Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
7333da62
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,发现更多精彩内容 >>
提交
7333da62
编写于
12月 26, 2017
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'next' of
https://github.com/100pah/echarts
into next
上级
0708b8fe
8af45755
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
114 addition
and
24 deletion
+114
-24
src/echarts.js
src/echarts.js
+7
-24
test/node/scatter-gps.js
test/node/scatter-gps.js
+107
-0
未找到文件。
src/echarts.js
浏览文件 @
7333da62
...
...
@@ -1423,7 +1423,7 @@ function renderSeries(ecIns, ecModel, api, payload, dirtySeriesModels) {
updateZ
(
seriesModel
,
chartView
);
// ??? updateProgressiveAnd
Blend(seriesModel, chartView);
update
Blend
(
seriesModel
,
chartView
);
}
scheduler
.
unfinished
|=
unfinished
;
...
...
@@ -1550,29 +1550,7 @@ function updateHoverLayerStatus(zr, ecModel) {
* @param {module:echarts/model/Series|module:echarts/model/Component} model
* @param {module:echarts/view/Component|module:echarts/view/Chart} view
*/
function
updateProgressiveAndBlend
(
seriesModel
,
chartView
)
{
// Progressive configuration
var
elCount
=
0
;
chartView
.
group
.
traverse
(
function
(
el
)
{
if
(
el
.
type
!==
'
group
'
&&
!
el
.
ignore
)
{
elCount
++
;
}
});
var
frameDrawNum
=
+
seriesModel
.
get
(
'
progressive
'
);
var
needProgressive
=
elCount
>
seriesModel
.
get
(
'
progressiveThreshold
'
)
&&
frameDrawNum
&&
!
env
.
node
;
if
(
needProgressive
)
{
chartView
.
group
.
traverse
(
function
(
el
)
{
// FIXME marker and other components
if
(
!
el
.
isGroup
)
{
el
.
progressive
=
needProgressive
?
Math
.
floor
(
elCount
++
/ frameDrawNum
)
: -1
;
if
(
needProgressive
)
{
el
.
stopAnimation
(
true
);
}
}
});
}
function
updateBlend
(
seriesModel
,
chartView
)
{
// Blend configration
// ???
var
blendMode
=
seriesModel
.
get
(
'
blendMode
'
)
||
null
;
...
...
@@ -1586,6 +1564,11 @@ function updateProgressiveAndBlend(seriesModel, chartView) {
if
(
!
el
.
isGroup
)
{
el
.
setStyle
(
'
blend
'
,
blendMode
);
}
if
(
el
.
eachPendingDisplayable
)
{
el
.
eachPendingDisplayable
(
function
(
displayable
)
{
displayable
.
setStyle
(
'
blend
'
,
blendMode
);
});
}
});
}
...
...
test/node/scatter-gps.js
0 → 100644
浏览文件 @
7333da62
var
echarts
=
require
(
'
../../dist/echarts
'
);
// var v8 = require('v8');
// v8.setFlagsFromString('--max-old-space-size=4096');
var
{
createCanvas
}
=
require
(
'
canvas
'
);
var
fs
=
require
(
'
fs
'
);
var
ProgressBar
=
require
(
'
progress
'
);
echarts
.
setCanvasCreator
(
function
()
{
return
createCanvas
(
100
,
100
);
});
var
canvas
=
createCanvas
();
canvas
.
width
=
2048
;
canvas
.
height
=
1024
;
var
worldJson
=
JSON
.
parse
(
fs
.
readFileSync
(
'
../../map/json/world.json
'
,
'
utf-8
'
));
echarts
.
registerMap
(
'
world
'
,
worldJson
);
var
chart
=
echarts
.
init
(
canvas
);
chart
.
setOption
({
backgroundColor
:
'
#000
'
,
geo
:
{
map
:
'
world
'
,
roam
:
true
,
label
:
{
emphasis
:
{
show
:
false
}
},
silent
:
true
,
itemStyle
:
{
normal
:
{
areaColor
:
'
#323c48
'
,
borderColor
:
'
#111
'
},
emphasis
:
{
areaColor
:
'
#2a333d
'
}
}
},
series
:
[{
name
:
'
弱
'
,
type
:
'
scatter
'
,
progressive
:
1
e5
,
coordinateSystem
:
'
geo
'
,
symbolSize
:
1
,
blendMode
:
'
lighter
'
,
large
:
true
,
itemStyle
:
{
normal
:
{
color
:
'
rgb(20, 15, 2)
'
}
},
postEffect
:
{
enable
:
true
},
silent
:
true
,
dimensions
:
[
'
lng
'
,
'
lat
'
],
data
:
new
Float32Array
()
}]
});
// var CHUNK_COUNT = 277;
var
CHUNK_COUNT
=
229
;
// https://blog.openstreetmap.org/2012/04/01/bulk-gps-point-data/
function
fetchData
(
idx
)
{
if
(
idx
>=
CHUNK_COUNT
)
{
setTimeout
(
function
()
{
fs
.
writeFile
(
'
out.png
'
,
canvas
.
toBuffer
());
chart
.
dispose
();
});
return
;
}
fs
.
readFile
(
`../../../echarts-gl/test/data/gps/gps_
${
idx
}
.bin`
,
function
(
err
,
buffer
)
{
var
arr
=
new
Uint8Array
(
buffer
.
length
);
for
(
var
i
=
0
;
i
<
buffer
.
length
;
i
++
)
{
arr
[
i
]
=
buffer
[
i
];
}
var
rawData
=
new
Int32Array
(
arr
.
buffer
);
var
data
=
new
Float32Array
(
rawData
.
length
);
for
(
var
i
=
0
;
i
<
rawData
.
length
;
i
+=
2
)
{
data
[
i
]
=
rawData
[
i
+
1
]
/
1
e7
;
data
[
i
+
1
]
=
rawData
[
i
]
/
1
e7
;
}
chart
.
addData
({
seriesIndex
:
0
,
data
:
data
});
fetchData
(
idx
+
1
);
progress
.
tick
();
});
}
var
progress
=
new
ProgressBar
(
'
Generating [:bar] :percent :etas
'
,
{
complete
:
'
=
'
,
incomplete
:
'
'
,
width
:
50
,
total
:
CHUNK_COUNT
});
fetchData
(
0
);
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录