Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
ad2709b6
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,发现更多精彩内容 >>
提交
ad2709b6
编写于
12月 27, 2017
作者:
P
pissang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[heatmap] support incremental rendering.
上级
998f3696
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
9 deletion
+33
-9
src/chart/heatmap/HeatmapView.js
src/chart/heatmap/HeatmapView.js
+29
-6
src/util/graphic.js
src/util/graphic.js
+2
-0
test/heatmap-large.html
test/heatmap-large.html
+2
-3
未找到文件。
src/chart/heatmap/HeatmapView.js
浏览文件 @
ad2709b6
...
@@ -77,9 +77,12 @@ export default echarts.extendChartView({
...
@@ -77,9 +77,12 @@ export default echarts.extendChartView({
}
}
this
.
group
.
removeAll
();
this
.
group
.
removeAll
();
this
.
_incrementalDisplayable
=
null
;
var
coordSys
=
seriesModel
.
coordinateSystem
;
var
coordSys
=
seriesModel
.
coordinateSystem
;
if
(
coordSys
.
type
===
'
cartesian2d
'
||
coordSys
.
type
===
'
calendar
'
)
{
if
(
coordSys
.
type
===
'
cartesian2d
'
||
coordSys
.
type
===
'
calendar
'
)
{
this
.
_renderOnCartesianAndCalendar
(
coordSys
,
seriesModel
,
api
);
this
.
_renderOnCartesianAndCalendar
(
seriesModel
,
api
,
0
,
seriesModel
.
getData
().
count
()
);
}
}
else
if
(
isGeoCoordSys
(
coordSys
))
{
else
if
(
isGeoCoordSys
(
coordSys
))
{
this
.
_renderOnGeo
(
this
.
_renderOnGeo
(
...
@@ -88,10 +91,20 @@ export default echarts.extendChartView({
...
@@ -88,10 +91,20 @@ export default echarts.extendChartView({
}
}
},
},
dispose
:
function
()
{},
incrementalPrepareRender
:
function
(
seriesModel
,
ecModel
,
api
)
{
this
.
group
.
removeAll
();
},
incrementalRender
:
function
(
params
,
seriesModel
,
ecModel
,
api
)
{
var
coordSys
=
seriesModel
.
coordinateSystem
;
if
(
coordSys
)
{
this
.
_renderOnCartesianAndCalendar
(
seriesModel
,
api
,
params
.
start
,
params
.
end
,
true
);
}
},
_renderOnCartesianAndCalendar
:
function
(
coordSys
,
seriesModel
,
api
)
{
_renderOnCartesianAndCalendar
:
function
(
seriesModel
,
api
,
start
,
end
,
incremental
)
{
var
coordSys
=
seriesModel
.
coordinateSystem
;
if
(
coordSys
.
type
===
'
cartesian2d
'
)
{
if
(
coordSys
.
type
===
'
cartesian2d
'
)
{
var
xAxis
=
coordSys
.
getAxis
(
'
x
'
);
var
xAxis
=
coordSys
.
getAxis
(
'
x
'
);
var
yAxis
=
coordSys
.
getAxis
(
'
y
'
);
var
yAxis
=
coordSys
.
getAxis
(
'
y
'
);
...
@@ -134,7 +147,7 @@ export default echarts.extendChartView({
...
@@ -134,7 +147,7 @@ export default echarts.extendChartView({
seriesModel
.
coordDimToDataDim
(
'
value
'
)[
0
]
seriesModel
.
coordDimToDataDim
(
'
value
'
)[
0
]
];
];
data
.
each
(
function
(
idx
)
{
for
(
var
idx
=
start
;
idx
<
end
;
idx
++
)
{
var
rect
;
var
rect
;
if
(
coordSysType
===
'
cartesian2d
'
)
{
if
(
coordSysType
===
'
cartesian2d
'
)
{
...
@@ -206,9 +219,17 @@ export default echarts.extendChartView({
...
@@ -206,9 +219,17 @@ export default echarts.extendChartView({
rect
.
setStyle
(
style
);
rect
.
setStyle
(
style
);
graphic
.
setHoverStyle
(
rect
,
data
.
hasItemOption
?
hoverStl
:
zrUtil
.
extend
({},
hoverStl
));
graphic
.
setHoverStyle
(
rect
,
data
.
hasItemOption
?
hoverStl
:
zrUtil
.
extend
({},
hoverStl
));
rect
.
incremental
=
incremental
;
// PENDING
if
(
incremental
)
{
rect
.
needsClear
=
start
===
0
;
// Rect must use hover layer if it's incremental.
rect
.
useHoverLayer
=
true
;
}
group
.
add
(
rect
);
group
.
add
(
rect
);
data
.
setItemGraphicEl
(
idx
,
rect
);
data
.
setItemGraphicEl
(
idx
,
rect
);
}
);
}
},
},
_renderOnGeo
:
function
(
geo
,
seriesModel
,
visualMapModel
,
api
)
{
_renderOnGeo
:
function
(
geo
,
seriesModel
,
visualMapModel
,
api
)
{
...
@@ -272,5 +293,7 @@ export default echarts.extendChartView({
...
@@ -272,5 +293,7 @@ export default echarts.extendChartView({
silent
:
true
silent
:
true
});
});
this
.
group
.
add
(
img
);
this
.
group
.
add
(
img
);
}
},
dispose
:
function
()
{}
});
});
\ No newline at end of file
src/util/graphic.js
浏览文件 @
ad2709b6
...
@@ -21,6 +21,7 @@ import CompoundPath from 'zrender/src/graphic/CompoundPath';
...
@@ -21,6 +21,7 @@ import CompoundPath from 'zrender/src/graphic/CompoundPath';
import
LinearGradient
from
'
zrender/src/graphic/LinearGradient
'
;
import
LinearGradient
from
'
zrender/src/graphic/LinearGradient
'
;
import
RadialGradient
from
'
zrender/src/graphic/RadialGradient
'
;
import
RadialGradient
from
'
zrender/src/graphic/RadialGradient
'
;
import
BoundingRect
from
'
zrender/src/core/BoundingRect
'
;
import
BoundingRect
from
'
zrender/src/core/BoundingRect
'
;
import
IncrementalDisplayable
from
'
zrender/src/graphic/IncrementalDisplayable
'
;
var
round
=
Math
.
round
;
var
round
=
Math
.
round
;
...
@@ -1073,6 +1074,7 @@ export {
...
@@ -1073,6 +1074,7 @@ export {
Line
,
Line
,
BezierCurve
,
BezierCurve
,
Arc
,
Arc
,
IncrementalDisplayable
,
CompoundPath
,
CompoundPath
,
LinearGradient
,
LinearGradient
,
RadialGradient
,
RadialGradient
,
...
...
test/heatmap-large.html
浏览文件 @
ad2709b6
...
@@ -39,8 +39,8 @@
...
@@ -39,8 +39,8 @@
noise
.
seed
(
Math
.
random
());
noise
.
seed
(
Math
.
random
());
function
generateData
(
theta
,
min
,
max
)
{
function
generateData
(
theta
,
min
,
max
)
{
var
data
=
[];
var
data
=
[];
for
(
var
i
=
0
;
i
<=
1
00
;
i
++
)
{
for
(
var
i
=
0
;
i
<=
3
00
;
i
++
)
{
for
(
var
j
=
0
;
j
<=
1
00
;
j
++
)
{
for
(
var
j
=
0
;
j
<=
3
00
;
j
++
)
{
// var x = (max - min) * i / 200 + min;
// var x = (max - min) * i / 200 + min;
// var y = (max - min) * j / 100 + min;
// var y = (max - min) * j / 100 + min;
data
.
push
([
i
,
j
,
noise
.
perlin2
(
i
/
40
,
j
/
20
)
+
0.5
]);
data
.
push
([
i
,
j
,
noise
.
perlin2
(
i
/
40
,
j
/
20
)
+
0.5
]);
...
@@ -70,7 +70,6 @@
...
@@ -70,7 +70,6 @@
min
:
0
,
min
:
0
,
max
:
1
,
max
:
1
,
calculable
:
true
,
calculable
:
true
,
realtime
:
false
,
splitNumber
:
8
,
splitNumber
:
8
,
inRange
:
{
inRange
:
{
color
:
[
'
#313695
'
,
'
#4575b4
'
,
'
#74add1
'
,
'
#abd9e9
'
,
'
#e0f3f8
'
,
'
#ffffbf
'
,
'
#fee090
'
,
'
#fdae61
'
,
'
#f46d43
'
,
'
#d73027
'
,
'
#a50026
'
]
color
:
[
'
#313695
'
,
'
#4575b4
'
,
'
#74add1
'
,
'
#abd9e9
'
,
'
#e0f3f8
'
,
'
#ffffbf
'
,
'
#fee090
'
,
'
#fdae61
'
,
'
#f46d43
'
,
'
#d73027
'
,
'
#a50026
'
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录