Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
36dcf1f6
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 搜索 >>
提交
36dcf1f6
编写于
4月 07, 2021
作者:
1
100pah
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: [geo svg] add test case.
上级
76625ba8
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
136 addition
and
2 deletion
+136
-2
test/geo-svg.html
test/geo-svg.html
+134
-0
test/runTest/actions/__meta__.json
test/runTest/actions/__meta__.json
+1
-1
test/runTest/actions/geo-svg.json
test/runTest/actions/geo-svg.json
+1
-1
未找到文件。
test/geo-svg.html
浏览文件 @
36dcf1f6
...
...
@@ -44,6 +44,8 @@ under the License.
<div
id=
"main_pure_geo_svg"
></div>
<div
id=
"main_pure_map_svg"
></div>
<div
id=
"main_map_geo_svg"
></div>
<div
id=
"main_geo_svg_click_finder"
></div>
<div
id=
"main_geo_svg_multiple_geo"
></div>
...
...
@@ -733,6 +735,138 @@ under the License.
<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" version="1.2" fill-rule="evenodd" xml:space="preserve">
'
,
'
<path name="a" d="M 0,0 L 0,100 100,100 100,0 Z" fill="green" stroke="rgb(56,93,138)" stroke-width="2" stroke-linecap="square" stroke-linejoin="miter"/>
'
,
'
<path name="b" d="M 150,0 L 150,100 250,100 250,0 Z" fill="blue" stroke="rgb(56,93,138)" stroke-width="2" stroke-linecap="square" stroke-linejoin="miter"/>
'
,
'
</svg>
'
].
join
(
''
)
echarts
.
registerMap
(
'
testGeoSVGclick
'
,
{
svg
:
svg
});
var
option
=
{
geo
:
{
map
:
'
testGeoSVGclick
'
,
selectedMode
:
'
single
'
,
zoom
:
1
,
aspectScale
:
1
,
label
:
{
show
:
true
}
}
};
var
chart
=
testHelper
.
create
(
echarts
,
'
main_geo_svg_click_finder
'
,
{
title
:
[
'
Click green rect, should display click event.
'
,
'
Click blue rect, should display nothing.
'
],
option
:
option
,
info
:
{},
infoKey
:
'
click event
'
,
height
:
200
});
if
(
chart
)
{
chart
.
on
(
'
click
'
,
{
geoIndex
:
0
,
name
:
'
a
'
},
function
(
params
)
{
console
.
log
(
params
);
chart
.
__testHelper
.
updateInfo
({
componentIndex
:
params
.
componentIndex
,
componentType
:
params
.
componentType
,
geoIndex
:
params
.
geoIndex
,
name
:
params
.
name
},
'
click event
'
);
});
}
});
</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" version="1.2" fill-rule="evenodd" xml:space="preserve">
'
,
'
<path name="a" d="M 0,0 L 0,100 100,100 100,0 Z" fill="green" stroke="rgb(56,93,138)" stroke-width="2" stroke-linecap="square" stroke-linejoin="miter"/>
'
,
'
</svg>
'
].
join
(
''
)
echarts
.
registerMap
(
'
testGeoSVG_for_multiple_test
'
,
{
svg
:
svg
});
var
option
=
{
geo
:
[{
id
:
'
g1
'
,
map
:
'
testGeoSVG_for_multiple_test
'
,
selectedMode
:
'
single
'
,
layoutCenter
:
[
'
25%
'
,
'
50%
'
],
layoutSize
:
20
,
select
:
{
itemStyle
:
{
color
:
'
red
'
}
}
},
{
id
:
'
g2
'
,
map
:
'
testGeoSVG_for_multiple_test
'
,
selectedMode
:
'
single
'
,
layoutCenter
:
[
'
50%
'
,
'
50%
'
],
layoutSize
:
20
,
select
:
{
itemStyle
:
{
color
:
'
red
'
}
},
},
{
id
:
'
g3
'
,
map
:
'
testGeoSVG_for_multiple_test
'
,
selectedMode
:
'
single
'
,
layoutCenter
:
[
'
75%
'
,
'
50%
'
],
layoutSize
:
20
,
select
:
{
itemStyle
:
{
color
:
'
red
'
}
},
}]
};
var
chart
=
testHelper
.
create
(
echarts
,
'
main_geo_svg_multiple_geo
'
,
{
title
:
[
'
Select the three rect to red.
'
,
'
click btn. Check all of the existing rect removed,
'
,
'
and only one new green rect generated.
'
],
option
:
option
,
height
:
200
,
buttons
:
[{
text
:
'
change geo (replaceMerge)
'
,
onclick
:
function
(
params
)
{
chart
.
setOption
({
geo
:
{
id
:
'
g4
'
,
map
:
'
testGeoSVG_for_multiple_test
'
,
selectedMode
:
'
single
'
,
layoutCenter
:
[
'
40%
'
,
'
50%
'
],
layoutSize
:
40
,
select
:
{
itemStyle
:
{
color
:
'
red
'
}
}
}
},
{
replaceMerge
:
'
geo
'
});
}
}]
});
});
</script>
</body>
</html>
...
...
test/runTest/actions/__meta__.json
浏览文件 @
36dcf1f6
...
...
@@ -78,7 +78,7 @@
"funnel"
:
2
,
"gauge-simple"
:
2
,
"geo-map"
:
3
,
"geo-svg"
:
6
,
"geo-svg"
:
8
,
"geo-svg-demo"
:
6
,
"geoScatter"
:
1
,
"getOption"
:
1
,
...
...
test/runTest/actions/geo-svg.json
浏览文件 @
36dcf1f6
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录