Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
27e68a02
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,发现更多精彩内容 >>
提交
27e68a02
编写于
6月 16, 2016
作者:
P
pah100
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://github.com/ecomfe/echarts
上级
f2fa58a6
7e6f5b5b
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
157 addition
and
62 deletion
+157
-62
extension/bmap/BMapModel.js
extension/bmap/BMapModel.js
+3
-2
src/chart/helper/EffectSymbol.js
src/chart/helper/EffectSymbol.js
+89
-51
src/chart/helper/LargeSymbolDraw.js
src/chart/helper/LargeSymbolDraw.js
+37
-2
src/chart/lines/LinesView.js
src/chart/lines/LinesView.js
+11
-0
src/chart/radar/RadarView.js
src/chart/radar/RadarView.js
+1
-1
src/component/dataZoom/SliderZoomView.js
src/component/dataZoom/SliderZoomView.js
+6
-3
test/parallel-nutrients.html
test/parallel-nutrients.html
+4
-2
test/theme.html
test/theme.html
+6
-1
未找到文件。
extension/bmap/BMapModel.js
浏览文件 @
27e68a02
...
...
@@ -23,9 +23,10 @@ define(function (require) {
},
defaultOption
:
{
center
:
null
,
zoom
:
1
,
center
:
[
104.114129
,
37.550339
],
zoom
:
5
,
mapStyle
:
{},
...
...
src/chart/helper/EffectSymbol.js
浏览文件 @
27e68a02
...
...
@@ -19,6 +19,19 @@ define(function (require) {
}
return
symbolSize
;
}
function
updateRipplePath
(
rippleGroup
,
effectCfg
)
{
rippleGroup
.
eachChild
(
function
(
ripplePath
)
{
ripplePath
.
attr
({
z
:
effectCfg
.
z
,
zlevel
:
effectCfg
.
zlevel
,
style
:
{
stroke
:
effectCfg
.
brushType
===
'
stroke
'
?
effectCfg
.
color
:
null
,
fill
:
effectCfg
.
brushType
===
'
fill
'
?
effectCfg
.
color
:
null
}
});
});
}
/**
* @constructor
* @param {module:echarts/data/List} data
...
...
@@ -45,12 +58,9 @@ define(function (require) {
this
.
childAt
(
1
).
removeAll
();
};
effectSymbolProto
.
startEffectAnimation
=
function
(
period
,
brushType
,
rippleScale
,
effectOffset
,
z
,
zlevel
)
{
var
symbolType
=
this
.
_symbolType
;
var
color
=
this
.
_color
;
effectSymbolProto
.
startEffectAnimation
=
function
(
effectCfg
)
{
var
symbolType
=
effectCfg
.
symbolType
;
var
color
=
effectCfg
.
color
;
var
rippleGroup
=
this
.
childAt
(
1
);
for
(
var
i
=
0
;
i
<
EFFECT_RIPPLE_NUMBER
;
i
++
)
{
...
...
@@ -59,27 +69,23 @@ define(function (require) {
);
ripplePath
.
attr
({
style
:
{
stroke
:
brushType
===
'
stroke
'
?
color
:
null
,
fill
:
brushType
===
'
fill
'
?
color
:
null
,
strokeNoScale
:
true
},
z2
:
99
,
silent
:
true
,
scale
:
[
1
,
1
],
z
:
z
,
zlevel
:
zlevel
scale
:
[
1
,
1
]
});
var
delay
=
-
i
/
EFFECT_RIPPLE_NUMBER
*
period
+
effectOffset
;
// TODO Configurable period
var
delay
=
-
i
/
EFFECT_RIPPLE_NUMBER
*
effectCfg
.
period
+
effectCfg
.
effectOffset
;
// TODO Configurable
effectCfg.
period
ripplePath
.
animate
(
''
,
true
)
.
when
(
period
,
{
scale
:
[
rippleScale
,
rippleScale
]
.
when
(
effectCfg
.
period
,
{
scale
:
[
effectCfg
.
rippleScale
,
effectCfg
.
rippleScale
]
})
.
delay
(
delay
)
.
start
();
ripplePath
.
animateStyle
(
true
)
.
when
(
period
,
{
.
when
(
effectCfg
.
period
,
{
opacity
:
0
})
.
delay
(
delay
)
...
...
@@ -87,6 +93,29 @@ define(function (require) {
rippleGroup
.
add
(
ripplePath
);
}
updateRipplePath
(
rippleGroup
,
effectCfg
);
};
/**
* Update effect symbol
*/
effectSymbolProto
.
updateEffectAnimation
=
function
(
effectCfg
)
{
var
oldEffectCfg
=
this
.
_effectCfg
;
var
rippleGroup
=
this
.
childAt
(
1
);
// Must reinitialize effect if following configuration changed
var
DIFFICULT_PROPS
=
[
'
symbolType
'
,
'
period
'
,
'
rippleScale
'
];
for
(
var
i
=
0
;
i
<
DIFFICULT_PROPS
;
i
++
)
{
var
propName
=
DIFFICULT_PROPS
[
i
];
if
(
oldEffectCfg
[
propName
]
!==
effectCfg
[
propName
])
{
this
.
stopEffectAnimation
();
this
.
startEffectAnimation
(
effectCfg
);
return
;
}
}
updateRipplePath
(
rippleGroup
,
effectCfg
);
};
/**
...
...
@@ -135,43 +164,52 @@ define(function (require) {
}
rippleGroup
.
rotation
=
(
itemModel
.
getShallow
(
'
symbolRotate
'
)
||
0
)
*
Math
.
PI
/
180
||
0
;
this
.
_symbolType
=
symbolType
;
this
.
_color
=
color
;
var
showEffectOn
=
seriesModel
.
get
(
'
showEffectOn
'
);
var
rippleScale
=
itemModel
.
get
(
'
rippleEffect.scale
'
);
var
brushType
=
itemModel
.
get
(
'
rippleEffect.brushType
'
);
var
effectPeriod
=
itemModel
.
get
(
'
rippleEffect.period
'
)
*
1000
;
var
effectOffset
=
idx
/
data
.
count
();
var
z
=
itemModel
.
getShallow
(
'
z
'
)
||
0
;
var
zlevel
=
itemModel
.
getShallow
(
'
zlevel
'
)
||
0
;
this
.
stopEffectAnimation
();
if
(
showEffectOn
===
'
render
'
)
{
this
.
startEffectAnimation
(
effectPeriod
,
brushType
,
rippleScale
,
effectOffset
,
z
,
zlevel
);
}
var
symbol
=
this
.
childAt
(
0
);
function
onEmphasis
()
{
symbol
.
trigger
(
'
emphasis
'
);
if
(
showEffectOn
!==
'
render
'
)
{
this
.
startEffectAnimation
(
effectPeriod
,
brushType
,
rippleScale
,
effectOffset
,
z
,
zlevel
);
}
var
effectCfg
=
{};
effectCfg
.
showEffectOn
=
seriesModel
.
get
(
'
showEffectOn
'
);
effectCfg
.
rippleScale
=
itemModel
.
get
(
'
rippleEffect.scale
'
);
effectCfg
.
brushType
=
itemModel
.
get
(
'
rippleEffect.brushType
'
);
effectCfg
.
period
=
itemModel
.
get
(
'
rippleEffect.period
'
)
*
1000
;
effectCfg
.
effectOffset
=
idx
/
data
.
count
();
effectCfg
.
z
=
itemModel
.
getShallow
(
'
z
'
)
||
0
;
effectCfg
.
zlevel
=
itemModel
.
getShallow
(
'
zlevel
'
)
||
0
;
effectCfg
.
symbolType
=
symbolType
;
effectCfg
.
color
=
color
;
this
.
off
(
'
mouseover
'
).
off
(
'
mouseout
'
).
off
(
'
emphasis
'
).
off
(
'
normal
'
);
if
(
effectCfg
.
showEffectOn
===
'
render
'
)
{
this
.
_effectCfg
?
this
.
updateEffectAnimation
(
effectCfg
)
:
this
.
startEffectAnimation
(
effectCfg
);
this
.
_effectCfg
=
effectCfg
;
}
function
onNormal
()
{
symbol
.
trigger
(
'
normal
'
);
if
(
showEffectOn
!==
'
render
'
)
{
this
.
stopEffectAnimation
();
}
else
{
// Not keep old effect config
this
.
_effectCfg
=
null
;
this
.
stopEffectAnimation
();
var
symbol
=
this
.
childAt
(
0
);
var
onEmphasis
=
function
()
{
symbol
.
trigger
(
'
emphasis
'
);
if
(
effectCfg
.
showEffectOn
!==
'
render
'
)
{
this
.
startEffectAnimation
(
effectCfg
);
}
};
var
onNormal
=
function
()
{
symbol
.
trigger
(
'
normal
'
);
if
(
effectCfg
.
showEffectOn
!==
'
render
'
)
{
this
.
stopEffectAnimation
();
}
};
this
.
on
(
'
mouseover
'
,
onEmphasis
,
this
)
.
on
(
'
mouseout
'
,
onNormal
,
this
)
.
on
(
'
emphasis
'
,
onEmphasis
,
this
)
.
on
(
'
normal
'
,
onNormal
,
this
);
}
this
.
off
(
'
mouseover
'
).
off
(
'
mouseout
'
).
off
(
'
emphasis
'
).
off
(
'
normal
'
);
this
.
on
(
'
mouseover
'
,
onEmphasis
,
this
)
.
on
(
'
mouseout
'
,
onNormal
,
this
)
.
on
(
'
emphasis
'
,
onEmphasis
,
this
)
.
on
(
'
normal
'
,
onNormal
,
this
);
this
.
_effectCfg
=
effectCfg
;
};
effectSymbolProto
.
fadeOut
=
function
(
cb
)
{
...
...
src/chart/helper/LargeSymbolDraw.js
浏览文件 @
27e68a02
...
...
@@ -37,6 +37,28 @@ define(function (require) {
symbolProxy
.
buildPath
(
path
,
symbolProxyShape
,
true
);
}
}
},
findDataIndex
:
function
(
x
,
y
)
{
var
shape
=
this
.
shape
;
var
points
=
shape
.
points
;
var
sizes
=
shape
.
sizes
;
// Not consider transform
// Treat each element as a rect
// top down traverse
for
(
var
i
=
points
.
length
-
1
;
i
>=
0
;
i
--
)
{
var
pt
=
points
[
i
];
var
size
=
sizes
[
i
];
var
x0
=
pt
[
0
]
-
size
[
0
]
/
2
;
var
y0
=
pt
[
1
]
-
size
[
1
]
/
2
;
if
(
x
>=
x0
&&
y
>=
y0
&&
x
<=
x0
+
size
[
0
]
&&
y
<=
y0
+
size
[
1
])
{
// i is dataIndex
return
i
;
}
}
return
-
1
;
}
});
...
...
@@ -44,7 +66,8 @@ define(function (require) {
this
.
group
=
new
graphic
.
Group
();
this
.
_symbolEl
=
new
LargeSymbolPath
({
silent
:
true
// rectHover: true,
// cursor: 'default'
});
}
...
...
@@ -90,8 +113,20 @@ define(function (require) {
symbolEl
.
setColor
(
visualColor
);
}
// Enable tooltip
// PENDING May have performance issue when path is extremely large
symbolEl
.
seriesIndex
=
seriesModel
.
seriesIndex
;
symbolEl
.
on
(
'
mousemove
'
,
function
(
e
)
{
symbolEl
.
dataIndex
=
null
;
var
dataIndex
=
symbolEl
.
findDataIndex
(
e
.
offsetX
,
e
.
offsetY
);
if
(
dataIndex
>
0
)
{
// Provide dataIndex for tooltip
symbolEl
.
dataIndex
=
dataIndex
;
}
});
// Add back
this
.
group
.
add
(
this
.
_
symbolEl
);
this
.
group
.
add
(
symbolEl
);
};
largeSymbolProto
.
updateLayout
=
function
(
seriesModel
)
{
...
...
src/chart/lines/LinesView.js
浏览文件 @
27e68a02
...
...
@@ -39,12 +39,23 @@ define(function (require) {
});
}
if
(
hasEffect
&&
trailLength
)
{
if
(
__DEV__
)
{
var
notInIndividual
=
false
;
ecModel
.
eachSeries
(
function
(
otherSeriesModel
)
{
if
(
otherSeriesModel
!==
seriesModel
&&
otherSeriesModel
.
get
(
'
zlevel
'
)
===
zlevel
)
{
notInIndividual
=
true
;
}
});
notInIndividual
&&
console
.
warn
(
'
Lines with trail effect should have an individual zlevel
'
);
}
zr
.
configLayer
(
zlevel
,
{
motionBlur
:
true
,
lastFrameAlpha
:
Math
.
max
(
Math
.
min
(
trailLength
/
10
+
0.9
,
1
),
0
)
});
}
this
.
group
.
add
(
lineDraw
.
group
);
lineDraw
.
updateData
(
data
);
...
...
src/chart/radar/RadarView.js
浏览文件 @
27e68a02
...
...
@@ -134,7 +134,7 @@ define(function (require) {
group
.
add
(
itemGroup
);
polyline
.
useStyle
(
zrUtil
.
extend
(
zrUtil
.
defaults
(
itemModel
.
getModel
(
'
lineStyle.normal
'
).
getLineStyle
(),
{
fill
:
'
none
'
,
...
...
src/component/dataZoom/SliderZoomView.js
浏览文件 @
27e68a02
...
...
@@ -146,9 +146,10 @@ define(function (require) {
var
barGroup
=
this
.
_displayables
.
barGroup
=
new
graphic
.
Group
();
this
.
_renderBackground
();
this
.
_renderHandle
();
this
.
_renderBackground
();
this
.
_renderDataShadow
();
thisGroup
.
add
(
barGroup
);
...
...
@@ -256,7 +257,8 @@ define(function (require) {
},
style
:
{
fill
:
dataZoomModel
.
get
(
'
backgroundColor
'
)
}
},
z2
:
-
40
}));
},
...
...
@@ -462,7 +464,8 @@ define(function (require) {
textAlign
:
'
center
'
,
fill
:
textStyleModel
.
getTextColor
(),
textFont
:
textStyleModel
.
getFont
()
}
},
z2
:
10
}));
},
this
);
...
...
test/parallel-nutrients.html
浏览文件 @
27e68a02
...
...
@@ -34,7 +34,7 @@
'
echarts/component/legend
'
,
'
echarts/component/tooltip
'
,
'
echarts/component/toolbox
'
,
'
echarts/component/visualMap
'
,
'
echarts/component/visualMap
'
],
function
(
ec
,
ct
)
{
$
.
getJSON
(
'
./data/nutrients.json
'
,
function
(
data
)
{
...
...
@@ -45,7 +45,9 @@
chart
=
myChart
=
echarts
.
init
(
document
.
getElementById
(
'
main
'
));
console
.
time
(
'
render
'
);
chart
.
setOption
(
getOption
(
data
));
console
.
timeEnd
(
'
render
'
);
chart
.
on
(
'
axisAreaSelected
'
,
function
(
event
)
{
// var indices = chart.getModel().getSeries()[0].getRawIndicesByActiveState('active');
...
...
@@ -231,7 +233,7 @@
lineStyle
:
lineStyle
,
inactiveOpacity
:
0
,
activeOpacity
:
0.01
,
progressive
:
1
00
,
progressive
:
5
00
,
smooth
:
true
,
data
:
data
}
...
...
test/theme.html
浏览文件 @
27e68a02
...
...
@@ -26,7 +26,8 @@
'
echarts/chart/bar
'
,
'
echarts/component/legend
'
,
'
echarts/component/grid
'
,
'
echarts/component/tooltip
'
'
echarts/component/tooltip
'
,
'
echarts/component/dataZoom
'
],
function
(
echarts
,
theme
)
{
var
chart
=
echarts
.
init
(
document
.
getElementById
(
'
main
'
),
'
dark
'
);
...
...
@@ -75,6 +76,10 @@
align
:
'
right
'
},
tooltip
:
{},
dataZoom
:
{
start
:
10
,
end
:
20
},
xAxis
:
{
data
:
xAxisData
,
axisLine
:
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录