Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
31c7787d
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,体验更适合开发者的 AI 搜索 >>
提交
31c7787d
编写于
4月 06, 2021
作者:
1
100pah
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: [geo svg] make test case better.
上级
43e99ef7
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
3364 addition
and
137 deletion
+3364
-137
test/data/svg/flight-seats.svg
test/data/svg/flight-seats.svg
+2997
-0
test/geo-layout.html
test/geo-layout.html
+346
-0
test/geo-svg-demo.html
test/geo-svg-demo.html
+11
-8
test/geo-svg.html
test/geo-svg.html
+10
-129
未找到文件。
test/data/svg/flight-seats.svg
0 → 100644
浏览文件 @
31c7787d
此差异已折叠。
点击以展开。
test/geo-layout.html
0 → 100644
浏览文件 @
31c7787d
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
<script
src=
"lib/esl.js"
></script>
<script
src=
"lib/config.js"
></script>
<script
src=
"lib/jquery.min.js"
></script>
<script
src=
"lib/facePrint.js"
></script>
<script
src=
"lib/testHelper.js"
></script>
<!-- <script src="ut/lib/canteen.js"></script> -->
<link
rel=
"stylesheet"
href=
"lib/reset.css"
/>
</head>
<body>
<style>
.test-chart-block
{
background-color
:
#777
;
}
</style>
<div
id=
"main_simple_geo_json_default_layout"
></div>
<div
id=
"main_simple_geo_svg_default_layout"
></div>
<div
id=
"main_simple_geo_json_layoutCenter_layoutSize_layout"
></div>
<div
id=
"main_simple_geo_svg_layoutCenter_layoutSize_layout"
></div>
<div
id=
"main_simple_geo_json_ltrb_layout"
></div>
<div
id=
"main_simple_geo_svg_ltrb_layout"
></div>
<script>
var
_echarts
;
require
([
'
echarts
'
],
function
(
echarts
)
{
_ecahrts
=
echarts
;
const
testGeoJSON1
=
{
'
type
'
:
'
FeatureCollection
'
,
'
features
'
:
[
{
'
type
'
:
'
Feature
'
,
'
geometry
'
:
{
'
type
'
:
'
Polygon
'
,
'
coordinates
'
:
[
[[
2000
,
2000
],
[
5000
,
2000
],
[
5000
,
5000
],
[
2000
,
5000
]]
]
},
'
properties
'
:
{
'
name
'
:
'
Afghanistan
'
,
'
childNum
'
:
1
}
}
]
};
echarts
.
registerMap
(
'
testGeoJSON1
'
,
testGeoJSON1
);
const
svg
=
[
'
<?xml version="1.0" encoding="utf-8"?>
'
,
'
<svg xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100" version="1.2" fill-rule="evenodd" xml:space="preserve">
'
,
'
<path d="M 0,0 L 0,100 100,100 100,0 Z" fill="none" stroke="rgb(56,93,138)" stroke-width="2" stroke-linecap="square" stroke-linejoin="miter"/>
'
,
'
</svg>
'
].
join
(
''
)
echarts
.
registerMap
(
'
testGeoSVG1
'
,
{
svg
:
svg
});
runAllCases
();
});
var
_cases
=
[];
function
_case
(
theCase
)
{
_cases
.
push
(
theCase
);
if
(
_echarts
)
{
runAllCases
();
}
}
function
runAllCases
()
{
for
(
var
i
=
0
;
i
<
_cases
.
length
;
i
++
)
{
_cases
[
i
](
_ecahrts
);
}
_cases
.
length
=
0
;
}
</script>
<script>
_case
(
function
(
echarts
)
{
option
=
{
backgroundColor
:
'
#fff
'
,
tooltip
:
{
},
geo
:
{
map
:
'
testGeoJSON1
'
,
roam
:
true
,
selectedMode
:
'
single
'
,
// height: '100%',
// center
// layoutCenter: ['30%', 40],
// layoutSize: 40,
// boundingCoords
zoom
:
1
,
aspectScale
:
1
}
};
var
chart
=
testHelper
.
create
(
echarts
,
'
main_simple_geo_json_default_layout
'
,
{
title
:
[
'
geoJSON default layout:
'
,
'
Should be a square.
'
,
'
80% of canvas height.
'
,
'
At the center of the canvas.
'
],
option
:
option
,
height
:
200
});
});
</script>
<script>
_case
(
function
(
echarts
)
{
option
=
{
backgroundColor
:
'
#fff
'
,
tooltip
:
{
},
geo
:
{
map
:
'
testGeoSVG1
'
,
roam
:
true
,
selectedMode
:
'
single
'
,
// height: '100%',
// center
// layoutCenter: ['30%', 40],
// layoutSize: 40,
// boundingCoords
// zoom: 1,
// aspectScale: 1
}
};
var
chart
=
testHelper
.
create
(
echarts
,
'
main_simple_geo_svg_default_layout
'
,
{
title
:
[
'
geoSVG default layout:
'
,
'
Should be a square.
'
,
'
80% of canvas height.
'
,
'
At the center of the canvas.
'
],
option
:
option
,
height
:
200
});
});
</script>
<script>
_case
(
function
(
echarts
)
{
option
=
{
backgroundColor
:
'
#fff
'
,
tooltip
:
{
},
geo
:
{
map
:
'
testGeoJSON1
'
,
roam
:
true
,
selectedMode
:
'
single
'
,
layoutCenter
:
[
'
50%
'
,
40
],
layoutSize
:
80
,
zoom
:
1
,
aspectScale
:
1
}
};
var
chart
=
testHelper
.
create
(
echarts
,
'
main_simple_geo_json_layoutCenter_layoutSize_layout
'
,
{
title
:
[
'
geoJSON layoutCenter/layoutSize layout:
'
,
'
Should be a square.
'
,
'
100% of canvas height.
'
,
'
At the center of the canvas.
'
],
option
:
option
,
height
:
80
});
});
</script>
<script>
_case
(
function
(
echarts
)
{
option
=
{
backgroundColor
:
'
#fff
'
,
tooltip
:
{
},
geo
:
{
map
:
'
testGeoSVG1
'
,
roam
:
true
,
selectedMode
:
'
single
'
,
layoutCenter
:
[
'
50%
'
,
40
],
layoutSize
:
80
,
zoom
:
1
,
aspectScale
:
1
}
};
var
chart
=
testHelper
.
create
(
echarts
,
'
main_simple_geo_svg_layoutCenter_layoutSize_layout
'
,
{
title
:
[
'
geoJSON layoutCenter/layoutSize layout:
'
,
'
Should be a square.
'
,
'
100% of canvas height.
'
,
'
At the center of the canvas.
'
],
option
:
option
,
height
:
80
});
});
</script>
<script>
_case
(
function
(
echarts
)
{
option
=
{
backgroundColor
:
'
#fff
'
,
tooltip
:
{
},
geo
:
{
map
:
'
testGeoJSON1
'
,
roam
:
true
,
selectedMode
:
'
single
'
,
left
:
10
,
right
:
10
,
top
:
10
,
bottom
:
10
,
width
:
null
,
height
:
null
,
zoom
:
1
,
aspectScale
:
1
}
};
var
chart
=
testHelper
.
create
(
echarts
,
'
main_simple_geo_json_ltrb_layout
'
,
{
title
:
[
'
geoJSON top/right/bottom/left layout:
'
,
'
Should be a rect. Canvas width 400.
'
,
'
left/right/top/bottom all are **10**
'
],
option
:
option
,
width
:
400
,
height
:
80
});
});
</script>
<script>
_case
(
function
(
echarts
)
{
option
=
{
backgroundColor
:
'
#fff
'
,
tooltip
:
{
},
geo
:
{
map
:
'
testGeoSVG1
'
,
roam
:
true
,
selectedMode
:
'
single
'
,
left
:
10
,
right
:
10
,
top
:
10
,
bottom
:
10
,
width
:
null
,
height
:
null
,
zoom
:
1
,
aspectScale
:
1
}
};
var
chart
=
testHelper
.
create
(
echarts
,
'
main_simple_geo_svg_ltrb_layout
'
,
{
title
:
[
'
geoJSON top/right/bottom/left layout:
'
,
'
Should be a rect. Canvas width 400.
'
,
'
left/right/top/bottom all are **10**
'
],
option
:
option
,
width
:
400
,
height
:
80
});
});
</script>
</body>
</html>
test/geo-svg-demo.html
浏览文件 @
31c7787d
...
...
@@ -37,11 +37,11 @@ under the License.
<div
id=
"main_geo_svg_organ"
></div>
<
!-- <
div id="main_geo_svg_organ"></div>
<div id="main_geo_svg_regions"></div>
<div id="main_geo_svg_line_path"></div>
<div id="main_geo_svg_heatmap"></div>
<div
id=
"main_geo_svg_building"
></div>
<div id="main_geo_svg_building"></div>
-->
<div
id=
"main_geo_svg_traffic"
></div>
...
...
@@ -618,7 +618,6 @@ under the License.
series
:
[{
name
:
'
Route
'
,
type
:
'
lines
'
,
map
:
'
MacOdrum-LV5-floorplan-web
'
,
coordinateSystem
:
'
geo
'
,
geoIndex
:
0
,
emphasis
:
{
...
...
@@ -629,8 +628,10 @@ under the License.
polyline
:
true
,
lineStyle
:
{
color
:
'
#c46e54
'
,
width
:
2
width
:
5
,
opacity
:
1
},
zlevel
:
1
,
effect
:
{
show
:
true
,
period
:
8
,
...
...
@@ -732,7 +733,6 @@ under the License.
series
:
[{
name
:
'
Route
'
,
type
:
'
lines
'
,
map
:
'
MacOdrum-LV5-floorplan-web
'
,
coordinateSystem
:
'
geo
'
,
geoIndex
:
0
,
emphasis
:
{
...
...
@@ -758,7 +758,8 @@ under the License.
data
:
[{
effect
:
{
color
:
'
#a10000
'
,
constantSpeed
:
100
constantSpeed
:
100
,
delay
:
0
,
},
coords
:
[
[
50.875133928571415
,
242.66287667410717
],
...
...
@@ -804,7 +805,8 @@ under the License.
},
{
effect
:
{
color
:
'
#00067d
'
,
constantSpeed
:
80
constantSpeed
:
80
,
delay
:
0
,
},
coords
:
[
[
779.4595368303574
,
287.98744419642856
],
...
...
@@ -840,7 +842,8 @@ under the License.
},
{
effect
:
{
color
:
'
#997405
'
,
constantSpeed
:
60
constantSpeed
:
60
,
delay
:
0
,
},
coords
:
[
[
2.5920703124999704
,
450.66908482142856
],
...
...
test/geo-svg.html
浏览文件 @
31c7787d
...
...
@@ -37,8 +37,6 @@ under the License.
<div
id=
"main_simple_geo_json"
></div>
<div
id=
"main_simple_geo_svg"
></div>
<div
id=
"main_simple_geo_svg_coord"
></div>
<div
id=
"main_simple_geo_svg_viewBox_svgWH"
></div>
<div
id=
"main_geo_json_focus_blur"
></div>
...
...
@@ -89,117 +87,6 @@ under the License.
<script>
require
([
'
echarts
'
/*, 'map/js/china' */
],
function
(
echarts
)
{
const
testGeoJson1
=
{
'
type
'
:
'
FeatureCollection
'
,
'
features
'
:
[
{
'
type
'
:
'
Feature
'
,
'
geometry
'
:
{
'
type
'
:
'
Polygon
'
,
'
coordinates
'
:
[
[[
2000
,
2000
],
[
5000
,
2000
],
[
5000
,
5000
],
[
2000
,
5000
]]
]
},
'
properties
'
:
{
'
name
'
:
'
Afghanistan
'
,
'
childNum
'
:
1
}
}
]
};
echarts
.
registerMap
(
'
testGeoJson1
'
,
testGeoJson1
);
option
=
{
tooltip
:
{
},
geo
:
{
map
:
'
testGeoJson1
'
,
roam
:
true
,
selectedMode
:
'
single
'
,
// height: '100%',
// center
// layoutCenter: ['30%', 40],
// layoutSize: 40,
// boundingCoords
zoom
:
1
,
aspectScale
:
1
}
};
var
chart
=
testHelper
.
create
(
echarts
,
'
main_simple_geo_json
'
,
{
title
:
[
'
simple geo geoJSON location:
'
,
'
Should be a square and 80% of canvas height.
'
,
'
At the center of the canvas.
'
],
option
:
option
,
info
:
{},
infoKey
:
'
event
'
,
height
:
200
});
listenAndPrintEvent
(
chart
);
});
</script>
<script>
require
([
'
echarts
'
/*, 'map/js/china' */
],
function
(
echarts
)
{
const
svg
=
[
'
<?xml version="1.0" encoding="utf-8"?>
'
,
'
<svg xmlns="http://www.w3.org/2000/svg" xmlns:ooo="http://xml.openoffice.org/svg/export" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100" version="1.2" fill-rule="evenodd" xml:space="preserve">
'
,
'
<path d="M 0,0 L 0,100 100,100 100,0 Z" fill="none" stroke="rgb(56,93,138)" stroke-width="2" stroke-linecap="square" stroke-linejoin="miter"/>
'
,
'
</svg>
'
].
join
(
''
)
echarts
.
registerMap
(
'
testGeoSVG
'
,
{
svg
:
svg
});
option
=
{
tooltip
:
{
},
geo
:
{
map
:
'
testGeoSVG
'
,
roam
:
true
,
selectedMode
:
'
single
'
,
// height: '100%',
// center
// layoutCenter: ['30%', 40],
// layoutSize: 40,
// boundingCoords
// zoom: 1,
// aspectScale: 1
}
};
var
chart
=
testHelper
.
create
(
echarts
,
'
main_simple_geo_svg
'
,
{
title
:
[
'
Should be a square and 80% of canvas height.
'
,
'
At the center of the canvas.
'
],
option
:
option
,
info
:
{},
infoKey
:
'
event
'
,
height
:
200
});
listenAndPrintEvent
(
chart
);
});
</script>
...
...
@@ -641,11 +528,11 @@ under the License.
require
([
'
echarts
'
/*, 'map/js/china' */
],
function
(
echarts
)
{
var
option
;
$
.
ajax
({
url
:
'
../../vis-data/map/svg/seats/seatmap-example
.svg
'
,
url
:
'
data/svg/flight-seats
.svg
'
,
dataType
:
'
text
'
}).
done
(
function
(
svg
)
{
echarts
.
registerMap
(
'
seatmap
'
,
{
echarts
.
registerMap
(
'
flight-seats
'
,
{
svg
:
svg
});
...
...
@@ -653,15 +540,18 @@ under the License.
tooltip
:
{
},
geo
:
{
map
:
'
seatmap
'
,
map
:
'
flight-seats
'
,
roam
:
true
,
selectedMode
:
'
multiple
'
,
tooltip
:
{
show
:
true
},
// height: 100,
// zoom: 1.5
emphasis
:
{
itemStyle
:
{
color
:
null
,
borderColor
:
'
#780705
'
,
borderWidth
:
3
},
label
:
{
textBorderColor
:
'
#fff
'
,
textBorderWidth
:
2
...
...
@@ -677,14 +567,7 @@ under the License.
textBorderWidth
:
2
}
}
},
// series: {
// type: 'scatter',
// coordinateSystem: 'geo',
// // ?????????????????????????
// geoIndex: 0,
// data: [[11, 22], [33, 44]]
// }
}
};
var
chart
=
testHelper
.
create
(
echarts
,
'
main_pure_geo_svg
'
,
{
...
...
@@ -697,8 +580,6 @@ under the License.
info
:
{},
infoKey
:
'
event
'
,
height
:
300
// buttons: [{text: 'btn-txt', onclick: function () {}}],
// recordCanvas: true,
});
listenAndPrintEvent
(
chart
);
...
...
@@ -717,7 +598,7 @@ under the License.
require
([
'
echarts
'
/*, 'map/js/china' */
],
function
(
echarts
)
{
var
option
;
$
.
ajax
({
url
:
'
../../vis-data/map/svg/seats
/seatmap-example.svg
'
,
url
:
'
data/svg
/seatmap-example.svg
'
,
dataType
:
'
text
'
}).
done
(
function
(
svg
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录