mirror of
https://gitee.com/antv/g6.git
synced 2024-12-01 19:28:39 +08:00
2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
(("undefined"!=typeof globalThis?globalThis:self)["makoChunk_@antv/g6-site"]=("undefined"!=typeof globalThis?globalThis:self)["makoChunk_@antv/g6-site"]||[]).push([["fff33d9f"],{"06c8bb2a":function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"texts",{enumerable:!0,get:function(){return a;}}),t("b1d1c242");let a=[{value:"createGraph(\n {\n data: {\n nodes: Array.from({ length: 10 }).map((_, i) => ({\n id: `node-${i}`,\n data: { category: i === 0 ? 'central' : 'around' },\n })),\n edges: Array.from({ length: 9 }).map((_, i) => ({ source: `node-0`, target: `node-${i + 1}` })),\n },\n node: {\n style: {\n size: 20,\n },\n palette: {\n field: 'category',\n color: 'tableau',\n },\n },\n edge: {\n style: {\n stroke: 'lightgreen',\n },\n },\n behaviors: ['drag-canvas', 'zoom-canvas', 'drag-element'],\n layout: {\n type: 'd3-force',\n },\n },\n { width: 200, height: 200 },\n);\n",paraId:0}];},"0b73e109":function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"texts",{enumerable:!0,get:function(){return a;}}),t("dc703ccb");let a=[{value:"createGraph(\n {\n data: {\n nodes: [\n { id: 'node-1', style: { x: 50, y: 50 } },\n { id: 'node-2', style: { x: 150, y: 50 } },\n ],\n edges: [{ source: 'node-1', target: 'node-2' }],\n },\n node: {\n type: (datum) => (datum.id === 'node-1' ? 'circle' : 'rect'),\n style: {\n fill: 'pink',\n size: 20,\n },\n },\n edge: {\n style: {\n stroke: 'lightgreen',\n },\n },\n behaviors: ['drag-canvas', 'zoom-canvas', 'drag-element'],\n },\n { width: 300, height: 200 },\n);\n",paraId:0}];},"13747ce4":function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"texts",{enumerable:!0,get:function(){return a;}}),t("9a243a9b");let a=[{value:"createGraph(\n {\n data: {\n nodes: new Array(6).fill(0).map((_, i) => ({ id: `node-${i}`, data: { category: ['A', 'B', 'C'][i % 3] } })),\n },\n layout: { type: 'grid', cols: 6 },\n node: {\n palette: {\n type: 'group',\n field: 'category',\n color: 'tableau',\n },\n },\n },\n { width: 200, height: 50 },\n);\n",paraId:0}];},"1a63caa3":function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"texts",{enumerable:!0,get:function(){return a;}}),t("dc032f13");let a=[{value:"createGraph(\n {\n data: {\n nodes: new Array(30).fill(0).map((_, i) => ({ id: `node-${i}` })),\n },\n layout: { type: 'grid', cols: 10, rows: 3 },\n node: {\n palette: 'spectral',\n },\n },\n { width: 400, height: 100 },\n);\n",paraId:0}];},"25c0c472":function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"texts",{enumerable:!0,get:function(){return a;}}),t("e05a8de6");let a=[{value:"createGraph(\n {\n data: {\n nodes: [\n { id: 'node-1', style: { x: 50, y: 50 } },\n { id: 'node-2', style: { x: 150, y: 50 } },\n ],\n edges: [{ source: 'node-1', target: 'node-2' }],\n },\n },\n { width: 200, height: 100 },\n);\n",paraId:0}];},"28eecdf4":function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"demos",{enumerable:!0,get:function(){return a;}}),t("78b3ac91"),t("56f8f4a7");let a={};},"2b77b478":function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"texts",{enumerable:!0,get:function(){return a;}}),t("b4a75f89");let a=[{value:"(() => {\n const { register, Circle, Graph } = window.g6;\n\n class BreathingCircle extends Circle {\n onCreate() {\n this.shapeMap.halo.animate([{ lineWidth: 5 }, { lineWidth: 10 }], {\n duration: 1000,\n iterations: Infinity,\n direction: 'alternate',\n });\n }\n }\n\n register('node', 'breathing-circle', BreathingCircle);\n\n const container = createContainer({ width: 50, height: 50 });\n\n const graph = new Graph({\n container,\n width: 50,\n height: 50,\n data: {\n nodes: [{ id: 'node-1', style: { x: 25, y: 25 } }],\n },\n node: {\n type: 'breathing-circle',\n style: {\n halo: true,\n haloLineWidth: 5,\n },\n },\n });\n\n graph.draw();\n\n return container;\n})();\n",paraId:0}];},"3d8e7f6c":function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"demos",{enumerable:!0,get:function(){return a;}}),t("78b3ac91"),t("b4a75f89");let a={};},"633596f9":function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"texts",{enumerable:!0,get:function(){return a;}}),t("51c8a05b");let a=[{value:"createGraph(\n {\n data: {\n nodes: Array.from({ length: 10 }).map((_, i) => ({\n id: `node-${i}`,\n data: { category: i === 0 ? 'central' : 'around' },\n })),\n edges: Array.from({ length: 9 }).map((_, i) => ({ source: `node-0`, target: `node-${i + 1}` })),\n },\n node: {\n style: {\n size: 20,\n },\n palette: {\n field: 'category',\n color: 'tableau',\n },\n },\n edge: {\n style: {\n stroke: 'lightgreen',\n },\n },\n behaviors: ['drag-canvas', 'zoom-canvas', 'drag-element'],\n layout: {\n type: 'd3-force',\n },\n plugins: ['grid-line'],\n },\n { width: 200, height: 200 },\n);\n",paraId:0}];},"64c77b43":function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"demos",{enumerable:!0,get:function(){return a;}}),t("78b3ac91"),t("dc032f13");let a={};},"6539c84e":function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"demos",{enumerable:!0,get:function(){return a;}}),t("78b3ac91"),t("8ce8dbc5");let a={};},"7543eb28":function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"demos",{enumerable:!0,get:function(){return a;}}),t("78b3ac91"),t("d4c5c981");let a={};},"78af187b":function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"texts",{enumerable:!0,get:function(){return a;}}),t("d4c5c981");let a=[{value:"createGraph(\n {\n data: {\n nodes: Array.from({ length: 10 }).map((_, i) => ({\n id: `node-${i}`,\n data: { category: i === 0 ? 'central' : 'around' },\n })),\n edges: Array.from({ length: 9 }).map((_, i) => ({ source: `node-0`, target: `node-${i + 1}` })),\n },\n node: {\n style: {\n size: 20,\n },\n palette: {\n field: 'category',\n color: 'tableau',\n },\n },\n edge: {\n style: {\n stroke: 'lightgreen',\n },\n },\n behaviors: ['drag-canvas', 'zoom-canvas', 'drag-element'],\n layout: {\n type: 'd3-force',\n },\n plugins: [{ type: 'grid-line', follow: true }],\n },\n { width: 200, height: 200 },\n);\n",paraId:0}];},"7ace787c":function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"demos",{enumerable:!0,get:function(){return a;}}),t("78b3ac91"),t("dc703ccb");let a={};},"7ec60136":function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"demos",{enumerable:!0,get:function(){return a;}}),t("78b3ac91"),t("89c3aa45");let a={};},"828e4cd1":function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"demos",{enumerable:!0,get:function(){return a;}}),t("78b3ac91"),t("e05a8de6");let a={};},a3eb22ee:function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"texts",{enumerable:!0,get:function(){return a;}}),t("8923f298");let a=[{value:"createGraph(\n {\n data: {\n nodes: new Array(6).fill(0).map((_, i) => ({ id: `node-${i}`, data: { value: (i + 1) * 20 } })),\n },\n layout: { type: 'grid', cols: 6 },\n node: {\n palette: {\n type: 'value',\n field: 'value',\n color: (value) => `rgb(${value * 255}, 0, 0)`,\n },\n },\n },\n { width: 200, height: 50 },\n);\n",paraId:0}];},afc72b1b:function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"demos",{enumerable:!0,get:function(){return a;}}),t("78b3ac91"),t("51c8a05b");let a={};},bc10f285:function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"demos",{enumerable:!0,get:function(){return a;}}),t("78b3ac91"),t("c21cd92a");let a={};},c2e76c21:function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"demos",{enumerable:!0,get:function(){return a;}}),t("78b3ac91"),t("b1d1c242");let a={};},c9cf6b64:function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"texts",{enumerable:!0,get:function(){return a;}}),t("8ce8dbc5");let a=[{value:"createGraph(\n {\n data: {\n nodes: Array.from({ length: 10 }).map((_, i) => ({ id: `node-${i}` })),\n edges: Array.from({ length: 9 }).map((_, i) => ({ source: `node-0`, target: `node-${i + 1}` })),\n },\n node: {\n style: {\n size: 20,\n fill: 'pink',\n },\n },\n edge: {\n style: {\n stroke: 'lightgreen',\n },\n },\n behaviors: ['drag-canvas', 'zoom-canvas', 'drag-element'],\n layout: {\n type: 'd3-force',\n },\n },\n { width: 200, height: 200 },\n);\n",paraId:0}];},cb13e9e3:function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"demos",{enumerable:!0,get:function(){return a;}}),t("78b3ac91"),t("8923f298");let a={};},cb474ccf:function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"texts",{enumerable:!0,get:function(){return a;}}),t("89c3aa45");let a=[{value:"fetch('https://assets.antv.antgroup.com/g6/graph.json')\n .then((res) => res.json())\n .then((data) =>\n createGraph(\n {\n data,\n autoFit: 'view',\n animation: false,\n node: {\n style: {\n size: 10,\n },\n palette: {\n field: 'group',\n color: 'tableau',\n },\n },\n layout: {\n type: 'd3-force',\n animation: false,\n manyBody: {},\n x: {},\n y: {},\n },\n behaviors: ['drag-canvas', 'zoom-canvas', 'drag-element'],\n },\n { width: 500, height: 500 },\n ),\n );\n",paraId:0}];},cbaf9562:function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"demos",{enumerable:!0,get:function(){return a;}}),t("78b3ac91"),t("3d5f603a");let a={};},d4a62b74:function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"texts",{enumerable:!0,get:function(){return a;}}),t("c21cd92a");let a=[{value:"(() => {\n const { register, Line, Graph } = window.g6;\n\n class AntLine extends Line {\n onCreate() {\n this.shapeMap.key.animate([{ lineDashOffset: 20 }, { lineDashOffset: 0 }], {\n duration: 500,\n iterations: Infinity,\n });\n }\n }\n\n register('edge', 'ant-line', AntLine);\n\n const container = createContainer({ width: 200, height: 50 });\n\n const graph = new Graph({\n container,\n width: 200,\n height: 50,\n data: {\n nodes: [\n { id: 'node-1', style: { x: 25, y: 25 } },\n { id: 'node-2', style: { x: 175, y: 25 } },\n ],\n edges: [{ source: 'node-1', target: 'node-2', style: { lineDash: [10, 10] } }],\n },\n edge: {\n type: 'ant-line',\n },\n });\n\n graph.draw();\n\n return container;\n})();\n",paraId:0}];},e565335c:function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"demos",{enumerable:!0,get:function(){return a;}}),t("78b3ac91"),t("9a243a9b");let a={};},ed86063c:function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"texts",{enumerable:!0,get:function(){return a;}}),t("3d5f603a");let a=[{value:"import { Graph, treeToGraphData } from '@antv/g6';\n\nconst data = {\n id: 'root',\n children: [\n { id: 'node1', children: [{ id: 'node1-1' }, { id: 'node1-2' }] },\n { id: 'node2', children: [{ id: 'node2-1' }, { id: 'node2-2' }] },\n ],\n};\n\nconst graph = new Graph({\n container: 'container',\n layout: {\n type: 'compact-box',\n direction: 'TB',\n },\n data: treeToGraphData(data),\n edge: {\n type: 'cubic-vertical',\n },\n});\n\ngraph.render();\n",paraId:0},{value:"createGraph(\n {\n autoFit: 'view',\n data: g6.treeToGraphData({\n id: 'root',\n children: [\n { id: 'node1', children: [{ id: 'node1-1' }, { id: 'node1-2' }] },\n { id: 'node2', children: [{ id: 'node2-1' }, { id: 'node2-2' }] },\n ],\n }),\n layout: {\n type: 'compact-box',\n direction: 'TB',\n },\n node: {\n style: {\n ports: [{ placement: 'center' }],\n },\n },\n edge: {\n type: 'cubic-vertical',\n },\n },\n { width: 200, height: 200 },\n);\n",paraId:1}];},ee2f345b:function(e,n,t){"use strict";t.d(n,"__esModule",{value:!0}),t.d(n,"texts",{enumerable:!0,get:function(){return a;}}),t("56f8f4a7");let a=[{value:"module.exports = {\n entry: './src/index.js',\n output: {\n path: path.resolve(__dirname, 'dist'),\n filename: 'index.js',\n },\n module: {\n rules: [\n {\n test: /\\.js$/,\n use: {\n loader: 'babel-loader',\n options: {\n presets: ['@babel/preset-env'],\n },\n },\n },\n {\n test: /\\.js$/,\n loader: '@open-wc/webpack-import-meta-loader',\n },\n ],\n },\n mode: 'production',\n};\n",paraId:0}];}}]);
|
|
//# sourceMappingURL=fff33d9f-async.b61d0899.js.map
|