Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
fc311a09
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,发现更多精彩内容 >>
提交
fc311a09
编写于
4月 01, 2021
作者:
1
100pah
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: geoJSON focus-blur
上级
8235095d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
94 addition
and
3 deletion
+94
-3
src/component/helper/MapDraw.ts
src/component/helper/MapDraw.ts
+10
-2
test/geo-svg.html
test/geo-svg.html
+84
-1
未找到文件。
src/component/helper/MapDraw.ts
浏览文件 @
fc311a09
...
@@ -399,6 +399,13 @@ class MapDraw {
...
@@ -399,6 +399,13 @@ class MapDraw {
},
this
);
},
this
);
this
.
_enableBlurEntireSVG
(
focusSelf
,
viewBuildCtx
);
}
private
_enableBlurEntireSVG
(
focusSelf
:
boolean
,
viewBuildCtx
:
ViewBuildContext
):
void
{
// It's a little complicated to support blurring the entire geoSVG in series-map.
// It's a little complicated to support blurring the entire geoSVG in series-map.
// So do not suport it until some requirements come.
// So do not suport it until some requirements come.
// At present, in series-map, only regions can be blurred.
// At present, in series-map, only regions can be blurred.
...
@@ -417,8 +424,7 @@ class MapDraw {
...
@@ -417,8 +424,7 @@ class MapDraw {
if
(
style
.
opacity
==
null
&&
opacity
!=
null
)
{
if
(
style
.
opacity
==
null
&&
opacity
!=
null
)
{
style
.
opacity
=
opacity
;
style
.
opacity
=
opacity
;
}
}
// If opacity not set, but `ensureState('blur').style` set, there will
// If `ensureState('blur').style = {}`, there will be default opacity.
// be default opacity.
// Enable `stateTransition` (animation).
// Enable `stateTransition` (animation).
(
el
as
Displayable
).
ensureState
(
'
emphasis
'
);
(
el
as
Displayable
).
ensureState
(
'
emphasis
'
);
...
@@ -638,6 +644,8 @@ function applyOptionStyleForRegion(
...
@@ -638,6 +644,8 @@ function applyOptionStyleForRegion(
el
.
ensureState
(
'
emphasis
'
).
style
=
emphasisStyle
;
el
.
ensureState
(
'
emphasis
'
).
style
=
emphasisStyle
;
el
.
ensureState
(
'
select
'
).
style
=
selectStyle
;
el
.
ensureState
(
'
select
'
).
style
=
selectStyle
;
el
.
ensureState
(
'
blur
'
).
style
=
blurStyle
;
el
.
ensureState
(
'
blur
'
).
style
=
blurStyle
;
// Enable blur
setDefaultStateProxy
(
el
);
}
}
function
resetLabelForRegion
(
function
resetLabelForRegion
(
...
...
test/geo-svg.html
浏览文件 @
fc311a09
...
@@ -39,6 +39,7 @@ under the License.
...
@@ -39,6 +39,7 @@ under the License.
<div
id=
"main_simple_geo_json"
></div>
<div
id=
"main_simple_geo_json"
></div>
<div
id=
"main_simple_geo_svg"
></div>
<div
id=
"main_simple_geo_svg"
></div>
<div
id=
"main_geo_json_focus_blur"
></div>
<div
id=
"main_geo_svg_emphasis_select"
></div>
<div
id=
"main_geo_svg_emphasis_select"
></div>
<div
id=
"main_pure_geo_svg"
></div>
<div
id=
"main_pure_geo_svg"
></div>
<div
id=
"main_pure_map_svg"
></div>
<div
id=
"main_pure_map_svg"
></div>
...
@@ -199,6 +200,86 @@ under the License.
...
@@ -199,6 +200,86 @@ 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
'
}
},
{
'
type
'
:
'
Feature
'
,
'
geometry
'
:
{
'
type
'
:
'
Polygon
'
,
'
coordinates
'
:
[
[[
6000
,
2300
],
[
9300
,
2300
],
[
9000
,
5000
]]
]
},
'
properties
'
:
{
'
name
'
:
'
BBB
'
}
}
]
};
echarts
.
registerMap
(
'
testGeoJson2
'
,
testGeoJson1
);
option
=
{
tooltip
:
{
},
geo
:
{
map
:
'
testGeoJson2
'
,
roam
:
true
,
selectedMode
:
'
single
'
,
label
:
{
show
:
true
},
emphasis
:
{
focus
:
'
self
'
},
// height: '100%',
// center
// layoutCenter: ['30%', 40],
// layoutSize: 40,
// boundingCoords
zoom
:
1
,
aspectScale
:
1
}
};
var
chart
=
testHelper
.
create
(
echarts
,
'
main_geo_json_focus_blur
'
,
{
title
:
[
'
check geoJSON focus-blur
'
,
],
option
:
option
,
info
:
{},
infoKey
:
'
event
'
,
height
:
200
});
listenAndPrintEvent
(
chart
);
});
</script>
<script>
<script>
require
([
'
echarts
'
/*, 'map/js/china' */
],
function
(
echarts
)
{
require
([
'
echarts
'
/*, 'map/js/china' */
],
function
(
echarts
)
{
const
svg
=
[
const
svg
=
[
...
@@ -243,6 +324,7 @@ under the License.
...
@@ -243,6 +324,7 @@ under the License.
show
:
true
show
:
true
},
},
emphasis
:
{
emphasis
:
{
focus
:
'
self
'
,
label
:
{
label
:
{
show
:
true
,
show
:
true
,
fontSize
:
100
fontSize
:
100
...
@@ -259,7 +341,8 @@ under the License.
...
@@ -259,7 +341,8 @@ under the License.
var
chart
=
testHelper
.
create
(
echarts
,
'
main_geo_svg_emphasis_select
'
,
{
var
chart
=
testHelper
.
create
(
echarts
,
'
main_geo_svg_emphasis_select
'
,
{
title
:
[
title
:
[
'
click buttons
'
,
'
click buttons
'
,
'
hover check
'
'
hover check
'
,
'
check focus-blur
'
],
],
option
:
option
,
option
:
option
,
info
:
{},
info
:
{},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录