Skip to content

Commit 4dfd5d1

Browse files
committed
chord 支持 category, force样式配置 stroke(兼容) -> border
1 parent f28626c commit 4dfd5d1

File tree

10 files changed

+260
-44
lines changed

10 files changed

+260
-44
lines changed

doc/example/chord3.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
{target: '多特蒙德', source: '胡梅尔斯', weight: 1},
123123
{target: '多特蒙德', source: '魏登费勒', weight: 1},
124124
{target: '多特蒙德', source: '杜尔姆', weight: 1},
125-
{target: '多特蒙德', source: '格罗斯克罗伊茨', weight: 1},
125+
{target: '多特蒙德', source: '格罗斯克罗伊茨', weight: 1}
126126
]
127127
}
128128
]

doc/example/chord4.html

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
}
7575
}
7676
},
77+
minRadius: 7,
78+
maxRadius: 20,
7779
// 使用 nodes links 表达和弦图
7880
nodes: [
7981
{name:'默特萨克'},
@@ -84,7 +86,7 @@
8486
{name:'施魏因施泰格'},
8587
{name:'拉姆'},
8688
{name:'克罗斯'},
87-
{name:'穆勒'},
89+
{name:'穆勒', symbol: 'star'},
8890
{name:'格策'},
8991
{name:'胡梅尔斯'},
9092
{name:'魏登费勒'},
@@ -95,20 +97,20 @@
9597
{name:'多特蒙德'}
9698
],
9799
links: [
98-
{source: '阿森纳', target: '默特萨克', weight: 0.9},
99-
{source: '阿森纳', target: '厄齐尔', weight: 0.9},
100-
{source: '阿森纳', target: '波多尔斯基', weight: 0.9},
101-
{source: '拜仁慕尼黑', target: '诺伊尔', weight: 0.9},
102-
{source: '拜仁慕尼黑', target: '博阿滕', weight: 0.9},
103-
{source: '拜仁慕尼黑', target: '施魏因施泰格', weight: 0.9},
104-
{source: '拜仁慕尼黑', target: '拉姆', weight: 0.9},
105-
{source: '拜仁慕尼黑', target: '克罗斯', weight: 0.9},
106-
{source: '拜仁慕尼黑', target: '穆勒', weight: 0.9},
107-
{source: '拜仁慕尼黑', target: '格策', weight: 0.9},
108-
{source: '多特蒙德', target: '胡梅尔斯', weight: 0.9},
109-
{source: '多特蒙德', target: '魏登费勒', weight: 0.9},
110-
{source: '多特蒙德', target: '杜尔姆', weight: 0.9},
111-
{source: '多特蒙德', target: '格罗斯克罗伊茨', weight: 0.9},
100+
{source: '阿森纳', target: '默特萨克', weight: 1},
101+
{source: '阿森纳', target: '厄齐尔', weight: 1},
102+
{source: '阿森纳', target: '波多尔斯基', weight: 1},
103+
{source: '拜仁慕尼黑', target: '诺伊尔', weight: 1},
104+
{source: '拜仁慕尼黑', target: '博阿滕', weight: 1},
105+
{source: '拜仁慕尼黑', target: '施魏因施泰格', weight: 1},
106+
{source: '拜仁慕尼黑', target: '拉姆', weight: 1},
107+
{source: '拜仁慕尼黑', target: '克罗斯', weight: 1},
108+
{source: '拜仁慕尼黑', target: '穆勒', weight: 1},
109+
{source: '拜仁慕尼黑', target: '格策', weight: 1},
110+
{source: '多特蒙德', target: '胡梅尔斯', weight: 1},
111+
{source: '多特蒙德', target: '魏登费勒', weight: 1},
112+
{source: '多特蒙德', target: '杜尔姆', weight: 1},
113+
{source: '多特蒙德', target: '格罗斯克罗伊茨', weight: 1}
112114
]
113115
}
114116
]

doc/example/force.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@
8787
},
8888
nodeStyle : {
8989
brushType : 'both',
90-
strokeColor : 'rgba(255,215,0,0.4)',
91-
lineWidth : 1
90+
borderColor : 'rgba(255,215,0,0.4)',
91+
borderWidth : 1
9292
}
9393
},
9494
emphasis: {
@@ -110,6 +110,7 @@
110110
linkSymbol: 'arrow',
111111
steps: 10,
112112
coolDown: 0.9,
113+
preventOverlap: true,
113114
nodes:[
114115
{
115116
category:0, name: '乔布斯', value : 10,

doc/example/force1.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@
8686
},
8787
nodeStyle : {
8888
brushType : 'both',
89-
strokeColor : 'rgba(255,215,0,0.4)',
90-
lineWidth : 1
89+
borderColor : 'rgba(255,215,0,0.4)',
90+
borderWidth : 1
9191
}
9292
},
9393
emphasis: {

doc/example/force2.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@
143143
},
144144
nodeStyle : {
145145
brushType : 'both',
146-
strokeColor : 'rgba(255,215,0,0.6)',
147-
lineWidth : 1
146+
borderColor : 'rgba(255,215,0,0.6)',
147+
borderWidth : 1
148148
}
149149
}
150150
},

doc/example/webkit-dep2.html

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta name="description" content="ECharts">
8+
<meta name="author" content="[email protected]">
9+
<title>ECharts · Example</title>
10+
11+
<link rel="shortcut icon" href="../asset/ico/favicon.png">
12+
13+
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
14+
<link href="../asset/css/bootstrap.css" rel="stylesheet">
15+
<link href="../asset/css/carousel.css" rel="stylesheet">
16+
<link href="../asset/css/echartsHome.css" rel="stylesheet">
17+
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
18+
<!--[if lt IE 9]>
19+
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
20+
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
21+
<![endif]-->
22+
23+
<script src="../asset/js/esl/esl.js"></script>
24+
<script src="../asset/js/codemirror.js"></script>
25+
<script src="../asset/js/javascript.js"></script>
26+
27+
<link href="../asset/css/codemirror.css" rel="stylesheet">
28+
<link href="../asset/css/monokai.css" rel="stylesheet">
29+
<style type="text/css">
30+
.CodeMirror {
31+
height: 620px;
32+
}
33+
</style>
34+
</head>
35+
36+
<body>
37+
<!-- Fixed navbar -->
38+
<div class="navbar navbar-default navbar-fixed-top" role="navigation" id="head"></div>
39+
40+
41+
<div class="container-fluid">
42+
<div class="row-fluid example">
43+
<div id="sidebar-code" class="col-md-1">
44+
<div class="well sidebar-nav">
45+
<div class="nav-header"><a href="#" onclick="autoResize()" class="glyphicon glyphicon-resize-full" id ="icon-resize" ></a>option</div>
46+
<textarea id="code" name="code">
47+
option = {
48+
title : {
49+
text: 'webkit内核依赖',
50+
subtext: '数据来自网络',
51+
x:'right',
52+
y:'bottom'
53+
},
54+
tooltip : {
55+
trigger: 'item',
56+
formatter : "{b}"
57+
},
58+
toolbox: {
59+
show : true,
60+
feature : {
61+
restore : {show: true},
62+
saveAsImage : {show: true}
63+
}
64+
},
65+
legend : {
66+
data : ['HTMLElement', 'WebGL', 'SVG', 'CSS', 'Other'],
67+
orient : 'vertical',
68+
x : 'left'
69+
},
70+
series : (function (){
71+
// If data have been loaded
72+
if (webkitDepData) {
73+
//webkitDepData has been required and defined in webkit-dep.js
74+
webkitDepData.type = 'chord';
75+
webkitDepData.ribbonType = false;
76+
for (var i = 0; i < webkitDepData.nodes.length; i++) {
77+
webkitDepData.nodes[i].value = null;
78+
}
79+
for (var i = 0; i < webkitDepData.links.length; i++) {
80+
webkitDepData.links[i].weight = 1;
81+
}
82+
webkitDepData.minRadius = 2;
83+
webkitDepData.maxRadius = 10;
84+
webkitDepData.itemStyle = {
85+
normal: {
86+
label: {
87+
show: true,
88+
rotate: true
89+
},
90+
chordStyle: {
91+
opacity: 0.2
92+
}
93+
}
94+
};
95+
return [webkitDepData];
96+
} else {
97+
return [];
98+
}
99+
})()
100+
};
101+
</textarea>
102+
</div><!--/.well -->
103+
</div><!--/span-->
104+
<div id="graphic" class="col-md-11">
105+
<div id="main" class="main" style="height:600px;"></div>
106+
<div>
107+
<button type="button" class="btn btn-sm btn-success" onclick="refresh(true)">刷 新</button>
108+
<span class="text-primary">切换主题</span>
109+
<select id="theme-select"></select>
110+
111+
<span id='wrong-message' style="color:red"></span>
112+
</div>
113+
</div><!--/span-->
114+
</div><!--/row-->
115+
116+
</div><!--/.fluid-container-->
117+
118+
<footer id="footer"></footer>
119+
<!-- Le javascript
120+
================================================== -->
121+
<!-- Placed at the end of the document so the pages load faster -->
122+
<script src="../asset/js/jquery.min.js"></script>
123+
<script type="text/javascript" src="../asset/js/echartsHome.js"></script>
124+
<script src="../asset/js/bootstrap.min.js"></script>
125+
<script type="text/javascript">
126+
var webkitDepData;
127+
require(['webkit-dep'], function (wd) {
128+
webkitDepData = wd;
129+
//webkitDepData has been required and defined in webkit-dep.js
130+
webkitDepData.minRadius = 5;
131+
webkitDepData.maxRadius = 8;
132+
webkitDepData.density = 1.1;
133+
webkitDepData.attractiveness = 1.1;
134+
webkitDepData.itemStyle = {
135+
normal : {
136+
linkStyle : {
137+
opacity : 0.5
138+
}
139+
}
140+
}
141+
// Echarts have been loaded
142+
if (typeof(echarts) !== 'undefined') {
143+
refresh();
144+
}
145+
})
146+
</script>
147+
<script src="../asset/js/echartsExample.js"></script>
148+
</body>
149+
</html>

0 commit comments

Comments
 (0)