plot icon indicating copy to clipboard operation
plot copied to clipboard

Using a channel of named symbols doesn't work with tips

Open Fil opened this issue 1 year ago • 1 comments

Image

Plot.dot(
  penguins,
  Plot.dodgeY({
    x: "culmen_length_mm",
    symbol: (d) => (d.sex === "FEMALE" ? "square" : "star"),
    tip: true
  })
).plot({ height: 220 })

The [Object object] is the {draw: function} that corresponds to the symbol. Maybe it should just have a toString?

Fil avatar Nov 16 '24 07:11 Fil

This is similar to a literal color channel. Perhaps the tip should ignore literal symbol channels too, since showing it again in the tip won’t help interpretation. The more idiomatic approach would be to define the channel as “sex” and then specify the domain and range of the symbol scale.

mbostock avatar Nov 16 '24 13:11 mbostock