-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Indicator trace type (gauge+bignum+bullet) #3659
Comments
|
There are a bunch of ideas in #12004 for the big-number mode that we should incorporate. In addition to those, we should have the ability to have 'ranges' against which the indicator value can be visually compared in a gauge or bullet chart, as well as a 'comparison measure': Here are some possible gauge chart variants we should think about: |
Here's a nice "bullet vs gauge" blog post to stimulate reflection also: http://duelingdata.blogspot.com/2017/07/bullet-vs-gauge.html |
@nicolaskruchten here's a prototype for |
Codepen showcasing animations of text and gauge: https://codepen.io/antoinerg/pen/arKrGO |
workshopping the spec:
|
Confirmed: |
@nicolaskruchten I adapted You'll probably agree that in the second example, it would be preferable to have the This brings us to the question of positions: how should they be specified by the user? Should they be values in pixel, in domain value or rather in vaguer but user-friendly |
Also, you can follow my work in branch |
My feeling is that we should do the simplest thing for this version and see what people ask for. What you have there is fine by me, and users can just make the box vertically shorter to control title positioning. If you want to spec out a top/bottom/left/right API i don’t mind but I don’t want layout considerations to add a week to the LOE ;) |
Do an image search for bullet charts and you’ll see they are often used inside tables or other short/wide contexts... not so much squarer aspect ratios |
Nicely done @antoinerg! You're on the right track. Let me know if you need help in trying to reuse |
@etpinard now could be a good time to check new progress on Also, it should be possible for the users to specify whether they want to automatically scale down numbers to fit the figure or not. I think this deserves a separate top-level attribute |
Hmm. Is this a requirement? If so, we might want to think about adding another trace-level mode e.g {
type: 'indicator',
mode: 'bignumber+deltarel+deltaabs'`,
// ...
}
Wait. I thought the only scenario where we "scale down" now is on circular gauges? |
Nice! As GitHub doesn't allow reviewers to make comments on combine diff in the compare view, would you mind rebasing your branch (or do that on a new branch) so that it includes ~10 commits or less. Thanks! |
There you go: Compare |
The current implementation will scale down "numbers" (ie. the big number and the delta) to fit in the available space. Depending on the mode, the available space is different:
|
I think @nicolaskruchten would like it to be possible to add down the road (although it's not a requirement for v1). I'm starting to think the user could provide a template ala |
Ok, almost ready to make a PR. I refactored the code to make it much easier to read: |
Let's tackle three of the ones from #2221 in a single
indicator
trace type.The text was updated successfully, but these errors were encountered: