diff --git a/demos/gallery-graphanalyzer.html b/demos/gallery-graphanalyzer.html index 54bae54f2..1205ef68c 100644 --- a/demos/gallery-graphanalyzer.html +++ b/demos/gallery-graphanalyzer.html @@ -10,6 +10,7 @@ + @@ -132,7 +133,6 @@ if (minimap !== undefined) minimap.style.display = 'none'; if (legend !== undefined) legend.style.display = 'none'; }); - diff --git a/plugins/layout.forceAtlas2/layout.js b/plugins/layout.forceAtlas2/layout.js index 63a044138..4387df214 100644 --- a/plugins/layout.forceAtlas2/layout.js +++ b/plugins/layout.forceAtlas2/layout.js @@ -195,6 +195,7 @@ class Layout { worker.terminate(); loading.style.display = 'none'; onLayoutComplete(); + }; } } diff --git a/plugins/template.maxSpanningForest/README.md b/plugins/template.maxSpanningForest/README.md new file mode 100644 index 000000000..e06a7d4a5 --- /dev/null +++ b/plugins/template.maxSpanningForest/README.md @@ -0,0 +1,43 @@ +## maxSpanningForest + +template.maxSpanningForest for jiuselu graph analyzer, which is a plugin for graph. This is a collection of fundamental functions, including: +- the style of the nodes and graphs, +- extracting max spanning forest, +- Force Atlas 2 layout algorithm( with webworker ), +- interactions + - extracting subgraph + - highlight subgraph + - fisheye lens + - onclick + - menu operations + +parameter for this plugin: +- layoutCfg: the configuration for layout. + - max_iteration: the number of iteration for terminating the layout algorithm + - kg: the gravity parameter for layout. The larger kg, more compact the graph, expecialy for the isolated subgraphs. + - prev_overlapping: whether preventing the node overlapping + - onLayoutComplete: a listener for layout completement. When the layout is complete, the loading div and img disappear. + +## use + +simple use. + +```js +const MaxSpanningForestPlugin = G6.Plugins['template.maxSpanningForest']; +//the instances of plugins +const maxSpanningForest = new MaxSpanningForestPlugin({ + layoutCfg: { + max_iteration: 600, + kg: 10, + prev_overlapping: true, + onLayoutComplete: function () { + const minimap = document.getElementById('minimap'); + const legend = document.getElementById('legend'); + if (minimap !== undefined) minimap.style.display = 'block'; + if (legend !== undefined) legend.style.display = 'block'; + } + } +}); + + +``` \ No newline at end of file diff --git a/plugins/tool.mapper/index.js b/plugins/tool.mapper/index.js index 90a7d6c12..cab3a0d1f 100644 --- a/plugins/tool.mapper/index.js +++ b/plugins/tool.mapper/index.js @@ -11,6 +11,7 @@ const Size = require('@antv/g2/src/component/legend/size'); const Attr = require('@antv/attr'); const Util = G6.Util; const Scale = require('@antv/scale'); + class Plugin { constructor(itemType, dim, channel, range, otherCfg) { Util.mix(this, {