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

functional sweep #1741

Merged
merged 2 commits into from
Jul 9, 2023
Merged

functional sweep #1741

merged 2 commits into from
Jul 9, 2023

Conversation

mbostock
Copy link
Member

@mbostock mbostock commented Jul 9, 2023

I prefer to encapsulate the logic in a function. This also makes it easier for a user to extend with custom logic — even if we don’t chose to expose that extensibility yet.

@mbostock mbostock requested a review from Fil July 9, 2023 13:07
@mbostock mbostock marked this pull request as ready for review July 9, 2023 13:07
Copy link
Member Author

@mbostock mbostock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other changes that I want to make:

  • Allow the sweep option to be specified as a constant number (typically 1, 0, -1) with the same semantics as a function that returns this number. -1 would effectively negate the bend angle.
  • Change the default sweep option to 1 instead of null.
  • If the sweep option is null, it should either be treated as a number and coerced to 0, or throw an error. (We don’t want to treat null as redundant with undefined for specifying the default value; it means “no” sweep.)
  • Remove the order sweep option. (Because I can’t think of a valid use case… but if there is one, please let me know.)
  • Allow the sweep option to be specified as a function. (Because why not.)

@mbostock
Copy link
Member Author

mbostock commented Jul 9, 2023

Another thought I had was that we could have the sweep +x for ascending(x1, x2) and -x for descending(x1, x2). That would be more flexible than order-x. And we could do the same for y.

@mbostock mbostock mentioned this pull request Jul 9, 2023
4 tasks
@Fil Fil merged commit 6bea437 into fil/arrow-sweep Jul 9, 2023
@Fil Fil deleted the mbostock/arrow-sweep branch July 9, 2023 15:41
Fil added a commit that referenced this pull request Jul 9, 2023
* arrow sweep option; note that I also removed the arrow head if headLength is zero.
* miserables.json
* miserables arc diagram
* the arrow head and insets computations depend on the flipped bend angle
* darker initializer
* functional sweep (#1741)
* ±[xy]

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>
Fil added a commit that referenced this pull request Aug 21, 2023
* arrow sweep option; note that I also removed the arrow head if headLength is zero.
* miserables.json
* miserables arc diagram
* the arrow head and insets computations depend on the flipped bend angle
* darker initializer
* functional sweep (#1741)
* ±[xy]

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>
chaichontat pushed a commit to chaichontat/plot that referenced this pull request Jan 14, 2024
* arrow sweep option; note that I also removed the arrow head if headLength is zero.
* miserables.json
* miserables arc diagram
* the arrow head and insets computations depend on the flipped bend angle
* darker initializer
* functional sweep (observablehq#1741)
* ±[xy]

---------

Co-authored-by: Mike Bostock <mbostock@gmail.com>
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.

2 participants