Skip to content

Pass the bin extent to reducers? #435

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

Closed
Fil opened this issue Jun 15, 2021 · 1 comment · Fixed by #437
Closed

Pass the bin extent to reducers? #435

Fil opened this issue Jun 15, 2021 · 1 comment · Fixed by #437
Assignees
Labels
enhancement New feature or request

Comments

@Fil
Copy link
Contributor

Fil commented Jun 15, 2021

A typical example would be to have the title of each bar show the date extent in https://observablehq.com/@fil/plot-stargazer-history

    Plot.rectY(
      data,
      Plot.binX(
        {
          y: "count",
          title: (bin) => `${bin.x1}${bin.x2}` // ⇐ something like this.
        },
        {
          x: "date",
          fill: "brown",
          thresholds: 100
        }
      )
    ),
@Fil Fil added the enhancement New feature or request label Jun 15, 2021
@Fil Fil self-assigned this Jun 15, 2021
Fil added a commit that referenced this issue Jun 17, 2021
closes #435

not sure about the way I've coded "around" the take() function…
@mbostock
Copy link
Member

By analogy, we could pass the key to group reducers.

@mbostock mbostock mentioned this issue Aug 11, 2021
@mbostock mbostock changed the title Pass the bin's extent to the reducer? Pass the bin extent, and group keys, to reducers? Aug 11, 2021
mbostock pushed a commit that referenced this issue Sep 11, 2021
closes #435

not sure about the way I've coded "around" the take() function…
@Fil Fil closed this as completed in #437 Sep 13, 2021
Fil added a commit that referenced this issue Sep 13, 2021
* pass the bins' extent (x1, x2, y1, y2) to the reducer
* allow outputs to be suppressed
* remove unused maybeLabel

closes #435

Co-authored-by: Mike Bostock <[email protected]>
@mbostock mbostock changed the title Pass the bin extent, and group keys, to reducers? Pass the bin extent to reducers? Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants