-
Notifications
You must be signed in to change notification settings - Fork 13.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
Adding a big number total viz type that is not a timeseries metric #212
Conversation
@@ -1,4 +1,4 @@ | |||
.big_number g.axis text { | |||
.big_number g.axis text, .big_number_total g.axis text { |
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.
nit, but style-wise (https://github.com/airbnb/css#formatting) each selector should have its own line when using multiple selectors in a rule declaration.
a couple of nit picky things about js linting, overall looks good though! |
2086607
to
6cfeb0f
Compare
To both showcase this new viz and get unit tests coverage you can add an example slice in |
"""Put emphasis on a single metric with this big number viz""" | ||
|
||
viz_type = "big_number_total" | ||
verbose_name = "Big Number Total" |
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.
Maybe this new viz should be just "Big Number" and the previous one should say "Big Number with Trendline" or something. The viz_type
we cannot change because of backwards compatibility, but the verbose_name we can change all we want.
As a side note it would be nice to have a time expression (much like That might be brutal on the database's depending on indexes / partitioning, but maybe there could also be a table level setting called |
6cfeb0f
to
0dd20b0
Compare
@williaster Thanks for all the feedback. Added fixes. Let me know if there's anything that still doesn't look good |
stroke-width: 1px; | ||
stroke: grey; | ||
} | ||
|
||
.big_number .domain { | ||
.big_number .domain, | ||
.big_number_total .domain{ |
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.
don't worry about changing it for this diff, but going forward I'm trying to get people to adopt dash case for css eg .big-number-total
BEM is also an interesting approach if you feel like reading :) https://css-tricks.com/bem-101/
@@ -558,7 +558,7 @@ class BigNumberViz(BaseViz): | |||
"""Put emphasis on a single metric with this big number viz""" | |||
|
|||
viz_type = "big_number" | |||
verbose_name = "Big Number" | |||
verbose_name = "Big Number with Trendline" |
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.
nice.
LGTM! nice improvement! :) |
…ment (apache#212) Updates the requirements on [@superset-ui/legacy-plugin-chart-sunburst](https://github.com/apache-superset/superset-ui-plugins) to permit the latest version. - [Release notes](https://github.com/apache-superset/superset-ui-plugins/releases) - [Changelog](https://github.com/apache-superset/superset-ui-plugins/blob/master/CHANGELOG.md) - [Commits](apache-superset/superset-ui-plugins@v0.10.0...v0.11.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
…ment (apache#212) Updates the requirements on [@superset-ui/legacy-plugin-chart-sunburst](https://github.com/apache-superset/superset-ui-plugins) to permit the latest version. - [Release notes](https://github.com/apache-superset/superset-ui-plugins/releases) - [Changelog](https://github.com/apache-superset/superset-ui-plugins/blob/master/CHANGELOG.md) - [Commits](apache-superset/superset-ui-plugins@v0.10.0...v0.11.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
…ment (apache#212) Updates the requirements on [@superset-ui/legacy-plugin-chart-sunburst](https://github.com/apache-superset/superset-ui-plugins) to permit the latest version. - [Release notes](https://github.com/apache-superset/superset-ui-plugins/releases) - [Changelog](https://github.com/apache-superset/superset-ui-plugins/blob/master/CHANGELOG.md) - [Commits](apache-superset/superset-ui-plugins@v0.10.0...v0.11.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
…ment (apache#212) Updates the requirements on [@superset-ui/legacy-plugin-chart-sunburst](https://github.com/apache-superset/superset-ui-plugins) to permit the latest version. - [Release notes](https://github.com/apache-superset/superset-ui-plugins/releases) - [Changelog](https://github.com/apache-superset/superset-ui-plugins/blob/master/CHANGELOG.md) - [Commits](apache-superset/superset-ui-plugins@v0.10.0...v0.11.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
…ment (apache#212) Updates the requirements on [@superset-ui/legacy-plugin-chart-sunburst](https://github.com/apache-superset/superset-ui-plugins) to permit the latest version. - [Release notes](https://github.com/apache-superset/superset-ui-plugins/releases) - [Changelog](https://github.com/apache-superset/superset-ui-plugins/blob/master/CHANGELOG.md) - [Commits](apache-superset/superset-ui-plugins@v0.10.0...v0.11.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
@williaster @mistercrunch
I'm adding a new big number total viz type that uses the same d3 as the big number but it is not a timeseries metric, so it will aggregate over whatever time period is given (this will allow us to do WAUs). I've also added functionality to add descriptive text below the number. I originally tried to adjust the text size based on the length but couldn't get it to work because of the loading order of the viz.