Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
4330bad6
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,体验更适合开发者的 AI 搜索 >>
提交
4330bad6
编写于
6月 08, 2016
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge visual and layout, use priority instead of fixed stage
上级
f6aad591
变更
33
隐藏空白更改
内联
并排
Showing
33 changed file
with
140 addition
and
119 deletion
+140
-119
src/chart/bar.js
src/chart/bar.js
+1
-1
src/chart/boxplot.js
src/chart/boxplot.js
+1
-1
src/chart/boxplot/boxplotLayout.js
src/chart/boxplot/boxplotLayout.js
+1
-1
src/chart/candlestick.js
src/chart/candlestick.js
+1
-1
src/chart/candlestick/candlestickLayout.js
src/chart/candlestick/candlestickLayout.js
+1
-1
src/chart/chord.js
src/chart/chord.js
+2
-6
src/chart/chord/chordCircularLayout.js
src/chart/chord/chordCircularLayout.js
+1
-1
src/chart/effectScatter.js
src/chart/effectScatter.js
+1
-1
src/chart/funnel.js
src/chart/funnel.js
+2
-6
src/chart/funnel/funnelLayout.js
src/chart/funnel/funnelLayout.js
+1
-1
src/chart/graph.js
src/chart/graph.js
+4
-4
src/chart/graph/circularLayout.js
src/chart/graph/circularLayout.js
+1
-1
src/chart/graph/forceLayout.js
src/chart/graph/forceLayout.js
+1
-1
src/chart/line.js
src/chart/line.js
+3
-2
src/chart/lines.js
src/chart/lines.js
+2
-2
src/chart/map.js
src/chart/map.js
+3
-2
src/chart/parallel.js
src/chart/parallel.js
+1
-1
src/chart/parallel/parallelVisual.js
src/chart/parallel/parallelVisual.js
+1
-6
src/chart/pie.js
src/chart/pie.js
+2
-6
src/chart/pie/pieLayout.js
src/chart/pie/pieLayout.js
+1
-1
src/chart/radar.js
src/chart/radar.js
+3
-5
src/chart/radar/radarLayout.js
src/chart/radar/radarLayout.js
+1
-1
src/chart/sankey.js
src/chart/sankey.js
+1
-1
src/chart/sankey/sankeyLayout.js
src/chart/sankey/sankeyLayout.js
+1
-1
src/chart/scatter.js
src/chart/scatter.js
+1
-1
src/chart/themeRiver.js
src/chart/themeRiver.js
+4
-4
src/chart/treemap.js
src/chart/treemap.js
+1
-1
src/chart/treemap/treemapVisual.js
src/chart/treemap/treemapVisual.js
+1
-1
src/component/dataZoom/dataZoomProcessor.js
src/component/dataZoom/dataZoomProcessor.js
+1
-1
src/component/legend.js
src/component/legend.js
+1
-1
src/component/visualMap/visualCoding.js
src/component/visualMap/visualCoding.js
+1
-1
src/echarts.js
src/echarts.js
+92
-54
src/layout/points.js
src/layout/points.js
+1
-1
未找到文件。
src/chart/bar.js
浏览文件 @
4330bad6
...
...
@@ -12,7 +12,7 @@ define(function (require) {
echarts
.
registerLayout
(
zrUtil
.
curry
(
barLayoutGrid
,
'
bar
'
));
// Visual coding for legend
echarts
.
registerVisual
Coding
(
'
chart
'
,
function
(
ecModel
)
{
echarts
.
registerVisual
(
function
(
ecModel
)
{
ecModel
.
eachSeriesByType
(
'
bar
'
,
function
(
seriesModel
)
{
var
data
=
seriesModel
.
getData
();
data
.
setVisual
(
'
legendSymbol
'
,
'
roundRect
'
);
...
...
src/chart/boxplot.js
浏览文件 @
4330bad6
...
...
@@ -5,7 +5,7 @@ define(function (require) {
require
(
'
./boxplot/BoxplotSeries
'
);
require
(
'
./boxplot/BoxplotView
'
);
echarts
.
registerVisual
Coding
(
'
chart
'
,
require
(
'
./boxplot/boxplotVisual
'
));
echarts
.
registerVisual
(
require
(
'
./boxplot/boxplotVisual
'
));
echarts
.
registerLayout
(
require
(
'
./boxplot/boxplotLayout
'
));
});
\ No newline at end of file
src/chart/boxplot/boxplotLayout.js
浏览文件 @
4330bad6
...
...
@@ -5,7 +5,7 @@ define(function (require) {
var
parsePercent
=
numberUtil
.
parsePercent
;
var
each
=
zrUtil
.
each
;
return
function
(
ecModel
,
api
)
{
return
function
(
ecModel
)
{
var
groupResult
=
groupSeriesByAxis
(
ecModel
);
...
...
src/chart/candlestick.js
浏览文件 @
4330bad6
...
...
@@ -9,7 +9,7 @@ define(function (require) {
require
(
'
./candlestick/preprocessor
'
)
);
echarts
.
registerVisual
Coding
(
'
chart
'
,
require
(
'
./candlestick/candlestickVisual
'
));
echarts
.
registerVisual
(
require
(
'
./candlestick/candlestickVisual
'
));
echarts
.
registerLayout
(
require
(
'
./candlestick/candlestickLayout
'
));
});
\ No newline at end of file
src/chart/candlestick/candlestickLayout.js
浏览文件 @
4330bad6
...
...
@@ -4,7 +4,7 @@ define(function (require) {
var
CANDLE_MIN_NICE_WIDTH
=
5
;
var
GPA_MIN
=
4
;
return
function
(
ecModel
,
api
)
{
return
function
(
ecModel
)
{
ecModel
.
eachSeriesByType
(
'
candlestick
'
,
function
(
seriesModel
)
{
...
...
src/chart/chord.js
浏览文件 @
4330bad6
...
...
@@ -7,11 +7,7 @@ define(function (require) {
var
zrUtil
=
require
(
'
zrender/core/util
'
);
echarts
.
registerLayout
(
require
(
'
./chord/chordCircularLayout
'
));
echarts
.
registerVisualCoding
(
'
chart
'
,
zrUtil
.
curry
(
require
(
'
../visual/dataColor
'
),
'
chord
'
)
);
echarts
.
registerVisual
(
zrUtil
.
curry
(
require
(
'
../visual/dataColor
'
),
'
chord
'
));
echarts
.
registerProcessor
(
'
filter
'
,
zrUtil
.
curry
(
require
(
'
../processor/dataFilter
'
),
'
pie
'
)
);
echarts
.
registerProcessor
(
zrUtil
.
curry
(
require
(
'
../processor/dataFilter
'
),
'
pie
'
));
});
\ No newline at end of file
src/chart/chord/chordCircularLayout.js
浏览文件 @
4330bad6
...
...
@@ -95,7 +95,7 @@ define(function (require) {
return
a
.
size
-
b
.
size
;
};
return
function
(
ecModel
,
api
)
{
return
function
(
ecModel
,
api
,
payload
)
{
ecModel
.
eachSeriesByType
(
'
chord
'
,
function
(
chordSeries
)
{
var
graph
=
chordSeries
.
getGraph
();
...
...
src/chart/effectScatter.js
浏览文件 @
4330bad6
...
...
@@ -6,7 +6,7 @@ define(function (require) {
require
(
'
./effectScatter/EffectScatterSeries
'
);
require
(
'
./effectScatter/EffectScatterView
'
);
echarts
.
registerVisual
Coding
(
'
chart
'
,
zrUtil
.
curry
(
echarts
.
registerVisual
(
zrUtil
.
curry
(
require
(
'
../visual/symbol
'
),
'
effectScatter
'
,
'
circle
'
,
null
));
echarts
.
registerLayout
(
zrUtil
.
curry
(
...
...
src/chart/funnel.js
浏览文件 @
4330bad6
...
...
@@ -6,12 +6,8 @@ define(function (require) {
require
(
'
./funnel/FunnelSeries
'
);
require
(
'
./funnel/FunnelView
'
);
echarts
.
registerVisualCoding
(
'
chart
'
,
zrUtil
.
curry
(
require
(
'
../visual/dataColor
'
),
'
funnel
'
)
);
echarts
.
registerVisual
(
zrUtil
.
curry
(
require
(
'
../visual/dataColor
'
),
'
funnel
'
));
echarts
.
registerLayout
(
require
(
'
./funnel/funnelLayout
'
));
echarts
.
registerProcessor
(
'
filter
'
,
zrUtil
.
curry
(
require
(
'
../processor/dataFilter
'
),
'
funnel
'
)
);
echarts
.
registerProcessor
(
zrUtil
.
curry
(
require
(
'
../processor/dataFilter
'
),
'
funnel
'
));
});
\ No newline at end of file
src/chart/funnel/funnelLayout.js
浏览文件 @
4330bad6
...
...
@@ -94,7 +94,7 @@ define(function (require) {
});
}
return
function
(
ecModel
,
api
)
{
return
function
(
ecModel
,
api
,
payload
)
{
ecModel
.
eachSeriesByType
(
'
funnel
'
,
function
(
seriesModel
)
{
var
data
=
seriesModel
.
getData
();
var
sort
=
seriesModel
.
get
(
'
sort
'
);
...
...
src/chart/graph.js
浏览文件 @
4330bad6
...
...
@@ -8,13 +8,13 @@ define(function (require) {
require
(
'
./graph/roamAction
'
);
echarts
.
registerProcessor
(
'
filter
'
,
require
(
'
./graph/categoryFilter
'
));
echarts
.
registerProcessor
(
require
(
'
./graph/categoryFilter
'
));
echarts
.
registerVisual
Coding
(
'
chart
'
,
zrUtil
.
curry
(
echarts
.
registerVisual
(
zrUtil
.
curry
(
require
(
'
../visual/symbol
'
),
'
graph
'
,
'
circle
'
,
null
));
echarts
.
registerVisual
Coding
(
'
chart
'
,
require
(
'
./graph/categoryVisual
'
));
echarts
.
registerVisual
Coding
(
'
chart
'
,
require
(
'
./graph/edgeVisual
'
));
echarts
.
registerVisual
(
require
(
'
./graph/categoryVisual
'
));
echarts
.
registerVisual
(
require
(
'
./graph/edgeVisual
'
));
echarts
.
registerLayout
(
require
(
'
./graph/simpleLayout
'
));
echarts
.
registerLayout
(
require
(
'
./graph/circularLayout
'
));
...
...
src/chart/graph/circularLayout.js
浏览文件 @
4330bad6
define
(
function
(
require
)
{
var
circularLayoutHelper
=
require
(
'
./circularLayoutHelper
'
);
return
function
(
ecModel
,
api
)
{
return
function
(
ecModel
)
{
ecModel
.
eachSeriesByType
(
'
graph
'
,
function
(
seriesModel
)
{
if
(
seriesModel
.
get
(
'
layout
'
)
===
'
circular
'
)
{
circularLayoutHelper
(
seriesModel
);
...
...
src/chart/graph/forceLayout.js
浏览文件 @
4330bad6
...
...
@@ -6,7 +6,7 @@ define(function (require) {
var
circularLayoutHelper
=
require
(
'
./circularLayoutHelper
'
);
var
vec2
=
require
(
'
zrender/core/vector
'
);
return
function
(
ecModel
,
api
)
{
return
function
(
ecModel
)
{
ecModel
.
eachSeriesByType
(
'
graph
'
,
function
(
graphSeries
)
{
var
coordSys
=
graphSeries
.
coordinateSystem
;
if
(
coordSys
&&
coordSys
.
type
!==
'
view
'
)
{
...
...
src/chart/line.js
浏览文件 @
4330bad6
...
...
@@ -2,11 +2,12 @@ define(function (require) {
var
zrUtil
=
require
(
'
zrender/core/util
'
);
var
echarts
=
require
(
'
../echarts
'
);
var
PRIORITY
=
echarts
.
PRIORITY
;
require
(
'
./line/LineSeries
'
);
require
(
'
./line/LineView
'
);
echarts
.
registerVisual
Coding
(
'
chart
'
,
zrUtil
.
curry
(
echarts
.
registerVisual
(
zrUtil
.
curry
(
require
(
'
../visual/symbol
'
),
'
line
'
,
'
circle
'
,
'
line
'
));
echarts
.
registerLayout
(
zrUtil
.
curry
(
...
...
@@ -14,7 +15,7 @@ define(function (require) {
));
// Down sample after filter
echarts
.
registerProcessor
(
'
statistic
'
,
zrUtil
.
curry
(
echarts
.
registerProcessor
(
PRIORITY
.
PROCESSOR
.
STATISTIC
,
zrUtil
.
curry
(
require
(
'
../processor/dataSample
'
),
'
line
'
));
...
...
src/chart/lines.js
浏览文件 @
4330bad6
...
...
@@ -9,7 +9,7 @@ define(function (require) {
require
(
'
./lines/linesLayout
'
)
);
echarts
.
registerVisual
Coding
(
'
chart
'
,
zrUtil
.
curry
(
require
(
'
../visual/seriesColor
'
),
'
lines
'
,
'
lineStyle
'
)
echarts
.
registerVisual
(
zrUtil
.
curry
(
require
(
'
../visual/seriesColor
'
),
'
lines
'
,
'
lineStyle
'
)
);
});
\ No newline at end of file
src/chart/map.js
浏览文件 @
4330bad6
define
(
function
(
require
)
{
var
echarts
=
require
(
'
../echarts
'
);
var
PRIORITY
=
echarts
.
PRIORITY
;
require
(
'
./map/MapSeries
'
);
...
...
@@ -12,9 +13,9 @@ define(function (require) {
echarts
.
registerLayout
(
require
(
'
./map/mapSymbolLayout
'
));
echarts
.
registerVisual
Coding
(
'
chart
'
,
require
(
'
./map/mapVisual
'
));
echarts
.
registerVisual
(
require
(
'
./map/mapVisual
'
));
echarts
.
registerProcessor
(
'
statistic
'
,
require
(
'
./map/mapDataStatistic
'
));
echarts
.
registerProcessor
(
PRIORITY
.
PROCESSOR
.
STATISTIC
,
require
(
'
./map/mapDataStatistic
'
));
echarts
.
registerPreprocessor
(
require
(
'
./map/backwardCompat
'
));
...
...
src/chart/parallel.js
浏览文件 @
4330bad6
...
...
@@ -7,6 +7,6 @@ define(function (require) {
require
(
'
./parallel/ParallelSeries
'
);
require
(
'
./parallel/ParallelView
'
);
echarts
.
registerVisual
Coding
(
'
chart
'
,
require
(
'
./parallel/parallelVisual
'
));
echarts
.
registerVisual
(
require
(
'
./parallel/parallelVisual
'
));
});
\ No newline at end of file
src/chart/parallel/parallelVisual.js
浏览文件 @
4330bad6
define
(
function
(
require
)
{
/**
* @payload
* @property {string} parallelAxisId
* @property {Array.<number>} extent
*/
return
function
(
ecModel
,
payload
)
{
return
function
(
ecModel
)
{
ecModel
.
eachSeriesByType
(
'
parallel
'
,
function
(
seriesModel
)
{
...
...
src/chart/pie.js
浏览文件 @
4330bad6
...
...
@@ -20,15 +20,11 @@ define(function (require) {
method
:
'
unSelect
'
}]);
echarts
.
registerVisualCoding
(
'
chart
'
,
zrUtil
.
curry
(
require
(
'
../visual/dataColor
'
),
'
pie
'
)
);
echarts
.
registerVisual
(
zrUtil
.
curry
(
require
(
'
../visual/dataColor
'
),
'
pie
'
));
echarts
.
registerLayout
(
zrUtil
.
curry
(
require
(
'
./pie/pieLayout
'
),
'
pie
'
));
echarts
.
registerProcessor
(
'
filter
'
,
zrUtil
.
curry
(
require
(
'
../processor/dataFilter
'
),
'
pie
'
)
);
echarts
.
registerProcessor
(
zrUtil
.
curry
(
require
(
'
../processor/dataFilter
'
),
'
pie
'
));
});
\ No newline at end of file
src/chart/pie/pieLayout.js
浏览文件 @
4330bad6
...
...
@@ -10,7 +10,7 @@ define(function (require) {
var
PI2
=
Math
.
PI
*
2
;
var
RADIAN
=
Math
.
PI
/
180
;
return
function
(
seriesType
,
ecModel
,
api
)
{
return
function
(
seriesType
,
ecModel
,
api
,
payload
)
{
ecModel
.
eachSeriesByType
(
seriesType
,
function
(
seriesModel
)
{
var
center
=
seriesModel
.
get
(
'
center
'
);
var
radius
=
seriesModel
.
get
(
'
radius
'
);
...
...
src/chart/radar.js
浏览文件 @
4330bad6
...
...
@@ -9,16 +9,14 @@ define(function (require) {
require
(
'
./radar/RadarSeries
'
);
require
(
'
./radar/RadarView
'
);
echarts
.
registerVisualCoding
(
'
chart
'
,
zrUtil
.
curry
(
require
(
'
../visual/dataColor
'
),
'
radar
'
)
);
echarts
.
registerVisualCoding
(
'
chart
'
,
zrUtil
.
curry
(
echarts
.
registerVisual
(
zrUtil
.
curry
(
require
(
'
../visual/dataColor
'
),
'
radar
'
));
echarts
.
registerVisual
(
zrUtil
.
curry
(
require
(
'
../visual/symbol
'
),
'
radar
'
,
'
circle
'
,
null
));
echarts
.
registerLayout
(
require
(
'
./radar/radarLayout
'
));
echarts
.
registerProcessor
(
'
filter
'
,
zrUtil
.
curry
(
require
(
'
../processor/dataFilter
'
),
'
radar
'
)
zrUtil
.
curry
(
require
(
'
../processor/dataFilter
'
),
'
radar
'
)
);
echarts
.
registerPreprocessor
(
require
(
'
./radar/backwardCompat
'
));
...
...
src/chart/radar/radarLayout.js
浏览文件 @
4330bad6
define
(
function
(
require
)
{
return
function
(
ecModel
,
api
)
{
return
function
(
ecModel
)
{
ecModel
.
eachSeriesByType
(
'
radar
'
,
function
(
seriesModel
)
{
var
data
=
seriesModel
.
getData
();
var
points
=
[];
...
...
src/chart/sankey.js
浏览文件 @
4330bad6
...
...
@@ -5,5 +5,5 @@ define(function (require) {
require
(
'
./sankey/SankeySeries
'
);
require
(
'
./sankey/SankeyView
'
);
echarts
.
registerLayout
(
require
(
'
./sankey/sankeyLayout
'
));
echarts
.
registerVisual
Coding
(
'
chart
'
,
require
(
'
./sankey/sankeyVisual
'
));
echarts
.
registerVisual
(
require
(
'
./sankey/sankeyVisual
'
));
});
\ No newline at end of file
src/chart/sankey/sankeyLayout.js
浏览文件 @
4330bad6
...
...
@@ -4,7 +4,7 @@ define(function (require) {
var
nest
=
require
(
'
../../util/array/nest
'
);
var
zrUtil
=
require
(
'
zrender/core/util
'
);
return
function
(
ecModel
,
api
)
{
return
function
(
ecModel
,
api
,
payload
)
{
ecModel
.
eachSeriesByType
(
'
sankey
'
,
function
(
seriesModel
)
{
...
...
src/chart/scatter.js
浏览文件 @
4330bad6
...
...
@@ -6,7 +6,7 @@ define(function (require) {
require
(
'
./scatter/ScatterSeries
'
);
require
(
'
./scatter/ScatterView
'
);
echarts
.
registerVisual
Coding
(
'
chart
'
,
zrUtil
.
curry
(
echarts
.
registerVisual
(
zrUtil
.
curry
(
require
(
'
../visual/symbol
'
),
'
scatter
'
,
'
circle
'
,
null
));
echarts
.
registerLayout
(
zrUtil
.
curry
(
...
...
src/chart/themeRiver.js
浏览文件 @
4330bad6
...
...
@@ -5,14 +5,14 @@ define(function (require) {
require
(
'
./themeRiver/ThemeRiverSeries
'
);
require
(
'
./themeRiver/ThemeRiverView
'
);
echarts
.
registerLayout
(
require
(
'
./themeRiver/themeRiverLayout
'
));
echarts
.
registerVisual
Coding
(
'
chart
'
,
require
(
'
./themeRiver/themeRiverVisual
'
));
echarts
.
registerVisual
(
require
(
'
./themeRiver/themeRiverVisual
'
));
echarts
.
registerProcessor
(
'
filter
'
,
zrUtil
.
curry
(
require
(
'
../processor/dataFilter
'
),
'
themeRiver
'
)
);
zrUtil
.
curry
(
require
(
'
../processor/dataFilter
'
),
'
themeRiver
'
)
);
});
\ No newline at end of file
src/chart/treemap.js
浏览文件 @
4330bad6
...
...
@@ -6,7 +6,7 @@ define(function (require) {
require
(
'
./treemap/TreemapView
'
);
require
(
'
./treemap/treemapAction
'
);
echarts
.
registerVisual
Coding
(
'
chart
'
,
require
(
'
./treemap/treemapVisual
'
));
echarts
.
registerVisual
(
require
(
'
./treemap/treemapVisual
'
));
echarts
.
registerLayout
(
require
(
'
./treemap/treemapLayout
'
));
});
\ No newline at end of file
src/chart/treemap/treemapVisual.js
浏览文件 @
4330bad6
...
...
@@ -7,7 +7,7 @@ define(function (require) {
var
ITEM_STYLE_NORMAL
=
'
itemStyle.normal
'
;
return
function
(
ecModel
,
payload
)
{
return
function
(
ecModel
,
api
,
payload
)
{
var
condition
=
{
mainType
:
'
series
'
,
subType
:
'
treemap
'
,
query
:
payload
};
ecModel
.
eachComponent
(
condition
,
function
(
seriesModel
)
{
...
...
src/component/dataZoom/dataZoomProcessor.js
浏览文件 @
4330bad6
...
...
@@ -5,7 +5,7 @@ define(function (require) {
var
echarts
=
require
(
'
../../echarts
'
);
echarts
.
registerProcessor
(
'
filter
'
,
function
(
ecModel
,
api
)
{
echarts
.
registerProcessor
(
function
(
ecModel
,
api
)
{
ecModel
.
eachComponent
(
'
dataZoom
'
,
function
(
dataZoomModel
)
{
// We calculate window and reset axis here but not in model
...
...
src/component/legend.js
浏览文件 @
4330bad6
...
...
@@ -9,5 +9,5 @@ define(function (require) {
var
echarts
=
require
(
'
../echarts
'
);
// Series Filter
echarts
.
registerProcessor
(
'
filter
'
,
require
(
'
./legend/legendFilter
'
));
echarts
.
registerProcessor
(
require
(
'
./legend/legendFilter
'
));
});
\ No newline at end of file
src/component/visualMap/visualCoding.js
浏览文件 @
4330bad6
...
...
@@ -7,7 +7,7 @@ define(function (require) {
var
VisualMapping
=
require
(
'
../../visual/VisualMapping
'
);
var
zrUtil
=
require
(
'
zrender/core/util
'
);
echarts
.
registerVisual
Coding
(
'
component
'
,
function
(
ecModel
)
{
echarts
.
registerVisual
(
echarts
.
PRIORITY
.
VISUAL
.
COMPONENT
,
function
(
ecModel
)
{
ecModel
.
eachComponent
(
'
visualMap
'
,
function
(
visualMapModel
)
{
processSingleVisualMap
(
visualMapModel
,
ecModel
);
});
...
...
src/echarts.js
浏览文件 @
4330bad6
...
...
@@ -33,10 +33,14 @@ define(function (require) {
var
each
=
zrUtil
.
each
;
var
VISUAL_CODING_STAGES
=
[
'
echarts
'
,
'
chart
'
,
'
component
'
];
var
PRIORITY_PROCESSOR_FILTER
=
1000
;
var
PRIORITY_PROCESSOR_STATISTIC
=
5000
;
// TODO Transform first or filter first
var
PROCESSOR_STAGES
=
[
'
transform
'
,
'
filter
'
,
'
statistic
'
];
var
PRIORITY_VISUAL_LAYOUT
=
1000
;
var
PRIORITY_VISUAL_GLOBAL
=
2000
;
var
PRIORITY_VISUAL_CHART
=
3000
;
var
PRIORITY_VISUAL_COMPONENT
=
4000
;
function
createRegisterEventWithLowercaseName
(
method
)
{
return
function
(
eventName
,
handler
,
context
)
{
...
...
@@ -144,6 +148,14 @@ define(function (require) {
// In case some people write `window.onresize = chart.resize`
this
.
resize
=
zrUtil
.
bind
(
this
.
resize
,
this
);
// Sort on demand
function
prioritySortFunc
(
a
,
b
)
{
return
a
.
prio
-
b
.
prio
;
}
visualFuncs
.
sort
(
prioritySortFunc
);
dataProcessorFuncs
.
sort
(
prioritySortFunc
);
}
var
echartsProto
=
ECharts
.
prototype
;
...
...
@@ -379,9 +391,7 @@ define(function (require) {
coordSysMgr
.
update
(
ecModel
,
api
);
doLayout
.
call
(
this
,
ecModel
,
payload
);
doVisualCoding
.
call
(
this
,
ecModel
,
payload
);
doVisualEncoding
.
call
(
this
,
ecModel
,
payload
,
api
);
doRender
.
call
(
this
,
ecModel
,
payload
);
...
...
@@ -424,9 +434,7 @@ define(function (require) {
return
;
}
doLayout
.
call
(
this
,
ecModel
,
payload
);
doVisualCoding
.
call
(
this
,
ecModel
,
payload
);
doVisualEncoding
.
call
(
this
,
ecModel
,
payload
);
invokeUpdateMethod
.
call
(
this
,
'
updateView
'
,
ecModel
,
payload
);
},
...
...
@@ -443,7 +451,7 @@ define(function (require) {
return
;
}
doVisual
C
oding
.
call
(
this
,
ecModel
,
payload
);
doVisual
Enc
oding
.
call
(
this
,
ecModel
,
payload
);
invokeUpdateMethod
.
call
(
this
,
'
updateVisual
'
,
ecModel
,
payload
);
},
...
...
@@ -460,7 +468,7 @@ define(function (require) {
return
;
}
doLayout
.
call
(
this
,
ecModel
,
payload
);
doLayout
.
call
(
this
,
ecModel
,
payload
,
this
.
_api
);
invokeUpdateMethod
.
call
(
this
,
'
updateLayout
'
,
ecModel
,
payload
);
},
...
...
@@ -738,10 +746,8 @@ define(function (require) {
* @private
*/
function
processData
(
ecModel
,
api
)
{
each
(
PROCESSOR_STAGES
,
function
(
stage
)
{
each
(
dataProcessorFuncs
[
stage
]
||
[],
function
(
process
)
{
process
(
ecModel
,
api
);
});
each
(
dataProcessorFuncs
,
function
(
process
)
{
process
.
func
(
ecModel
,
api
);
});
}
...
...
@@ -764,33 +770,32 @@ define(function (require) {
}
/**
* Layout before each chart render there series,
after visual coding and data processing
* Layout before each chart render there series,
special visual encoding stage
*
* @param {module:echarts/model/Global} ecModel
* @private
*/
function
doLayout
(
ecModel
,
payload
)
{
var
api
=
this
.
_api
;
each
(
layoutFuncs
,
function
(
layout
)
{
layout
(
ecModel
,
api
,
payload
);
function
doLayout
(
ecModel
,
payload
,
api
)
{
each
(
visualFuncs
,
function
(
visual
)
{
if
(
visual
.
isLayout
)
{
visual
.
func
(
ecModel
,
api
,
payload
);
}
});
}
/**
*
C
ode visual infomation from data after data processing
*
Enc
ode visual infomation from data after data processing
*
* @param {module:echarts/model/Global} ecModel
* @private
*/
function
doVisual
Coding
(
ecModel
,
payload
)
{
function
doVisual
Encoding
(
ecModel
,
payload
,
api
)
{
ecModel
.
clearColorPalette
();
ecModel
.
eachSeries
(
function
(
seriesModel
)
{
seriesModel
.
clearColorPalette
();
});
each
(
VISUAL_CODING_STAGES
,
function
(
stage
)
{
each
(
visualCodingFuncs
[
stage
]
||
[],
function
(
visualCoding
)
{
visualCoding
(
ecModel
,
payload
);
});
each
(
visualFuncs
,
function
(
visual
)
{
visual
.
func
(
ecModel
,
api
,
payload
);
});
}
...
...
@@ -959,18 +964,12 @@ define(function (require) {
*/
var
eventActionMap
=
{};
/**
* @type {Array.<Function>}
* @inner
*/
var
layoutFuncs
=
[];
/**
* Data processor functions of each stage
* @type {Array.<Object.<string, Function>>}
* @inner
*/
var
dataProcessorFuncs
=
{}
;
var
dataProcessorFuncs
=
[]
;
/**
* @type {Array.<Function>}
...
...
@@ -979,11 +978,11 @@ define(function (require) {
var
optionPreprocessorFuncs
=
[];
/**
* Visual coding functions of each stage
* Visual
en
coding functions of each stage
* @type {Array.<Object.<string, Function>>}
* @inner
*/
var
visual
CodingFuncs
=
{}
;
var
visual
Funcs
=
[]
;
/**
* Theme storage
* @type {Object.<key, Object>}
...
...
@@ -1154,15 +1153,21 @@ define(function (require) {
};
/**
* @param {
string} stage
* @param {
number} [priority=1000]
* @param {Function} processorFunc
*/
echarts
.
registerProcessor
=
function
(
stage
,
processorFunc
)
{
if
(
zrUtil
.
indexOf
(
PROCESSOR_STAGES
,
stage
)
<
0
)
{
throw
new
Error
(
'
stage should be one of
'
+
PROCESSOR_STAGES
);
echarts
.
registerProcessor
=
function
(
priority
,
processorFunc
)
{
if
(
typeof
priority
===
'
function
'
)
{
processorFunc
=
priority
;
priority
=
PRIORITY_PROCESSOR_FILTER
;
}
var
funcs
=
dataProcessorFuncs
[
stage
]
||
(
dataProcessorFuncs
[
stage
]
=
[]);
funcs
.
push
(
processorFunc
);
if
(
isNaN
(
priority
))
{
throw
new
Error
(
'
Unkown processor priority
'
);
}
dataProcessorFuncs
.
push
({
prio
:
priority
,
func
:
processorFunc
});
};
/**
...
...
@@ -1211,25 +1216,44 @@ define(function (require) {
};
/**
* @param {*} layout
* Layout is a special stage of visual encoding
* Most visual encoding like color are common for different chart
* But each chart has it's own layout algorithm
*
* @param {string} [priority=1000]
* @param {Function} layoutFunc
*/
echarts
.
registerLayout
=
function
(
layout
)
{
// PENDING All functions ?
if
(
zrUtil
.
indexOf
(
layoutFuncs
,
layout
)
<
0
)
{
layoutFuncs
.
push
(
layout
);
echarts
.
registerLayout
=
function
(
priority
,
layoutFunc
)
{
if
(
typeof
priority
===
'
function
'
)
{
layoutFunc
=
priority
;
priority
=
PRIORITY_VISUAL_LAYOUT
;
}
if
(
isNaN
(
priority
))
{
throw
new
Error
(
'
Unkown layout priority
'
);
}
visualFuncs
.
push
({
prio
:
priority
,
func
:
layoutFunc
,
isLayout
:
true
});
};
/**
* @param {string}
stage
* @param {Function} visual
Coding
Func
* @param {string}
[priority=3000]
* @param {Function} visualFunc
*/
echarts
.
registerVisualCoding
=
function
(
stage
,
visualCodingFunc
)
{
if
(
zrUtil
.
indexOf
(
VISUAL_CODING_STAGES
,
stage
)
<
0
)
{
throw
new
Error
(
'
stage should be one of
'
+
VISUAL_CODING_STAGES
);
echarts
.
registerVisual
=
function
(
priority
,
visualFunc
)
{
if
(
typeof
priority
===
'
function
'
)
{
visualFunc
=
priority
;
priority
=
PRIORITY_VISUAL_CHART
;
}
var
funcs
=
visualCodingFuncs
[
stage
]
||
(
visualCodingFuncs
[
stage
]
=
[]);
funcs
.
push
(
visualCodingFunc
);
if
(
isNaN
(
priority
))
{
throw
new
Error
(
'
Unkown visual priority
'
);
}
visualFuncs
.
push
({
prio
:
priority
,
func
:
visualFunc
});
};
/**
...
...
@@ -1280,7 +1304,7 @@ define(function (require) {
zrUtil
.
createCanvas
=
creator
;
};
echarts
.
registerVisual
Coding
(
'
echarts
'
,
zrUtil
.
curry
(
echarts
.
registerVisual
(
PRIORITY_VISUAL_GLOBAL
,
zrUtil
.
curry
(
require
(
'
./visual/seriesColor
'
),
''
,
'
itemStyle
'
));
echarts
.
registerPreprocessor
(
require
(
'
./preprocessor/backwardCompat
'
));
...
...
@@ -1323,5 +1347,19 @@ define(function (require) {
}
);
// PRIORITY
echarts
.
PRIORITY
=
{
PROCESSOR
:
{
FILTER
:
PRIORITY_PROCESSOR_FILTER
,
STATISTIC
:
PRIORITY_PROCESSOR_STATISTIC
},
VISUAL
:
{
LAYOUT
:
PRIORITY_VISUAL_LAYOUT
,
GLOBAL
:
PRIORITY_VISUAL_GLOBAL
,
CHART
:
PRIORITY_VISUAL_CHART
,
COMPONENT
:
PRIORITY_VISUAL_COMPONENT
}
};
return
echarts
;
});
\ No newline at end of file
src/layout/points.js
浏览文件 @
4330bad6
define
(
function
(
require
)
{
return
function
(
seriesType
,
ecModel
,
api
)
{
return
function
(
seriesType
,
ecModel
)
{
ecModel
.
eachSeriesByType
(
seriesType
,
function
(
seriesModel
)
{
var
data
=
seriesModel
.
getData
();
var
coordSys
=
seriesModel
.
coordinateSystem
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录