-
Notifications
You must be signed in to change notification settings - Fork 63
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
respect thresholds passed to contourDensity #57
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fil
added a commit
to observablehq/plot
that referenced
this pull request
Jun 23, 2022
note: we have to go around this bug in d3-contour: d3/d3-contour#57
mbostock
approved these changes
Jun 23, 2022
7 tasks
Fil
added a commit
to observablehq/plot
that referenced
this pull request
Jun 24, 2022
note: we have to go around this bug in d3-contour: d3/d3-contour#57
mbostock
pushed a commit
to observablehq/plot
that referenced
this pull request
Jun 24, 2022
note: we have to go around this bug in d3-contour: d3/d3-contour#57
mbostock
pushed a commit
to observablehq/plot
that referenced
this pull request
Jun 24, 2022
note: we have to go around this bug in d3-contour: d3/d3-contour#57
mbostock
added a commit
to observablehq/plot
that referenced
this pull request
Jun 24, 2022
* density contours as an initializer: first pass * density by z, carrying styles and channels (no reducer, only "first") * fill: "density" * density weight * consistent thresholds across facets and series note: we have to go around this bug in d3-contour: d3/d3-contour#57 * allow initializer composition; move initializer to the class; clean up * density weight example * error if x or y is undefined (in the future we might route those to 1-dimensional transforms—KDE) * document * reduce img * * don't apply the scales if we are already in pixel space (e.g. when composing with the hexbin transform) * avoids a crash when there is no contour * 1d density contours with frameAnchor * adopt d3@7.4.5 for https://github.com/d3/d3-contour/releases/tag/v3.0.2 (not entirely sure if it's good practice to have all the yarn.lock changes in the PR, beyond those that are relevant) * replace example image * mike’s edits * fix image dimensions * isDensity * distinct * tweak tests Co-authored-by: Mike Bostock <mbostock@gmail.com>
mbostock
added a commit
to observablehq/plot
that referenced
this pull request
Jun 24, 2022
* density mark * density contours stroke & fill (#948) * density contours as an initializer: first pass * density by z, carrying styles and channels (no reducer, only "first") * fill: "density" * density weight * consistent thresholds across facets and series note: we have to go around this bug in d3-contour: d3/d3-contour#57 * allow initializer composition; move initializer to the class; clean up * density weight example * error if x or y is undefined (in the future we might route those to 1-dimensional transforms—KDE) * document * reduce img * * don't apply the scales if we are already in pixel space (e.g. when composing with the hexbin transform) * avoids a crash when there is no contour * 1d density contours with frameAnchor * adopt d3@7.4.5 for https://github.com/d3/d3-contour/releases/tag/v3.0.2 (not entirely sure if it's good practice to have all the yarn.lock changes in the PR, beyond those that are relevant) * replace example image * mike’s edits * fix image dimensions * isDensity * distinct * tweak tests Co-authored-by: Mike Bostock <mbostock@gmail.com> Co-authored-by: Philippe Rivière <fil@rezo.net>
frontend-provider
added a commit
to frontend-provider/plot
that referenced
this pull request
Sep 20, 2023
* density mark * density contours stroke & fill (#948) * density contours as an initializer: first pass * density by z, carrying styles and channels (no reducer, only "first") * fill: "density" * density weight * consistent thresholds across facets and series note: we have to go around this bug in d3-contour: d3/d3-contour#57 * allow initializer composition; move initializer to the class; clean up * density weight example * error if x or y is undefined (in the future we might route those to 1-dimensional transforms—KDE) * document * reduce img * * don't apply the scales if we are already in pixel space (e.g. when composing with the hexbin transform) * avoids a crash when there is no contour * 1d density contours with frameAnchor * adopt d3@7.4.5 for https://github.com/d3/d3-contour/releases/tag/v3.0.2 (not entirely sure if it's good practice to have all the yarn.lock changes in the PR, beyond those that are relevant) * replace example image * mike’s edits * fix image dimensions * isDensity * distinct * tweak tests Co-authored-by: Mike Bostock <mbostock@gmail.com> Co-authored-by: Philippe Rivière <fil@rezo.net>
backend-devloper
pushed a commit
to backend-devloper/plot
that referenced
this pull request
Nov 24, 2023
* density mark * density contours stroke & fill (#948) * density contours as an initializer: first pass * density by z, carrying styles and channels (no reducer, only "first") * fill: "density" * density weight * consistent thresholds across facets and series note: we have to go around this bug in d3-contour: d3/d3-contour#57 * allow initializer composition; move initializer to the class; clean up * density weight example * error if x or y is undefined (in the future we might route those to 1-dimensional transforms—KDE) * document * reduce img * * don't apply the scales if we are already in pixel space (e.g. when composing with the hexbin transform) * avoids a crash when there is no contour * 1d density contours with frameAnchor * adopt d3@7.4.5 for https://github.com/d3/d3-contour/releases/tag/v3.0.2 (not entirely sure if it's good practice to have all the yarn.lock changes in the PR, beyond those that are relevant) * replace example image * mike’s edits * fix image dimensions * isDensity * distinct * tweak tests Co-authored-by: Mike Bostock <mbostock@gmail.com> Co-authored-by: Philippe Rivière <fil@rezo.net>
tigrevol8888
added a commit
to tigrevol8888/plot
that referenced
this pull request
Jul 5, 2024
* density mark * density contours stroke & fill (#948) * density contours as an initializer: first pass * density by z, carrying styles and channels (no reducer, only "first") * fill: "density" * density weight * consistent thresholds across facets and series note: we have to go around this bug in d3-contour: d3/d3-contour#57 * allow initializer composition; move initializer to the class; clean up * density weight example * error if x or y is undefined (in the future we might route those to 1-dimensional transforms—KDE) * document * reduce img * * don't apply the scales if we are already in pixel space (e.g. when composing with the hexbin transform) * avoids a crash when there is no contour * 1d density contours with frameAnchor * adopt d3@7.4.5 for https://github.com/d3/d3-contour/releases/tag/v3.0.2 (not entirely sure if it's good practice to have all the yarn.lock changes in the PR, beyond those that are relevant) * replace example image * mike’s edits * fix image dimensions * isDensity * distinct * tweak tests Co-authored-by: Mike Bostock <mbostock@gmail.com> Co-authored-by: Philippe Rivière <fil@rezo.net>
LordOfCodes26
added a commit
to LordOfCodes26/plot
that referenced
this pull request
Aug 15, 2024
* density mark * density contours stroke & fill (#948) * density contours as an initializer: first pass * density by z, carrying styles and channels (no reducer, only "first") * fill: "density" * density weight * consistent thresholds across facets and series note: we have to go around this bug in d3-contour: d3/d3-contour#57 * allow initializer composition; move initializer to the class; clean up * density weight example * error if x or y is undefined (in the future we might route those to 1-dimensional transforms—KDE) * document * reduce img * * don't apply the scales if we are already in pixel space (e.g. when composing with the hexbin transform) * avoids a crash when there is no contour * 1d density contours with frameAnchor * adopt d3@7.4.5 for https://github.com/d3/d3-contour/releases/tag/v3.0.2 (not entirely sure if it's good practice to have all the yarn.lock changes in the PR, beyond those that are relevant) * replace example image * mike’s edits * fix image dimensions * isDensity * distinct * tweak tests Co-authored-by: Mike Bostock <mbostock@gmail.com> Co-authored-by: Philippe Rivière <fil@rezo.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When passing thresholds([0.5]) to contourDensity, one would expect the returned thresholds to be [0.5], but instead we get 0.5 * 2^-2k = 1/32 (with the default cellSize k=2).
This fixes the logic so that the thresholds are respected. Unfortunately it is a breaking change or any user who has manually set those thresholds.