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: add threshold line to timeseries charts [MA-3442] #1825

Merged
merged 8 commits into from
Dec 4, 2024

Conversation

mihai-peteu
Copy link
Contributor

@mihai-peteu mihai-peteu commented Nov 29, 2024

Summary

https://konghq.atlassian.net/browse/MA-3442

Analytics Chart

Screenshot 2024-12-03 at 14 52 36

Dashboard Renderer

Screenshot 2024-12-03 at 14 52 59

@mihai-peteu mihai-peteu requested a review from a team as a code owner November 29, 2024 23:54
Copy link
Contributor

@filipgutica filipgutica left a comment

Choose a reason for hiding this comment

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

Need to update the readme for the new threshold prop.

Copy link
Contributor

@filipgutica filipgutica left a comment

Choose a reason for hiding this comment

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

I think dashboard-renderer should be updated so that threshold can be passed through the tile definition -> chart renderer so it's supported in dashboards as well?

Copy link
Contributor

@filipgutica filipgutica left a comment

Choose a reason for hiding this comment

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

Should threshold be labelled in the tooltip?
What should be done about threshold in the legend? 🤔

image

@mihai-peteu mihai-peteu force-pushed the feat/ma-3442-analytics-chart-threshold branch from 3e14d7c to e6ee577 Compare December 4, 2024 00:20
threshold: {
type: 'object',
properties: Object.fromEntries(
exploreAggregations.map((key) => [key, { type: 'number' }]),
Copy link
Contributor

Choose a reason for hiding this comment

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

This sort of dynamic definition is going to prevent TS inference from working. I don't have context on what this is trying to do; at the least trying to make this dynamic will be a journey with the way the current dashboard types are set up. Maybe just splat it out for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is what it yields:

Screenshot 2024-12-04 at 08 44 04

I assume it's preferable to dynamically build the allowed keys rather than spelling out each one, and having to maintain this list separate from exploreAggregations.

We can simply make it {type: string}, {type: number}, but that seems too imprecise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dropped the properties and just ended up doing

additionalProperties: {
      type: 'number',
 },

Copy link
Contributor

@adorack adorack left a comment

Choose a reason for hiding this comment

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

Dashboard side looks good to me.

@mihai-peteu mihai-peteu merged commit 054b547 into main Dec 4, 2024
13 checks passed
@mihai-peteu mihai-peteu deleted the feat/ma-3442-analytics-chart-threshold branch December 4, 2024 22:08
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.

3 participants