Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
强哥很慌张
Echarts
提交
f6612561
E
Echarts
项目概览
强哥很慌张
/
Echarts
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
Echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f6612561
编写于
2月 26, 2018
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix heatmap dimensions.
上级
96f2fae1
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
33 addition
and
15 deletion
+33
-15
src/chart/heatmap/HeatmapSeries.js
src/chart/heatmap/HeatmapSeries.js
+3
-1
src/chart/helper/createListFromArray.js
src/chart/helper/createListFromArray.js
+7
-2
src/chart/radar/RadarSeries.js
src/chart/radar/RadarSeries.js
+2
-1
src/data/helper/completeDimensions.js
src/data/helper/completeDimensions.js
+15
-7
src/data/helper/createDimensions.js
src/data/helper/createDimensions.js
+3
-1
src/data/helper/dimensionHelper.js
src/data/helper/dimensionHelper.js
+3
-3
未找到文件。
src/chart/heatmap/HeatmapSeries.js
浏览文件 @
f6612561
...
...
@@ -6,7 +6,9 @@ export default SeriesModel.extend({
type
:
'
series.heatmap
'
,
getInitialData
:
function
(
option
,
ecModel
)
{
return
createListFromArray
(
this
.
getSource
(),
this
);
return
createListFromArray
(
this
.
getSource
(),
this
,
{
generateCoord
:
'
value
'
});
},
preventIncremental
:
function
()
{
...
...
src/chart/helper/createListFromArray.js
浏览文件 @
f6612561
...
...
@@ -12,8 +12,12 @@ import {enableDataStack} from '../../data/helper/dataStackHelper';
/**
* @param {module:echarts/data/Source|Array} source Or raw data.
* @param {module:echarts/model/Series} seriesModel
* @param {Object} [opt]
* @param {string} [opt.generateCoord]
*/
function
createListFromArray
(
source
,
seriesModel
)
{
function
createListFromArray
(
source
,
seriesModel
,
opt
)
{
opt
=
opt
||
{};
if
(
!
Source
.
isInstance
(
source
))
{
source
=
Source
.
seriesDataToSource
(
source
);
}
...
...
@@ -48,7 +52,8 @@ function createListFromArray(source, seriesModel) {
}
var
dimInfoList
=
createDimensions
(
source
,
{
coordDimensions
:
coordSysDimDefs
coordDimensions
:
coordSysDimDefs
,
generateCoord
:
opt
.
generateCoord
});
var
firstCategoryDimIndex
;
...
...
src/chart/radar/RadarSeries.js
浏览文件 @
f6612561
...
...
@@ -23,7 +23,8 @@ var RadarSeries = SeriesModel.extend({
getInitialData
:
function
(
option
,
ecModel
)
{
return
createListSimply
(
this
,
{
generateCoord
:
'
indicator_
'
generateCoord
:
'
indicator_
'
,
generateCoordCount
:
Infinity
});
},
...
...
src/data/helper/completeDimensions.js
浏览文件 @
f6612561
...
...
@@ -29,11 +29,13 @@ import {OTHER_DIMENSIONS} from './dimensionHelper';
* @param {Array.<Object|string>} [opt.dimsDef] option.series.dimensions User defined dimensions
* For example: ['asdf', {name, type}, ...].
* @param {Object|HashMap} [opt.encodeDef] option.series.encode {x: 2, y: [3, 1], tooltip: [1, 2], label: 3}
* @param {string} [opt.generateCoord] Generate coord dim with the given prefix.
* The generated dim names will be:
* generateCoord + 0, generateCoord + 1, ...
* @param {string} [opt.generateCoord] Generate coord dim with the given name.
* If not specified, extra dim names will be:
* 'value', 'value0', 'value1', ...
* @param {number} [opt.generateCoordCount] By default, the generated dim name is `generateCoord`.
* If `generateCoordCount` specified, the generated dim names will be:
* `generateCoord` + 0, `generateCoord` + 1, ...
* can be Infinity, indicate that use all of the remain columns.
* @param {number} [opt.dimCount] If not specified, guess by the first data item.
* @param {number} [opt.encodeDefaulter] If not specified, auto find the next available data dim.
* @return {Array.<Object>} [{
...
...
@@ -162,8 +164,11 @@ function completeDimensions(sysDims, source, opt) {
}
// Make sure the first extra dim is 'value'.
var
doesGenerateCoord
=
!!
opt
.
generateCoord
;
var
extra
=
opt
.
generateCoord
||
'
value
'
;
var
generateCoord
=
opt
.
generateCoord
;
var
generateCoordCount
=
opt
.
generateCoordCount
;
var
fromZero
=
generateCoordCount
!=
null
;
generateCoordCount
=
generateCoord
?
(
generateCoordCount
||
1
)
:
0
;
var
extra
=
generateCoord
||
'
value
'
;
// Set dim `name` and other `coordDim` and other props.
for
(
var
resultDimIdx
=
0
;
resultDimIdx
<
dimCount
;
resultDimIdx
++
)
{
...
...
@@ -172,10 +177,13 @@ function completeDimensions(sysDims, source, opt) {
if
(
coordDim
==
null
)
{
resultItem
.
coordDim
=
genName
(
extra
,
coordDimNameMap
,
doesGenerateCoord
extra
,
coordDimNameMap
,
fromZero
);
resultItem
.
coordDimIndex
=
0
;
resultItem
.
isExtraCoord
=
!
doesGenerateCoord
;
if
(
!
generateCoord
||
generateCoordCount
<=
0
)
{
resultItem
.
isExtraCoord
=
true
;
}
generateCoordCount
--
;
}
resultItem
.
name
==
null
&&
(
resultItem
.
name
=
genName
(
...
...
src/data/helper/createDimensions.js
浏览文件 @
f6612561
...
...
@@ -10,6 +10,7 @@ import completeDimensions from './completeDimensions';
* @param {Array.<string|Object>} [opt.coordDimensions=[]]
* @param {number} [opt.dimensionsCount]
* @param {string} [opt.generateCoord]
* @param {string} [opt.generateCoordCount]
* @param {Array.<string|Object>} [opt.dimensionsDefine=source.dimensionsDefine] Overwrite source define.
* @param {Object|HashMap} [opt.encodeDefine=source.encodeDefine] Overwrite source define.
* @return {Array.<Object>} dimensionsInfo
...
...
@@ -20,6 +21,7 @@ export default function (source, opt) {
dimsDef
:
opt
.
dimensionsDefine
||
source
.
dimensionsDefine
,
encodeDef
:
opt
.
encodeDefine
||
source
.
encodeDefine
,
dimCount
:
opt
.
dimensionsCount
,
generateCoord
:
opt
.
generateCoord
generateCoord
:
opt
.
generateCoord
,
generateCoordCount
:
opt
.
generateCoordCount
});
}
src/data/helper/dimensionHelper.js
浏览文件 @
f6612561
import
{
each
,
filter
,
createHashMap
,
assert
}
from
'
zrender/src/core/util
'
;
import
{
each
,
createHashMap
,
assert
}
from
'
zrender/src/core/util
'
;
import
{
__DEV__
}
from
'
../../config
'
;
export
var
OTHER_DIMENSIONS
=
createHashMap
([
...
...
@@ -30,8 +30,8 @@ export function summarizeDimensions(data) {
if
(
mayLabelDimType
(
dimItem
.
type
))
{
// Use the last coord dim (and label friendly) as default label,
// because both show x, y on label is not look good, and
usually
//
y axis is more focusd conventionally
.
// because both show x, y on label is not look good, and
//
conventionally y axis is focused more
.
defaultedLabel
[
0
]
=
dimName
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录