Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symbol reducer and scale hint #806

Closed
Fil opened this issue Mar 12, 2022 · 1 comment
Closed

symbol reducer and scale hint #806

Fil opened this issue Mar 12, 2022 · 1 comment
Labels
bug Something isn’t working

Comments

@Fil
Copy link
Contributor

Fil commented Mar 12, 2022

on the mbostock/reinitialize branch, the symbol reducer crashes at inferSymbolHint (ordinal.js:121:32) with Cannot read properties of undefined (reading 'fill')

import * as Plot from "@observablehq/plot";
import * as d3 from "d3";

export default async function() {
  const penguins = await d3.csv("data/penguins.csv", d3.autoType);
  return Plot.plot({
    grid: true,
    marks: [
      Plot.dot(penguins, Plot.hexbin({r: "count", symbol: "mode"}, {
        radius: 20, 
        symbol: "sex",
        x: "culmen_depth_mm",
        y: "culmen_length_mm"
      }))
    ],
    symbol: {legend: true}
  });
}

I've tried to fix this here #804 (review)

@mbostock mbostock added the bug Something isn’t working label Mar 12, 2022
mbostock added a commit that referenced this issue Mar 12, 2022
@mbostock
Copy link
Member

Thanks for finding this bug and sharing a reproduction!

mbostock added a commit that referenced this issue May 4, 2022
mbostock added a commit that referenced this issue May 26, 2022
scale hex radius so that when hexagons touch, circles also touch without overlapping (#803)

(supersedes #795)

simpler hexagon

hexgrid

fix for unscaled channels

reorder

hexbin

fix #806; handle missing hint

infer channel scales

pass data to initializer

offset hexagonal grid slightly

simpler without destructuring

reinitialize (#823)

* document layouts (as "scale-aware transforms")

* document binWidth

* document the initialize option after 42ac4f0

* sort hex bins by radius (descending)
group by z
inline hexbin
binWidth is the distance between two centers

(rebased on mbostock/reinitialize)

* dodge

rebased on mbostock/reinitialize

* compose intializers

* use composeInitialize to make dodge composable

* add new channels as you compose initializers

* darker transform, to demonstrate composition with dodgeY

(added as an example, but we could promote it to a transform)

* a more generic "remap"

* jiggle layout
(using the same remap intializer as in the darkerDodge plot)

composeInitialize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

No branches or pull requests

2 participants