@redsift/dashboard 7.0.1 → 7.1.0
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/index.d.ts +2 -2
- package/index.js +10 -23
- package/index.js.map +1 -1
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -151,12 +151,12 @@ interface LocaleText$2 {
|
|
|
151
151
|
* Component props.
|
|
152
152
|
*/
|
|
153
153
|
interface HorizontalBarChartProps extends ComponentProps<'div'> {
|
|
154
|
+
/** Whether the x axis labels are rotated or not. */
|
|
155
|
+
areXLabelsRotated?: boolean;
|
|
154
156
|
/** Number of categories to use, the rest being put into a new category called "Others". */
|
|
155
157
|
caping?: number;
|
|
156
158
|
/** Caption. */
|
|
157
159
|
caption?: string;
|
|
158
|
-
/** Whether the x axis labels are rotated or not. */
|
|
159
|
-
areXLabelsRotated?: boolean;
|
|
160
160
|
/** Dataset to use to generate the chart, if no context is provided. */
|
|
161
161
|
data?: JSONArray;
|
|
162
162
|
/** Which datagrid column the chart is filtering and using which operation. */
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorTheme, getColorScale, scheme, PieChartLabelVariant, PieChartSize, PieChartTheme, PieChartVariant, StyledPieChartTitle, StyledPieChartCenterText, StyledPieChartLabel, StyledPieChartCaption } from '@redsift/charts';
|
|
1
|
+
import { ColorTheme, getColorScale, scheme, StyledHorizontalBarChartTitle, StyledHorizontalBarChartCaption, PieChartLabelVariant, PieChartSize, PieChartTheme, PieChartVariant, StyledPieChartTitle, StyledPieChartCenterText, StyledPieChartLabel, StyledPieChartCaption } from '@redsift/charts';
|
|
2
2
|
export { ColorTheme, PieChartLabelVariant, PieChartSize, PieChartTheme, PieChartVariant } from '@redsift/charts';
|
|
3
3
|
import React, { useContext, useMemo, useState, useLayoutEffect, useRef, useCallback, useEffect, forwardRef, useReducer, useId } from 'react';
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
@@ -4073,22 +4073,6 @@ const StyledHorizontalBarChart = styled.div`
|
|
|
4073
4073
|
}
|
|
4074
4074
|
}
|
|
4075
4075
|
`;
|
|
4076
|
-
const StyledHorizontalBarChartTitle = styled.div`
|
|
4077
|
-
align-items: center;
|
|
4078
|
-
display: flex;
|
|
4079
|
-
flex-direction: row;
|
|
4080
|
-
font-family: var(--redsift-typography-h4-font-family);
|
|
4081
|
-
font-size: var(--redsift-typography-h4-font-size);
|
|
4082
|
-
font-weight: var(--redsift-typography-h4-font-weight);
|
|
4083
|
-
gap: 16px;
|
|
4084
|
-
line-height: var(--redsift-typography-h4-line-height);
|
|
4085
|
-
`;
|
|
4086
|
-
const StyledHorizontalBarChartCaption = styled.p`
|
|
4087
|
-
font-family: var(--redsift-typography-caption-font-family);
|
|
4088
|
-
font-size: var(--redsift-typography-caption-font-size);
|
|
4089
|
-
font-weight: var(--redsift-typography-caption-font-weight);
|
|
4090
|
-
line-height: var(--redsift-typography-caption-line-height);
|
|
4091
|
-
`;
|
|
4092
4076
|
const StyledHorizontalBarChartContainer = styled.div`
|
|
4093
4077
|
display: flex;
|
|
4094
4078
|
align-items: center;
|
|
@@ -4315,7 +4299,8 @@ const HorizontalBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4315
4299
|
const {
|
|
4316
4300
|
ndx = crossfilter(data),
|
|
4317
4301
|
dispatch,
|
|
4318
|
-
state
|
|
4302
|
+
state,
|
|
4303
|
+
data: contextData
|
|
4319
4304
|
} = useContext(DashboardContext);
|
|
4320
4305
|
const {
|
|
4321
4306
|
tableFilters
|
|
@@ -4394,7 +4379,7 @@ const HorizontalBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
4394
4379
|
setDimensions(computedDimension);
|
|
4395
4380
|
setGroups(computedGroup);
|
|
4396
4381
|
}
|
|
4397
|
-
}, []);
|
|
4382
|
+
}, [data, contextData]);
|
|
4398
4383
|
|
|
4399
4384
|
// Filter chart if context is updated by an external component.
|
|
4400
4385
|
const filter = datagridFilter ? tableFilters.find(filter => filter.columnField === datagridFilter.field && filter.operatorValue === datagridFilter.operator) : null;
|
|
@@ -7719,7 +7704,8 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7719
7704
|
const {
|
|
7720
7705
|
ndx = crossfilter(data),
|
|
7721
7706
|
dispatch,
|
|
7722
|
-
state
|
|
7707
|
+
state,
|
|
7708
|
+
data: contextData
|
|
7723
7709
|
} = useContext(DashboardContext);
|
|
7724
7710
|
const {
|
|
7725
7711
|
tableFilters
|
|
@@ -7784,7 +7770,7 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7784
7770
|
setDimensions(computedDimension);
|
|
7785
7771
|
setGroups(computedGroup);
|
|
7786
7772
|
}
|
|
7787
|
-
}, []);
|
|
7773
|
+
}, [data, contextData]);
|
|
7788
7774
|
|
|
7789
7775
|
// Filter chart if context is updated by an external component.
|
|
7790
7776
|
const filter = datagridFilter ? tableFilters.find(filter => filter.columnField === datagridFilter.field && filter.operatorValue === datagridFilter.operator) : null;
|
|
@@ -8124,7 +8110,8 @@ const TimeSeriesBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
8124
8110
|
const {
|
|
8125
8111
|
ndx = crossfilter(data),
|
|
8126
8112
|
dispatch,
|
|
8127
|
-
state
|
|
8113
|
+
state,
|
|
8114
|
+
data: contextData
|
|
8128
8115
|
} = useContext(DashboardContext);
|
|
8129
8116
|
const {
|
|
8130
8117
|
tableFilters
|
|
@@ -8263,7 +8250,7 @@ const TimeSeriesBarChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
8263
8250
|
// Store chart for further use.
|
|
8264
8251
|
setChart(barChart$1);
|
|
8265
8252
|
}
|
|
8266
|
-
}, []);
|
|
8253
|
+
}, [data, contextData]);
|
|
8267
8254
|
|
|
8268
8255
|
// Filter chart if context is updated by an external component.
|
|
8269
8256
|
const filterStart = tableFilters.find(filter => filter.columnField === columnToFilter && filter.operatorValue === 'after');
|