Plotly.js: Contour negative valued layer is not visible

Created on 6 Dec 2019  Â·  6Comments  Â·  Source: plotly/plotly.js

Negative numbers within the layer are not that visible, it looks like the symbol it is part of the line.

Adding extra padding should fix this visibility issue only for negative symbols.

contour-sample

bug

Most helpful comment

@alexcjohnson I do use the contours.labelformat with the value: .0f

All 6 comments

Thanks for pointing this out.

Maybe instead of some vertical adjustment, we could implement https://github.com/plotly/plotly.js/issues/1597 to make the minus sign more visible.

Adding extra padding should fix this visibility issue only for negative symbols.

Oh you mean some padding between the negative sign and the start of the contour line i.e. tweaking the label bounding box dimensions to "pad" the text of the contour labels. That's actually a great idea with or without https://github.com/plotly/plotly.js/issues/1597 and is probably much easier to implement. Calling this a bug.

Thanks for posting @poldz123 !

BTW whenever this gets addressed, looks like contour labels sometimes use the regular hyphen "-", not minus sign "−" like we do for all other negatives

https://github.com/plotly/plotly.js/blob/162afe491bccda9284e7c3b903a45bd9ac5cf836/src/constants/numerical.js#L62

Looking at https://rreusser.github.io/plotly-mock-viewer/#contour_edge_cases - perhaps when contours.labelformat is specified we don't fix this character, but we do when auto-formatting? Compare the "-1.0e-6" to "−1µ"
Screen Shot 2019-12-09 at 12 03 11 PM

@poldz123 does your example use contours.labelformat? Or is there another case we're missing? We do use the correct minus sign for axis ticks with axis.tickformat, so seems this issue is just with contour labels.

@alexcjohnson I do use the contours.labelformat with the value: .0f

@poldz123 I'm attempting to fix this problem in https://github.com/plotly/plotly.js/pull/4540, maybe you could try out this dev bundle:

https://65959-45646037-gh.circle-artifacts.com/0/dist/plotly.min.js

in your use case to see if the results are to your likings. Thanks!

@etpinard
It looks great, good job. The sign is now visible with the naked eye.

Thanks.

device-2020-02-03-150710

Was this page helpful?
0 / 5 - 0 ratings