Skip to content

Stack improvements #110

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
wants to merge 16 commits into from
Closed

Stack improvements #110

wants to merge 16 commits into from

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Jan 28, 2021

negative values; offsets; sort by z, stacked lines, transforms

  • Negative values always result in diverging stacking. (By contrast, in d3-shape an explicit diverging offset must be invoked.)
  • Offsets: expand and silhouette are similar to d3-shape, but taking into account negative values.
  • Grouping can be defined by z, fill, stroke…
  • z and an optional zOrder define the ordering of the stack
  • stacked lines with position=<top (default),center,bottom> or <right (default),center, left>
  • transform: ƒ

closes #109
closes #22
closes #113

examples:

Capture d’écran 2021-01-28 à 12 28 55
Capture d’écran 2021-01-28 à 12 28 45s:
Capture d’écran 2021-01-28 à 12 28 36
Capture d’écran 2021-01-28 à 12 29 03
Capture d’écran 2021-01-28 à 14 12 44

…s, trasnforms

- Negative values always result in diverging stacking. (By contrast, in d3-shape an explicit diverging offset must be invoked.)
- Offsets: expand and silhouette are similar to d3-shape, but taking into account negative values.
- Grouping can be defined by z, fill, stroke…
- z and an optional zOrder define the ordering of the stack
- stacked lines with position=<top (default),center,bottom> or <right (default),center, left>
- transform: ƒ
@Fil Fil requested a review from mbostock January 28, 2021 11:26
@mbostock mbostock mentioned this pull request Jan 28, 2021
@Fil Fil force-pushed the stack-diverging branch from e0f8378 to 816eec8 Compare January 29, 2021 14:43
@Fil Fil requested a review from mbostock January 30, 2021 07:49
@Fil
Copy link
Contributor Author

Fil commented Feb 5, 2021

I think we can merge this. In the future we might want to add:

  • sorting (a sort option that could be reverse, or a function that receives and sorts the z, or a sort method similar to d3's; with only z everything is possible, since we can pre-sort in a specific field and call z on that field)
  • more offset options (free-form function, wiggle)

@Fil
Copy link
Contributor Author

Fil commented Feb 18, 2021

Converted this PR to Draft since I want to reconsider a few things.

In brief:

  • rename x y channels as key, value (trivial)
  • z is for grouping (make it more explicit)
  • order groups with stackOrder strategies (todo)
  • use an accessor for the value, so we don't have to populate with 0 values to have curves that gradually "emerge"

@Fil Fil marked this pull request as draft February 18, 2021 06:22
@mbostock
Copy link
Member

Exciting to see so much progress!

- export stack as the core transform, and stackX, stackY for convenience
@Fil Fil mentioned this pull request Feb 23, 2021
@Fil
Copy link
Contributor Author

Fil commented Feb 23, 2021

rebased and squashed as #132

@Fil Fil closed this Feb 23, 2021
@Fil Fil deleted the stack-diverging branch February 23, 2021 14:15
@Fil Fil mentioned this pull request Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Faceted stacks Diverging stack? Stacked charts: area, bars, histogram?
2 participants