-
Notifications
You must be signed in to change notification settings - Fork 185
text font-size as an unscaled numerical channel #300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Interestingly, the result is quite smaller than a circle defined with the same accessor. So it seems that we need to introduce fontSizeAdjust (which isn't much supported https://caniuse.com/font-size-adjust), and rescale the resulting channel values in the font-size attribute. See for example https://observablehq.com/d/f5698ebfc65d2b5c#FSA closes #296
Do you prefer this to a fontSize scale where you can set the range separately? Or perhaps no scale at all, and simply using the literal value similar to how we handle the rotate option? That feels like it might make the most sense for me, since font size is inherently fiddly and I don’t think we’d try to make a legend for it. But maybe it’s inconsistent? Related, I’ve been thinking we need a strokeWidth scale or similar so that a line or link’s stroke width can be used as an encoding. That I think we would want a scale for, and we would also probably want a legend. |
In the example of the image it makes sense to bind it to the r scale, but I agree it might be a rare case in which you would compute the scale outside the plot. strokeWidth on links is definitely something that needs a scale. Not so sure about the legend, but if we follow #236 / #299 we can add as many legends as we want as plugins. |
Binding to the r scale feels surprising to me. I think we should probably not use a scaled channel here and have people compute font sizes manually. Then we won’t need the fontSizeAdjust property also. |
Agreed, I'll update this accordingly. |
Discussion loosely connected to #56 (comment) |
ready |
Interestingly, the result is quite smaller than a circle defined with the same accessor. So it seems that we need to introduce fontSizeAdjust (which isn't much supported as a css property https://caniuse.com/font-size-adjust), and rescale the resulting channel values in the font-size attribute. See for example https://observablehq.com/d/f5698ebfc65d2b5c#FSA
closes #296