Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
missman
incubator-echarts
提交
7ffec768
I
incubator-echarts
项目概览
missman
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
7ffec768
编写于
12月 29, 2017
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'next' of
https://github.com/100pah/echarts
into next
上级
6d32b03e
f4268c0f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
32 deletion
+31
-32
src/data/List.js
src/data/List.js
+31
-32
未找到文件。
src/data/List.js
浏览文件 @
7ffec768
...
...
@@ -423,6 +423,9 @@ listProto.initData = function (data, nameList, dimValueGetter) {
);
};
// Reset raw extent.
this
.
_rawExtent
=
{};
this
.
_initDataFromProvider
(
0
,
data
.
count
());
// If data has no item option.
...
...
@@ -459,6 +462,7 @@ listProto._initDataFromProvider = function (start, end) {
var
dimensionInfoMap
=
this
.
_dimensionInfos
;
var
nameList
=
this
.
_nameList
;
var
idList
=
this
.
_idList
;
var
rawExtent
=
this
.
_rawExtent
;
var
nameRepeatCount
=
this
.
_nameRepeatCount
=
{};
var
nameDimIdx
;
...
...
@@ -466,6 +470,9 @@ listProto._initDataFromProvider = function (start, end) {
var
lastChunkIndex
=
chunkCount
-
1
;
for
(
var
i
=
0
;
i
<
dimensions
.
length
;
i
++
)
{
var
dim
=
dimensions
[
i
];
if
(
!
rawExtent
[
dim
])
{
rawExtent
[
dim
]
=
[
Infinity
,
-
Infinity
];
}
var
dimInfo
=
dimensionInfoMap
[
dim
];
if
(
dimInfo
.
otherDims
.
itemName
===
0
)
{
...
...
@@ -511,7 +518,15 @@ listProto._initDataFromProvider = function (start, end) {
var
dim
=
dimensions
[
k
];
var
dimStorage
=
storage
[
dim
][
chunkIndex
];
// PENDING NULL is empty or zero
dimStorage
[
chunkOffset
]
=
this
.
_dimValueGetter
(
dataItem
,
dim
,
idx
,
k
);
var
val
=
this
.
_dimValueGetter
(
dataItem
,
dim
,
idx
,
k
);
dimStorage
[
chunkOffset
]
=
val
;
if
(
val
<
rawExtent
[
dim
][
0
])
{
rawExtent
[
dim
][
0
]
=
val
;
}
if
(
val
>
rawExtent
[
dim
][
1
])
{
rawExtent
[
dim
][
1
]
=
val
;
}
}
// Use the name in option and create id
...
...
@@ -668,14 +683,15 @@ listProto.hasValue = function (idx) {
* Get extent of data in one dimension
* @param {string} dim
* @param {boolean} stack
* @param {Function} filter
*/
listProto
.
getDataExtent
=
function
(
dim
,
stack
,
filter
)
{
listProto
.
getDataExtent
=
function
(
dim
,
stack
)
{
// Make sure use concrete dim as cache name.
dim
=
this
.
getDimension
(
dim
);
var
dimData
=
this
.
_storage
[
dim
];
var
initialExtent
=
[
Infinity
,
-
Infinity
];
stack
=
stack
||
false
;
if
(
!
dimData
)
{
return
initialExtent
;
}
...
...
@@ -690,46 +706,29 @@ listProto.getDataExtent = function (dim, stack, filter) {
// Consider the most cases when using data zoom, `getDataExtent`
// happened before filtering. We cache raw extent, which is not
// necessary to be cleared and recalculated when restore data.
var
useRaw
=
!
this
.
_indices
&&
!
filter
&&
!
stacked
;
var
rawExtentCache
=
this
.
_rawExtent
[
dim
]
=
this
.
_rawExtent
[
dim
]
||
{};
var
useRaw
=
!
this
.
_indices
&&
!
stacked
;
var
dimExtent
;
var
dimExtentEnd
;
// Assume that rawExtentCache.end > currEnd will never happen.
// After data appended, rawExtentCache.end < currEnd.
if
(
useRaw
)
{
dimExtent
=
rawExtentCache
.
extent
||
initialExtent
;
dimExtentEnd
=
rawExtentCache
.
end
||
0
;
if
(
dimExtentEnd
===
currEnd
)
{
return
dimExtent
.
slice
();
}
return
this
.
_rawExtent
[
dim
].
slice
();
}
else
{
dimExtent
=
this
.
_extent
[
cacheName
];
if
(
dimExtent
)
{
return
dimExtent
.
slice
();
}
dimExtent
=
initialExtent
;
dimExtentEnd
=
0
;
dimExtent
=
this
.
_extent
[
cacheName
];
if
(
dimExtent
)
{
return
dimExtent
.
slice
();
}
dimExtent
=
initialExtent
;
var
min
=
dimExtent
[
0
];
var
max
=
dimExtent
[
1
];
for
(
var
i
=
dimExtentEnd
;
i
<
currEnd
;
i
++
)
{
var
value
=
this
.
get
(
dim
,
i
,
stack
);
if
(
!
filter
||
filter
(
value
,
dim
,
i
))
{
value
<
min
&&
(
min
=
value
);
value
>
max
&&
(
max
=
value
);
}
for
(
var
i
=
0
;
i
<
currEnd
;
i
++
)
{
var
value
=
stack
?
this
.
get
(
dim
,
i
,
true
)
:
this
.
_getFast
(
dim
,
this
.
getRawIndex
(
i
));
value
<
min
&&
(
min
=
value
);
value
>
max
&&
(
max
=
value
);
}
dimExtent
=
[
min
,
max
];
if
(
useRaw
)
{
rawExtentCache
.
extent
=
dimExtent
;
rawExtentCache
.
end
=
currEnd
;
}
this
.
_extent
[
cacheName
]
=
dimExtent
;
return
dimExtent
;
...
...
@@ -741,9 +740,9 @@ listProto.getDataExtent = function (dim, stack, filter) {
* extent calculation will cost more than 10ms and the cache will
* be erased because of the filtering.
*/
listProto
.
getApproximateExtent
=
function
(
dim
,
stack
,
filter
)
{
listProto
.
getApproximateExtent
=
function
(
dim
,
stack
)
{
dim
=
this
.
getDimension
(
dim
);
return
this
.
_approximateExtent
[
dim
]
||
this
.
getDataExtent
(
dim
,
stack
,
filter
);
return
this
.
_approximateExtent
[
dim
]
||
this
.
getDataExtent
(
dim
,
stack
);
};
listProto
.
setApproximateExtent
=
function
(
extent
,
dim
,
stack
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录