Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
bf2f13f5
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,发现更多精彩内容 >>
提交
bf2f13f5
编写于
11月 24, 2015
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Enhancement
上级
e5f2822d
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
139 addition
and
77 deletion
+139
-77
src/chart/bar/BarView.js
src/chart/bar/BarView.js
+20
-1
src/chart/helper/Symbol.js
src/chart/helper/Symbol.js
+23
-1
src/chart/helper/createListFromArray.js
src/chart/helper/createListFromArray.js
+1
-1
src/chart/line/LineSeries.js
src/chart/line/LineSeries.js
+2
-0
src/chart/line/LineView.js
src/chart/line/LineView.js
+0
-1
src/chart/map/MapView.js
src/chart/map/MapView.js
+5
-0
src/chart/pie/PieSeries.js
src/chart/pie/PieSeries.js
+2
-0
src/chart/pie/PieView.js
src/chart/pie/PieView.js
+21
-0
src/chart/scatter/ScatterSeries.js
src/chart/scatter/ScatterSeries.js
+1
-0
src/component/helper/MapDraw.js
src/component/helper/MapDraw.js
+2
-1
src/component/helper/RoamController.js
src/component/helper/RoamController.js
+1
-1
src/coord/cartesian/AxisModel.js
src/coord/cartesian/AxisModel.js
+2
-1
src/coord/geo/Geo.js
src/coord/geo/Geo.js
+2
-2
src/coord/geo/parseGeoJson.js
src/coord/geo/parseGeoJson.js
+6
-3
src/echarts.js
src/echarts.js
+2
-2
src/layout/barGrid.js
src/layout/barGrid.js
+48
-50
src/model/Global.js
src/model/Global.js
+0
-11
src/util/number.js
src/util/number.js
+1
-2
未找到文件。
src/chart/bar/BarView.js
浏览文件 @
bf2f13f5
...
...
@@ -7,6 +7,15 @@ define(function (require) {
zrUtil
.
extend
(
require
(
'
../../model/Model
'
).
prototype
,
require
(
'
./barItemStyle
'
));
function
fixLayoutWithLineWidth
(
layout
,
lineWidth
)
{
var
signX
=
layout
.
width
>
0
?
1
:
-
1
;
var
signY
=
layout
.
height
>
0
?
1
:
-
1
;
layout
.
x
+=
signX
*
lineWidth
/
2
;
layout
.
y
+=
signY
*
lineWidth
/
2
;
layout
.
width
-=
signX
*
lineWidth
;
layout
.
height
-=
signY
*
lineWidth
;
}
return
require
(
'
../../echarts
'
).
extendChartView
({
type
:
'
bar
'
,
...
...
@@ -32,6 +41,8 @@ define(function (require) {
var
enableAnimation
=
ecModel
.
get
(
'
animation
'
);
var
barBorderWidthQuery
=
[
'
itemStyle
'
,
'
normal
'
,
'
barBorderWidth
'
];
data
.
diff
(
oldData
)
.
add
(
function
(
dataIndex
)
{
// 空数据
...
...
@@ -40,6 +51,10 @@ define(function (require) {
}
var
layout
=
data
.
getItemLayout
(
dataIndex
);
var
lineWidth
=
data
.
getItemModel
(
dataIndex
).
get
(
barBorderWidthQuery
)
||
0
;
fixLayoutWithLineWidth
(
layout
,
lineWidth
);
var
rect
=
new
graphic
.
Rect
({
shape
:
zrUtil
.
extend
({},
layout
)
});
...
...
@@ -68,8 +83,12 @@ define(function (require) {
return
;
}
var
layout
=
data
.
getItemLayout
(
newIndex
);
var
lineWidth
=
data
.
getItemModel
(
newIndex
).
get
(
barBorderWidthQuery
)
||
0
;
fixLayoutWithLineWidth
(
layout
,
lineWidth
);
api
.
updateGraphicEl
(
rect
,
{
shape
:
data
.
getItemLayout
(
newIndex
)
shape
:
layout
});
data
.
setItemGraphicEl
(
newIndex
,
rect
);
...
...
src/chart/helper/Symbol.js
浏览文件 @
bf2f13f5
...
...
@@ -37,7 +37,7 @@ define(function (require) {
z2
:
100
});
symbolPath
.
attr
(
'
scale
'
,
[
0
,
0
]);
this
.
add
(
symbolPath
);
var
size
=
normalizeSymbolSize
(
data
.
getItemVisual
(
idx
,
'
symbolSize
'
));
api
.
initGraphicEl
(
symbolPath
,
{
...
...
@@ -45,6 +45,8 @@ define(function (require) {
});
this
.
_symbolType
=
symbolType
;
this
.
add
(
symbolPath
);
};
/**
...
...
@@ -72,6 +74,7 @@ define(function (require) {
// Update common properties
var
normalStyleAccessPath
=
[
'
itemStyle
'
,
'
normal
'
];
var
emphasisStyleAccessPath
=
[
'
itemStyle
'
,
'
emphasis
'
];
symbolProto
.
_updateCommon
=
function
(
data
,
idx
)
{
var
symbolPath
=
this
.
childAt
(
0
);
var
seriesModel
=
data
.
hostModel
;
...
...
@@ -115,6 +118,25 @@ define(function (require) {
}
graphic
.
setHoverStyle
(
symbolPath
,
hoverStyle
);
var
size
=
normalizeSymbolSize
(
data
.
getItemVisual
(
idx
,
'
symbolSize
'
));
function
onEmphasis
()
{
this
.
animateTo
({
scale
:
[
size
[
0
]
*
1.1
,
size
[
1
]
*
1.1
]
},
400
,
'
elasticOut
'
);
}
function
onNormal
()
{
this
.
animateTo
({
scale
:
size
},
400
,
'
elasticOut
'
);
}
if
(
itemModel
.
get
(
'
hoverAnimation
'
))
{
symbolPath
.
on
(
'
mouseover
'
,
onEmphasis
)
.
on
(
'
mouseout
'
,
onNormal
)
.
on
(
'
emphasis
'
,
onEmphasis
)
.
on
(
'
normal
'
,
onNormal
);
}
};
symbolProto
.
fadeOut
=
function
(
cb
,
api
)
{
...
...
src/chart/helper/createListFromArray.js
浏览文件 @
bf2f13f5
...
...
@@ -114,7 +114,7 @@ define(function(require) {
// 多个散点图系列在同一个地区的时候
return
{
dimensions
:
[
{
name
:
'
l
on
'
},
{
name
:
'
l
ng
'
},
{
name
:
'
lat
'
},
{
name
:
'
value
'
}
]
...
...
src/chart/line/LineSeries.js
浏览文件 @
bf2f13f5
...
...
@@ -20,6 +20,8 @@ define(function(require) {
z
:
2
,
// 二级层叠
coordinateSystem
:
'
cartesian2d
'
,
legendHoverLink
:
true
,
hoverAnimation
:
true
,
// stack: null
xAxisIndex
:
0
,
yAxisIndex
:
0
,
...
...
src/chart/line/LineView.js
浏览文件 @
bf2f13f5
...
...
@@ -3,7 +3,6 @@ define(function(require) {
'
use strict
'
;
var
zrUtil
=
require
(
'
zrender/core/util
'
);
var
vector
=
require
(
'
zrender/core/vector
'
);
var
SymbolDraw
=
require
(
'
../helper/SymbolDraw
'
);
var
lineAnimationDiff
=
require
(
'
./lineAnimationDiff
'
);
var
graphic
=
require
(
'
../../util/graphic
'
);
...
...
src/chart/map/MapView.js
浏览文件 @
bf2f13f5
...
...
@@ -60,6 +60,11 @@ define(function (require) {
var
layout
=
data
.
getItemLayout
(
idx
);
if
(
!
layout
||
!
layout
.
point
)
{
// Not exists in map
return
;
}
var
point
=
layout
.
point
;
var
offset
=
layout
.
offset
;
...
...
src/chart/pie/PieSeries.js
浏览文件 @
bf2f13f5
...
...
@@ -70,6 +70,8 @@ define(function(require) {
zlevel
:
0
,
z
:
2
,
legendHoverLink
:
true
,
hoverAnimation
:
true
,
// 默认全局居中
center
:
[
'
50%
'
,
'
50%
'
],
radius
:
[
0
,
'
75%
'
],
...
...
src/chart/pie/PieView.js
浏览文件 @
bf2f13f5
...
...
@@ -216,6 +216,27 @@ define(function (require) {
seriesModel
.
get
(
'
selectedOffset
'
),
seriesModel
.
ecModel
.
get
(
'
animation
'
)
);
function
onEmphasis
()
{
sector
.
animateTo
({
shape
:
{
r
:
layout
.
r
+
10
}
},
300
,
'
elasticOut
'
);
}
function
onNormal
()
{
sector
.
animateTo
({
shape
:
{
r
:
layout
.
r
}
},
300
,
'
elasticOut
'
);
}
if
(
itemModel
.
get
(
'
hoverAnimation
'
))
{
sector
.
on
(
'
mouseover
'
,
onEmphasis
)
.
on
(
'
mouseout
'
,
onNormal
)
.
on
(
'
emphasis
'
,
onEmphasis
)
.
on
(
'
normal
'
,
onNormal
);
}
};
zrUtil
.
inherits
(
PiePiece
,
graphic
.
Group
);
...
...
src/chart/scatter/ScatterSeries.js
浏览文件 @
bf2f13f5
...
...
@@ -26,6 +26,7 @@ define(function (require) {
z
:
2
,
// 二级层叠
legendHoverLink
:
true
,
hoverAnimation
:
true
,
// Cartesian coordinate system
xAxisIndex
:
0
,
yAxisIndex
:
0
,
...
...
src/component/helper/MapDraw.js
浏览文件 @
bf2f13f5
...
...
@@ -146,7 +146,8 @@ define(function (require) {
},
style
:
{
strokeNoScale
:
true
}
},
culling
:
true
});
polygon
.
setStyle
(
itemStyle
);
...
...
src/component/helper/RoamController.js
浏览文件 @
bf2f13f5
...
...
@@ -25,7 +25,7 @@ define(function (require) {
function
mousemove
(
e
)
{
if
(
this
.
_dragging
)
{
var
rawE
=
e
.
event
;
rawE
.
preventDefault
();
rawE
.
preventDefault
&&
rawE
.
preventDefault
();
var
x
=
e
.
offsetX
;
var
y
=
e
.
offsetY
;
...
...
src/coord/cartesian/AxisModel.js
浏览文件 @
bf2f13f5
...
...
@@ -25,7 +25,8 @@ define(function(require) {
});
function
getAxisType
(
axisDim
,
option
)
{
return
option
.
type
||
(
axisDim
===
'
x
'
?
'
category
'
:
'
value
'
);
// Default xAxis and axis with data is category axis
return
option
.
type
||
((
axisDim
===
'
x
'
||
option
.
data
)
?
'
category
'
:
'
value
'
);
}
zrUtil
.
merge
(
AxisModel
.
prototype
,
require
(
'
../axisModelCommonMixin
'
));
...
...
src/coord/geo/Geo.js
浏览文件 @
bf2f13f5
...
...
@@ -29,7 +29,7 @@ define(function (require) {
* @param {Array.<string>}
* @readOnly
*/
this
.
dimensions
=
[
'
l
on
'
,
'
lat
'
];
this
.
dimensions
=
[
'
l
ng
'
,
'
lat
'
];
this
.
_nameCoordMap
=
{};
...
...
@@ -147,7 +147,7 @@ define(function (require) {
*/
dataToPoints
:
function
(
data
)
{
var
item
=
[];
return
data
.
mapArray
([
'
l
on
'
,
'
lat
'
],
function
(
lon
,
lat
)
{
return
data
.
mapArray
([
'
l
ng
'
,
'
lat
'
],
function
(
lon
,
lat
)
{
item
[
0
]
=
lon
;
item
[
1
]
=
lat
;
return
this
.
dataToPoint
(
item
);
...
...
src/coord/geo/parseGeoJson.js
浏览文件 @
bf2f13f5
...
...
@@ -50,9 +50,9 @@ define(function (require) {
var
prevX
=
encodeOffsets
[
0
];
var
prevY
=
encodeOffsets
[
1
];
for
(
var
i
=
0
;
i
<
coordinate
.
length
;
i
+=
2
)
{
for
(
var
i
=
0
;
i
<
coordinate
.
length
;
i
+=
2
)
{
var
x
=
coordinate
.
charCodeAt
(
i
)
-
64
;
var
y
=
coordinate
.
charCodeAt
(
i
+
1
)
-
64
;
var
y
=
coordinate
.
charCodeAt
(
i
+
1
)
-
64
;
// ZigZag decoding
x
=
(
x
>>
1
)
^
(
-
(
x
&
1
));
y
=
(
y
>>
1
)
^
(
-
(
y
&
1
));
...
...
@@ -91,7 +91,10 @@ define(function (require) {
decode
(
geoJson
);
return
zrUtil
.
map
(
geoJson
.
features
,
function
(
featureObj
)
{
return
zrUtil
.
map
(
zrUtil
.
filter
(
geoJson
.
features
,
function
(
featureObj
)
{
// Output of mapshaper may have geometry null
return
featureObj
.
geometry
&&
featureObj
.
properties
;
}),
function
(
featureObj
)
{
var
properties
=
featureObj
.
properties
;
var
geometry
=
featureObj
.
geometry
;
...
...
src/echarts.js
浏览文件 @
bf2f13f5
...
...
@@ -13,7 +13,7 @@ define(function (require) {
var
ComponentView
=
require
(
'
./view/Component
'
);
var
ChartView
=
require
(
'
./view/Chart
'
);
var
Scale
=
require
(
'
./scale/Scale
'
);
//
var Scale = require('./scale/Scale');
var
zrender
=
require
(
'
zrender
'
);
var
zrUtil
=
require
(
'
zrender/core/util
'
);
...
...
@@ -65,7 +65,7 @@ define(function (require) {
* @type {Object}
* @private
*/
this
.
_theme
=
zrUtil
.
clone
(
theme
);
this
.
_theme
=
zrUtil
.
clone
(
theme
,
true
);
/**
* @type {Array.<module:echarts/view/Chart>}
...
...
src/layout/barGrid.js
浏览文件 @
bf2f13f5
...
...
@@ -153,60 +153,58 @@ define(function(require) {
var
barMinHeight
=
seriesModel
.
get
(
'
barMinHeight
'
)
||
0
;
if
(
data
.
type
===
'
list
'
)
{
var
valueAxisStart
=
baseAxis
.
onZero
?
valueAxis
.
dataToCoord
(
0
)
:
valueAxis
.
getExtent
()[
0
];
var
coords
=
cartesian
.
dataToPoints
(
data
,
true
);
lastStackCoords
[
stackId
]
=
lastStackCoords
[
stackId
]
||
[];
data
.
each
(
valueAxis
.
dim
,
function
(
value
,
idx
)
{
// 空数据
if
(
isNaN
(
value
))
{
return
;
}
if
(
!
lastStackCoords
[
stackId
][
idx
])
{
lastStackCoords
[
stackId
][
idx
]
=
{
// Positive stack
p
:
valueAxisStart
,
// Negative stack
n
:
valueAxisStart
};
}
var
sign
=
value
>=
0
?
'
p
'
:
'
n
'
;
var
coord
=
coords
[
idx
];
var
lastCoord
=
lastStackCoords
[
stackId
][
idx
][
sign
];
var
x
,
y
,
width
,
height
;
if
(
valueAxis
.
isHorizontal
())
{
x
=
lastCoord
;
y
=
coord
[
1
]
+
columnOffset
;
width
=
coord
[
0
]
-
lastCoord
;
height
=
columnWidth
;
if
(
Math
.
abs
(
width
)
<
barMinHeight
)
{
width
=
(
width
<
0
?
-
1
:
1
)
*
barMinHeight
;
}
var
valueAxisStart
=
baseAxis
.
onZero
?
valueAxis
.
dataToCoord
(
0
)
:
valueAxis
.
getExtent
()[
0
];
var
coords
=
cartesian
.
dataToPoints
(
data
,
true
);
lastStackCoords
[
stackId
]
=
lastStackCoords
[
stackId
]
||
[];
data
.
each
(
valueAxis
.
dim
,
function
(
value
,
idx
)
{
// 空数据
if
(
isNaN
(
value
))
{
return
;
}
if
(
!
lastStackCoords
[
stackId
][
idx
])
{
lastStackCoords
[
stackId
][
idx
]
=
{
// Positive stack
p
:
valueAxisStart
,
// Negative stack
n
:
valueAxisStart
};
}
var
sign
=
value
>=
0
?
'
p
'
:
'
n
'
;
var
coord
=
coords
[
idx
];
var
lastCoord
=
lastStackCoords
[
stackId
][
idx
][
sign
];
var
x
,
y
,
width
,
height
;
if
(
valueAxis
.
isHorizontal
())
{
x
=
lastCoord
;
y
=
coord
[
1
]
+
columnOffset
;
width
=
coord
[
0
]
-
lastCoord
;
height
=
columnWidth
;
if
(
Math
.
abs
(
width
)
<
barMinHeight
)
{
width
=
(
width
<
0
?
-
1
:
1
)
*
barMinHeight
;
}
else
{
x
=
coord
[
0
]
+
columnOffset
;
y
=
lastCoord
;
width
=
columnWidth
;
height
=
coord
[
1
]
-
lastCoord
;
if
(
Math
.
abs
(
height
)
<
barMinHeight
)
{
height
=
(
height
<
0
?
-
1
:
1
)
*
barMinHeight
;
}
lastStackCoords
[
stackId
][
idx
][
sign
]
+=
width
;
}
else
{
x
=
coord
[
0
]
+
columnOffset
;
y
=
lastCoord
;
width
=
columnWidth
;
height
=
coord
[
1
]
-
lastCoord
;
if
(
Math
.
abs
(
height
)
<
barMinHeight
)
{
height
=
(
height
<
0
?
-
1
:
1
)
*
barMinHeight
;
}
lastStackCoords
[
stackId
][
idx
][
sign
]
+=
height
;
}
data
.
setItemLayout
(
idx
,
{
x
:
x
,
y
:
y
,
width
:
width
,
height
:
height
});
},
true
);
}
data
.
setItemLayout
(
idx
,
{
x
:
x
,
y
:
y
,
width
:
width
,
height
:
height
});
},
true
);
},
this
);
}
...
...
src/model/Global.js
浏览文件 @
bf2f13f5
...
...
@@ -530,17 +530,6 @@ define(function (require) {
);
},
/**
* @param {Function} cb
* @param {*} context
*/
mapSeries
:
function
(
cb
,
context
)
{
var
componentsMap
=
this
.
_componentsMap
;
componentsMap
.
series
=
zrUtil
.
map
(
componentsMap
.
series
,
cb
,
context
);
},
restoreData
:
function
()
{
var
componentsMap
=
this
.
_componentsMap
;
var
componentTypes
=
[];
...
...
src/util/number.js
浏览文件 @
bf2f13f5
...
...
@@ -9,8 +9,7 @@ define(function (require) {
var
number
=
{};
function
_trim
(
str
)
{
return
str
.
replace
(
/^
\s
+/
,
''
).
replace
(
/
\s
+$/
,
''
);
}
return
str
.
replace
(
/^
\s
+/
,
''
).
replace
(
/
\s
+$/
,
''
);
}
/**
* Linear mapping a value from domain to range
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录