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

ensure thresholds consistency across facets #1226

Merged
merged 4 commits into from
Jan 17, 2023

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Jan 16, 2023

Using thresholds: 10 would create 10 different levels on each facet; this ensures they are consistent, like we do with the bin transform.

@Fil Fil added the bug Something isn’t working label Jan 16, 2023
@Fil Fil requested a review from mbostock January 16, 2023 12:09
Copy link
Member

@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.

Thanks for catching this.

Did you consider switching to contour.contour directly since we are now effectively opting-out of d3-contour’s built-in ticks logic?

@@ -158,7 +158,12 @@ function contourGeometry({thresholds, interval, ...options}) {
? thresholds.range(...(([min, max]) => [thresholds.floor(min), max])(finiteExtent(VV)))
: typeof thresholds === "function"
? thresholds(V, ...finiteExtent(VV))
: thresholds;
: typeof thresholds === "number"
? ticks(...nice(...finiteExtent(VV), thresholds), thresholds)
Copy link
Member

Choose a reason for hiding this comment

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

src/marks/contour.js Outdated Show resolved Hide resolved
@Fil Fil requested a review from mbostock January 16, 2023 22:21
@mbostock mbostock merged commit adf8278 into main Jan 17, 2023
@mbostock mbostock deleted the fil/contour-facet-thresholds branch January 17, 2023 17:56
chaichontat pushed a commit to chaichontat/plot that referenced this pull request Jan 14, 2024
* ensure thresholds consistency across facets

* arrayify

Co-authored-by: Mike Bostock <mbostock@gmail.com>

* nice ticks; use contour

* polish

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
bug Something isn’t working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants