mirror of
https://gitee.com/antv/g6.git
synced 2024-11-30 02:38:20 +08:00
Release 2.0.4
This commit is contained in:
parent
163c77d498
commit
a111948668
13
CHANGELOG.md
13
CHANGELOG.md
@ -1,8 +1,19 @@
|
||||
|
||||
# ChangeLog
|
||||
|
||||
---
|
||||
|
||||
#### 2.0.4
|
||||
|
||||
`2018-07-12`
|
||||
|
||||
* feat: layout export group.Closes #355
|
||||
* feat(plugin): add tool.tooltip. Closes #360.
|
||||
* style: change the calling way of forceAtlas2 on template.maxSpanningForest
|
||||
* fix: origin tree data collapsed is true tree edge visible bug.Closes #357
|
||||
* fix: remove the forceAtlas.js in template.maxSpanningForest, use forceAtlas from layout.forceAtlas2
|
||||
* fix: add demos: plugin-fisheye, plugin-forceAtlas2, gallery-graphanalyzer
|
||||
* fix: add demos: plugin-forceAtlas2, plugin-fisheye
|
||||
|
||||
#### 2.0.3
|
||||
|
||||
`2018-06-29`
|
||||
|
@ -5,14 +5,12 @@
|
||||
<meta content="origin" name="referrer">
|
||||
<title>test shiwu</title>
|
||||
<script src="../build/g6.js"></script>
|
||||
<script src="../build/templateMaxSpanningForest.js"></script>
|
||||
<script src="../build/layoutForceAtlas2.js"></script>
|
||||
<script src="../build/behaviourAnalysis.js"></script>
|
||||
<script src="../build/plugin.template.maxSpanningForest.js"></script>
|
||||
<script src="../build/plugin.layout.forceAtlas2.js"></script>
|
||||
<script src="../build/plugin.behaviour.analysis.js"></script>
|
||||
<script src="../build/plugin.tool.d3.mapper.js"></script>
|
||||
<script src="../build/plugin.tool.fisheye.js"></script>
|
||||
<script src="./assets/jquery-3.2.1.min.js"></script>
|
||||
<script src="../build/toolD3Mapper.js"></script>
|
||||
<script src="../build/toolFisheye.js"></script>
|
||||
|
||||
|
||||
<style>
|
||||
ul, li {
|
||||
margin: 0;
|
||||
@ -65,9 +63,8 @@
|
||||
|
||||
var graph = null;
|
||||
var clickOnNode = null;
|
||||
// $.getJSON('../../test/fixtures/viralMarketing.json', data => {
|
||||
$.getJSON('../../test/fixtures/view-test.json', data => {
|
||||
const Mapper = window.ToolD3Mapper;
|
||||
$.getJSON('./assets/data/view-test.json', data => {
|
||||
const Mapper = G6.Plugins['tool.d3.mapper'];
|
||||
const Plugin = G6.Plugins['template.maxSpanningForest'];
|
||||
// const Plugin = G6.Plugins['layout.forceAtlas2'];
|
||||
const FisheyePlugin = G6.Plugins['tool.fisheye'];
|
||||
@ -147,7 +144,6 @@
|
||||
}
|
||||
});
|
||||
subGraph.read(sub_data);
|
||||
console.log(subGraph);
|
||||
}
|
||||
|
||||
function clickDCmap() {
|
||||
|
@ -21,7 +21,7 @@
|
||||
<script src="./assets/jquery-3.2.1.min.js"></script>
|
||||
<script src="./assets/d3-4.13.0.min.js"></script>
|
||||
<script src="../build/g6.js"></script>
|
||||
<script src="../build/toolD3Mapper.js"></script>
|
||||
<script src="../build/plugin.tool.d3.mapper.js"></script>
|
||||
<script>
|
||||
$.getJSON('./assets/data/university.json', data => {
|
||||
const Mapper = window.ToolD3Mapper;
|
||||
|
@ -16,12 +16,12 @@
|
||||
<script src="./assets/d3-4.13.0.min.js"></script>
|
||||
<script src="./assets/d3-legend-2.25.6.min.js"></script>
|
||||
<script src="../build/g6.js"></script>
|
||||
<script src="../build/layoutCircle.js"></script>
|
||||
<script src="../build/layoutDagre.js"></script>
|
||||
<script src="../build/layoutGrid.js"></script>
|
||||
<script src="../build/layoutArchimeddeanSpiral.js"></script>
|
||||
<script src="../build/toolD3Mapper.js"></script>
|
||||
<script src="../build/templateMaxSpanningForest.js"></script>
|
||||
<script src="../build/plugin.layout.circle.js"></script>
|
||||
<script src="../build/plugin.layout.dagre.js"></script>
|
||||
<script src="../build/plugin.layout.grid.js"></script>
|
||||
<script src="../build/plugin.layout.archimeddeanSpiral.js"></script>
|
||||
<script src="../build/plugin.tool.d3.mapper.js"></script>
|
||||
<script src="../build/plugin.template.maxSpanningForest.js"></script>
|
||||
<script>
|
||||
$.getJSON('./assets/data/g6-index.json', data => {
|
||||
const Template = G6.Plugins['template.maxSpanningForest'];
|
||||
|
@ -11,7 +11,7 @@
|
||||
<body>
|
||||
<div id="mountNode"></div>
|
||||
<script src="../build/g6.js"></script>
|
||||
<script src="../build/g6Plugins.js"></script>
|
||||
<script src="../build/plugins.js"></script>
|
||||
<script>
|
||||
G6.registerNode('rect', {
|
||||
getPath(item) {
|
||||
|
@ -19,8 +19,8 @@
|
||||
<script src="./assets/d3-4.13.0.min.js"></script>
|
||||
<script src="./assets/d3-legend-2.25.6.min.js"></script>
|
||||
<script src="../build/g6.js"></script>
|
||||
<script src="../build/behaviourAnalysis.js"></script>
|
||||
<script src="../build/toolD3Mapper.js"></script>
|
||||
<script src="../build/plugin.behaviour.analysis.js"></script>
|
||||
<script src="../build/plugin.tool.d3.mapper.js"></script>
|
||||
<script>
|
||||
$.getJSON('./assets/data/xiaomi.json', data => {
|
||||
const Mapper = window.ToolD3Mapper;
|
||||
|
@ -11,7 +11,7 @@
|
||||
<body>
|
||||
<div id="mountNode"></div>
|
||||
<script src="../build/g6.js"></script>
|
||||
<script src="../build/utilRandomData.js"></script>
|
||||
<script src="../build/plugin.util.randomData.js"></script>
|
||||
<script>
|
||||
const Util = G6.Util;
|
||||
const data = Util.createChainData(50);
|
||||
|
@ -14,8 +14,8 @@
|
||||
<button id="layout">整理布局</button>
|
||||
<div id="mountNode"></div>
|
||||
<script src="../build/g6.js"></script>
|
||||
<script src="../build/utilRandomData.js"></script>
|
||||
<script src="../build/behaviourAnalysis.js"></script>
|
||||
<script src="../build/plugin.util.randomData.js"></script>
|
||||
<script src="../build/plugin.behaviour.analysis.js"></script>
|
||||
<script>
|
||||
const Util = G6.Util;
|
||||
const data = Util.createChainData(50);
|
||||
|
@ -11,8 +11,8 @@
|
||||
<body>
|
||||
<div id="mountNode"></div>
|
||||
<script src="../build/g6.js"></script>
|
||||
<script src="../build/utilRandomData.js"></script>
|
||||
<script src="../build/layoutArchimeddeanSpiral.js"></script>
|
||||
<script src="../build/plugin.util.randomData.js"></script>
|
||||
<script src="../build/plugin.layout.archimeddeanSpiral.js"></script>
|
||||
<script>
|
||||
const Plugin = G6.Plugins['layout.archimeddeanSpiral'];
|
||||
const Util = G6.Util;
|
||||
|
@ -11,17 +11,16 @@
|
||||
<body>
|
||||
<div id="mountNode"></div>
|
||||
<script src="../build/g6.js"></script>
|
||||
<script src="../build/utilRandomData.js"></script>
|
||||
<script src="../build/layoutCircle.js"></script>
|
||||
<script src="../build/plugin.util.randomData.js"></script>
|
||||
<script src="../build/plugin.layout.circle.js"></script>
|
||||
<script>
|
||||
const Plugin = window.LayoutCircle;
|
||||
const Util = G6.Util;
|
||||
const data = Util.createCyclicData(30);
|
||||
const graph = new G6.Graph({
|
||||
container: 'mountNode',
|
||||
fitView: 'cc',
|
||||
height: window.innerHeight,
|
||||
plugins: [new Plugin()]
|
||||
plugins: [new G6.Plugins['layout.circle']()]
|
||||
});
|
||||
graph.node({
|
||||
size: 16
|
||||
|
@ -6,8 +6,8 @@
|
||||
<title>plugin-fisheye</title>
|
||||
<script src="../build/g6.js"></script>
|
||||
<script src="./assets/jquery-3.2.1.min.js"></script>
|
||||
<script src="../build/toolFisheye.js"></script>
|
||||
<script src="../build/utilRandomData.js"></script>
|
||||
<script src="../build/plugin.tool.fisheye.js"></script>
|
||||
<script src="../build/plugin.util.randomData.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<meta content="origin" name="referrer">
|
||||
<title>plugin-forceAtlas2</title>
|
||||
<script src="../build/g6.js"></script>
|
||||
<script src="../build/layoutForceAtlas2.js"></script>
|
||||
<script src="../build/plugin.layout.forceAtlas2.js"></script>
|
||||
<script src="./assets/jquery-3.2.1.min.js"></script>
|
||||
|
||||
</head>
|
||||
@ -43,7 +43,6 @@
|
||||
}
|
||||
});
|
||||
graph.read(data);
|
||||
graph.setFitView('autoZoom');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<body>
|
||||
<div id="mountNode"></div>
|
||||
<script src="../build/g6.js"></script>
|
||||
<script src="../build/templateMaxSpanningForest.js"></script>
|
||||
<script src="../build/plugin.template.maxSpanningForest.js"></script>
|
||||
<script>
|
||||
const plugin = new G6.Plugins['template.maxSpanningForest']();
|
||||
const data = {
|
||||
|
@ -14,7 +14,7 @@
|
||||
<div id="minimap" style="border: 1px solid #999; position: absolute; top: 0px;"></div>
|
||||
</div>
|
||||
<script src="../build/g6.js"></script>
|
||||
<script src="../build/toolMinimap.js"></script>
|
||||
<script src="../build/plugin.tool.minimap.js"></script>
|
||||
<script>
|
||||
const plugin = new G6.Plugins['tool.minimap']({
|
||||
container: 'minimap',
|
||||
|
@ -11,7 +11,7 @@
|
||||
<body>
|
||||
<div id="mountNode"></div>
|
||||
<script src="../build/g6.js"></script>
|
||||
<script src="../build/edgeQuadraticCurve.js"></script>
|
||||
<script src="../build/plugin.edge.quadraticCurve.js"></script>
|
||||
<script>
|
||||
const data = {
|
||||
nodes: [{
|
||||
|
@ -11,7 +11,7 @@
|
||||
<body>
|
||||
<div id="mountNode"></div>
|
||||
<script src="../build/g6.js"></script>
|
||||
<script src="../build/toolTooltip.js"></script>
|
||||
<script src="../build/plugin.tool.tooltip.js"></script>
|
||||
<script>
|
||||
const plugin = new G6.Plugins['tool.tooltip']();
|
||||
const data = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@antv/g6",
|
||||
"version": "2.0.4-beta.4",
|
||||
"version": "2.0.4",
|
||||
"description": "graph visualization frame work",
|
||||
"main": "build/g6.js",
|
||||
"homepage": "https://github.com/antvis/g6",
|
||||
@ -119,4 +119,4 @@
|
||||
"engines": {
|
||||
"node": ">=8.9.0"
|
||||
}
|
||||
}
|
||||
}
|
@ -102,14 +102,13 @@ class Graph extends Base {
|
||||
* @type {string}
|
||||
*/
|
||||
defaultIntersectBox: 'circle',
|
||||
firstRender: true,
|
||||
render: 'canvas',
|
||||
_controllers: {},
|
||||
_timers: {},
|
||||
_dataMap: {},
|
||||
_itemMap: {},
|
||||
_data: {},
|
||||
_delayRunObj: {},
|
||||
render: 'canvas'
|
||||
_delayRunObj: {}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
module.exports = '2.0.4-beta.4';
|
||||
module.exports = '2.0.4';
|
||||
|
537
test/fixtures/view-test.json
vendored
537
test/fixtures/view-test.json
vendored
@ -1,537 +0,0 @@
|
||||
{
|
||||
"nodes": [{
|
||||
"id": "b1965",
|
||||
"label": "新小精灵",
|
||||
"userview": 606,
|
||||
"pageview": 1723,
|
||||
"stayTime": 40
|
||||
}, {
|
||||
"id": "b1966",
|
||||
"label": "注册页面",
|
||||
"userview": 627,
|
||||
"pageview": 907,
|
||||
"stayTime": 11
|
||||
}, {
|
||||
"id": "b1967",
|
||||
"label": "添加心愿",
|
||||
"userview": 56,
|
||||
"pageview": 107,
|
||||
"stayTime": 10
|
||||
}, {
|
||||
"id": "b1968",
|
||||
"label": "记录",
|
||||
"userview": 31,
|
||||
"pageview": 40,
|
||||
"stayTime": 10
|
||||
}, {
|
||||
"id": "b2003",
|
||||
"label": "签约心愿",
|
||||
"userview": 31,
|
||||
"pageview": 46,
|
||||
"stayTime": 28
|
||||
}, {
|
||||
"id": "b2060",
|
||||
"label": "心愿记录详情页面",
|
||||
"userview": 5,
|
||||
"pageview": 8,
|
||||
"stayTime": 7
|
||||
}, {
|
||||
"id": "b2303",
|
||||
"label": "我的",
|
||||
"userview": 117,
|
||||
"pageview": 299,
|
||||
"stayTime": 3
|
||||
}, {
|
||||
"id": "b2304",
|
||||
"label": "家庭",
|
||||
"userview": 35,
|
||||
"pageview": 96,
|
||||
"stayTime": 2
|
||||
}, {
|
||||
"id": "b2316",
|
||||
"label": "新手向导",
|
||||
"userview": 1258,
|
||||
"pageview": 2011,
|
||||
"stayTime": 5
|
||||
}, {
|
||||
"id": "b3041",
|
||||
"label": "好习惯",
|
||||
"userview": 759,
|
||||
"pageview": 3337,
|
||||
"stayTime": 5
|
||||
}, {
|
||||
"id": "b3042",
|
||||
"label": "坏习惯",
|
||||
"userview": 64,
|
||||
"pageview": 246,
|
||||
"stayTime": 7
|
||||
}, {
|
||||
"id": "b3077",
|
||||
"label": "详情页",
|
||||
"userview": 404,
|
||||
"pageview": 1422,
|
||||
"stayTime": 4
|
||||
}, {
|
||||
"id": "b3078",
|
||||
"label": "已矫正",
|
||||
"userview": 8,
|
||||
"pageview": 10,
|
||||
"stayTime": 2
|
||||
}, {
|
||||
"id": "b3081",
|
||||
"label": "添加好习惯",
|
||||
"userview": 134,
|
||||
"pageview": 506,
|
||||
"stayTime": 8
|
||||
}, {
|
||||
"id": "b3083",
|
||||
"label": "添加坏习惯",
|
||||
"userview": 24,
|
||||
"pageview": 70,
|
||||
"stayTime": 12
|
||||
}, {
|
||||
"id": "b3084",
|
||||
"label": "保证书",
|
||||
"userview": 5,
|
||||
"pageview": 7,
|
||||
"stayTime": 31
|
||||
}, {
|
||||
"id": "b3328",
|
||||
"label": "修改习惯",
|
||||
"userview": 31,
|
||||
"pageview": 44,
|
||||
"stayTime": 11
|
||||
}, {
|
||||
"id": "b3413",
|
||||
"label": "发现",
|
||||
"userview": 130,
|
||||
"pageview": 215,
|
||||
"stayTime": 4
|
||||
}, {
|
||||
"id": "b3589",
|
||||
"label": "拍照页面",
|
||||
"userview": 35,
|
||||
"pageview": 52,
|
||||
"stayTime": 35
|
||||
}, {
|
||||
"id": "b_activity_fd_75660",
|
||||
"label": "彩虹星愿",
|
||||
"userview": 190,
|
||||
"pageview": 279,
|
||||
"stayTime": 30
|
||||
}],
|
||||
"edges": [{
|
||||
"source": "b1965",
|
||||
"sourcelabel": "新小精灵",
|
||||
"target": "b3081",
|
||||
"targetlabel": "添加好习惯",
|
||||
"userview": 48,
|
||||
"pageview": 52
|
||||
}, {
|
||||
"source": "b1965",
|
||||
"sourcelabel": "新小精灵",
|
||||
"target": "b3077",
|
||||
"targetlabel": "详情页",
|
||||
"userview": 334,
|
||||
"pageview": 491
|
||||
}, {
|
||||
"source": "b1965",
|
||||
"sourcelabel": "新小精灵",
|
||||
"target": "b2003",
|
||||
"targetlabel": "签约心愿",
|
||||
"userview": 12,
|
||||
"pageview": 13
|
||||
}, {
|
||||
"source": "b1965",
|
||||
"sourcelabel": "新小精灵",
|
||||
"target": "b3589",
|
||||
"targetlabel": "拍照页面",
|
||||
"userview": 31,
|
||||
"pageview": 31
|
||||
}, {
|
||||
"source": "b1965",
|
||||
"sourcelabel": "新小精灵",
|
||||
"target": "b3328",
|
||||
"targetlabel": "修改习惯",
|
||||
"userview": 22,
|
||||
"pageview": 30
|
||||
}, {
|
||||
"source": "b1965",
|
||||
"sourcelabel": "新小精灵",
|
||||
"target": "b2303",
|
||||
"targetlabel": "我的",
|
||||
"userview": 2,
|
||||
"pageview": 2
|
||||
}, {
|
||||
"source": "b1965",
|
||||
"sourcelabel": "新小精灵",
|
||||
"target": "b2060",
|
||||
"targetlabel": "心愿记录详情页面",
|
||||
"userview": 5,
|
||||
"pageview": 6
|
||||
}, {
|
||||
"source": "b1965",
|
||||
"sourcelabel": "新小精灵",
|
||||
"target": "b1967",
|
||||
"targetlabel": "添加心愿",
|
||||
"userview": 42,
|
||||
"pageview": 50
|
||||
}, {
|
||||
"source": "b1965",
|
||||
"sourcelabel": "新小精灵",
|
||||
"target": "b3041",
|
||||
"targetlabel": "好习惯",
|
||||
"userview": 368,
|
||||
"pageview": 639
|
||||
}, {
|
||||
"source": "b1966",
|
||||
"sourcelabel": "注册页面",
|
||||
"target": "b3042",
|
||||
"targetlabel": "坏习惯",
|
||||
"userview": 1,
|
||||
"pageview": 1
|
||||
}, {
|
||||
"source": "b1966",
|
||||
"sourcelabel": "注册页面",
|
||||
"target": "b3041",
|
||||
"targetlabel": "好习惯",
|
||||
"userview": 6,
|
||||
"pageview": 7
|
||||
}, {
|
||||
"source": "b1966",
|
||||
"sourcelabel": "注册页面",
|
||||
"target": "b2304",
|
||||
"targetlabel": "家庭",
|
||||
"userview": 15,
|
||||
"pageview": 29
|
||||
}, {
|
||||
"source": "b1966",
|
||||
"sourcelabel": "注册页面",
|
||||
"target": "b2316",
|
||||
"targetlabel": "新手向导",
|
||||
"userview": 620,
|
||||
"pageview": 650
|
||||
}, {
|
||||
"source": "b1967",
|
||||
"sourcelabel": "添加心愿",
|
||||
"target": "b1965",
|
||||
"targetlabel": "新小精灵",
|
||||
"userview": 56,
|
||||
"pageview": 70
|
||||
}, {
|
||||
"source": "b1967",
|
||||
"sourcelabel": "添加心愿",
|
||||
"target": "b2003",
|
||||
"targetlabel": "签约心愿",
|
||||
"userview": 22,
|
||||
"pageview": 29
|
||||
}, {
|
||||
"source": "b1968",
|
||||
"sourcelabel": "记录",
|
||||
"target": "b2303",
|
||||
"targetlabel": "我的",
|
||||
"userview": 31,
|
||||
"pageview": 40
|
||||
}, {
|
||||
"source": "b2003",
|
||||
"sourcelabel": "签约心愿",
|
||||
"target": "b1967",
|
||||
"targetlabel": "添加心愿",
|
||||
"userview": 31,
|
||||
"pageview": 45
|
||||
}, {
|
||||
"source": "b2060",
|
||||
"sourcelabel": "心愿记录详情页面",
|
||||
"target": "b1965",
|
||||
"targetlabel": "新小精灵",
|
||||
"userview": 5,
|
||||
"pageview": 6
|
||||
}, {
|
||||
"source": "b2303",
|
||||
"sourcelabel": "我的",
|
||||
"target": "b3041",
|
||||
"targetlabel": "好习惯",
|
||||
"userview": 116,
|
||||
"pageview": 169
|
||||
}, {
|
||||
"source": "b2303",
|
||||
"sourcelabel": "我的",
|
||||
"target": "b3077",
|
||||
"targetlabel": "详情页",
|
||||
"userview": 1,
|
||||
"pageview": 1
|
||||
}, {
|
||||
"source": "b2303",
|
||||
"sourcelabel": "我的",
|
||||
"target": "b1968",
|
||||
"targetlabel": "记录",
|
||||
"userview": 31,
|
||||
"pageview": 39
|
||||
}, {
|
||||
"source": "b2303",
|
||||
"sourcelabel": "我的",
|
||||
"target": "b2304",
|
||||
"targetlabel": "家庭",
|
||||
"userview": 33,
|
||||
"pageview": 45
|
||||
}, {
|
||||
"source": "b2303",
|
||||
"sourcelabel": "我的",
|
||||
"target": "b3328",
|
||||
"targetlabel": "修改习惯",
|
||||
"userview": 4,
|
||||
"pageview": 4
|
||||
}, {
|
||||
"source": "b2304",
|
||||
"sourcelabel": "家庭",
|
||||
"target": "b1966",
|
||||
"targetlabel": "注册页面",
|
||||
"userview": 15,
|
||||
"pageview": 26
|
||||
}, {
|
||||
"source": "b2304",
|
||||
"sourcelabel": "家庭",
|
||||
"target": "b2303",
|
||||
"targetlabel": "我的",
|
||||
"userview": 35,
|
||||
"pageview": 46
|
||||
}, {
|
||||
"source": "b2316",
|
||||
"sourcelabel": "新手向导",
|
||||
"target": "b3042",
|
||||
"targetlabel": "坏习惯",
|
||||
"userview": 1,
|
||||
"pageview": 1
|
||||
}, {
|
||||
"source": "b2316",
|
||||
"sourcelabel": "新手向导",
|
||||
"target": "b1966",
|
||||
"targetlabel": "注册页面",
|
||||
"userview": 514,
|
||||
"pageview": 536
|
||||
}, {
|
||||
"source": "b3041",
|
||||
"sourcelabel": "好习惯",
|
||||
"target": "b3328",
|
||||
"targetlabel": "修改习惯",
|
||||
"userview": 5,
|
||||
"pageview": 5
|
||||
}, {
|
||||
"source": "b3041",
|
||||
"sourcelabel": "好习惯",
|
||||
"target": "b1966",
|
||||
"targetlabel": "注册页面",
|
||||
"userview": 6,
|
||||
"pageview": 7
|
||||
}, {
|
||||
"source": "b3041",
|
||||
"sourcelabel": "好习惯",
|
||||
"target": "b3413",
|
||||
"targetlabel": "发现",
|
||||
"userview": 122,
|
||||
"pageview": 146
|
||||
}, {
|
||||
"source": "b3041",
|
||||
"sourcelabel": "好习惯",
|
||||
"target": "b2316",
|
||||
"targetlabel": "新手向导",
|
||||
"userview": 3,
|
||||
"pageview": 3
|
||||
}, {
|
||||
"source": "b3041",
|
||||
"sourcelabel": "好习惯",
|
||||
"target": "b3081",
|
||||
"targetlabel": "添加好习惯",
|
||||
"userview": 86,
|
||||
"pageview": 213
|
||||
}, {
|
||||
"source": "b3041",
|
||||
"sourcelabel": "好习惯",
|
||||
"target": "b3077",
|
||||
"targetlabel": "详情页",
|
||||
"userview": 347,
|
||||
"pageview": 749
|
||||
}, {
|
||||
"source": "b3041",
|
||||
"sourcelabel": "好习惯",
|
||||
"target": "b1965",
|
||||
"targetlabel": "新小精灵",
|
||||
"userview": 335,
|
||||
"pageview": 556
|
||||
}, {
|
||||
"source": "b3041",
|
||||
"sourcelabel": "好习惯",
|
||||
"target": "b3042",
|
||||
"targetlabel": "坏习惯",
|
||||
"userview": 58,
|
||||
"pageview": 71
|
||||
}, {
|
||||
"source": "b3041",
|
||||
"sourcelabel": "好习惯",
|
||||
"target": "b2303",
|
||||
"targetlabel": "我的",
|
||||
"userview": 112,
|
||||
"pageview": 165
|
||||
}, {
|
||||
"source": "b3042",
|
||||
"sourcelabel": "坏习惯",
|
||||
"target": "b3077",
|
||||
"targetlabel": "详情页",
|
||||
"userview": 32,
|
||||
"pageview": 75
|
||||
}, {
|
||||
"source": "b3042",
|
||||
"sourcelabel": "坏习惯",
|
||||
"target": "b3328",
|
||||
"targetlabel": "修改习惯",
|
||||
"userview": 2,
|
||||
"pageview": 2
|
||||
}, {
|
||||
"source": "b3042",
|
||||
"sourcelabel": "坏习惯",
|
||||
"target": "b1966",
|
||||
"targetlabel": "注册页面",
|
||||
"userview": 1,
|
||||
"pageview": 1
|
||||
}, {
|
||||
"source": "b3042",
|
||||
"sourcelabel": "坏习惯",
|
||||
"target": "b3084",
|
||||
"targetlabel": "保证书",
|
||||
"userview": 1,
|
||||
"pageview": 1
|
||||
}, {
|
||||
"source": "b3042",
|
||||
"sourcelabel": "坏习惯",
|
||||
"target": "b3083",
|
||||
"targetlabel": "添加坏习惯",
|
||||
"userview": 24,
|
||||
"pageview": 69
|
||||
}, {
|
||||
"source": "b3042",
|
||||
"sourcelabel": "坏习惯",
|
||||
"target": "b2316",
|
||||
"targetlabel": "新手向导",
|
||||
"userview": 2,
|
||||
"pageview": 2
|
||||
}, {
|
||||
"source": "b3042",
|
||||
"sourcelabel": "坏习惯",
|
||||
"target": "b3041",
|
||||
"targetlabel": "好习惯",
|
||||
"userview": 61,
|
||||
"pageview": 75
|
||||
}, {
|
||||
"source": "b3042",
|
||||
"sourcelabel": "坏习惯",
|
||||
"target": "b3078",
|
||||
"targetlabel": "已矫正",
|
||||
"userview": 8,
|
||||
"pageview": 10
|
||||
}, {
|
||||
"source": "b3077",
|
||||
"sourcelabel": "详情页",
|
||||
"target": "b1965",
|
||||
"targetlabel": "新小精灵",
|
||||
"userview": 309,
|
||||
"pageview": 450
|
||||
}, {
|
||||
"source": "b3077",
|
||||
"sourcelabel": "详情页",
|
||||
"target": "b3042",
|
||||
"targetlabel": "坏习惯",
|
||||
"userview": 32,
|
||||
"pageview": 79
|
||||
}, {
|
||||
"source": "b3077",
|
||||
"sourcelabel": "详情页",
|
||||
"target": "b3084",
|
||||
"targetlabel": "保证书",
|
||||
"userview": 4,
|
||||
"pageview": 6
|
||||
}, {
|
||||
"source": "b3077",
|
||||
"sourcelabel": "详情页",
|
||||
"target": "b3041",
|
||||
"targetlabel": "好习惯",
|
||||
"userview": 387,
|
||||
"pageview": 817
|
||||
}, {
|
||||
"source": "b3078",
|
||||
"sourcelabel": "已矫正",
|
||||
"target": "b3042",
|
||||
"targetlabel": "坏习惯",
|
||||
"userview": 8,
|
||||
"pageview": 10
|
||||
}, {
|
||||
"source": "b3081",
|
||||
"sourcelabel": "添加好习惯",
|
||||
"target": "b1965",
|
||||
"targetlabel": "新小精灵",
|
||||
"userview": 61,
|
||||
"pageview": 75
|
||||
}, {
|
||||
"source": "b3081",
|
||||
"sourcelabel": "添加好习惯",
|
||||
"target": "b3041",
|
||||
"targetlabel": "好习惯",
|
||||
"userview": 90,
|
||||
"pageview": 254
|
||||
}, {
|
||||
"source": "b3083",
|
||||
"sourcelabel": "添加坏习惯",
|
||||
"target": "b3042",
|
||||
"targetlabel": "坏习惯",
|
||||
"userview": 24,
|
||||
"pageview": 69
|
||||
}, {
|
||||
"source": "b3084",
|
||||
"sourcelabel": "保证书",
|
||||
"target": "b3077",
|
||||
"targetlabel": "详情页",
|
||||
"userview": 5,
|
||||
"pageview": 7
|
||||
}, {
|
||||
"source": "b3328",
|
||||
"sourcelabel": "修改习惯",
|
||||
"target": "b3041",
|
||||
"targetlabel": "好习惯",
|
||||
"userview": 5,
|
||||
"pageview": 5
|
||||
}, {
|
||||
"source": "b3328",
|
||||
"sourcelabel": "修改习惯",
|
||||
"target": "b1965",
|
||||
"targetlabel": "新小精灵",
|
||||
"userview": 22,
|
||||
"pageview": 30
|
||||
}, {
|
||||
"source": "b3328",
|
||||
"sourcelabel": "修改习惯",
|
||||
"target": "b3042",
|
||||
"targetlabel": "坏习惯",
|
||||
"userview": 2,
|
||||
"pageview": 2
|
||||
}, {
|
||||
"source": "b3328",
|
||||
"sourcelabel": "修改习惯",
|
||||
"target": "b2303",
|
||||
"targetlabel": "我的",
|
||||
"userview": 4,
|
||||
"pageview": 4
|
||||
}, {
|
||||
"source": "b3413",
|
||||
"sourcelabel": "发现",
|
||||
"target": "b3041",
|
||||
"targetlabel": "好习惯",
|
||||
"userview": 126,
|
||||
"pageview": 151
|
||||
}, {
|
||||
"source": "b3589",
|
||||
"sourcelabel": "拍照页面",
|
||||
"target": "b1965",
|
||||
"targetlabel": "新小精灵",
|
||||
"userview": 6,
|
||||
"pageview": 6
|
||||
}]
|
||||
}
|
@ -1,19 +1,18 @@
|
||||
const G6 = require('../../../src/index');
|
||||
const Tooltip = require('../../../plugins/tool.tooltip/');
|
||||
const Simulate = require('event-simulate');
|
||||
const expect = require('chai').expect;
|
||||
const Util = G6.Util;
|
||||
|
||||
document.body.appendChild(Util.createDOM(`
|
||||
<div>
|
||||
<div id='mountNode'></div>
|
||||
</div>
|
||||
`));
|
||||
|
||||
describe('tooltip test', () => {
|
||||
const tooltip = new Tooltip({
|
||||
getTooltip() {
|
||||
return `
|
||||
<div>dddd</div>
|
||||
<div id="tooltip">dddd</div>
|
||||
`;
|
||||
}
|
||||
});
|
||||
@ -38,8 +37,55 @@ describe('tooltip test', () => {
|
||||
height: 500,
|
||||
plugins: [ tooltip ]
|
||||
});
|
||||
const mouseEventWrapper = graph.getMouseEventWrapper();
|
||||
let top;
|
||||
let left;
|
||||
graph.read(data);
|
||||
it('tooltip destroy', () => {
|
||||
graph.destroy();
|
||||
it('mouseenter show tooltip', () => {
|
||||
const node1Model = graph.find('node1').getModel();
|
||||
const clientPoint = graph.getClientPoint(node1Model);
|
||||
Simulate.simulate(mouseEventWrapper, 'mousedown', {
|
||||
clientX: clientPoint.x - 50,
|
||||
clientY: clientPoint.y
|
||||
});
|
||||
Simulate.simulate(mouseEventWrapper, 'mousemove', {
|
||||
clientX: clientPoint.x - 50,
|
||||
clientY: clientPoint.y
|
||||
});
|
||||
Simulate.simulate(mouseEventWrapper, 'mousemove', {
|
||||
clientX: clientPoint.x,
|
||||
clientY: clientPoint.y
|
||||
});
|
||||
expect(document.getElementById('tooltip')).not.eql(null);
|
||||
});
|
||||
it('mousemove move tooltip', () => {
|
||||
const node1Model = graph.find('node1').getModel();
|
||||
const clientPoint = graph.getClientPoint(node1Model);
|
||||
Simulate.simulate(mouseEventWrapper, 'mousemove', {
|
||||
clientX: clientPoint.x + 5,
|
||||
clientY: clientPoint.y
|
||||
});
|
||||
});
|
||||
// it('mouseleave hide tooltip', () => {
|
||||
// const node1Model = graph.find('node1').getModel();
|
||||
// const clientPoint = graph.getClientPoint(node1Model);
|
||||
// Simulate.simulate(mouseEventWrapper, 'mousedown', {
|
||||
// clientX: clientPoint.x - 50,
|
||||
// clientY: clientPoint.y
|
||||
// });
|
||||
// Simulate.simulate(mouseEventWrapper, 'mousemove', {
|
||||
// clientX: clientPoint.x - 50,
|
||||
// clientY: clientPoint.y
|
||||
// });
|
||||
// Simulate.simulate(mouseEventWrapper, 'mousemove', {
|
||||
// clientX: clientPoint.x,
|
||||
// clientY: clientPoint.y
|
||||
// });
|
||||
// });
|
||||
// it('mouseleave', () => {
|
||||
|
||||
// });
|
||||
// it('tooltip destroy', () => {
|
||||
// graph.destroy();
|
||||
// });
|
||||
});
|
||||
|
@ -10,8 +10,11 @@ const entry = {
|
||||
|
||||
shelljs.ls(resolve(__dirname, 'plugins')).forEach(pluginPath => {
|
||||
if (pluginPath !== 'index.js') {
|
||||
const moduleName = _.upperFirst(_.camelCase(pluginPath));
|
||||
const moduleName = 'plugin.' + pluginPath;
|
||||
entry[moduleName] = `./plugins/${pluginPath}/index.js`;
|
||||
} else {
|
||||
const moduleName = 'plugins';
|
||||
entry[moduleName] = './plugins/index.js';
|
||||
}
|
||||
});
|
||||
|
||||
@ -26,8 +29,12 @@ module.exports = {
|
||||
path: resolve(__dirname, 'build/')
|
||||
},
|
||||
externals: {
|
||||
'@antv/g6': 'G6',
|
||||
'../../src/index': 'G6'
|
||||
'@antv/g6': {
|
||||
root: 'G6',
|
||||
commonjs2: '@antv/g6',
|
||||
commonjs: '@antv/g6',
|
||||
amd: '@antv/g6'
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
@ -40,10 +47,6 @@ module.exports = {
|
||||
babelrc: true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [ 'style-loader', 'css-loader' ]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user