Risheit commented on code in PR #36323:
URL: https://github.com/apache/superset/pull/36323#discussion_r2585856165
##########
superset-frontend/plugins/legacy-plugin-chart-country-map/src/CountryMap.js:
##########
@@ -176,17 +141,34 @@ function CountryMap(element, props) {
c = d3.rgb(c).darker().toString();
}
d3.select(this).style('fill', c);
- selectAndDisplayNameOfRegion(d);
+ // Display information popup
const result = data.filter(
region => region.country_id === d.properties.ISO,
);
- updateMetrics(result);
+
+ const position = d3.mouse(svg.node());
+ hoverPopup
+ .style('display', 'block')
+ .style('top', `${position[1] + 30}px`)
+ .style('left', `${position[0]}px`)
+ .html(
+ `<div>
+ <strong>${getNameOfRegion(d)}</strong><br>
+ ${result.length > 0 ? format(result[0].metric) : ''}
Review Comment:
The current implementation follows the hover tooltip format follows the
tooltip HTML defined in `legacy-plugin-chart-world-map`, which also leaves a
`<br>` character even when no data is present.
Since, visually, the tooltip looks alright when displayed with no data (no
extra whitespace) I don't think there's a reason to change the HTML definition.
<img width="263" height="234" alt="Screenshot 2025-12-03 at 11 23 18 AM"
src="https://github.com/user-attachments/assets/ce7a0b98-a40c-4231-9ff6-f577acfc3db0"
/>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]