Skip to content

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

Open
@Fil

Description

@Fil
Contributor

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?

Activity

added
bugSomething isn’t working
on Nov 16, 2024
mbostock

mbostock commented on Nov 16, 2024

@mbostock
Member

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.

added a commit that references this issue on Nov 19, 2024
d514313
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn’t working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @Fil@mbostock

      Issue actions

        Using a channel of named symbols doesn't work with tips · Issue #2237 · observablehq/plot