fix(rendering): fix rendering values <= 0 on log scale#114
fix(rendering): fix rendering values <= 0 on log scale#114markov00 merged 3 commits intoelastic:masterfrom
Conversation
instead of throwing errors or warnings, if the user is using a log scale with a dataset with 0 values, we will hide them on the rendering of line and area charts. This fix also the defined area of the chart fix elastic#112, fix elastic#63
Codecov Report
@@ Coverage Diff @@
## master #114 +/- ##
==========================================
+ Coverage 90.17% 91.09% +0.91%
==========================================
Files 31 31
Lines 1405 1460 +55
Branches 150 163 +13
==========================================
+ Hits 1267 1330 +63
+ Misses 125 116 -9
- Partials 13 14 +1
Continue to review full report at Codecov.
|
emmacunningham
left a comment
There was a problem hiding this comment.
Tested locally on Firefox. Code LGTM just one small comment but non-blocking.
src/lib/series/rendering.ts
Outdated
| areaGeometry: AreaGeometry; | ||
| indexedGeometries: Map<any, IndexedGeometry[]>; | ||
| } { | ||
| const isLogScale = yScale.type === ScaleType.Log; |
There was a problem hiding this comment.
Since this logic is repeated in a few places, could create a helper function isLogScale(type: ScaleType) to ensure consistency.
There was a problem hiding this comment.
resolved in 790d5f7
currently passing a Scale object instead of a type as it's done for the isContinuousScale or isOrdinalScale
|
🎉 This PR is included in version 3.4.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [3.4.2](elastic/elastic-charts@v3.4.1...v3.4.2) (2019-03-26) ### Bug Fixes * **rendering:** fix rendering values <= 0 on log scale ([opensearch-project#114](elastic/elastic-charts#114)) ([2b79877](elastic/elastic-charts@2b79877)), closes [opensearch-project#112](elastic/elastic-charts#112) [opensearch-project#63](elastic/elastic-charts#63)
Summary
Instead of throwing errors or warnings, if the user is using a log scale with a dataset with 0
values, we will hide them on the rendering of line and area charts.
This fix also the defined area of a line/area chart: if the y value is null, the area/line is depicted with an empty space between the previous non null value and the following one.
fix #112, fix #63
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.