Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
半栈学徒
incubator-echarts
提交
a7c2f713
I
incubator-echarts
项目概览
半栈学徒
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
5
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,发现更多精彩内容 >>
提交
a7c2f713
编写于
9月 16, 2015
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Line fix after new List
上级
be623cca
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
12 addition
and
23 deletion
+12
-23
src/chart/helper/DataSymbol.js
src/chart/helper/DataSymbol.js
+1
-9
src/chart/line/LineView.js
src/chart/line/LineView.js
+9
-8
src/data/List.js
src/data/List.js
+1
-1
test/ut/spec/data/List.js
test/ut/spec/data/List.js
+1
-5
未找到文件。
src/chart/helper/DataSymbol.js
浏览文件 @
a7c2f713
...
...
@@ -4,10 +4,6 @@ define(function (require) {
var
Group
=
require
(
'
zrender/container/Group
'
);
var
symbolCreators
=
require
(
'
../../util/symbol
'
);
function
getSymbolElement
(
dataItem
)
{
return
dataItem
.
__symbolEl
;
}
function
createSymbol
(
data
,
idx
,
enableAnimation
)
{
var
point
=
data
.
getItemLayout
(
idx
);
var
color
=
data
.
getItemVisual
(
idx
,
'
color
'
);
...
...
@@ -63,10 +59,6 @@ define(function (require) {
return
this
.
_data
;
},
getSymbolElements
:
function
()
{
return
this
.
_data
.
map
(
getSymbolElement
);
},
updateData
:
function
(
data
,
enableAnimation
)
{
var
group
=
this
.
group
;
...
...
@@ -110,7 +102,7 @@ define(function (require) {
else
{
el
.
attr
({
scale
:
[
symbolSize
,
symbolSize
],
position
:
point
position
:
point
.
slice
()
});
}
...
...
src/chart/line/LineView.js
浏览文件 @
a7c2f713
...
...
@@ -38,9 +38,10 @@ define(function(require) {
var
lineStyleNormalModel
=
seriesModel
.
getModel
(
'
itemStyle.normal.lineStyle
'
);
var
points
=
data
.
map
(
data
.
getItemLayout
,
true
);
var
pointsWithName
=
data
.
map
(
function
(
dataItem
,
idx
)
{
var
pointsWithName
=
data
.
map
(
function
(
idx
)
{
return
{
name
:
dataItem
.
name
,
// TODO Use category names if possible
name
:
data
.
getRawIndex
(
idx
),
point
:
points
[
idx
]
};
});
...
...
@@ -95,7 +96,7 @@ define(function(require) {
dataSymbol
.
updateData
(
data
,
false
);
// In the case data zoom triggerred refreshing frequently
// Data may not change if line has a category axis. So it should animate nothing
if
(
!
isPointsSame
(
this
.
_pointsWithName
,
pointsWithName
))
{
if
(
!
isPointsSame
(
this
.
_pointsWithName
,
pointsWithName
))
{
this
.
_updateAnimation
(
data
,
pointsWithName
);
}
// Add back
...
...
@@ -111,7 +112,6 @@ define(function(require) {
var
polyline
=
this
.
_polyline
;
var
diff
=
lineAnimationDiff
(
this
.
_pointsWithName
,
pointsWithName
);
polyline
.
shape
.
points
=
diff
.
current
;
// FIXME Handle the situation of adding and removing data
polyline
.
animateTo
({
shape
:
{
points
:
diff
.
next
...
...
@@ -120,7 +120,7 @@ define(function(require) {
var
updatedDataIndices
=
[];
var
diffStatus
=
diff
.
status
;
var
symbolElements
=
this
.
_dataSymbol
.
getSymbolElements
();
var
data
=
this
.
_dataSymbol
.
getData
();
for
(
var
i
=
0
;
i
<
diffStatus
.
length
;
i
++
)
{
if
(
diffStatus
[
i
]
===
'
=
'
)
{
...
...
@@ -132,12 +132,13 @@ define(function(require) {
polyline
.
animators
[
0
].
during
(
function
()
{
// Symbol elements may be more than updatedDataIndices if there is new added data
for
(
var
i
=
0
;
i
<
updatedDataIndices
.
length
;
i
++
)
{
var
el
=
data
.
getItemGraphicEl
(
i
);
vector
.
copy
(
symbolElements
[
i
]
.
position
,
// synchronizing w
h
ith the point on line
el
.
position
,
// synchronizing with the point on line
polyline
.
shape
.
points
[
updatedDataIndices
[
i
]]
);
symbolElements
[
i
]
.
dirty
();
el
.
dirty
();
}
});
}
...
...
src/data/List.js
浏览文件 @
a7c2f713
...
...
@@ -293,7 +293,7 @@ define(function (require) {
/**
* Get raw data index
*/
listProto
.
get
Data
Index
=
function
(
idx
)
{
listProto
.
get
Raw
Index
=
function
(
idx
)
{
return
this
.
indices
[
idx
];
};
...
...
test/ut/spec/data/List.js
浏览文件 @
a7c2f713
...
...
@@ -87,17 +87,13 @@ describe('List', function () {
testCase
(
'
Data types
'
,
function
(
List
)
{
var
list
=
new
List
([{
name
:
'
name
'
,
type
:
'
string
'
},
{
name
:
'
x
'
,
type
:
'
int
'
},
{
name
:
'
y
'
,
type
:
'
float
'
}]);
list
.
initData
([[
'
foo
'
,
1.1
,
1.1
]]);
expect
(
list
.
get
(
'
name
'
,
0
)).
toEqual
(
'
foo
'
);
list
.
initData
([[
1.1
,
1.1
]]);
expect
(
list
.
get
(
'
x
'
,
0
)).
toEqual
(
1
);
expect
(
list
.
get
(
'
y
'
,
0
)).
toBeCloseTo
(
1.1
,
5
);
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录