Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
bcea9b40
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,发现更多精彩内容 >>
提交
bcea9b40
编写于
1月 11, 2018
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix map on dimension.
上级
5ddb32ef
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
13 deletion
+29
-13
src/chart/map/MapSeries.js
src/chart/map/MapSeries.js
+1
-1
src/data/List.js
src/data/List.js
+9
-3
src/data/OrdinalMeta.js
src/data/OrdinalMeta.js
+6
-5
src/data/helper/sourceHelper.js
src/data/helper/sourceHelper.js
+13
-4
未找到文件。
src/chart/map/MapSeries.js
浏览文件 @
bcea9b40
...
...
@@ -66,7 +66,7 @@ var MapSeries = SeriesModel.extend({
// Shallow clone
// option = zrUtil.extend({}, option);
option
.
data
=
geoCreator
.
getFilledRegions
(
option
.
data
,
mapName
,
option
.
nameMap
);
//
option.data = geoCreator.getFilledRegions(option.data, mapName, option.nameMap);
// return option;
},
...
...
src/data/List.js
浏览文件 @
bcea9b40
...
...
@@ -10,6 +10,7 @@ import DataDiffer from './DataDiffer';
import
Source
from
'
./Source
'
;
import
{
defaultDimValueGetters
,
DefaultDataProvider
}
from
'
./helper/dataProvider
'
;
import
{
summarizeDimensions
}
from
'
./helper/dimensionHelper
'
;
import
OrdinalMeta
from
'
./OrdinalMeta
'
;
var
isObject
=
zrUtil
.
isObject
;
...
...
@@ -103,6 +104,7 @@ var List = function (dimensions, hostModel) {
dimensionInfo
.
coordDimIndex
=
0
;
}
}
dimensionInfo
.
otherDims
=
dimensionInfo
.
otherDims
||
{};
dimensionNames
.
push
(
dimensionName
);
dimensionInfos
[
dimensionName
]
=
dimensionInfo
;
...
...
@@ -522,9 +524,13 @@ listProto._getNameFromStore = function (rawIndex) {
var
chunkOffset
=
rawIndex
%
chunkSize
;
var
dim
=
this
.
dimensions
[
nameDimIdx
];
var
ordinalMeta
=
this
.
_dimensionInfos
[
dim
].
ordinalMeta
;
return
ordinalMeta
?
ordinalMeta
.
categories
[
rawIndex
]
:
this
.
_storage
[
dim
][
chunkIndex
][
chunkOffset
];
if
(
ordinalMeta
)
{
return
ordinalMeta
.
categories
[
rawIndex
];
}
else
{
var
chunk
=
this
.
_storage
[
dim
][
chunkIndex
];
return
chunk
&&
chunk
[
chunkOffset
];
}
}
};
...
...
src/data/OrdinalMeta.js
浏览文件 @
bcea9b40
...
...
@@ -5,7 +5,7 @@ import {createHashMap, isObject, map} from 'zrender/src/core/util';
* @param {Object} [opt]
* @param {Object} [opt.categories=[]]
* @param {Object} [opt.needCollect=false]
* @param {Object} [opt.
preventD
eduplication=false]
* @param {Object} [opt.
d
eduplication=false]
*/
function
OrdinalMeta
(
opt
)
{
...
...
@@ -25,7 +25,7 @@ function OrdinalMeta(opt) {
* @private
* @type {boolean}
*/
this
.
_
preventDeduplication
=
opt
.
preventD
eduplication
;
this
.
_
deduplication
=
opt
.
d
eduplication
;
/**
* @private
...
...
@@ -46,7 +46,8 @@ OrdinalMeta.createByAxisModel = function (axisModel) {
return
new
OrdinalMeta
({
categories
:
categories
,
needCollect
:
!
categories
,
preventDeduplication
:
option
.
dedplication
===
false
// deduplication is default in axis.
deduplication
:
option
.
dedplication
!==
false
});
};
...
...
@@ -76,7 +77,7 @@ proto.parseAndCollect = function (category) {
// (set axis.deduplication = false), because echarts do not know whether
// the values in the category dimension has duplication (consider the
// parallel-aqi example)
if
(
needCollect
&&
this
.
_preventD
eduplication
)
{
if
(
needCollect
&&
!
this
.
_d
eduplication
)
{
index
=
this
.
categories
.
length
;
this
.
categories
[
index
]
=
category
;
return
index
;
...
...
@@ -99,7 +100,7 @@ proto.parseAndCollect = function (category) {
return
index
;
};
//
D
o not create map until needed.
//
Consider big data, d
o not create map until needed.
function
getOrCreateMap
(
ordinalMeta
)
{
return
ordinalMeta
.
_map
||
(
ordinalMeta
.
_map
=
createHashMap
(
ordinalMeta
.
categories
)
...
...
src/data/helper/sourceHelper.js
浏览文件 @
bcea9b40
...
...
@@ -294,7 +294,8 @@ function objectRowsCollectDimensions(data) {
}
// ??? TODO merge to completedimensions, where also has
// default encode making logic.
// default encode making logic. And the default rule
// should depends on series? consider 'map'.
function
makeDefaultEncode
(
seriesModel
,
datasetModel
,
data
,
sourceFormat
,
seriesLayoutBy
,
completeResult
)
{
...
...
@@ -306,17 +307,25 @@ function makeDefaultEncode(
var
encodeSeriesName
=
[];
var
seriesType
=
seriesModel
.
subType
;
// ??? TODO refactor: provide by series itself.
// Consider the case: 'map' series is based on geo coordSys,
// 'graph', 'heatmap' can be based on cartesian. But can not
// give default rule simply here.
var
nSeriesMap
=
createHashMap
([
'
pie
'
,
'
map
'
,
'
funnel
'
]);
var
cSeriesMap
=
createHashMap
([
'
line
'
,
'
bar
'
,
'
pictorialBar
'
,
'
scatter
'
,
'
effectScatter
'
,
'
candlestick
'
,
'
boxplot
'
]);
// Usually in this case series will use the first data
// dimension as the "value" dimension, or other default
// processes respectively.
if
(
coordSysDefine
)
{
if
(
coordSysDefine
&&
cSeriesMap
.
get
(
seriesType
)
!=
null
)
{
var
ecModel
=
seriesModel
.
ecModel
;
var
datasetMap
=
inner
(
ecModel
).
datasetMap
;
var
key
=
datasetModel
.
uid
+
'
_
'
+
seriesLayoutBy
;
var
datasetRecord
=
datasetMap
.
get
(
key
)
||
datasetMap
.
set
(
key
,
{
categoryWayDim
:
1
,
valueWayDim
:
0
});
// ??? TODO refactor: provide by series itself.
each
(
coordSysDefine
.
coordSysDims
,
function
(
coordDim
)
{
// In value way.
if
(
coordSysDefine
.
firstCategoryDimIndex
==
null
)
{
...
...
@@ -342,7 +351,7 @@ function makeDefaultEncode(
}
// ??? TODO refactor: provide by series itself.
// [{name: ..., value: ...}, ...] like:
else
if
(
seriesType
===
'
pie
'
||
seriesType
===
'
map
'
||
seriesType
===
'
funnel
'
)
{
else
if
(
nSeriesMap
.
get
(
seriesType
)
!=
null
)
{
// Find the first not ordinal. (5 is an experience value)
var
firstNotOrdinal
;
for
(
var
i
=
0
;
i
<
5
&&
firstNotOrdinal
==
null
;
i
++
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录