Skip to content

Conversation

skjindal93
Copy link
Contributor

@skjindal93 skjindal93 requested a review from a team as a code owner January 11, 2021 14:14
@codecov
Copy link

codecov bot commented Jan 11, 2021

Codecov Report

Merging #494 (20e963e) into main (8dc4b72) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #494   +/-   ##
=======================================
  Coverage   85.60%   85.60%           
=======================================
  Files         757      757           
  Lines       15518    15519    +1     
  Branches     1839     1839           
=======================================
+ Hits        13284    13285    +1     
  Misses       2203     2203           
  Partials       31       31           
Impacted Files Coverage Δ
...ity/src/shared/components/gauge/gauge.component.ts 90.90% <100.00%> (+0.16%) ⬆️

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 8dc4b72...20e963e. Read the comment docs.

@github-actions

This comment has been minimized.

outerRadius: radius,
startAngle: -Math.PI / 2 - GaugeComponent.EXTRA_ARC_ANGLE,
endAngle: -Math.PI / 2 - GaugeComponent.EXTRA_ARC_ANGLE + (inputData.value / inputData.maxValue) * Math.PI
startAngle: -completeAngle,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this handle the first case described in the comment? If inputData.value is 0, we're doing [-completeAngle, -completeAngle] so there'd still be no arc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. We want no value arc, when the inputData.value is 0. In fact @anandtiwary mentioned that's the expected outcome as well

case 1: inputData.value = 0, the end angle would be -Math.PI / 2 - GaugeComponent.EXTRA_ARC_ANGLE which is same as start angle. So the arc will be completely empty. Expected outcome.

Copy link
Contributor

@aaron-steinfeld aaron-steinfeld Jan 11, 2021

Choose a reason for hiding this comment

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

Ah I misread his comment - I thought our ux generally has a little arc for a 0-value gauge to show it's "emptiness"? I'm pretty sure that's what we do in the linear case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm. fair point. I can use a value of 0.5, if the value is 0 to display the 0-value arc

Copy link
Contributor

@aaron-steinfeld aaron-steinfeld Jan 11, 2021

Choose a reason for hiding this comment

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

I think that makes sense - something like percentFill = Math.max(0.01, inputData.value / inputData.maxValue)

Copy link
Contributor

@anandtiwary anandtiwary Jan 11, 2021

Choose a reason for hiding this comment

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

I am not sure it looks any better to show a little arc for 0.

Also, could we rename completeAngle to just startAngle and assign it -completeAngle ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, could we rename completeAngle to just startAngle and assign it -completeAngle

Didn't catch the comment

Copy link
Contributor

Choose a reason for hiding this comment

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

CompleteAngle is confusing to me. Can we do const startAngle = - (Math.PI / 2 + GaugeComponent.EXTRA_ARC_ANGLE); ?

Copy link
Contributor

@anandtiwary anandtiwary Jan 11, 2021

Choose a reason for hiding this comment

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

So, endAngle = startAngle + 2 * (inputData.value / inputData.maxValue) * (- startAngle)

@github-actions

This comment has been minimized.

outerRadius: radius,
startAngle: -completeAngle,
endAngle: -completeAngle + 2 * (inputData.value / inputData.maxValue) * completeAngle
endAngle: -completeAngle + 2 * Math.max(0.05, inputData.value / inputData.maxValue) * completeAngle
Copy link
Contributor

Choose a reason for hiding this comment

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

.05 feels high here, how does it look? It's showing a 5% fill in the empty case - I was thinking a 1% fill would be sufficient.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

0.01
Screen Shot 2021-01-11 at 9 56 20 PM

0.02
Screen Shot 2021-01-11 at 9 58 24 PM

0.05
Screen Shot 2021-01-11 at 9 56 42 PM

Copy link
Contributor Author

@skjindal93 skjindal93 Jan 11, 2021

Choose a reason for hiding this comment

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

0.05 looks high, as you said. Looks like a real +ve value.

0.02 seems to look good as compared to 0.01

@github-actions

This comment has been minimized.

@anandtiwary
Copy link
Contributor

Anything more needed on this PR? For max risk score, the gauge would not appear full. This seems like an important bug

@aaron-steinfeld
Copy link
Contributor

Anything more needed on this PR? For max risk score, the gauge would not appear full. This seems like an important bug

yes we should fix. I think the consensus was no nub, right @jake-bassett ?

@skjindal93
Copy link
Contributor Author

Anything more needed on this PR? For max risk score, the gauge would not appear full. This seems like an important bug

yes we should fix. I think the consensus was no nub, right @jake-bassett ?

got rid of the nib computation

@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.

@anandtiwary anandtiwary merged commit bba15af into main Jan 22, 2021
@anandtiwary anandtiwary deleted the fix+value+angle branch January 22, 2021 22:44
@github-actions
Copy link

Unit Test Results

    4 files  ±0  232 suites  ±0   12m 35s ⏱️ +3s
818 tests ±0  818 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
822 runs  ±0  822 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit bba15af. ± Comparison against base commit 8dc4b72.

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