-
Notifications
You must be signed in to change notification settings - Fork 184
strokeWidth as a channel #322
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
do you have an idea for a test plot? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we’ll want a scale on this, no? It feels like the sort of thing you’d want a scale for, rather than specifying literal pixels. But I guess the same argument could be made for font-size.
Can do, but I'm not sure it's worth it. Links tend to come with value=1…10 (co-occurences as in the miserables.json example), or 0…1, or sometimes from distance matrices 0…infty, and I feel it's always more "graphic tweaking" than really using it as an encoding to be shared with another mark. |
here's my recent real-world example of "stroke as scaled channel" from pairing with a friend on a correlation chart for her psych paper; stroke shows absolute value of correlation, which i just multiplied by 3: https://observablehq.com/@tophtucker/correlation-matrix-dreamcatcher to fil's point, if i understand it — multiplying by 3 was definitely just "graphic tweaking"; it doesn't encode anything shared with another mark. |
Related b66b618 |
e8405b2
to
a90580f
Compare
I rebased this PR to keep it alive, but I still want to think through whether there should be a scale here (if not, that’s probably fine) and whether we also need to support this on other marks (e.g., dot and line). |
Using this for a Sankey diagram, I'll need to set the width with a scale: identity. (Doesn't mean a scale isn't going to be useful in general.) |
3b03443
to
6c637ca
Compare
6c637ca
to
b23eafd
Compare
b23eafd
to
5304491
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I support not having a scale for strokeWidth (at least for now), but it does feel arbitrary to only expose this property on the link mark. I would prefer to make this a standard channel on all marks, like we do with strokeOpacity. Even if that channel often goes unused, it’s still meaningful, and should be supported for consistency/symmetry. I might take a pass at this now.
hey, I've always been fan of d3.js. thanks for moving this forward. :) |
49c0860
to
c6b6dfa
Compare
c6b6dfa
to
6219edf
Compare
hooray! thanks for working hard on this. so, strokeWidth for all marks? cool. :) fyi, I'm creating a nice chart like this with plot (simply put, we're debugging any performance issues for distributed computing node's consensus formulation): And I want to use |
wow! great example, I'd be curious to see it in action if you can share it! If you want to test this branch I've updated the build at https://observablehq.com/@fil/plot-strokewidth-322 (see also https://observablehq.com/@fil/plot-early-bird) |
yeah, I'd like to share but it's still in bad shape to share currently... needs some preparation to be published to the public..
seems to work nicely! (I applied strokeWidth to Plot.dot and Plot.tickX. I can't wait official new version release with it. :) |
6219edf
to
267623c
Compare
I didn't think about the "shared with another mark" aspect, but from the perspective of "Plot figures out how to map data space to graphic space for me and I just want to tweak the pixels" having a scale here is what I expect. It's similar to how I would think about the |
one thing I don't want is to write |
closes #311
build : https://observablehq.com/@fil/plot-strokewidth-322