Skip to content

sort: {[scale]: channel} doesn’t work when combined with a transform #1303

Description

@mbostock

E.g., here:

Screenshot 2023-03-01 at 10 11 04 AM

Plot.plot({
  color: {
    legend: true
  },
  marks: [
    Plot.dot(olympians, Plot.sort("height", {
      x: "height",
      y: "weight",
      stroke: "nationality",
      sort: {
        color: "stroke", // we don’t need a channel here; TODO null?
        reduce: "count",
        reverse: true,
        limit: 10
      }
    }))
  ]
})

The addition of the sort transform should look more similar to the below, i.e., without affecting the imputed domain of the color scale; it should only affect the z-order of dots sorted by the height column.

Screenshot 2023-03-01 at 10 12 54 AM

Plot.plot({
  color: {
    legend: true
  },
  marks: [
    Plot.dot(olympians, {
      x: "height",
      y: "weight",
      stroke: "nationality",
      sort: {
        color: "stroke",
        reduce: "count",
        reverse: true,
        limit: 10
      }
    })
  ]
})

Maybe something wrong around here?

range(XV),

Same issue as #840, I think.

Activity

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

      No branches or pull requests

      Issue actions