From 12b7c939e9f067450be643a0772c807a4da1ae9c Mon Sep 17 00:00:00 2001 From: nickofthyme Date: Mon, 12 Apr 2021 14:01:37 -0500 Subject: [PATCH] fix(legend): sizing for short labels with scrollbar --- ...r-sizing-visually-looks-correct-1-snap.png | Bin 0 -> 20146 bytes src/state/selectors/get_legend_size.ts | 2 +- .../test_cases/5_legend_scroll_bar_sizing.tsx | 89 ++++++++++++++++++ stories/test_cases/test_cases.stories.tsx | 1 + 4 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-test-cases-legend-scroll-bar-sizing-visually-looks-correct-1-snap.png create mode 100644 stories/test_cases/5_legend_scroll_bar_sizing.tsx diff --git a/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-test-cases-legend-scroll-bar-sizing-visually-looks-correct-1-snap.png b/integration/tests/__image_snapshots__/all-test-ts-baseline-visual-tests-for-all-stories-test-cases-legend-scroll-bar-sizing-visually-looks-correct-1-snap.png new file mode 100644 index 0000000000000000000000000000000000000000..09ba4ae30284cb7ddf17e4b8b87608446bf19ba7 GIT binary patch literal 20146 zcmai61z42rw#81s0;EMsN|bICq>=7a8itUD0R|NWr9-+qhL9W@5h;<5ksOhd7(y6o zi2DxkpYxw{&$;(`^ck3$@B7{__TFo)y*3||6r}L4l3m5a!^4-6ex`zlcXj~}?~KLe zi{PEb&!$V@<&2|>lo(!7HwF0Q9-hpzr)qAA%M%`YgQk;5>)RBGq|Yv12(|d|cJ4~l z@Zfh$!Oy&M8z#g=p>-h}q-&zzNv;GtIk>W7+gXTyrE8OAxm(6_rg`JBO(9)j`Ik@6 zGVpFHzjz(Ddoa~HNk@AQW^cBP@f7kDid}WqPg&aF&Lz}DZtum{85C=R#o)d5D0q}Ceq~MJLc*Wbv`%#XrCrgncpj3m11~`GY ze%@zdVcCXLkLiP7Uf&ZBCjhVK<6c|4?yfZxM#aTxAM6h1sm6pKgg*pZ&ivXle)2s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~1y;j8h0mT>VY?WB_6fjTjbI>Z$36#Em&0el5K6<)3S-8^32bbuBJM(1dxuqfKvroF-8BY~1M9m+qn>TWfhe zLU7H5goJ#(6L@T&cpHkkCHu=}y&e5^&K&QPyW@QUTNfjvFF$khpTF_?{{HmBHMzCF s;QVXN*IUIel4o+BJYJ9P5|SQW^1n(*7GH>A$H^fw5(>|X#9qApAIgjwPyhe` literal 0 HcmV?d00001 diff --git a/src/state/selectors/get_legend_size.ts b/src/state/selectors/get_legend_size.ts index 10b15b84ad..26ce650420 100644 --- a/src/state/selectors/get_legend_size.ts +++ b/src/state/selectors/get_legend_size.ts @@ -33,7 +33,7 @@ import { getLegendItemsLabelsSelector } from './get_legend_items_labels'; const getParentDimensionSelector = (state: GlobalChartState) => state.parentDimensions; -const SCROLL_BAR_WIDTH = 6; // ~1em +const SCROLL_BAR_WIDTH = 16; // ~1em const MARKER_WIDTH = 16; const SHARED_MARGIN = 4; const VERTICAL_PADDING = 4; diff --git a/stories/test_cases/5_legend_scroll_bar_sizing.tsx b/stories/test_cases/5_legend_scroll_bar_sizing.tsx new file mode 100644 index 0000000000..8b62ddbe32 --- /dev/null +++ b/stories/test_cases/5_legend_scroll_bar_sizing.tsx @@ -0,0 +1,89 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import React from 'react'; + +import { Chart, Axis, Position, BarSeries, ScaleType, Settings } from '../../src'; + +const data = [ + { g: 'AE', x: '2021-04-06 00:00', y: 1 }, + { g: 'AE', x: '2021-04-06 03:00', y: 0 }, + { g: 'AF', x: '2021-04-07 06:00', y: 1 }, + { g: 'AF', x: '2021-04-07 09:00', y: 0 }, + { g: 'AM', x: '2021-04-10 09:00', y: 1 }, + { g: 'AO', x: '2021-04-07 09:00', y: 1 }, + { g: 'AO', x: '2021-04-07 12:00', y: 0 }, + { g: 'AR', x: '2021-04-07 03:00', y: 1 }, + { g: 'AR', x: '2021-04-07 06:00', y: 0 }, + { g: 'AT', x: '2021-04-12 03:00', y: 1 }, + { g: 'AU', x: '2021-04-06 09:00', y: 1 }, + { g: 'AU', x: '2021-04-06 12:00', y: 0 }, + { g: 'AZ', x: '2021-04-10 15:00', y: 1 }, + { g: 'AZ', x: '2021-04-10 18:00', y: 0 }, + { g: 'BA', x: '2021-04-09 06:00', y: 1 }, + { g: 'BA', x: '2021-04-09 09:00', y: 0 }, + { g: 'BD', x: '2021-04-06 03:00', y: 3 }, + { g: 'BD', x: '2021-04-06 06:00', y: 2 }, + { g: 'BD', x: '2021-04-06 09:00', y: 1 }, + { g: 'BD', x: '2021-04-06 12:00', y: 0 }, + { g: 'BE', x: '2021-04-07 06:00', y: 1 }, + { g: 'BF', x: '2021-04-09 09:00', y: 1 }, + { g: 'BJ', x: '2021-04-07 15:00', y: 1 }, + { g: 'BJ', x: '2021-04-07 18:00', y: 0 }, + { g: 'BO', x: '2021-04-07 06:00', y: 1 }, + { g: 'BO', x: '2021-04-07 09:00', y: 0 }, + { g: 'BR', x: '2021-04-06 03:00', y: 3 }, + { g: 'BR', x: '2021-04-06 06:00', y: 0 }, + { g: 'BR', x: '2021-04-06 09:00', y: 2 }, + { g: 'BR', x: '2021-04-06 12:00', y: 1 }, + { g: 'BR', x: '2021-04-06 15:00', y: 0 }, + { g: 'BW', x: '2021-04-06 03:00', y: 1 }, + { g: 'BY', x: '2021-04-08 06:00', y: 1 }, + { g: 'CA', x: '2021-04-07 09:00', y: 1 }, + { g: 'CA', x: '2021-04-07 12:00', y: 0 }, + { g: 'CA', x: '2021-04-08 06:00', y: 0 }, + { g: 'CA', x: '2021-04-08 09:00', y: 2 }, + { g: 'CA', x: '2021-04-08 12:00', y: 0 }, + { g: 'CD', x: '2021-04-07 03:00', y: 1 }, + { g: 'CD', x: '2021-04-07 06:00', y: 1 }, + { g: 'CD', x: '2021-04-07 09:00', y: 1 }, + { g: 'CD', x: '2021-04-07 12:00', y: 0 }, + { g: 'CG', x: '2021-04-12 06:00', y: 1 }, +]; + +/** + * Should filter out zero values when fitting domain + */ +export const Example = () => { + return ( + + + + + + + ); +}; diff --git a/stories/test_cases/test_cases.stories.tsx b/stories/test_cases/test_cases.stories.tsx index 816243fb2e..3f75475915 100644 --- a/stories/test_cases/test_cases.stories.tsx +++ b/stories/test_cases/test_cases.stories.tsx @@ -30,3 +30,4 @@ export { Example as noSeries } from './1_no_series'; export { Example as chromePathBugFix } from './2_chrome_path_bug_fix'; export { Example as noAxesAnnotationBugFix } from './3_no_axes_annotation'; export { Example as filterZerosInLogFitDomain } from './4_filter_zero_values_log'; +export { Example as legendScrollBarSizing } from './5_legend_scroll_bar_sizing';