Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
8fd14f1e
Commit
8fd14f1e
authored
5 years ago
by
Tiago Varela
Committed by
Tom Robinson
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use feature name on hover (#10065)
parent
66e93821
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/metabase/visualizations/components/ChoroplethMap.jsx
+6
-5
6 additions, 5 deletions
.../src/metabase/visualizations/components/ChoroplethMap.jsx
with
6 additions
and
5 deletions
frontend/src/metabase/visualizations/components/ChoroplethMap.jsx
+
6
−
5
View file @
8fd14f1e
...
...
@@ -162,7 +162,7 @@ export default class ChoroplethMap extends Component {
projection
=
null
;
}
//
const nameProperty = details.region_name;
const
nameProperty
=
details
.
region_name
;
const
keyProperty
=
details
.
region_key
;
if
(
!
geoJson
)
{
...
...
@@ -191,7 +191,7 @@ export default class ChoroplethMap extends Component {
getCanonicalRowKey
(
row
[
dimensionIndex
],
settings
[
"
map.region
"
]);
const
getRowValue
=
row
=>
row
[
metricIndex
]
||
0
;
//
const getFeatureName = feature => String(feature.properties[nameProperty]);
const
getFeatureName
=
feature
=>
String
(
feature
.
properties
[
nameProperty
]);
const
getFeatureKey
=
feature
=>
String
(
feature
.
properties
[
keyProperty
]).
toLowerCase
();
...
...
@@ -202,12 +202,13 @@ export default class ChoroplethMap extends Component {
const
rowByFeatureKey
=
new
Map
(
rows
.
map
(
row
=>
[
getRowKey
(
row
),
row
]));
const
getFeatureClickObject
=
row
=>
({
const
getFeatureClickObject
=
(
row
,
feature
)
=>
({
value
:
row
[
metricIndex
],
column
:
cols
[
metricIndex
],
dimensions
:
[
{
value
:
row
[
dimensionIndex
],
value
:
feature
!=
null
?
getFeatureName
(
feature
)
:
row
[
dimensionIndex
],
column
:
cols
[
dimensionIndex
],
},
],
...
...
@@ -234,7 +235,7 @@ export default class ChoroplethMap extends Component {
const
row
=
hover
&&
rowByFeatureKey
.
get
(
getFeatureKey
(
hover
.
feature
));
if
(
row
&&
onHoverChange
)
{
onHoverChange
({
...
getFeatureClickObject
(
row
),
...
getFeatureClickObject
(
row
,
hover
.
feature
),
event
:
hover
.
event
,
});
}
else
if
(
onHoverChange
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment