Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
半栈学徒
incubator-echarts
提交
d323a360
I
incubator-echarts
项目概览
半栈学徒
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
5
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 搜索 >>
提交
d323a360
编写于
11月 11, 2015
作者:
L
lang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Roam type
上级
b7491ff8
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
69 addition
and
31 deletion
+69
-31
src/chart/graph/GraphView.js
src/chart/graph/GraphView.js
+1
-2
src/component/helper/MapDraw.js
src/component/helper/MapDraw.js
+2
-0
src/component/helper/RoamController.js
src/component/helper/RoamController.js
+19
-8
src/coord/geo/Geo.js
src/coord/geo/Geo.js
+17
-3
src/coord/geo/Region.js
src/coord/geo/Region.js
+3
-3
src/coord/geo/geoCreator.js
src/coord/geo/geoCreator.js
+18
-3
src/echarts.js
src/echarts.js
+8
-11
src/layout/points.js
src/layout/points.js
+1
-1
未找到文件。
src/chart/graph/GraphView.js
浏览文件 @
d323a360
...
...
@@ -65,8 +65,7 @@ define(function (require) {
var
controller
=
this
.
_controller
;
controller
.
rect
=
coordSys
.
getViewRect
();
controller
.
disable
();
seriesModel
.
get
(
'
roam
'
)
&&
controller
.
enable
();
controller
.
enable
(
seriesModel
.
get
(
'
roam
'
));
controller
.
off
(
'
pan
'
)
...
...
src/component/helper/MapDraw.js
浏览文件 @
d323a360
...
...
@@ -224,6 +224,8 @@ define(function (require) {
_updateController
:
function
(
mapOrGeoModel
,
ecModel
,
api
)
{
var
geo
=
mapOrGeoModel
.
coordinateSystem
;
var
controller
=
this
.
_controller
;
// roamType is will be set default true if it is null
controller
.
enable
(
mapOrGeoModel
.
get
(
'
roam
'
)
||
false
);
// FIXME mainType, subType 作为 component 的属性?
var
mainType
=
mapOrGeoModel
.
type
.
split
(
'
.
'
)[
0
];
controller
.
off
(
'
pan
'
)
...
...
src/component/helper/RoamController.js
浏览文件 @
d323a360
...
...
@@ -118,21 +118,32 @@ define(function (require) {
Eventful
.
call
(
this
);
this
.
enable
=
function
()
{
zr
.
on
(
'
mousedown
'
,
mousedownHandler
);
zr
.
on
(
'
mousemove
'
,
mousemoveHandler
);
zr
.
on
(
'
mouseup
'
,
mouseupHandler
);
zr
.
on
(
'
mousewheel
'
,
mousewheelHandler
);
/**
* @param {boolean} [controlType=true] Specify the control type, which can be only 'pan' or 'zoom'
*/
this
.
enable
=
function
(
controlType
)
{
// Disable previous first
this
.
disable
();
if
(
controlType
==
null
)
{
controlType
=
true
;
}
if
(
controlType
&&
controlType
!==
'
zoom
'
)
{
zr
.
on
(
'
mousedown
'
,
mousedownHandler
);
zr
.
on
(
'
mousemove
'
,
mousemoveHandler
);
zr
.
on
(
'
mouseup
'
,
mouseupHandler
);
}
if
(
controlType
&&
controlType
!==
'
pan
'
)
{
zr
.
on
(
'
mousewheel
'
,
mousewheelHandler
);
}
};
this
.
disable
=
this
.
dispose
=
function
()
{
this
.
disable
=
function
()
{
zr
.
off
(
'
mousedown
'
,
mousedownHandler
);
zr
.
off
(
'
mousemove
'
,
mousemoveHandler
);
zr
.
off
(
'
mouseup
'
,
mouseupHandler
);
zr
.
off
(
'
mousewheel
'
,
mousewheelHandler
);
};
this
.
enable
();
this
.
dispose
=
this
.
disable
;
this
.
isDragging
=
function
()
{
return
this
.
_dragging
;
...
...
src/coord/geo/Geo.js
浏览文件 @
d323a360
define
(
function
(
require
)
{
var
vector
=
require
(
'
zrender/core/vector
'
);
var
parseGeoJson
=
require
(
'
./parseGeoJson
'
);
var
zrUtil
=
require
(
'
zrender/core/util
'
);
...
...
@@ -10,7 +8,6 @@ define(function (require) {
var
View
=
require
(
'
../View
'
);
var
v2Copy
=
vector
.
copy
;
// Geo fix functions
var
geoFixFuncs
=
[
...
...
@@ -60,6 +57,8 @@ define(function (require) {
var
regionsMap
=
{};
for
(
var
i
=
0
;
i
<
regions
.
length
;
i
++
)
{
regionsMap
[
regions
[
i
].
name
]
=
regions
[
i
];
// Add geoJson
this
.
addGeoCoord
(
regions
[
i
].
name
,
regions
[
i
].
center
);
}
this
.
_regionsMap
=
regionsMap
;
...
...
@@ -153,6 +152,21 @@ define(function (require) {
item
[
1
]
=
lat
;
return
this
.
dataToPoint
(
item
);
},
this
);
},
// Overwrite
/**
* @param {string|Array.<number>} data
* @return {Array.<number>}
*/
dataToPoint
:
function
(
data
)
{
if
(
typeof
data
===
'
string
'
)
{
// Map area name to geoCoord
data
=
this
.
getGeoCoord
(
data
);
}
if
(
data
)
{
return
View
.
prototype
.
dataToPoint
.
call
(
this
,
data
);
}
}
};
...
...
src/coord/geo/Region.js
浏览文件 @
d323a360
...
...
@@ -43,7 +43,7 @@ define(function (require) {
* @type {Array.<number>}
*/
this
.
center
=
cp
;
}
;
}
Region
.
prototype
=
{
...
...
@@ -74,9 +74,9 @@ define(function (require) {
min
[
0
]
=
min
[
1
]
=
max
[
0
]
=
max
[
1
]
=
0
;
}
return
this
.
_rect
=
new
BoundingRect
(
return
(
this
.
_rect
=
new
BoundingRect
(
min
[
0
],
min
[
1
],
max
[
0
]
-
min
[
0
],
max
[
1
]
-
min
[
1
]
);
)
)
;
},
/**
...
...
src/coord/geo/geoCreator.js
浏览文件 @
d323a360
...
...
@@ -4,7 +4,6 @@ define(function (require) {
var
Geo
=
require
(
'
./Geo
'
);
var
numberUtil
=
require
(
'
../../util/number
'
);
var
layout
=
require
(
'
../../util/layout
'
);
var
zrUtil
=
require
(
'
zrender/core/util
'
);
...
...
@@ -15,7 +14,7 @@ define(function (require) {
* @param {module:echarts/coord/geo/GeoModel|module:echarts/chart/map/MapModel} geoModel
* @param {module:echarts/ExtensionAPI} api
*/
var
resizeGeo
=
function
(
geoModel
,
api
)
{
function
resizeGeo
(
geoModel
,
api
)
{
var
locModel
=
geoModel
;
if
(
geoModel
.
type
===
'
series.map
'
)
{
locModel
=
geoModel
.
getModel
(
'
mapLocation
'
);
...
...
@@ -52,7 +51,18 @@ define(function (require) {
this
.
setPan
(
panX
,
panY
);
this
.
setZoom
(
zoom
);
};
}
/**
* @param {module:echarts/coord/Geo} geo
* @param {module:echarts/model/Model} model
* @inner
*/
function
setGeoCoords
(
geo
,
model
)
{
zrUtil
.
each
(
model
.
get
(
'
geoCoord
'
),
function
(
geoCoord
,
name
)
{
geo
.
addGeoCoord
(
name
,
geoCoord
);
});
}
var
geoCreator
=
{
...
...
@@ -69,7 +79,10 @@ define(function (require) {
var
geo
=
new
Geo
(
name
+
idx
,
name
,
geoJson
);
geoList
.
push
(
geo
);
setGeoCoords
(
geo
,
geoModel
);
geoModel
.
coordinateSystem
=
geo
;
geo
.
model
=
geoModel
;
// Inject resize method
geo
.
resize
=
resizeGeo
;
...
...
@@ -112,6 +125,8 @@ define(function (require) {
zrUtil
.
each
(
mapSeries
,
function
(
singleMapSeries
)
{
singleMapSeries
.
coordinateSystem
=
geo
;
setGeoCoords
(
geo
,
singleMapSeries
);
});
});
...
...
src/echarts.js
浏览文件 @
d323a360
/**
* TODO setTheme
* axis position 统一处理
* 规范 Symbol 配置和绘制, customPath
*
* 每次 update 只刷新 model 变化的那些 component(需要做依赖收集)
* @module echarts
*/
define
(
function
(
require
)
{
...
...
@@ -34,7 +30,7 @@ define(function (require) {
/**
* @module echarts~ECharts
*/
var
ECharts
=
function
(
dom
,
theme
,
opts
)
{
function
ECharts
(
dom
,
theme
,
opts
)
{
opts
=
opts
||
{};
/**
...
...
@@ -100,9 +96,10 @@ define(function (require) {
this
.
_layouts
=
zrUtil
.
map
(
layoutClasses
,
function
(
Layout
)
{
return
new
Layout
();
});
}
;
}
var
echartsProto
=
ECharts
.
prototype
;
echartsProto
.
getDom
=
function
()
{
return
this
.
_dom
;
};
...
...
@@ -423,7 +420,7 @@ define(function (require) {
};
/**
* Layout before each chart render there series after visual coding and data processing
* Layout before each chart render there series
,
after visual coding and data processing
*
* @param {module:echarts/model/Global} ecModel
* @private
...
...
@@ -480,7 +477,7 @@ define(function (require) {
updateZ
(
seriesModel
,
chart
);
},
this
);
// Remove groups of charts
// Remove groups of
unrendered
charts
each
(
this
.
_chartsList
,
function
(
chart
)
{
if
(
!
chart
.
__keepAlive
)
{
chart
.
remove
(
ecModel
,
api
);
...
...
@@ -560,7 +557,7 @@ define(function (require) {
var
visualCodingFuncs
=
{};
/**
* @
module echart
s
* @
alia
s
*/
var
echarts
=
{};
...
...
@@ -659,7 +656,7 @@ define(function (require) {
};
/**
* @param
* @param
{echarts/scale/*} scale
*/
echarts
.
registerScale
=
function
(
scale
)
{
scaleClasses
.
register
(
scale
);
...
...
src/layout/points.js
浏览文件 @
d323a360
...
...
@@ -19,5 +19,5 @@ define(function (require) {
data
.
setItemLayout
(
idx
,
point
);
},
true
);
});
}
}
;
});
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录