提交 0fa2f1ce 编写于 作者: S sushuang

Merge branch 'next' of https://github.com/100pah/echarts into next

# Conflicts:
#	src/chart/helper/LargeLine.js
#	src/chart/helper/LargeLineDraw.js
#	src/chart/helper/LineDraw.js
#	src/chart/lines/LinesSeries.js
#	src/chart/lines/LinesView.js
#	src/chart/lines/linesLayout.js
#	src/data/List.js
#	src/model/Series.js
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<body> <body>
<style> <style>
html, body, #main { html, body, #main {
background: #111;
width: 100%; width: 100%;
height: 100%; height: 100%;
margin: 0; margin: 0;
...@@ -21,7 +22,8 @@ ...@@ -21,7 +22,8 @@
var xs = [440000, 450000]; var xs = [440000, 450000];
var ys = [4368000, 4537000]; var ys = [4368000, 4537000];
var dataURL = '../../data-online/figshare_Urban_Road_Network/public/Links_NewYork_1.json'; var dataURL = '../../echarts-worker/example/data/links_ny.bin';
// var dataURL = '../../echarts-worker/example/data/Links_NewYork_1.json';
// var dataURL = 'http://echarts.baidu.com/resource/data/figshare_Urban_Road_Network/public/Links_NewYork_1.json'; // var dataURL = 'http://echarts.baidu.com/resource/data/figshare_Urban_Road_Network/public/Links_NewYork_1.json';
...@@ -33,22 +35,42 @@ ...@@ -33,22 +35,42 @@
// 'extension/bmap' // 'extension/bmap'
], function (echarts) { ], function (echarts) {
var config = {
dataLoading: 'whole',
streamThreshold: 0,
streamRender: true,
largeModel: true
};
$.get('../map/json/world.json', function (worldJson) { $.get('../map/json/world.json', function (worldJson) {
echarts.registerMap('world', worldJson); echarts.registerMap('world', worldJson);
// echarts.registerMap('test', testGeoJson1); // echarts.registerMap('test', testGeoJson1);
// $.get('data/Links_Beijing_0.json', function (data) { // $.get('data/Links_Beijing_0.json', function (data) {
$.get(dataURL, function (data) { var xhr = new XMLHttpRequest();
var config = { xhr.open('GET', dataURL, true);
dataLoading: 'whole', xhr.responseType = 'arraybuffer';
streamThreshold: 0,
streamRender: true,
largeModel: true
};
xhr.onload = function (e) {
var rawData = new Float32Array(this.response);
var chart; var chart;
var data = new Float64Array(rawData.length - 2);
var offsetX = rawData[0];
var offsetY = rawData[1];
var off = 0;
for (var i = 2; i < rawData.length;) {
var count = rawData[i++];
data[off++] = count;
for (var k = 0; k < count; k++) {
var x = rawData[i++] + offsetX;
var y = rawData[i++] + offsetY;
data[off++] = x;
data[off++] = y;
}
}
var gui = new dat.GUI(); var gui = new dat.GUI();
gui.add(config, 'dataLoading', ['whole', 'chunked']) gui.add(config, 'dataLoading', ['whole', 'chunked'])
.onChange(init); .onChange(init);
...@@ -68,61 +90,35 @@ ...@@ -68,61 +90,35 @@
chart = echarts.init(document.getElementById('main')); chart = echarts.init(document.getElementById('main'));
var lines = data.geometries.map(function (entry) {
return {
coords: entry.coordinates
};
});
// var lines = [];
// for (var i = 0; i < 1000; i++) {
// var entry = data.geometries[i];
// lines.push({
// coords: entry.coordinates
// });
// }
chart.setOption({ chart.setOption({
streamStep: 14000, streamStep: 15000,
animation: false, animation: false,
geo: { geo: {
center: [-74.04327099998152, 40.86737600240287], center: [-74.04327099998152, 40.86737600240287],
zoom: 360, zoom: 360,
map: 'world', map: 'world',
roam: true, roam: true,
label: { silent: true,
normal: {
show: true,
textStyle: {
color: 'rgba(0,0,0,0.4)'
}
}
},
itemStyle: { itemStyle: {
normal:{ normal: {
borderColor: 'rgba(0, 0, 0, 0.2)' areaColor: 'transparent',
}, borderColor: 'rgba(255,255,255,0.1)',
emphasis:{ borderWidth: 1
color: null,
areaColor: null,
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 20,
borderWidth: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
} }
} }
}, },
series: [{ series: [{
type: 'lines', type: 'lines',
coordinateSystem: 'geo', coordinateSystem: 'geo',
data: lines, data: data,
large: config.largeModel, large: config.largeModel,
polyline: true, polyline: true,
blendMode: 'lighter',
lineStyle: { lineStyle: {
normal: { normal: {
color: 'purple', color: 'orange',
opacity: 1, opacity: 0.3,
width: 0.5 width: 0.5
} }
}, },
...@@ -130,9 +126,9 @@ ...@@ -130,9 +126,9 @@
}] }]
}); });
} }
};
}); xhr.send();
}); });
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册