Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
794d283d
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,发现更多精彩内容 >>
提交
794d283d
编写于
1月 10, 2016
作者:
P
pah100
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev-3.0.0' of
https://github.com/ecomfe/echarts
into dev-3.0.0
上级
34a4b7ac
c55db1ac
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
138 addition
and
45 deletion
+138
-45
build/build.sh
build/build.sh
+9
-3
build/config/dataTool.js
build/config/dataTool.js
+2
-4
build/config/echarts.common.js
build/config/echarts.common.js
+36
-0
build/config/echarts.js
build/config/echarts.js
+3
-6
build/config/echarts.simple.js
build/config/echarts.simple.js
+24
-0
build/mangleString.js
build/mangleString.js
+2
-2
build/optimize.js
build/optimize.js
+10
-6
build/wrap/end.js
build/wrap/end.js
+0
-4
src/action/createDataSelectAction.js
src/action/createDataSelectAction.js
+11
-0
src/chart/line/LineSeries.js
src/chart/line/LineSeries.js
+3
-0
src/chart/line/LineView.js
src/chart/line/LineView.js
+9
-8
src/component/legend/LegendModel.js
src/component/legend/LegendModel.js
+10
-7
src/component/legend/legendAction.js
src/component/legend/legendAction.js
+13
-3
src/component/toolbox/feature/MagicType.js
src/component/toolbox/feature/MagicType.js
+1
-0
src/echarts.js
src/echarts.js
+5
-2
未找到文件。
build/build.sh
浏览文件 @
794d283d
...
...
@@ -2,7 +2,13 @@
rm
-r
../dist
node r.js
-o
config.js
node optimize.js
node r.js
-o
config
/echarts.simple
.js
node optimize.js
-m
simple
node r.js
-o
dataTool.js
node r.js
-o
config/echarts.common.js
node optimize.js
-m
common
node r.js
-o
config/echarts.js
node optimize.js
-m
all
node r.js
-o
config/dataTool.js
build/dataTool.js
→
build/
config/
dataTool.js
浏览文件 @
794d283d
({
// appDir: './',
// baseUrl: '../src',
// optimize: 'none',
baseUrl
:
'
../
'
,
name
:
'
echarts
'
,
paths
:
{
extension
:
'
../extension
'
,
...
...
@@ -20,5 +18,5 @@
'
extension/dataTool/prepareBoxplotData
'
,
'
extension/dataTool/gexf
'
],
out
:
'
../dist/extension/dataTool.js
'
out
:
'
../
../
dist/extension/dataTool.js
'
})
\ No newline at end of file
build/config/echarts.common.js
0 → 100644
浏览文件 @
794d283d
({
baseUrl
:
'
../
'
,
optimize
:
'
none
'
,
name
:
'
echarts
'
,
packages
:
[
{
name
:
'
zrender
'
,
location
:
'
../../zrender/src
'
,
main
:
'
zrender
'
},
{
name
:
'
echarts
'
,
location
:
'
../src
'
,
main
:
'
echarts
'
}
],
include
:[
'
echarts/chart/line
'
,
'
echarts/chart/bar
'
,
'
echarts/chart/pie
'
,
'
echarts/chart/scatter
'
,
'
echarts/component/tooltip
'
,
'
echarts/component/legend
'
,
'
echarts/component/grid
'
,
'
echarts/component/title
'
,
'
echarts/component/markPoint
'
,
'
echarts/component/markLine
'
,
'
echarts/component/dataZoom
'
,
'
echarts/component/toolbox
'
,
'
zrender/vml/vml
'
],
out
:
'
../../dist/echarts.common.js
'
})
\ No newline at end of file
build/config.js
→
build/config
/echarts
.js
浏览文件 @
794d283d
({
// appDir: './',
// baseUrl: '../src',
baseUrl
:
'
../
'
,
optimize
:
'
none
'
,
name
:
'
echarts
'
,
packages
:
[
{
name
:
'
zrender
'
,
location
:
'
../../zrender
-dev3.0
/src
'
,
location
:
'
../../zrender/src
'
,
main
:
'
zrender
'
},
{
...
...
@@ -54,9 +53,7 @@
'
echarts/component/timeline
'
,
'
echarts/component/toolbox
'
,
'
echarts/scale/Time
'
,
'
echarts/scale/Log
'
,
'
zrender/vml/vml
'
],
out
:
'
../dist/echarts.js
'
out
:
'
../
../
dist/echarts.js
'
})
\ No newline at end of file
build/config/echarts.simple.js
0 → 100644
浏览文件 @
794d283d
({
baseUrl
:
'
../
'
,
optimize
:
'
none
'
,
name
:
'
echarts
'
,
packages
:
[
{
name
:
'
zrender
'
,
location
:
'
../../zrender/src
'
,
main
:
'
zrender
'
},
{
name
:
'
echarts
'
,
location
:
'
../src
'
,
main
:
'
echarts
'
}
],
include
:[
'
echarts/chart/line
'
,
'
echarts/chart/bar
'
,
'
echarts/chart/pie
'
,
'
echarts/component/grid
'
],
out
:
'
../../dist/echarts.simple.js
'
})
\ No newline at end of file
build/
optimiz
eString.js
→
build/
mangl
eString.js
浏览文件 @
794d283d
...
...
@@ -48,7 +48,7 @@ var base54 = (function(){
};
})();
function
optimiz
eString
(
source
)
{
function
mangl
eString
(
source
)
{
var
ast
=
esprima
.
parse
(
source
,
{
loc
:
true
...
...
@@ -162,4 +162,4 @@ function optimizeString(source) {
);
}
exports
=
module
.
exports
=
optimizeString
;
\ No newline at end of file
exports
=
module
.
exports
=
mangleString
;
\ No newline at end of file
build/optimize.js
浏览文件 @
794d283d
var
UglifyJS
=
require
(
'
uglify-js
'
);
var
fs
=
require
(
'
fs
'
);
var
etpl
=
require
(
'
etpl
'
);
var
argv
=
require
(
'
optimist
'
).
argv
;
etpl
.
config
({
commandOpen
:
'
/**
'
,
commandClose
:
'
*/
'
});
var
config
=
eval
(
'
(
'
+
fs
.
readFileSync
(
'
config.js
'
,
'
utf-8
'
)
+
'
)
'
);
var
mainCode
=
fs
.
readFileSync
(
'
../dist/echarts.js
'
,
'
utf-8
'
);
var
mode
=
argv
.
m
||
'
all
'
;
var
configPath
=
mode
===
'
all
'
?
'
config/echarts.js
'
:
'
config/echarts.
'
+
mode
+
'
.js
'
;
var
outPath
=
mode
===
'
all
'
?
'
../dist/echarts.js
'
:
'
../dist/echarts.
'
+
mode
+
'
.js
'
;
var
config
=
eval
(
'
(
'
+
fs
.
readFileSync
(
configPath
,
'
utf-8
'
)
+
'
)
'
);
var
mainCode
=
fs
.
readFileSync
(
outPath
,
'
utf-8
'
);
var
startCode
=
fs
.
readFileSync
(
'
wrap/start.js
'
,
'
utf-8
'
);
var
nutCode
=
fs
.
readFileSync
(
'
wrap/nut.js
'
,
'
utf-8
'
);
var
endCode
=
fs
.
readFileSync
(
'
wrap/end.js
'
,
'
utf-8
'
);
...
...
@@ -18,8 +23,7 @@ endCode = etpl.compile(endCode)({
});
// FIXME
var
sourceCode
=
[
startCode
,
nutCode
,
require
(
'
./optimizeString
'
)(
mainCode
),
endCode
].
join
(
'
\n
'
);
// var sourceCode = [startCode, nutCode, mainCode, endCode].join('\n');
var
sourceCode
=
[
startCode
,
nutCode
,
require
(
'
./mangleString
'
)(
mainCode
),
endCode
].
join
(
'
\n
'
);
var
ast
=
UglifyJS
.
parse
(
sourceCode
);
/* jshint camelcase: false */
...
...
@@ -32,5 +36,5 @@ ast.figure_out_scope();
ast
.
compute_char_frequency
();
ast
.
mangle_names
();
fs
.
writeFileSync
(
'
../dist/echarts.js
'
,
[
startCode
,
nutCode
,
mainCode
,
endCode
].
join
(
'
\n
'
),
'
utf-8
'
);
fs
.
writeFileSync
(
'
../dist/echarts.min.js
'
,
ast
.
print_to_string
(),
'
utf-8
'
);
\ No newline at end of file
fs
.
writeFileSync
(
outPath
,
[
startCode
,
nutCode
,
mainCode
,
endCode
].
join
(
'
\n
'
),
'
utf-8
'
);
fs
.
writeFileSync
(
outPath
.
replace
(
'
.js
'
,
'
.min.js
'
),
ast
.
print_to_string
(),
'
utf-8
'
);
\ No newline at end of file
build/wrap/end.js
浏览文件 @
794d283d
...
...
@@ -4,9 +4,5 @@ var echarts = require('echarts');
require
(
"
${mod}
"
);
/** /for */
/** if: ${vml} */
require
(
'
zrender/vml/vml
'
);
/** /if */
return
echarts
;
}));
src/action/createDataSelectAction.js
浏览文件 @
794d283d
...
...
@@ -10,14 +10,25 @@ define(function (require) {
* @property {string} name
*/
echarts
.
registerAction
(
actionInfo
,
function
(
payload
,
ecModel
)
{
var
selected
=
{};
ecModel
.
eachComponent
(
{
mainType
:
'
series
'
,
subType
:
seriesType
,
query
:
payload
},
function
(
seriesModel
)
{
if
(
seriesModel
[
actionInfo
.
method
])
{
seriesModel
[
actionInfo
.
method
](
payload
.
name
);
}
var
data
=
seriesModel
.
getData
();
// Create selected map
data
.
each
(
function
(
idx
)
{
var
name
=
data
.
getName
(
idx
);
selected
[
name
]
=
seriesModel
.
isSelected
(
name
)
||
false
;
});
}
);
return
{
name
:
payload
.
name
,
selected
:
selected
};
});
});
};
...
...
src/chart/line/LineSeries.js
浏览文件 @
794d283d
...
...
@@ -28,6 +28,9 @@ define(function(require) {
polarIndex
:
0
,
// If clip the overflow value
clipOverflow
:
true
,
label
:
{
normal
:
{
// show: false,
...
...
src/chart/line/LineView.js
浏览文件 @
794d283d
...
...
@@ -99,15 +99,16 @@ define(function(require) {
var
width
=
xExtent
[
1
]
-
x
;
var
height
=
yExtent
[
1
]
-
y
;
// Expand clip shape to avoid line value exceeds axis
if
(
isHorizontal
)
{
height
*=
10
;
y
-=
height
/
2
;
}
else
{
width
*=
10
;
x
-=
width
/
2
;
if
(
!
seriesModel
.
get
(
'
clipOverflow
'
))
{
if
(
isHorizontal
)
{
y
-=
height
;
height
*=
3
;
}
else
{
x
-=
width
;
width
*=
3
;
}
}
isHorizontal
?
(
height
*=
10
)
:
(
width
*=
10
);
var
clipPath
=
new
graphic
.
Rect
({
shape
:
{
x
:
x
,
...
...
src/component/legend/LegendModel.js
浏览文件 @
794d283d
...
...
@@ -30,15 +30,18 @@ define(function(require) {
// If has any selected in option.selected
var
selectedMap
=
this
.
option
.
selected
;
var
hasSelected
=
false
;
for
(
var
name
in
selectedMap
)
{
if
(
selectedMap
[
name
])
{
legendData
[
0
]
&&
this
.
select
(
name
);
hasSelected
=
true
;
// If selectedMode is single, try to select one
if
(
legendData
[
0
]
&&
this
.
get
(
'
selectedMode
'
)
===
'
single
'
)
{
var
hasSelected
=
false
;
for
(
var
name
in
selectedMap
)
{
if
(
selectedMap
[
name
])
{
this
.
select
(
name
);
hasSelected
=
true
;
}
}
// Try select the first if selectedMode is single
!
hasSelected
&&
this
.
select
(
legendData
[
0
].
get
(
'
name
'
));
}
// Try select the first if selectedMode is single
!
hasSelected
&&
legendData
[
0
]
&&
this
.
select
(
legendData
[
0
].
get
(
'
name
'
));
},
mergeOption
:
function
(
option
)
{
...
...
src/component/legend/legendAction.js
浏览文件 @
794d283d
...
...
@@ -6,11 +6,21 @@ define(function(require) {
var
echarts
=
require
(
'
../../echarts
'
);
var
zrUtil
=
require
(
'
zrender/core/util
'
);
function
legendSelectActionHandler
(
methodName
,
action
,
ecModel
)
{
function
legendSelectActionHandler
(
methodName
,
payload
,
ecModel
)
{
var
selectedMap
=
{};
var
isToggleSelect
=
methodName
===
'
toggleSelected
'
;
var
isSelected
;
// Update all legend components
ecModel
.
eachComponent
(
'
legend
'
,
function
(
legendModel
)
{
legendModel
[
methodName
](
action
.
name
);
if
(
isToggleSelect
&&
isSelected
!=
null
)
{
// Force other legend has same selected status
// Or the first is toggled to true and other are toggled to false
legendModel
[
isSelected
?
'
select
'
:
'
unSelect
'
](
payload
.
name
);
}
else
{
legendModel
[
methodName
](
payload
.
name
);
isSelected
=
legendModel
.
isSelected
(
payload
.
name
);
}
var
legendData
=
legendModel
.
getData
();
zrUtil
.
each
(
legendData
,
function
(
model
)
{
var
name
=
model
.
get
(
'
name
'
);
...
...
@@ -30,7 +40,7 @@ define(function(require) {
});
// Return the event explicitly
return
{
name
:
action
.
name
,
name
:
payload
.
name
,
selected
:
selectedMap
};
}
...
...
src/component/toolbox/feature/MagicType.js
浏览文件 @
794d283d
...
...
@@ -128,6 +128,7 @@ define(function(require) {
);
api
.
dispatchAction
({
type
:
'
changeMagicType
'
,
currentType
:
type
,
newOption
:
newOption
});
};
...
...
src/echarts.js
浏览文件 @
794d283d
...
...
@@ -572,8 +572,10 @@ define(function (require) {
var
updateMethod
=
actionInfo
.
update
||
'
update
'
;
var
payloads
=
[
payload
];
var
batched
=
false
;
// Batch action
if
(
payload
.
batch
)
{
batched
=
true
;
payloads
=
zrUtil
.
map
(
payload
.
batch
,
function
(
item
)
{
item
=
zrUtil
.
defaults
(
zrUtil
.
extend
({},
item
),
payload
);
item
.
batch
=
null
;
...
...
@@ -594,7 +596,7 @@ define(function (require) {
eventObj
.
type
=
actionInfo
.
event
||
eventObj
.
type
;
eventObjBatch
.
push
(
eventObj
);
// Highlight and downplay
is
special.
// Highlight and downplay
are
special.
isHighlightOrDownplay
&&
updateMethods
[
updateMethod
].
call
(
this
,
batchItem
);
}
...
...
@@ -602,7 +604,8 @@ define(function (require) {
&&
updateMethods
[
updateMethod
].
call
(
this
,
payload
);
if
(
!
silent
)
{
if
(
eventObjBatch
.
length
>
1
)
{
// Follow the rule of action batch
if
(
batched
)
{
eventObj
=
{
type
:
eventObjBatch
[
0
].
type
,
batch
:
eventObjBatch
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录