Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
12588bd9
I
incubator-echarts
项目概览
x649585723
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
12588bd9
编写于
7月 25, 2014
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
力导向默认关闭 worker, 布局比例调整
上级
e4177ea4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
17 addition
and
13 deletion
+17
-13
doc/doc.html
doc/doc.html
+1
-1
doc/example/force1.html
doc/example/force1.html
+1
-1
doc/example/webkit-dep.html
doc/example/webkit-dep.html
+1
-0
src/chart/force.js
src/chart/force.js
+2
-2
src/chart/forceLayoutWorker.js
src/chart/forceLayoutWorker.js
+7
-7
src/config.js
src/config.js
+5
-2
未找到文件。
doc/doc.html
浏览文件 @
12588bd9
...
...
@@ -2870,7 +2870,7 @@ indicator : [
</tr>
<tr>
<td>
<b>
{boolean}
</b>
useWorker
</td>
<td>
tru
e
</td>
<td>
fals
e
</td>
<td>
是否在浏览器支持 web worker 的时候把布局计算放入 web worker 中
</td>
</tr>
<tr>
...
...
doc/example/force1.html
浏览文件 @
12588bd9
...
...
@@ -105,7 +105,7 @@ option = {
minRadius : 15,
maxRadius : 25,
gravity: 1.1,
scaling: 1.
2
,
scaling: 1.
1
,
linkSymbol: 'arrow',
nodes:[
{category:0, name: '乔布斯', value : 10},
...
...
doc/example/webkit-dep.html
浏览文件 @
12588bd9
...
...
@@ -77,6 +77,7 @@ option = {
webkitDepData.scaling = 1.1;
webkitDepData.steps = 20;
webkitDepData.large = true;
webkitDepData.useWorker = true;
webkitDepData.coolDown = 0.995;
webkitDepData.itemStyle = {
normal : {
...
...
src/chart/force.js
浏览文件 @
12588bd9
...
...
@@ -363,8 +363,8 @@ define(function (require) {
var
config
=
{
center
:
center
,
width
:
width
,
height
:
height
,
width
:
serie
.
ratioScaling
?
width
:
size
,
height
:
serie
.
ratioScaling
?
height
:
size
,
scaling
:
serie
.
scaling
||
1.0
,
gravity
:
serie
.
gravity
||
1.0
,
barnesHutOptimize
:
serie
.
large
...
...
src/chart/forceLayoutWorker.js
浏览文件 @
12588bd9
...
...
@@ -642,13 +642,13 @@ define(function(require) {
// vec2.sub(v, this._rootRegion.centerOfMass, node.position);
// vec2.negate(v, node.position);
vec2
.
sub
(
v
,
this
.
center
,
node
.
position
);
//
if (this.width > this.height) {
//
// Stronger gravity on y axis
//
v[1] *= this.width / this.height;
//
} else {
//
// Stronger gravity on x axis
//
v[0] *= this.height / this.width;
//
}
if
(
this
.
width
>
this
.
height
)
{
// Stronger gravity on y axis
v
[
1
]
*=
this
.
width
/
this
.
height
;
}
else
{
// Stronger gravity on x axis
v
[
0
]
*=
this
.
height
/
this
.
width
;
}
var
d
=
vec2
.
len
(
v
)
/
100
;
if
(
this
.
strongGravity
)
{
...
...
src/config.js
浏览文件 @
12588bd9
...
...
@@ -796,13 +796,16 @@ define(function() {
minRadius
:
10
,
maxRadius
:
20
,
// 是否根据屏幕比例拉伸
ratioScaling
:
false
,
// 在 500+ 顶点的图上建议设置 large 为 true, 会使用 Barnes-Hut simulation
// 同时开启 useWorker 并且把 steps 值调大
// 关于Barnes-Hut simulation: http://en.wikipedia.org/wiki/Barnes–Hut_simulation
large
:
false
,
//
为 false 的时候强制关闭
web worker
useWorker
:
tru
e
,
//
是否在浏览器支持 worker 的时候使用
web worker
useWorker
:
fals
e
,
// 每一帧 force 迭代的次数,仅在启用webworker的情况下有用
steps
:
1
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录