8.1.4 • Published 5 days ago

layercake v8.1.4

Weekly downloads
1,596
License
MIT
Repository
-
Last release
5 days ago

Layer Cake

a framework for mostly-reusable graphics with svelte

Tests badges npm version npm

🍰 See examples 🍰 Read the guide 🍰 API docs 🍰 View the Component Gallery 🍰 Try the starter template

Svelte versions

Works with Svelte 3 through 5. Note the library itself does not use runes but it is compatible with Svelte 5. This will change in future versions.

Install

npm install --save layercake

Example

<script>
  // The library provides a main wrapper component
  // and a bunch empty layout components...
  import { LayerCake, Svg, Html, Canvas } from 'layercake';

  // ...that you fill with your own chart components,
  // that live inside your project and which you
  // can copy and paste from here as starting points.
  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 }, { x: 2, y: 3 }];
</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>

License

MIT

8.1.4

5 days ago

8.1.3

5 days ago

8.1.2

17 days ago

8.1.0

2 months ago

8.1.1

2 months ago

8.0.3

2 months ago

8.0.1

7 months ago

8.0.0

8 months ago

8.0.2

7 months ago

7.6.1

10 months ago

7.6.0

11 months ago

7.5.0

11 months ago

7.4.0

1 year ago

7.3.1

1 year ago

7.3.0

1 year ago

7.3.5

1 year ago

7.3.4

1 year ago

7.3.3

1 year ago

7.3.2

1 year ago

7.2.3

1 year ago

7.2.2

1 year ago

7.2.1

1 year ago

7.2.0

1 year ago

7.1.0

2 years ago

6.1.2

2 years ago

6.1.1

2 years ago

7.0.0

2 years ago

5.0.3

2 years ago

5.0.2

2 years ago

6.1.0

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago

6.0.2

2 years ago

5.0.1

2 years ago

5.0.0

3 years ago

4.1.1

3 years ago

4.1.0

3 years ago

4.0.4

3 years ago

4.0.3

3 years ago

4.0.2

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.4.0

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.0

7 years ago