diff --git a/.storybook/config.ts b/.storybook/config.ts index 7c9169fd03..064a6e387b 100644 --- a/.storybook/config.ts +++ b/.storybook/config.ts @@ -40,20 +40,4 @@ addParameters({ addDecorator(withKnobs); addDecorator(withInfo); -function loadStories() { - require('../stories/bar_chart.tsx'); - require('../stories/line_chart.tsx'); - require('../stories/area_chart.tsx'); - require('../stories/axis.tsx'); - require('../stories/mixed.tsx'); - require('../stories/legend.tsx'); - require('../stories/interactions.tsx'); - require('../stories/rotations.tsx'); - require('../stories/styling.tsx'); - require('../stories/grid.tsx'); - require('../stories/annotations.tsx'); - require('../stories/scales.tsx'); - return [require('../stories/sunburst.tsx'), require('../stories/treemap.tsx')]; -} - -configure(loadStories, module); +configure(require.context('../stories', true, /\.tsx$/), module); diff --git a/integration/helpers.ts b/integration/helpers.ts index f2d21b2f8c..4518afb932 100644 --- a/integration/helpers.ts +++ b/integration/helpers.ts @@ -1,6 +1,6 @@ -import { join } from 'path'; -import { readdirSync } from 'fs'; -import { getStorybook } from '@storybook/react'; +import { join, resolve } from 'path'; +import { lstatSync, readdirSync } from 'fs'; +import { getStorybook, configure } from '@storybook/react'; export interface StoryInfo { title: string; @@ -13,12 +13,33 @@ export interface StoryGroupInfo { stories: StoryInfo[]; } -function requireAllStories() { - const normalizedPath = join(__dirname, '../stories'); +function requireAllStories(basedir: string, directory: string) { + function enumerateFiles(basedir: string, dir: string) { + let result: string[] = []; + readdirSync(join(basedir, dir)).forEach(function(file) { + const relativePath = join(dir, file); + const stats = lstatSync(join(basedir, relativePath)); + if (stats.isDirectory()) { + result = result.concat(enumerateFiles(basedir, relativePath)); + } else if (/\.tsx$/.test(relativePath)) { + result.push(relativePath); + } + }); + return result; + } + const absoluteDirectory = resolve(basedir, directory); + + const keys = enumerateFiles(absoluteDirectory, '.'); + function requireContext(key: string) { + if (!keys.includes(key)) { + throw new Error(`Cannot find module '${key}'`); + } + const fullKey = require('path').resolve(absoluteDirectory, key); + return require(fullKey); + } - readdirSync(normalizedPath).forEach((file) => { - require(join(normalizedPath, file)); - }); + requireContext.keys = () => keys; + return requireContext; } function encodeString(string: string) { @@ -34,8 +55,7 @@ function encodeString(string: string) { } export function getStorybookInfo(): StoryGroupInfo[] { - requireAllStories(); - + configure(requireAllStories(__dirname, '../stories'), module); return getStorybook() .filter(({ kind }) => kind) .map(({ kind: group, stories: storiesRaw }) => { diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-basic-x-domain-continous-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-basic-x-domain-continous-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..30d41a68b8 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-basic-x-domain-continous-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-basic-x-domain-continuous-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-basic-x-domain-continuous-visually-looks-correct-1-snap.png deleted file mode 100644 index 6e742b2031..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-basic-x-domain-continuous-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-basic-x-domain-ordinal-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-basic-x-domain-ordinal-visually-looks-correct-1-snap.png index 77fc88dcbb..b68718fdc6 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-basic-x-domain-ordinal-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-basic-x-domain-ordinal-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-basic-y-domain-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-basic-y-domain-visually-looks-correct-1-snap.png index 1900fbd86d..b05fdfbc33 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-basic-y-domain-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-basic-y-domain-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-styling-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-styling-visually-looks-correct-1-snap.png index d51c93ec79..b0dea47aae 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-styling-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-styling-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-time-series-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-time-series-visually-looks-correct-1-snap.png index 4cf21bdffb..3bf690a1dc 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-time-series-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-line-time-series-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-basic-annotation-line-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-basic-annotation-line-visually-looks-correct-1-snap.png index 2ecde90990..6446828588 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-basic-annotation-line-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-basic-annotation-line-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-basic-annotation-linear-bar-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-basic-annotation-linear-bar-visually-looks-correct-1-snap.png index 51c8bf0721..63da9acf86 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-basic-annotation-linear-bar-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-basic-annotation-linear-bar-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-basic-annotation-ordinal-bar-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-basic-annotation-ordinal-bar-visually-looks-correct-1-snap.png index b2e7df5654..3a79d31379 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-basic-annotation-ordinal-bar-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-basic-annotation-ordinal-bar-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-styling-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-styling-visually-looks-correct-1-snap.png index fa975e3e3a..e5cdc25fc1 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-styling-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-styling-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-tooltip-visibility-dependent-on-content-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-tooltip-visibility-dependent-on-content-visually-looks-correct-1-snap.png deleted file mode 100644 index 51c8bf0721..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-tooltip-visibility-dependent-on-content-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-tooltip-visilibity-dependent-on-content-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-tooltip-visilibity-dependent-on-content-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..63da9acf86 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-annotations-rect-tooltip-visilibity-dependent-on-content-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-area-chart-band-area-chart-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-area-chart-band-area-chart-visually-looks-correct-1-snap.png index 33487e22b9..8587b2c98d 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-area-chart-band-area-chart-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-area-chart-band-area-chart-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-4-axes-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-axis-4-axes-visually-looks-correct-1-snap.png similarity index 100% rename from integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-4-axes-visually-looks-correct-1-snap.png rename to integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-axis-4-axes-visually-looks-correct-1-snap.png diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-customizing-domain-limits-mixed-linear-chart-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-customizing-domain-limits-mixed-linear-chart-visually-looks-correct-1-snap.png deleted file mode 100644 index e5d222a7cb..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-customizing-domain-limits-mixed-linear-chart-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-customizing-domain-limits-mixed-ordinal-linear-x-domain-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-customizing-domain-limits-mixed-ordinal-linear-x-domain-visually-looks-correct-1-snap.png index d9bf398224..c1ca15b013 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-customizing-domain-limits-mixed-ordinal-linear-x-domain-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-customizing-domain-limits-mixed-ordinal-linear-x-domain-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-customizing-domain-limits-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-customizing-domain-limits-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..dcc0d05c85 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-customizing-domain-limits-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-with-multi-axis-bar-lines-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-with-multi-axis-bar-lines-visually-looks-correct-1-snap.png index 9936ef26a5..4c2c250071 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-with-multi-axis-bar-lines-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-with-multi-axis-bar-lines-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-with-multi-axis-different-tooltip-formats-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-with-multi-axis-different-tooltip-formats-visually-looks-correct-1-snap.png index 12be3f8931..13953a971e 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-with-multi-axis-different-tooltip-formats-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-axis-with-multi-axis-different-tooltip-formats-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-band-bar-chart-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-band-bar-chart-visually-looks-correct-1-snap.png index 37774fa826..18f1507e5b 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-band-bar-chart-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-band-bar-chart-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-1-y-0-g-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-bar-chart-1-y-0-g-visually-looks-correct-1-snap.png similarity index 100% rename from integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-1-y-0-g-visually-looks-correct-1-snap.png rename to integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-bar-chart-1-y-0-g-visually-looks-correct-1-snap.png diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-1-y-1-g-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-bar-chart-1-y-1-g-visually-looks-correct-1-snap.png similarity index 100% rename from integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-1-y-1-g-visually-looks-correct-1-snap.png rename to integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-bar-chart-1-y-1-g-visually-looks-correct-1-snap.png diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-1-y-2-g-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-bar-chart-1-y-2-g-visually-looks-correct-1-snap.png similarity index 100% rename from integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-1-y-2-g-visually-looks-correct-1-snap.png rename to integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-bar-chart-1-y-2-g-visually-looks-correct-1-snap.png diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-2-y-0-g-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-bar-chart-2-y-0-g-visually-looks-correct-1-snap.png similarity index 100% rename from integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-2-y-0-g-visually-looks-correct-1-snap.png rename to integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-bar-chart-2-y-0-g-visually-looks-correct-1-snap.png diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-2-y-1-g-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-bar-chart-2-y-1-g-visually-looks-correct-1-snap.png similarity index 100% rename from integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-2-y-1-g-visually-looks-correct-1-snap.png rename to integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-bar-chart-2-y-1-g-visually-looks-correct-1-snap.png diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-2-y-2-g-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-bar-chart-2-y-2-g-visually-looks-correct-1-snap.png similarity index 100% rename from integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-2-y-2-g-visually-looks-correct-1-snap.png rename to integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-bar-chart-2-y-2-g-visually-looks-correct-1-snap.png diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-negative-and-positive-x-values-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-negative-and-positive-x-values-visually-looks-correct-1-snap.png index 9fd6162e1f..e09052af24 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-negative-and-positive-x-values-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-negative-and-positive-x-values-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-single-data-stacked-chart-scale-to-extent-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-singldedatachartstackedtoextent-visually-looks-correct-1-snap.png similarity index 100% rename from integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-single-data-stacked-chart-scale-to-extent-visually-looks-correct-1-snap.png rename to integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-singldedatachartstackedtoextent-visually-looks-correct-1-snap.png diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-single-data-clusterd-chart-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-single-data-clustered-chart-visually-looks-correct-1-snap.png similarity index 100% rename from integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-single-data-clusterd-chart-visually-looks-correct-1-snap.png rename to integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-single-data-clustered-chart-visually-looks-correct-1-snap.png diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-stacked-as-percentage-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-stacked-as-percentage-visually-looks-correct-1-snap.png index 23dd52d6f1..2e490867d8 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-stacked-as-percentage-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-stacked-as-percentage-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-test-histogram-mode-linear-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-test-histogram-mode-linear-visually-looks-correct-1-snap.png index 3bb2847a93..2e045a44d3 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-test-histogram-mode-linear-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-test-histogram-mode-linear-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-test-linear-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-test-linear-visually-looks-correct-1-snap.png index 705a341665..2c44a0ff20 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-test-linear-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-test-linear-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-test-stacked-bar-chart-with-null-bars-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-test-stacked-bar-chart-with-null-bars-visually-looks-correct-1-snap.png index b67ead4215..1de0fbf8b1 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-test-stacked-bar-chart-with-null-bars-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-test-stacked-bar-chart-with-null-bars-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-test-switch-ordinal-linear-x-axis-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-test-switch-ordinal-linear-axis-visually-looks-correct-1-snap.png similarity index 100% rename from integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-test-switch-ordinal-linear-x-axis-visually-looks-correct-1-snap.png rename to integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-test-switch-ordinal-linear-axis-visually-looks-correct-1-snap.png diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-with-linear-x-axis-no-linear-interval-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-with-linear-x-axis-no-linear-interval-visually-looks-correct-1-snap.png index 27f2e68d53..9629bdef97 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-with-linear-x-axis-no-linear-interval-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-with-linear-x-axis-no-linear-interval-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-with-log-y-axis-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-with-log-y-axis-visually-looks-correct-1-snap.png index 13ea096642..e3d8a1b022 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-with-log-y-axis-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-bar-chart-with-log-y-axis-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-grids-basic-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-grids-basic-visually-looks-correct-1-snap.png index 8452dab797..ab1256b808 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-grids-basic-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-grids-basic-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-grids-multiple-axes-with-the-same-position-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-grids-multiple-axes-with-the-same-position-visually-looks-correct-1-snap.png index a30017dede..53277a35ec 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-grids-multiple-axes-with-the-same-position-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-grids-multiple-axes-with-the-same-position-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-brush-disabled-on-ordinal-x-axis-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-brush-disabled-on-ordinal-x-axis-visually-looks-correct-1-snap.png index 485665b62f..d2fb33c56b 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-brush-disabled-on-ordinal-x-axis-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-brush-disabled-on-ordinal-x-axis-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-brush-selection-tool-on-time-charts-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-brush-selection-tool-on-time-charts-visually-looks-correct-1-snap.png index 0f0e3426a0..5fbbb5dd62 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-brush-selection-tool-on-time-charts-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-brush-selection-tool-on-time-charts-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-click-hovers-on-legend-items-line-chart-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-click-hovers-on-legend-items-line-chart-visually-looks-correct-1-snap.png index 2bae67388a..71d13106ff 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-click-hovers-on-legend-items-line-chart-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-click-hovers-on-legend-items-line-chart-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-click-hovers-on-legend-items-mixed-chart-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-click-hovers-on-legend-items-mixed-chart-visually-looks-correct-1-snap.png index cb140da6d3..b2ca02b872 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-click-hovers-on-legend-items-mixed-chart-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-click-hovers-on-legend-items-mixed-chart-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-click-hovers-on-legend-items-bar-chart-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-clicks-hovers-on-legend-items-bar-chart-visually-looks-correct-1-snap.png similarity index 100% rename from integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-click-hovers-on-legend-items-bar-chart-visually-looks-correct-1-snap.png rename to integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-clicks-hovers-on-legend-items-bar-chart-visually-looks-correct-1-snap.png diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-crosshair-with-time-axis-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-crosshair-with-time-axis-visually-looks-correct-1-snap.png index 0d33c369ce..f931337614 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-crosshair-with-time-axis-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-crosshair-with-time-axis-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-line-area-bar-point-clicks-and-hovers-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-line-area-bar-point-clicks-and-hovers-visually-looks-correct-1-snap.png index 724c199905..3a64c4e46e 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-line-area-bar-point-clicks-and-hovers-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-line-area-bar-point-clicks-and-hovers-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-line-point-clicks-and-hovers-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-line-point-clicks-and-hovers-visually-looks-correct-1-snap.png index e850a8819b..7fb578073e 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-line-point-clicks-and-hovers-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-interactions-line-point-clicks-and-hovers-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-bottom-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-bottom-visually-looks-correct-1-snap.png index 859c4c54c1..b6feb34a8c 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-bottom-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-bottom-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-changing-specs-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-changing-specs-visually-looks-correct-1-snap.png index 99ee347ae2..e35c985c44 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-changing-specs-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-changing-specs-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-hide-legend-items-by-series-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-hide-legend-items-by-series-visually-looks-correct-1-snap.png index cb140da6d3..b2ca02b872 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-hide-legend-items-by-series-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-hide-legend-items-by-series-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-top-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-top-visually-looks-correct-1-snap.png index 99ee347ae2..e35c985c44 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-top-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-legend-top-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-basic-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-basic-visually-looks-correct-1-snap.png index e4a8aa795c..73db83eff7 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-basic-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-basic-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-curved-w-axis-and-legend-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-curved-w-axis-and-legend-visually-looks-correct-1-snap.png deleted file mode 100644 index 9a86b8cf20..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-curved-w-axis-and-legend-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-curvedwaxisandlegend-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-curvedwaxisandlegend-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..c414c5344e Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-curvedwaxisandlegend-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-linear-w-axis-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-linear-w-axis-visually-looks-correct-1-snap.png index cd202bd171..d29071149e 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-linear-w-axis-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-linear-w-axis-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-multi-series-with-log-values-limit-0-or-negative-values-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-multi-series-with-log-values-limit-0-or-negative-values-visually-looks-correct-1-snap.png deleted file mode 100644 index 8b9569bb67..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-multi-series-with-log-values-limit-0-or-negative-values-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-multiple-w-axis-and-legend-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-multiple-w-axis-and-legend-visually-looks-correct-1-snap.png deleted file mode 100644 index 181d63dafc..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-multiple-w-axis-and-legend-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-multiplewaxisandlegend-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-multiplewaxisandlegend-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..9671b37fe2 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-multiplewaxisandlegend-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-multiserieswithlogvalues-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-multiserieswithlogvalues-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..9cf302557f Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-multiserieswithlogvalues-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-ordinal-w-axis-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-ordinal-w-axis-visually-looks-correct-1-snap.png index 638f08ccde..8a5bd6c562 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-ordinal-w-axis-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-ordinal-w-axis-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-stacked-w-axis-and-legend-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-stacked-w-axis-and-legend-visually-looks-correct-1-snap.png deleted file mode 100644 index 383a6f826e..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-stacked-w-axis-and-legend-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-stackedwaxisandlegend-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-stackedwaxisandlegend-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..a097dd9c81 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-stackedwaxisandlegend-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-w-axis-and-legend-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-w-axis-and-legend-visually-looks-correct-1-snap.png index bea9f66473..09337c35a0 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-w-axis-and-legend-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-w-axis-and-legend-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-w-axis-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-w-axis-visually-looks-correct-1-snap.png index a109d19bb1..d5cb2f40d0 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-w-axis-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-line-chart-w-axis-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-bar-and-lines-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-bar-and-lines-visually-looks-correct-1-snap.png deleted file mode 100644 index a88ac9cd57..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-bar-and-lines-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-bars-and-lines-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-bars-and-lines-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..3ac81c642f Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-bars-and-lines-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-fitting-functions-non-stacked-series-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-fitting-functions-non-stacked-series-visually-looks-correct-1-snap.png index 49f9ad800b..8af56eb587 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-fitting-functions-non-stacked-series-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-fitting-functions-non-stacked-series-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-lines-and-areas-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-lines-and-areas-visually-looks-correct-1-snap.png index 9a5b2bab57..be8c42b4b0 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-lines-and-areas-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-lines-and-areas-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-test-bar-lines-linear-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-test-bar-lines-linear-visually-looks-correct-1-snap.png index 1b4b2e339f..8d078cf8a5 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-test-bar-lines-linear-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-test-bar-lines-linear-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-test-bar-lines-time-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-test-bar-lines-time-visually-looks-correct-1-snap.png index 3b83c3ab19..fd158f8b2c 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-test-bar-lines-time-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-mixed-charts-test-bar-lines-time-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-0-deg-linear-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-0-deg-linear-visually-looks-correct-1-snap.png deleted file mode 100644 index d7f2a68c0e..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-0-deg-linear-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-0-deg-ordinal-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-0-deg-ordinal-visually-looks-correct-1-snap.png deleted file mode 100644 index e1c5ed5df0..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-0-deg-ordinal-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-180-deg-linear-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-180-deg-linear-visually-looks-correct-1-snap.png deleted file mode 100644 index bc24ebb477..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-180-deg-linear-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-180-deg-ordinal-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-180-deg-ordinal-visually-looks-correct-1-snap.png deleted file mode 100644 index bf699ee7be..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-180-deg-ordinal-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-90-deg-linear-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-90-deg-linear-visually-looks-correct-1-snap.png deleted file mode 100644 index bce6948717..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-90-deg-linear-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-90-deg-ordinal-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-90-deg-ordinal-visually-looks-correct-1-snap.png deleted file mode 100644 index f06e05fcef..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-90-deg-ordinal-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-negative-90-deg-linear-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-negative-90-deg-linear-visually-looks-correct-1-snap.png index 308729bb2c..ff6db56dd6 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-negative-90-deg-linear-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-negative-90-deg-linear-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-negative-90-deg-ordinal-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-negative-90-deg-ordinal-visually-looks-correct-1-snap.png deleted file mode 100644 index cad89ca08d..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-negative-90-deg-ordinal-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-negative-90-degree-ordinal-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-negative-90-degree-ordinal-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..e05dfc39f9 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-negative-90-degree-ordinal-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-0-deg-linear-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-0-deg-linear-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..74bc3b02e1 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-0-deg-linear-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-0-deg-ordinal-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-0-deg-ordinal-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..4462c0e21c Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-0-deg-ordinal-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-180-deg-linear-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-180-deg-linear-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..4872f1cafa Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-180-deg-linear-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-180-deg-ordinal-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-180-deg-ordinal-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..f7295c031e Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-180-deg-ordinal-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-90-deg-linear-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-90-deg-linear-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..28297d89c3 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-90-deg-linear-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-90-deg-ordinal-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-90-deg-ordinal-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..dbcf69441b Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-rotations-rotations-90-deg-ordinal-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-line-chart-with-different-timezones-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-line-chart-with-different-timezones-visually-looks-correct-1-snap.png index 53df6b37a3..9a150263d2 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-line-chart-with-different-timezones-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-line-chart-with-different-timezones-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-remove-duplicate-scales-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-remove-duplicate-scales-visually-looks-correct-1-snap.png index eaad6f2e0e..d4236fa857 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-remove-duplicate-scales-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-remove-duplicate-scales-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-utc-time-zone-local-tooltip-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-utc-time-zone-local-tooltip-visually-looks-correct-1-snap.png deleted file mode 100644 index 53df6b37a3..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-utc-time-zone-local-tooltip-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-utc-time-zone-utc-tooltip-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-utc-time-zone-utc-tooltip-visually-looks-correct-1-snap.png deleted file mode 100644 index 53df6b37a3..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-utc-time-zone-utc-tooltip-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-utc-timezone-local-tooltip-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-utc-timezone-local-tooltip-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..9a150263d2 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-utc-timezone-local-tooltip-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-utc-timezone-utc-tooltip-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-utc-timezone-utc-tooltip-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..9a150263d2 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-utc-timezone-utc-tooltip-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-year-scale-custom-timezone-same-tone-tooltip-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-year-scale-custom-timezone-same-tone-tooltip-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..5c0976828d Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-year-scale-custom-timezone-same-tone-tooltip-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-year-scale-custom-timezone-same-zone-tooltip-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-year-scale-custom-timezone-same-zone-tooltip-visually-looks-correct-1-snap.png deleted file mode 100644 index f335e70b8a..0000000000 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-scales-x-scale-year-scale-custom-timezone-same-zone-tooltip-visually-looks-correct-1-snap.png and /dev/null differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-add-custom-sub-series-label-formatting-time-date-and-percent-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-add-custom-sub-series-label-formatting-visually-looks-correct-1-snap.png similarity index 100% rename from integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-add-custom-sub-series-label-formatting-time-date-and-percent-visually-looks-correct-1-snap.png rename to integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-add-custom-sub-series-label-formatting-visually-looks-correct-1-snap.png diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-custom-series-colors-via-accessor-function-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-custom-series-colors-via-accessor-function-visually-looks-correct-1-snap.png index f9881e56fa..873a096109 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-custom-series-colors-via-accessor-function-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-custom-series-colors-via-accessor-function-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-custom-series-styles-area-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-custom-series-styles-area-visually-looks-correct-1-snap.png index e2e7983ead..d9b5a3e02d 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-custom-series-styles-area-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-custom-series-styles-area-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-custom-series-styles-lines-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-custom-series-styles-lines-visually-looks-correct-1-snap.png index 1f65d6ba4c..d9d2001dde 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-custom-series-styles-lines-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-custom-series-styles-lines-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-partial-custom-theme-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-partial-custom-theme-visually-looks-correct-1-snap.png index 0c62acc9a7..aadc83ce09 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-partial-custom-theme-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-partial-custom-theme-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-partial-custom-theme-with-base-theme-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-partial-custom-theme-with-base-theme-visually-looks-correct-1-snap.png index 0c62acc9a7..aadc83ce09 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-partial-custom-theme-with-base-theme-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-partial-custom-theme-with-base-theme-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-style-accessor-overrides-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-style-accessor-overrides-visually-looks-correct-1-snap.png index 4275dcc88c..32d36270c8 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-style-accessor-overrides-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-style-accessor-overrides-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-theme-style-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-theme-style-visually-looks-correct-1-snap.png index 09f1febeaa..dbe254a3ce 100644 Binary files a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-theme-style-visually-looks-correct-1-snap.png and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-stylings-theme-style-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-big-empty-pie-chart-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-big-empty-pie-chart-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..bdef73d2fb Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-big-empty-pie-chart-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-clockwise-no-special-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-clockwise-no-special-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..ccf1cf7c81 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-clockwise-no-special-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-counter-clockwise-special-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-counter-clockwise-special-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..44e534beb7 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-counter-clockwise-special-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-donut-chart-with-fill-labels-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-donut-chart-with-fill-labels-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..8bee3401f9 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-donut-chart-with-fill-labels-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-full-zero-slice-pie-chart-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-full-zero-slice-pie-chart-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..77d2a36cdd Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-full-zero-slice-pie-chart-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-high-number-of-slice-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-high-number-of-slice-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..bc1ab22d11 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-high-number-of-slice-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-large-small-pie-chart-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-large-small-pie-chart-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..aeb031f5d5 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-large-small-pie-chart-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-linked-labels-only-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-linked-labels-only-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..5008e3c29b Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-linked-labels-only-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-negative-no-pie-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-negative-no-pie-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..deefe8491f Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-negative-no-pie-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-no-labels-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-no-labels-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..96c5d23d1a Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-no-labels-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-no-slice-no-pie-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-no-slice-no-pie-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..deefe8491f Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-no-slice-no-pie-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-pie-chart-labels-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-pie-chart-labels-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..02b2a29168 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-pie-chart-labels-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-pie-chart-with-fill-labels-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-pie-chart-with-fill-labels-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..e7bee44940 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-pie-chart-with-fill-labels-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-simple-pie-chart-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-simple-pie-chart-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..1fb5f49655 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-simple-pie-chart-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-single-slice-pie-chart-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-single-slice-pie-chart-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..f8c522b801 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-single-slice-pie-chart-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-some-zero-value-slice-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-some-zero-value-slice-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..7a364473ba Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-some-zero-value-slice-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-sunburst-three-layers-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-sunburst-three-layers-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..6d307a2ee9 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-sunburst-three-layers-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-sunburst-two-layers-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-sunburst-two-layers-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..4ed8ea6a14 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-sunburst-two-layers-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-total-zero-no-pie-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-total-zero-no-pie-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..deefe8491f Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-total-zero-no-pie-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-two-slices-pie-chart-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-two-slices-pie-chart-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..708f6a488d Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-two-slices-pie-chart-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-very-large-small-pie-chart-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-very-large-small-pie-chart-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..4f4dae70f3 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-sunburst-very-large-small-pie-chart-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-treemap-custom-style-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-treemap-custom-style-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..ddc6359dab Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-treemap-custom-style-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-treemap-mid-two-layers-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-treemap-mid-two-layers-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..ca031bc3bb Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-treemap-mid-two-layers-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-treemap-multi-color-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-treemap-multi-color-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..c736966dec Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-treemap-multi-color-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-treemap-one-layer-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-treemap-one-layer-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..ff0a751758 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-treemap-one-layer-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-treemap-two-layers-stress-test-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-treemap-two-layers-stress-test-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000..830035f1e3 Binary files /dev/null and b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-treemap-two-layers-stress-test-visually-looks-correct-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/area-stories-test-ts-area-series-stories-accessor-formats-should-show-custom-format-1-snap.png b/integration/tests/__image_snapshots__/area-stories-test-ts-area-series-stories-accessor-formats-should-show-custom-format-1-snap.png index 5cfee5c36c..9b9d45a907 100644 Binary files a/integration/tests/__image_snapshots__/area-stories-test-ts-area-series-stories-accessor-formats-should-show-custom-format-1-snap.png and b/integration/tests/__image_snapshots__/area-stories-test-ts-area-series-stories-accessor-formats-should-show-custom-format-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/axis-stories-test-ts-axis-stories-should-render-proper-tick-count-1-snap.png b/integration/tests/__image_snapshots__/axis-stories-test-ts-axis-stories-should-render-proper-tick-count-1-snap.png index 3198265149..b5148a0f82 100644 Binary files a/integration/tests/__image_snapshots__/axis-stories-test-ts-axis-stories-should-render-proper-tick-count-1-snap.png and b/integration/tests/__image_snapshots__/axis-stories-test-ts-axis-stories-should-render-proper-tick-count-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/axis-stories-test-ts-axis-stories-should-render-with-domain-constraints-1-snap.png b/integration/tests/__image_snapshots__/axis-stories-test-ts-axis-stories-should-render-with-domain-constraints-1-snap.png index 4b87ec0d20..8848e6cb37 100644 Binary files a/integration/tests/__image_snapshots__/axis-stories-test-ts-axis-stories-should-render-with-domain-constraints-1-snap.png and b/integration/tests/__image_snapshots__/axis-stories-test-ts-axis-stories-should-render-with-domain-constraints-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-false-rotation-0-1-snap.png b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-false-rotation-0-1-snap.png index 3bb2847a93..2e045a44d3 100644 Binary files a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-false-rotation-0-1-snap.png and b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-false-rotation-0-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-false-rotation-180-1-snap.png b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-false-rotation-180-1-snap.png index 98b022e7eb..8b7d6c19dd 100644 Binary files a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-false-rotation-180-1-snap.png and b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-false-rotation-180-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-false-rotation-90-1-snap.png b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-false-rotation-90-1-snap.png index 994da0099d..70375cac0c 100644 Binary files a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-false-rotation-90-1-snap.png and b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-false-rotation-90-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-false-rotation-negative-90-1-snap.png b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-false-rotation-negative-90-1-snap.png index 604d88a26c..25a434a410 100644 Binary files a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-false-rotation-negative-90-1-snap.png and b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-false-rotation-negative-90-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-true-rotation-0-1-snap.png b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-true-rotation-0-1-snap.png index 77e283586d..02a43108d9 100644 Binary files a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-true-rotation-0-1-snap.png and b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-true-rotation-0-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-true-rotation-180-1-snap.png b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-true-rotation-180-1-snap.png index c0597b6b41..142c764920 100644 Binary files a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-true-rotation-180-1-snap.png and b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-true-rotation-180-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-true-rotation-90-1-snap.png b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-true-rotation-90-1-snap.png index 061c75fbcf..a3f4a5370e 100644 Binary files a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-true-rotation-90-1-snap.png and b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-true-rotation-90-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-true-rotation-negative-90-1-snap.png b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-true-rotation-negative-90-1-snap.png index c4445de79a..e55d1d04f9 100644 Binary files a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-true-rotation-negative-90-1-snap.png and b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-enable-histogram-mode-is-true-rotation-negative-90-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-point-alignment-center-1-snap.png b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-point-alignment-center-1-snap.png index e76cd1f055..77aabe9da9 100644 Binary files a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-point-alignment-center-1-snap.png and b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-point-alignment-center-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-point-alignment-end-1-snap.png b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-point-alignment-end-1-snap.png index 428b8cfaf7..c2946e9e94 100644 Binary files a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-point-alignment-end-1-snap.png and b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-point-alignment-end-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-point-alignment-start-1-snap.png b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-point-alignment-start-1-snap.png index 874341b22b..9203dc5900 100644 Binary files a/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-point-alignment-start-1-snap.png and b/integration/tests/__image_snapshots__/bar-stories-test-ts-bar-series-stories-test-histogram-mode-linear-point-alignment-start-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-0-shows-tooltip-on-first-x-value-bottom-1-snap.png b/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-0-shows-tooltip-on-first-x-value-bottom-1-snap.png index e777f22716..c3298e6bb5 100644 Binary files a/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-0-shows-tooltip-on-first-x-value-bottom-1-snap.png and b/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-0-shows-tooltip-on-first-x-value-bottom-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-0-shows-tooltip-on-first-x-value-top-1-snap.png b/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-0-shows-tooltip-on-first-x-value-top-1-snap.png index 88d02087a2..0049cf8488 100644 Binary files a/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-0-shows-tooltip-on-first-x-value-top-1-snap.png and b/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-0-shows-tooltip-on-first-x-value-top-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-0-shows-tooltip-on-last-x-value-bottom-1-snap.png b/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-0-shows-tooltip-on-last-x-value-bottom-1-snap.png index 16861c7d18..4d7528b7ea 100644 Binary files a/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-0-shows-tooltip-on-last-x-value-bottom-1-snap.png and b/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-0-shows-tooltip-on-last-x-value-bottom-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-0-shows-tooltip-on-last-x-value-top-1-snap.png b/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-0-shows-tooltip-on-last-x-value-top-1-snap.png index c65ec2d1a6..02cf8fa8c3 100644 Binary files a/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-0-shows-tooltip-on-last-x-value-top-1-snap.png and b/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-0-shows-tooltip-on-last-x-value-top-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-90-shows-tooltip-on-first-x-value-bottom-1-snap.png b/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-90-shows-tooltip-on-first-x-value-bottom-1-snap.png index 4f0d5892eb..d6a11ba864 100644 Binary files a/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-90-shows-tooltip-on-first-x-value-bottom-1-snap.png and b/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-90-shows-tooltip-on-first-x-value-bottom-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-90-shows-tooltip-on-first-x-value-top-1-snap.png b/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-90-shows-tooltip-on-first-x-value-top-1-snap.png index 7b3b07b45a..bb87427e82 100644 Binary files a/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-90-shows-tooltip-on-first-x-value-top-1-snap.png and b/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-90-shows-tooltip-on-first-x-value-top-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-90-shows-tooltip-on-last-x-value-bottom-1-snap.png b/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-90-shows-tooltip-on-last-x-value-bottom-1-snap.png index 85fd73e86d..4e661cf87c 100644 Binary files a/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-90-shows-tooltip-on-last-x-value-bottom-1-snap.png and b/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-90-shows-tooltip-on-last-x-value-bottom-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-90-shows-tooltip-on-last-x-value-top-1-snap.png b/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-90-shows-tooltip-on-last-x-value-top-1-snap.png index 132adfcc4e..ab8b7f0a5f 100644 Binary files a/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-90-shows-tooltip-on-last-x-value-top-1-snap.png and b/integration/tests/__image_snapshots__/interactions-test-ts-tooltips-rotation-90-shows-tooltip-on-last-x-value-top-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/legend-stories-test-ts-legend-stories-should-hide-bar-series-legend-item-1-snap.png b/integration/tests/__image_snapshots__/legend-stories-test-ts-legend-stories-should-hide-bar-series-legend-item-1-snap.png index a253e70a13..dc91999bd1 100644 Binary files a/integration/tests/__image_snapshots__/legend-stories-test-ts-legend-stories-should-hide-bar-series-legend-item-1-snap.png and b/integration/tests/__image_snapshots__/legend-stories-test-ts-legend-stories-should-hide-bar-series-legend-item-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/legend-stories-test-ts-legend-stories-should-hide-line-series-legend-item-1-snap.png b/integration/tests/__image_snapshots__/legend-stories-test-ts-legend-stories-should-hide-line-series-legend-item-1-snap.png index d6aeff8e70..7ac1215308 100644 Binary files a/integration/tests/__image_snapshots__/legend-stories-test-ts-legend-stories-should-hide-line-series-legend-item-1-snap.png and b/integration/tests/__image_snapshots__/legend-stories-test-ts-legend-stories-should-hide-line-series-legend-item-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/legend-stories-test-ts-legend-stories-should-render-non-split-series-1-snap.png b/integration/tests/__image_snapshots__/legend-stories-test-ts-legend-stories-should-render-non-split-series-1-snap.png index 99ee347ae2..e35c985c44 100644 Binary files a/integration/tests/__image_snapshots__/legend-stories-test-ts-legend-stories-should-render-non-split-series-1-snap.png and b/integration/tests/__image_snapshots__/legend-stories-test-ts-legend-stories-should-render-non-split-series-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/line-stories-test-ts-line-series-stories-rotation-rotation-0-1-snap.png b/integration/tests/__image_snapshots__/line-stories-test-ts-line-series-stories-rotation-rotation-0-1-snap.png index 638f08ccde..8a5bd6c562 100644 Binary files a/integration/tests/__image_snapshots__/line-stories-test-ts-line-series-stories-rotation-rotation-0-1-snap.png and b/integration/tests/__image_snapshots__/line-stories-test-ts-line-series-stories-rotation-rotation-0-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/line-stories-test-ts-line-series-stories-rotation-rotation-90-1-snap.png b/integration/tests/__image_snapshots__/line-stories-test-ts-line-series-stories-rotation-rotation-90-1-snap.png index 7d26012345..13fd5ea4e5 100644 Binary files a/integration/tests/__image_snapshots__/line-stories-test-ts-line-series-stories-rotation-rotation-90-1-snap.png and b/integration/tests/__image_snapshots__/line-stories-test-ts-line-series-stories-rotation-rotation-90-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/line-stories-test-ts-line-series-stories-rotation-rotation-negative-90-1-snap.png b/integration/tests/__image_snapshots__/line-stories-test-ts-line-series-stories-rotation-rotation-negative-90-1-snap.png index 4260f0f5cd..96d61ea8c5 100644 Binary files a/integration/tests/__image_snapshots__/line-stories-test-ts-line-series-stories-rotation-rotation-negative-90-1-snap.png and b/integration/tests/__image_snapshots__/line-stories-test-ts-line-series-stories-rotation-rotation-negative-90-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png index 1073d00e16..d6f35b954f 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png index 8bbf926bec..2bac5c42eb 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png index 03c0c7ae28..b230d89562 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png index 71ecc0c0f0..e287de0314 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png index 57ffc660a5..d483516a5b 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png index 2a17078745..8671b6054a 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png index ef63804ab2..454aae6c6c 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png index df37f50c84..bdba44b1c9 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-average-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-average-1-snap.png index 1f9b3b14ba..3d845a43fa 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-average-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-average-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-carry-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-carry-1-snap.png index fe13aacb14..2a109bc76a 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-carry-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-carry-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-explicit-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-explicit-1-snap.png index 03c0c7ae28..b230d89562 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-explicit-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-explicit-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-linear-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-linear-1-snap.png index 179f089fc6..b48b61016c 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-linear-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-linear-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-lookahead-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-lookahead-1-snap.png index e502d2bf7d..3a615b8080 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-lookahead-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-lookahead-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-nearest-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-nearest-1-snap.png index 2a17078745..8671b6054a 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-nearest-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-nearest-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-none-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-none-1-snap.png index 2f24132a79..454aae6c6c 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-none-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-none-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-zero-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-zero-1-snap.png index df37f50c84..bdba44b1c9 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-zero-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-end-value-set-to-nearest-should-display-correct-fit-for-type-zero-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-average-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-average-1-snap.png index 49f9ad800b..8af56eb587 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-average-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-average-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-carry-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-carry-1-snap.png index a23ceb9594..35b261d011 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-carry-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-carry-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-explicit-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-explicit-1-snap.png index 03c0c7ae28..b230d89562 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-explicit-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-explicit-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-linear-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-linear-1-snap.png index f4eee894a6..72f6b76c31 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-linear-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-linear-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-lookahead-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-lookahead-1-snap.png index 3152e341f9..e7e05a8407 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-lookahead-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-lookahead-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-nearest-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-nearest-1-snap.png index 2a17078745..8671b6054a 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-nearest-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-nearest-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-none-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-none-1-snap.png index ef63804ab2..454aae6c6c 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-none-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-none-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-zero-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-zero-1-snap.png index df37f50c84..bdba44b1c9 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-zero-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-no-end-value-should-display-correct-fit-for-type-zero-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-average-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-average-1-snap.png index 99fdde5816..4ae938b1a7 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-average-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-average-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-carry-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-carry-1-snap.png index 6433f597a7..2438819d25 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-carry-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-carry-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-explicit-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-explicit-1-snap.png index f296c81817..2ffc2958d3 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-explicit-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-explicit-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-linear-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-linear-1-snap.png index 587c4c4094..b79197ce7f 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-linear-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-linear-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-lookahead-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-lookahead-1-snap.png index 5f3be43a8c..85f364127c 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-lookahead-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-lookahead-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-nearest-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-nearest-1-snap.png index 4ae788a2f5..5227d5b7bb 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-nearest-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-nearest-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-none-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-none-1-snap.png index 4a4a07a18e..746da2f660 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-none-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-none-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-zero-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-zero-1-snap.png index 5520db6a6a..599a9ef3dc 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-zero-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-ordinal-dataset-no-end-value-should-display-correct-fit-for-type-zero-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png index 1073d00e16..d6f35b954f 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png index 8bbf926bec..2bac5c42eb 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png index 03c0c7ae28..b230d89562 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png index 71ecc0c0f0..e287de0314 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png index 57ffc660a5..d483516a5b 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png index 2a17078745..8671b6054a 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png index ef63804ab2..454aae6c6c 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png index df37f50c84..bdba44b1c9 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-area-charts-with-curved-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png index ff328cfec9..7a0b65177a 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png index 0c41dfe5b1..2b7f78716d 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png index 40f3e66fe5..b7ee5360b5 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png index d89b6e5aed..05e2ea87ca 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png index 936c6fc8ee..01667db06c 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png index d46d71eb5b..9d786229f1 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png index a2f2eb5370..1bbe78da6f 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png index 527a9f603b..884f48b7b3 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-average-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-average-1-snap.png index 81f62480fb..f24a75a516 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-average-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-average-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-carry-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-carry-1-snap.png index 4a49c5f6d8..b350523c35 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-carry-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-carry-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-explicit-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-explicit-1-snap.png index 40f3e66fe5..b7ee5360b5 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-explicit-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-explicit-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-linear-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-linear-1-snap.png index 78ba866112..5d7c4f72bc 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-linear-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-linear-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-lookahead-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-lookahead-1-snap.png index 0e142da1bc..8db2d9ec68 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-lookahead-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-lookahead-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-nearest-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-nearest-1-snap.png index 1bc9eeb764..9d786229f1 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-nearest-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-nearest-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-none-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-none-1-snap.png index a2f2eb5370..1bbe78da6f 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-none-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-none-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-zero-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-zero-1-snap.png index 527a9f603b..884f48b7b3 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-zero-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-no-end-value-should-display-correct-fit-for-type-zero-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png index ff328cfec9..7a0b65177a 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-average-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png index 0c41dfe5b1..2b7f78716d 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-carry-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png index 40f3e66fe5..b7ee5360b5 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-explicit-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png index d89b6e5aed..05e2ea87ca 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-linear-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png index 936c6fc8ee..01667db06c 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-lookahead-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png index d46d71eb5b..9d786229f1 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-nearest-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png index a2f2eb5370..1bbe78da6f 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-none-1-snap.png differ diff --git a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png index 527a9f603b..884f48b7b3 100644 Binary files a/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png and b/integration/tests/__image_snapshots__/mixed-stories-test-ts-mixed-series-stories-fitting-functions-line-charts-with-curve-end-value-set-to-2-should-display-correct-fit-for-type-zero-1-snap.png differ diff --git a/integration/tests/bar-stories.test.ts b/integration/tests/bar-stories.test.ts index 8564d6c5af..cb9cc07db6 100644 --- a/integration/tests/bar-stories.test.ts +++ b/integration/tests/bar-stories.test.ts @@ -4,7 +4,7 @@ describe('Bar series stories', () => { describe('[test] switch ordinal/linear x axis', () => { it('using ordinal x axis', async () => { await common.expectChartAtUrlToMatchScreenshot( - 'http://localhost:9001/?path=/story/bar-chart--test-switch-ordinal-linear-x-axis&knob-scaleType=ordinal', + 'http://localhost:9001/?path=/story/bar-chart--test-switch-ordinal-linear-axis&knob-scaleType=ordinal', ); }); }); diff --git a/integration/tests/legend-stories.test.ts b/integration/tests/legend-stories.test.ts index 933d4ed324..0c40236201 100644 --- a/integration/tests/legend-stories.test.ts +++ b/integration/tests/legend-stories.test.ts @@ -18,7 +18,7 @@ describe('Legend stories', () => { }); it('should 0 legend buffer', async () => { await common.expectChartAtUrlToMatchScreenshot( - 'http://localhost:9001/?path=/story/legend--legend-spacingbuffer&knob-legend buffer value=0', + 'http://localhost:9001/?path=/story/legend--legend-spacing-buffer&knob-legend buffer value=0', ); }); }); diff --git a/stories/annotations.tsx b/stories/annotations.tsx index 715044d34a..4f89494dfa 100644 --- a/stories/annotations.tsx +++ b/stories/annotations.tsx @@ -1,5 +1,4 @@ import { boolean, color, number, select } from '@storybook/addon-knobs'; -import { storiesOf } from '@storybook/react'; import React from 'react'; import { AnnotationDomainTypes, @@ -38,561 +37,607 @@ function generateTimeAnnotationData(values: any[]): LineAnnotationDatum[] { })); } -storiesOf('Annotations', module) - .add('[line] basic xDomain continuous', () => { - const data = arrayKnobs('data values', [2.5, 7.2]); - const dataValues = generateAnnotationData(data); - - const style = { - line: { - strokeWidth: 3, - stroke: '#f00', - opacity: 1, - }, - details: { - fontSize: 12, - fontFamily: 'Arial', - fontStyle: 'bold', - fill: 'gray', - padding: 0, - }, - }; - - const isBottom = boolean('x domain axis is bottom', true); - const axisPosition = isBottom ? Position.Bottom : Position.Top; - - return ( - - - } - /> - - - - - ); - }) - .add('[line] basic xDomain ordinal', () => { - const dataValues = generateAnnotationData(arrayKnobs('annotation values', ['a', 'c'])); - - return ( - - - } - /> - - - - - - ); - }) - .add('[line] basic yDomain', () => { - const data = arrayKnobs('data values', [1.5, 7.2]); - const dataValues = generateAnnotationData(data); - - const isLeft = boolean('y-domain axis is Position.Left', true); - const axisTitle = isLeft ? 'y-domain axis (left)' : 'y-domain axis (right)'; - const axisPosition = isLeft ? Position.Left : Position.Right; - - return ( - - - } - /> - - - - - ); - }) - .add('[line] time series', () => { - const dataValues = generateTimeAnnotationData([ - 1551438150000, - 1551438180000, - 1551438390000, - 1551438450000, - 1551438480000, - ]); - - return ( - - - } - /> - - - - - ); - }) - .add('[line] styling', () => { - const data = [2.5, 7.2]; - const dataValues = generateAnnotationData(data); - - const dashWidth = number('dash line width', 1); - const dashGapWidth = number('dash gap width', 0); - - const style = { - line: { - strokeWidth: number('line stroke width', 3), - stroke: color('line & marker color', '#f00'), - dash: [dashWidth, dashGapWidth], - opacity: number('line opacity', 1, { - range: true, - min: 0, - max: 1, - step: 0.1, - }), - }, - }; - - const axisPosition = Position.Bottom; - - const marker = select<'alert' | 'eye' | 'questionInCircle'>( - 'marker icon (examples from internal Icon library)', - { - alert: 'alert', - eye: 'eye', - questionInCircle: 'questionInCircle', - }, - 'alert', - ); - - const hideLines = boolean('annotation lines hidden', false); - const hideTooltips = boolean('annotation tooltips hidden', false); - - return ( - - - } - hideLines={hideLines} - hideTooltips={hideTooltips} - /> - - - - - ); - }) - .add('[rect] basic annotation (linear bar)', () => { - const dataValues = [ - { - coordinates: { - x0: 0, - x1: 1, - y0: 0, - y1: 7, - }, - details: 'details about this annotation', - }, - ]; - - return ( - - - - - - - - ); - }) - .add('[rect] basic annotation (ordinal bar)', () => { - const dataValues = [ - { - coordinates: { - x0: 'a', - x1: 'b', - }, - details: 'details about this annotation', - }, - ]; - - return ( - - - - - - - - ); - }) - .add('[rect] basic annotation (line)', () => { - const definedCoordinate = select( - 'defined coordinate', - { - x0: 'x0', - x1: 'x1', - y0: BandedAccessorType.Y0, - y1: BandedAccessorType.Y1, - }, - 'x0', - ); - - const dataValues = [ - { - coordinates: { - x0: 1, - x1: 1.25, - y0: 0, - y1: 7, - }, - details: 'details about this annotation', - }, - { - coordinates: { - x0: 2.0, - x1: 2.1, - y0: 0, - y1: 7, - }, - details: 'details about this annotation', +export default { + title: 'Annotations', + parameters: { + info: { + source: false, + }, + }, +}; + +export const lineBasicXDomainContinous = () => { + const data = arrayKnobs('data values', [2.5, 7.2]); + const dataValues = generateAnnotationData(data); + + const style = { + line: { + strokeWidth: 3, + stroke: '#f00', + opacity: 1, + }, + details: { + fontSize: 12, + fontFamily: 'Arial', + fontStyle: 'bold', + fill: 'gray', + padding: 0, + }, + }; + + const isBottom = boolean('x domain axis is bottom', true); + const axisPosition = isBottom ? Position.Bottom : Position.Top; + + return ( + + + } + /> + + + + + ); +}; +lineBasicXDomainContinous.story = { + name: '[line] basic xDomain continuous', +}; + +export const lineBasicXDomainOrdinal = () => { + const dataValues = generateAnnotationData(arrayKnobs('annotation values', ['a', 'c'])); + + return ( + + + } + /> + + + + + + ); +}; +lineBasicXDomainOrdinal.story = { + name: '[line] basic xDomain ordinal', +}; + +export const lineBasicYDomain = () => { + const data = arrayKnobs('data values', [1.5, 7.2]); + const dataValues = generateAnnotationData(data); + + const isLeft = boolean('y-domain axis is Position.Left', true); + const axisTitle = isLeft ? 'y-domain axis (left)' : 'y-domain axis (right)'; + const axisPosition = isLeft ? Position.Left : Position.Right; + + return ( + + + } + /> + + + + + ); +}; +lineBasicYDomain.story = { + name: '[line] basic yDomain', +}; + +export const lineTimeSeries = () => { + const dataValues = generateTimeAnnotationData([ + 1551438150000, + 1551438180000, + 1551438390000, + 1551438450000, + 1551438480000, + ]); + + return ( + + + } + /> + + + + + ); +}; +lineTimeSeries.story = { + name: '[line] time series', +}; + +export const lineStyling = () => { + const data = [2.5, 7.2]; + const dataValues = generateAnnotationData(data); + + const dashWidth = number('dash line width', 1); + const dashGapWidth = number('dash gap width', 0); + + const style = { + line: { + strokeWidth: number('line stroke width', 3), + stroke: color('line & marker color', '#f00'), + dash: [dashWidth, dashGapWidth], + opacity: number('line opacity', 1, { + range: true, + min: 0, + max: 1, + step: 0.1, + }), + }, + }; + + const axisPosition = Position.Bottom; + + const marker = select<'alert' | 'eye' | 'questionInCircle'>( + 'marker icon (examples from internal Icon library)', + { + alert: 'alert', + eye: 'eye', + questionInCircle: 'questionInCircle', + }, + 'alert', + ); + + const hideLines = boolean('annotation lines hidden', false); + const hideTooltips = boolean('annotation tooltips hidden', false); + + return ( + + + } + hideLines={hideLines} + hideTooltips={hideTooltips} + /> + + + + + ); +}; +lineStyling.story = { + name: '[line] styling', +}; + +export const rectBasicAnnotationLinearBar = () => { + const dataValues = [ + { + coordinates: { + x0: 0, + x1: 1, + y0: 0, + y1: 7, }, - { - coordinates: { - x0: definedCoordinate === 'x0' ? 0.25 : null, - x1: definedCoordinate === 'x1' ? 2.75 : null, - y0: definedCoordinate === BandedAccessorType.Y0 ? 0.25 : null, - y1: definedCoordinate === BandedAccessorType.Y1 ? 6.75 : null, - }, - details: 'can have null values', + details: 'details about this annotation', + }, + ]; + + return ( + + + + + + + + ); +}; +rectBasicAnnotationLinearBar.story = { + name: '[rect] basic annotation (linear bar)', +}; + +export const rectBasicAnnotationOrdinalBar = () => { + const dataValues = [ + { + coordinates: { + x0: 'a', + x1: 'b', }, - ]; - - const isLeft = boolean('y-domain axis is Position.Left', true); - const yAxisTitle = isLeft ? 'y-domain axis (left)' : 'y-domain axis (right)'; - const yAxisPosition = isLeft ? Position.Left : Position.Right; - - const isBottom = boolean('x-domain axis is Position.Bottom', true); - const xAxisTitle = isBottom ? 'x-domain axis (botttom)' : 'x-domain axis (top)'; - const xAxisPosition = isBottom ? Position.Bottom : Position.Top; - - return ( - - - - - - - - ); - }) - .add('[rect] styling', () => { - const dataValues = [ - { - coordinates: { - x0: 0, - x1: 0.25, - y0: 0, - y1: 7, - }, - details: 'annotation 1', + details: 'details about this annotation', + }, + ]; + + return ( + + + + + + + + ); +}; +rectBasicAnnotationOrdinalBar.story = { + name: '[rect] basic annotation (ordinal bar)', +}; + +export const rectBasicAnnotationLine = () => { + const definedCoordinate = select( + 'defined coordinate', + { + x0: 'x0', + x1: 'x1', + y0: BandedAccessorType.Y0, + y1: BandedAccessorType.Y1, + }, + 'x0', + ); + + const dataValues = [ + { + coordinates: { + x0: 1, + x1: 1.25, + y0: 0, + y1: 7, }, - { - coordinates: { - x0: -0.1, - x1: 0, - y0: 0, - y1: 7, - }, - details: 'annotation 2', + details: 'details about this annotation', + }, + { + coordinates: { + x0: 2.0, + x1: 2.1, + y0: 0, + y1: 7, }, - { - coordinates: { - x0: 1.1, - x1: 1.3, - y0: 0, - y1: 7, - }, - details: 'annotation 2', + details: 'details about this annotation', + }, + { + coordinates: { + x0: definedCoordinate === 'x0' ? 0.25 : null, + x1: definedCoordinate === 'x1' ? 2.75 : null, + y0: definedCoordinate === BandedAccessorType.Y0 ? 0.25 : null, + y1: definedCoordinate === BandedAccessorType.Y1 ? 6.75 : null, }, - { - coordinates: { - x0: 2.5, - x1: 3, - y0: 0, - y1: 7, - }, - details: 'annotation 3', + details: 'can have null values', + }, + ]; + + const isLeft = boolean('y-domain axis is Position.Left', true); + const yAxisTitle = isLeft ? 'y-domain axis (left)' : 'y-domain axis (right)'; + const yAxisPosition = isLeft ? Position.Left : Position.Right; + + const isBottom = boolean('x-domain axis is Position.Bottom', true); + const xAxisTitle = isBottom ? 'x-domain axis (botttom)' : 'x-domain axis (top)'; + const xAxisPosition = isBottom ? Position.Bottom : Position.Top; + + return ( + + + + + + + + ); +}; +rectBasicAnnotationLine.story = { + name: '[rect] basic annotation (line)', +}; + +export const rectStyling = () => { + const dataValues = [ + { + coordinates: { + x0: 0, + x1: 0.25, + y0: 0, + y1: 7, }, - ]; - - const zIndex = number('annotation zIndex', 0); - - const style = { - strokeWidth: number('rect border stroke width', 1), - stroke: color('rect border stroke color', '#e5e5e5'), - fill: color('fill color', '#e5e5e5'), - opacity: number('annotation opacity', 0.5, { - range: true, - min: 0, - max: 1, - step: 0.1, - }), - }; - - const hasCustomTooltip = boolean('has custom tooltip render', false); - - const customTooltip = (details?: string) => ( -
- - {details} -
- ); - const renderTooltip = hasCustomTooltip ? customTooltip : undefined; - - const isLeft = boolean('y-domain axis is Position.Left', true); - const yAxisTitle = isLeft ? 'y-domain axis (left)' : 'y-domain axis (right)'; - const yAxisPosition = isLeft ? Position.Left : Position.Right; - - const isBottom = boolean('x-domain axis is Position.Bottom', true); - const xAxisTitle = isBottom ? 'x-domain axis (botttom)' : 'x-domain axis (top)'; - const xAxisPosition = isBottom ? Position.Bottom : Position.Top; - - return ( - - - - - - - - ); - }) - .add('[test] line annotation single value histogram', () => { - const dataValues = [ - { - dataValue: 3.5, + details: 'annotation 1', + }, + { + coordinates: { + x0: -0.1, + x1: 0, + y0: 0, + y1: 7, }, - ]; - - const style = { - line: { - strokeWidth: 3, - stroke: '#f00', - opacity: 1, + details: 'annotation 2', + }, + { + coordinates: { + x0: 1.1, + x1: 1.3, + y0: 0, + y1: 7, }, - details: { - fontSize: 12, - fontFamily: 'Arial', - fontStyle: 'bold', - fill: 'gray', - padding: 0, + details: 'annotation 2', + }, + { + coordinates: { + x0: 2.5, + x1: 3, + y0: 0, + y1: 7, }, - }; - - const xDomain = { - minInterval: 1, - }; - - return ( - - - - - - - - ); - }) - .add('[rect] tooltip visibility dependent on content', () => { - const tooltipOptions = { - 'default formatter, details defined': 'default_defined', - 'default formatter, details undefined': 'default_undefined', - 'custom formatter, return element': 'custom_element', - 'custom formatter, return null': 'custom_null', - }; - - const tooltipFormat = select('tooltip format', tooltipOptions, 'default_defined'); - - const isDefaultDefined = tooltipFormat === 'default_defined'; - - const dataValues = [ - { - coordinates: { - x0: 0, - x1: 1, - y0: 0, - y1: 7, - }, - details: isDefaultDefined ? 'foo' : undefined, + details: 'annotation 3', + }, + ]; + + const zIndex = number('annotation zIndex', 0); + + const style = { + strokeWidth: number('rect border stroke width', 1), + stroke: color('rect border stroke color', '#e5e5e5'), + fill: color('fill color', '#e5e5e5'), + opacity: number('annotation opacity', 0.5, { + range: true, + min: 0, + max: 1, + step: 0.1, + }), + }; + + const hasCustomTooltip = boolean('has custom tooltip render', false); + + const customTooltip = (details?: string) => ( +
+ + {details} +
+ ); + const renderTooltip = hasCustomTooltip ? customTooltip : undefined; + + const isLeft = boolean('y-domain axis is Position.Left', true); + const yAxisTitle = isLeft ? 'y-domain axis (left)' : 'y-domain axis (right)'; + const yAxisPosition = isLeft ? Position.Left : Position.Right; + + const isBottom = boolean('x-domain axis is Position.Bottom', true); + const xAxisTitle = isBottom ? 'x-domain axis (botttom)' : 'x-domain axis (top)'; + const xAxisPosition = isBottom ? Position.Bottom : Position.Top; + + return ( + + + + + + + + ); +}; +rectStyling.story = { + name: '[rect] styling', +}; + +export const testLineAnnotationSingleValueHistogram = () => { + const dataValues = [ + { + dataValue: 3.5, + }, + ]; + + const style = { + line: { + strokeWidth: 3, + stroke: '#f00', + opacity: 1, + }, + details: { + fontSize: 12, + fontFamily: 'Arial', + fontStyle: 'bold', + fill: 'gray', + padding: 0, + }, + }; + + const xDomain = { + minInterval: 1, + }; + + return ( + + + + + + + + ); +}; +testLineAnnotationSingleValueHistogram.story = { + name: '[test] line annotation single value histogram', +}; + +export const rectTooltipVisilibityDependentOnContent = () => { + const tooltipOptions = { + 'default formatter, details defined': 'default_defined', + 'default formatter, details undefined': 'default_undefined', + 'custom formatter, return element': 'custom_element', + 'custom formatter, return null': 'custom_null', + }; + + const tooltipFormat = select('tooltip format', tooltipOptions, 'default_defined'); + + const isDefaultDefined = tooltipFormat === 'default_defined'; + + const dataValues = [ + { + coordinates: { + x0: 0, + x1: 1, + y0: 0, + y1: 7, }, - ]; - - const isCustomTooltipElement = tooltipFormat === 'custom_element'; - const tooltipFormatter: AnnotationTooltipFormatter = () => { - if (!isCustomTooltipElement) { - return null; - } - - return
{'custom formatter'}
; - }; - - const isCustomTooltip = tooltipFormat.includes('custom'); - - return ( - - - - - - - ); - }); + details: isDefaultDefined ? 'foo' : undefined, + }, + ]; + + const isCustomTooltipElement = tooltipFormat === 'custom_element'; + const tooltipFormatter: AnnotationTooltipFormatter = () => { + if (!isCustomTooltipElement) { + return null; + } + + return
{'custom formatter'}
; + }; + + const isCustomTooltip = tooltipFormat.includes('custom'); + + return ( + + + + + + + ); +}; +rectTooltipVisilibityDependentOnContent.story = { + name: '[rect] tooltip visibility dependent on content', +}; diff --git a/stories/area_chart.tsx b/stories/area_chart.tsx index eec5e40ace..9440331e13 100644 --- a/stories/area_chart.tsx +++ b/stories/area_chart.tsx @@ -1,5 +1,4 @@ import { boolean, text } from '@storybook/addon-knobs'; -import { storiesOf } from '@storybook/react'; import { DateTime } from 'luxon'; import React from 'react'; import { @@ -20,597 +19,664 @@ import { getRandomNumber } from '../src/mocks/utils'; const dateFormatter = timeFormatter('HH:mm'); -storiesOf('Area Chart', module) - .add('basic', () => { - const toggleSpec = boolean('toggle area spec', true); - const data1 = KIBANA_METRICS.metrics.kibana_os_load[0].data; - const data2 = data1.map((datum) => [datum[0], datum[1] - 1]); - const data = toggleSpec ? data1 : data2; - const specId = toggleSpec ? 'areas1' : 'areas2'; +export default { + title: 'Area Chart', + parameters: { + info: { + source: false, + }, + }, +}; - return ( - - - - ); - }) - .add('with time x axis', () => { - return ( - - - Number(d).toFixed(2)} - /> +export const basic = () => { + const toggleSpec = boolean('toggle area spec', true); + const data1 = KIBANA_METRICS.metrics.kibana_os_load[0].data; + const data2 = data1.map((datum) => [datum[0], datum[1] - 1]); + const data = toggleSpec ? data1 : data2; + const specId = toggleSpec ? 'areas1' : 'areas2'; - - - ); - }) - .add('with linear x axis', () => { - const start = KIBANA_METRICS.metrics.kibana_os_load[0].data[0][0]; - const data = KIBANA_METRICS.metrics.kibana_os_load[0].data.slice(0, 20).map((d) => { - return [(d[0] - start) / 30000, d[1]]; - }); - return ( - - - Number(d).toFixed(2)} - /> + return ( + + + + ); +}; +basic.story = { + name: 'basic', +}; - - - ); - }) - .add('with log y axis', () => { - const data = KIBANA_METRICS.metrics.kibana_os_load[0].data.map((d) => { - return d[1] < 7 ? [d[0], null] : [d[0], d[1] - 10]; - }); - return ( - - - Number(d).toFixed(2)} - /> +export const withTimeXAxis = () => { + return ( + + + Number(d).toFixed(2)} + /> - - - ); - }) - .add('with 4 axes', () => { - return ( - - - - `${Number(d).toFixed(0)}%`} - /> - - `${Number(d).toFixed(0)} %`} - /> + + + ); +}; +withTimeXAxis.story = { + name: 'with time x axis', +}; - - - ); - }) - .add('w axis and legend', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const withLinearXAxis = () => { + const start = KIBANA_METRICS.metrics.kibana_os_load[0].data[0][0]; + const data = KIBANA_METRICS.metrics.kibana_os_load[0].data.slice(0, 20).map((d) => { + return [(d[0] - start) / 30000, d[1]]; + }); + return ( + + + Number(d).toFixed(2)} + /> + + + + ); +}; +withLinearXAxis.story = { + name: 'with linear x axis', +}; - - - ); - }) - .add('stacked w axis and legend', () => { - const data1 = KIBANA_METRICS.metrics.kibana_os_load[0].data.map((d) => { - return [...d, KIBANA_METRICS.metrics.kibana_os_load[0].metric.label]; - }); - const data2 = KIBANA_METRICS.metrics.kibana_os_load[1].data.map((d) => { - return [...d, KIBANA_METRICS.metrics.kibana_os_load[1].metric.label]; - }); - const data3 = KIBANA_METRICS.metrics.kibana_os_load[2].data.map((d) => { - return [...d, KIBANA_METRICS.metrics.kibana_os_load[2].metric.label]; - }); - const allMetrics = [...data3, ...data2, ...data1]; - return ( - - - - Number(d).toFixed(2)} - /> - - - ); - }) - .add('stacked as percentage', () => { - const stackedAsPercentage = boolean('stacked as percentage', true); - return ( - - - - `${Number(d * 100).toFixed(0)} %`} - /> +export const withLogYAxis = () => { + const data = KIBANA_METRICS.metrics.kibana_os_load[0].data.map((d) => { + return d[1] < 7 ? [d[0], null] : [d[0], d[1] - 10]; + }); + return ( + + + Number(d).toFixed(2)} + /> - - - ); - }) - .add('stacked with separated specs', () => { - return ( - - - - Number(d).toFixed(2)} - /> - - - - - ); - }) - .add('stacked with separated specs - same naming', () => { - return ( - - - - Number(d).toFixed(2)} - /> - - - - - ); - }) - .add('[test] - linear', () => { - const data = [ - [1, 1], - [2, 2], - [3, 3], - [4, 4], - [5, 5], - [6, 4], - [7, 3], - [8, 2], - [9, 1], - ]; - return ( - - - Number(d).toFixed(2)} - /> - - - ); - }) - .add('[test] - time', () => { - const start = DateTime.fromISO('2019-01-01T00:00:00.000', { zone: 'utc' }); - const data = [ - [start.toMillis(), 1], - [start.plus({ minute: 1 }).toMillis(), 2], - [start.plus({ minute: 2 }).toMillis(), 3], - [start.plus({ minute: 3 }).toMillis(), 4], - [start.plus({ minute: 4 }).toMillis(), 5], - [start.plus({ minute: 5 }).toMillis(), 4], - [start.plus({ minute: 6 }).toMillis(), 3], - [start.plus({ minute: 7 }).toMillis(), 2], - [start.plus({ minute: 8 }).toMillis(), 1], - ]; - return ( - - - Number(d).toFixed(2)} - /> - - - ); - }) - .add('band area chart', () => { - const data = KIBANA_METRICS.metrics.kibana_os_load[0].data.map((d) => { - return { - x: d[0], - max: d[1] + 4 + 4 * getRandomNumber(), - min: d[1] - 4 - 4 * getRandomNumber(), - }; - }); - const lineData = KIBANA_METRICS.metrics.kibana_os_load[0].data.map((d) => { - return [d[0], d[1]]; - }); - const scaleToDataExtent = boolean('scale to extent', true); - const y0AccessorFormat = text('y0AccessorFormat', ''); - const y1AccessorFormat = text('y1AccessorFormat', ''); - return ( - - - - Number(d).toFixed(2)} - /> + + + ); +}; +withLogYAxis.story = { + name: 'with log y axis', +}; - +export const with4Axes = () => { + return ( + + + + `${Number(d).toFixed(0)}%`} + /> + + `${Number(d).toFixed(0)} %`} + /> - - - ); - }) - .add('stacked band area chart', () => { - const data = KIBANA_METRICS.metrics.kibana_os_load[0].data; - const data2 = KIBANA_METRICS.metrics.kibana_os_load[0].data.map((d) => [d[0], 20, 10]); - const scaleToDataExtent = boolean('scale to extent', false); + + + ); +}; +with4Axes.story = { + name: 'with 4 axes', +}; - return ( - - - - Number(d).toFixed(2)} - /> +export const wAxisAndLegend = () => { + return ( + + + + Number(d).toFixed(2)} + /> - + + + ); +}; +wAxisAndLegend.story = { + name: 'w axis and legend', +}; - - - ); - }) - .add('stacked only grouped areas', () => { - const data1 = [ - [1, 2], - [2, 2], - [3, 3], - [4, 5], - [5, 5], - [6, 3], - [7, 8], - [8, 2], - [9, 1], - ]; - const data2 = [ - [1, 1], - [2, 2], - [3, 3], - [4, 4], - [5, 5], - [6, 4], - [7, 3], - [8, 2], - [9, 4], - ]; - const data3 = [ - [1, 6], - [2, 6], - [3, 3], - [4, 2], - [5, 1], - [6, 1], - [7, 5], - [8, 6], - [9, 7], - ]; - return ( - - - Number(d).toFixed(2)} - /> - - - - - ); +export const stackedWAxisAndLegend = () => { + const data1 = KIBANA_METRICS.metrics.kibana_os_load[0].data.map((d) => { + return [...d, KIBANA_METRICS.metrics.kibana_os_load[0].metric.label]; }); + const data2 = KIBANA_METRICS.metrics.kibana_os_load[1].data.map((d) => { + return [...d, KIBANA_METRICS.metrics.kibana_os_load[1].metric.label]; + }); + const data3 = KIBANA_METRICS.metrics.kibana_os_load[2].data.map((d) => { + return [...d, KIBANA_METRICS.metrics.kibana_os_load[2].metric.label]; + }); + const allMetrics = [...data3, ...data2, ...data1]; + return ( + + + + Number(d).toFixed(2)} + /> + + + ); +}; +stackedWAxisAndLegend.story = { + name: 'stacked w axis and legend', +}; + +export const stackedAsPercentage = () => { + const stackedAsPercentage = boolean('stacked as percentage', true); + return ( + + + + `${Number(d * 100).toFixed(0)} %`} + /> + + + + ); +}; +stackedAsPercentage.story = { + name: 'stacked as percentage', +}; + +export const stackedWithSeparatedSpecs = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + + ); +}; +stackedWithSeparatedSpecs.story = { + name: 'stacked with separated specs', +}; + +export const stackedWithSeparatedSpecsSameNaming = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + + ); +}; +stackedWithSeparatedSpecsSameNaming.story = { + name: 'stacked with separated specs - same naming', +}; + +export const testLinear = () => { + const data = [ + [1, 1], + [2, 2], + [3, 3], + [4, 4], + [5, 5], + [6, 4], + [7, 3], + [8, 2], + [9, 1], + ]; + return ( + + + Number(d).toFixed(2)} + /> + + + ); +}; +testLinear.story = { + name: '[test] - linear', +}; + +export const testTime = () => { + const start = DateTime.fromISO('2019-01-01T00:00:00.000', { zone: 'utc' }); + const data = [ + [start.toMillis(), 1], + [start.plus({ minute: 1 }).toMillis(), 2], + [start.plus({ minute: 2 }).toMillis(), 3], + [start.plus({ minute: 3 }).toMillis(), 4], + [start.plus({ minute: 4 }).toMillis(), 5], + [start.plus({ minute: 5 }).toMillis(), 4], + [start.plus({ minute: 6 }).toMillis(), 3], + [start.plus({ minute: 7 }).toMillis(), 2], + [start.plus({ minute: 8 }).toMillis(), 1], + ]; + return ( + + + Number(d).toFixed(2)} + /> + + + ); +}; +testTime.story = { + name: '[test] - time', +}; + +export const bandAreaChart = () => { + const data = KIBANA_METRICS.metrics.kibana_os_load[0].data.map((d) => { + return { + x: d[0], + max: d[1] + 4 + 4 * getRandomNumber(), + min: d[1] - 4 - 4 * getRandomNumber(), + }; + }); + const lineData = KIBANA_METRICS.metrics.kibana_os_load[0].data.map((d) => { + return [d[0], d[1]]; + }); + const scaleToDataExtent = boolean('scale to extent', true); + const y0AccessorFormat = text('y0AccessorFormat', ''); + const y1AccessorFormat = text('y1AccessorFormat', ''); + return ( + + + + Number(d).toFixed(2)} + /> + + + + + + ); +}; +bandAreaChart.story = { + name: 'band area chart', +}; + +export const stackedBandAreaChart = () => { + const data = KIBANA_METRICS.metrics.kibana_os_load[0].data; + const data2 = KIBANA_METRICS.metrics.kibana_os_load[0].data.map((d) => [d[0], 20, 10]); + const scaleToDataExtent = boolean('scale to extent', false); + + return ( + + + + Number(d).toFixed(2)} + /> + + + + + + ); +}; +stackedBandAreaChart.story = { + name: 'stacked band area chart', +}; + +export const stackedOnlyGroupedAreas = () => { + const data1 = [ + [1, 2], + [2, 2], + [3, 3], + [4, 5], + [5, 5], + [6, 3], + [7, 8], + [8, 2], + [9, 1], + ]; + const data2 = [ + [1, 1], + [2, 2], + [3, 3], + [4, 4], + [5, 5], + [6, 4], + [7, 3], + [8, 2], + [9, 4], + ]; + const data3 = [ + [1, 6], + [2, 6], + [3, 3], + [4, 2], + [5, 1], + [6, 1], + [7, 5], + [8, 6], + [9, 7], + ]; + return ( + + + Number(d).toFixed(2)} + /> + + + + + ); +}; +stackedOnlyGroupedAreas.story = { + name: 'stacked only grouped areas', +}; diff --git a/stories/axis.tsx b/stories/axis.tsx index b703ab7b62..668a234181 100644 --- a/stories/axis.tsx +++ b/stories/axis.tsx @@ -1,5 +1,4 @@ import { boolean, number, select } from '@storybook/addon-knobs'; -import { storiesOf } from '@storybook/react'; import React from 'react'; import { @@ -56,609 +55,660 @@ function renderAxisWithOptions(position: Position, seriesGroup: string, show: bo return ; } -storiesOf('Axis', module) - .add('basic', () => { - const customStyle = { - tickLabelPadding: number('Tick Label Padding', 0, { - range: true, - min: 2, - max: 30, - step: 1, - }), - }; - const data = KIBANA_METRICS.metrics.kibana_os_load[0].data.slice(0, 60); - return ( - - - - Number(d).toFixed(2)} - style={customStyle} - showOverlappingLabels={boolean('Left overlap labels', false, 'Left Axis')} - showOverlappingTicks={boolean('Left overlap ticks', true, 'Left Axis')} - ticks={number( - 'Number of ticks on left', - 10, - { - range: true, - min: 2, - max: 20, - step: 1, - }, - 'Left Axis', - )} - /> - - - - ); - }) - .add('tick label rotation', () => { - const customStyle = { - tickLabelPadding: number('Tick Label Padding', 0), - }; - - return ( - - - Number(d).toFixed(2)} - style={customStyle} - hide={boolean('hide left axis', false)} - /> - { + const customStyle = { + tickLabelPadding: number('Tick Label Padding', 0, { + range: true, + min: 2, + max: 30, + step: 1, + }), + }; + const data = KIBANA_METRICS.metrics.kibana_os_load[0].data.slice(0, 60); + return ( + + + Number(d).toFixed(2)} - style={customStyle} - hide={boolean('hide top axis', false)} - /> - + Number(d).toFixed(2)} + style={customStyle} + showOverlappingLabels={boolean('Left overlap labels', false, 'Left Axis')} + showOverlappingTicks={boolean('Left overlap ticks', true, 'Left Axis')} + ticks={number( + 'Number of ticks on left', + 10, + { range: true, - min: -90, - max: 90, + min: 2, + max: 20, step: 1, - })} - tickFormat={(d) => Number(d).toFixed(2)} - style={customStyle} - hide={boolean('hide right axis', false)} - /> - - - - ); - }) - .add('4 axes', () => { - return ( - - - Number(d).toFixed(2)} - hide={boolean('hide left axis', false)} - /> - - Number(d).toFixed(2)} - hide={boolean('hide right axis', false)} - /> - - - - ); - }) - .add('with multi axis', () => { - const theme: PartialTheme = { - chartMargins: { - left: createThemeAction('margin left', 0, 50, 0), - right: createThemeAction('margin right', 0, 50, 0), - top: createThemeAction('margin top', 0, 50, 0), - bottom: createThemeAction('margin bottom', 0, 50, 0), - }, - chartPaddings: { - left: createThemeAction('padding left', 0, 50, 0), - right: createThemeAction('padding right', 0, 50, 0), - top: createThemeAction('padding top', 0, 50, 0), - bottom: createThemeAction('padding bottom', 0, 50, 0), - }, - }; - const customTheme = mergeWithDefaultTheme(theme, LIGHT_THEME); - - const seriesGroup1 = 'group1'; - const seriesGroup2 = 'group2'; - return ( - - - {renderAxisWithOptions(Position.Top, seriesGroup1, false)} - {renderAxisWithOptions(Position.Top, seriesGroup2, true)} - {renderAxisWithOptions(Position.Left, seriesGroup1, false)} - {renderAxisWithOptions(Position.Left, seriesGroup2, true)} - {renderAxisWithOptions(Position.Bottom, seriesGroup1, false)} - {renderAxisWithOptions(Position.Bottom, seriesGroup2, true)} - {renderAxisWithOptions(Position.Right, seriesGroup1, false)} - {renderAxisWithOptions(Position.Right, seriesGroup2, true)} - - - ); - }) - .add('with multi axis bar/lines', () => { - return ( - - - - Number(d).toFixed(2)} - /> - Number(d).toFixed(2)} - /> - - - - ); - }) - .add('with multi axis different tooltip formats', () => { - return ( - - - - `${Number(d).toFixed(2)} %`} - /> - `${Number(d).toFixed(2)}/s`} - /> - - - - ); - }) - .add('w many tick labels', () => { - const dg = new SeededDataGenerator(); - const data = dg.generateSimpleSeries(31); - const customStyle = { - tickLabelPadding: number('Tick Label Padding', 0), - }; - - return ( - - - - - - ); - }) - .add('customizing domain limits [mixed linear chart]', () => { - const leftDomain = { - min: number('left min', 0), - max: number('left max', 7), - }; - - const rightDomain1 = { - min: number('right1 min', 0), - max: number('right1 max', 10), - }; - - const rightDomain2 = { - min: number('right2 min', 0), - max: number('right2 max', 10), - }; - - const xDomain = { - min: number('xDomain min', 0), - max: number('xDomain max', 3), - }; - return ( - - - - Number(d).toFixed(2)} - domain={leftDomain} - hide={boolean('hide left axis', false)} - /> - Number(d).toFixed(2)} - domain={rightDomain1} - /> - Number(d).toFixed(2)} - domain={rightDomain2} - /> - - - - ); - }) - .add('customizing domain limits [mixed ordinal & linear x domain]', () => { - const leftDomain = { - min: number('left min', 0), - max: number('left max', 7), - }; - - const right1Domain = { - min: number('right1 min', 0), - max: number('right1 max', 10), - }; - - const xDomain = arrayKnobs('xDomain', ['a', 'b', 'c', 'd', 0, 1, 2, 3]); - - return ( - - - - Number(d).toFixed(2)} - domain={leftDomain} - /> - Number(d).toFixed(2)} - domain={right1Domain} - /> - Number(d).toFixed(2)} - /> - - - - ); - }) - .add('customizing domain limits [only one bound defined]', () => { - const leftDomain = { - min: number('left min', 0), - }; - - const xDomain = { - max: number('xDomain max', 3), - }; - - return ( - - - - Number(d).toFixed(2)} - domain={leftDomain} - /> - - - ); - }) - .add('fit domain to extent in y axis', () => { - const dg = new SeededDataGenerator(); - const base = dg.generateBasicSeries(100, 0, 50); - const positive = base.map(({ x, y }) => ({ x, y: y + 1000 })); - const both = base.map(({ x, y }) => ({ x, y: y - 100 })); - const negative = base.map(({ x, y }) => ({ x, y: y - 1000 })); - - const dataTypes = { - positive, - both, - negative, - }; - const dataKey = select( - 'dataset', - { - 'Positive values only': 'positive', - 'Positive and negative': 'both', - 'Negtive values only': 'negative', - }, - 'both', - ); - // @ts-ignore - const dataset = dataTypes[dataKey]; - const fit = boolean('fit domain to data', true); - - return ( - - - Number(d).toFixed(2)} - /> - - - - ); - }); + }, + 'Left Axis', + )} + /> + + + + ); +}; +basic.story = { + name: 'basic', +}; + +export const tickLabelRotation = () => { + const customStyle = { + tickLabelPadding: number('Tick Label Padding', 0), + }; + + return ( + + + Number(d).toFixed(2)} + style={customStyle} + hide={boolean('hide left axis', false)} + /> + Number(d).toFixed(2)} + style={customStyle} + hide={boolean('hide top axis', false)} + /> + Number(d).toFixed(2)} + style={customStyle} + hide={boolean('hide right axis', false)} + /> + + + + ); +}; +tickLabelRotation.story = { + name: 'tick label rotation', +}; + +export const axis4axes = () => { + return ( + + + Number(d).toFixed(2)} + hide={boolean('hide left axis', false)} + /> + + Number(d).toFixed(2)} + hide={boolean('hide right axis', false)} + /> + + + + ); +}; +axis4axes.story = { + name: '4 axes', +}; + +export const withMultiAxis = () => { + const theme: PartialTheme = { + chartMargins: { + left: createThemeAction('margin left', 0, 50, 0), + right: createThemeAction('margin right', 0, 50, 0), + top: createThemeAction('margin top', 0, 50, 0), + bottom: createThemeAction('margin bottom', 0, 50, 0), + }, + chartPaddings: { + left: createThemeAction('padding left', 0, 50, 0), + right: createThemeAction('padding right', 0, 50, 0), + top: createThemeAction('padding top', 0, 50, 0), + bottom: createThemeAction('padding bottom', 0, 50, 0), + }, + }; + const customTheme = mergeWithDefaultTheme(theme, LIGHT_THEME); + + const seriesGroup1 = 'group1'; + const seriesGroup2 = 'group2'; + return ( + + + {renderAxisWithOptions(Position.Top, seriesGroup1, false)} + {renderAxisWithOptions(Position.Top, seriesGroup2, true)} + {renderAxisWithOptions(Position.Left, seriesGroup1, false)} + {renderAxisWithOptions(Position.Left, seriesGroup2, true)} + {renderAxisWithOptions(Position.Bottom, seriesGroup1, false)} + {renderAxisWithOptions(Position.Bottom, seriesGroup2, true)} + {renderAxisWithOptions(Position.Right, seriesGroup1, false)} + {renderAxisWithOptions(Position.Right, seriesGroup2, true)} + + + ); +}; +withMultiAxis.story = { + parameter: 'with multi axis', +}; + +export const withMultiAxisBarLines = () => { + return ( + + + + Number(d).toFixed(2)} + /> + Number(d).toFixed(2)} + /> + + + + ); +}; +withMultiAxisBarLines.story = { + name: 'with multi axis bar/lines', +}; + +export const withMultiAxisDifferentTooltipFormats = () => { + return ( + + + + `${Number(d).toFixed(2)} %`} + /> + `${Number(d).toFixed(2)}/s`} + /> + + + + ); +}; +withMultiAxisDifferentTooltipFormats.story = { + name: 'with multi axis different tooltip formats', +}; + +export const wManyTickLabels = () => { + const dg = new SeededDataGenerator(); + const data = dg.generateSimpleSeries(31); + const customStyle = { + tickLabelPadding: number('Tick Label Padding', 0), + }; + + return ( + + + + + + ); +}; +wManyTickLabels.story = { + name: 'w many tick labels', +}; + +export const customizingDomainLimits = () => { + const leftDomain = { + min: number('left min', 0), + max: number('left max', 7), + }; + + const rightDomain1 = { + min: number('right1 min', 0), + max: number('right1 max', 10), + }; + + const rightDomain2 = { + min: number('right2 min', 0), + max: number('right2 max', 10), + }; + + const xDomain = { + min: number('xDomain min', 0), + max: number('xDomain max', 3), + }; + return ( + + + + Number(d).toFixed(2)} + domain={leftDomain} + hide={boolean('hide left axis', false)} + /> + Number(d).toFixed(2)} + domain={rightDomain1} + /> + Number(d).toFixed(2)} + domain={rightDomain2} + /> + + + + ); +}; +customizingDomainLimits.story = { + name: 'customizing domain limits [mixed linear chart]', +}; + +export const customizingDomainLimitsMixedOrdinalLinearXDomain = () => { + const leftDomain = { + min: number('left min', 0), + max: number('left max', 7), + }; + + const right1Domain = { + min: number('right1 min', 0), + max: number('right1 max', 10), + }; + + const xDomain = arrayKnobs('xDomain', ['a', 'b', 'c', 'd', 0, 1, 2, 3]); + + return ( + + + + Number(d).toFixed(2)} + domain={leftDomain} + /> + Number(d).toFixed(2)} + domain={right1Domain} + /> + Number(d).toFixed(2)} + /> + + + + ); +}; +customizingDomainLimitsMixedOrdinalLinearXDomain.story = { + name: 'customizing domain limits [mixed ordinal & linear x domain]', +}; + +export const customizingDomainLimitsOnlyOneBoundDefined = () => { + const leftDomain = { + min: number('left min', 0), + }; + + const xDomain = { + max: number('xDomain max', 3), + }; + + return ( + + + + Number(d).toFixed(2)} + domain={leftDomain} + /> + + + ); +}; +customizingDomainLimitsOnlyOneBoundDefined.story = { + name: 'customizing domain limits [only one bound defined]', +}; + +export const fitDomainToExtentInYAxis = () => { + const dg = new SeededDataGenerator(); + const base = dg.generateBasicSeries(100, 0, 50); + const positive = base.map(({ x, y }) => ({ x, y: y + 1000 })); + const both = base.map(({ x, y }) => ({ x, y: y - 100 })); + const negative = base.map(({ x, y }) => ({ x, y: y - 1000 })); + + const dataTypes = { + positive, + both, + negative, + }; + const dataKey = select( + 'dataset', + { + 'Positive values only': 'positive', + 'Positive and negative': 'both', + 'Negtive values only': 'negative', + }, + 'both', + ); + // @ts-ignore + const dataset = dataTypes[dataKey]; + const fit = boolean('fit domain to data', true); + + return ( + + + Number(d).toFixed(2)} + /> + + + + ); +}; +fitDomainToExtentInYAxis.story = { + name: 'fit domain to extent in y axis', +}; diff --git a/stories/bar_chart.tsx b/stories/bar_chart.tsx index 4b3e2a70fb..5361c00749 100644 --- a/stories/bar_chart.tsx +++ b/stories/bar_chart.tsx @@ -1,5 +1,4 @@ import { boolean, color, number, select } from '@storybook/addon-knobs'; -import { storiesOf } from '@storybook/react'; import { DateTime } from 'luxon'; import React from 'react'; @@ -49,1931 +48,2111 @@ const frozenData: { [key: string]: any[] } = { h: frozenDataHighVolume, }; -storiesOf('Bar Chart', module) - .add('basic', () => { - const darkmode = boolean('darkmode', false); - const className = darkmode ? 'story-chart-dark' : 'story-chart'; - const toggleSpec = boolean('toggle bar spec', true); - const data1 = [ - { x: 0, y: 2 }, - { x: 1, y: 7 }, - { x: 2, y: 3 }, - { x: 3, y: 6 }, - ]; - const data2 = data1.map((datum) => ({ ...datum, y: datum.y - 1 })); - const data = toggleSpec ? data1 : data2; - const specId = toggleSpec ? 'bars1' : 'bars2'; - - return ( - - - - ); - }) - .add('with value label', () => { - const showValueLabel = boolean('show value label', true); - const isAlternatingValueLabel = boolean('alternating value label', false); - const isValueContainedInElement = boolean('contain value label within bar element', false); - const hideClippedValue = boolean('hide clipped value', false); - - const displayValueSettings = { - showValueLabel, - isAlternatingValueLabel, - isValueContainedInElement, - hideClippedValue, - }; +export default { + title: 'Bar Chart', + parameters: { + info: { + source: false, + }, + }, +}; - const debug = boolean('debug', false); - - const theme = { - barSeriesStyle: { - displayValue: { - fontSize: number('value font size', 10), - fontFamily: `'Open Sans', Helvetica, Arial, sans-serif`, - fontStyle: 'normal', - padding: 0, - fill: color('value color', '#000'), - offsetX: number('offsetX', 0), - offsetY: number('offsetY', 0), - }, - }, - }; +export const basic = () => { + const darkmode = boolean('darkmode', false); + const className = darkmode ? 'story-chart-dark' : 'story-chart'; + const toggleSpec = boolean('toggle bar spec', true); + const data1 = [ + { x: 0, y: 2 }, + { x: 1, y: 7 }, + { x: 2, y: 3 }, + { x: 3, y: 6 }, + ]; + const data2 = data1.map((datum) => ({ ...datum, y: datum.y - 1 })); + const data = toggleSpec ? data1 : data2; + const specId = toggleSpec ? 'bars1' : 'bars2'; + return ( + + + + ); +}; +basic.story = { + name: 'basic', +}; - const dataSize = select( - 'data volume size', - { - 'small volume': 's', - 'medium volume': 'm', - 'high volume': 'h', +export const withValueLabel = () => { + const showValueLabel = boolean('show value label', true); + const isAlternatingValueLabel = boolean('alternating value label', false); + const isValueContainedInElement = boolean('contain value label within bar element', false); + const hideClippedValue = boolean('hide clipped value', false); + + const displayValueSettings = { + showValueLabel, + isAlternatingValueLabel, + isValueContainedInElement, + hideClippedValue, + }; + + const debug = boolean('debug', false); + + const theme = { + barSeriesStyle: { + displayValue: { + fontSize: number('value font size', 10), + fontFamily: `'Open Sans', Helvetica, Arial, sans-serif`, + fontStyle: 'normal', + padding: 0, + fill: color('value color', '#000'), + offsetX: number('offsetX', 0), + offsetY: number('offsetY', 0), }, - 's', - ); - const data = frozenData[dataSize]; - - const isSplitSeries = boolean('split series', false); - const isStackedSeries = boolean('stacked series', false); - - const splitSeriesAccessors = isSplitSeries ? ['g'] : undefined; - const stackAccessors = isStackedSeries ? ['x'] : undefined; - - return ( - - - - Number(d).toFixed(2)} - /> - - - - ); - }) - .add('with axis', () => { - const darkmode = boolean('darkmode', false); - const className = darkmode ? 'story-chart-dark' : 'story-chart'; - const defaultTheme = darkmode ? DARK_THEME : LIGHT_THEME; - return ( - - - - Number(d).toFixed(2)} - /> + }, + }; - - - ); - }) - .add('with ordinal x axis', () => { - return ( - - - Number(d).toFixed(2)} - /> + const dataSize = select( + 'data volume size', + { + 'small volume': 's', + 'medium volume': 'm', + 'high volume': 'h', + }, + 's', + ); + const data = frozenData[dataSize]; + + const isSplitSeries = boolean('split series', false); + const isStackedSeries = boolean('stacked series', false); + + const splitSeriesAccessors = isSplitSeries ? ['g'] : undefined; + const stackAccessors = isStackedSeries ? ['x'] : undefined; + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +withValueLabel.story = { + name: 'with value label', +}; - - - ); - }) - .add('with linear x axis', () => { - const theme = { - ...LIGHT_THEME, - scales: { - histogramPadding: number('histogram padding', 0, { - range: true, - min: 0, - max: 1, - step: 0.01, - }), - barsPadding: number('bar padding', 0, { - range: true, - min: 0, - max: 1, - step: 0.01, - }), - }, - }; - return ( - - - - Number(d).toFixed(2)} - /> +export const withAxis = () => { + const darkmode = boolean('darkmode', false); + const className = darkmode ? 'story-chart-dark' : 'story-chart'; + const defaultTheme = darkmode ? DARK_THEME : LIGHT_THEME; + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +withAxis.story = { + name: 'with axis', +}; - - - ); - }) - .add('with linear x axis no linear interval', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const withOrdinalXAxis = () => { + return ( + + + Number(d).toFixed(2)} + /> + + + + ); +}; +withOrdinalXAxis.story = { + name: 'with ordinal x axis', +}; - - - ); - }) - .add('with time x axis', () => { - const formatter = timeFormatter(niceTimeFormatByDay(1)); - return ( - - - - Number(d).toFixed(2)} - /> +export const withLinearXAxis = () => { + const theme = { + ...LIGHT_THEME, + scales: { + histogramPadding: number('histogram padding', 0, { + range: true, + min: 0, + max: 1, + step: 0.01, + }), + barsPadding: number('bar padding', 0, { + range: true, + min: 0, + max: 1, + step: 0.01, + }), + }, + }; + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +withLinearXAxis.story = { + name: 'with linear x axis', +}; - - - ); - }) - .add('with log y axis', () => { - return ( - - - Number(d).toFixed(2)} - /> +export const withLinearXAxisNoLinearInterval = () => ( + + + + Number(d).toFixed(2)} + /> + + + +); +withLinearXAxisNoLinearInterval.story = { + name: 'with linear x axis no linear interval', +}; - - - ); - }) - .add('with stacked log y axis', () => { - return ( - - - Number(d).toFixed(2)} - /> +export const withTimeXAxis = () => { + const formatter = timeFormatter(niceTimeFormatByDay(1)); + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +withTimeXAxis.story = { + name: 'with time x axis', +}; - - - ); - }) - .add('with axis and legend', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const withLogYAxis = () => { + return ( + + + Number(d).toFixed(2)} + /> + + + + ); +}; +withLogYAxis.story = { + name: 'with log y axis', +}; - - - ); - }) - .add('stacked with axis and legend', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const withStackedLogYAxis = () => { + return ( + + + Number(d).toFixed(2)} + /> + + + + ); +}; +withStackedLogYAxis.story = { + name: 'with stacked log y axis', +}; - - - ); - }) - .add('stacked as percentage', () => { - const stackedAsPercentage = boolean('stacked as percentage', true); - const clusterBars = boolean('cluster', true); - - return ( - - - - (stackedAsPercentage && !clusterBars ? `${Number(d * 100).toFixed(0)} %` : d)} - /> +export const withAxisAndLegend = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +withAxisAndLegend.story = { + name: 'with axis and legend', +}; - - - ); - }) - .add('clustered with axis and legend', () => { - const theme = { - ...LIGHT_THEME, - scales: { - histogramPadding: number('histogram padding', 0.05, { - range: true, - min: 0, - max: 1, - step: 0.01, - }), - barsPadding: number('bar padding', 0.25, { - range: true, - min: 0, - max: 1, - step: 0.01, - }), - }, - }; +export const stackedWithAxisAndLegend = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +stackedWithAxisAndLegend.story = { + name: 'stacked with axis and legend', +}; - return ( - - - - Number(d).toFixed(2)} - /> +export const stackedAsPercentage = () => { + const stackedAsPercentage = boolean('stacked as percentage', true); + const clusterBars = boolean('cluster', true); + return ( + + + + (stackedAsPercentage && !clusterBars ? `${Number(d * 100).toFixed(0)} %` : d)} + /> + + + + ); +}; +stackedAsPercentage.story = { + name: 'stacked as percentage', +}; - - - ); - }) - .add('clustered multiple series specs', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const clusteredWithAxisAndLegend = () => { + const theme = { + ...LIGHT_THEME, + scales: { + histogramPadding: number('histogram padding', 0.05, { + range: true, + min: 0, + max: 1, + step: 0.01, + }), + barsPadding: number('bar padding', 0.25, { + range: true, + min: 0, + max: 1, + step: 0.01, + }), + }, + }; + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +clusteredWithAxisAndLegend.story = { + name: 'clustered with axis and legend', +}; - - - - - ); - }) - .add('time clustered using various specs', () => { - const formatter = timeFormatter(niceTimeFormatByDay(1)); - return ( - - - - Number(d).toFixed(2)} - /> +export const clusteredMultipleSeriesSpecs = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + + + ); +}; +clusteredMultipleSeriesSpecs.story = { + name: 'clustered multiple series specs', +}; - - - - - ); - }) - .add('time stacked using various specs', () => { - const formatter = timeFormatter(niceTimeFormatByDay(1)); - return ( - - - - Number(d).toFixed(2)} - /> +export const timeClusteredUsingVariousSpecs = () => { + const formatter = timeFormatter(niceTimeFormatByDay(1)); + return ( + + + + Number(d).toFixed(2)} + /> + + + + + + ); +}; +timeClusteredUsingVariousSpecs.story = { + name: 'time clustered using various specs', +}; - - - - - ); - }) - .add('1y0g', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const timeStackedUsingVariousSpecs = () => { + const formatter = timeFormatter(niceTimeFormatByDay(1)); + return ( + + + + Number(d).toFixed(2)} + /> + + + + + + ); +}; +timeStackedUsingVariousSpecs.story = { + name: 'time stacked using various specs', +}; - - - ); - }) - .add('1y1g', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const barChart1y0g = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +barChart1y0g.story = { + name: '1y0g', +}; - - - ); - }) - .add('1y2g', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const barChart1y1g = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +barChart1y1g.story = { + name: '1y1g', +}; - - - ); - }) - .add('2y0g', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const barChart1y2g = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +barChart1y2g.story = { + name: '1y2g', +}; - - - ); - }) - .add('2y1g', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const barChart2y0g = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +barChart2y0g.story = { + name: '2y0g', +}; - - - ); - }) - .add('2y2g', () => { - const isVisibleFunction: FilterPredicate = (series) => { - return series.splitAccessors.size > 0 - ? series.specId === getSpecId('bars') && - series.yAccessor === 'y1' && - series.splitAccessors.get('g1') === 'cloudflare.com' - : series.specId === getSpecId('bars') && series.yAccessor === 'y1'; - }; +export const barChart2y1g = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +barChart2y1g.story = { + name: '2y1g', +}; - return ( - - - - Number(d).toFixed(2)} - /> +export const barChart2y2g = () => { + const isVisibleFunction: FilterPredicate = (series) => { + return series.splitAccessors.size > 0 + ? series.specId === getSpecId('bars') && + series.yAccessor === 'y1' && + series.splitAccessors.get('g1') === 'cloudflare.com' + : series.specId === getSpecId('bars') && series.yAccessor === 'y1'; + }; + + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +barChart2y2g.story = { + name: '2y2g', +}; - - - ); - }) - .add('tooltip series visibility', () => { - const isVisibleFunction: FilterPredicate = (series) => { - return series.splitAccessors.get('g1') === 'cloudflare.com'; - }; +export const tooltipSeriesVisibility = () => { + const isVisibleFunction: FilterPredicate = (series) => { + return series.splitAccessors.get('g1') === 'cloudflare.com'; + }; + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +tooltipSeriesVisibility.story = { + name: 'tooltip series visibility', +}; - return ( - - - - Number(d).toFixed(2)} - /> +export const withHighDataVolume = () => { + const dg = new SeededDataGenerator(); + const data = dg.generateSimpleSeries(15000); + const tooltipProps = { + type: TooltipType.Follow, + }; + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +withHighDataVolume.story = { + name: 'with high data volume', + info: { + source: false, + }, +}; - - - ); - }) - .add( - 'with high data volume', - () => { - const dg = new SeededDataGenerator(); - const data = dg.generateSimpleSeries(15000); - const tooltipProps = { - type: TooltipType.Follow, - }; - - return ( - - - - Number(d).toFixed(2)} - /> - - - - ); +export const singleDataChartLinear = () => { + const hasCustomDomain = boolean('has custom domain', false); + const xDomain = hasCustomDomain + ? { + min: 0, + } + : undefined; + + const theme = { + scales: { + barsPadding: number('bars padding', 0.25, { + range: true, + min: 0, + max: 1, + step: 0.1, + }), }, - { - info: { - source: false, - }, + }; + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +singleDataChartLinear.story = { + name: 'single data chart [linear]', +}; + +export const singleDataChartOrdinal = () => { + const hasCustomDomain = boolean('has custom domain', false); + const xDomain = hasCustomDomain ? ['a', 'b'] : undefined; + + const theme = { + scales: { + barsPadding: number('bars padding', 0.25, { + range: true, + min: 0, + max: 1, + step: 0.1, + }), }, - ) - .add('single data chart [linear]', () => { - const hasCustomDomain = boolean('has custom domain', false); - const xDomain = hasCustomDomain - ? { - min: 0, - } - : undefined; - - const theme = { - scales: { - barsPadding: number('bars padding', 0.25, { - range: true, - min: 0, - max: 1, - step: 0.1, - }), - }, - }; + }; + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +singleDataChartOrdinal.story = { + name: 'single data chart [ordinal]', +}; - return ( - - - - Number(d).toFixed(2)} - /> +export const singleDataClusteredChart = () => { + return ( + + + Number(d).toFixed(2)} + /> + + + + ); +}; +singleDataClusteredChart.story = { + name: 'single data clusterd chart', +}; - - - ); - }) - .add('single data chart [ordinal]', () => { - const hasCustomDomain = boolean('has custom domain', false); - const xDomain = hasCustomDomain ? ['a', 'b'] : undefined; - - const theme = { - scales: { - barsPadding: number('bars padding', 0.25, { - range: true, - min: 0, - max: 1, - step: 0.1, - }), - }, - }; +export const singleDataStackedChart = () => { + return ( + + + Number(d).toFixed(2)} + /> + + + + ); +}; +singleDataStackedChart.story = { + name: 'single data stacked chart', +}; - return ( - - - - Number(d).toFixed(2)} - /> +export const singldedatachartstackedtoextent = () => { + return ( + + + Number(d).toFixed(2)} + /> + + + + ); +}; +singldedatachartstackedtoextent.story = { + name: 'single data stacked chart scale to extent', +}; - - - ); - }) - .add('single data clusterd chart', () => { - return ( - - - Number(d).toFixed(2)} - /> +export const singleDataClusteredChartScaleToExtent = () => { + return ( + + + Number(d).toFixed(2)} + /> + + + + ); +}; +singleDataClusteredChartScaleToExtent.story = { + name: 'single data clustered chart scale to extent', +}; - - - ); - }) - .add('single data stacked chart', () => { - return ( - - - Number(d).toFixed(2)} - /> +export const negativeAndPositiveXValues = () => { + return ( + + + Number(d).toFixed(2)} + /> + + + + ); +}; +negativeAndPositiveXValues.story = { + name: 'negative and positive x values', +}; - - - ); - }) - .add('single data stacked chart scale to extent', () => { - return ( - - - Number(d).toFixed(2)} - /> +export const scaleToExtent = () => { + const yScaleToDataExtent = boolean('yScaleDataToExtent', true); + const mixed = [ + { x: 0, y: -4 }, + { x: 1, y: -3 }, + { x: 2, y: 2 }, + { x: 3, y: 1 }, + ]; - - - ); - }) - .add('single data clustered chart scale to extent', () => { - return ( - - - Number(d).toFixed(2)} - /> + const allPositive = mixed.map((datum) => ({ x: datum.x, y: Math.abs(datum.y) })); + const allNegative = mixed.map((datum) => ({ x: datum.x, y: Math.abs(datum.y) * -1 })); - - - ); - }) - .add('negative and positive x values', () => { - return ( - - - Number(d).toFixed(2)} - /> + const dataChoice = select( + 'data', + { + mixed: 'mixed', + allPositive: 'all positive', + allNegative: 'all negative', + }, + 'all negative', + ); + + let data = mixed; + switch (dataChoice) { + case 'all positive': + data = allPositive; + break; + case 'all negative': + data = allNegative; + break; + } + return ( + + + Number(d).toFixed(2)} + /> + + + + ); +}; +scaleToExtent.story = { + name: 'scale to extent', +}; - - - ); - }) - .add('scale to extent', () => { - const yScaleToDataExtent = boolean('yScaleDataToExtent', true); - const mixed = [ - { x: 0, y: -4 }, - { x: 1, y: -3 }, - { x: 2, y: 2 }, - { x: 3, y: 1 }, - ]; - - const allPositive = mixed.map((datum) => ({ x: datum.x, y: Math.abs(datum.y) })); - const allNegative = mixed.map((datum) => ({ x: datum.x, y: Math.abs(datum.y) * -1 })); - - const dataChoice = select( - 'data', - { - mixed: 'mixed', - allPositive: 'all positive', - allNegative: 'all negative', - }, - 'all negative', - ); +export const bandBarChart = () => { + const data = KIBANA_METRICS.metrics.kibana_os_load[0].data.map((d: any) => { + return { + x: d[0], + max: d[1] + 4 + 4 * getRandomNumber(), + min: d[1] - 4 - 4 * getRandomNumber(), + }; + }); + const lineData = KIBANA_METRICS.metrics.kibana_os_load[0].data.map((d: any) => { + return [d[0], d[1]]; + }); + const scaleToDataExtent = boolean('scale to extent', true); + return ( + + + Number(d).toFixed(2)} + /> + + + + + + ); +}; +bandBarChart.story = { + name: 'band bar chart', +}; - let data = mixed; - switch (dataChoice) { - case 'all positive': - data = allPositive; - break; - case 'all negative': - data = allNegative; - break; - } - - return ( - - - Number(d).toFixed(2)} - /> +export const testLinear = () => { + const data = [ + [1, 1], + [2, 2], + [3, 3], + [4, 4], + [5, 5], + [6, 4], + [7, 3], + [8, 2], + [9, 1], + ]; + return ( + + + Number(d).toFixed(2)} + /> + + + ); +}; +testLinear.story = { + name: '[test] - linear', +}; - - - ); - }) - .add('band bar chart', () => { - const data = KIBANA_METRICS.metrics.kibana_os_load[0].data.map((d: any) => { - return { - x: d[0], - max: d[1] + 4 + 4 * getRandomNumber(), - min: d[1] - 4 - 4 * getRandomNumber(), - }; - }); - const lineData = KIBANA_METRICS.metrics.kibana_os_load[0].data.map((d: any) => { - return [d[0], d[1]]; - }); - const scaleToDataExtent = boolean('scale to extent', true); - return ( - - - Number(d).toFixed(2)} - /> +export const testTime = () => { + const start = DateTime.fromISO('2019-01-01T00:00:00.000', { zone: 'utc' }); + const data = [ + [start.toMillis(), 1], + [start.plus({ minute: 1 }).toMillis(), 2], + [start.plus({ minute: 2 }).toMillis(), 3], + [start.plus({ minute: 3 }).toMillis(), 4], + [start.plus({ minute: 4 }).toMillis(), 5], + [start.plus({ minute: 5 }).toMillis(), 4], + [start.plus({ minute: 6 }).toMillis(), 3], + [start.plus({ minute: 7 }).toMillis(), 2], + [start.plus({ minute: 8 }).toMillis(), 1], + ]; + return ( + + + Number(d).toFixed(2)} + /> + + + ); +}; +testTime.story = { + name: '[test] - time', +}; - +export const testLinearClustered = () => { + const data9 = [ + [1, 1, 3], + [2, 2, 4], + [3, 3, 5], + [4, 4, 6], + [5, 5, 7], + [6, 4, 6], + [7, 3, 5], + [8, 2, 4], + [9, 1, 3], + ]; + return ( + + + Number(d).toFixed(2)} + /> + + + ); +}; +testLinearClustered.story = { + name: '[test] - linear clustered', +}; - - - ); - }) - .add('[test] - linear', () => { - const data = [ - [1, 1], - [2, 2], - [3, 3], - [4, 4], - [5, 5], - [6, 4], - [7, 3], - [8, 2], - [9, 1], - ]; - return ( - - - Number(d).toFixed(2)} - /> - - - ); - }) - .add('[test] - time', () => { - const start = DateTime.fromISO('2019-01-01T00:00:00.000', { zone: 'utc' }); - const data = [ - [start.toMillis(), 1], - [start.plus({ minute: 1 }).toMillis(), 2], - [start.plus({ minute: 2 }).toMillis(), 3], - [start.plus({ minute: 3 }).toMillis(), 4], - [start.plus({ minute: 4 }).toMillis(), 5], - [start.plus({ minute: 5 }).toMillis(), 4], - [start.plus({ minute: 6 }).toMillis(), 3], - [start.plus({ minute: 7 }).toMillis(), 2], - [start.plus({ minute: 8 }).toMillis(), 1], - ]; - return ( - - - Number(d).toFixed(2)} - /> - - - ); - }) - .add('[test] - linear clustered', () => { - const data = [ - [1, 1, 3], - [2, 2, 4], - [3, 3, 5], - [4, 4, 6], - [5, 5, 7], - [6, 4, 6], - [7, 3, 5], - [8, 2, 4], - [9, 1, 3], - ]; - return ( - - - Number(d).toFixed(2)} - /> - - - ); - }) - .add('[test] - time clustered', () => { - const start = DateTime.fromISO('2019-01-01T00:00:00.000', { zone: 'utc' }); - const data = [ - [start.toMillis(), 1, 4], - [start.plus({ minute: 1 }).toMillis(), 2, 5], - [start.plus({ minute: 2 }).toMillis(), 3, 6], - [start.plus({ minute: 3 }).toMillis(), 4, 7], - [start.plus({ minute: 4 }).toMillis(), 5, 8], - [start.plus({ minute: 5 }).toMillis(), 4, 7], - [start.plus({ minute: 6 }).toMillis(), 3, 6], - [start.plus({ minute: 7 }).toMillis(), 2, 5], - [start.plus({ minute: 8 }).toMillis(), 1, 4], - ]; - return ( - - - Number(d).toFixed(2)} - /> - - - ); - }) - .add('[test] - clustered bar chart with null bars', () => { - const data = [ - [1, 1, 3, 'a'], - [2, null, 4, 'a'], - [3, 3, 5, 'a'], - [4, 4, 6, 'a'], - [1, 1, 3, 'b'], - [2, 2, 4, 'b'], - [3, 3, 5, 'b'], - [4, 4, 6, 'b'], - ]; - return ( - - - Number(d).toFixed(2)} - /> - - - ); - }) - .add('[test] - stacked bar chart with null bars', () => { - const data = [ - [1, 1, 3, 'a'], - [2, null, 4, 'a'], - [3, 3, 5, 'a'], - [4, 4, 6, 'a'], - [1, 1, 3, 'b'], - [2, 2, 4, 'b'], - [3, null, 5, 'b'], - [4, 4, 6, 'b'], - ]; - return ( - - - Number(d).toFixed(2)} - /> - - - ); - }) - .add('[test] switch ordinal/linear x axis', () => { - return ( - - - Number(d).toFixed(2)} - /> +export const testTimeClustered = () => { + const start = DateTime.fromISO('2019-01-01T00:00:00.000', { zone: 'utc' }); + const data = [ + [start.toMillis(), 1, 4], + [start.plus({ minute: 1 }).toMillis(), 2, 5], + [start.plus({ minute: 2 }).toMillis(), 3, 6], + [start.plus({ minute: 3 }).toMillis(), 4, 7], + [start.plus({ minute: 4 }).toMillis(), 5, 8], + [start.plus({ minute: 5 }).toMillis(), 4, 7], + [start.plus({ minute: 6 }).toMillis(), 3, 6], + [start.plus({ minute: 7 }).toMillis(), 2, 5], + [start.plus({ minute: 8 }).toMillis(), 1, 4], + ]; + return ( + + + Number(d).toFixed(2)} + /> + + + ); +}; +testTimeClustered.story = { + name: '[test] - time clustered', +}; - - - ); - }) - .add('[test] histogram mode (linear)', () => { - const data = TestDatasets.BARCHART_2Y1G; - - const lineAnnotationStyle = { - line: { - strokeWidth: 2, - stroke: '#c80000', - opacity: 0.3, - }, - }; +export const testClusteredBarChartWithNullBars = () => { + const data = [ + [1, 1, 3, 'a'], + [2, null, 4, 'a'], + [3, 3, 5, 'a'], + [4, 4, 6, 'a'], + [1, 1, 3, 'b'], + [2, 2, 4, 'b'], + [3, 3, 5, 'b'], + [4, 4, 6, 'b'], + ]; + return ( + + + Number(d).toFixed(2)} + /> + + + ); +}; +testClusteredBarChartWithNullBars.story = { + name: '[test] - clustered bar chart with null bars', +}; - const theme = { - scales: { - barsPadding: number('bars padding', 0.25, { - range: true, - min: 0, - max: 1, - step: 0.1, - }), - histogramPadding: number('histogram padding', 0.05, { - range: true, - min: 0, - max: 1, - step: 0.1, - }), - }, - }; +export const testStackedBarChartWithNullBars = () => { + const data = [ + [1, 1, 3, 'a'], + [2, null, 4, 'a'], + [3, 3, 5, 'a'], + [4, 4, 6, 'a'], + [1, 1, 3, 'b'], + [2, 2, 4, 'b'], + [3, null, 5, 'b'], + [4, 4, 6, 'b'], + ]; + return ( + + + Number(d).toFixed(2)} + /> + + + ); +}; +testStackedBarChartWithNullBars.story = { + name: '[test] - stacked bar chart with null bars', +}; - const otherSeriesSelection = select( - 'other series', - { - line: 'line', - area: 'area', - }, - 'line', - ); +export const testSwitchOrdinalLinearAxis = () => { + return ( + + + Number(d).toFixed(2)} + /> + + + + ); +}; +testSwitchOrdinalLinearAxis.story = { + name: '[test] switch ordinal/linear x axis', +}; - const pointAlignment = select('point series alignment', HistogramModeAlignments, HistogramModeAlignments.Center); - const pointData = TestDatasets.BARCHART_1Y0G; +export const testHistogramModeLinear = () => { + const data = TestDatasets.BARCHART_2Y1G; - const otherSeries = - otherSeriesSelection === 'line' ? ( - - ) : ( - - ); - - const hasHistogramBarSeries = boolean('hasHistogramBarSeries', false); - - return ( - - - } - /> - + ) : ( + + ); + + const hasHistogramBarSeries = boolean('hasHistogramBarSeries', false); + return ( + + + } + /> + - - - {hasHistogramBarSeries && ( - - )} - + + + {hasHistogramBarSeries && ( + - - {otherSeries} - - ); - }) - .add('[test] histogram mode (ordinal)', () => { - const data = [ - { x: 'a', y: 2 }, - { x: 'b', y: 7 }, - { x: 'c', y: 0 }, - { x: 'd', y: 6 }, - ]; - const theme = { - scales: { - barsPadding: number('bars padding', 0.25, { - range: true, - min: 0, - max: 1, - step: 0.1, - }), - }, - }; + name={'histogram'} + /> + )} + + + {otherSeries} + + ); +}; +testHistogramModeLinear.story = { + name: '[test] histogram mode (linear)', +}; - const hasHistogramBarSeries = boolean('hasHistogramBarSeries', false); - - return ( - - - - - {hasHistogramBarSeries && ( - - )} - - { + const data = [ + { x: 'a', y: 2 }, + { x: 'b', y: 7 }, + { x: 'c', y: 0 }, + { x: 'd', y: 6 }, + ]; + const theme = { + scales: { + barsPadding: number('bars padding', 0.25, { + range: true, + min: 0, + max: 1, + step: 0.1, + }), + }, + }; + + const hasHistogramBarSeries = boolean('hasHistogramBarSeries', false); + return ( + + + + + {hasHistogramBarSeries && ( + - - ); - }) - .add('[test] discover', () => { - const data = TEST_DATASET_DISCOVER.series[0].values; - - const formatter = timeFormatter(niceTimeFormatByDay(1)); - - const xDomain = { - minInterval: 30000, - }; - - const useCustomMinInterval = boolean('use custom minInterval of 30s', true); + name={'histogram'} + /> + )} + + + + ); +}; +testHistogramModeOrdinal.story = { + name: '[test] histogram mode (ordinal)', +}; - return ( - - - - +export const testDiscover = () => { + const data = TEST_DATASET_DISCOVER.series[0].values; + + const formatter = timeFormatter(niceTimeFormatByDay(1)); + + const xDomain = { + minInterval: 30000, + }; + + const useCustomMinInterval = boolean('use custom minInterval of 30s', true); + return ( + + + + + + + + ); +}; +testDiscover.story = { + name: '[test] discover', +}; - - - ); - }) - .add('[test] single histogram bar chart', () => { - const formatter = timeFormatter(niceTimeFormatByDay(1)); +export const testSingleHistogramBarChart = () => { + const formatter = timeFormatter(niceTimeFormatByDay(1)); + + const xDomain = { + minInterval: 60000, + }; + + return ( + + + + + + + ); +}; +testSingleHistogramBarChart.story = { + name: '[test] single histogram bar chart', +}; - const xDomain = { - minInterval: 60000, - }; +export const MinHeight = () => { + const minBarHeight = number('minBarHeight', 5); + const data = [ + [1, 100000], + [2, 10000], + [3, 1000], + [4, 100], + [5, 10], + [6, 1], + [7, 0], + [8, 1], + [9, 0], + ]; + return ( + + + + + + ); +}; +MinHeight.story = { + name: 'Min Height', +}; - return ( - - - - - - - ); - }) - .add('Min Height', () => { - const minBarHeight = number('minBarHeight', 5); - const data = [ - [1, 100000], - [2, 10000], - [3, 1000], - [4, 100], - [5, 10], - [6, 1], - [7, 0], - [8, 1], - [9, 0], - ]; - return ( - - - - - - ); - }) - .add('[Test] Min Height - positive and negative values', () => { - const minBarHeight = number('minBarHeight', 10); - const data = [ - [1, -100000], - [2, -10000], - [3, -1000], - [4, -100], - [5, -10], - [6, -1], - [7, 0], - [8, -1], - [9, 0], - [10, 0], - [11, 1], - [12, 0], - [13, 1], - [14, 10], - [15, 100], - [16, 1000], - [17, 10000], - [18, 100000], - ]; - return ( - - - - - - ); - }) - .add('stacked only grouped areas', () => { - const data1 = [ - [1, 2], - [2, 2], - [3, 3], - [4, 5], - [5, 5], - [6, 3], - [7, 8], - [8, 2], - [9, 1], - ]; - const data2 = [ - [1, 1], - [2, 2], - [3, 3], - [4, 4], - [5, 5], - [6, 4], - [7, 3], - [8, 2], - [9, 4], - ]; - const data3 = [ - [1, 6], - [2, 6], - [3, 3], - [4, 2], - [5, 1], - [6, 1], - [7, 5], - [8, 6], - [9, 7], - ]; - const data4 = [ - [1, 2], - [2, 6], - [3, 2], - [4, 9], - [5, 2], - [6, 3], - [7, 1], - [8, 2], - [9, 7], - ]; - const data5 = [ - [1, 1], - [2, 7], - [3, 5], - [4, 6], - [5, 5], - [6, 4], - [7, 2], - [8, 4], - [9, 8], - ]; - return ( - - - Number(d).toFixed(2)} - domain={{ min: 0, max: 15 }} - /> - Number(d).toFixed(2)} - hide={true} - domain={{ min: 0, max: 15 }} - /> - - +export const testMinHeightPositiveAndNegativeValues = () => { + const minBarHeight = number('minBarHeight', 10); + const data = [ + [1, -100000], + [2, -10000], + [3, -1000], + [4, -100], + [5, -10], + [6, -1], + [7, 0], + [8, -1], + [9, 0], + [10, 0], + [11, 1], + [12, 0], + [13, 1], + [14, 10], + [15, 100], + [16, 1000], + [17, 10000], + [18, 100000], + ]; + return ( + + + + + + ); +}; +testMinHeightPositiveAndNegativeValues.story = { + name: '[Test] Min Height - positive and negative values', +}; - - - - - ); - }) - .add('[test] tooltip and rotation', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const stackedOnlyGroupedAreas = () => { + const data1 = [ + [1, 2], + [2, 2], + [3, 3], + [4, 5], + [5, 5], + [6, 3], + [7, 8], + [8, 2], + [9, 1], + ]; + const data2 = [ + [1, 1], + [2, 2], + [3, 3], + [4, 4], + [5, 5], + [6, 4], + [7, 3], + [8, 2], + [9, 4], + ]; + const data3 = [ + [1, 6], + [2, 6], + [3, 3], + [4, 2], + [5, 1], + [6, 1], + [7, 5], + [8, 6], + [9, 7], + ]; + const data4 = [ + [1, 2], + [2, 6], + [3, 2], + [4, 9], + [5, 2], + [6, 3], + [7, 1], + [8, 2], + [9, 7], + ]; + const data5 = [ + [1, 1], + [2, 7], + [3, 5], + [4, 6], + [5, 5], + [6, 4], + [7, 2], + [8, 4], + [9, 8], + ]; + return ( + + + Number(d).toFixed(2)} + domain={{ min: 0, max: 15 }} + /> + Number(d).toFixed(2)} + hide={true} + domain={{ min: 0, max: 15 }} + /> + + + + + + + + ); +}; +stackedOnlyGroupedAreas.story = { + name: 'stacked only grouped areas', +}; - - - ); - }); +export const testTooltipAndRotation = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +testTooltipAndRotation.story = { + name: '[test] tooltip and rotation', +}; diff --git a/stories/grid.tsx b/stories/grid.tsx index 7a1620c5a3..15ef64ac21 100644 --- a/stories/grid.tsx +++ b/stories/grid.tsx @@ -1,5 +1,4 @@ import { boolean, color, number } from '@storybook/addon-knobs'; -import { storiesOf } from '@storybook/react'; import React from 'react'; import { Axis, @@ -69,147 +68,162 @@ function generateGridLineConfig(group: string, gridColor = 'purple'): GridLineCo }; } -storiesOf('Grids', module) - .add('basic', () => { - const leftAxisGridLineConfig = generateGridLineConfig(Position.Left, 'lightblue'); - const rightAxisGridLineConfig = generateGridLineConfig(Position.Right, 'red'); - const topAxisGridLineConfig = generateGridLineConfig(Position.Top, 'teal'); - const bottomAxisGridLineConfig = generateGridLineConfig(Position.Bottom, 'blue'); - const toggleBottomAxisGridLineStyle = boolean('use axis gridLineStyle vertically', false, 'bottom axis'); - const toggleHorizontalAxisGridLineStyle = boolean('use axis gridLineStyle horizontally', false, 'left axis'); - const bottomAxisThemeGridLineConfig = generateGridLineConfig('Vertical Axis Theme', 'violet'); - const leftAxisThemeGridLineConfig = generateGridLineConfig('Horizontal Axis Theme', 'hotpink'); - const theme = { - axes: { - gridLineStyle: { vertical: leftAxisThemeGridLineConfig, horizontal: bottomAxisThemeGridLineConfig }, - }, - }; - const integersOnlyLeft = boolean('left axis show only integer values', false, 'left axis'); - const integersOnlyRight = boolean('right axis show only intger values', false, 'right axis'); - return ( - - - - Number(d).toFixed(0) : (d) => Number(d).toFixed(2)} - showGridLines={boolean('show left axis grid lines', false, 'left axis')} - gridLineStyle={toggleHorizontalAxisGridLineStyle ? leftAxisGridLineConfig : undefined} - integersOnly={integersOnlyLeft} - /> - - Number(d).toFixed(0) : (d) => Number(d).toFixed(2)} - showGridLines={boolean('show right axis grid lines', false, 'right axis')} - gridLineStyle={rightAxisGridLineConfig} - integersOnly={integersOnlyRight} - /> - - - - ); - }) - .add('multiple axes with the same position', () => { - const leftAxisGridLineConfig = generateGridLineConfig(Position.Left); - const leftAxisGridLineConfig2 = generateGridLineConfig(`${Position.Left}2`); +export default { + title: 'Grids', + parameters: { + info: { + source: false, + }, + }, +}; + +export const basic = () => { + const leftAxisGridLineConfig = generateGridLineConfig(Position.Left, 'lightblue'); + const rightAxisGridLineConfig = generateGridLineConfig(Position.Right, 'red'); + const topAxisGridLineConfig = generateGridLineConfig(Position.Top, 'teal'); + const bottomAxisGridLineConfig = generateGridLineConfig(Position.Bottom, 'blue'); + const toggleBottomAxisGridLineStyle = boolean('use axis gridLineStyle vertically', false, 'bottom axis'); + const toggleHorizontalAxisGridLineStyle = boolean('use axis gridLineStyle horizontally', false, 'left axis'); + const bottomAxisThemeGridLineConfig = generateGridLineConfig('Vertical Axis Theme', 'violet'); + const leftAxisThemeGridLineConfig = generateGridLineConfig('Horizontal Axis Theme', 'hotpink'); + const theme = { + axes: { + gridLineStyle: { vertical: leftAxisThemeGridLineConfig, horizontal: bottomAxisThemeGridLineConfig }, + }, + }; + const integersOnlyLeft = boolean('left axis show only integer values', false, 'left axis'); + const integersOnlyRight = boolean('right axis show only intger values', false, 'right axis'); + return ( + + + + Number(d).toFixed(0) : (d) => Number(d).toFixed(2)} + showGridLines={boolean('show left axis grid lines', false, 'left axis')} + gridLineStyle={toggleHorizontalAxisGridLineStyle ? leftAxisGridLineConfig : undefined} + integersOnly={integersOnlyLeft} + /> + + Number(d).toFixed(0) : (d) => Number(d).toFixed(2)} + showGridLines={boolean('show right axis grid lines', false, 'right axis')} + gridLineStyle={rightAxisGridLineConfig} + integersOnly={integersOnlyRight} + /> + + + + ); +}; +basic.story = { + name: 'basic', +}; + +export const multipleAxesWithTheSamePosition = () => { + const leftAxisGridLineConfig = generateGridLineConfig(Position.Left); + const leftAxisGridLineConfig2 = generateGridLineConfig(`${Position.Left}2`); - return ( - - - Number(d).toFixed(2)} - showGridLines={boolean('show left axis grid lines', false, 'left axis')} - gridLineStyle={leftAxisGridLineConfig} - /> - Number(d).toFixed(2)} - showGridLines={boolean('show left axis 2 grid lines', false, 'left2 axis')} - gridLineStyle={leftAxisGridLineConfig2} - /> - - - - ); - }); + return ( + + + Number(d).toFixed(2)} + showGridLines={boolean('show left axis grid lines', false, 'left axis')} + gridLineStyle={leftAxisGridLineConfig} + /> + Number(d).toFixed(2)} + showGridLines={boolean('show left axis 2 grid lines', false, 'left2 axis')} + gridLineStyle={leftAxisGridLineConfig2} + /> + + + + ); +}; +multipleAxesWithTheSamePosition.story = { + name: 'multiple axes with the same position', +}; diff --git a/stories/interactions.tsx b/stories/interactions.tsx index 3d31fb1474..5742560546 100644 --- a/stories/interactions.tsx +++ b/stories/interactions.tsx @@ -1,5 +1,4 @@ import { action } from '@storybook/addon-actions'; -import { storiesOf } from '@storybook/react'; import React from 'react'; import { AreaSeries, @@ -48,812 +47,870 @@ const onLegendItemListeners = { const onRenderChange = action('onRenderChange'); const onPointerUpdate = action('onPointerUpdate'); -storiesOf('Interactions', module) - .add('bar clicks and hovers', () => { - const headerFormatter: TooltipValueFormatter = (tooltipData: TooltipValue) => { - if (tooltipData.value % 2 === 0) { - return ( -
-

special header for even x values

-

{tooltipData.value}

-
- ); - } - - return tooltipData.value; - }; - - const tooltipProps = { - headerFormatter, - }; - - return ( - - - - Number(d).toFixed(2)} - /> +export default { + title: 'Interactions', + parameters: { + info: { + source: false, + }, + }, +}; - - - ); - }) - .add('area point clicks and hovers', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const barClicksAndHovers = () => { + const headerFormatter: TooltipValueFormatter = (tooltipData: TooltipValue) => { + if (tooltipData.value % 2 === 0) { + return ( +
+

special header for even x values

+

{tooltipData.value}

+
+ ); + } + + return tooltipData.value; + }; + + const tooltipProps = { + headerFormatter, + }; + + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +barClicksAndHovers.story = { + name: 'bar clicks and hovers', +}; - -
- ); - }) - .add('line point clicks and hovers', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const areaPointClicksAndHovers = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +areaPointClicksAndHovers.story = { + name: 'area point clicks and hovers', +}; - - - ); - }) - .add('line area bar point clicks and hovers', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const linePointClicksAndHovers = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +linePointClicksAndHovers.story = { + name: 'line point clicks and hovers', +}; - - - - - ); - }) - .add('click/hovers on legend items [bar chart]', () => { - const notSpecChange = 'not spec change'; - const specChange = 'spec change'; - - const xDomain = { - min: number('xDomain min', 0, {}, notSpecChange), - max: number('xDomain max', 6, {}, notSpecChange), - }; - - const yDomain = { - min: number('yDomain min', 0, {}, notSpecChange), - max: number('yDomain max', 10, {}, notSpecChange), - }; - - const yScaleTypeOptions: { [key: string]: typeof ScaleType.Linear | typeof ScaleType.Log } = { - linear: ScaleType.Linear, - log: ScaleType.Log, - }; - const yScaleType = select('yScaleType', yScaleTypeOptions, ScaleType.Linear, specChange); - - const xAccessorOptions = { x: 'x', y1: 'y1', y2: 'y2' }; - const xAccessor = select('xAccessor', xAccessorOptions, 'x', notSpecChange); - - const yScaleToDataExtent = boolean('yScaleDataToExtent', false, specChange); - - const splitSeriesAccessors = array('split series accessors', ['g1', 'g2'], ',', specChange); - - const hasY2 = boolean('has y2 yAccessor', true, specChange); - const yAccessors = hasY2 ? ['y1', 'y2'] : ['y1']; - - const additionalG1Value = { x: 4, g1: '$$$$$$$$', g2: 'indirect-cdn', y1: 7, y2: 3 }; - const hasAdditionalG1Value = boolean('has additional g1 value', false, specChange); - - const seriesData = BARCHART_2Y2G; - - const data = hasAdditionalG1Value ? [...seriesData, additionalG1Value] : seriesData; - - return ( - - - - Number(d).toFixed(2)} - domain={yDomain} - /> +export const lineAreaBarPointClicksAndHovers = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + + + ); +}; +lineAreaBarPointClicksAndHovers.story = { + name: 'line area bar point clicks and hovers', +}; - - - ); - }) - .add('click/hovers on legend items [area chart]', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const clicksHoversOnLegendItemsBarChart = () => { + const notSpecChange = 'not spec change'; + const specChange = 'spec change'; + + const xDomain = { + min: number('xDomain min', 0, {}, notSpecChange), + max: number('xDomain max', 6, {}, notSpecChange), + }; + + const yDomain = { + min: number('yDomain min', 0, {}, notSpecChange), + max: number('yDomain max', 10, {}, notSpecChange), + }; + + const yScaleTypeOptions: { [key: string]: typeof ScaleType.Linear | typeof ScaleType.Log } = { + linear: ScaleType.Linear, + log: ScaleType.Log, + }; + const yScaleType = select('yScaleType', yScaleTypeOptions, ScaleType.Linear, specChange); + + const xAccessorOptions = { x: 'x', y1: 'y1', y2: 'y2' }; + const xAccessor = select('xAccessor', xAccessorOptions, 'x', notSpecChange); + + const yScaleToDataExtent = boolean('yScaleDataToExtent', false, specChange); + + const splitSeriesAccessors = array('split series accessors', ['g1', 'g2'], ',', specChange); + + const hasY2 = boolean('has y2 yAccessor', true, specChange); + const yAccessors = hasY2 ? ['y1', 'y2'] : ['y1']; + + const additionalG1Value = { x: 4, g1: '$$$$$$$$', g2: 'indirect-cdn', y1: 7, y2: 3 }; + const hasAdditionalG1Value = boolean('has additional g1 value', false, specChange); + + const seriesData = BARCHART_2Y2G; + + const data = hasAdditionalG1Value ? [...seriesData, additionalG1Value] : seriesData; + + return ( + + + + Number(d).toFixed(2)} + domain={yDomain} + /> + + + + ); +}; +clicksHoversOnLegendItemsBarChart.story = { + name: 'click/hovers on legend items [bar chart]', +}; - - - ); - }) - .add('click/hovers on legend items [line chart]', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const clickHoversOnLegendItemsAreaChart = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +clickHoversOnLegendItemsAreaChart.story = { + name: 'click/hovers on legend items [area chart]', +}; - - - - - - - - ); - }) - .add('click/hovers on legend items [mixed chart]', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const clickHoversOnLegendItemsLineChart = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + + + + + + ); +}; +clickHoversOnLegendItemsLineChart.story = { + name: 'click/hovers on legend items [line chart]', +}; - - - - ); - }) - .add('brush selection tool on linear', () => { - return ( - - - - Number(d).toFixed(2)} /> - - Number(d).toFixed(2)} - /> +export const clickHoversOnLegendItemsMixedChart = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + + ); +}; +clickHoversOnLegendItemsMixedChart.story = { + name: 'click/hovers on legend items [mixed chart]', +}; - - - ); - }) - .add('brush selection tool on bar chart linear', () => { - return ( - - - - Number(d).toFixed(2)} /> - - Number(d).toFixed(2)} - /> +export const brushSelectionToolOnLinear = () => { + return ( + + + + Number(d).toFixed(2)} /> + + Number(d).toFixed(2)} + /> + + + + ); +}; +brushSelectionToolOnLinear.story = { + name: 'brush selection tool on linear', +}; - - - ); - }) - .add('brush selection tool on time charts', () => { - const now = DateTime.fromISO('2019-01-11T00:00:00.000') - .setZone('utc+1') - .toMillis(); - const oneDay = 1000 * 60 * 60 * 24; - const formatter = niceTimeFormatter([now, now + oneDay * 5]); - return ( - - { - action('onBrushEnd')(formatter(start), formatter(end)); - }} - onElementClick={action('onElementClick')} - /> - - Number(d).toFixed(2)} /> +export const brushSelectionToolOnBarChartLinear = () => { + return ( + + + + Number(d).toFixed(2)} /> + + Number(d).toFixed(2)} + /> + + + + ); +}; +brushSelectionToolOnBarChartLinear.story = { + name: 'brush selection tool on bar chart linear', +}; - - - - ); - }) - .add('brush selection tool on histogram time charts', () => { - const now = DateTime.fromISO('2019-01-11T00:00:00.000') - .setZone('utc+1') - .toMillis(); - const oneDay = 1000 * 60 * 60 * 24; - const formatter = niceTimeFormatter([now, now + oneDay * 5]); - return ( - - { - action('onBrushEnd')(formatter(start), formatter(end)); - }} - onElementClick={action('onElementClick')} - /> - - Number(d).toFixed(2)} /> +export const brushSelectionToolOnTimeCharts = () => { + const now = DateTime.fromISO('2019-01-11T00:00:00.000') + .setZone('utc+1') + .toMillis(); + const oneDay = 1000 * 60 * 60 * 24; + const formatter = niceTimeFormatter([now, now + oneDay * 5]); + return ( + + { + action('onBrushEnd')(formatter(start), formatter(end)); + }} + onElementClick={action('onElementClick')} + /> + + Number(d).toFixed(2)} /> + + + + + ); +}; +brushSelectionToolOnTimeCharts.story = { + name: 'brush selection tool on time charts', +}; + +export const brushSelectionToolOnHistogramTimeCharts = () => { + const now = DateTime.fromISO('2019-01-11T00:00:00.000') + .setZone('utc+1') + .toMillis(); + const oneDay = 1000 * 60 * 60 * 24; + const formatter = niceTimeFormatter([now, now + oneDay * 5]); + return ( + + { + action('onBrushEnd')(formatter(start), formatter(end)); + }} + onElementClick={action('onElementClick')} + /> + + Number(d).toFixed(2)} /> + + + + ); +}; +brushSelectionToolOnHistogramTimeCharts.story = { + name: 'brush selection tool on histogram time charts', +}; - { + return ( + + + + + + + ); +}; +brushDisabledOnOrdinalXAxis.story = { + name: 'brush disabled on ordinal x axis', +}; + +export const crosshairWithTimeAxis = () => { + const hideBars = boolean('hideBars', false); + const formatter = timeFormatter(niceTimeFormatByDay(1)); + const darkmode = boolean('darkmode', false); + const className = darkmode ? 'story-chart-dark' : 'story-chart'; + const defaultTheme = darkmode ? DARK_THEME : LIGHT_THEME; + switchTheme(darkmode ? 'dark' : 'light'); + const chartRotation = getChartRotationKnob(); + const numberFormatter = (d: any) => Number(d).toFixed(2); + + const tooltipType = select( + 'tooltipType', + { + cross: TooltipType.Crosshairs, + vertical: TooltipType.VerticalCursor, + follow: TooltipType.Follow, + none: TooltipType.None, + }, + TooltipType.Crosshairs, + ); + + const tooltipProps = { + type: tooltipType, + snap: boolean('tooltip snap to grid', true), + }; + + return ( + + + + + {!hideBars && ( + - - ); - }) - .add('brush disabled on ordinal x axis', () => { - return ( - - - - - - - ); - }) - .add('crosshair with time axis', () => { - const hideBars = boolean('hideBars', false); - const formatter = timeFormatter(niceTimeFormatByDay(1)); - const darkmode = boolean('darkmode', false); - const className = darkmode ? 'story-chart-dark' : 'story-chart'; - const defaultTheme = darkmode ? DARK_THEME : LIGHT_THEME; - switchTheme(darkmode ? 'dark' : 'light'); - const chartRotation = getChartRotationKnob(); - const numberFormatter = (d: any) => Number(d).toFixed(2); - - const tooltipType = select( - 'tooltipType', - { - cross: TooltipType.Crosshairs, - vertical: TooltipType.VerticalCursor, - follow: TooltipType.Follow, - none: TooltipType.None, - }, - TooltipType.Crosshairs, - ); - - const tooltipProps = { - type: tooltipType, - snap: boolean('tooltip snap to grid', true), - }; - - return ( - - - - - {!hideBars && ( - - )} - {!hideBars && ( - - )} - - - ); - }) - .add( - 'Render change action', - () => { - return ( - - - - Number(d).toFixed(2)} - /> - - - - ); - }, - { - info: { - text: - 'Sends an event every time the chart render state changes. This is provided to bind attributes to the chart for visulaization loading checks.', - }, - }, - ) - .add( - 'Cursor update action', - () => { - return ( - - - - Number(d).toFixed(2)} - /> - - - - ); - }, - { - info: { - text: 'Sends an event every time the cursor changes. This is provided to sync cursors between multiple charts.', - }, - }, - ) - .add( - 'PNG export action', - () => { - /** - * The handler section of this story demonstrates the PNG export functionality - */ - const data = KIBANA_METRICS.metrics.kibana_os_load[0].data.slice(0, 100); - const label = 'Export PNG'; - const chartRef: React.RefObject = React.createRef(); - const handler = () => { - if (!chartRef.current) { - return; - } - const snapshot = chartRef.current.getPNGSnapshot({ - // you can set the background and pixel ratio for the PNG export - backgroundColor: 'white', - pixelRatio: 2, - }); - if (!snapshot) { - return; - } - // will save as chart.png - const fileName = 'chart.png'; - switch (snapshot.browser) { - case 'IE11': - return navigator.msSaveBlob(snapshot.blobOrDataUrl, fileName); - default: - const link = document.createElement('a'); - link.download = fileName; - link.href = snapshot.blobOrDataUrl; - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); - } - }; - const groupId = ''; - button(label, handler, groupId); - return ( - - - - - - - - ); - }, - { - info: { - text: - 'Generate a PNG of the chart by clicking on the Export PNG button in the knobs section. In this example, the button handler is setting the PNG background to white with a pixel ratio of 2. If the browser is detected to be IE11, msSaveBlob will be used instead of a PNG capture.', - }, - }, + stackAccessors={[0]} + data={KIBANA_METRICS.metrics.kibana_os_load[1].data.slice(0, 20)} + /> + )} + + + ); +}; +crosshairWithTimeAxis.story = { + name: 'crosshair with time axis', +}; + +export const renderChangeAction = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + ); +}; +renderChangeAction.story = { + name: 'Render change action', +}; +// info: { +// text: +// 'Sends an event every time the chart render state changes. This is provided to bind attributes to the chart for visulaization loading checks.', +// }, + +export const cursorUpdateAction = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +cursorUpdateAction.story = { + name: 'Cursor update action', + // info: { + // text: 'Sends an event every time the cursor changes. This is provided to sync cursors between multiple charts.', + // }, +}; + +export const pngExportAction = () => { + /** + * The handler section of this story demonstrates the PNG export functionality + */ + const data = KIBANA_METRICS.metrics.kibana_os_load[0].data.slice(0, 100); + const label = 'Export PNG'; + const chartRef: React.RefObject = React.createRef(); + const handler = () => { + if (!chartRef.current) { + return; + } + const snapshot = chartRef.current.getPNGSnapshot({ + // you can set the background and pixel ratio for the PNG export + backgroundColor: 'white', + pixelRatio: 2, + }); + if (!snapshot) { + return; + } + // will save as chart.png + const fileName = 'chart.png'; + switch (snapshot.browser) { + case 'IE11': + return navigator.msSaveBlob(snapshot.blobOrDataUrl, fileName); + default: + const link = document.createElement('a'); + link.download = fileName; + link.href = snapshot.blobOrDataUrl; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + } + }; + const groupId = ''; + button(label, handler, groupId); + return ( + + + + + + + + ); +}; +pngExportAction.story = { + name: 'PNG export action', +}; +// { +// info: { +// text: +// 'Generate a PNG of the chart by clicking on the Export PNG button in the knobs section. In this example, the button handler is setting the PNG background to white with a pixel ratio of 2. If the browser is detected to be IE11, msSaveBlob will be used instead of a PNG capture.', +// }, +// }, +// ); diff --git a/stories/legend.tsx b/stories/legend.tsx index 4cc4cf9e49..614215b481 100644 --- a/stories/legend.tsx +++ b/stories/legend.tsx @@ -1,5 +1,4 @@ import { boolean, select, number } from '@storybook/addon-knobs'; -import { storiesOf } from '@storybook/react'; import React from 'react'; import { AreaSeries, @@ -19,285 +18,322 @@ import * as TestDatasets from '../src/utils/data_samples/test_dataset'; import { TSVB_DATASET } from '../src/utils/data_samples/test_dataset_tsvb'; import { arrayKnobs } from './common'; -storiesOf('Legend', module) - .add('right', () => { - const yAccessors = ['y1', 'y2']; - const splitSeriesAccessors = ['g1', 'g2']; +export default { + title: 'Legend', + parameters: { + info: { + source: false, + }, + }, +}; - return ( - - - - Number(d).toFixed(2)} - /> +export const right = () => { + const yAccessors = ['y1', 'y2']; + const splitSeriesAccessors = ['g1', 'g2']; - - - ); - }) - .add('bottom', () => { - return ( - - - - Number(d).toFixed(2)} - /> + return ( + + + + Number(d).toFixed(2)} + /> - - - ); - }) - .add('left', () => { - return ( - - - - Number(d).toFixed(2)} - /> + + + ); +}; +right.story = { + name: 'right', +}; - - - ); - }) - .add('top', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const bottom = () => { + return ( + + + + Number(d).toFixed(2)} + /> - - - ); - }) - .add('changing specs', () => { - const splitSeries = boolean('split series', true) ? ['g1', 'g2'] : undefined; - return ( - - - - Number(d).toFixed(2)} - /> + + + ); +}; +bottom.story = { + name: 'bottom', +}; - - - ); - }) - .add('hide legend items by series', () => { - const hideBarSeriesInLegend = boolean('hide bar series in legend', false); - const hideLineSeriesInLegend = boolean('hide line series in legend', false); +export const left = () => { + return ( + + + + Number(d).toFixed(2)} + /> - return ( - - - - Number(d).toFixed(2)} - /> + + + ); +}; +left.story = { + name: 'left', +}; - - - - ); - }) - .add('display values in legend elements', () => { - const showLegendDisplayValue = boolean('show display value in legend', true); - const legendPosition = select( - 'legendPosition', - { - right: Position.Right, - bottom: Position.Bottom, - left: Position.Left, - top: Position.Top, - }, - Position.Right, - ); +export const top = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +top.story = { + name: 'top', +}; + +export const changingSpecs = () => { + const splitSeries = boolean('split series', true) ? ['g1', 'g2'] : undefined; + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +changingSpecs.story = { + name: 'changing specs', +}; + +export const hideLegendItemsBySeries = () => { + const hideBarSeriesInLegend = boolean('hide bar series in legend', false); + const hideLineSeriesInLegend = boolean('hide line series in legend', false); - const tsvbSeries = TSVB_DATASET.series; + return ( + + + + Number(d).toFixed(2)} + /> + + + + + ); +}; +hideLegendItemsBySeries.story = { + name: 'hide legend items by series', +}; + +export const displayValuesInLegendElements = () => { + const showLegendDisplayValue = boolean('show display value in legend', true); + const legendPosition = select( + 'legendPosition', + { + right: Position.Right, + bottom: Position.Bottom, + left: Position.Left, + top: Position.Top, + }, + Position.Right, + ); - const namesArray = arrayKnobs('series names (in sort order)', ['jpg', 'php', 'png', 'css', 'gif']); + const tsvbSeries = TSVB_DATASET.series; - const seriesComponents = tsvbSeries.map((series: any) => { - const nameIndex = namesArray.findIndex((name) => { - return name === series.label; - }); - const sortIndex = nameIndex > -1 ? nameIndex : undefined; + const namesArray = arrayKnobs('series names (in sort order)', ['jpg', 'php', 'png', 'css', 'gif']); - return ( - - ); + const seriesComponents = tsvbSeries.map((series: any) => { + const nameIndex = namesArray.findIndex((name) => { + return name === series.label; }); + const sortIndex = nameIndex > -1 ? nameIndex : undefined; + return ( - - - - Number(d).toFixed(2)} - /> - {seriesComponents} - + ); - }) - .add( - 'legend spacingBuffer', - () => { - const theme: PartialTheme = { - legend: { - spacingBuffer: number('legend buffer value', 80), - }, - }; - - return ( - - - - Number(d).toFixed(2)} - /> + }); + return ( + + + + Number(d).toFixed(2)} + /> + {seriesComponents} + + ); +}; +displayValuesInLegendElements.story = { + name: 'display values in legend elements', +}; - - - - ); - }, - { - info: { - text: - 'For high variability in values it may be necessary to increase the `spacingBuffer` to account for larger numbers.', - }, +export const legendSpacingBuffer = () => { + const theme: PartialTheme = { + legend: { + spacingBuffer: number('legend buffer value', 80), }, + }; + + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +legendSpacingBuffer.story = { + name: 'legend spacingBuffer', +}; +// { +// info: { +// text: +// 'For high variability in values it may be necessary to increase the `spacingBuffer` to account for larger numbers.', +// }, +// }, +// ); diff --git a/stories/line_chart.tsx b/stories/line_chart.tsx index 9a9ee79864..089a14f94c 100644 --- a/stories/line_chart.tsx +++ b/stories/line_chart.tsx @@ -1,5 +1,4 @@ import { boolean } from '@storybook/addon-knobs'; -import { storiesOf } from '@storybook/react'; import React from 'react'; import { Axis, @@ -20,333 +19,376 @@ import { getChartRotationKnob } from './common'; const dateFormatter = timeFormatter(niceTimeFormatByDay(1)); -storiesOf('Line Chart', module) - .add('basic', () => { - const toggleSpec = boolean('toggle line spec', true); - const data1 = KIBANA_METRICS.metrics.kibana_os_load[0].data; - const data2 = data1.map((datum) => [datum[0], datum[1] - 1]); - const data = toggleSpec ? data1 : data2; - const specId = toggleSpec ? 'lines1' : 'lines2'; +export default { + title: 'Line Chart', + parameters: { + info: { + source: false, + }, + }, +}; - return ( - - - - ); - }) - .add('w axis', () => { - return ( - - - `${Number(d).toFixed(2)}%`} - /> - - - ); - }) - .add('ordinal w axis', () => { - return ( - - - - `${Number(d).toFixed(2)}%`} - /> - - - ); - }) - .add('linear w axis', () => { - return ( - - - `${Number(d).toFixed(2)}%`} - /> - - - ); - }) - .add('w axis and legend', () => { - return ( - - - - `${Number(d).toFixed(0)}%`} - /> - - - ); - }) - .add('curved w axis and legend', () => { - return ( - - - - `${Number(d).toFixed(0)}%`} - /> +export const basic = () => { + const toggleSpec = boolean('toggle line spec', true); + const data1 = KIBANA_METRICS.metrics.kibana_os_load[0].data; + const data2 = data1.map((datum) => [datum[0], datum[1] - 1]); + const data = toggleSpec ? data1 : data2; + const specId = toggleSpec ? 'lines1' : 'lines2'; - - - - - - - - ); - }) - .add('multiple w axis and legend', () => { - return ( - - - - `${Number(d).toFixed(0)}%`} - /> + return ( + + + + ); +}; +basic.story = { + name: 'basic', +}; - - - - - ); - }) - .add('stacked w axis and legend', () => { - return ( - - - - `${Number(d).toFixed(0)}%`} - /> - - - - - ); - }) - .add('multi series with log values (limit 0 or negative values)', () => { - return ( - - - - `${Number(d).toFixed(0)}%`} - /> - {TSVB_DATASET.series.map((series) => { - return ( - - ); - })} - - ); - }); +export const wAxis = () => { + return ( + + + `${Number(d).toFixed(2)}%`} + /> + + + ); +}; +wAxis.story = { + name: 'w axis', +}; + +export const ordinalWAxis = () => { + return ( + + + + `${Number(d).toFixed(2)}%`} + /> + + + ); +}; +ordinalWAxis.story = { + name: 'ordinal w axis', +}; + +export const linearWAxis = () => { + return ( + + + `${Number(d).toFixed(2)}%`} + /> + + + ); +}; +linearWAxis.story = { + name: 'linear w axis', +}; + +export const wAxisAndLegend = () => { + return ( + + + + `${Number(d).toFixed(0)}%`} + /> + + + ); +}; +wAxisAndLegend.story = { + name: 'w axis and legend', +}; + +export const curvedwaxisandlegend = () => { + return ( + + + + `${Number(d).toFixed(0)}%`} + /> + + + + + + + + + ); +}; +curvedwaxisandlegend.story = { + name: 'curved w axis and legend', +}; + +export const multiplewaxisandlegend = () => { + return ( + + + + `${Number(d).toFixed(0)}%`} + /> + + + + + + ); +}; +multiplewaxisandlegend.story = { + name: 'multiple w axis and legend', +}; + +export const stackedwaxisandlegend = () => { + return ( + + + + `${Number(d).toFixed(0)}%`} + /> + + + + + ); +}; +stackedwaxisandlegend.story = { + name: 'stacked w axis and legend', +}; + +export const multiserieswithlogvalues = () => { + return ( + + + + `${Number(d).toFixed(0)}%`} + /> + {TSVB_DATASET.series.map((series) => { + return ( + + ); + })} + + ); +}; +multiserieswithlogvalues.story = { + name: 'multi series with log values (limit 0 or negative values)', +}; diff --git a/stories/mixed.tsx b/stories/mixed.tsx index 2c16000621..fc42497a60 100644 --- a/stories/mixed.tsx +++ b/stories/mixed.tsx @@ -1,4 +1,3 @@ -import { storiesOf } from '@storybook/react'; import { select, number } from '@storybook/addon-knobs'; import { DateTime } from 'luxon'; import React from 'react'; @@ -19,433 +18,464 @@ import { import { timeFormatter } from '../src/utils/data/formatters'; import { Fit, SeriesTypes } from '../src/chart_types/xy_chart/utils/specs'; -storiesOf('Mixed Charts', module) - .add('bar and lines', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export default { + title: 'Mixed Charts', + parameters: { + info: { + source: false, + }, + }, +}; - - - - ); - }) - .add('lines and areas', () => { - return ( - - - - Number(d).toFixed(2)} - /> +export const barsAndLines = () => { + return ( + + + + Number(d).toFixed(2)} + /> - - - - ); - }) - .add('areas and bars', () => { - return ( - - - - Number(d).toFixed(2)} - /> - - Number(d).toFixed(2)} - /> - - - - ); - }) - .add('[test] - bar/lines linear', () => { - const data1 = [ - [1, 1], - [2, 2], - [3, 3], - [4, 4], - [5, 5], - [6, 4], - [7, 3], - [8, 2], - [9, 1], - ]; - const data2 = [ - [1, 5], - [2, 4], - [3, 3], - [4, 2], - [5, 1], - [6, 2], - [7, 3], - [8, 4], - [9, 5], - ]; + + + + ); +}; +barsAndLines.story = { + name: 'bar and lines', +}; - return ( - - - - Number(d).toFixed(2)} - /> +export const linesAndAreas = () => { + return ( + + + + Number(d).toFixed(2)} + /> - - - - ); - }) - .add('[test] - bar/lines time', () => { - const start = DateTime.fromISO('2019-01-01T00:00:00.000', { zone: 'utc' }); - const data1 = [ - [start.toMillis(), 1, 4], - [start.plus({ minute: 1 }).toMillis(), 2, 5], - [start.plus({ minute: 2 }).toMillis(), 3, 6], - [start.plus({ minute: 3 }).toMillis(), 4, 7], - [start.plus({ minute: 4 }).toMillis(), 5, 8], - [start.plus({ minute: 5 }).toMillis(), 4, 7], - [start.plus({ minute: 6 }).toMillis(), 3, 6], - [start.plus({ minute: 7 }).toMillis(), 2, 5], - [start.plus({ minute: 8 }).toMillis(), 1, 4], - ]; - const data2 = [ - [start.toMillis(), 1, 4], - [start.plus({ minute: 1 }).toMillis(), 2, 5], - [start.plus({ minute: 2 }).toMillis(), 3, 6], - [start.plus({ minute: 3 }).toMillis(), 4, 7], - [start.plus({ minute: 4 }).toMillis(), 5, 8], - [start.plus({ minute: 5 }).toMillis(), 4, 7], - [start.plus({ minute: 6 }).toMillis(), 3, 6], - [start.plus({ minute: 7 }).toMillis(), 2, 5], - [start.plus({ minute: 8 }).toMillis(), 1, 4], - ]; - const dateFormatter = timeFormatter('HH:mm:ss'); + + + + ); +}; +linesAndAreas.story = { + name: 'lines and areas', +}; - return ( - - - - Number(d).toFixed(2)} - /> +export const areasAndBars = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + Number(d).toFixed(2)} + /> + + + + ); +}; +areasAndBars.story = { + name: 'areas and bars', +}; + +export const testBarLinesLinear = () => { + const data1 = [ + [1, 1], + [2, 2], + [3, 3], + [4, 4], + [5, 5], + [6, 4], + [7, 3], + [8, 2], + [9, 1], + ]; + const data2 = [ + [1, 5], + [2, 4], + [3, 3], + [4, 2], + [5, 1], + [6, 2], + [7, 3], + [8, 4], + [9, 5], + ]; + + return ( + + + + Number(d).toFixed(2)} + /> + + + + + ); +}; +testBarLinesLinear.story = { + name: '[test] - bar/lines linear', +}; + +export const testBarLinesTime = () => { + const start = DateTime.fromISO('2019-01-01T00:00:00.000', { zone: 'utc' }); + const data1 = [ + [start.toMillis(), 1, 4], + [start.plus({ minute: 1 }).toMillis(), 2, 5], + [start.plus({ minute: 2 }).toMillis(), 3, 6], + [start.plus({ minute: 3 }).toMillis(), 4, 7], + [start.plus({ minute: 4 }).toMillis(), 5, 8], + [start.plus({ minute: 5 }).toMillis(), 4, 7], + [start.plus({ minute: 6 }).toMillis(), 3, 6], + [start.plus({ minute: 7 }).toMillis(), 2, 5], + [start.plus({ minute: 8 }).toMillis(), 1, 4], + ]; + const data2 = [ + [start.toMillis(), 1, 4], + [start.plus({ minute: 1 }).toMillis(), 2, 5], + [start.plus({ minute: 2 }).toMillis(), 3, 6], + [start.plus({ minute: 3 }).toMillis(), 4, 7], + [start.plus({ minute: 4 }).toMillis(), 5, 8], + [start.plus({ minute: 5 }).toMillis(), 4, 7], + [start.plus({ minute: 6 }).toMillis(), 3, 6], + [start.plus({ minute: 7 }).toMillis(), 2, 5], + [start.plus({ minute: 8 }).toMillis(), 1, 4], + ]; + const dateFormatter = timeFormatter('HH:mm:ss'); + + return ( + + + + Number(d).toFixed(2)} + /> - + + + ); +}; +testBarLinesTime.story = { + name: '[test] - bar/lines time', +}; + +export const fittingFunctionsNonStackedSeries = () => { + const dataTypes = { + isolated: [ + { x: 0, y: 3 }, + { x: 1, y: 5 }, + { x: 2, y: null }, + { x: 3, y: 4 }, + { x: 4, y: null }, + { x: 5, y: 5 }, + { x: 6, y: null }, + { x: 7, y: 12 }, + { x: 8, y: null }, + { x: 9, y: 10 }, + { x: 10, y: 7 }, + ], + successive: [ + { x: 0, y: 3 }, + { x: 1, y: 5 }, + { x: 2, y: null }, + { x: 4, y: null }, + { x: 6, y: null }, + { x: 8, y: null }, + { x: 9, y: 10 }, + { x: 10, y: 7 }, + ], + endPoints: [ + { x: 0, y: null }, + { x: 1, y: 5 }, + { x: 3, y: 4 }, + { x: 5, y: 5 }, + { x: 7, y: 12 }, + { x: 9, y: 10 }, + { x: 10, y: null }, + ], + ordinal: [ + { x: 'a', y: null }, + { x: 'b', y: 3 }, + { x: 'c', y: 5 }, + { x: 'd', y: null }, + { x: 'e', y: 4 }, + { x: 'f', y: null }, + { x: 'g', y: 5 }, + { x: 'h', y: 6 }, + { x: 'i', y: null }, + { x: 'j', y: null }, + { x: 'k', y: null }, + { x: 'l', y: 12 }, + { x: 'm', y: null }, + ], + all: [ + { x: 0, y: null }, + { x: 1, y: 3 }, + { x: 2, y: 5 }, + { x: 3, y: null }, + { x: 4, y: 4 }, + { x: 5, y: null }, + { x: 6, y: 5 }, + { x: 7, y: 6 }, + { x: 8, y: null }, + { x: 9, y: null }, + { x: 10, y: null }, + { x: 11, y: 12 }, + { x: 12, y: null }, + ], + }; + + const seriesType = select( + 'seriesType', + { + Area: SeriesTypes.Area, + Line: SeriesTypes.Line, + }, + SeriesTypes.Area, + ); + const dataKey = select( + 'dataset', + { + 'Isolated Points': 'isolated', + 'Successive null Points': 'successive', + 'null end points': 'endPoints', + 'Ordinal x values': 'ordinal', + 'All edge cases': 'all', + }, + 'all', + ); + // @ts-ignore + const dataset = dataTypes[dataKey]; + const fit = select( + 'fitting function', + { + None: Fit.None, + Carry: Fit.Carry, + Lookahead: Fit.Lookahead, + Nearest: Fit.Nearest, + Average: Fit.Average, + Linear: Fit.Linear, + Zero: Fit.Zero, + Explicit: Fit.Explicit, + }, + Fit.Average, + ); + const curve = select( + 'Curve', + { + 'Curve cardinal': CurveType.CURVE_CARDINAL, + 'Curve natural': CurveType.CURVE_NATURAL, + 'Curve monotone x': CurveType.CURVE_MONOTONE_X, + 'Curve monotone y': CurveType.CURVE_MONOTONE_Y, + 'Curve basis': CurveType.CURVE_BASIS, + 'Curve catmull rom': CurveType.CURVE_CATMULL_ROM, + 'Curve step': CurveType.CURVE_STEP, + 'Curve step after': CurveType.CURVE_STEP_AFTER, + 'Curve step before': CurveType.CURVE_STEP_BEFORE, + Linear: CurveType.LINEAR, + }, + 0, + ); + const endValue = select( + 'End value', + { + None: 'none', + nearest: 'nearest', + '0': 0, + '2': 2, + }, + 'none', + ); + const parsedEndValue: number | 'nearest' = Number.isNaN(Number(endValue)) ? 'nearest' : Number(endValue); + const value = number('Explicit valuve (using Fit.Explicit)', 5); + const xScaleType = dataKey === 'ordinal' ? ScaleType.Ordinal : ScaleType.Linear; + + return ( + + + + + {seriesType === SeriesTypes.Area ? ( + + ) : ( - - ); - }) - .add('Fitting functions - non-stacked series', () => { - const dataTypes = { - isolated: [ - { x: 0, y: 3 }, - { x: 1, y: 5 }, - { x: 2, y: null }, - { x: 3, y: 4 }, - { x: 4, y: null }, - { x: 5, y: 5 }, - { x: 6, y: null }, - { x: 7, y: 12 }, - { x: 8, y: null }, - { x: 9, y: 10 }, - { x: 10, y: 7 }, - ], - successive: [ - { x: 0, y: 3 }, - { x: 1, y: 5 }, - { x: 2, y: null }, - { x: 4, y: null }, - { x: 6, y: null }, - { x: 8, y: null }, - { x: 9, y: 10 }, - { x: 10, y: 7 }, - ], - endPoints: [ - { x: 0, y: null }, - { x: 1, y: 5 }, - { x: 3, y: 4 }, - { x: 5, y: 5 }, - { x: 7, y: 12 }, - { x: 9, y: 10 }, - { x: 10, y: null }, - ], - ordinal: [ - { x: 'a', y: null }, - { x: 'b', y: 3 }, - { x: 'c', y: 5 }, - { x: 'd', y: null }, - { x: 'e', y: 4 }, - { x: 'f', y: null }, - { x: 'g', y: 5 }, - { x: 'h', y: 6 }, - { x: 'i', y: null }, - { x: 'j', y: null }, - { x: 'k', y: null }, - { x: 'l', y: 12 }, - { x: 'm', y: null }, - ], - all: [ - { x: 0, y: null }, - { x: 1, y: 3 }, - { x: 2, y: 5 }, - { x: 3, y: null }, - { x: 4, y: 4 }, - { x: 5, y: null }, - { x: 6, y: 5 }, - { x: 7, y: 6 }, - { x: 8, y: null }, - { x: 9, y: null }, - { x: 10, y: null }, - { x: 11, y: 12 }, - { x: 12, y: null }, - ], - }; - - const seriesType = select( - 'seriesType', - { - Area: SeriesTypes.Area, - Line: SeriesTypes.Line, - }, - SeriesTypes.Area, - ); - const dataKey = select( - 'dataset', - { - 'Isolated Points': 'isolated', - 'Successive null Points': 'successive', - 'null end points': 'endPoints', - 'Ordinal x values': 'ordinal', - 'All edge cases': 'all', - }, - 'all', - ); - // @ts-ignore - const dataset = dataTypes[dataKey]; - const fit = select( - 'fitting function', - { - None: Fit.None, - Carry: Fit.Carry, - Lookahead: Fit.Lookahead, - Nearest: Fit.Nearest, - Average: Fit.Average, - Linear: Fit.Linear, - Zero: Fit.Zero, - Explicit: Fit.Explicit, - }, - Fit.Average, - ); - const curve = select( - 'Curve', - { - 'Curve cardinal': CurveType.CURVE_CARDINAL, - 'Curve natural': CurveType.CURVE_NATURAL, - 'Curve monotone x': CurveType.CURVE_MONOTONE_X, - 'Curve monotone y': CurveType.CURVE_MONOTONE_Y, - 'Curve basis': CurveType.CURVE_BASIS, - 'Curve catmull rom': CurveType.CURVE_CATMULL_ROM, - 'Curve step': CurveType.CURVE_STEP, - 'Curve step after': CurveType.CURVE_STEP_AFTER, - 'Curve step before': CurveType.CURVE_STEP_BEFORE, - Linear: CurveType.LINEAR, - }, - 0, - ); - const endValue = select( - 'End value', - { - None: 'none', - nearest: 'nearest', - '0': 0, - '2': 2, - }, - 'none', - ); - const parsedEndValue: number | 'nearest' = Number.isNaN(Number(endValue)) ? 'nearest' : Number(endValue); - const value = number('Explicit valuve (using Fit.Explicit)', 5); - const xScaleType = dataKey === 'ordinal' ? ScaleType.Ordinal : ScaleType.Linear; - - return ( - - - - - {seriesType === SeriesTypes.Area ? ( - - ) : ( - - )} - - ); - }); + )} + + ); +}; +fittingFunctionsNonStackedSeries.story = { + name: 'Fitting functions - non-stacked series', +}; diff --git a/stories/rotations.tsx b/stories/rotations.tsx index 09a3664432..feae1ccb90 100644 --- a/stories/rotations.tsx +++ b/stories/rotations.tsx @@ -1,256 +1,298 @@ import { boolean, select } from '@storybook/addon-knobs'; -import { storiesOf } from '@storybook/react'; import React from 'react'; import { Axis, BarSeries, Chart, getAxisId, getSpecId, Position, ScaleType, Settings } from '../src/'; -storiesOf('Rotations', module) - .add('with ordinal axis', () => { - return ( - - - - +export default { + title: 'Rotations', + parameters: { + info: { + source: false, + }, + }, +}; - - - ); - }) - .add('negative 90 deg ordinal', () => { - return ( - - - - - - - - - ); - }) - .add('0 deg ordinal', () => { - return ( - - - - - - - - - ); - }) - .add('90 deg ordinal', () => { - return ( - - - - - - - - - ); - }) - .add('180 deg ordinal', () => { - return ( - - - - - - - - - ); - }) - .add('negative 90 deg linear', () => { - return ( - - - - - - - - - ); - }) - .add('0 deg linear', () => { - return ( - - - - - - - - - ); - }) - .add('90 deg linear', () => { - return ( - - - - - - - - - ); - }) - .add('180 deg linear', () => { - return ( - - - - - - - - - ); - }); +export const withOrdinalAxis = () => { + return ( + + + + + + + + ); +}; +withOrdinalAxis.story = { + name: 'with ordinal axis', +}; + +export const negative90DegreeOrdinal = () => { + return ( + + + + + + + + + ); +}; +negative90DegreeOrdinal.story = { + name: 'negative 90 deg ordinal', +}; + +export const rotations0DegOrdinal = () => { + return ( + + + + + + + + + ); +}; +rotations0DegOrdinal.story = { + name: '0 deg ordinal', +}; + +export const rotations90DegOrdinal = () => { + return ( + + + + + + + + + ); +}; +rotations90DegOrdinal.story = { + name: '90 deg ordinal', +}; + +export const rotations180DegOrdinal = () => { + return ( + + + + + + + + + ); +}; +rotations180DegOrdinal.story = { + name: '180 deg ordinal', +}; + +export const negative90DegLinear = () => { + return ( + + + + + + + + + ); +}; +negative90DegLinear.story = { + name: 'negative 90 deg linear', +}; + +export const rotations0DegLinear = () => { + return ( + + + + + + + + + ); +}; +rotations0DegLinear.story = { + name: '0 deg linear', +}; + +export const rotations90DegLinear = () => { + return ( + + + + + + + + + ); +}; +rotations90DegLinear.story = { + name: '90 deg linear', +}; + +export const rotations180DegLinear = () => { + return ( + + + + + + + + + ); +}; +rotations180DegLinear.story = { + name: '180 deg linear', +}; diff --git a/stories/scales.tsx b/stories/scales.tsx index 765f700ddb..09ab70efc8 100644 --- a/stories/scales.tsx +++ b/stories/scales.tsx @@ -1,5 +1,4 @@ import { select, boolean } from '@storybook/addon-knobs'; -import { storiesOf } from '@storybook/react'; import { DateTime } from 'luxon'; import React from 'react'; import { Axis, Chart, getAxisId, getSpecId, LineSeries, Position, ScaleType, Settings } from '../src'; @@ -26,220 +25,234 @@ const OTHER_MINUS8_TIMEZONE_DATASET = new Array(10).fill(0).map((d, i) => { return [UTC_MINUS8_DATE + DAY_INCREMENT_1 * i, i % 5]; }); -storiesOf('Scales', module) - .add('line chart with different timezones', () => { - const timezones = { - utc: 'utc', - local: 'local', - utcplus8: 'utc+8', - utcminus8: 'utc-8', - }; - const datasetSelected = select('dataset', timezones, 'utc'); - const tooltipSelected = select('tooltip', timezones, 'utc'); +export default { + title: 'Scales', + parameters: { + info: { + source: false, + }, + }, +}; + +export const lineChartWithDifferentTimezones = () => { + const timezones = { + utc: 'utc', + local: 'local', + utcplus8: 'utc+8', + utcminus8: 'utc-8', + }; + const datasetSelected = select('dataset', timezones, 'utc'); + const tooltipSelected = select('tooltip', timezones, 'utc'); - let data; - switch (datasetSelected) { - case 'local': - data = CURRENT_TIMEZONE_DATASET; - break; - case 'utc+8': - data = OTHER_PLUS8_TIMEZONE_DATASET; - break; - case 'utc-8': - data = OTHER_MINUS8_TIMEZONE_DATASET; - break; - case 'utc': - default: - data = UTC_DATASET; - break; - } - let tooltipFn: (d: number) => string; - switch (tooltipSelected) { - case 'local': - tooltipFn = (d: number) => { + let data; + switch (datasetSelected) { + case 'local': + data = CURRENT_TIMEZONE_DATASET; + break; + case 'utc+8': + data = OTHER_PLUS8_TIMEZONE_DATASET; + break; + case 'utc-8': + data = OTHER_MINUS8_TIMEZONE_DATASET; + break; + case 'utc': + default: + data = UTC_DATASET; + break; + } + let tooltipFn: (d: number) => string; + switch (tooltipSelected) { + case 'local': + tooltipFn = (d: number) => { + return DateTime.fromMillis(d).toFormat('yyyy-MM-dd HH:mm:ss'); + }; + break; + case 'utc+8': + tooltipFn = (d: number) => { + return DateTime.fromMillis(d, { zone: 'utc+8' }).toFormat('yyyy-MM-dd HH:mm:ss'); + }; + break; + case 'utc-8': + tooltipFn = (d: number) => { + return DateTime.fromMillis(d, { zone: 'utc-8' }).toFormat('yyyy-MM-dd HH:mm:ss'); + }; + break; + default: + case 'utc': + tooltipFn = (d: number) => { + return DateTime.fromMillis(d) + .toUTC() + .toFormat('yyyy-MM-dd HH:mm:ss'); + }; + break; + } + return ( + + + + + + ); +}; +lineChartWithDifferentTimezones.story = { + name: 'line chart with different timezones', +}; + +export const xScaleUTCTimezoneLocalTooltip = () => { + return ( + + { return DateTime.fromMillis(d).toFormat('yyyy-MM-dd HH:mm:ss'); - }; - break; - case 'utc+8': - tooltipFn = (d: number) => { - return DateTime.fromMillis(d, { zone: 'utc+8' }).toFormat('yyyy-MM-dd HH:mm:ss'); - }; - break; - case 'utc-8': - tooltipFn = (d: number) => { - return DateTime.fromMillis(d, { zone: 'utc-8' }).toFormat('yyyy-MM-dd HH:mm:ss'); - }; - break; - default: - case 'utc': - tooltipFn = (d: number) => { + }} + /> + + + + ); +}; +xScaleUTCTimezoneLocalTooltip.story = { + name: 'x scale: UTC Time zone - local tooltip', +}; +// { +// info: { +// text: `If your data is in UTC timezone, your tooltip and axis labels can +// be configured to visualize the time translated to your local timezone. You should +// be able to see the first value on \`2019-01-01 01:00:00.000 \``, +// }, +// }, +// ) + +export const xScaleUTCTimezoneUTCTooltip = () => { + return ( + + { return DateTime.fromMillis(d) .toUTC() .toFormat('yyyy-MM-dd HH:mm:ss'); - }; - break; - } - return ( - - - - - - ); - }) - .add( - 'x scale: UTC Time zone - local tooltip', - () => { - return ( - - { - return DateTime.fromMillis(d).toFormat('yyyy-MM-dd HH:mm:ss'); - }} - /> - - - - ); - }, - { - info: { - text: `If your data is in UTC timezone, your tooltip and axis labels can - be configured to visualize the time translated to your local timezone. You should - be able to see the first value on \`2019-01-01 01:00:00.000 \``, - }, - }, - ) - .add( - 'x scale: UTC Time zone - UTC tooltip', - () => { - return ( - - { - return DateTime.fromMillis(d) - .toUTC() - .toFormat('yyyy-MM-dd HH:mm:ss'); - }} - /> - - - - ); - }, - { - info: { - text: `The default timezone is UTC. If you want to visualize data in UTC, - but you are in a different timezone, remember to format the millis from \`tickFormat\` - to UTC. In this example be able to see the first value on \`2019-01-01 00:00:00.000 \``, - }, - }, - ) - .add( - 'x scale year scale: custom timezone - same zone tooltip', - () => { - return ( - - { - return DateTime.fromMillis(d, { zone: 'utc-6' }).toISO(); - // return DateTime.fromMillis(d, { zone: 'utc-6' }).toISO(); - }} - /> - - - - ); - }, - { - info: { - text: `You can visualize data in a different timezone than your local or UTC zones. - Specify the \`timeZone={'utc-6'}\` property with the correct timezone and - remember to apply the same timezone also to each formatted tick in \`tickFormat\` `, - }, - }, - ) - .add( - 'Remove duplicate scales', - () => { - return ( - - - - `${d}%`} /> - `${d}%`} /> - `${d}%`} - /> - `${d}%`} /> - - - ); - }, - { - info: { - text: '`hideDuplicateAxes` will remove redundant axes that have the same min and max labels and position', - }, - }, + }} + /> + + + + ); +}; +xScaleUTCTimezoneUTCTooltip.story = { + name: 'x scale: UTC Time zone - UTC tooltip', +}; +// { +// info: { +// text: `The default timezone is UTC. If you want to visualize data in UTC, +// but you are in a different timezone, remember to format the millis from \`tickFormat\` +// to UTC. In this example be able to see the first value on \`2019-01-01 00:00:00.000 \``, +// }, +// }, +// ) + +export const xScaleYearScaleCustomTimezoneSameToneTooltip = () => { + return ( + + { + return DateTime.fromMillis(d, { zone: 'utc-6' }).toISO(); + // return DateTime.fromMillis(d, { zone: 'utc-6' }).toISO(); + }} + /> + + + + ); +}; +xScaleYearScaleCustomTimezoneSameToneTooltip.story = { + name: 'x scale year scale: custom timezone - same zone tooltip', +}; +// { +// info: { +// text: `You can visualize data in a different timezone than your local or UTC zones. +// Specify the \`timeZone={'utc-6'}\` property with the correct timezone and +// remember to apply the same timezone also to each formatted tick in \`tickFormat\` `, +// }, +// }, +// ) + +export const removeDuplicateScales = () => { + return ( + + + + `${d}%`} /> + `${d}%`} /> + `${d}%`} /> + `${d}%`} /> + + ); +}; +removeDuplicateScales.story = { + name: 'Remove duplicate scales', +}; +// { +// info: { +// text: '`hideDuplicateAxes` will remove redundant axes that have the same min and max labels and position', +// }, +// }, +// ); diff --git a/stories/styling.tsx b/stories/styling.tsx index c14ee4aa66..66f757243c 100644 --- a/stories/styling.tsx +++ b/stories/styling.tsx @@ -1,5 +1,4 @@ import { boolean, color, number, select } from '@storybook/addon-knobs'; -import { storiesOf } from '@storybook/react'; import React from 'react'; import { switchTheme } from '../.storybook/theme_service'; @@ -116,1002 +115,1065 @@ const data1 = dg.generateGroupedSeries(40, 4); const data2 = dg.generateSimpleSeries(40); const data3 = dg.generateSimpleSeries(40); -storiesOf('Stylings', module) - .add('chart size', () => { - const theme: RecursivePartial = { - chartMargins: { - bottom: 0, - left: 0, - top: 0, - right: 0, - }, - }; - return ( -
- - - - - - - - - - - - - - - - - - - - -
- ); - }) - .add('margins and paddings', () => { - const theme: PartialTheme = { - chartMargins: { - left: range('margin left', 0, 50, 10), - right: range('margin right', 0, 50, 10), - top: range('margin top', 0, 50, 10), - bottom: range('margin bottom', 0, 50, 10), - }, - chartPaddings: { - left: range('padding left', 0, 50, 10), - right: range('padding right', 0, 50, 10), - top: range('padding top', 0, 50, 10), - bottom: range('padding bottom', 0, 50, 10), - }, - scales: { - barsPadding: range('bar padding', 0, 1, 0.1, undefined, 0.01), - }, - }; - const withLeftTitle = boolean('left axis with title', true); - const withBottomTitle = boolean('bottom axis with title', true); - const withRightTitle = boolean('right axis with title', true); - const withTopTitle = boolean('top axis with title', true); - return ( - - - - Number(d).toFixed(2)} - showGridLines={boolean('show left axis grid lines', false)} - /> - - Number(d).toFixed(2)} - showGridLines={boolean('show right axis grid lines', false)} - /> +export default { + title: 'Stylings', + parameters: { + info: { + source: false, + }, + }, +}; + +export const chartSize = () => { + const theme: RecursivePartial = { + chartMargins: { + bottom: 0, + left: 0, + top: 0, + right: 0, + }, + }; + return ( +
+ + - ); - }) - .add('axis', () => { - const theme: PartialTheme = { - axes: { - axisTitleStyle: { - fill: color('titleFill', '#333', 'Axis Title'), - fontSize: range('titleFontSize', 0, 40, 12, 'Axis Title'), - fontStyle: 'bold', - fontFamily: `'Open Sans', Helvetica, Arial, sans-serif`, - padding: range('titlePadding', 0, 40, 5, 'Axis Title'), - }, - axisLineStyle: { - stroke: color('axisLinecolor', '#333', 'Axis Line'), - strokeWidth: range('axisLineWidth', 0, 5, 1, 'Axis Line'), - }, - tickLabelStyle: { - fill: color('tickFill', '#333', 'Tick Label'), - fontSize: range('tickFontSize', 0, 40, 10, 'Tick Label'), - fontFamily: `'Open Sans', Helvetica, Arial, sans-serif`, - fontStyle: 'normal', - padding: number('tickLabelPadding', 1, {}, 'Tick Label'), - }, - tickLineStyle: { - visible: boolean('showTicks', true, 'Tick Line'), - stroke: color('tickLineColor', '#333', 'Tick Line'), - strokeWidth: range('tickLineWidth', 0, 5, 1, 'Tick Line'), - }, - }, - }; - return ( - - - - Number(d).toFixed(2)} - /> - + + - ); - }) - .add('theme/style', () => { - const customizeLineStroke = boolean('customizeLineStroke', false, 'line'); - const customizePointStroke = boolean('customizeLinePointStroke', false, 'line'); - const customizeAreaFill = boolean('customizeAreaFill', false, 'area'); - const customizeAreaLineStroke = boolean('customizeAreaLineStroke', false, 'area'); - const customizeRectFill = boolean('customizeRectFill', false, 'bar'); - const theme: PartialTheme = { - chartMargins: { - left: range('margin left', 0, 50, 10, 'Margins'), - right: range('margin right', 0, 50, 10, 'Margins'), - top: range('margin top', 0, 50, 10, 'Margins'), - bottom: range('margin bottom', 0, 50, 10, 'Margins'), - }, - chartPaddings: { - left: range('padding left', 0, 50, 10, 'Paddings'), - right: range('padding right', 0, 50, 10, 'Paddings'), - top: range('padding top', 0, 50, 10, 'Paddings'), - bottom: range('padding bottom', 0, 50, 10, 'Paddings'), - }, - lineSeriesStyle: { - line: { - stroke: customizeLineStroke ? color('customLineStroke', 'red', 'line') : undefined, - strokeWidth: range('lineStrokeWidth', 0, 10, 1, 'line'), - visible: boolean('lineVisible', true, 'line'), - }, - point: { - visible: boolean('linePointVisible', true, 'line'), - radius: range('linePointRadius', 0, 20, 1, 'line', 0.5), - fill: color('linePointFill', 'white', 'line'), - stroke: customizePointStroke ? color('customLinePointStroke', 'red', 'line') : undefined, - strokeWidth: range('linePointStrokeWidth', 0, 20, 0.5, 'line'), - opacity: range('linePointOpacity', 0, 1, 1, 'line', 0.01), - }, - }, - areaSeriesStyle: { - area: { - fill: customizeAreaFill ? color('customAreaFill', 'red', 'area') : undefined, - visible: boolean('aAreaVisible', true, 'area'), - opacity: range('aAreaOpacity', 0, 1, 1, 'area'), - }, - line: { - stroke: customizeAreaLineStroke ? color('customAreaLineStroke', 'red', 'area') : undefined, - strokeWidth: range('aStrokeWidth', 0, 10, 1, 'area'), - visible: boolean('aLineVisible', true, 'area'), - }, - point: { - visible: boolean('aPointVisible', true, 'area'), - fill: color('aPointFill', 'white', 'area'), - radius: range('aPointRadius', 0, 20, 1, 'area'), - stroke: color('aPointStroke', 'white', 'area'), - strokeWidth: range('aPointStrokeWidth', 0, 20, 0.5, 'area'), - opacity: range('aPointOpacity', 0, 1, 0.01, 'area'), - }, - }, - barSeriesStyle: { - rect: { - fill: customizeRectFill ? color('recCustomFull', 'red', 'bar') : undefined, - opacity: range('rectOpacity', 0, 1, 0.5, 'bar', 0.1), - }, - rectBorder: { - stroke: color('bBorderStroke', 'white', 'bar'), - strokeWidth: range('bStrokeWidth', 0, 10, 1, 'bar'), - visible: boolean('bBorderVisible', true, 'bar'), - }, - }, - sharedStyle: { - default: { - opacity: range('sOpacity', 0, 1, 1, 'Shared', 0.05), - }, - highlighted: { - opacity: range('sHighlighted', 0, 1, 1, 'Shared', 0.05), - }, - unhighlighted: { - opacity: range('sUnhighlighted', 0, 1, 0.25, 'Shared', 0.05), - }, - }, - colors: { - vizColors: select( - 'vizColors', - { - colorBlind: palettes.echPaletteColorBlind.colors, - darkBackground: palettes.echPaletteForDarkBackground.colors, - lightBackground: palettes.echPaletteForLightBackground.colors, - forStatus: palettes.echPaletteForStatus.colors, - }, - palettes.echPaletteColorBlind.colors, - 'Colors', - ), - defaultVizColor: DEFAULT_MISSING_COLOR, - }, - }; - - const darkmode = boolean('darkmode', false, 'Colors'); - const className = darkmode ? 'story-chart-dark' : 'story-chart'; - switchTheme(darkmode ? 'dark' : 'light'); - - return ( - - - - Number(d).toFixed(2)} - /> - - Number(d).toFixed(2)} - /> + + - - - ); - }) - .add('partial custom theme', () => { - const customPartialTheme: PartialTheme = { - barSeriesStyle: { - rectBorder: { - stroke: color('BarBorderStroke', 'white'), - visible: true, - }, - }, - }; - - return ( - - - - Number(d).toFixed(2)} - /> - - Number(d).toFixed(2)} - /> + + - ); - }) - .add('partial custom theme with baseTheme', () => { - const customPartialTheme: PartialTheme = { - barSeriesStyle: { - rectBorder: { - stroke: color('BarBorderStroke', 'white'), - visible: true, - }, - }, - }; - - return ( - - - - Number(d).toFixed(2)} - /> - - Number(d).toFixed(2)} - /> + + - ); - }) - .add( - 'multiple custom partial themes', - () => { - const primaryTheme: PartialTheme = { - barSeriesStyle: { - rect: { - fill: color('bar fill - primary theme', 'red'), - }, - }, - }; - const secondaryTheme: PartialTheme = { - barSeriesStyle: { - rect: { - fill: color('bar fill - secondary theme', 'blue'), - opacity: range('bar opacity - secondary theme', 0.1, 1, 0.7, undefined, 0.1), - }, - }, - }; +
+ ); +}; +chartSize.story = { + name: 'chart size', +}; - return ( - - - - Number(d).toFixed(2)} - /> - - Number(d).toFixed(2)} - /> - - - ); +export const marginsAndPaddings = () => { + const theme: PartialTheme = { + chartMargins: { + left: range('margin left', 0, 50, 10), + right: range('margin right', 0, 50, 10), + top: range('margin top', 0, 50, 10), + bottom: range('margin bottom', 0, 50, 10), }, - { - info: { - text: 'Notice that the secondary theme bar fill has no effect as the primary value takes priority', + chartPaddings: { + left: range('padding left', 0, 50, 10), + right: range('padding right', 0, 50, 10), + top: range('padding top', 0, 50, 10), + bottom: range('padding bottom', 0, 50, 10), + }, + scales: { + barsPadding: range('bar padding', 0, 1, 0.1, undefined, 0.01), + }, + }; + const withLeftTitle = boolean('left axis with title', true); + const withBottomTitle = boolean('bottom axis with title', true); + const withRightTitle = boolean('right axis with title', true); + const withTopTitle = boolean('top axis with title', true); + return ( + + + + Number(d).toFixed(2)} + showGridLines={boolean('show left axis grid lines', false)} + /> + + Number(d).toFixed(2)} + showGridLines={boolean('show right axis grid lines', false)} + /> + + + ); +}; +marginsAndPaddings.story = { + name: 'margins and paddings', +}; + +export const axis = () => { + const theme: PartialTheme = { + axes: { + axisTitleStyle: { + fill: color('titleFill', '#333', 'Axis Title'), + fontSize: range('titleFontSize', 0, 40, 12, 'Axis Title'), + fontStyle: 'bold', + fontFamily: `'Open Sans', Helvetica, Arial, sans-serif`, + padding: range('titlePadding', 0, 40, 5, 'Axis Title'), + }, + axisLineStyle: { + stroke: color('axisLinecolor', '#333', 'Axis Line'), + strokeWidth: range('axisLineWidth', 0, 5, 1, 'Axis Line'), + }, + tickLabelStyle: { + fill: color('tickFill', '#333', 'Tick Label'), + fontSize: range('tickFontSize', 0, 40, 10, 'Tick Label'), + fontFamily: `'Open Sans', Helvetica, Arial, sans-serif`, + fontStyle: 'normal', + padding: number('tickLabelPadding', 1, {}, 'Tick Label'), + }, + tickLineStyle: { + visible: boolean('showTicks', true, 'Tick Line'), + stroke: color('tickLineColor', '#333', 'Tick Line'), + strokeWidth: range('tickLineWidth', 0, 5, 1, 'Tick Line'), }, }, - ) - .add('custom series colors via colors array', () => { - return ( - - - - Number(d).toFixed(2)} - /> + }; + return ( + + + + Number(d).toFixed(2)} + /> - - - ); - }) - .add('custom series colors via accessor function', () => { - const barColor = color('barSeriesColor', '#000'); - const barSeriesColorAccessor: CustomSeriesColors = ({ specId, yAccessor, splitAccessors }) => { - if ( - specId === getSpecId('bars') && - yAccessor === 'y1' && - splitAccessors.get('g1') === 'cloudflare.com' && - splitAccessors.get('g2') === 'direct-cdn' - ) { - return barColor; - } - return null; - }; + + + ); +}; +axis.story = { + name: 'axis', +}; - const lineColor = color('linelineSeriesColor', '#ff0'); - const lineSeriesColorAccessor: CustomSeriesColors = ({ specId, yAccessor, splitAccessors }) => { - if (specId === getSpecId('lines') && yAccessor === 'y1' && splitAccessors.size === 0) { - return lineColor; - } - return null; - }; +export const themeStyle = () => { + const customizeLineStroke = boolean('customizeLineStroke', false, 'line'); + const customizePointStroke = boolean('customizeLinePointStroke', false, 'line'); + const customizeAreaFill = boolean('customizeAreaFill', false, 'area'); + const customizeAreaLineStroke = boolean('customizeAreaLineStroke', false, 'area'); + const customizeRectFill = boolean('customizeRectFill', false, 'bar'); + const theme: PartialTheme = { + chartMargins: { + left: range('margin left', 0, 50, 10, 'Margins'), + right: range('margin right', 0, 50, 10, 'Margins'), + top: range('margin top', 0, 50, 10, 'Margins'), + bottom: range('margin bottom', 0, 50, 10, 'Margins'), + }, + chartPaddings: { + left: range('padding left', 0, 50, 10, 'Paddings'), + right: range('padding right', 0, 50, 10, 'Paddings'), + top: range('padding top', 0, 50, 10, 'Paddings'), + bottom: range('padding bottom', 0, 50, 10, 'Paddings'), + }, + lineSeriesStyle: { + line: { + stroke: customizeLineStroke ? color('customLineStroke', 'red', 'line') : undefined, + strokeWidth: range('lineStrokeWidth', 0, 10, 1, 'line'), + visible: boolean('lineVisible', true, 'line'), + }, + point: { + visible: boolean('linePointVisible', true, 'line'), + radius: range('linePointRadius', 0, 20, 1, 'line', 0.5), + fill: color('linePointFill', 'white', 'line'), + stroke: customizePointStroke ? color('customLinePointStroke', 'red', 'line') : undefined, + strokeWidth: range('linePointStrokeWidth', 0, 20, 0.5, 'line'), + opacity: range('linePointOpacity', 0, 1, 1, 'line', 0.01), + }, + }, + areaSeriesStyle: { + area: { + fill: customizeAreaFill ? color('customAreaFill', 'red', 'area') : undefined, + visible: boolean('aAreaVisible', true, 'area'), + opacity: range('aAreaOpacity', 0, 1, 1, 'area'), + }, + line: { + stroke: customizeAreaLineStroke ? color('customAreaLineStroke', 'red', 'area') : undefined, + strokeWidth: range('aStrokeWidth', 0, 10, 1, 'area'), + visible: boolean('aLineVisible', true, 'area'), + }, + point: { + visible: boolean('aPointVisible', true, 'area'), + fill: color('aPointFill', 'white', 'area'), + radius: range('aPointRadius', 0, 20, 1, 'area'), + stroke: color('aPointStroke', 'white', 'area'), + strokeWidth: range('aPointStrokeWidth', 0, 20, 0.5, 'area'), + opacity: range('aPointOpacity', 0, 1, 0.01, 'area'), + }, + }, + barSeriesStyle: { + rect: { + fill: customizeRectFill ? color('recCustomFull', 'red', 'bar') : undefined, + opacity: range('rectOpacity', 0, 1, 0.5, 'bar', 0.1), + }, + rectBorder: { + stroke: color('bBorderStroke', 'white', 'bar'), + strokeWidth: range('bStrokeWidth', 0, 10, 1, 'bar'), + visible: boolean('bBorderVisible', true, 'bar'), + }, + }, + sharedStyle: { + default: { + opacity: range('sOpacity', 0, 1, 1, 'Shared', 0.05), + }, + highlighted: { + opacity: range('sHighlighted', 0, 1, 1, 'Shared', 0.05), + }, + unhighlighted: { + opacity: range('sUnhighlighted', 0, 1, 0.25, 'Shared', 0.05), + }, + }, + colors: { + vizColors: select( + 'vizColors', + { + colorBlind: palettes.echPaletteColorBlind.colors, + darkBackground: palettes.echPaletteForDarkBackground.colors, + lightBackground: palettes.echPaletteForLightBackground.colors, + forStatus: palettes.echPaletteForStatus.colors, + }, + palettes.echPaletteColorBlind.colors, + 'Colors', + ), + defaultVizColor: DEFAULT_MISSING_COLOR, + }, + }; - return ( - - - - Number(d).toFixed(2)} - /> + const darkmode = boolean('darkmode', false, 'Colors'); + const className = darkmode ? 'story-chart-dark' : 'story-chart'; + switchTheme(darkmode ? 'dark' : 'light'); - - - - ); - }) - .add('custom series styles: bars', () => { - const applyBarStyle = boolean('apply bar style (bar 1 series)', true, 'Chart Global Theme'); + return ( + + + + Number(d).toFixed(2)} + /> + + Number(d).toFixed(2)} + /> + + + + + ); +}; +themeStyle.story = { + name: 'theme/style', +}; - const barSeriesStyle = { +export const partialCustomTheme = () => { + const customPartialTheme: PartialTheme = { + barSeriesStyle: { rectBorder: { - stroke: color('border stroke', 'blue', 'Bar 1 Style'), - strokeWidth: range('border strokeWidth', 0, 5, 2, 'Bar 1 Style', 0.1), - visible: boolean('border visible', true, 'Bar 1 Style'), + stroke: color('BarBorderStroke', 'white'), + visible: true, + }, + }, + }; + + return ( + + + + Number(d).toFixed(2)} + /> + + Number(d).toFixed(2)} + /> + + + ); +}; +partialCustomTheme.story = { + name: 'partial custom theme', +}; + +export const partialCustomThemeWithBaseTheme = () => { + const customPartialTheme: PartialTheme = { + barSeriesStyle: { + rectBorder: { + stroke: color('BarBorderStroke', 'white'), + visible: true, + }, + }, + }; + + return ( + + + + Number(d).toFixed(2)} + /> + + Number(d).toFixed(2)} + /> + + + ); +}; +partialCustomThemeWithBaseTheme.story = { + name: 'partial custom theme with baseTheme', +}; + +export const multipleCustomPartialThemes = () => { + const primaryTheme: PartialTheme = { + barSeriesStyle: { + rect: { + fill: color('bar fill - primary theme', 'red'), }, + }, + }; + const secondaryTheme: PartialTheme = { + barSeriesStyle: { rect: { - fill: color('rect fill', '#22C61A', 'Bar 1 Style'), - opacity: range('rect opacity', 0, 1, 0.3, 'Bar 1 Style', 0.1), + fill: color('bar fill - secondary theme', 'blue'), + opacity: range('bar opacity - secondary theme', 0.1, 1, 0.7, undefined, 0.1), }, - }; + }, + }; - const theme = { - barSeriesStyle: { - rectBorder: { - stroke: color('theme border stroke', 'red', 'Chart Global Theme'), - strokeWidth: range('theme border strokeWidth', 0, 5, 2, 'Chart Global Theme', 0.1), - visible: boolean('theme border visible', true, 'Chart Global Theme'), - }, - rect: { - opacity: range('theme opacity ', 0, 1, 0.9, 'Chart Global Theme', 0.1), - }, + return ( + + + + Number(d).toFixed(2)} + /> + + Number(d).toFixed(2)} + /> + + + ); +}; +multipleCustomPartialThemes.story = { + name: 'multiple custom partial themes', +}; +// { +// info: { +// text: 'Notice that the secondary theme bar fill has no effect as the primary value takes priority', +// }, +// }, +// ) + +export const customSeriesColorsViaColorsArray = () => { + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +customSeriesColorsViaColorsArray.story = { + name: 'custom series colors via colors array', +}; + +export const customSeriesColorsViaAccessorFunction = () => { + const barColor = color('barSeriesColor', '#000'); + const barSeriesColorAccessor: CustomSeriesColors = ({ specId, yAccessor, splitAccessors }) => { + if ( + specId === getSpecId('bars') && + yAccessor === 'y1' && + // eslint-disable-next-line react/prop-types + splitAccessors.get('g1') === 'cloudflare.com' && + // eslint-disable-next-line react/prop-types + splitAccessors.get('g2') === 'direct-cdn' + ) { + return barColor; + } + return null; + }; + + const lineColor = color('linelineSeriesColor', '#ff0'); + const lineSeriesColorAccessor: CustomSeriesColors = ({ specId, yAccessor, splitAccessors }) => { + // eslint-disable-next-line react/prop-types + if (specId === getSpecId('lines') && yAccessor === 'y1' && splitAccessors.size === 0) { + return lineColor; + } + return null; + }; + + return ( + + + + Number(d).toFixed(2)} + /> + + + + + ); +}; +customSeriesColorsViaAccessorFunction.story = { + name: 'custom series colors via accessor function', +}; + +export const customSeriesStylesBars = () => { + const applyBarStyle = boolean('apply bar style (bar 1 series)', true, 'Chart Global Theme'); + + const barSeriesStyle = { + rectBorder: { + stroke: color('border stroke', 'blue', 'Bar 1 Style'), + strokeWidth: range('border strokeWidth', 0, 5, 2, 'Bar 1 Style', 0.1), + visible: boolean('border visible', true, 'Bar 1 Style'), + }, + rect: { + fill: color('rect fill', '#22C61A', 'Bar 1 Style'), + opacity: range('rect opacity', 0, 1, 0.3, 'Bar 1 Style', 0.1), + }, + }; + + const theme = { + barSeriesStyle: { + rectBorder: { + stroke: color('theme border stroke', 'red', 'Chart Global Theme'), + strokeWidth: range('theme border strokeWidth', 0, 5, 2, 'Chart Global Theme', 0.1), + visible: boolean('theme border visible', true, 'Chart Global Theme'), + }, + rect: { + opacity: range('theme opacity ', 0, 1, 0.9, 'Chart Global Theme', 0.1), }, - }; + }, + }; - return ( - - - - Number(d).toFixed(2)} - /> + return ( + + + + Number(d).toFixed(2)} + /> - - - - ); - }) - .add('custom series styles: lines', () => { - const applyLineStyles = boolean('apply line series style', true, 'Chart Global Theme'); - const lineSeriesStyle1 = generateLineSeriesStyleKnobs('Line 1 style', 'line1', 'lime', 'green', 4, 10, 6); - const lineSeriesStyle2 = generateLineSeriesStyleKnobs('Line 2 style', 'line2', 'blue', 'violet', 2, 5, 4); + + + + ); +}; +customSeriesStylesBars.story = { + name: 'custom series styles: bars', +}; - const chartTheme = { - lineSeriesStyle: generateLineSeriesStyleKnobs('Chart Global Theme', 'chartTheme'), - }; +export const customSeriesStylesLines = () => { + const applyLineStyles = boolean('apply line series style', true, 'Chart Global Theme'); + const lineSeriesStyle1 = generateLineSeriesStyleKnobs('Line 1 style', 'line1', 'lime', 'green', 4, 10, 6); + const lineSeriesStyle2 = generateLineSeriesStyleKnobs('Line 2 style', 'line2', 'blue', 'violet', 2, 5, 4); - const dataset1 = [ - { x: 0, y: 3 }, - { x: 1, y: 2 }, - { x: 2, y: 4 }, - { x: 3, y: 10 }, - ]; - const dataset2 = dataset1.map((datum) => ({ ...datum, y: datum.y - 1 })); - const dataset3 = dataset1.map((datum) => ({ ...datum, y: datum.y - 2 })); + const chartTheme = { + lineSeriesStyle: generateLineSeriesStyleKnobs('Chart Global Theme', 'chartTheme'), + }; - return ( - - - - Number(d).toFixed(2)} - /> - - - - - ); - }) - .add('custom series styles: area', () => { - const applyLineStyles = boolean('apply line series style', true, 'Chart Global Theme'); + const dataset1 = [ + { x: 0, y: 3 }, + { x: 1, y: 2 }, + { x: 2, y: 4 }, + { x: 3, y: 10 }, + ]; + const dataset2 = dataset1.map((datum) => ({ ...datum, y: datum.y - 1 })); + const dataset3 = dataset1.map((datum) => ({ ...datum, y: datum.y - 2 })); - const chartTheme = { - areaSeriesStyle: generateAreaSeriesStyleKnobs('Chart Global Theme', 'chartTheme'), - }; + return ( + + + + Number(d).toFixed(2)} + /> + + + + + ); +}; +customSeriesStylesLines.story = { + name: 'custom series styles: lines', +}; - const dataset1 = [ - { x: 0, y: 3 }, - { x: 1, y: 6 }, - { x: 2, y: 4 }, - { x: 3, y: 10 }, - ]; - const dataset2 = dataset1.map((datum) => ({ ...datum, y: datum.y - 1 })); - const dataset3 = dataset1.map((datum) => ({ ...datum, y: datum.y - 2 })); +export const customSeriesStylesArea = () => { + const applyLineStyles = boolean('apply line series style', true, 'Chart Global Theme'); - const areaStyle1 = generateAreaSeriesStyleKnobs('Area 1 Style', 'area1', 'lime', 'green', 4, 10, 6, 'black'); - const areaStyle2 = generateAreaSeriesStyleKnobs( - 'Area 2 Style', - 'area2', - 'blue', - 'violet', - 2, - 5, - 4, - undefined, - 'red', - ); + const chartTheme = { + areaSeriesStyle: generateAreaSeriesStyleKnobs('Chart Global Theme', 'chartTheme'), + }; - return ( - - - - Number(d).toFixed(2)} - /> - - - - - ); - }) - .add('Add custom full and sub series label', () => { - const customSeriesLabel: SeriesStringPredicate = ({ yAccessor, splitAccessors }) => { - if (yAccessor === 'y1' && splitAccessors.get('g') === 'a') { - return 'replace full series name'; - } + const dataset1 = [ + { x: 0, y: 3 }, + { x: 1, y: 6 }, + { x: 2, y: 4 }, + { x: 3, y: 10 }, + ]; + const dataset2 = dataset1.map((datum) => ({ ...datum, y: datum.y - 1 })); + const dataset3 = dataset1.map((datum) => ({ ...datum, y: datum.y - 2 })); - return null; - }; - const customSubSeriesLabel: SubSeriesStringPredicate = (accessor, key) => { - if (key) { - // split accessor; - if (accessor === 'a') { - return 'replace a(from g)'; - } - } else { - // y accessor; - if (accessor === 'y2') { - return 'replace y2'; - } - } + const areaStyle1 = generateAreaSeriesStyleKnobs('Area 1 Style', 'area1', 'lime', 'green', 4, 10, 6, 'black'); + const areaStyle2 = generateAreaSeriesStyleKnobs('Area 2 Style', 'area2', 'blue', 'violet', 2, 5, 4, undefined, 'red'); - return null; - }; - return ( - - - - Number(d).toFixed(2)} - /> + return ( + + + + Number(d).toFixed(2)} + /> + + + + + ); +}; +customSeriesStylesArea.story = { + name: 'custom series styles: area', +}; - - - ); - }) - .add('Add custom sub-series label formatting [time/date and percent]', () => { - const start = DateTime.fromISO('2019-01-01T00:00:00.000', { zone: 'utc' }); - const data = [ - { x: 1, y: 3, percent: 0.5, time: start.plus({ month: 1 }).toMillis() }, - { x: 2, y: 6, percent: 0.5, time: start.plus({ month: 2 }).toMillis() }, - { x: 3, y: 20, percent: 0.5, time: start.plus({ month: 3 }).toMillis() }, - { x: 1, y: 9, percent: 0.7, time: start.plus({ month: 1 }).toMillis() }, - { x: 2, y: 13, percent: 0.7, time: start.plus({ month: 2 }).toMillis() }, - { x: 3, y: 14, percent: 0.7, time: start.plus({ month: 3 }).toMillis() }, - { x: 1, y: 15, percent: 0.1, time: start.plus({ month: 1 }).toMillis() }, - { x: 2, y: 18, percent: 1, time: start.plus({ month: 2 }).toMillis() }, - { x: 3, y: 7, percent: 1, time: start.plus({ month: 3 }).toMillis() }, - ]; - const customSubSeriesLabel: SubSeriesStringPredicate = (accessor, key, isTooltip) => { - if (key === 'time') { - // Format time group - if (isTooltip) { - // Format tooltip time to be longer - return moment(accessor).format('ll'); - } +export const addCustomFullAndSubSeriesLabel = () => { + const customSeriesLabel: SeriesStringPredicate = ({ yAccessor, splitAccessors }) => { + // eslint-disable-next-line react/prop-types + if (yAccessor === 'y1' && splitAccessors.get('g') === 'a') { + return 'replace full series name'; + } - // Format legend to be shorter - return moment(accessor).format('M/YYYY'); + return null; + }; + const customSubSeriesLabel: SubSeriesStringPredicate = (accessor, key) => { + if (key) { + // split accessor; + if (accessor === 'a') { + return 'replace a(from g)'; + } + } else { + // y accessor; + if (accessor === 'y2') { + return 'replace y2'; } + } + + return null; + }; + return ( + + + + Number(d).toFixed(2)} + /> - if (key === 'percent') { - // Format percent group - return `${(accessor as number) * 100}%`; + + + ); +}; +addCustomFullAndSubSeriesLabel.story = { + name: 'Add custom full and sub series label', +}; + +export const addCustomSubSeriesLabelFormatting = () => { + const start = DateTime.fromISO('2019-01-01T00:00:00.000', { zone: 'utc' }); + const data = [ + { x: 1, y: 3, percent: 0.5, time: start.plus({ month: 1 }).toMillis() }, + { x: 2, y: 6, percent: 0.5, time: start.plus({ month: 2 }).toMillis() }, + { x: 3, y: 20, percent: 0.5, time: start.plus({ month: 3 }).toMillis() }, + { x: 1, y: 9, percent: 0.7, time: start.plus({ month: 1 }).toMillis() }, + { x: 2, y: 13, percent: 0.7, time: start.plus({ month: 2 }).toMillis() }, + { x: 3, y: 14, percent: 0.7, time: start.plus({ month: 3 }).toMillis() }, + { x: 1, y: 15, percent: 0.1, time: start.plus({ month: 1 }).toMillis() }, + { x: 2, y: 18, percent: 1, time: start.plus({ month: 2 }).toMillis() }, + { x: 3, y: 7, percent: 1, time: start.plus({ month: 3 }).toMillis() }, + ]; + const customSubSeriesLabel: SubSeriesStringPredicate = (accessor, key, isTooltip) => { + if (key === 'time') { + // Format time group + if (isTooltip) { + // Format tooltip time to be longer + return moment(accessor).format('ll'); } - // don't format yAccessor - return null; - }; + // Format legend to be shorter + return moment(accessor).format('M/YYYY'); + } - return ( - - - - Number(d).toFixed(2)} - /> + if (key === 'percent') { + // Format percent group + return `${(accessor as number) * 100}%`; + } - - - ); - }) - .add('tickLabelPadding both prop and theme', () => { - const theme: PartialTheme = { - axes: { - tickLabelStyle: { - fill: color('tickFill', '#333', 'Tick Label'), - fontSize: range('tickFontSize', 0, 40, 10, 'Tick Label'), - fontFamily: `'Open Sans', Helvetica, Arial, sans-serif`, - fontStyle: 'normal', - padding: number('Tick Label Padding Theme', 1, {}, 'Tick Label'), - }, - }, - }; - const customStyle = { - tickLabelPadding: number('Tick Label Padding Axis Spec', 0), - }; - return ( - - - - Number(d).toFixed(2)} - /> - - - ); - }) - .add('Style Accessor Overrides', () => { - const hasThreshold = boolean('threshold', true); - const threshold = number('min threshold', 3); - const barStyle: RecursivePartial = { - rect: { - opacity: 0.5, - fill: 'red', + // don't format yAccessor + return null; + }; + + return ( + + + + Number(d).toFixed(2)} + /> + + + + ); +}; +addCustomFullAndSubSeriesLabel.story = { + name: 'Add custom sub-series label formatting [time/date and percent]', +}; + +export const tickLabelPaddingBothPropAndTheme = () => { + const theme: PartialTheme = { + axes: { + tickLabelStyle: { + fill: color('tickFill', '#333', 'Tick Label'), + fontSize: range('tickFontSize', 0, 40, 10, 'Tick Label'), + fontFamily: `'Open Sans', Helvetica, Arial, sans-serif`, + fontStyle: 'normal', + padding: number('Tick Label Padding Theme', 1, {}, 'Tick Label'), }, - }; - const pointStyle: RecursivePartial = { + }, + }; + const customStyle = { + tickLabelPadding: number('Tick Label Padding Axis Spec', 0), + }; + return ( + + + + Number(d).toFixed(2)} + /> + + + ); +}; +tickLabelPaddingBothPropAndTheme.story = { + name: 'tickLabelPadding both prop and theme', +}; + +export const styleAccessorOverrides = () => { + const hasThreshold = boolean('threshold', true); + const threshold = number('min threshold', 3); + const barStyle: RecursivePartial = { + rect: { + opacity: 0.5, fill: 'red', - radius: 10, - }; - const barStyleAccessor: BarStyleAccessor = (d, g) => - g.specId === getSpecId('bar') && d.y1! > threshold ? barStyle : null; - const pointStyleAccessor: PointStyleAccessor = (d, g) => - (g.specId === getSpecId('line') || g.specId === getSpecId('area')) && d.y1! > threshold ? pointStyle : null; + }, + }; + const pointStyle: RecursivePartial = { + fill: 'red', + radius: 10, + }; + const barStyleAccessor: BarStyleAccessor = (d, g) => + g.specId === getSpecId('bar') && d.y1! > threshold ? barStyle : null; + const pointStyleAccessor: PointStyleAccessor = (d, g) => + (g.specId === getSpecId('line') || g.specId === getSpecId('area')) && d.y1! > threshold ? pointStyle : null; - return ( - - + - - Number(d).toFixed(2)} - /> + }, + }} + /> + + Number(d).toFixed(2)} + /> - + - + - - - ); - }); + +
+ ); +}; +styleAccessorOverrides.story = { + name: 'Style Accessor Overrides', +};