Open jimjam-slam opened 6 months ago
The strokeWidth
channel is not bound to a scale, so you can only it express it as literal values (currently). As you discerned, you’ll need to say something like strokeWidth: (d) => d.count / 100
, replacing 100
with whatever value is appropriate to your data.
https://github.com/observablehq/plot/blob/41a63e372453d2f95e7a046839dfd245d21e7660/src/style.js#L144
Thanks v much for confirming!
The finite state machine example shows the use of
strokeWidth
as a channel to vary widths. But getting this going on a map is proving tricky:https://observablehq.com/@jimjamslam/vary-stroke-width-on-map
Without varying stroke widths I see the expected links. But once I add
strokeWidth
as a channel, the values appear to be interpreted literally, making them too large enough to overwhelm the plot. (I can see them vary if I manually scale the values with something likestrokeWidth: d => d.count / 100
.I've tried adding a
strokeWidth
object with arange
andtype: "log"
, but that doesn't seem to get me the result I'm looking for, unfortunately!