Closed akre54 closed 2 months ago
This is the intended behavior because when you double the values, it doubles the implicit domain, and so the effective size of the bubbles is the same. If you want to change the size of the bubbles, you need to either set the range or domain of the r scale.
Thanks @mbostock. Appreciate the quick response. I'm not seeing where the documentation is for setting the range or domain on a Mark. The Scales documentation seems to imply that I can pass a domain
property, but I'm not seeing how to use that with the example map.
Is this right?
r: {
value: 'population',
range: [0, 5000],
domain: [0, 10000],
},
This seems to work as I'd intend (where negIconScale
is a viewof Inputs.range
)
Plot.image(
negGeoJson,
Plot.centroid({
src: negative.src,
width: d => d.properties.earlier * negIconScale,
})
),
Is width
just treated differently as not a channel?
It’s not a mark option; it’s the r scale which is defined at the plot level. Edit the r: {range: …}
line in the linked notebook.
Oh got it - I just grabbed a random notebook and I missed that. Thanks
Steps to reproduce:
Video:
https://github.com/observablehq/plot/assets/931368/0b7f4af0-e480-4243-9082-bebf425b4932
I would expect that the radius size of the bubbles double in response to this change, similar to the way that the legend updates. This also means that responsive values from notebook variables don't actually update the svg. I can confirm that this works as I'd expect using
Plot.image
and thewidth
property. Is there something different withr
?