Skip to content
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

feat(insights): Support comparison to previous period in Bold Number #11225

Merged
merged 6 commits into from Aug 12, 2022

Conversation

Twixes
Copy link
Collaborator

@Twixes Twixes commented Aug 10, 2022

Changes

Follow-up to #11188 adding support for "Compare to previous time period" to the Number display type. Brings the feature fully in line with #6172 (comment).

Query editor

query

Dashboard

dash

@Twixes
Copy link
Collaborator Author

Twixes commented Aug 10, 2022

Now that I think about it, color coding "up" and "down" may not be the best idea. For instance, if we did a "Churned customers this week" insight, the lower the better. Removed the green and red.

Copy link
Member

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

glitter

@pauldambra
Copy link
Member

Ah, just one case that should be caught... page load is infinity different for me

Screenshot 2022-08-10 at 14 54 11

@Twixes
Copy link
Collaborator Author

Twixes commented Aug 10, 2022

Hmm, this is intentional – I don't have a good idea of a better thing to present when the previous period's value is zero and the current one is non-zero. Infinity seems pretty logical in this case.

@pauldambra
Copy link
Member

I'd have expected no comparison, or a note none is possible.

Maybe one to check with @clarkus but no need to block

Copy link
Contributor

@clarkus clarkus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove the success color options from the rate of change. As an example, if the value being described is a churn metric or something that improves as it is reduced, then we shouldn't indicate that a negative case. We can't be sure that the status colors will always be applied in a clear way, so I'd recommend removing them and instead go with an unbiased neutral color.

@clarkus
Copy link
Contributor

clarkus commented Aug 10, 2022

Hmm, this is intentional – I don't have a good idea of a better thing to present when the previous period's value is zero and the current one is non-zero. Infinity seems pretty logical in this case.

Are we comparing a zero value in the previous range or a null value? If there is data for that range and the values are 0, then showing the actual rate of change with a numerical value is good. If there is no data (say the event didn't exist in that time frame) then no comparison is really available. In either case, the infinity symbol is pretty confusing - not sure how it'd be interpreted by users.

@Twixes
Copy link
Collaborator Author

Twixes commented Aug 11, 2022

We should remove the success color options from the rate of change.

Yes, sorry I've not updated the screenshots, but that's exactly what I meant in my previous comment too:
#11225 (comment)

Are we comparing a zero value in the previous range or a null value?

This would be a useful distinction to be made by our API, but unfortunately the result of there being no events and e.g the result of an aggregation on some property are both 0. Mathematically, "Up ∞%" seems like an appropriate result.

@Twixes Twixes requested a review from clarkus August 11, 2022 07:54
@Twixes
Copy link
Collaborator Author

Twixes commented Aug 11, 2022

Actually I took one more glance at Paul's screenshot and realized we do return null on aggregation-based series. So, to absolutely nail quality here, I added handling of that case too:

case-1


case-2

@Twixes Twixes requested a review from pauldambra August 11, 2022 13:42
Copy link
Member

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦺

@Twixes
Copy link
Collaborator Author

Twixes commented Aug 12, 2022

I think all feedback should be addressed now, so I'll merge while you're off Chris, but of course let me know if there's anything else.

@Twixes Twixes merged commit f888630 into master Aug 12, 2022
@Twixes Twixes deleted the bold-number-previous-period branch August 12, 2022 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants