layercake

graphics framework for sveltejs

Github星跟蹤圖

Layer Cake

a framework for mostly-reusable graphics with svelte

Travis (.org) branch npm version

? See examples
? Read the guide
? API docs
? Starter template
?

Example

<script>
  import { LayerCake, Svg, Html, Canvas } from 'layercake';

  import AxisX from './components/AxisX.svelte';
  import AxisY from './components/AxisY.svelte';
  import Line from './components/Line.svelte';
  import Scatter from './components/Scatter.svelte';
  import Labels from './components/Labels.svelte';

  const data = [{ x: 0, y: 1 }, { x: 1, y: 2 }];
</script>

<style>
  .chart-container {
    width: 100%;
    height: 500px;
  }
</style>

<div class="chart-container">
  <LayerCake
    x='x'
    y='y'
    {data}
  >
    <Svg>
      <AxisX/>
      <AxisY/>
      <Line color='#f0c'/>
    </Svg>

    <Canvas>
      <Scatter color='#0fc'/>
    </Canvas>

    <Html>
      <Labels/>
    </Html>
  </LayerCake>
</div>

Install

Layer Cake lives in your devDependencies alongside Svelte, which it lists as a peerDependency.

npm install --save-dev layercake

License

MIT

主要指標

概覽
名稱與所有者mhkeller/layercake
主編程語言Svelte
編程語言JavaScript (語言數: 5)
平台
許可證MIT License
所有者活动
創建於2018-07-17 06:49:33
推送於2025-10-01 12:55:11
最后一次提交
發布數68
最新版本名稱v10.0.1 (發布於 2025-08-24 14:22:19)
第一版名稱v0.1.0 (發布於 2018-10-17 23:13:33)
用户参与
星數1.7k
關注者數9
派生數37
提交數1.2k
已啟用問題?
問題數133
打開的問題數2
拉請求數153
打開的拉請求數2
關閉的拉請求數44
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?