SOURCE

console 命令行工具 X clear

                    
>
console
const data = {
  nodes: [
    {
      id: "node1",
      label: "Circle1",
      x: 0,
      y: 0
    }
  ]
};

const graph = new G6.Graph({
  container: "container",
  width: 500,
  height: 500,
  defaultNode: {
    type: "rect",
    size: [100],
    color: "#5B8FF9",
    style: {
      fill: "#9EC9FF",
      lineWidth: 3
    },
    labelCfg: {
      style: {
        fill: "#fff",
        fontSize: 20
      }
    }
  },
  defaultEdge: {
    style: {
      stroke: "#e2e2e2"
    }
  }
});

graph.data(data);
graph.render();
<script src="https://gw.alipayobjects.com/os/lib/antv/g6/4.0.3/dist/g6.min.js"></script>

<div id="container" />