Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
303140d5
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,发现更多精彩内容 >>
提交
303140d5
编写于
6月 14, 2016
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improvement of __DEV__ define for error checking
上级
cdd0c0d2
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
100 addition
and
45 deletion
+100
-45
src/chart/heatmap/HeatmapView.js
src/chart/heatmap/HeatmapView.js
+5
-3
src/chart/helper/createListFromArray.js
src/chart/helper/createListFromArray.js
+19
-6
src/chart/line/LineSeries.js
src/chart/line/LineSeries.js
+6
-0
src/chart/lines/LinesSeries.js
src/chart/lines/LinesSeries.js
+6
-8
src/component/marker/MarkerModel.js
src/component/marker/MarkerModel.js
+5
-2
src/coord/cartesian/Grid.js
src/coord/cartesian/Grid.js
+1
-1
src/data/List.js
src/data/List.js
+4
-2
src/echarts.js
src/echarts.js
+44
-18
src/model/Global.js
src/model/Global.js
+4
-2
src/util/clazz.js
src/util/clazz.js
+4
-2
webpack.config.js
webpack.config.js
+2
-1
未找到文件。
src/chart/heatmap/HeatmapView.js
浏览文件 @
303140d5
...
...
@@ -69,8 +69,10 @@ define(function (require) {
});
});
if
(
!
visualMapOfThisSeries
)
{
throw
new
Error
(
'
Heatmap must use with visualMap
'
);
if
(
__DEV__
)
{
if
(
!
visualMapOfThisSeries
)
{
throw
new
Error
(
'
Heatmap must use with visualMap
'
);
}
}
this
.
group
.
removeAll
();
...
...
@@ -90,7 +92,7 @@ define(function (require) {
var
yAxis
=
cartesian
.
getAxis
(
'
y
'
);
var
group
=
this
.
group
;
if
(
typeof
__DEV__
!==
'
undefined
'
)
{
if
(
__DEV__
)
{
if
(
!
(
xAxis
.
type
===
'
category
'
&&
yAxis
.
type
===
'
category
'
))
{
throw
new
Error
(
'
Heatmap on cartesian must have two category axes
'
);
}
...
...
src/chart/helper/createListFromArray.js
浏览文件 @
303140d5
...
...
@@ -29,8 +29,10 @@ define(function(require) {
// If data is undefined
data
=
data
||
[];
if
(
!
zrUtil
.
isArray
(
data
))
{
throw
new
Error
(
'
Invalid data.
'
);
if
(
__DEV__
)
{
if
(
!
zrUtil
.
isArray
(
data
))
{
throw
new
Error
(
'
Invalid data.
'
);
}
}
var
coordSysName
=
seriesModel
.
get
(
'
coordinateSystem
'
);
...
...
@@ -116,8 +118,14 @@ define(function(require) {
cartesian2d
:
function
(
data
,
seriesModel
,
ecModel
)
{
var
xAxisModel
=
ecModel
.
getComponent
(
'
xAxis
'
,
seriesModel
.
get
(
'
xAxisIndex
'
));
var
yAxisModel
=
ecModel
.
getComponent
(
'
yAxis
'
,
seriesModel
.
get
(
'
yAxisIndex
'
));
if
(
!
xAxisModel
||
!
yAxisModel
)
{
throw
new
Error
(
'
Axis option not found
'
);
if
(
__DEV__
)
{
if
(
!
xAxisModel
)
{
throw
new
Error
(
'
xAxis "
'
+
seriesModel
.
get
(
'
xAxisIndex
'
)
+
'
" not found
'
);
}
if
(
!
yAxisModel
)
{
throw
new
Error
(
'
yAxis "
'
+
seriesModel
.
get
(
'
yAxisIndex
'
)
+
'
" not found
'
);
}
}
var
xAxisType
=
xAxisModel
.
get
(
'
type
'
);
...
...
@@ -164,8 +172,13 @@ define(function(require) {
mainType
:
'
radiusAxis
'
,
filter
:
axisFinder
})[
0
];
if
(
!
angleAxisModel
||
!
radiusAxisModel
)
{
throw
new
Error
(
'
Axis option not found
'
);
if
(
__DEV__
)
{
if
(
!
angleAxisModel
)
{
throw
new
Error
(
'
angleAxis option not found
'
);
}
if
(
!
radiusAxisModel
)
{
throw
new
Error
(
'
radiusAxis option not found
'
);
}
}
var
radiusAxisType
=
radiusAxisModel
.
get
(
'
type
'
);
...
...
src/chart/line/LineSeries.js
浏览文件 @
303140d5
...
...
@@ -12,6 +12,12 @@ define(function(require) {
dependencies
:
[
'
grid
'
,
'
polar
'
],
getInitialData
:
function
(
option
,
ecModel
)
{
if
(
__DEV__
)
{
var
coordSys
=
option
.
coordinateSystem
;
if
(
coordSys
!==
'
polar
'
&&
coordSys
!==
'
cartesian2d
'
)
{
throw
new
Error
(
'
Line not support coordinateSystem besides cartesian and polar
'
);
}
}
return
createListFromArray
(
option
.
data
,
this
,
ecModel
);
},
...
...
src/chart/lines/LinesSeries.js
浏览文件 @
303140d5
...
...
@@ -26,16 +26,14 @@ define(function (require) {
));
});
// var coordSys = option.coordinateSystem;
// if (coordSys !== 'cartesian2d' && coordSys !== 'geo') {
// throw new Error('Coordinate system can only be cartesian2d or geo in lines');
// }
// var dimensions = coordSys === 'geo' ? ['lng', 'lat'] : ['x', 'y'];
var
coordSys
=
CoordinateSystem
.
get
(
option
.
coordinateSystem
);
if
(
!
coordSys
)
{
throw
new
Error
(
'
Invalid coordinate system
'
);
if
(
__DEV__
)
{
if
(
!
coordSys
)
{
throw
new
Error
(
'
Invalid coordinate system
'
);
}
}
var
dimensions
=
coordSys
.
dimensions
;
var
fromData
=
new
List
(
dimensions
,
this
);
...
...
src/component/marker/MarkerModel.js
浏览文件 @
303140d5
...
...
@@ -23,8 +23,11 @@ define(function (require) {
* @overrite
*/
init
:
function
(
option
,
parentModel
,
ecModel
,
extraOpt
)
{
if
(
this
.
type
===
'
marker
'
)
{
throw
new
Error
(
'
Marker component is abstract component. Use markLine, markPoint, markArea instead.
'
);
if
(
__DEV__
)
{
if
(
this
.
type
===
'
marker
'
)
{
throw
new
Error
(
'
Marker component is abstract component. Use markLine, markPoint, markArea instead.
'
);
}
}
this
.
mergeDefaultAndTheme
(
option
,
ecModel
);
this
.
mergeOption
(
option
,
ecModel
,
extraOpt
.
createdBySelf
,
true
);
...
...
src/coord/cartesian/Grid.js
浏览文件 @
303140d5
...
...
@@ -402,7 +402,7 @@ define(function(require, factory) {
var
yAxisIndex
=
seriesModel
.
get
(
'
yAxisIndex
'
);
var
xAxisModel
=
ecModel
.
getComponent
(
'
xAxis
'
,
xAxisIndex
);
if
(
typeof
__DEV__
!==
'
undefined
'
)
{
if
(
__DEV__
)
{
var
yAxisModel
=
ecModel
.
getComponent
(
'
yAxis
'
,
yAxisIndex
);
if
(
xAxisModel
.
get
(
'
gridIndex
'
)
!==
yAxisModel
.
get
(
'
gridIndex
'
))
{
throw
new
Error
(
'
xAxis and yAxis must use the same grid
'
);
...
...
src/data/List.js
浏览文件 @
303140d5
...
...
@@ -222,8 +222,10 @@ define(function (require) {
listProto
.
initData
=
function
(
data
,
nameList
,
dimValueGetter
)
{
data
=
data
||
[];
if
(
!
zrUtil
.
isArray
(
data
))
{
throw
new
Error
(
'
Invalid data.
'
);
if
(
__DEV__
)
{
if
(
!
zrUtil
.
isArray
(
data
))
{
throw
new
Error
(
'
Invalid data.
'
);
}
}
this
.
_rawData
=
data
;
...
...
src/echarts.js
浏览文件 @
303140d5
// Enable DEV mode when using source code without build. which has no __DEV__ variable
// In build process 'typeof __DEV__' will be replace with 'boolean'
// So this code will be removed or disabled anyway after built.
if
(
typeof
__DEV__
===
'
undefined
'
)
{
// In browser
if
(
typeof
window
!==
'
undefined
'
)
{
window
.
__DEV__
=
true
;
}
// In node
else
if
(
typeof
global
!==
'
undefined
'
)
{
global
.
__DEV__
=
true
;
}
}
/*!
* ECharts, a javascript interactive chart library.
*
...
...
@@ -13,6 +27,8 @@
*/
define
(
function
(
require
)
{
var
env
=
require
(
'
zrender/core/env
'
);
var
GlobalModel
=
require
(
'
./model/Global
'
);
var
ExtensionAPI
=
require
(
'
./ExtensionAPI
'
);
var
CoordinateSystemManager
=
require
(
'
./CoordinateSystem
'
);
...
...
@@ -28,7 +44,6 @@ define(function (require) {
var
zrender
=
require
(
'
zrender
'
);
var
zrUtil
=
require
(
'
zrender/core/util
'
);
var
colorTool
=
require
(
'
zrender/tool/color
'
);
var
env
=
require
(
'
zrender/core/env
'
);
var
Eventful
=
require
(
'
zrender/mixin/Eventful
'
);
var
each
=
zrUtil
.
each
;
...
...
@@ -1052,17 +1067,22 @@ define(function (require) {
* @param {Object} opts
*/
echarts
.
init
=
function
(
dom
,
theme
,
opts
)
{
// Check version
if
((
zrender
.
version
.
replace
(
'
.
'
,
''
)
-
0
)
<
(
echarts
.
dependencies
.
zrender
.
replace
(
'
.
'
,
''
)
-
0
))
{
throw
new
Error
(
'
ZRender
'
+
zrender
.
version
+
'
is too old for ECharts
'
+
echarts
.
version
+
'
. Current version need ZRender
'
+
echarts
.
dependencies
.
zrender
+
'
+
'
);
}
if
(
!
dom
)
{
throw
new
Error
(
'
Initialize failed: invalid dom.
'
);
if
(
__DEV__
)
{
// Check version
if
((
zrender
.
version
.
replace
(
'
.
'
,
''
)
-
0
)
<
(
echarts
.
dependencies
.
zrender
.
replace
(
'
.
'
,
''
)
-
0
))
{
throw
new
Error
(
'
ZRender
'
+
zrender
.
version
+
'
is too old for ECharts
'
+
echarts
.
version
+
'
. Current version need ZRender
'
+
echarts
.
dependencies
.
zrender
+
'
+
'
);
}
if
(
!
dom
)
{
throw
new
Error
(
'
Initialize failed: invalid dom.
'
);
}
if
(
!
dom
.
clientWidth
||
!
dom
.
clientHeight
)
{
console
.
error
(
'
Can
\'
t get dom width or height
'
);
}
}
var
chart
=
new
ECharts
(
dom
,
theme
,
opts
);
...
...
@@ -1163,8 +1183,10 @@ define(function (require) {
processorFunc
=
priority
;
priority
=
PRIORITY_PROCESSOR_FILTER
;
}
if
(
isNaN
(
priority
))
{
throw
new
Error
(
'
Unkown processor priority
'
);
if
(
__DEV__
)
{
if
(
isNaN
(
priority
))
{
throw
new
Error
(
'
Unkown processor priority
'
);
}
}
dataProcessorFuncs
.
push
({
prio
:
priority
,
...
...
@@ -1230,8 +1252,10 @@ define(function (require) {
layoutFunc
=
priority
;
priority
=
PRIORITY_VISUAL_LAYOUT
;
}
if
(
isNaN
(
priority
))
{
throw
new
Error
(
'
Unkown layout priority
'
);
if
(
__DEV__
)
{
if
(
isNaN
(
priority
))
{
throw
new
Error
(
'
Unkown layout priority
'
);
}
}
visualFuncs
.
push
({
prio
:
priority
,
...
...
@@ -1249,8 +1273,10 @@ define(function (require) {
visualFunc
=
priority
;
priority
=
PRIORITY_VISUAL_CHART
;
}
if
(
isNaN
(
priority
))
{
throw
new
Error
(
'
Unkown visual priority
'
);
if
(
__DEV__
)
{
if
(
isNaN
(
priority
))
{
throw
new
Error
(
'
Unkown visual priority
'
);
}
}
visualFuncs
.
push
({
prio
:
priority
,
...
...
src/model/Global.js
浏览文件 @
303140d5
...
...
@@ -743,8 +743,10 @@ define(function (require) {
function
assertSeriesInitialized
(
ecModel
)
{
// Components that use _seriesIndices should depends on series component,
// which make sure that their initialization is after series.
if
(
!
ecModel
.
_seriesIndices
)
{
throw
new
Error
(
'
Series has not been initialized yet.
'
);
if
(
__DEV__
)
{
if
(
!
ecModel
.
_seriesIndices
)
{
throw
new
Error
(
'
Series has not been initialized yet.
'
);
}
}
}
...
...
src/util/clazz.js
浏览文件 @
303140d5
...
...
@@ -79,8 +79,10 @@ define(function (require) {
componentType
=
parseClassType
(
componentType
);
if
(
!
componentType
.
sub
)
{
if
(
storage
[
componentType
.
main
])
{
throw
new
Error
(
componentType
.
main
+
'
exists.
'
);
if
(
__DEV__
)
{
if
(
storage
[
componentType
.
main
])
{
console
.
warn
(
componentType
.
main
+
'
exists.
'
);
}
}
storage
[
componentType
.
main
]
=
Clazz
;
}
...
...
webpack.config.js
浏览文件 @
303140d5
...
...
@@ -4,7 +4,8 @@ var webpack = require('webpack');
module
.
exports
=
{
plugins
:
[
new
webpack
.
DefinePlugin
({
'
typeof __DEV__
'
:
JSON
.
stringify
(
PROD
?
'
undefined
'
:
'
boolean
'
)
'
typeof __DEV__
'
:
JSON
.
stringify
(
'
boolean
'
),
__DEV__
:
PROD
?
false
:
true
})
],
entry
:
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录