@cdc/chart 4.25.3-6 → 4.25.3
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/dist/cdcchart-1a1724a1.es.js +4886 -0
- package/dist/cdcchart.js +51921 -76151
- package/index.html +1 -1
- package/package.json +2 -2
- package/src/CdcChart.tsx +1 -22
- package/src/CdcChartComponent.tsx +27 -13
- package/src/_stories/Chart.CI.stories.tsx +33 -0
- package/src/_stories/Chart.Legend.Gradient.stories.tsx +6 -0
- package/src/_stories/Chart.stories.tsx +0 -16
- package/src/_stories/_mock/bar_chart_ci_labels.json +620 -0
- package/src/_stories/_mock/legend_groupBy_mock.json +474 -0
- package/src/components/BarChart/components/BarChart.Horizontal.tsx +1 -1
- package/src/components/BarChart/components/BarChart.StackedHorizontal.tsx +1 -1
- package/src/components/BarChart/components/BarChart.StackedVertical.tsx +1 -1
- package/src/components/BarChart/components/BarChart.Vertical.tsx +2 -2
- package/src/components/EditorPanel/EditorPanel.tsx +60 -24
- package/src/components/EditorPanel/helpers/updateFieldRankByValue.ts +4 -3
- package/src/components/Legend/Legend.Component.tsx +69 -58
- package/src/components/Legend/Legend.tsx +3 -1
- package/src/components/Legend/LegendGroup/LegendGroup.styles.css +40 -0
- package/src/components/Legend/LegendGroup/LegendGroup.tsx +103 -0
- package/src/components/Legend/LegendGroup/index.tsx +3 -0
- package/src/components/LineChart/components/LineChart.Circle.tsx +14 -9
- package/src/components/LineChart/index.tsx +18 -7
- package/src/components/LinearChart.tsx +38 -30
- package/src/data/initial-state.js +1 -1
- package/src/helpers/dataHelpers.ts +10 -0
- package/src/helpers/sizeHelpers.ts +23 -0
- package/src/hooks/useBarChart.ts +2 -1
- package/src/hooks/useScales.ts +2 -8
- package/src/store/chart.actions.ts +1 -1
- package/src/types/ChartConfig.ts +2 -1
package/src/hooks/useBarChart.ts
CHANGED
|
@@ -200,7 +200,8 @@ export const useBarChart = () => {
|
|
|
200
200
|
return d[config.xAxis.dataKey] === xAxisDataValue && dynamicCategoryMatch
|
|
201
201
|
}) || {}
|
|
202
202
|
Object.keys(columns).forEach(colKeys => {
|
|
203
|
-
|
|
203
|
+
const colConfig = config.columns[colKeys]
|
|
204
|
+
if (series && colConfig.series && colConfig.series !== series && !colConfig.tooltips) return
|
|
204
205
|
const formattingParams = {
|
|
205
206
|
addColPrefix: config.columns[colKeys].prefix,
|
|
206
207
|
addColSuffix: config.columns[colKeys].suffix,
|
package/src/hooks/useScales.ts
CHANGED
|
@@ -137,14 +137,8 @@ const useScales = (properties: useScaleProps) => {
|
|
|
137
137
|
xScale.type = scaleTypes.LINEAR
|
|
138
138
|
}
|
|
139
139
|
if (xAxis.type === 'categorical') {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
const strItem = String(item)
|
|
143
|
-
const parsed = parseFloat(strItem)
|
|
144
|
-
return !isNaN(parsed) ? Math.round(parsed).toString() : strItem
|
|
145
|
-
})
|
|
146
|
-
|
|
147
|
-
xScale = composeScaleBand(xAxisDataMappedRoundedItems, [0, xMax], 1 - config.barThickness)
|
|
140
|
+
xScale = composeScaleBand(xAxisDataMapped, [0, xMax], 1)
|
|
141
|
+
xScale.type = scaleTypes.BAND
|
|
148
142
|
}
|
|
149
143
|
}
|
|
150
144
|
|
|
@@ -14,7 +14,7 @@ type SET_COLOR_SCALE = Action<'SET_COLOR_SCALE', Function>
|
|
|
14
14
|
type SET_STATE_DATA = Action<'SET_STATE_DATA', object[]>
|
|
15
15
|
type SET_EXCLUDED_DATA = Action<'SET_EXCLUDED_DATA', object[]>
|
|
16
16
|
type SET_FILTERED_DATA = Action<'SET_FILTERED_DATA', object[]>
|
|
17
|
-
type SET_SERIES_HIGHLIGHT = Action<'SET_SERIES_HIGHLIGHT',
|
|
17
|
+
type SET_SERIES_HIGHLIGHT = Action<'SET_SERIES_HIGHLIGHT', string[]>
|
|
18
18
|
type SET_VIEWPORT = Action<'SET_VIEWPORT', string>
|
|
19
19
|
type SET_DIMENSIONS = Action<'SET_DIMENSIONS', DimensionsType>
|
|
20
20
|
type SET_CONTAINER = Action<'SET_CONTAINER', object>
|
package/src/types/ChartConfig.ts
CHANGED
|
@@ -80,7 +80,7 @@ type Exclusions = {
|
|
|
80
80
|
|
|
81
81
|
export type Legend = CoreLegend & {
|
|
82
82
|
seriesHighlight: string[]
|
|
83
|
-
|
|
83
|
+
unified: boolean
|
|
84
84
|
hideSuppressionLink: boolean
|
|
85
85
|
style: 'circles' | 'boxes' | 'gradient' | 'lines'
|
|
86
86
|
subStyle: 'linear blocks' | 'smooth'
|
|
@@ -90,6 +90,7 @@ export type Legend = CoreLegend & {
|
|
|
90
90
|
side: boolean
|
|
91
91
|
topBottom: boolean
|
|
92
92
|
}
|
|
93
|
+
groupBy: string
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
type Visual = {
|