Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
7a3ba7d4
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,发现更多精彩内容 >>
提交
7a3ba7d4
编写于
11月 12, 2017
作者:
S
sushuang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Avoid inject.
上级
9e06beba
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
64 addition
and
88 deletion
+64
-88
extension-src/dataTool/index.js
extension-src/dataTool/index.js
+9
-5
src/config.js
src/config.js
+6
-6
src/coord/geo/geoCreator.js
src/coord/geo/geoCreator.js
+4
-50
src/echarts.js
src/echarts.js
+44
-27
src/export.js
src/export.js
+1
-0
未找到文件。
extension-src/dataTool/index.js
浏览文件 @
7a3ba7d4
...
...
@@ -8,8 +8,12 @@ export {gexf};
export
{
prepareBoxplotData
};
echarts
.
$inject
.
dataTool
({
version
:
version
,
gexf
:
gexf
,
prepareBoxplotData
:
prepareBoxplotData
});
// For backward compatibility, where the namespace `dataTool` will
// be mounted on `echarts` is the extension `dataTool` is imported.
// But the old version of echarts do not have `dataTool` namespace,
// so check it before mounting.
if
(
echarts
.
dataTool
)
{
echarts
.
dataTool
.
version
=
version
;
echarts
.
dataTool
.
gexf
=
gexf
;
echarts
.
dataTool
.
prepareBoxplotData
=
prepareBoxplotData
;
}
src/config.js
浏览文件 @
7a3ba7d4
...
...
@@ -4,19 +4,19 @@
// declaration is behind of the using position (for example in `Model.extent`,
// And tools like rollup can not analysis the dependency if not import).
var
__DEV__
;
var
dev
;
// In browser
if
(
typeof
window
!==
'
undefined
'
)
{
__DEV__
=
window
.
__DEV__
;
dev
=
window
.
__DEV__
;
}
// In node
else
if
(
typeof
global
!==
'
undefined
'
)
{
__DEV__
=
global
.
__DEV__
;
dev
=
global
.
__DEV__
;
}
if
(
typeof
__DEV__
===
'
undefined
'
)
{
__DEV__
=
true
;
if
(
typeof
dev
===
'
undefined
'
)
{
dev
=
true
;
}
export
{
__DEV__
}
;
export
var
__DEV__
=
dev
;
src/coord/geo/geoCreator.js
浏览文件 @
7a3ba7d4
...
...
@@ -4,16 +4,13 @@ import * as zrUtil from 'zrender/src/core/util';
import
Geo
from
'
./Geo
'
;
import
*
as
layout
from
'
../../util/layout
'
;
import
*
as
numberUtil
from
'
../../util/number
'
;
import
parseGeoJson
from
'
./parseGeoJson
'
;
var
mapDataStores
=
{};
/**
* Resize method bound to the geo
* @param {module:echarts/coord/geo/GeoModel|module:echarts/chart/map/MapModel} geoModel
* @param {module:echarts/ExtensionAPI} api
*/
function
resizeGeo
(
geoModel
,
api
)
{
function
resizeGeo
(
geoModel
,
api
)
{
var
boundingCoords
=
geoModel
.
get
(
'
boundingCoords
'
);
if
(
boundingCoords
!=
null
)
{
...
...
@@ -123,7 +120,7 @@ var geoCreator = {
// FIXME Create each time may be slow
ecModel
.
eachComponent
(
'
geo
'
,
function
(
geoModel
,
idx
)
{
var
name
=
geoModel
.
get
(
'
map
'
);
var
mapData
=
mapDataStores
[
name
]
;
var
mapData
=
echarts
.
getMap
(
name
)
;
if
(
__DEV__
)
{
if
(
!
mapData
)
{
mapNotExistsError
(
name
);
...
...
@@ -168,7 +165,7 @@ var geoCreator = {
});
zrUtil
.
each
(
mapModelGroupBySeries
,
function
(
mapSeries
,
mapType
)
{
var
mapData
=
mapDataStores
[
mapType
]
;
var
mapData
=
echarts
.
getMap
(
mapType
)
;
if
(
__DEV__
)
{
if
(
!
mapData
)
{
mapNotExistsError
(
mapSeries
[
0
].
get
(
'
map
'
));
...
...
@@ -203,44 +200,6 @@ var geoCreator = {
return
geoList
;
},
/**
* @param {string} mapName
* @param {Object|string} geoJson
* @param {Object} [specialAreas]
*
* @example
* $.get('USA.json', function (geoJson) {
* echarts.registerMap('USA', geoJson);
* // Or
* echarts.registerMap('USA', {
* geoJson: geoJson,
* specialAreas: {}
* })
* });
*/
registerMap
:
function
(
mapName
,
geoJson
,
specialAreas
)
{
if
(
geoJson
.
geoJson
&&
!
geoJson
.
features
)
{
specialAreas
=
geoJson
.
specialAreas
;
geoJson
=
geoJson
.
geoJson
;
}
if
(
typeof
geoJson
===
'
string
'
)
{
geoJson
=
(
typeof
JSON
!==
'
undefined
'
&&
JSON
.
parse
)
?
JSON
.
parse
(
geoJson
)
:
(
new
Function
(
'
return (
'
+
geoJson
+
'
);
'
))();
}
mapDataStores
[
mapName
]
=
{
geoJson
:
geoJson
,
specialAreas
:
specialAreas
};
},
/**
* @param {string} mapName
* @return {Object}
*/
getMap
:
function
(
mapName
)
{
return
mapDataStores
[
mapName
];
},
/**
* Fill given regions array
* @param {Array.<Object>} originRegionArr
...
...
@@ -283,11 +242,6 @@ var geoCreator = {
}
};
// Inject methods into echarts
echarts
.
$inject
.
registerMap
(
geoCreator
.
registerMap
);
echarts
.
$inject
.
getMap
(
geoCreator
.
getMap
);
echarts
.
$inject
.
parseGeoJSON
(
parseGeoJson
);
echarts
.
registerCoordinateSystem
(
'
geo
'
,
geoCreator
);
export
default
geoCreator
;
\ No newline at end of file
export
default
geoCreator
;
src/echarts.js
浏览文件 @
7a3ba7d4
...
...
@@ -1544,7 +1544,6 @@ var themeStorage = {};
*/
var
loadingEffects
=
{};
var
instances
=
{};
var
connectedGroups
=
{};
...
...
@@ -1552,6 +1551,8 @@ var idBase = new Date() - 0;
var
groupIdBase
=
new
Date
()
-
0
;
var
DOM_ATTRIBUTE_KEY
=
'
_echarts_instance_
'
;
var
mapDataStores
=
{};
function
enableConnect
(
chart
)
{
var
STATUS_PENDING
=
0
;
var
STATUS_UPDATING
=
1
;
...
...
@@ -1961,7 +1962,45 @@ export function extendChartView(opts/*, superClass*/) {
* });
*/
export
function
setCanvasCreator
(
creator
)
{
zrUtil
.
$inject
.
createCanvas
(
creator
);
zrUtil
.
$override
(
'
createCanvas
'
,
creator
);
}
/**
* @param {string} mapName
* @param {Object|string} geoJson
* @param {Object} [specialAreas]
*
* @example
* $.get('USA.json', function (geoJson) {
* echarts.registerMap('USA', geoJson);
* // Or
* echarts.registerMap('USA', {
* geoJson: geoJson,
* specialAreas: {}
* })
* });
*/
export
function
registerMap
(
mapName
,
geoJson
,
specialAreas
)
{
if
(
geoJson
.
geoJson
&&
!
geoJson
.
features
)
{
specialAreas
=
geoJson
.
specialAreas
;
geoJson
=
geoJson
.
geoJson
;
}
if
(
typeof
geoJson
===
'
string
'
)
{
geoJson
=
(
typeof
JSON
!==
'
undefined
'
&&
JSON
.
parse
)
?
JSON
.
parse
(
geoJson
)
:
(
new
Function
(
'
return (
'
+
geoJson
+
'
);
'
))();
}
mapDataStores
[
mapName
]
=
{
geoJson
:
geoJson
,
specialAreas
:
specialAreas
};
}
/**
* @param {string} mapName
* @return {Object}
*/
export
function
getMap
(
mapName
)
{
return
mapDataStores
[
mapName
];
}
registerVisual
(
PRIORITY_VISUAL_GLOBAL
,
seriesColor
);
...
...
@@ -1983,28 +2022,6 @@ registerAction({
},
zrUtil
.
noop
);
// --------
// Exports
// --------
export
var
registerMap
;
export
var
getMap
;
export
var
parseGeoJSON
;
export
var
dataTool
;
// FIXME
export
var
$inject
=
{
registerMap
:
function
(
f
)
{
registerMap
=
f
;
/* ESM2CJS_REPLACE exports.registerMap = f; */
},
getMap
:
function
(
f
)
{
getMap
=
f
;
/* ESM2CJS_REPLACE exports.getMap = f; */
},
parseGeoJSON
:
function
(
f
)
{
parseGeoJSON
=
f
;
/* ESM2CJS_REPLACE exports.parseGeoJSON = f; */
},
dataTool
:
function
(
f
)
{
dataTool
=
f
;
/* ESM2CJS_REPLACE exports.dataTool = f; */
}
};
// For backward compatibility, where the namespace `dataTool` will
// be mounted on `echarts` is the extension `dataTool` is imported.
export
var
dataTool
=
{};
src/export.js
浏览文件 @
7a3ba7d4
...
...
@@ -27,6 +27,7 @@ export {matrix};
export
{
vector
};
export
{
colorTool
as
color
};
export
{
default
as
env
}
from
'
zrender/src/core/env
'
;
export
{
default
as
parseGeoJson
}
from
'
./coord/geo/parseGeoJson
'
;
var
ecUtil
=
{};
zrUtil
.
each
([
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录