Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
3438bb1d
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,发现更多精彩内容 >>
提交
3438bb1d
编写于
2月 07, 2017
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Export helper methods, some tweaks for better interface
上级
07b819d1
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
63 addition
and
44 deletion
+63
-44
src/chart/lines/linesLayout.js
src/chart/lines/linesLayout.js
+1
-1
src/chart/scatter/ScatterSeries.js
src/chart/scatter/ScatterSeries.js
+1
-1
src/component/axis/AngleAxisView.js
src/component/axis/AngleAxisView.js
+1
-1
src/component/axis/AxisBuilder.js
src/component/axis/AxisBuilder.js
+2
-2
src/component/axis/AxisView.js
src/component/axis/AxisView.js
+2
-2
src/component/axis/RadiusAxisView.js
src/component/axis/RadiusAxisView.js
+1
-1
src/component/axis/SingleAxisView.js
src/component/axis/SingleAxisView.js
+1
-1
src/component/tooltip/TooltipView.js
src/component/tooltip/TooltipView.js
+1
-1
src/coord/Axis.js
src/coord/Axis.js
+0
-17
src/coord/axisHelper.js
src/coord/axisHelper.js
+4
-6
src/coord/cartesian/Grid.js
src/coord/cartesian/Grid.js
+2
-2
src/coord/parallel/Parallel.js
src/coord/parallel/Parallel.js
+1
-1
src/coord/polar/polarCreator.js
src/coord/polar/polarCreator.js
+2
-2
src/coord/radar/Radar.js
src/coord/radar/Radar.js
+2
-2
src/coord/single/Single.js
src/coord/single/Single.js
+1
-1
src/echarts.js
src/echarts.js
+4
-2
src/helper.js
src/helper.js
+15
-0
src/model/Series.js
src/model/Series.js
+5
-1
src/scale/Scale.js
src/scale/Scale.js
+17
-0
未找到文件。
src/chart/lines/linesLayout.js
浏览文件 @
3438bb1d
...
...
@@ -8,7 +8,7 @@ define(function (require) {
// FIXME Use data dimensions ?
lineData
.
each
(
function
(
idx
)
{
var
itemModel
=
lineData
.
getItemModel
(
idx
);
// TODO Support pure array
var
coords
=
(
itemModel
.
option
instanceof
Array
)
?
itemModel
.
option
:
itemModel
.
get
(
'
coords
'
);
...
...
src/chart/scatter/ScatterSeries.js
浏览文件 @
3438bb1d
...
...
@@ -9,7 +9,7 @@ define(function (require) {
type
:
'
series.scatter
'
,
dependencies
:
[
'
grid
'
,
'
polar
'
],
dependencies
:
[
'
grid
'
,
'
polar
'
,
'
geo
'
,
'
singleAxis
'
],
getInitialData
:
function
(
option
,
ecModel
)
{
var
list
=
createListFromArray
(
option
.
data
,
this
,
ecModel
);
...
...
src/component/axis/AngleAxisView.js
浏览文件 @
3438bb1d
...
...
@@ -41,7 +41,7 @@ define(function (require) {
zrUtil
.
each
(
elementList
,
function
(
name
)
{
if
(
angleAxisModel
.
get
(
name
+
'
.show
'
)
&&
(
!
angleAxis
.
isBlank
()
||
name
===
'
axisLine
'
)
&&
(
!
angleAxis
.
scale
.
isBlank
()
||
name
===
'
axisLine
'
)
)
{
this
[
'
_
'
+
name
](
angleAxisModel
,
polar
,
ticksAngles
,
radiusExtent
);
}
...
...
src/component/axis/AxisBuilder.js
浏览文件 @
3438bb1d
...
...
@@ -173,7 +173,7 @@ define(function (require) {
var
axisModel
=
this
.
axisModel
;
var
axis
=
axisModel
.
axis
;
if
(
!
axisModel
.
get
(
'
axisTick.show
'
)
||
axis
.
isBlank
())
{
if
(
!
axisModel
.
get
(
'
axisTick.show
'
)
||
axis
.
scale
.
isBlank
())
{
return
;
}
...
...
@@ -243,7 +243,7 @@ define(function (require) {
var
axis
=
axisModel
.
axis
;
var
show
=
retrieve
(
opt
.
axisLabelShow
,
axisModel
.
get
(
'
axisLabel.show
'
));
if
(
!
show
||
axis
.
isBlank
())
{
if
(
!
show
||
axis
.
scale
.
isBlank
())
{
return
;
}
...
...
src/component/axis/AxisView.js
浏览文件 @
3438bb1d
...
...
@@ -66,7 +66,7 @@ define(function (require) {
_splitLine
:
function
(
axisModel
,
gridModel
,
labelInterval
)
{
var
axis
=
axisModel
.
axis
;
if
(
axis
.
isBlank
())
{
if
(
axis
.
scale
.
isBlank
())
{
return
;
}
...
...
@@ -140,7 +140,7 @@ define(function (require) {
_splitArea
:
function
(
axisModel
,
gridModel
,
labelInterval
)
{
var
axis
=
axisModel
.
axis
;
if
(
axis
.
isBlank
())
{
if
(
axis
.
scale
.
isBlank
())
{
return
;
}
...
...
src/component/axis/RadiusAxisView.js
浏览文件 @
3438bb1d
...
...
@@ -36,7 +36,7 @@ define(function (require) {
this
.
group
.
add
(
axisBuilder
.
getGroup
());
zrUtil
.
each
(
selfBuilderAttrs
,
function
(
name
)
{
if
(
radiusAxisModel
.
get
(
name
+
'
.show
'
)
&&
!
radiusAxis
.
isBlank
())
{
if
(
radiusAxisModel
.
get
(
name
+
'
.show
'
)
&&
!
radiusAxis
.
scale
.
isBlank
())
{
this
[
'
_
'
+
name
](
radiusAxisModel
,
polar
,
axisAngle
,
radiusExtent
,
ticksCoords
);
}
},
this
);
...
...
src/component/axis/SingleAxisView.js
浏览文件 @
3438bb1d
...
...
@@ -38,7 +38,7 @@ define(function (require) {
_splitLine
:
function
(
axisModel
,
labelInterval
)
{
var
axis
=
axisModel
.
axis
;
if
(
axis
.
isBlank
())
{
if
(
axis
.
scale
.
isBlank
())
{
return
;
}
...
...
src/component/tooltip/TooltipView.js
浏览文件 @
3438bb1d
...
...
@@ -616,7 +616,7 @@ define(function (require) {
axisType
=
baseAxis
.
dim
;
}
if
(
baseAxis
.
isBlank
()
||
zrUtil
.
eqNaN
(
point
[
0
])
||
zrUtil
.
eqNaN
(
point
[
1
]))
{
if
(
baseAxis
.
scale
.
isBlank
()
||
zrUtil
.
eqNaN
(
point
[
0
])
||
zrUtil
.
eqNaN
(
point
[
1
]))
{
this
.
_hideAxisPointer
(
coordSys
.
name
);
return
;
}
...
...
src/coord/Axis.js
浏览文件 @
3438bb1d
...
...
@@ -213,24 +213,7 @@ define(function (require) {
var
size
=
Math
.
abs
(
axisExtent
[
1
]
-
axisExtent
[
0
]);
return
Math
.
abs
(
size
)
/
len
;
},
/**
* When axis extent depends on data and no data exists,
* axis ticks should not be drawn, which is named 'blank'.
*/
isBlank
:
function
()
{
return
this
.
_isBlank
;
},
/**
* When axis extent depends on data and no data exists,
* axis ticks should not be drawn, which is named 'blank'.
*/
setBlank
:
function
(
isBlank
)
{
this
.
_isBlank
=
isBlank
;
}
};
return
Axis
;
...
...
src/coord/axisHelper.js
浏览文件 @
3438bb1d
...
...
@@ -15,8 +15,7 @@ define(function (require) {
* Get axis scale extent before niced.
* Item of returned array can only be number (including Infinity and NaN).
*/
axisHelper
.
getScaleExtent
=
function
(
axis
,
model
)
{
var
scale
=
axis
.
scale
;
axisHelper
.
getScaleExtent
=
function
(
scale
,
model
)
{
var
scaleType
=
scale
.
type
;
var
min
=
model
.
getMin
();
...
...
@@ -62,7 +61,7 @@ define(function (require) {
(
min
==
null
||
!
isFinite
(
min
))
&&
(
min
=
NaN
);
(
max
==
null
||
!
isFinite
(
max
))
&&
(
max
=
NaN
);
axis
.
setBlank
(
zrUtil
.
eqNaN
(
min
)
||
zrUtil
.
eqNaN
(
max
));
scale
.
setBlank
(
zrUtil
.
eqNaN
(
min
)
||
zrUtil
.
eqNaN
(
max
));
// Evaluate if axis needs cross zero
if
(
model
.
getNeedCrossZero
())
{
...
...
@@ -79,9 +78,8 @@ define(function (require) {
return
[
min
,
max
];
};
axisHelper
.
niceScaleExtent
=
function
(
axis
,
model
)
{
var
scale
=
axis
.
scale
;
var
extent
=
axisHelper
.
getScaleExtent
(
axis
,
model
);
axisHelper
.
niceScaleExtent
=
function
(
scale
,
model
)
{
var
extent
=
axisHelper
.
getScaleExtent
(
scale
,
model
);
var
fixMin
=
model
.
getMin
()
!=
null
;
var
fixMax
=
model
.
getMax
()
!=
null
;
var
splitNumber
=
model
.
get
(
'
splitNumber
'
);
...
...
src/coord/cartesian/Grid.js
浏览文件 @
3438bb1d
...
...
@@ -111,10 +111,10 @@ define(function(require, factory) {
}
each
(
axesMap
.
x
,
function
(
xAxis
)
{
niceScaleExtent
(
xAxis
,
xAxis
.
model
);
niceScaleExtent
(
xAxis
.
scale
,
xAxis
.
model
);
});
each
(
axesMap
.
y
,
function
(
yAxis
)
{
niceScaleExtent
(
yAxis
,
yAxis
.
model
);
niceScaleExtent
(
yAxis
.
scale
,
yAxis
.
model
);
});
// Fix configuration
each
(
axesMap
.
x
,
function
(
xAxis
)
{
...
...
src/coord/parallel/Parallel.js
浏览文件 @
3438bb1d
...
...
@@ -117,7 +117,7 @@ define(function(require) {
each
(
this
.
dimensions
,
function
(
dim
)
{
var
axis
=
this
.
_axesMap
[
dim
];
axis
.
scale
.
unionExtentFromData
(
data
,
dim
);
axisHelper
.
niceScaleExtent
(
axis
,
axis
.
model
);
axisHelper
.
niceScaleExtent
(
axis
.
scale
,
axis
.
model
);
},
this
);
},
this
);
},
...
...
src/coord/polar/polarCreator.js
浏览文件 @
3438bb1d
...
...
@@ -51,8 +51,8 @@ define(function (require) {
}
});
niceScaleExtent
(
angleAxis
,
angleAxis
.
model
);
niceScaleExtent
(
radiusAxis
,
radiusAxis
.
model
);
niceScaleExtent
(
angleAxis
.
scale
,
angleAxis
.
model
);
niceScaleExtent
(
radiusAxis
.
scale
,
radiusAxis
.
model
);
// Fix extent of category angle axis
if
(
angleAxis
.
type
===
'
category
'
&&
!
angleAxis
.
onBand
)
{
...
...
src/coord/radar/Radar.js
浏览文件 @
3438bb1d
...
...
@@ -151,8 +151,8 @@ define(function (require) {
}
// Force all the axis fixing the maxSplitNumber.
zrUtil
.
each
(
indicatorAxes
,
function
(
indicatorAxis
,
idx
)
{
var
rawExtent
=
axisHelper
.
getScaleExtent
(
indicatorAxis
,
indicatorAxis
.
model
);
axisHelper
.
niceScaleExtent
(
indicatorAxis
,
indicatorAxis
.
model
);
var
rawExtent
=
axisHelper
.
getScaleExtent
(
indicatorAxis
.
scale
,
indicatorAxis
.
model
);
axisHelper
.
niceScaleExtent
(
indicatorAxis
.
scale
,
indicatorAxis
.
model
);
var
axisModel
=
indicatorAxis
.
model
;
var
scale
=
indicatorAxis
.
scale
;
...
...
src/coord/single/Single.js
浏览文件 @
3438bb1d
...
...
@@ -99,7 +99,7 @@ define(function (require) {
this
.
_axis
.
scale
.
unionExtentFromData
(
data
,
seriesModel
.
coordDimToDataDim
(
dim
)
);
axisHelper
.
niceScaleExtent
(
this
.
_axis
,
this
.
_axis
.
model
);
axisHelper
.
niceScaleExtent
(
this
.
_axis
.
scale
,
this
.
_axis
.
model
);
}
},
this
);
},
...
...
src/echarts.js
浏览文件 @
3438bb1d
...
...
@@ -649,7 +649,7 @@ define(function (require) {
* @private
*/
update
:
function
(
payload
)
{
// console.
time && console.tim
e('update');
// console.
profile && console.profil
e('update');
var
ecModel
=
this
.
_model
;
var
api
=
this
.
_api
;
...
...
@@ -726,7 +726,7 @@ define(function (require) {
func
(
ecModel
,
api
);
});
// console.
time && console.tim
eEnd('update');
// console.
profile && console.profil
eEnd('update');
},
/**
...
...
@@ -1893,6 +1893,8 @@ define(function (require) {
}
);
echarts
.
helper
=
require
(
'
./helper
'
);
// PRIORITY
echarts
.
PRIORITY
=
{
PROCESSOR
:
{
...
...
src/helper.js
0 → 100644
浏览文件 @
3438bb1d
define
(
function
(
require
)
{
var
createListFromArray
=
require
(
'
./chart/helper/createListFromArray
'
);
// var axisHelper = require('./coord/axisHelper');
return
{
createList
:
function
(
seriesModel
)
{
var
data
=
seriesModel
.
get
(
'
data
'
);
return
createListFromArray
(
data
,
seriesModel
,
seriesModel
.
ecModel
);
}
// createScale: function () {
// }
};
});
\ No newline at end of file
src/model/Series.js
浏览文件 @
3438bb1d
...
...
@@ -64,11 +64,15 @@ define(function(require) {
this
.
mergeDefaultAndTheme
(
option
,
ecModel
);
var
data
=
this
.
getInitialData
(
option
,
ecModel
);
if
(
__DEV__
)
{
zrUtil
.
assert
(
data
,
'
getInitialData returned invalid data.
'
);
}
/**
* @type {module:echarts/data/List|module:echarts/data/Tree|module:echarts/data/Graph}
* @private
*/
set
(
this
,
'
dataBeforeProcessed
'
,
this
.
getInitialData
(
option
,
ecModel
)
);
set
(
this
,
'
dataBeforeProcessed
'
,
data
);
// If we reverse the order (make data firstly, and then make
// dataBeforeProcessed by cloneShallow), cloneShallow will
...
...
src/scale/Scale.js
浏览文件 @
3438bb1d
...
...
@@ -123,6 +123,23 @@ define(function (require) {
return
labels
;
};
/**
* When axis extent depends on data and no data exists,
* axis ticks should not be drawn, which is named 'blank'.
*/
scaleProto
.
isBlank
=
function
()
{
return
this
.
_isBlank
;
},
/**
* When axis extent depends on data and no data exists,
* axis ticks should not be drawn, which is named 'blank'.
*/
scaleProto
.
setBlank
=
function
(
isBlank
)
{
this
.
_isBlank
=
isBlank
;
};
clazzUtil
.
enableClassExtend
(
Scale
);
clazzUtil
.
enableClassManagement
(
Scale
,
{
registerWhenExtend
:
true
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录