svelte-g6
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

svelte-g6

A Svelte component for @antv/g6

Inspired by g6-in-react

minified + gzip tree-shakeable no dependencies

Installation

yarn add svelte-g6
# or
npm install --save svelte-g6

Usage

<!-- App.svelte -->
<script lang="ts">
  import G6 from '@antv/g6';
  import G6Component from 'svelte-g6';
  const options = {
    container: 'mountNode',
    width: 800,
    height: 500,
    workerEnabled: false,
  };
  const data = {
    nodes: [
      {
        id: 'node1',
        x: 100,
        y: 200,
        },
      {
        id: 'node2',
        x: 300,
        y: 200,
      },
    ],
    edges: [
      {
        source: 'node1',
        target: 'node2',
      },
    ],
  };
</script>
<G6Component {G6} {options} {data} />

Dependencies (0)

    Dev Dependencies (12)

    Package Sidebar

    Install

    npm i svelte-g6

    Weekly Downloads

    2

    Version

    0.0.4

    License

    ISC

    Unpacked Size

    15.9 kB

    Total Files

    9

    Last publish

    Collaborators

    • albertaz777