-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Histogram events & bin hover label improvements #2113
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
59b6463
let timeit work with n=1
alexcjohnson 6dc9904
give Lib.findBin a tiny buffer for on-the-line points
alexcjohnson ccf1a76
update histograms to include input point numbers in events and smart …
alexcjohnson 1b356d2
lint histogram2d calc
alexcjohnson 8f8add1
:palm_tree: histogram2d calc
alexcjohnson 7686096
refactor bar/hist hover
alexcjohnson 8d36d81
factor out bin_label_vals so histogram2d can use it too
alexcjohnson a7e2f32
extend event data and bin label improvements to histogram2d
alexcjohnson 6b74fbe
:hocho: TODOs we've done
alexcjohnson b91d1cb
exclude CDFs from new histogram event & label features
alexcjohnson ad0e08f
limit the number of extra digits we give to histogram bin labels
alexcjohnson 6cb4e71
test bin_label_vals
alexcjohnson 7581567
use unicode minus in `Axes.hoverLabelText`
alexcjohnson 51ad8c2
get rid of (x|y)LabelVal(0|1), in favor of (x|y)Label
alexcjohnson 3aa03f7
tests of histogram hover label range format, and log-negative format
alexcjohnson cc454dc
TODO -> comment
alexcjohnson 2696c1c
test event data for histogram
alexcjohnson 0331a16
test case for category range histogram hover labels
alexcjohnson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,15 +171,19 @@ module.exports = function calc(gd, trace) { | |
var cdi = { | ||
p: pos[i], | ||
s: size[i], | ||
b: 0, | ||
pts: inputPoints[i] | ||
b: 0 | ||
}; | ||
if(uniqueValsPerBin) { | ||
cdi.p0 = cdi.p1 = (inputPoints[i].length) ? pos0[inputPoints[i][0]] : pos[i]; | ||
} | ||
else { | ||
cdi.p0 = roundFn(binEdges[i]); | ||
cdi.p1 = roundFn(binEdges[i + 1], true); | ||
|
||
// pts and p0/p1 don't seem to make much sense for cumulative distributions | ||
if(!cumulativeSpec.enabled) { | ||
cdi.pts = inputPoints[i]; | ||
if(uniqueValsPerBin) { | ||
cdi.p0 = cdi.p1 = (inputPoints[i].length) ? pos0[inputPoints[i][0]] : pos[i]; | ||
} | ||
else { | ||
cdi.p0 = roundFn(binEdges[i]); | ||
cdi.p1 = roundFn(binEdges[i + 1], true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❤️ ing that you were able to put all thing new rounding logic in |
||
} | ||
} | ||
cd.push(cdi); | ||
} | ||
|
This file contains hidden or 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
This file contains hidden or 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A questionable decision... this gets at some of the same issues that led to
cumulative.currentbin
but in principle a CDF shows the sum of all the data prior to a specific point, not the data within that bin. perhaps I should shiftp0
andp1
depending oncurrentbin
so that the hover label at least gets the description "all the data prior to X" precisely correct, even though it'll be a different value than the center of the bar...And then what about
pts
? You could say it should be included and again should be "all the data prior to X" but then it would be meaningless to select a single bar and not all the bars before it. Alternativelypts
could contain "all the data that was added in this bar" which might be more useful in terms of selecting a single bar, but it's not really what that bar means.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I think something along those lines would be useful down the road.
Sounds to me like both all-data-prior-to-X and data-added-in-this-bar point lists could be useful, so we'll might have to emit both in the future. Leaving this discussion for another time is 👌 with me. I doubt that most plotly.js users even know about cumulative histograms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, I'll make a new issue to discuss how this should work for CDFs.