Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
6002a2ce
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,发现更多精彩内容 >>
提交
6002a2ce
编写于
12月 31, 2017
作者:
P
pissang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Optimize lines updateTransform
上级
f7145b35
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
44 addition
and
3 deletion
+44
-3
src/chart/helper/LargeLineDraw.js
src/chart/helper/LargeLineDraw.js
+5
-0
src/chart/helper/LineDraw.js
src/chart/helper/LineDraw.js
+4
-1
src/chart/lines/LinesView.js
src/chart/lines/LinesView.js
+31
-0
src/chart/lines/linesLayout.js
src/chart/lines/linesLayout.js
+3
-1
src/chart/scatter/ScatterView.js
src/chart/scatter/ScatterView.js
+1
-1
未找到文件。
src/chart/helper/LargeLineDraw.js
浏览文件 @
6002a2ce
...
...
@@ -107,6 +107,10 @@ function LargeLineDraw() {
var
largeLineProto
=
LargeLineDraw
.
prototype
;
largeLineProto
.
isPersistent
=
function
()
{
return
!
this
.
_incremental
;
};
/**
* Update symbols draw by new data
* @param {module:echarts/data/List} data
...
...
@@ -192,6 +196,7 @@ largeLineProto._setCommon = function (lineEl, data, isIncremental) {
lineEl
.
useStyle
(
hostModel
.
getModel
(
'
lineStyle
'
).
getLineStyle
()
);
lineEl
.
style
.
strokeNoScale
=
true
;
var
visualColor
=
data
.
getVisual
(
'
color
'
);
if
(
visualColor
)
{
...
...
src/chart/helper/LineDraw.js
浏览文件 @
6002a2ce
...
...
@@ -18,6 +18,10 @@ function LineDraw(ctor) {
var
lineDrawProto
=
LineDraw
.
prototype
;
lineDrawProto
.
isPersistent
=
function
()
{
return
true
;
};
/**
* @param {module:echarts/data/List} lineData
*/
...
...
@@ -100,7 +104,6 @@ lineDrawProto.incrementalUpdate = function (taskParams, lineData) {
var
itemLayout
=
lineData
.
getItemLayout
(
idx
);
if
(
lineNeedsDraw
(
itemLayout
))
{
// ??? IncrementalDisplayable do not support Group.
var
el
=
new
this
.
_ctor
(
lineData
,
idx
,
this
.
_seriesScope
);
el
.
traverse
(
updateIncrementalAndHover
);
this
.
group
.
add
(
el
);
...
...
src/chart/lines/LinesView.js
浏览文件 @
6002a2ce
...
...
@@ -6,6 +6,7 @@ import Line from '../helper/Line';
import
Polyline
from
'
../helper/Polyline
'
;
import
EffectPolyline
from
'
../helper/EffectPolyline
'
;
import
LargeLineDraw
from
'
../helper/LargeLineDraw
'
;
import
*
as
matrix
from
'
zrender/src/core/matrix
'
;
export
default
echarts
.
extendChartView
({
...
...
@@ -16,6 +17,8 @@ export default echarts.extendChartView({
render
:
function
(
seriesModel
,
ecModel
,
api
)
{
var
data
=
seriesModel
.
getData
();
this
.
_updateGroupTransform
(
seriesModel
);
var
lineDraw
=
this
.
_updateLineDraw
(
data
,
seriesModel
);
var
zlevel
=
seriesModel
.
get
(
'
zlevel
'
);
...
...
@@ -62,6 +65,8 @@ export default echarts.extendChartView({
incrementalPrepareRender
:
function
(
seriesModel
,
ecModel
,
api
)
{
var
data
=
seriesModel
.
getData
();
this
.
_updateGroupTransform
(
seriesModel
);
var
lineDraw
=
this
.
_updateLineDraw
(
data
,
seriesModel
);
lineDraw
.
incrementalPrepareUpdate
(
data
);
...
...
@@ -73,6 +78,32 @@ export default echarts.extendChartView({
this
.
_lineDraw
.
incrementalUpdate
(
taskParams
,
seriesModel
.
getData
());
},
updateTransform
:
function
(
seriesModel
,
ecModel
,
api
)
{
var
coordSys
=
seriesModel
.
coordinateSystem
;
var
update
=
true
;
// Must mark group dirty and make sure the incremental layer will be cleared
// PENDING
this
.
group
.
dirty
();
if
(
coordSys
.
getRoamTransform
)
{
update
=
false
;
this
.
_updateGroupTransform
(
seriesModel
);
}
if
(
update
||
!
this
.
_finished
||
!
this
.
_lineDraw
.
isPersistent
())
{
return
{
update
:
true
};
}
},
_updateGroupTransform
:
function
(
seriesModel
)
{
var
coordSys
=
seriesModel
.
coordinateSystem
;
if
(
coordSys
&&
coordSys
.
getRoamTransform
)
{
this
.
group
.
transform
=
matrix
.
clone
(
coordSys
.
getRoamTransform
());
this
.
group
.
decomposeTransform
();
}
},
_updateLineDraw
:
function
(
data
,
seriesModel
)
{
var
lineDraw
=
this
.
_lineDraw
;
var
hasEffect
=
this
.
_showEffect
(
seriesModel
);
...
...
src/chart/lines/linesLayout.js
浏览文件 @
6002a2ce
...
...
@@ -34,7 +34,9 @@ export default {
points
[
offset
++
]
=
len
;
}
for
(
var
k
=
0
;
k
<
len
;
k
++
)
{
pt
=
coordSys
.
dataToPoint
(
lineCoords
[
k
],
null
,
pt
);
// Second parameter is used in coordinate system geo, view.
// FIXME, if other coordinate system has second parameter.
pt
=
coordSys
.
dataToPoint
(
lineCoords
[
k
],
true
,
pt
);
points
[
offset
++
]
=
pt
[
0
];
points
[
offset
++
]
=
pt
[
1
];
}
...
...
src/chart/scatter/ScatterView.js
浏览文件 @
6002a2ce
...
...
@@ -67,7 +67,7 @@ echarts.extendChartView({
if
(
coordSys
&&
coordSys
.
removeRoamTransformInPoint
)
{
var
data
=
seriesModel
.
getData
();
var
pt
=
[];
if
(
seriesModel
.
get
(
'
large
'
)
)
{
if
(
seriesModel
.
pipelineContext
.
large
)
{
var
points
=
data
.
getLayout
(
'
symbolPoints
'
);
if
(
points
)
{
for
(
var
i
=
0
;
i
<
points
.
length
;
i
+=
2
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录