feat: Show category counts/percentages on ValueCounts hover #43
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.
Great project idea!
This PR adds in some UX seen in the Observable Summary Table, where hovering over values in the
ValueCountsPlot
displays the corresponding row count/percentage (see demo of PR in action in video below).Observable Example:
quakPRObservable.mov
Quak Example (this PR):
quakPRHoverRowCount.mov
Two small differences here versus Observable:
I format the percentage via
d3.format(".1%")
, while they appear to used3.format(".0%")
. (A future improvement could use a ternary to check if the percentage is less than 1, if so, format viad3.format(".1%")
or .2,, otherwise,d3.format(".0%")
.On
mouseout
, they appear to show the JS data-type, while I show the type provided by thearrow.Field
(as that's what was displayed by default inquak
).Note:
deno lint
+deno fmt
.Value Counts
plots (for categorical data). I can happily add another PR for the histogram as well 😄