Explorar o código

chore(plugin): require g6 by src/index

huangtong.ht %!s(int64=7) %!d(string=hai) anos
pai
achega
095e3f6356

+ 3 - 0
.eslintrc

@@ -35,6 +35,9 @@
     ],
     "linebreak-style": [
       0
+    ],
+    "no-loop-func": [
+      0
     ]
   }
 }

+ 1 - 1
package.json

@@ -98,7 +98,7 @@
     "screenshot": "node ./bin/screenshot.js",
     "start": "npm run dev",
     "test": "torch --compile --renderer --recursive ./test/unit",
-    "test-live": "torch --compile --interactive --watch --recursive ./test/unit/graph-spec.js",
+    "test-live": "torch --compile --interactive --watch --recursive ./test/bugs/issue-308-spec.js",
     "watch": "webpack --config webpack-dev.config.js",
     "win-dev": "node ./bin/win-dev.js"
   },

+ 1 - 1
plugins/behaviour.analysis/index.js

@@ -2,7 +2,7 @@
  * @fileOverview 拓展分析交互
  * @author huangtonger@aliyun.com
  */
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 
 function panCanvas(graph, button = 'left') {
   let lastPoint;

+ 1 - 1
plugins/edge.quadraticCurve/index.js

@@ -4,7 +4,7 @@
  * cpd control point distance detail {number} could be 0 ~ 1
  * @author huangtonger@aliyun.com
  */
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 const Util = G6.Util;
 
 G6.registerEdge('quadraticCurve', {

+ 1 - 1
plugins/layout.archimeddeanSpiral/index.js

@@ -3,7 +3,7 @@
  * @author huangtonger@aliyun.com
  */
 
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 const Layout = require('./layout');
 
 G6.Layouts.ArchimeddeanSpiral = Layout;

+ 1 - 1
plugins/layout.archimeddeanSpiral/layout.js

@@ -3,7 +3,7 @@
  * https://zh.wikipedia.org/wiki/%E9%98%BF%E5%9F%BA%E7%B1%B3%E5%BE%B7%E8%9E%BA%E7%BA%BF
  * @author huangtonger@aliyun.com
  */
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 const Util = G6.Util;
 
 class Layout {

+ 1 - 1
plugins/layout.circle/index.js

@@ -3,7 +3,7 @@
  * @author huangtonger@aliyun.com
  */
 
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 const Layout = require('./layout');
 
 G6.Layouts.Circle = Layout;

+ 1 - 1
plugins/layout.circle/layout.js

@@ -2,7 +2,7 @@
  * @fileOverview 圆形布局
  * @author huangtonger@aliyun.com
  */
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 const Util = G6.Util;
 
 

+ 1 - 1
plugins/layout.dagre/index.js

@@ -2,7 +2,7 @@
  * @fileOverview DAG 分层布局
  * @author huangtonger@aliyun.com
  */
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 const Layout = require('./layout');
 
 G6.Layouts.Dagre = Layout;

+ 1 - 1
plugins/layout.dagre/layout.js

@@ -3,7 +3,7 @@
  * dagre layout wiki: https://github.com/cpettitt/dagre/wiki
  * @author huangtonger@aliyun.com
  */
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 const dagre = require('dagre');
 const { Util } = G6;
 

+ 1 - 1
plugins/layout.grid/index.js

@@ -2,7 +2,7 @@
  * @fileOverview 栅格布局
  * @author huangtonger@aliyun.com
  */
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 const Layout = require('./layout');
 
 G6.Layouts.Grid = Layout;

+ 1 - 1
plugins/layout.grid/layout.js

@@ -2,7 +2,7 @@
  * @fileOverview 栅格布局
  * @author huangtonger@aliyun.com
  */
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 const Util = G6.Util;
 
 class Layout {

+ 1 - 1
plugins/template.maxSpanningForest/index.js

@@ -10,7 +10,7 @@
  * node.rank  分层权重
  * node.label 节点标签
  */
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 const maxSpanningForest = require('./maxSpanningForest');
 const d3 = require('d3');
 const { forceSimulation, forceLink, forceManyBody, forceCenter, forceCollide } = d3;

+ 1 - 1
plugins/template.maxSpanningForest/maxSpanningForest.js

@@ -2,7 +2,7 @@
  * @fileOverview 最大生成森林
  * @author huangtonger@aliyun.com
  */
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 const { Util } = G6;
 const maxSpanningTree = require('./maxSpanningTree');
 

+ 1 - 1
plugins/template.maxSpanningForest/maxSpanningTree.js

@@ -3,7 +3,7 @@
  * https://zh.wikipedia.org/wiki/%E6%99%AE%E6%9E%97%E5%A7%86%E7%AE%97%E6%B3%95
  * @author huangtonger@aliyun.com
  */
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 const { Util } = G6;
 
 let treeNodes = [];

+ 1 - 1
plugins/tool.d3.mapper/index.js

@@ -4,7 +4,7 @@
  * d3-legend https://github.com/susielu/d3-legend
  * @author huangtonger@aliyun.com
  */
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 const d3 = require('d3');
 const Util = G6.Util;
 const DEFAULT_LEGEND_FILL = '#199CFB';

+ 1 - 1
plugins/tool.minimap/index.js

@@ -2,7 +2,7 @@
  * @fileOverview 缩略图
  * @author huangtonger@aliyun.com
  */
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 const Minimap = require('./minimap');
 
 class Plugin {

+ 1 - 1
plugins/tool.minimap/minimap.js

@@ -2,7 +2,7 @@
  * @fileOverview minimap
  * @author huangtonger@aliyun.com
  */
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 const { Util, G } = G6;
 const Canvas = G.Canvas;
 

+ 1 - 1
plugins/util.randomData/index.js

@@ -2,7 +2,7 @@
  * @fileOverview 模拟数据生成的工具
  * @author huangtonger@aliyun.com
  */
-const G6 = require('@antv/g6');
+const G6 = require('../../src/index');
 const Util = G6.Util;
 const randomData = {
   // 生成链式图数据

+ 0 - 0
test/bugs/issue-308-spec.js


+ 2 - 1
webpack.config.js

@@ -27,7 +27,8 @@ module.exports = {
     path: resolve(__dirname, 'build/')
   },
   externals: {
-    '@antv/g6': 'G6'
+    '@antv/g6': 'G6',
+    '../../src/index': 'G6'
   },
   module: {
     rules: [