BigFatDog / parcoords-es

ES6 module of Syntagmatic's Parallel Coordinates
MIT License
62 stars 32 forks source link

Left-most axis label cut off #46

Closed joshhjacobson closed 5 years ago

joshhjacobson commented 6 years ago

Hi again,

I believe this is a minor formatting bug as it did not happen in the original parallel-coordinates examples. For longer axis labels, the left-most text is cut off at the edge of the chart's canvas layer. Below is a screen shot of the example in basic.html where the economy (mpg) variable is cut off.

image

Just thought I'd bring this to your attention.

Best, Josh

timelyportfolio commented 5 years ago

I believe this is answered in this StackOverflow question. @BigFatDog happy to submit a pull if you would like. I think we can just supply padding to mimic the behavior from d3v3. To be approximately the same as the original parallel-coordinates I think we can do xscale.padding(1 / devicePixelRatio).

BigFatDog commented 5 years ago

@timelyportfolio Sure, go ahead.

timelyportfolio commented 5 years ago

@BigFatDog we can change with .xscale.padding(?), but I think it would be good to have a sensible default. Here is an example to demonstrate the effect. I think 0.1 or 0.2 will fairly closely replicate the old parallel-coordinates behavior.

Note, this will also solve a bug in reorderable where moving an axis to the first or last does not work since there is no padding on the edge.

Happy to submit pull once we decide on a good default.

BigFatDog commented 5 years ago

You're right.0.2 works well in demo.