New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: geo component and map series support SVG format source #14571
Conversation
(1) refactor of geoJSON & SVG source loader and management. (2) remove the support of "load multiple geoJSON or SVG in one map name". This feature is never documented and published. And this feature have a inherent problem that it's not easy to normalize the unit among the different SVG. After this commit, one map name can only have one geoJSON or one SVG.
(1) label scale implementation change: user afterUpdate rather than / parentScale. (2) some refactor and clean code.
…as regions of geoJSON
(1) "geoselectchanged" event: add param: allSelected: { geoIndex: number, name: string[] }[] (2) geoSVG resource support: + label + emphasis/select/blur state + "geoselectchanged" event (on geo component) + "selectchanged" event (on map series) (3) some refactor to make those happen: + The original `Region` is migrated to `GeoJSONRegion`. And make `Region` as the base class of `GeoJSONRegion` and `GeoSVGRegion`. + Modify the constructor of `Geo`.
(1) fix contain point calculation. (2) remove Geo['_nameCoordMap'], instead, calculate center on demand. (3) fix that some API missing nameProperty and geoJSON should cached not only by mapName but also by nameProperty. (4) do not support nameMap in geoSVG until some real requirements come. (5) svg line polyline use 'region.lineStyle' rather than 'region.itemStyle' (6) svg text tspan image are enabled to trigger tooltip and user event (but not supported to change state and style yet).
(1) add missing test:visual (2) fix tooltip component default position: should apply `position` on option firstly.
… firstly for other series).
(1) Support component focus blur. The option `emphasis.focus` can be specified to enable this feature. `emphasis.focus` only supports the value `'self'`. The option `emphasis.focusScope` is not supported in component. That is, the focus scope can be only a single component itself. All of the elements in this component will be blurred. Added `Component['focusBlurEnabled']` to enable component blur. (2) Support component hover link when highlight with a given name. There probably be multiple elements share one region name while those region elements has no common ancestor. hover link enables them to be highlighted together. Implementation: if a component implements `Component['findHighDownDispatchers']`, dispatcher elements by a given name will be found and this feature is enabled. (3) Support component highlight/downplay be triggered by `dispatchAction`. Implementation: if a component implements `Component['findHighDownDispatchers']`, dispatcher elements by a given name will be found and this feature is enabled. (4) Some refactor.
(1) support name on <g>. (2) some refactor.
Thanks for your contribution! The pull request is marked to be |
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
[memento] Some historical discussion about:
At present, the implementation is "all use |
Brief Information
This pull request is in the type of:
Features:
Support use SVG as the map in both Geo component and series map.
Support tooltip on Geo component
Support label option on Geo component
Support to name some SVG tags to enable them to be configured in option
regions
.Then this config enabled:
These SVG tags are available to be named:
'rect'
,'circle'
,'line'
,'ellipse'
,'polygon'
,'polyline'
,'path'
,'text'
,'tspan'
,'g'
Once named:
That is, can be listened by
mouseover
/mouseout
dispatchAction({ type: 'highlight'/'downplay', ... });
hover
ordispatchAction
'rect'
,'circle'
,'line'
,'ellipse'
,'polygon'
,'polyline'
,'path'
support state style.text
/tspan
/image
can not apply state style.mouseover
/mouseout
dispatchAction({ type: 'showTip', ... });
emphasis.focus
set.<g>
can be named.<g name="xxx">
, all of the descendants will apply the region options styles if possible.<g>
.Support focus-blur on Geo component.
Once focus-blur feature enabled, the "blurScope" is this Geo component. That is, the entire SVG
Note: in series-map, we do not support "blur all of the SVG" yet. There is a little implementation trouble. So do not support it until some requirement come.
geoSVG named tag support select:
select
option.selectchanged
event (on series-map).allSelected: { geoIndex: number, name: string[] }[]
fix: [common focus-blur feature]
make API trigger emphasis blur correct (should leave blur firstly for other series).
fix: [common tooltip feature]
fix tooltip component default position: should apply
position
on option firstly.Some implementation details:
afterUpdate
hook rather than divide parentScale.Region
is migrated toGeoJSONRegion
. And makeRegion
as the base class ofGeoJSONRegion
andGeoSVGRegion
. Modify the constructor ofGeo
.emphasis.focus
can be specified to enable this feature.emphasis.focus
only supports the value'self'
. The optionemphasis.focusScope
is not supported in component. That is, the focus scope can be only a single component itself. All of the elements in this component will be blurred. AddedComponent['focusBlurEnabled']
to enable component blur.Component['findHighDownDispatchers']
, dispatcher elements by a given name will be found and this feature is enabled.dispatchAction
. Implementation: if a component implementsComponent['findHighDownDispatchers']
, dispatcher elements by a given name will be found and this feature is enabled.Others
nameMap
in geoSVG until some real requirements come.Test Case
test/geo-svg.html
test/geo-svg-demo.html