@cdc/chart 4.24.9 → 4.24.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/dist/cdcchart.js +45911 -41739
- package/examples/feature/boxplot/boxplot-data.json +88 -22
- package/examples/feature/boxplot/boxplot.json +540 -16
- package/examples/feature/boxplot/testing.csv +7 -7
- package/examples/feature/sankey/sankey-example-data.json +0 -1
- package/examples/private/test.json +20092 -0
- package/index.html +4 -4
- package/package.json +2 -2
- package/src/CdcChart.tsx +209 -188
- package/src/_stories/Chart.CustomColors.stories.tsx +19 -0
- package/src/_stories/Chart.DynamicSeries.stories.tsx +27 -0
- package/src/_stories/Chart.Legend.Gradient.stories.tsx +74 -0
- package/src/_stories/Chart.stories.tsx +30 -3
- package/src/_stories/ChartAxisLabels.stories.tsx +20 -0
- package/src/_stories/ChartAxisTitles.stories.tsx +53 -0
- package/src/_stories/ChartEditor.stories.tsx +27 -0
- package/src/_stories/ChartLine.Suppression.stories.tsx +25 -0
- package/src/_stories/ChartPrefixSuffix.stories.tsx +159 -0
- package/src/_stories/_mock/boxplot_multiseries.json +647 -0
- package/src/_stories/_mock/dynamic_series_bar_config.json +723 -0
- package/src/_stories/_mock/dynamic_series_config.json +979 -0
- package/src/_stories/_mock/horizontal_bar.json +257 -0
- package/src/_stories/_mock/large_x_axis_labels.json +261 -0
- package/src/_stories/_mock/paired-bar.json +262 -0
- package/src/_stories/_mock/pie_with_data.json +255 -0
- package/{examples/feature/scatterplot/scatterplot.json → src/_stories/_mock/scatterplot_mock.json} +62 -92
- package/src/_stories/_mock/simplified_line.json +1510 -0
- package/src/_stories/_mock/suppression_mock.json +1549 -0
- package/src/components/Annotations/components/AnnotationDraggable.tsx +0 -3
- package/src/components/Annotations/components/AnnotationDropdown.tsx +1 -1
- package/src/components/Axis/Categorical.Axis.tsx +22 -4
- package/src/components/BarChart/components/BarChart.Horizontal.tsx +95 -16
- package/src/components/BarChart/components/BarChart.StackedHorizontal.tsx +41 -17
- package/src/components/BarChart/components/BarChart.StackedVertical.tsx +43 -9
- package/src/components/BarChart/components/BarChart.Vertical.tsx +123 -47
- package/src/components/BarChart/helpers/index.ts +23 -5
- package/src/components/BoxPlot/BoxPlot.tsx +189 -0
- package/src/components/BrushChart.tsx +3 -2
- package/src/components/DeviationBar.jsx +58 -8
- package/src/components/EditorPanel/EditorPanel.tsx +127 -102
- package/src/components/EditorPanel/components/Panels/Panel.Annotate.tsx +11 -28
- package/src/components/EditorPanel/components/Panels/Panel.BoxPlot.tsx +51 -6
- package/src/components/EditorPanel/components/Panels/Panel.General.tsx +21 -4
- package/src/components/EditorPanel/components/Panels/Panel.Regions.tsx +40 -9
- package/src/components/EditorPanel/components/Panels/Panel.Sankey.tsx +3 -3
- package/src/components/EditorPanel/components/Panels/Panel.Series.tsx +121 -56
- package/src/components/EditorPanel/components/Panels/Panel.Visual.tsx +296 -35
- package/src/components/EditorPanel/components/panels.scss +4 -6
- package/src/components/EditorPanel/editor-panel.scss +0 -8
- package/src/components/EditorPanel/helpers/tests/updateFieldRankByValue.test.ts +38 -0
- package/src/components/EditorPanel/helpers/updateFieldRankByValue.ts +42 -0
- package/src/components/EditorPanel/useEditorPermissions.ts +16 -1
- package/src/components/ForestPlot/ForestPlot.tsx +2 -3
- package/src/components/ForestPlot/ForestPlotProps.ts +2 -0
- package/src/components/Legend/Legend.Component.tsx +23 -24
- package/src/components/Legend/Legend.Suppression.tsx +25 -20
- package/src/components/Legend/Legend.tsx +16 -18
- package/src/components/Legend/helpers/index.ts +16 -19
- package/src/components/LegendWrapper.tsx +3 -1
- package/src/components/LineChart/components/LineChart.Circle.tsx +10 -0
- package/src/components/LineChart/helpers.ts +48 -43
- package/src/components/LineChart/index.tsx +88 -82
- package/src/components/LinearChart.tsx +747 -562
- package/src/components/PairedBarChart.jsx +50 -10
- package/src/components/PieChart/PieChart.tsx +1 -6
- package/src/components/Regions/components/Regions.tsx +33 -19
- package/src/components/Sankey/index.tsx +50 -32
- package/src/components/Sankey/sankey.scss +6 -5
- package/src/components/Sankey/useSankeyAlert.tsx +60 -0
- package/src/components/ScatterPlot/ScatterPlot.jsx +20 -4
- package/src/components/ZoomBrush.tsx +25 -6
- package/src/coreStyles_chart.scss +3 -0
- package/src/data/initial-state.js +8 -10
- package/src/helpers/configHelpers.ts +28 -0
- package/src/helpers/handleRankByValue.ts +15 -0
- package/src/helpers/sizeHelpers.ts +25 -0
- package/src/helpers/tests/handleRankByValue.test.ts +37 -0
- package/src/helpers/tests/sizeHelpers.test.ts +80 -0
- package/src/hooks/useColorPalette.js +10 -2
- package/src/hooks/useLegendClasses.ts +13 -22
- package/src/hooks/useMinMax.ts +27 -13
- package/src/hooks/useReduceData.ts +43 -10
- package/src/hooks/useScales.ts +87 -38
- package/src/hooks/useTooltip.tsx +62 -53
- package/src/index.jsx +1 -0
- package/src/scss/DataTable.scss +5 -4
- package/src/scss/main.scss +57 -70
- package/src/types/ChartConfig.ts +43 -34
- package/src/types/ChartContext.ts +22 -15
- package/src/types/ForestPlot.ts +8 -0
- package/src/_stories/Chart.Legend.Gradient.tsx +0 -19
- package/src/_stories/ChartBrush.stories.tsx +0 -19
- package/src/components/BoxPlot/BoxPlot.jsx +0 -111
- package/src/components/LinearChart.jsx +0 -817
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import Chart from '../CdcChart'
|
|
3
|
+
import scatterPlotCustomColorConfig from './_mock/scatterplot_mock.json'
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof Chart> = {
|
|
6
|
+
title: 'Components/Templates/Chart/Custom Colors',
|
|
7
|
+
component: Chart
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof Chart>
|
|
11
|
+
|
|
12
|
+
export const ScatterPlot: Story = {
|
|
13
|
+
args: {
|
|
14
|
+
config: scatterPlotCustomColorConfig,
|
|
15
|
+
isEditor: false
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default meta
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import DynamicSeriesConfig from './_mock/dynamic_series_config.json'
|
|
2
|
+
import DynamicSeriesBarConfig from './_mock/dynamic_series_bar_config.json'
|
|
3
|
+
import { Meta, StoryObj } from '@storybook/react'
|
|
4
|
+
import Chart from '../CdcChart'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof Chart> = {
|
|
7
|
+
title: 'Components/Templates/Chart/Dynamic Series',
|
|
8
|
+
component: Chart
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof Chart>
|
|
12
|
+
|
|
13
|
+
export const Line: Story = {
|
|
14
|
+
args: {
|
|
15
|
+
config: DynamicSeriesConfig,
|
|
16
|
+
isEditor: false
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const Bar: Story = {
|
|
21
|
+
args: {
|
|
22
|
+
config: DynamicSeriesBarConfig,
|
|
23
|
+
isEditor: false
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default meta
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import chartGradientConfig from './_mock/legend.gradient_mock.json'
|
|
3
|
+
import SimplifiedLineConfig from './_mock/simplified_line.json'
|
|
4
|
+
|
|
5
|
+
import Chart from '../CdcChart'
|
|
6
|
+
import { editConfigKeys } from '../helpers/configHelpers'
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof Chart> = {
|
|
9
|
+
title: 'Components/Templates/Chart/Legend',
|
|
10
|
+
component: Chart
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof Chart>
|
|
14
|
+
|
|
15
|
+
export const Legend_Gradient_Smooth: Story = {
|
|
16
|
+
args: {
|
|
17
|
+
config: chartGradientConfig
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const Legend_Gradient_Linear_Blocks: Story = {
|
|
22
|
+
args: {
|
|
23
|
+
config: editConfigKeys(chartGradientConfig, [{ path: ['legend', 'subStyle'], value: 'linear blocks' }])
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const Labels_On_Line_Legend_On_Top: Story = {
|
|
28
|
+
args: {
|
|
29
|
+
config: editConfigKeys(chartGradientConfig, [{ path: ['yAxis', 'labelsAboveGridlines'], value: true }])
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const Legend_On_Right: Story = {
|
|
34
|
+
args: {
|
|
35
|
+
config: SimplifiedLineConfig
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const Legend_On_Right_With_Box: Story = {
|
|
40
|
+
args: {
|
|
41
|
+
config: editConfigKeys(SimplifiedLineConfig, [{ path: ['legend', 'hideBorder'], value: false }])
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const Legend_Gradient_With_box: Story = {
|
|
46
|
+
args: {
|
|
47
|
+
config: editConfigKeys(chartGradientConfig, [{ path: ['legend', 'hideBorder'], value: false }])
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const Legend_Gradient_With_Text: Story = {
|
|
52
|
+
args: {
|
|
53
|
+
config: editConfigKeys(chartGradientConfig, [
|
|
54
|
+
{ path: ['legend', 'title'], value: 'Title' },
|
|
55
|
+
{ path: ['legend', 'description'], value: 'Description' },
|
|
56
|
+
{ path: ['legend', 'hideBorder'], value: false }
|
|
57
|
+
])
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export const Legend_Gradient_Wrapping_Label: Story = {
|
|
61
|
+
args: {
|
|
62
|
+
config: JSON.parse(
|
|
63
|
+
JSON.stringify(
|
|
64
|
+
editConfigKeys(chartGradientConfig, [
|
|
65
|
+
{ path: ['legend', 'title'], value: 'Title' },
|
|
66
|
+
{ path: ['legend', 'description'], value: 'Description' },
|
|
67
|
+
{ path: ['legend', 'hideBorder'], value: false }
|
|
68
|
+
])
|
|
69
|
+
).replace(/Data 1/g, 'This is a long string that should wrap')
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export default meta
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
import SuppressedConfig from './_mock/bar-chart-suppressed.json'
|
|
3
2
|
|
|
4
3
|
import Chart from '../CdcChart'
|
|
5
4
|
import lineChartTwoPointsRegressionTest from './_mock/line_chart_two_points_regression_test.json'
|
|
6
5
|
import lineChartTwoPointsNewChart from './_mock/line_chart_two_points_new_chart.json'
|
|
7
6
|
import lollipop from './_mock/lollipop.json'
|
|
7
|
+
import forestPlot from '../../examples/feature/forest-plot/forest-plot.json'
|
|
8
|
+
import pairedBar from './_mock/paired-bar.json'
|
|
9
|
+
import horizontalBarConfig from './_mock/horizontal_bar.json'
|
|
10
|
+
import pieConfig from './_mock/pie_with_data.json'
|
|
11
|
+
import boxPlotConfig from './_mock/boxplot_multiseries.json'
|
|
8
12
|
|
|
9
13
|
const meta: Meta<typeof Chart> = {
|
|
10
14
|
title: 'Components/Templates/Chart',
|
|
@@ -33,9 +37,32 @@ export const Lollipop: Story = {
|
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
|
|
36
|
-
export const
|
|
40
|
+
export const Forest_Plot: Story = {
|
|
37
41
|
args: {
|
|
38
|
-
config:
|
|
42
|
+
config: forestPlot
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const Horizontal_Bar: Story = {
|
|
47
|
+
args: {
|
|
48
|
+
config: horizontalBarConfig
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const Pie: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
config: pieConfig
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const Paired_Bar: Story = {
|
|
59
|
+
args: {
|
|
60
|
+
config: pairedBar
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export const BoxPlot_Multiseries: Story = {
|
|
64
|
+
args: {
|
|
65
|
+
config: boxPlotConfig,
|
|
39
66
|
isEditor: false
|
|
40
67
|
}
|
|
41
68
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import SimplifiedLineConfig from './_mock/simplified_line.json'
|
|
3
|
+
|
|
4
|
+
import Chart from '../CdcChart'
|
|
5
|
+
import { editConfigKeys } from '../helpers/configHelpers'
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Chart> = {
|
|
8
|
+
title: 'Components/Templates/Chart/Axis Labels',
|
|
9
|
+
component: Chart
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type Story = StoryObj<typeof Chart>
|
|
13
|
+
|
|
14
|
+
export const Abbreviated_Dates: Story = {
|
|
15
|
+
args: {
|
|
16
|
+
config: editConfigKeys(SimplifiedLineConfig, [{ path: ['xAxis', 'showYearsOnce'], value: true }])
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default meta
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import Chart from '../CdcChart'
|
|
3
|
+
import longXLabelsConfig from './_mock/large_x_axis_labels.json'
|
|
4
|
+
import pairedBarConfig from './_mock/paired-bar.json'
|
|
5
|
+
import { editConfigKeys } from '../helpers/configHelpers'
|
|
6
|
+
import { ChartConfig } from '../types/ChartConfig'
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof Chart> = {
|
|
9
|
+
title: 'Components/Templates/Chart/Axis Titles',
|
|
10
|
+
component: Chart
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default meta
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof Chart>
|
|
16
|
+
|
|
17
|
+
export const Dynamic_Labels: Story = {
|
|
18
|
+
args: {
|
|
19
|
+
config: editConfigKeys(longXLabelsConfig, [{ path: ['xAxis', 'label'], value: 'This is the title' }])
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const Rotated_Labels: StoryObj<{ config: ChartConfig; tickRotation: number }> = {
|
|
24
|
+
args: {
|
|
25
|
+
tickRotation: 0, // Default value
|
|
26
|
+
config: longXLabelsConfig
|
|
27
|
+
},
|
|
28
|
+
argTypes: {
|
|
29
|
+
tickRotation: {
|
|
30
|
+
control: {
|
|
31
|
+
type: 'range',
|
|
32
|
+
min: 0,
|
|
33
|
+
max: 90,
|
|
34
|
+
step: 5
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
render: args => {
|
|
39
|
+
// Create a new config object with the updated tickRotation
|
|
40
|
+
const config = editConfigKeys(longXLabelsConfig, [
|
|
41
|
+
{ path: ['xAxis', 'label'], value: 'This is the title This is the title This is the title' },
|
|
42
|
+
{ path: ['xAxis', 'tickRotation'], value: args.tickRotation }
|
|
43
|
+
])
|
|
44
|
+
|
|
45
|
+
return <Chart config={config} />
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const Paired_Bar: Story = {
|
|
50
|
+
args: {
|
|
51
|
+
config: pairedBarConfig
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -4,6 +4,7 @@ import Chart from '../CdcChart'
|
|
|
4
4
|
import pieChartExample from './_mock/pie_config.json'
|
|
5
5
|
import pieData from './_mock/pie_data.json'
|
|
6
6
|
import urlFilterExample from './_mock/url_filter.json'
|
|
7
|
+
import mockScatterPlot from './_mock/scatterplot_mock.json'
|
|
7
8
|
|
|
8
9
|
const meta: Meta<typeof Chart> = {
|
|
9
10
|
title: 'Components/Templates/Chart/Editor',
|
|
@@ -30,4 +31,30 @@ export const Url_Filter: Story = {
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
export const ScatterPlot: Story = {
|
|
35
|
+
args: {
|
|
36
|
+
config: mockScatterPlot,
|
|
37
|
+
isEditor: true
|
|
38
|
+
},
|
|
39
|
+
play: async ({ canvasElement }) => {
|
|
40
|
+
const canvas = within(canvasElement)
|
|
41
|
+
const user = userEvent.setup()
|
|
42
|
+
// play is running before full rendering is complete so sleep function
|
|
43
|
+
// is needed to delay the execution.
|
|
44
|
+
// possible related bug: https://github.com/storybookjs/storybook/issues/18258
|
|
45
|
+
await sleep(3000)
|
|
46
|
+
const dateCategoryAccordion = await canvas.findByRole('button', { name: /Date\/Category Axis/i })
|
|
47
|
+
user.click(dateCategoryAccordion)
|
|
48
|
+
await sleep(1000)
|
|
49
|
+
const minValueInput = await canvas.findByLabelText('min value')
|
|
50
|
+
const maxValueInput = await canvas.findByLabelText('max value')
|
|
51
|
+
await user.type(minValueInput, '0')
|
|
52
|
+
await user.type(maxValueInput, '100')
|
|
53
|
+
await sleep(1000)
|
|
54
|
+
// Scroll to the top of the screen
|
|
55
|
+
user.click(dateCategoryAccordion)
|
|
56
|
+
await canvasElement.scrollTo(0, 0)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
33
60
|
export default meta
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import Chart from '../CdcChart'
|
|
3
|
+
import suppressionConfig from './_mock/suppression_mock.json'
|
|
4
|
+
import SuppressedConfig from './_mock/bar-chart-suppressed.json'
|
|
5
|
+
const meta: Meta<typeof Chart> = {
|
|
6
|
+
title: 'Components/Templates/Chart/Suppression',
|
|
7
|
+
component: Chart
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type Story = StoryObj<typeof Chart>
|
|
11
|
+
|
|
12
|
+
export const SuppressedLines: Story = {
|
|
13
|
+
args: {
|
|
14
|
+
config: suppressionConfig,
|
|
15
|
+
isEditor: false
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export const SuppressedBars: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
config: SuppressedConfig,
|
|
21
|
+
isEditor: false
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default meta
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import barConfig from './_mock/line_chart_two_points_new_chart.json'
|
|
3
|
+
import annotationConfig from './_mock/annotation_category_mock.json'
|
|
4
|
+
import areaPrefix from './_mock/annotation_category_mock.json'
|
|
5
|
+
import horizontalBarConfig from './_mock/horizontal_bar.json'
|
|
6
|
+
import scatterPlotConfig from './_mock/scatterplot_mock.json'
|
|
7
|
+
|
|
8
|
+
import Chart from '../CdcChart'
|
|
9
|
+
import { editConfigKeys } from '../helpers/configHelpers'
|
|
10
|
+
|
|
11
|
+
const meta: Meta<typeof Chart> = {
|
|
12
|
+
title: 'Components/Templates/Chart/Prefix Suffix',
|
|
13
|
+
component: Chart
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type Story = StoryObj<typeof Chart>
|
|
17
|
+
|
|
18
|
+
export const Top_Suffix: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
config: editConfigKeys(barConfig, [
|
|
21
|
+
{ path: ['dataFormat', 'onlyShowTopPrefixSuffix'], value: true },
|
|
22
|
+
{ path: ['dataFormat', 'suffix'], value: ' Somethings per Something' },
|
|
23
|
+
{ path: ['yAxis', 'gridLines'], value: true }
|
|
24
|
+
])
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const Top_Suffix_Worst_Case: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
config: editConfigKeys(annotationConfig, [
|
|
31
|
+
{ path: ['dataFormat', 'onlyShowTopPrefixSuffix'], value: true },
|
|
32
|
+
{ path: ['dataFormat', 'suffix'], value: ' Somethings per Something' }
|
|
33
|
+
])
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const Top_Suffix_With_Options: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
config: editConfigKeys(annotationConfig, [
|
|
40
|
+
{ path: ['dataFormat', 'onlyShowTopPrefixSuffix'], value: true },
|
|
41
|
+
{ path: ['yAxis', 'tickRotation'], value: 45 },
|
|
42
|
+
{ path: ['yAxis', 'tickLabelColor'], value: 'red' }
|
|
43
|
+
])
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const Top_Suffix_No_Space: Story = {
|
|
48
|
+
args: {
|
|
49
|
+
config: editConfigKeys(annotationConfig, [
|
|
50
|
+
{ path: ['dataFormat', 'onlyShowTopPrefixSuffix'], value: true },
|
|
51
|
+
{ path: ['dataFormat', 'suffix'], value: 'lbs' }
|
|
52
|
+
])
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const Top_Suffix_With_Space: Story = {
|
|
57
|
+
args: {
|
|
58
|
+
config: editConfigKeys(annotationConfig, [
|
|
59
|
+
{ path: ['dataFormat', 'onlyShowTopPrefixSuffix'], value: true },
|
|
60
|
+
{ path: ['dataFormat', 'suffix'], value: 'lbs of something' }
|
|
61
|
+
])
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const Suffix: Story = {
|
|
66
|
+
args: {
|
|
67
|
+
config: annotationConfig
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export const Top_Prefix: Story = {
|
|
71
|
+
args: {
|
|
72
|
+
config: editConfigKeys(annotationConfig, [
|
|
73
|
+
{ path: ['dataFormat', 'onlyShowTopPrefixSuffix'], value: true },
|
|
74
|
+
{ path: ['dataFormat', 'prefix'], value: '$' },
|
|
75
|
+
{ path: ['dataFormat', 'suffix'], value: '' }
|
|
76
|
+
])
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export const Prefix: Story = {
|
|
80
|
+
args: {
|
|
81
|
+
config: editConfigKeys(areaPrefix, [
|
|
82
|
+
{ path: ['dataFormat', 'prefix'], value: '$' },
|
|
83
|
+
{ path: ['dataFormat', 'suffix'], value: '' }
|
|
84
|
+
])
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const Top_Prefix_And_Suffix: Story = {
|
|
89
|
+
args: {
|
|
90
|
+
config: editConfigKeys(annotationConfig, [
|
|
91
|
+
{ path: ['dataFormat', 'onlyShowTopPrefixSuffix'], value: true },
|
|
92
|
+
{ path: ['dataFormat', 'prefix'], value: '$' }
|
|
93
|
+
])
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export const Horizontal_Bar: Story = {
|
|
97
|
+
args: {
|
|
98
|
+
config: editConfigKeys(horizontalBarConfig, [
|
|
99
|
+
{ path: ['dataFormat', 'suffix'], value: ' suf' },
|
|
100
|
+
{ path: ['dataFormat', 'prefix'], value: 'pre' }
|
|
101
|
+
])
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export const Top_Suffix_On_Line: Story = {
|
|
106
|
+
args: {
|
|
107
|
+
config: editConfigKeys(barConfig, [
|
|
108
|
+
{ path: ['dataFormat', 'onlyShowTopPrefixSuffix'], value: true },
|
|
109
|
+
{ path: ['dataFormat', 'suffix'], value: ' Somethings per Something' },
|
|
110
|
+
{ path: ['yAxis', 'gridLines'], value: true },
|
|
111
|
+
{ path: ['yAxis', 'labelsAboveGridlines'], value: true },
|
|
112
|
+
{ path: ['yAxis', 'hideAxis'], value: true }
|
|
113
|
+
])
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const Values_On_Line_All_Suffix: Story = {
|
|
118
|
+
args: {
|
|
119
|
+
config: editConfigKeys(annotationConfig, [
|
|
120
|
+
{ path: ['yAxis', 'labelsAboveGridlines'], value: true },
|
|
121
|
+
{ path: ['dataFormat', 'suffix'], value: ' units' },
|
|
122
|
+
{ path: ['yAxis', 'gridLines'], value: true },
|
|
123
|
+
{ path: ['yAxis', 'hideAxis'], value: true }
|
|
124
|
+
])
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export const Values_on_Line_Top_Suffix_Only_Area_Worst_Case: Story = {
|
|
129
|
+
args: {
|
|
130
|
+
config: editConfigKeys(annotationConfig, [
|
|
131
|
+
{ path: ['dataFormat', 'onlyShowTopPrefixSuffix'], value: true },
|
|
132
|
+
{ path: ['dataFormat', 'prefix'], value: 'pre' },
|
|
133
|
+
{ path: ['dataFormat', 'suffix'], value: ' Somethings per Something' },
|
|
134
|
+
{ path: ['yAxis', 'labelsAboveGridlines'], value: true },
|
|
135
|
+
{ path: ['yAxis', 'gridLines'], value: true }
|
|
136
|
+
])
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export const Top_Suffix_Above_Gridlines_With_Options: Story = {
|
|
141
|
+
args: {
|
|
142
|
+
config: editConfigKeys(annotationConfig, [
|
|
143
|
+
{ path: ['yAxis', 'tickRotation'], value: 45 },
|
|
144
|
+
{ path: ['yAxis', 'tickLabelColor'], value: 'red' },
|
|
145
|
+
{ path: ['yAxis', 'labelsAboveGridlines'], value: true },
|
|
146
|
+
{ path: ['yAxis', 'gridLines'], value: true },
|
|
147
|
+
{ path: ['yAxis', 'hideAxis'], value: true }
|
|
148
|
+
])
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export const ScatterPlot_Bottom_Commas: Story = {
|
|
153
|
+
args: {
|
|
154
|
+
config: editConfigKeys(scatterPlotConfig, [{ path: ['dataFormat', 'bottomCommas'], value: true }])
|
|
155
|
+
},
|
|
156
|
+
isEditor: true
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export default meta
|