提交 9f4eb7c6 编写于 作者: K kener

单文件更新,例子更新

上级 12588bd9
此差异已折叠。
......@@ -797,13 +797,16 @@ define('echarts/config',[],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: true,
// 是否在浏览器支持 worker 的时候使用 web worker
useWorker: false,
// 每一帧 force 迭代的次数,仅在启用webworker的情况下有用
steps: 1,
......@@ -36030,10 +36033,10 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh
return Chord;
});
(function __echartsForceLayoutWorker(self) {
(function __echartsForceLayoutWorker(glob) {
// In web worker
if (typeof(window) === 'undefined' || window !== self) {
if (typeof(window) === 'undefined' || window !== glob) {
// Simple TMD implementation
self.tmd = {};
self.tmd.modules = {};
......@@ -36520,11 +36523,7 @@ define('echarts/chart/ForceLayoutWorker',['require','zrender/tool/vector'],funct
// Gravity
if (this.gravity > 0) {
if (this.strongGravity) {
this.applyNodeStrongGravity(na);
} else {
this.applyNodeGravity(na);
}
this.applyNodeGravity(na);
}
}
......@@ -36678,18 +36677,20 @@ define('echarts/chart/ForceLayoutWorker',['require','zrender/tool/vector'],funct
// vec2.sub(v, this._rootRegion.centerOfMass, node.position);
// vec2.negate(v, node.position);
vec2.sub(v, this.center, node.position);
var d = vec2.len(v);
vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1));
};
})();
ForceLayout.prototype.applyNodeStrongGravity = (function() {
var v = vec2.create();
return function(node) {
// 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;
}
var d = vec2.len(v) / 100;
vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass);
if (this.strongGravity) {
vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass);
} else {
vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1));
}
};
})();
......@@ -37022,8 +37023,9 @@ define('echarts/chart/force',['require','../component/base','./base','./ForceLay
this._coolDown = serie.coolDown || 0.99;
var center = this.parseCenter(this.zr, serie.center);
var size = this.parseRadius(this.zr, serie.size);
size = size[1] * 2;
var width = this.parsePercent(serie.size, this.zr.getWidth());
var height = this.parsePercent(serie.size, this.zr.getHeight());
var size = Math.min(width, height);
// 将值映射到minRadius-maxRadius的范围上
var radius = [];
......@@ -37084,8 +37086,8 @@ define('echarts/chart/force',['require','../component/base','./base','./ForceLay
var config = {
center: center,
width: size,
height: size,
width: serie.ratioScaling ? width : size,
height: serie.ratioScaling ? height : size,
scaling: serie.scaling || 1.0,
gravity: serie.gravity || 1.0,
barnesHutOptimize: serie.large
......@@ -797,13 +797,16 @@ define('echarts/config',[],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: true,
// 是否在浏览器支持 worker 的时候使用 web worker
useWorker: false,
// 每一帧 force 迭代的次数,仅在启用webworker的情况下有用
steps: 1,
......@@ -36030,10 +36033,10 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh
return Chord;
});
(function __echartsForceLayoutWorker(self) {
(function __echartsForceLayoutWorker(glob) {
// In web worker
if (typeof(window) === 'undefined' || window !== self) {
if (typeof(window) === 'undefined' || window !== glob) {
// Simple TMD implementation
self.tmd = {};
self.tmd.modules = {};
......@@ -36520,11 +36523,7 @@ define('echarts/chart/ForceLayoutWorker',['require','zrender/tool/vector'],funct
// Gravity
if (this.gravity > 0) {
if (this.strongGravity) {
this.applyNodeStrongGravity(na);
} else {
this.applyNodeGravity(na);
}
this.applyNodeGravity(na);
}
}
......@@ -36678,18 +36677,20 @@ define('echarts/chart/ForceLayoutWorker',['require','zrender/tool/vector'],funct
// vec2.sub(v, this._rootRegion.centerOfMass, node.position);
// vec2.negate(v, node.position);
vec2.sub(v, this.center, node.position);
var d = vec2.len(v);
vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1));
};
})();
ForceLayout.prototype.applyNodeStrongGravity = (function() {
var v = vec2.create();
return function(node) {
// 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;
}
var d = vec2.len(v) / 100;
vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass);
if (this.strongGravity) {
vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass);
} else {
vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1));
}
};
})();
......@@ -37022,8 +37023,9 @@ define('echarts/chart/force',['require','../component/base','./base','./ForceLay
this._coolDown = serie.coolDown || 0.99;
var center = this.parseCenter(this.zr, serie.center);
var size = this.parseRadius(this.zr, serie.size);
size = size[1] * 2;
var width = this.parsePercent(serie.size, this.zr.getWidth());
var height = this.parsePercent(serie.size, this.zr.getHeight());
var size = Math.min(width, height);
// 将值映射到minRadius-maxRadius的范围上
var radius = [];
......@@ -37084,8 +37086,8 @@ define('echarts/chart/force',['require','../component/base','./base','./ForceLay
var config = {
center: center,
width: size,
height: size,
width: serie.ratioScaling ? width : size,
height: serie.ratioScaling ? height : size,
scaling: serie.scaling || 1.0,
gravity: serie.gravity || 1.0,
barnesHutOptimize: serie.large
此差异已折叠。
......@@ -1204,13 +1204,16 @@ define('echarts/config',[],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: true,
// 是否在浏览器支持 worker 的时候使用 web worker
useWorker: false,
// 每一帧 force 迭代的次数,仅在启用webworker的情况下有用
steps: 1,
......@@ -36437,10 +36440,10 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh
return Chord;
});
(function __echartsForceLayoutWorker(self) {
(function __echartsForceLayoutWorker(glob) {
// In web worker
if (typeof(window) === 'undefined' || window !== self) {
if (typeof(window) === 'undefined' || window !== glob) {
// Simple TMD implementation
self.tmd = {};
self.tmd.modules = {};
......@@ -36927,11 +36930,7 @@ define('echarts/chart/ForceLayoutWorker',['require','zrender/tool/vector'],funct
// Gravity
if (this.gravity > 0) {
if (this.strongGravity) {
this.applyNodeStrongGravity(na);
} else {
this.applyNodeGravity(na);
}
this.applyNodeGravity(na);
}
}
......@@ -37085,18 +37084,20 @@ define('echarts/chart/ForceLayoutWorker',['require','zrender/tool/vector'],funct
// vec2.sub(v, this._rootRegion.centerOfMass, node.position);
// vec2.negate(v, node.position);
vec2.sub(v, this.center, node.position);
var d = vec2.len(v);
vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1));
};
})();
ForceLayout.prototype.applyNodeStrongGravity = (function() {
var v = vec2.create();
return function(node) {
// 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;
}
var d = vec2.len(v) / 100;
vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass);
if (this.strongGravity) {
vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass);
} else {
vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1));
}
};
})();
......@@ -37429,8 +37430,9 @@ define('echarts/chart/force',['require','../component/base','./base','./ForceLay
this._coolDown = serie.coolDown || 0.99;
var center = this.parseCenter(this.zr, serie.center);
var size = this.parseRadius(this.zr, serie.size);
size = size[1] * 2;
var width = this.parsePercent(serie.size, this.zr.getWidth());
var height = this.parsePercent(serie.size, this.zr.getHeight());
var size = Math.min(width, height);
// 将值映射到minRadius-maxRadius的范围上
var radius = [];
......@@ -37491,8 +37493,8 @@ define('echarts/chart/force',['require','../component/base','./base','./ForceLay
var config = {
center: center,
width: size,
height: size,
width: serie.ratioScaling ? width : size,
height: serie.ratioScaling ? height : size,
scaling: serie.scaling || 1.0,
gravity: serie.gravity || 1.0,
barnesHutOptimize: serie.large
......@@ -1204,13 +1204,16 @@ define('echarts/config',[],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: true,
// 是否在浏览器支持 worker 的时候使用 web worker
useWorker: false,
// 每一帧 force 迭代的次数,仅在启用webworker的情况下有用
steps: 1,
......@@ -36437,10 +36440,10 @@ define('echarts/chart/chord',['require','../component/base','./base','zrender/sh
return Chord;
});
(function __echartsForceLayoutWorker(self) {
(function __echartsForceLayoutWorker(glob) {
// In web worker
if (typeof(window) === 'undefined' || window !== self) {
if (typeof(window) === 'undefined' || window !== glob) {
// Simple TMD implementation
self.tmd = {};
self.tmd.modules = {};
......@@ -36927,11 +36930,7 @@ define('echarts/chart/ForceLayoutWorker',['require','zrender/tool/vector'],funct
// Gravity
if (this.gravity > 0) {
if (this.strongGravity) {
this.applyNodeStrongGravity(na);
} else {
this.applyNodeGravity(na);
}
this.applyNodeGravity(na);
}
}
......@@ -37085,18 +37084,20 @@ define('echarts/chart/ForceLayoutWorker',['require','zrender/tool/vector'],funct
// vec2.sub(v, this._rootRegion.centerOfMass, node.position);
// vec2.negate(v, node.position);
vec2.sub(v, this.center, node.position);
var d = vec2.len(v);
vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1));
};
})();
ForceLayout.prototype.applyNodeStrongGravity = (function() {
var v = vec2.create();
return function(node) {
// 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;
}
var d = vec2.len(v) / 100;
vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass);
if (this.strongGravity) {
vec2.scaleAndAdd(node.force, node.force, v, d * this.gravity * node.mass);
} else {
vec2.scaleAndAdd(node.force, node.force, v, this.gravity * node.mass / (d + 1));
}
};
})();
......@@ -37429,8 +37430,9 @@ define('echarts/chart/force',['require','../component/base','./base','./ForceLay
this._coolDown = serie.coolDown || 0.99;
var center = this.parseCenter(this.zr, serie.center);
var size = this.parseRadius(this.zr, serie.size);
size = size[1] * 2;
var width = this.parsePercent(serie.size, this.zr.getWidth());
var height = this.parsePercent(serie.size, this.zr.getHeight());
var size = Math.min(width, height);
// 将值映射到minRadius-maxRadius的范围上
var radius = [];
......@@ -37491,8 +37493,8 @@ define('echarts/chart/force',['require','../component/base','./base','./ForceLay
var config = {
center: center,
width: size,
height: size,
width: serie.ratioScaling ? width : size,
height: serie.ratioScaling ? height : size,
scaling: serie.scaling || 1.0,
gravity: serie.gravity || 1.0,
barnesHutOptimize: serie.large
此差异已折叠。
此差异已折叠。
......@@ -177,8 +177,8 @@
<span><strong>变化瀑布图</strong><br/>个性化样式,文本标签显示,透明数据驱动样式</span></a>
</li><!--/li-->
<li data-thumb="asset/img/example/cache.png">
<a href="example/bar.html"><img src="asset/img/example/cache.png">
<span><strong>柱状图</strong><br/>个性化,柱形宽度,填充、高亮、文本样式等</span></a>
<a href="example/bar12.html"><img src="asset/img/example/cache.png">
<span><strong>多系列层叠</strong><br/>个性化样式</span></a>
</li><!--/li-->
<li data-thumb="asset/img/example/cache.png">
<a href="example/bar3.html"><img src="asset/img/example/cache.png">
......@@ -205,8 +205,8 @@
<span><strong>搭配时间轴使用</strong><br/>时空维度的数据展现</span></a>
</li><!--/li-->
<li data-thumb="asset/img/example/cache.png">
<a href="example/bar12.html"><img src="asset/img/example/cache.png">
<span><strong>多系列层叠</strong><br/>个性化样式</span></a>
<a href="example/bar.html"><img src="asset/img/example/cache.png">
<span><strong>柱状图</strong><br/>个性化,柱形宽度,填充、高亮、文本样式等</span></a>
</li><!--/li-->
</ul>
</div>
......@@ -230,16 +230,16 @@
<span><strong>大规模散点图</strong><br/>启用设置</span></a>
</li><!--/li-->
<li data-thumb="asset/img/example/cache.png">
<a href="example/scatter.html"><img src="asset/img/example/cache.png">
<span><strong>散点图</strong><br/>多级控制,个性化图形样式,大小等</span></a>
<a href="example/scatter5.html"><img src="asset/img/example/cache.png">
<span><strong>类目散点图</strong><br/>搭配数据区域缩放</span></a>
</li><!--/li-->
<li data-thumb="asset/img/example/cache.png">
<a href="example/scatter4.html"><img src="asset/img/example/cache.png">
<span><strong>搭配时间轴使用</strong><br/>时空维度数据展现,Gapminder</span></a>
</li><!--/li-->
<li data-thumb="asset/img/example/cache.png">
<a href="example/scatter5.html"><img src="asset/img/example/cache.png">
<span><strong>类目散点图</strong><br/>搭配数据区域缩放</span></a>
<a href="example/scatter.html"><img src="asset/img/example/cache.png">
<span><strong>散点图</strong><br/>多级控制,个性化图形样式,大小等</span></a>
</li><!--/li-->
</ul>
</div>
......@@ -291,14 +291,14 @@
<a href="example/pie6.html"><img src="asset/img/example/cache.png">
<span><strong>环形图</strong><br/>信息图样式,额外内容添加,文本标签技巧</span></a>
</li><!--/li-->
<li data-thumb="asset/img/example/cache.png">
<a href="example/pie.html"><img src="asset/img/example/cache.png">
<span><strong>饼图</strong><br/>多级控制,个性化填充、标签文本、视觉引导线样式等</span></a>
</li><!--/li-->
<li data-thumb="asset/img/example/cache.png">
<a href="example/pie7.html"><img src="asset/img/example/cache.png">
<span><strong>搭配时间轴使用</strong><br/>时空维度数据展现</span></a>
</li><!--/li-->
<li data-thumb="asset/img/example/cache.png">
<a href="example/pie.html"><img src="asset/img/example/cache.png">
<span><strong>饼图</strong><br/>多级控制,个性化填充、标签文本、视觉引导线样式等</span></a>
</li><!--/li-->
</ul>
</div>
</div>
......@@ -363,13 +363,17 @@
<span><strong>树状关系网络</strong><br/>数据格式</span></a>
</li><!--/li-->
<li data-thumb="asset/img/example/cache.png">
<a href="example/force5.html"><img src="asset/img/example/cache.png">
<a href="example/force4.html"><img src="asset/img/example/cache.png">
<span><strong>树状关系网络</strong><br/>数据格式</span></a>
</li><!--/li-->
<li data-thumb="asset/img/example/cache.png">
<a href="example/webkit-dep.html"><img src="asset/img/example/cache.png">
<span><strong>复杂关系网络</strong><br/>Webkit内核依赖</span></a>
</li><!--/li-->
<li data-thumb="asset/img/example/cache.png">
<a href="example/force.html"><img src="asset/img/example/cache.png">
<span><strong>力导向布局</strong><br/>个性化,节点样式,线条样式</span></a>
</li><!--/li-->
</ul>
</div>
</div>
......
......@@ -102,7 +102,7 @@ option = {
linkStyle : {}
}
},
useWorker: true,
useWorker: false,
minRadius : 15,
maxRadius : 25,
gravity: 1.1,
......
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册