Get started with antv-x6 CDN

MIT licensed

AntV-X6: library for large-scale data visualization with interactive, data-driven graphics.

Tags:
  • graph
  • diagram
  • flowchart
  • uml
  • x6-editor
  • editor
  • svg
  • x6
  • antv

Stable version

Copied!

How to start using antv-x6 CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with antv-x6 CDN - cdnhub.io</title>
  <style>
    #graph {
      width: 100%;
      height: 100%;
    }
  </style>
</head>
<body>
  <div id="graph"></div>
  <script src="https://cdn.jsdelivr.net/npm/babel-polyfill@7.12.1/dist/polyfill.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/rxjs@6.5.4/bundles/rxjs.umd.min.js"></script>
  <script src="https://cdn.cdnhub.io/antv-x6/3.0.0/index.js"></script>
  <script>
    const graph = new G6.Graph({
      container: 'graph',
      width: 800,
      height: 600,
      layout: {
        type: 'force',
        linkDistance: 50,
        nodeDistanceX: 100,
        nodeDistanceY: 100,
      },
      modes: {
        default: ['drag-canvas'],
      },
    });

    const data = {
      nodes: [
        { id: 1, x: 200, y: 200 },
        { id: 2, x: 400, y: 200 },
        { id: 3, x: 600, y: 200 },
      ],
      edges: [
        { source: 1, target: 2 },
        { source: 1, target: 3 },
      ],
    };

    graph.data(data);
    graph.render();
  </script>
</body>
</html>
Copied!
Copied!

All versions

1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.10.0 1.10.1 1.10.2 1.11.0 1.11.1 1.11.2 1.11.3 1.11.6 1.12.0 1.12.1 1.12.10 1.12.11 1.12.12 1.12.13 1.12.14 1.12.16 1.12.17 1.12.18 1.12.19 1.12.2 1.12.20 1.12.21 1.12.22 1.12.23 1.12.24 1.12.25 1.12.26 1.12.27 1.12.28 1.12.29 1.12.3 1.12.30 1.12.31 1.12.32 1.12.4 1.12.5 1.12.6 1.12.7 1.12.8 1.12.9 1.13.0 1.13.1 1.13.3 1.13.4 1.14.0 1.16.0 1.17.0 1.17.1 1.17.2 1.17.3 1.17.4 1.17.5 1.17.6 1.17.7 1.18.0 1.18.1 1.18.3 1.18.4 1.18.5 1.18.6-beta.1 1.19.0 1.19.1 1.19.2 1.19.3 1.19.4 1.19.5 1.19.6 1.2.1 1.2.2 1.2.3 1.20.0 1.21.0 1.21.1 1.21.2 1.21.3 1.21.4 1.21.5 1.21.6 1.21.7 1.22.0 1.22.1 1.23.0 1.23.1 1.23.10 1.23.12 1.23.13 1.23.2 1.23.3 1.23.4 1.23.6 1.23.7 1.23.8 1.24.0 1.24.1 1.24.2 1.24.3 1.24.4 1.24.5 1.24.6 1.24.7 1.24.8 1.25.0 1.25.1 1.25.2 1.25.3 1.25.5 1.26.0 1.26.1 1.26.2 1.27.0 1.27.1 1.27.2 1.28.0 1.28.1 1.29.0 1.29.1 1.29.2 1.29.3 1.29.4 1.29.5 1.29.6 1.3.0 1.3.1 1.3.10 1.3.11 1.3.12 1.3.15 1.3.16 1.3.17 1.3.18 1.3.19 1.3.2 1.3.20 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.30.0 1.30.1 1.30.2 1.31.0 1.31.1 1.31.2 1.31.3 1.31.4 1.31.5 1.32.0 1.32.1 1.32.10 1.32.10-beta 1.32.11 1.32.12-beta 1.32.2 1.32.3 1.32.3-beta.1 1.32.4 1.32.5 1.32.6 1.32.7 1.32.8 1.32.9 1.33.0 1.33.1 1.34.0 1.34.1 1.34.10 1.34.11 1.34.12 1.34.13 1.34.14 1.34.2 1.34.3 1.34.5 1.34.6 1.34.8 1.34.9 1.35.0 1.35.1 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.6.3 1.7.1 1.7.10 1.7.11 1.7.12 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 1.7.8 1.7.9 1.8.0 1.8.1 1.9.0 1.9.1 1.9.2 1.9.3 2.0.0 2.0.0-beta.1 2.0.0-beta.2 2.0.0-beta.3 2.0.0-beta.4 2.0.0-beta.5 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.6-beta.15 2.0.6-beta.16 2.0.6-beta.18 2.0.6-beta.20 2.0.6-beta.21 2.0.6-beta.25 2.0.6-beta.26 2.0.6-beta.7 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.10.1 2.11.1 2.11.2 2.11.3 2.11.4 2.11.5 2.12.1 2.13.1 2.14.1 2.15.1 2.15.2 2.15.3 2.15.4 2.15.5 2.15.6 2.16.1 2.17.1 2.18.1 2.2.0 2.2.1 2.3.0 2.4.0 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.6.1 2.7.1 2.8.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 *** 3.0.0