-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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(web-analytics): Choose sensible interval for graphs #18860
Conversation
a779d4c
to
3fc1a08
Compare
Size Change: +377 B (0%) Total Size: 1.83 MB
|
@@ -729,7 +749,7 @@ export const webAnalyticsLogic = kea<webAnalyticsLogicType>([ | |||
const geoIpPluginConfig = | |||
isNotNil(geoIpPluginId) && | |||
pluginsConfigResponse.status === 'fulfilled' && | |||
pluginsConfigResponse.value.find((plugin) => plugin.id === geoIpPluginId) | |||
pluginsConfigResponse.value.find((plugin) => plugin.plugin === geoIpPluginId) |
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.
Snuck this change in
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! Here's a ✅ , though it might be worth adding (or letting chatgpt add) a few more tests to utils.test.ts? You added a few new functions, but tests only for getDefaultInterval
. Or you think e.g. testing dateStringToComponents
via dateStringToDayJs
is good enough? I don't feel too strongly here, so happy to merge without.
cb662e3
to
0f1728c
Compare
6d4b806
to
6d652e6
Compare
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
Problem
Currently if you choose the last 24 hours, you see a daily view, which is not helpful as there is 1 data point.
Additionally if you choose past year, you also get a daily view, which again not helpful as you have hundreds of data points.
Changes
Try to choose a sensible interval based on the date range. For the default options in the date picker, these are already set, but provide a fallback.
Do something similar when changing the interval, if the existing date range is not compatible with the new interval then change the date range.
Note: I could have gone further into this, particularly handling custom date ranges. This is something I'll follow up with in a separate PR when I let people change the interval
Used the dates in trends when comparing to previous periods
How did you test this code?
Some unit tests