diff --git a/dashboards-observability/common/constants/explorer.ts b/dashboards-observability/common/constants/explorer.ts index 40ea3bb13..f572a9a0c 100644 --- a/dashboards-observability/common/constants/explorer.ts +++ b/dashboards-observability/common/constants/explorer.ts @@ -238,7 +238,6 @@ export interface DefaultBarChartStylesProps { BarMode: string; GroupWidth: number; BarWidth: number; - LineWidth: number; LabelSize: number; } @@ -246,7 +245,6 @@ export const DEFAULT_BAR_CHART_STYLES: DefaultBarChartStylesProps = { BarMode: 'group', GroupWidth: 0.7, BarWidth: 0.97, - LineWidth: 1, LabelSize: 12, }; diff --git a/dashboards-observability/public/components/custom_panels/helpers/__tests__/__snapshots__/utils.test.tsx.snap b/dashboards-observability/public/components/custom_panels/helpers/__tests__/__snapshots__/utils.test.tsx.snap index 91d867566..743789e9b 100644 --- a/dashboards-observability/public/components/custom_panels/helpers/__tests__/__snapshots__/utils.test.tsx.snap +++ b/dashboards-observability/public/components/custom_panels/helpers/__tests__/__snapshots__/utils.test.tsx.snap @@ -361,7 +361,7 @@ exports[`Utils helper functions renders displayVisualization function 1`] = ` }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -414,7 +414,7 @@ exports[`Utils helper functions renders displayVisualization function 1`] = ` "label": "Vertical bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "bar", "orientation": "v", @@ -809,7 +809,7 @@ exports[`Utils helper functions renders displayVisualization function 1`] = ` }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -862,7 +862,7 @@ exports[`Utils helper functions renders displayVisualization function 1`] = ` "label": "Vertical bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "bar", "orientation": "v", @@ -1264,7 +1264,7 @@ exports[`Utils helper functions renders displayVisualization function 1`] = ` }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -1317,7 +1317,7 @@ exports[`Utils helper functions renders displayVisualization function 1`] = ` "label": "Vertical bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "bar", "orientation": "v", @@ -3414,7 +3414,7 @@ exports[`Utils helper functions renders displayVisualization function 3`] = ` }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -3467,7 +3467,7 @@ exports[`Utils helper functions renders displayVisualization function 3`] = ` "label": "Horizontal bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "horizontal_bar", "orientation": "h", @@ -3862,7 +3862,7 @@ exports[`Utils helper functions renders displayVisualization function 3`] = ` }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -3915,7 +3915,7 @@ exports[`Utils helper functions renders displayVisualization function 3`] = ` "label": "Horizontal bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "horizontal_bar", "orientation": "h", @@ -4317,7 +4317,7 @@ exports[`Utils helper functions renders displayVisualization function 3`] = ` }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -4370,7 +4370,7 @@ exports[`Utils helper functions renders displayVisualization function 3`] = ` "label": "Horizontal bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "horizontal_bar", "orientation": "h", @@ -4796,7 +4796,7 @@ exports[`Utils helper functions renders displayVisualization function 4`] = ` }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -4849,7 +4849,7 @@ exports[`Utils helper functions renders displayVisualization function 4`] = ` "label": "Horizontal bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "horizontal_bar", "orientation": "h", @@ -5190,7 +5190,7 @@ exports[`Utils helper functions renders displayVisualization function 4`] = ` }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -5243,7 +5243,7 @@ exports[`Utils helper functions renders displayVisualization function 4`] = ` "label": "Horizontal bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "horizontal_bar", "orientation": "h", @@ -5591,7 +5591,7 @@ exports[`Utils helper functions renders displayVisualization function 4`] = ` }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -5644,7 +5644,7 @@ exports[`Utils helper functions renders displayVisualization function 4`] = ` "label": "Horizontal bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "horizontal_bar", "orientation": "h", diff --git a/dashboards-observability/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap b/dashboards-observability/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap index b940933a8..9880f2a59 100644 --- a/dashboards-observability/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap +++ b/dashboards-observability/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap @@ -446,7 +446,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -499,7 +499,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] "label": "Vertical bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "bar", "orientation": "v", @@ -776,7 +776,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -830,7 +830,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] "label": "Vertical bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "bar", "orientation": "v", @@ -1089,7 +1089,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -1142,7 +1142,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] "label": "Horizontal bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "horizontal_bar", "orientation": "h", @@ -4238,7 +4238,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -4292,7 +4292,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] "label": "Vertical bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "bar", "orientation": "v", @@ -4583,7 +4583,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -4637,7 +4637,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] "label": "Vertical bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "bar", "orientation": "v", @@ -4933,7 +4933,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -4988,7 +4988,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] key="vertical bar" labelangle={0} legendposition="v" - linewidth={1} + linewidth={2} mode="group" name="bar" option={ @@ -5218,7 +5218,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -5272,7 +5272,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] "label": "Vertical bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "bar", "orientation": "v", @@ -5569,7 +5569,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -5623,7 +5623,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] id="bar" labelangle={0} legendposition="v" - linewidth={1} + linewidth={2} mode="group" name="bar" orientation="v" @@ -5890,7 +5890,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -5943,7 +5943,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] id="bar" labelangle={0} legendposition="v" - linewidth={1} + linewidth={2} mode="group" name="bar" orientation="v" @@ -6379,7 +6379,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -6837,7 +6837,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -6890,7 +6890,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] "label": "Vertical bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "bar", "orientation": "v", @@ -7177,7 +7177,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -7635,7 +7635,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -7688,7 +7688,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] "label": "Vertical bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "bar", "orientation": "v", @@ -8206,7 +8206,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -8259,7 +8259,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] "label": "Vertical bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "bar", "orientation": "v", @@ -8614,7 +8614,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -9072,7 +9072,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -9125,7 +9125,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] "label": "Vertical bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "bar", "orientation": "v", @@ -9639,7 +9639,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -9692,7 +9692,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] "label": "Vertical bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "bar", "orientation": "v", @@ -10473,7 +10473,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -10526,7 +10526,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] "label": "Vertical bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "bar", "orientation": "v", @@ -11806,7 +11806,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -11859,7 +11859,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] "label": "Vertical bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "bar", "orientation": "v", @@ -12710,7 +12710,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -13160,7 +13160,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, Object { "component": [Function], - "defaultState": 1, + "defaultState": 2, "eleType": "slider", "mapTo": "lineWidth", "name": "Line width", @@ -13213,7 +13213,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] "label": "Vertical bar", "labelangle": 0, "legendposition": "v", - "linewidth": 1, + "linewidth": 2, "mode": "group", "name": "bar", "orientation": "v", @@ -14974,7 +14974,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] />
@@ -15088,7 +15088,7 @@ exports[`Config panel component Renders config panel with visualization data 1`] name="Line width" onChange={[Function]} step={1} - value={1} + value={2} > { dataConfig?.legend?.showLegend && dataConfig.legend.showLegend !== visMetaData.showlegend ); const legendPosition = dataConfig?.legend?.position || visMetaData.legendposition; - - visualizations.data?.rawVizData?.dataConfig?.metrics - ? visualizations.data.rawVizData.dataConfig.metrics - : []; const labelSize = dataConfig?.chartStyles?.labelSize || DEFAULT_BAR_CHART_STYLES.LabelSize; const legendSize = dataConfig?.legend?.legendSize; const getSelectedColorTheme = (field: any, index: number) => diff --git a/dashboards-observability/public/components/visualizations/charts/bar/bar_type.ts b/dashboards-observability/public/components/visualizations/charts/bar/bar_type.ts index bc2fd0742..7cb75ba3a 100644 --- a/dashboards-observability/public/components/visualizations/charts/bar/bar_type.ts +++ b/dashboards-observability/public/components/visualizations/charts/bar/bar_type.ts @@ -25,9 +25,8 @@ import { DEFAULT_BAR_CHART_STYLES } from '../../../../../common/constants/explor const sharedConfigs = getPlotlySharedConfigs(); const VIS_CATEGORY = getPlotlyCategory(); -// const { LegendPosition, ShowLegend } = DEFAULT_CHART_STYLES; -const { LegendPosition, ShowLegend, LabelAngle, FillOpacity } = DEFAULT_CHART_STYLES; -const { BarMode, GroupWidth, BarWidth, LineWidth } = DEFAULT_BAR_CHART_STYLES; +const { LegendPosition, ShowLegend, LabelAngle, FillOpacity, LineWidth } = DEFAULT_CHART_STYLES; +const { BarMode, GroupWidth, BarWidth } = DEFAULT_BAR_CHART_STYLES; const isHorizontalBar = (paramstype: string) => paramstype === VIS_CHART_TYPES.HorizontalBar ? true : false; @@ -123,7 +122,7 @@ export const createBarTypeDefinition = (params: any) => ({ eleType: 'buttons', props: { options: [ - { name: 'Group', id: 'group' }, + { name: 'Group', id: BarMode }, { name: 'Stack', id: 'stack' }, ], defaultSelections: [{ name: 'Group', id: BarMode }],