Skip to content

a few changes - #511

Merged
mbostock merged 4 commits into
fil/order-x-by-yfrom
fil/order-x-by-y-changes
Aug 19, 2021
Merged

mbostock merged 4 commits into
fil/order-x-by-yfrom
fil/order-x-by-y-changes

Conversation

@Fil

@Fil Fil commented Aug 19, 2021

Copy link
Copy Markdown
Contributor
  • README document sort x by y
  • first ladies example plot (by @tophtucker )
  • add limit: [lo, hi]
  • throw the correct error if a mistaken sort option is given as {x: "-y", limit: 10}

@Fil
Fil requested a review from mbostock August 19, 2021 10:18
Comment thread src/mark.js
Comment on lines +88 to +90
if (limit !== undefined) {
domain = domain.slice(...typeof limit === "object" ? [limit[0], limit[1]] : [0, limit]);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

here in fact we could be more lazy, since slice(0, undefined) returns the same array.

I the case of limit being an array, I chose to pass [limit[0], limit[1]] rather than limit, but it may be too superstitious

@Fil Fil mentioned this pull request Aug 19, 2021
@mbostock
mbostock merged commit c035cdc into fil/order-x-by-y Aug 19, 2021
@mbostock
mbostock deleted the fil/order-x-by-y-changes branch August 19, 2021 15:39
mbostock added a commit that referenced this pull request Aug 19, 2021
* sortX, sortY (rebased)

* stricter reduce interpretation

* prepare channel sorting in mark.initialize

* allow channels to imply domains

* remove unused variable

* use group reducers

* use groupSort

* mark order option

* remove unused order option

* order options

* fix reverse order

* order ↦ sort

* isOptions

* reverse shorthand

* alias sort channels

* shorten

* better error for unknown scale

* a few changes (#511)

* throw the correct error if a mistaken sort option is given as {x: "-y", limit: 10}

* first ladies example plot (demonstrates "group names by first tenure_start")
based on Toph Tucker’s https://observablehq.com/@tophtucker/first-ladies-of-the-united-states

* document sort x by y

* add limit: [lo, hi]

* update README

* update README

* update README

* update README

* update README

* update README

* update README

* update README

* order facet channels, too

* update README

* add googleTrendsRidgeline test

* min- and max-index

* negative limit; iterable test

* update README

* coerce to string once

* coerce to string

* replace ±channel with shared sort options

* update README

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