Auto: error on reducer without input; warn on ordinal size; expose warnings#1424
Closed
tophtucker wants to merge 1 commit into
Closed
Auto: error on reducer without input; warn on ordinal size; expose warnings#1424tophtucker wants to merge 1 commit into
tophtucker wants to merge 1 commit into
Conversation
Contributor
|
sum does not need an input (it defaults to count); distinct works too I think, also giving count. min-index and max-index will always give 0. And then there are the x1, x2 reducers (for binX), which give the bins' bounds. |
Member
Author
|
Even though sum and distinct work as count, I've seen several people get confused by selecting "distinct" in the chart cell and seeing nothing change, so I'm still sort of inclined to throw (or warn?) on them. |
Member
Author
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
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.
Demo. Sketching some additional errors / warnings based on what I've seen leading people astray.
Error on reducer without input — Setting a non-count reducer without an input field error, not warns, because it's a static error in the config, regardless of what data gets passed in. TODO: do any other reducers not need an input field?
Warn on ordinal size — Since this is dynamic, it’s just a warning, not an error. One issue is there’s no way to suppress it if for some reason you want this. It should probably be subsumed by #493, but I was just itching to try something.
Expose warnings (#1192) — In this PR, my approach is to set an array of warnings on the returned figure. Mike has mentioned he might prefer passing in an onWarn callback. I guess the advantage there is that these warnings could be triggered by interaction in the future? Right now, the chart cell almost never runs into warnings, but there are situations where it seems like it should (like ordinal size), so I feel the itch to be able to expose the warnings in its UI.