Skip to content

fix: fix misc issues with gauge and donuts #950

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

Merged
merged 10 commits into from
Jun 29, 2021
Merged

Conversation

anandtiwary
Copy link
Contributor

@anandtiwary anandtiwary commented Jun 28, 2021

Description

Please include a summary of the change, motivation and context.

Testing

Please describe the tests that you ran to verify your changes. Please summarize what did you test and what needs to be tested e.g. deployed and tested helm chart locally.

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

Documentation

Make sure that you have documented corresponding changes in this repository or hypertrace docs repo if required.

@codecov
Copy link

codecov bot commented Jun 28, 2021

Codecov Report

Merging #950 (9eb1fda) into main (df5c71a) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #950      +/-   ##
==========================================
- Coverage   85.05%   85.04%   -0.01%     
==========================================
  Files         812      812              
  Lines       16723    16737      +14     
  Branches     2004     2010       +6     
==========================================
+ Hits        14223    14234      +11     
- Misses       2468     2472       +4     
+ Partials       32       31       -1     
Impacted Files Coverage Δ
...ity/src/shared/components/donut/donut.component.ts 100.00% <ø> (ø)
projects/observability/src/public-api.ts 100.00% <100.00%> (ø)
...c/shared/components/donut/donut-builder.service.ts 85.00% <100.00%> (-0.72%) ⬇️
...ared/components/gauge-list/gauge-list.component.ts 93.33% <100.00%> (+0.47%) ⬆️
...nents/utils/d3/d3-visualization-builder.service.ts 81.97% <100.00%> (-0.42%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update df5c71a...9eb1fda. Read the comment docs.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@@ -126,19 +126,7 @@ export class DonutBuilderService extends D3VisualizationBuilderService<
}

protected decorateDimensions(calculatedDimensions: ChartDimensions): DonutDimensions {
let diameter = Math.min(calculatedDimensions.visualizationWidth, calculatedDimensions.visualizationHeight);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@skjindal93 @aaron-steinfeld Do you guys remember why we need this logic? It seems to reduce the size of donut by a lot. It creates problem with smaller container size.

After I removed it, I didn't notice any issues.

Copy link
Contributor

Choose a reason for hiding this comment

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

Basically, we wanted the smaller dimension to decide the diameter for the donut. If the screen has more width than the height, the height determines the diameter and vice versa

If there is a way to automatically fit in the donut, irrespective of different screen sizes, then that would be perfect

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, this logic was for sizing, based on the original donut mocks way back. The comments explain it, but it's mostly about legend, padding and fitting a square visualization into potentially rectangular bounding boxes like @skjindal93 mentioned.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, so with the new changes, the Donut is still working fine. It is however making a better use of the space and appearing bigger. Apart from that, I am not seeing any failure in terms of rendering. We might want to reduce the size of the dashboard containers though so that it can match previous size.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a little hesitant about this change, mainly wrt the legend. Two things are being changed here.

  1. We're not assigning legend width (why not? are we not using a legend?). Does legend still work if rendered below? to the side?
  2. We're not using the configured padding. This is fine if that's the intended visual change, but if so, any supporting code like that constant should be removed. That said, I'd guess that would show up as the legend sitting right next to the chart with 0 gap, which will look broken too.

The logic looks like it's doing these things regardless of legend position (If I vaguely recall, I think when written we always showed right legends) so that should be fixed, but this reads to me like we changed an assumption of a legend into an assumption of no legend, which is equally wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we are already using Flex in container. So css is automatically assigning them correct width and position. The padding also appears to be fine visually.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me share the screenshot in slack

@anandtiwary anandtiwary marked this pull request as ready for review June 28, 2021 19:16
@anandtiwary anandtiwary requested a review from a team as a code owner June 28, 2021 19:16
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Contributor

@aaron-steinfeld aaron-steinfeld left a comment

Choose a reason for hiding this comment

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

lgtm other than small cleanup. let's see what happens!

private static readonly DONUT_PADDING_PX: number = 60;
private static readonly LEGEND_SIZE_MULTIPLE: number = 1.5;
public static readonly DONUT_PADDING_PX: number = 10;
public static readonly LEGEND_SIZE_MULTIPLE: number = 1.5;
Copy link
Contributor

Choose a reason for hiding this comment

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

can you remove the unused ones and revert any still used to private

@@ -15,3 +15,4 @@ browserslist
LICENSE*
conf/
coverage/
test-results/
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you! Been meaning to do this for... months.

@github-actions

This comment has been minimized.

@anandtiwary anandtiwary merged commit dea7932 into main Jun 29, 2021
@anandtiwary anandtiwary deleted the dashboard-misc-changes branch June 29, 2021 19:14
@github-actions
Copy link

Unit Test Results

    4 files  259 suites   15m 47s ⏱️
937 tests 937 ✔️ 0 💤 0 ❌
943 runs  943 ✔️ 0 💤 0 ❌

Results for commit dea7932.

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.

4 participants