@cfasim-ui/docs 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/charts/ChoroplethMap/ChoroplethMap.vue +14 -2
- package/index.json +1 -1
- package/package.json +1 -1
|
@@ -555,11 +555,20 @@ function setupZoom() {
|
|
|
555
555
|
const svg = select(svgRef.value);
|
|
556
556
|
zoomBehavior = d3Zoom<SVGSVGElement, unknown>()
|
|
557
557
|
.scaleExtent([1, maxScale.value])
|
|
558
|
+
// d3-zoom swallows the click after any mousedown→mouseup movement
|
|
559
|
+
// beyond this distance. The default of 0 makes clicks unreliable the
|
|
560
|
+
// moment drag-pan is live (a pixel of hand jitter reads as a drag),
|
|
561
|
+
// so allow a few pixels of slack.
|
|
562
|
+
.clickDistance(6)
|
|
558
563
|
.on("start", () => {
|
|
559
564
|
isZooming = true;
|
|
560
|
-
clearHover();
|
|
561
565
|
})
|
|
562
566
|
.on("zoom", (event) => {
|
|
567
|
+
// Cleared here, not on gesture start: a plain mousedown opens a
|
|
568
|
+
// gesture once drag-pan is live, and hiding the tooltip on every
|
|
569
|
+
// click press felt broken. The tooltip only needs to go once the
|
|
570
|
+
// map actually moves under the cursor.
|
|
571
|
+
clearHover();
|
|
563
572
|
if (mapGroupRef.value) {
|
|
564
573
|
mapGroupRef.value.setAttribute("transform", event.transform);
|
|
565
574
|
}
|
|
@@ -1690,7 +1699,10 @@ function emitSelection(data: TooltipPayload) {
|
|
|
1690
1699
|
}
|
|
1691
1700
|
|
|
1692
1701
|
function onDelegatedEvent(event: Event) {
|
|
1693
|
-
|
|
1702
|
+
// Only hover is suppressed mid-gesture (stroke churn while the map
|
|
1703
|
+
// moves); clicks stay live — even during zoom animations — since d3
|
|
1704
|
+
// already swallows genuine post-drag clicks via clickDistance.
|
|
1705
|
+
if (event.type === "mouseover" && isZooming) return;
|
|
1694
1706
|
const me = event as MouseEvent;
|
|
1695
1707
|
const featId = eventToFeatureId(me.target);
|
|
1696
1708
|
if (!featId) return;
|
package/index.json
CHANGED