You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Possible solutions include providing a cut-down array of tickValues and rotating the labels after the fact, e.g. https://bl.ocks.org/mbostock/4403522
However, this module is named d3 simple slider so we should consider solutions which put less burden on the user. For example, provide an interface to let the user simply specify a rotation angle. Even better, but much larger in scope, would be to detect the size of the labels and adjust the tick values accordingly.
You can use element.getComputedTextLength() to calculate the text width of the label, but the question is then what? One could:
• truncate the text and add an ellipsis, and keep knocking off characters until it fits in the designated width (slider width / # of ticks), but the label may be unusable (e.g. a bunch of "20..." in your example)
• figure out the widest label text, and skip every nth label to make sure they all fit... but if there wind up not being enough tick labels to infer what the other ticks represent, then that's a bad solution too.
The text was updated successfully, but these errors were encountered: