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

fix(chart): set y domain appropriately #61

Merged
merged 1 commit into from
Jul 29, 2019

Conversation

priley86
Copy link
Contributor

@priley86 priley86 commented Jul 26, 2019

What's included

Set the y-domain according the max y value in the input data...

Related Victory issues:
FormidableLabs/victory#883
https://github.com/FormidableLabs/victory-docs/pull/559/files

How to test

Targets a current edge case where all y values are the same causing the issue noted in Victory charts.

Example data which found this edge case:

{
   "data":[
      {
         "date":"2019-07-25T18:00:09.56Z",
         "instance_count":0,
         "cores":0,
         "sockets":0
      },
      {
         "date":"2019-07-26T00:00:00.696Z",
         "instance_count":0,
         "cores":0,
         "sockets":0
      }
   ],
   "links":{
      "first":"/api/rhsm-subscriptions/v1/tally/products/RHEL?granularity=daily&beginning=2019-06-26T00:00:00.000Z&ending=2019-07-26T23:59:59.999Z&offset=0",
      "last":"/api/rhsm-subscriptions/v1/tally/products/RHEL?granularity=daily&beginning=2019-06-26T00:00:00.000Z&ending=2019-07-26T23:59:59.999Z&offset=0"
   },
   "meta":{
      "count":2,
      "product":"RHEL",
      "granularity":"daily"
   }
}

Coverage and basic unit test check

  1. update the NPM packages with $ yarn
  2. $ yarn test

Interactive unit test check

  1. update the NPM packages with $ yarn
  2. $ yarn test:dev
    -->
  3. $ yarn test:dev

Example

...

Updates issue/story

Closes #60

@codecov-io
Copy link

Codecov Report

Merging #61 into master will increase coverage by 0.31%.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #61      +/-   ##
=======================================
+ Coverage   86.68%   87%   +0.31%     
=======================================
  Files          23    23              
  Lines         293   300       +7     
  Branches       60    62       +2     
=======================================
+ Hits          254   261       +7     
  Misses         31    31              
  Partials        8     8
Impacted Files Coverage Δ
src/common/graphHelpers.js 98.64% <100%> (+0.14%) ⬆️

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 9828e6a...3a54b4d. Read the comment docs.

Copy link
Member

@cdcabrera cdcabrera left a comment

Choose a reason for hiding this comment

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

Looks good, reviewed some adjustments to the helper, namely

  • removed the switch and
  • relaxed/removed the linting rule that preferred the shorthand syntax of Math.pow

priley86 added a commit to priley86/subscriptions-insights-frontend that referenced this pull request Jul 29, 2019
@cdcabrera cdcabrera merged commit 6402585 into RedHatInsights:master Jul 29, 2019
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.

Graph display needs a Y axis minimum
3 participants