Skip to content

Svelte Component for Graph Visualization Framework @antvis/g6

Notifications You must be signed in to change notification settings

AlbertAZ1992/svelte-g6

Repository files navigation

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: 400,
    height: 400,
    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} />

Edit compassionate-lalande-5lxm7

About

Svelte Component for Graph Visualization Framework @antvis/g6

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published