-
Notifications
You must be signed in to change notification settings - Fork 122
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
feat(scales): add LinearBinary
scale type
#1389
Conversation
packages/charts/src/chart_types/xy_chart/utils/get_binary_ticks.ts
Outdated
Show resolved
Hide resolved
LinearBinary
scale type
9e6104f
to
97203e8
Compare
packages/charts/src/chart_types/xy_chart/utils/get_linear_ticks.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
# [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)
🎉 This PR is included in version 38.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
This PR adds
LienarBinary
toScaleType
s. This scale type functions exactly likeLinear
with the exception of ticks which are computed in a base 2 rather than base 10.Details
Overrides
ticks
andnice
methods for linear scales inpackages/charts/src/scales/scale_continuous.ts
. This is a temporary work around until changes are added tod3-array
andd3-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