Skip to content

fix(rendering): fix rendering values <= 0 on log scale#114

Merged
markov00 merged 3 commits intoelastic:masterfrom
markov00:fix-log-rendering
Mar 26, 2019
Merged

fix(rendering): fix rendering values <= 0 on log scale#114
markov00 merged 3 commits intoelastic:masterfrom
markov00:fix-log-rendering

Conversation

@markov00
Copy link
Copy Markdown
Collaborator

@markov00 markov00 commented Mar 22, 2019

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.

Screenshot 2019-03-22 at 19 38 28

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 strikethroughs to remove checklist items you don't feel are applicable to this PR.

  • This was checked for cross-browser compatibility, including a check against IE11
  • Proper documentation or storybook story was added for features that require explanation or tutorials
  • Unit tests were updated or added to match the most common scenarios
  • Each commit follows the convention

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
@markov00 markov00 added the :data Data/series/scales related issue label Mar 22, 2019
@markov00 markov00 requested a review from emmacunningham March 22, 2019 18:41
@markov00 markov00 mentioned this pull request Mar 22, 2019
93 tasks
@codecov-io
Copy link
Copy Markdown

codecov-io commented Mar 22, 2019

Codecov Report

Merging #114 into master will increase coverage by 0.91%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/lib/series/rendering.ts 82.66% <100%> (+13.31%) ⬆️
src/lib/utils/scales/scale_continuous.ts 89.04% <100%> (+0.3%) ⬆️
src/lib/series/specs.ts 100% <0%> (ø) ⬆️
src/lib/series/domains/y_domain.ts 100% <0%> (ø) ⬆️
src/lib/series/domains/x_domain.ts 100% <0%> (ø) ⬆️
src/lib/axes/axis_utils.ts 100% <0%> (ø) ⬆️
src/state/chart_state.ts 95.53% <0%> (+0.1%) ⬆️
src/lib/series/series.ts 94.53% <0%> (+1.56%) ⬆️

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 d498484...25ee308. Read the comment docs.

@markov00 markov00 added the bug Something isn't working label Mar 22, 2019
Copy link
Copy Markdown
Contributor

@emmacunningham emmacunningham left a comment

Choose a reason for hiding this comment

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

Tested locally on Firefox. Code LGTM just one small comment but non-blocking.

areaGeometry: AreaGeometry;
indexedGeometries: Map<any, IndexedGeometry[]>;
} {
const isLogScale = yScale.type === ScaleType.Log;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since this logic is repeated in a few places, could create a helper function isLogScale(type: ScaleType) to ensure consistency.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

resolved in 790d5f7
currently passing a Scale object instead of a type as it's done for the isContinuousScale or isOrdinalScale

@markov00 markov00 merged commit 9d7b159 into elastic:master Mar 26, 2019
@markov00 markov00 added this to the 7.1 milestone Mar 26, 2019
markov00 pushed a commit that referenced this pull request Mar 26, 2019
## [3.4.2](v3.4.1...v3.4.2) (2019-03-26)

### Bug Fixes

* **rendering:** fix rendering values <= 0 on log scale ([#114](#114)) ([9d7b159](9d7b159)), closes [#112](#112) [#63](#63)
@markov00
Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 3.4.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Mar 26, 2019
@markov00 markov00 removed this from the 7.1 milestone Apr 1, 2019
@markov00 markov00 deleted the fix-log-rendering branch April 16, 2019 12:07
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this pull request Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working :data Data/series/scales related issue released Issue released publicly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LineSeries throw warnings when using ScaleType.Log Display orphan data points on line/area series

3 participants