feat(scales): add LinearBinary scale type#1389
Merged
nickofthyme merged 6 commits intoelastic:masterfrom Oct 6, 2021
Merged
Conversation
nickofthyme
commented
Sep 20, 2021
packages/charts/src/chart_types/xy_chart/utils/get_binary_ticks.ts
Outdated
Show resolved
Hide resolved
LinearBinary scale type
9e6104f to
97203e8
Compare
monfera
reviewed
Sep 29, 2021
monfera
reviewed
Sep 29, 2021
monfera
reviewed
Sep 30, 2021
packages/charts/src/chart_types/xy_chart/utils/get_linear_ticks.ts
Outdated
Show resolved
Hide resolved
monfera
reviewed
Oct 1, 2021
monfera
approved these changes
Oct 1, 2021
Contributor
monfera
left a comment
There was a problem hiding this comment.
LGTM!
Would still like to farm out our copy of D3 derived code so our license is consistent in charts/ or at least charts/src @markov00 seeking your input to this too
I see this PR exercises an ability for Charts to ingest strings for numbers, it's not this PR's making though
Minor code comments inside
4d298a1 to
4ef1b49
Compare
markov00
reviewed
Oct 6, 2021
Collaborator
markov00
left a comment
There was a problem hiding this comment.
LGTM I tested it locally, reducing the size of the ticks and applying a brutal byte formatter and it works correctly.
I'm not sure what cause the VRT failure visible on the CI
nickofthyme
pushed a commit
that referenced
this pull request
Oct 15, 2021
# [38.0.0](v37.0.0...v38.0.0) (2021-10-15) ### Bug Fixes * **deps:** update dependency @elastic/eui to v39 ([#1422](#1422)) ([2ee97aa](2ee97aa)) * **goal:** reduce whitespace for circular charts ([#1413](#1413)) ([6517523](6517523)) * **interactions:** change allowBrushingLastHistogramBin to true ([#1396](#1396)) ([9fa9783](9fa9783)) * **xy:** remove wrongly represented null/missing values in tooltip ([#1415](#1415)) ([e5963a3](e5963a3)), closes [#1414](#1414) ### Code Refactoring * scales ([#1410](#1410)) ([a53a2ba](a53a2ba)) ### Features * **scales:** add `LinearBinary` scale type ([#1389](#1389)) ([9f2e427](9f2e427)) * **xy:** adaptive tick raster ([#1420](#1420)) ([200577b](200577b)) * **xy:** apply the data value formatter to data values over bars ([#1419](#1419)) ([e673fc7](e673fc7)) ### BREAKING CHANGES * **interactions:** allowBrushingLastHistogramBucket renamed to allowBrushingLastHistogramBin on the Settings component defaults true and is only applied for histogram type charts * LogScaleOptions.logBase` is now a `number` instead of the object enum `LogBase`. Some edge case data or configuration _might_, with a deemed low likelihood, lead to a situation where the earlier version would have silently not rendered a bar, line or point, while the new code doesn't `catch`, therefore throw an exception (see the last item). General risk of regressions due to the quantity of code changes (altogether 3.5k)
Collaborator
Author
|
🎉 This PR is included in version 38.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds
LienarBinarytoScaleTypes. This scale type functions exactly likeLinearwith the exception of ticks which are computed in a base 2 rather than base 10.Details
Overrides
ticksandnicemethods for linear scales inpackages/charts/src/scales/scale_continuous.ts. This is a temporary work around until changes are added tod3-arrayandd3-scale.See example story here, once deployed.
Issues
This completes a missing feature requested by the Lens team regarding binary ticks
closes #1395
Related to elastic/kibana#97100, elastic/kibana#7539
Checklist
:xy,:partition):interactions,:axis)closes #123,fixes #123)packages/charts/src/index.ts