Skip to content

Commit 510cb60

Browse files
committed
doc: expand comment about placeholder calc point
1 parent 7498fe6 commit 510cb60

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: src/plots/plots.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1670,9 +1670,12 @@ plots.doCalcdata = function(gd, traces) {
16701670
}
16711671

16721672
// Make sure there is a first point.
1673+
//
16731674
// This ensures there is a calcdata item for every trace,
16741675
// even if cartesian logic doesn't handle it (for things like legends).
1675-
// Tag this artificial calc point with 'placeholder: true'
1676+
//
1677+
// Tag this artificial calc point with 'placeholder: true',
1678+
// to make it easier to skip over them in during the plot and hover step.
16761679
if(!Array.isArray(cd) || !cd[0]) {
16771680
cd = [{x: false, y: false, placeholder: true}];
16781681
}

Diff for: src/traces/scattergeo/hover.js

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ module.exports = function hoverPoints(pointData) {
4646
dy = Math.abs(yPx - pos[1]),
4747
rad = Math.max(3, d.mrc || 0);
4848

49+
// N.B. d.mrc is the calculated marker radius
50+
// which is only set for trace with 'markers' mode.
51+
4952
return Math.max(Math.sqrt(dx * dx + dy * dy) - rad, 1 - 3 / rad);
5053
}
5154

0 commit comments

Comments
 (0)