Skip to content

Commit d52cfba

Browse files
committed
scale min path length for contour labels to width + height
using just width had some adverse effects with really short labels
1 parent ca1cced commit d52cfba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/traces/contour/plot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ function makeLinesAndLabels(plotgroup, pathinfo, gd, cd0, contours, perimeter) {
423423

424424
var isOpen = d3.select(this).classed('openline');
425425

426-
if(pathLen < textWidth * constants.LABELMIN) return;
426+
if(pathLen < (textWidth + textHeight) * constants.LABELMIN) return;
427427

428428
var maxLabels = Math.min(Math.ceil(pathLen / normLength),
429429
constants.LABELMAX);

0 commit comments

Comments
 (0)