forked from opensearch-project/OpenSearch-Dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(axis): log scale limit and base options (#1032)
- Set base of log scales to 10, 2 or e (`Common`, `Binary` or `Natural`), via `domain.logBase` and `xDomain.logBase` - Set custom min limit of log values, previously hardcoded to 1, via `domain.logMinLimit` - Allow domain to fit full domain of dataset, without crossing 0 via `domain.fit` option
- Loading branch information
1 parent
36bc058
commit 11f94c6
Showing
92 changed files
with
799 additions
and
270 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Binary file removed
BIN
-25.7 KB
...ll-stories-bar-chart-change-series-sort-order-visually-looks-correct-1-snap.png
Binary file not shown.
Binary file removed
BIN
-11.8 KB
...-stories-bar-chart-stacked-only-grouped-areas-visually-looks-correct-1-snap.png
Binary file not shown.
Binary file added
BIN
+20.8 KB
...ests-for-all-stories-scales-log-scale-options-visually-looks-correct-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-26.4 KB
...stories-small-multiples-alpha-horizontal-bars-visually-looks-correct-2-snap.png
Binary file not shown.
Binary file modified
BIN
+112 Bytes
(100%)
...l-stories-stylings-custom-series-styles-lines-visually-looks-correct-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
...or-all-stories-sunburst-high-number-of-slices-visually-looks-correct-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+30.2 KB
...og-areas-shows-only-positive-domain-mixed-polarity-domain-with-limit-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file removed
BIN
-31.2 KB
...ries-stories-negative-log-areas-snows-negative-values-with-log-scale-1-snap.png
Binary file not shown.
Binary file removed
BIN
-25.2 KB
...gative-log-areas-snows-only-positive-values-when-hiding-negative-one-1-snap.png
Binary file not shown.
Binary file removed
BIN
-25.5 KB
...ion/tests/__image_snapshots__/fake-test-ts-stacked-as-not-percentage-1-snap.png
Binary file not shown.
Binary file modified
BIN
+10 Bytes
(100%)
...er-over-specific-bars-rotation-0-shows-tooltip-on-last-bar-group-top-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3 Bytes
(100%)
...l-chart-rotation-0-placement-bottom-shows-tooltip-in-top-left-corner-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+9 Bytes
(100%)
...-chart-rotation-0-placement-bottom-shows-tooltip-in-top-right-corner-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1 Byte
(100%)
...l-chart-rotation-0-placement-top-shows-tooltip-in-bottom-left-corner-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+9 Bytes
(100%)
...-chart-rotation-0-placement-top-shows-tooltip-in-bottom-right-corner-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+2 Bytes
(100%)
...chart-rotation-180-placement-bottom-shows-tooltip-in-top-left-corner-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+10 Bytes
(100%)
...hart-rotation-180-placement-bottom-shows-tooltip-in-top-right-corner-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4 Bytes
(100%)
...chart-rotation-180-placement-top-shows-tooltip-in-bottom-left-corner-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+11 Bytes
(100%)
...hart-rotation-180-placement-top-shows-tooltip-in-bottom-right-corner-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3 Bytes
(100%)
...ult-rotation-0-placement-bottom-shows-tooltip-in-bottom-right-corner-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3 Bytes
(100%)
...default-rotation-0-placement-bottom-shows-tooltip-in-top-left-corner-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+9 Bytes
(100%)
...efault-rotation-0-placement-bottom-shows-tooltip-in-top-right-corner-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1 Byte
(100%)
...efault-rotation-0-placement-left-shows-tooltip-in-bottom-left-corner-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
...l-default-rotation-0-placement-left-shows-tooltip-in-top-left-corner-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+3 Bytes
(100%)
...ault-rotation-0-placement-right-shows-tooltip-in-bottom-right-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+10 Bytes
(100%)
...default-rotation-0-placement-right-shows-tooltip-in-top-right-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+1 Byte
(100%)
...default-rotation-0-placement-top-shows-tooltip-in-bottom-left-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+9 Bytes
(100%)
...efault-rotation-0-placement-top-shows-tooltip-in-bottom-right-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
...el-default-rotation-0-placement-top-shows-tooltip-in-top-left-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
...l-default-rotation-0-placement-top-shows-tooltip-in-top-right-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+14 Bytes
(100%)
...t-rotation-180-placement-bottom-shows-tooltip-in-bottom-right-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+2 Bytes
(100%)
...fault-rotation-180-placement-bottom-shows-tooltip-in-top-left-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+10 Bytes
(100%)
...ault-rotation-180-placement-bottom-shows-tooltip-in-top-right-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+1 Byte
(100%)
...ault-rotation-180-placement-left-shows-tooltip-in-bottom-left-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+1 Byte
(100%)
...default-rotation-180-placement-left-shows-tooltip-in-top-left-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+14 Bytes
(100%)
...lt-rotation-180-placement-right-shows-tooltip-in-bottom-right-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+5 Bytes
(100%)
...fault-rotation-180-placement-right-shows-tooltip-in-top-right-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
-4 Bytes
(100%)
...fault-rotation-180-placement-top-shows-tooltip-in-bottom-left-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+11 Bytes
(100%)
...ault-rotation-180-placement-top-shows-tooltip-in-bottom-right-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+2 Bytes
(100%)
...-default-rotation-180-placement-top-shows-tooltip-in-top-left-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+4 Bytes
(100%)
...default-rotation-180-placement-top-shows-tooltip-in-top-right-corner-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+13 Bytes
(100%)
...eractions-test-ts-interactions-tooltips-should-render-custom-tooltip-1-snap.png
Oops, something went wrong.
Binary file modified
BIN
+1 Byte
(100%)
...es-test-ts-legend-stories-should-render-legend-action-on-mouse-hover-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+17.2 KB
...-stories-negative-values-should-render-proper-ticks-with-binary-base-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+25.4 KB
...-stories-negative-values-should-render-proper-ticks-with-common-base-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+17.2 KB
...stories-negative-values-should-render-proper-ticks-with-natural-base-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+22.8 KB
...s-scales-stories-negative-values-should-render-values-with-log-limit-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+21.8 KB
...negative-values-should-render-with-baseline-set-to-1-if-fit-is-false-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+21.8 KB
...hould-render-with-baseline-set-to-1-if-fit-is-false-and-limit-is-set-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+17.1 KB
...-stories-positive-values-should-render-proper-ticks-with-binary-base-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+25.3 KB
...-stories-positive-values-should-render-proper-ticks-with-common-base-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+17.2 KB
...stories-positive-values-should-render-proper-ticks-with-natural-base-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+22.6 KB
...s-scales-stories-positive-values-should-render-values-with-log-limit-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+20.8 KB
...positive-values-should-render-with-baseline-set-to-1-if-fit-is-false-1-snap.png
Oops, something went wrong.
Binary file added
BIN
+20.8 KB
...hould-render-with-baseline-set-to-1-if-fit-is-false-and-limit-is-set-1-snap.png
Oops, something went wrong.
This file contains 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
53 changes: 53 additions & 0 deletions
53
packages/osd-charts/integration/tests/scales_stories.test.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { LogBase } from '../../src/scales/scale_continuous'; | ||
import { common } from '../page_objects'; | ||
|
||
describe('Scales stories', () => { | ||
describe.each` | ||
polarity | value | ||
${'Negative'} | ${true} | ||
${'Positive'} | ${false} | ||
`('$polarity values', ({ value: negative }) => { | ||
it.each(Object.values(LogBase))('should render proper ticks with %s base', async (base) => { | ||
await common.expectChartAtUrlToMatchScreenshot( | ||
`http://localhost:9001/?path=/story/scales--log-scale-options&knob-Use negative values_Y - Axis=${negative}&knob-Log base_Y - Axis=${base}&knob-Fit domain_Y - Axis=true&knob-Use default limit_Y - Axis=true`, | ||
); | ||
}); | ||
|
||
it('should render with baseline set to 1 if fit is false', async () => { | ||
await common.expectChartAtUrlToMatchScreenshot( | ||
`http://localhost:9001/?path=/story/scales--log-scale-options&knob-Use negative values_Y - Axis=${negative}&knob-Log base_Y - Axis=common&knob-Fit domain_Y - Axis=false&knob-Use default limit_Y - Axis=true`, | ||
); | ||
}); | ||
|
||
it('should render with baseline set to 1 if fit is false and limit is set', async () => { | ||
await common.expectChartAtUrlToMatchScreenshot( | ||
`http://localhost:9001/?path=/story/scales--log-scale-options&knob-Use negative values_Y - Axis=${negative}&knob-Log base_Y - Axis=common&knob-Fit domain_Y - Axis=false&knob-Use default limit_Y - Axis=true&knob-Log min limit_Y - Axis=0.01`, | ||
); | ||
}); | ||
|
||
it('should render values with log limit', async () => { | ||
await common.expectChartAtUrlToMatchScreenshot( | ||
`http://localhost:9001/?path=/story/scales--log-scale-options&knob-Use negative values_Y - Axis=${negative}&knob-Log base_Y - Axis=common&knob-Fit domain_Y - Axis=true&knob-Log min limit_Y - Axis=0.01&knob-Use default limit_Y - Axis=false`, | ||
); | ||
}); | ||
}); | ||
}); |
This file contains 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
Oops, something went wrong.