@redsift/charts 11.6.0-muiv5-alpha.4 → 11.6.0-muiv5-alpha.5
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/_internal/Arc.js +10 -0
- package/_internal/Arc.js.map +1 -0
- package/{components/Arc/Arc.js → _internal/Arc2.js} +52 -9
- package/_internal/Arc2.js.map +1 -0
- package/_internal/Arcs.js +10 -0
- package/_internal/Arcs.js.map +1 -0
- package/{components/Arcs/Arcs.js → _internal/Arcs2.js} +12 -8
- package/_internal/Arcs2.js.map +1 -0
- package/_internal/Axis.js +8 -0
- package/_internal/Axis.js.map +1 -0
- package/{types/axis.d.ts → _internal/Axis2.js} +2 -2
- package/_internal/Axis2.js.map +1 -0
- package/_internal/Bar.js +10 -0
- package/_internal/Bar.js.map +1 -0
- package/{components/Bar/Bar.js → _internal/Bar2.js} +85 -10
- package/_internal/Bar2.js.map +1 -0
- package/_internal/BarChart.js +17 -0
- package/_internal/BarChart.js.map +1 -0
- package/_internal/BarChart2.js +1419 -0
- package/_internal/BarChart2.js.map +1 -0
- package/_internal/ChartContainer.js +5 -0
- package/_internal/ChartContainer.js.map +1 -0
- package/{components/ChartContainer/ChartContainer.js → _internal/ChartContainer2.js} +105 -6
- package/_internal/ChartContainer2.js.map +1 -0
- package/_internal/DataPoint.js +7 -0
- package/_internal/DataPoint.js.map +1 -0
- package/{components/DataPoint/DataPoint.js → _internal/DataPoint2.js} +11 -5
- package/_internal/DataPoint2.js.map +1 -0
- package/_internal/Dot.js +10 -0
- package/_internal/Dot.js.map +1 -0
- package/{components/Dot/Dot.js → _internal/Dot2.js} +61 -6
- package/_internal/Dot2.js.map +1 -0
- package/_internal/Legend.js +10 -0
- package/_internal/Legend.js.map +1 -0
- package/{components/Legend/Legend.js → _internal/Legend3.js} +17 -6
- package/_internal/Legend3.js.map +1 -0
- package/_internal/LegendItem.js +21 -0
- package/_internal/LegendItem.js.map +1 -0
- package/{components/LegendItem/LegendItem.js → _internal/LegendItem2.js} +64 -7
- package/_internal/LegendItem2.js.map +1 -0
- package/_internal/Line.js +10 -0
- package/_internal/Line.js.map +1 -0
- package/{components/Line/Line.js → _internal/Line2.js} +12 -8
- package/_internal/Line2.js.map +1 -0
- package/_internal/LineChart.js +17 -0
- package/_internal/LineChart.js.map +1 -0
- package/{components/LineChart/RenderedLineChart.js → _internal/LineChart2.js} +317 -20
- package/_internal/LineChart2.js.map +1 -0
- package/_internal/PieChart.js +14 -0
- package/_internal/PieChart.js.map +1 -0
- package/_internal/PieChart2.js +605 -0
- package/_internal/PieChart2.js.map +1 -0
- package/_internal/ScatterPlot.js +17 -0
- package/_internal/ScatterPlot.js.map +1 -0
- package/_internal/ScatterPlot2.js +743 -0
- package/_internal/ScatterPlot2.js.map +1 -0
- package/{_virtual → _internal}/_rollupPluginBabelHelpers.js +1 -1
- package/_internal/config.js +13 -0
- package/_internal/config.js.map +1 -0
- package/{types/data.d.ts → _internal/data.js} +1 -1
- package/{types/legend.js → _internal/legend2.js} +2 -2
- package/_internal/legend2.js.map +1 -0
- package/{components/Axis/types.d.ts → _internal/scale.js} +47 -2
- package/{scheme.js → _internal/scheme.js} +1 -1
- package/_internal/scheme.js.map +1 -0
- package/{components/Arc/styles.d.ts → _internal/styles.js} +7 -5
- package/{components/Line/types.d.ts → _internal/styles10.js} +14 -5
- package/{components/LineChart/types.d.ts → _internal/styles11.js} +23 -12
- package/{components/PieChart/types.d.ts → _internal/styles12.js} +29 -11
- package/{components/ScatterPlot/types.d.ts → _internal/styles13.js} +23 -12
- package/{components/Arcs/types.d.ts → _internal/styles2.js} +11 -2
- package/{components/Axis/styles.d.ts → _internal/styles3.js} +6 -3
- package/{components/Bar/styles.d.ts → _internal/styles4.js} +7 -5
- package/{components/BarChart/types.d.ts → _internal/styles5.js} +49 -14
- package/{components/ChartContainer/styles.d.ts → _internal/styles6.js} +8 -3
- package/{components/DataPoint/styles.d.ts → _internal/styles7.js} +5 -2
- package/{components/Dot/styles.d.ts → _internal/styles8.js} +7 -4
- package/{components/Legend/styles.d.ts → _internal/styles9.js} +5 -2
- package/{utils/index.js → _internal/theme.js} +37 -2
- package/_internal/theme.js.map +1 -0
- package/{components/Arc/types.d.ts → _internal/types.js} +3 -3
- package/{components/Bar/types.d.ts → _internal/types2.js} +3 -3
- package/{components/ChartContainer/types.d.ts → _internal/types3.js} +1 -1
- package/{components/DataPoint/types.d.ts → _internal/types4.js} +29 -3
- package/{components/Dot/types.d.ts → _internal/types5.js} +3 -3
- package/{components/Legend/types.d.ts → _internal/types6.js} +4 -4
- package/{components/LegendItem/types.d.ts → _internal/types7.js} +8 -4
- package/{hooks → _internal}/useFormatCategoricalData.js +3 -4
- package/{hooks → _internal}/useFormatCategoricalData.js.map +1 -1
- package/index.js +129 -43
- package/index.js.map +1 -1
- package/index2.js +49 -0
- package/index2.js.map +1 -0
- package/package.json +2 -2
- package/components/Arc/Arc.d.ts +0 -6
- package/components/Arc/Arc.js.map +0 -1
- package/components/Arc/styles.js +0 -49
- package/components/Arc/styles.js.map +0 -1
- package/components/Arcs/Arcs.d.ts +0 -6
- package/components/Arcs/Arcs.js.map +0 -1
- package/components/Arcs/styles.d.ts +0 -9
- package/components/Arcs/styles.js +0 -9
- package/components/Arcs/styles.js.map +0 -1
- package/components/Axis/Axis.d.ts +0 -7
- package/components/Axis/Axis.js +0 -211
- package/components/Axis/Axis.js.map +0 -1
- package/components/Axis/computeTicks.js +0 -117
- package/components/Axis/computeTicks.js.map +0 -1
- package/components/Axis/styles.js +0 -51
- package/components/Axis/styles.js.map +0 -1
- package/components/Axis/types.js +0 -24
- package/components/Axis/types.js.map +0 -1
- package/components/Bar/Bar.d.ts +0 -6
- package/components/Bar/Bar.js.map +0 -1
- package/components/Bar/styles.js +0 -66
- package/components/Bar/styles.js.map +0 -1
- package/components/Bar/types.js +0 -18
- package/components/Bar/types.js.map +0 -1
- package/components/BarChart/BarChart.d.ts +0 -29
- package/components/BarChart/BarChart.js +0 -141
- package/components/BarChart/BarChart.js.map +0 -1
- package/components/BarChart/BarChartBars.js +0 -168
- package/components/BarChart/BarChartBars.js.map +0 -1
- package/components/BarChart/BarChartSection.js +0 -139
- package/components/BarChart/BarChartSection.js.map +0 -1
- package/components/BarChart/EmptyBarChart.js +0 -57
- package/components/BarChart/EmptyBarChart.js.map +0 -1
- package/components/BarChart/LoadingBarChart.js +0 -18
- package/components/BarChart/LoadingBarChart.js.map +0 -1
- package/components/BarChart/RenderedLinearBarChart.js +0 -549
- package/components/BarChart/RenderedLinearBarChart.js.map +0 -1
- package/components/BarChart/RenderedOrdinalBarChart.js +0 -236
- package/components/BarChart/RenderedOrdinalBarChart.js.map +0 -1
- package/components/BarChart/context.js +0 -13
- package/components/BarChart/context.js.map +0 -1
- package/components/BarChart/intl/en-US.json.js +0 -17
- package/components/BarChart/intl/en-US.json.js.map +0 -1
- package/components/BarChart/intl/fr-FR.json.js +0 -17
- package/components/BarChart/intl/fr-FR.json.js.map +0 -1
- package/components/BarChart/intl/index.js +0 -10
- package/components/BarChart/intl/index.js.map +0 -1
- package/components/BarChart/styles.d.ts +0 -19
- package/components/BarChart/styles.js +0 -71
- package/components/BarChart/styles.js.map +0 -1
- package/components/BarChart/types.js +0 -17
- package/components/BarChart/types.js.map +0 -1
- package/components/BarChart/utils.js +0 -69
- package/components/BarChart/utils.js.map +0 -1
- package/components/ChartContainer/ChartContainer.d.ts +0 -9
- package/components/ChartContainer/ChartContainer.js.map +0 -1
- package/components/ChartContainer/context.js +0 -6
- package/components/ChartContainer/context.js.map +0 -1
- package/components/ChartContainer/intl/en-US.json.js +0 -14
- package/components/ChartContainer/intl/en-US.json.js.map +0 -1
- package/components/ChartContainer/intl/fr-FR.json.js +0 -14
- package/components/ChartContainer/intl/fr-FR.json.js.map +0 -1
- package/components/ChartContainer/intl/index.js +0 -10
- package/components/ChartContainer/intl/index.js.map +0 -1
- package/components/ChartContainer/styles.js +0 -76
- package/components/ChartContainer/styles.js.map +0 -1
- package/components/DataPoint/DataPoint.d.ts +0 -6
- package/components/DataPoint/DataPoint.js.map +0 -1
- package/components/DataPoint/styles.js +0 -10
- package/components/DataPoint/styles.js.map +0 -1
- package/components/Dot/Dot.d.ts +0 -6
- package/components/Dot/Dot.js.map +0 -1
- package/components/Dot/styles.js +0 -49
- package/components/Dot/styles.js.map +0 -1
- package/components/Dot/types.js +0 -14
- package/components/Dot/types.js.map +0 -1
- package/components/Legend/Legend.d.ts +0 -6
- package/components/Legend/Legend.js.map +0 -1
- package/components/Legend/styles.js +0 -15
- package/components/Legend/styles.js.map +0 -1
- package/components/LegendItem/LegendItem.js.map +0 -1
- package/components/LegendItem/styles.js +0 -63
- package/components/LegendItem/styles.js.map +0 -1
- package/components/Line/Line.d.ts +0 -6
- package/components/Line/Line.js.map +0 -1
- package/components/Line/styles.d.ts +0 -9
- package/components/Line/styles.js +0 -9
- package/components/Line/styles.js.map +0 -1
- package/components/LineChart/EmptyLineChart.js +0 -58
- package/components/LineChart/EmptyLineChart.js.map +0 -1
- package/components/LineChart/LineChart.d.ts +0 -6
- package/components/LineChart/LineChart.js +0 -96
- package/components/LineChart/LineChart.js.map +0 -1
- package/components/LineChart/LoadingLineChart.js +0 -18
- package/components/LineChart/LoadingLineChart.js.map +0 -1
- package/components/LineChart/RenderedLineChart.js.map +0 -1
- package/components/LineChart/intl/en-US.json.js +0 -17
- package/components/LineChart/intl/en-US.json.js.map +0 -1
- package/components/LineChart/intl/fr-FR.json.js +0 -17
- package/components/LineChart/intl/fr-FR.json.js.map +0 -1
- package/components/LineChart/intl/index.js +0 -10
- package/components/LineChart/intl/index.js.map +0 -1
- package/components/LineChart/styles.d.ts +0 -17
- package/components/LineChart/styles.js +0 -53
- package/components/LineChart/styles.js.map +0 -1
- package/components/LineChart/types.js +0 -17
- package/components/LineChart/types.js.map +0 -1
- package/components/LineChart/utils.js +0 -67
- package/components/LineChart/utils.js.map +0 -1
- package/components/PieChart/EmptyPieChart.js +0 -85
- package/components/PieChart/EmptyPieChart.js.map +0 -1
- package/components/PieChart/LoadingPieChart.js +0 -18
- package/components/PieChart/LoadingPieChart.js.map +0 -1
- package/components/PieChart/PieChart.d.ts +0 -6
- package/components/PieChart/PieChart.js +0 -98
- package/components/PieChart/PieChart.js.map +0 -1
- package/components/PieChart/RenderedPieChart.js +0 -198
- package/components/PieChart/RenderedPieChart.js.map +0 -1
- package/components/PieChart/intl/en-US.json.js +0 -9
- package/components/PieChart/intl/en-US.json.js.map +0 -1
- package/components/PieChart/intl/fr-FR.json.js +0 -9
- package/components/PieChart/intl/fr-FR.json.js.map +0 -1
- package/components/PieChart/intl/index.js +0 -10
- package/components/PieChart/intl/index.js.map +0 -1
- package/components/PieChart/styles.d.ts +0 -24
- package/components/PieChart/styles.js +0 -168
- package/components/PieChart/styles.js.map +0 -1
- package/components/PieChart/types.js +0 -27
- package/components/PieChart/types.js.map +0 -1
- package/components/PieChart/utils.js +0 -37
- package/components/PieChart/utils.js.map +0 -1
- package/components/ScatterPlot/EmptyScatterPlot.js +0 -58
- package/components/ScatterPlot/EmptyScatterPlot.js.map +0 -1
- package/components/ScatterPlot/LoadingScatterPlot.js +0 -18
- package/components/ScatterPlot/LoadingScatterPlot.js.map +0 -1
- package/components/ScatterPlot/RenderedScatterPlot.js +0 -352
- package/components/ScatterPlot/RenderedScatterPlot.js.map +0 -1
- package/components/ScatterPlot/ScatterPlot.d.ts +0 -6
- package/components/ScatterPlot/ScatterPlot.js +0 -105
- package/components/ScatterPlot/ScatterPlot.js.map +0 -1
- package/components/ScatterPlot/intl/en-US.json.js +0 -12
- package/components/ScatterPlot/intl/en-US.json.js.map +0 -1
- package/components/ScatterPlot/intl/fr-FR.json.js +0 -17
- package/components/ScatterPlot/intl/fr-FR.json.js.map +0 -1
- package/components/ScatterPlot/intl/index.js +0 -10
- package/components/ScatterPlot/intl/index.js.map +0 -1
- package/components/ScatterPlot/styles.d.ts +0 -17
- package/components/ScatterPlot/styles.js +0 -53
- package/components/ScatterPlot/styles.js.map +0 -1
- package/components/ScatterPlot/types.js +0 -24
- package/components/ScatterPlot/types.js.map +0 -1
- package/components/ScatterPlot/utils.js +0 -70
- package/components/ScatterPlot/utils.js.map +0 -1
- package/config.js +0 -15
- package/config.js.map +0 -1
- package/design-system/src/react-aria/react-aria/i18n/useMessageFormatter.d.ts +0 -5
- package/hooks/useBrush.d.ts +0 -17
- package/hooks/useBrush.js +0 -48
- package/hooks/useBrush.js.map +0 -1
- package/hooks/useColor.d.ts +0 -18
- package/hooks/useColor.js +0 -20
- package/hooks/useColor.js.map +0 -1
- package/hooks/useFormatCategoricalData.d.ts +0 -26
- package/hooks/useZoom.d.ts +0 -26
- package/hooks/useZoom.js +0 -39
- package/hooks/useZoom.js.map +0 -1
- package/index.d.ts +0 -51
- package/scheme.d.ts +0 -32
- package/scheme.js.map +0 -1
- package/types/legend.d.ts +0 -30
- package/types/legend.js.map +0 -1
- package/types/scale.d.ts +0 -48
- package/types/size.d.ts +0 -20
- package/types/size.js +0 -8
- package/types/size.js.map +0 -1
- package/types/theme.d.ts +0 -23
- package/types/theme.js +0 -13
- package/types/theme.js.map +0 -1
- package/utils/index.d.ts +0 -11
- package/utils/index.js.map +0 -1
- /package/{_virtual → _internal}/_rollupPluginBabelHelpers.js.map +0 -0
package/types/scale.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { CountableTimeInterval } from 'd3';
|
|
2
|
-
import { ScaleLinear as ScaleLinear$1, ScaleLogarithmic, ScaleSymLog, ScalePoint as ScalePoint$1, ScaleBand as ScaleBand$1, ScaleTime as ScaleTime$1 } from 'd3-scale';
|
|
3
|
-
|
|
4
|
-
type Coordinates = {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
};
|
|
8
|
-
type NumericValue = {
|
|
9
|
-
valueOf(): number;
|
|
10
|
-
};
|
|
11
|
-
type StringValue = {
|
|
12
|
-
toString(): string;
|
|
13
|
-
};
|
|
14
|
-
type ScaleValue = NumericValue | StringValue | Date;
|
|
15
|
-
interface ScaleLinear<Output> extends ScaleLinear$1<number, Output, never> {
|
|
16
|
-
type: 'linear';
|
|
17
|
-
stacked: boolean;
|
|
18
|
-
}
|
|
19
|
-
interface ScaleLog extends ScaleLogarithmic<number, number> {
|
|
20
|
-
type: 'log';
|
|
21
|
-
}
|
|
22
|
-
interface ScaleSymlog extends ScaleSymLog<number, number> {
|
|
23
|
-
type: 'symlog';
|
|
24
|
-
}
|
|
25
|
-
interface ScalePoint<Input extends StringValue> extends ScalePoint$1<Input> {
|
|
26
|
-
type: 'point';
|
|
27
|
-
}
|
|
28
|
-
interface ScaleBand<Input extends StringValue> extends ScaleBand$1<Input> {
|
|
29
|
-
type: 'band';
|
|
30
|
-
}
|
|
31
|
-
interface ScaleTime<Input> extends ScaleTime$1<Input, number> {
|
|
32
|
-
type: 'time';
|
|
33
|
-
useUTC: boolean;
|
|
34
|
-
}
|
|
35
|
-
interface ScaleTypeToScale<Input, Output> {
|
|
36
|
-
linear: Input extends NumericValue ? ScaleLinear<Output> : never;
|
|
37
|
-
log: Input extends NumericValue ? ScaleLog : never;
|
|
38
|
-
symlog: Input extends NumericValue ? ScaleSymlog : never;
|
|
39
|
-
point: Input extends StringValue ? ScalePoint<Input> : never;
|
|
40
|
-
band: Input extends StringValue ? ScaleBand<Input> : never;
|
|
41
|
-
time: Input extends StringValue | Date ? ScaleTime<Input> : never;
|
|
42
|
-
}
|
|
43
|
-
type Scale<Input, Output> = ScaleTypeToScale<Input, Output>[keyof ScaleTypeToScale<Input, Output>];
|
|
44
|
-
type AnyScale = Scale<any, any>;
|
|
45
|
-
type ScaleWithBandwidth = ScaleBand<any> | ScalePoint<any>;
|
|
46
|
-
type TicksSpec = number | string | ScaleValue[] | CountableTimeInterval;
|
|
47
|
-
|
|
48
|
-
export { AnyScale, Coordinates, NumericValue, Scale, ScaleBand, ScaleLinear, ScaleLog, ScalePoint, ScaleSymlog, ScaleTime, ScaleTypeToScale, ScaleValue, ScaleWithBandwidth, StringValue, TicksSpec };
|
package/types/size.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ValueOf } from '@redsift/design-system';
|
|
2
|
-
|
|
3
|
-
type ChartDimensions = {
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
};
|
|
7
|
-
declare const ChartSize: {
|
|
8
|
-
readonly small: "small";
|
|
9
|
-
readonly medium: "medium";
|
|
10
|
-
readonly large: "large";
|
|
11
|
-
};
|
|
12
|
-
type ChartSize = ValueOf<typeof ChartSize>;
|
|
13
|
-
type MarginProps = {
|
|
14
|
-
top?: number;
|
|
15
|
-
right?: number;
|
|
16
|
-
bottom?: number;
|
|
17
|
-
left?: number;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export { ChartDimensions, ChartSize, MarginProps };
|
package/types/size.js
DELETED
package/types/size.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"size.js","sources":["../../src/types/size.ts"],"sourcesContent":["import { ValueOf } from '@redsift/design-system';\n\nexport type ChartDimensions = {\n width: number;\n height: number;\n};\n\nexport const ChartSize = {\n small: 'small',\n medium: 'medium',\n large: 'large',\n} as const;\nexport type ChartSize = ValueOf<typeof ChartSize>;\n\nexport type MarginProps = {\n top?: number;\n right?: number;\n bottom?: number;\n left?: number;\n};\n"],"names":["ChartSize","small","medium","large"],"mappings":"AAOO,MAAMA,SAAS,GAAG;AACvBC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,KAAK,EAAE,OAAA;AACT;;;;"}
|
package/types/theme.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ValueOf } from '@redsift/design-system';
|
|
2
|
-
|
|
3
|
-
declare const ColorTheme: {
|
|
4
|
-
readonly default: "default";
|
|
5
|
-
readonly dark: "dark";
|
|
6
|
-
readonly darker: "darker";
|
|
7
|
-
readonly darkerer: "darkerer";
|
|
8
|
-
readonly light: "light";
|
|
9
|
-
readonly lighter: "lighter";
|
|
10
|
-
readonly lighterer: "lighterer";
|
|
11
|
-
readonly monochrome: "monochrome";
|
|
12
|
-
};
|
|
13
|
-
type ColorTheme = ValueOf<typeof ColorTheme>;
|
|
14
|
-
type SuccessDangerColorTheme = {
|
|
15
|
-
success: string;
|
|
16
|
-
warning: string;
|
|
17
|
-
danger: string;
|
|
18
|
-
neutral?: string;
|
|
19
|
-
};
|
|
20
|
-
type CustomColorTheme = Record<string, string>;
|
|
21
|
-
type ChartTheme = ColorTheme | SuccessDangerColorTheme | CustomColorTheme;
|
|
22
|
-
|
|
23
|
-
export { ChartTheme, ColorTheme, CustomColorTheme, SuccessDangerColorTheme };
|
package/types/theme.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const ColorTheme = {
|
|
2
|
-
default: 'default',
|
|
3
|
-
dark: 'dark',
|
|
4
|
-
darker: 'darker',
|
|
5
|
-
darkerer: 'darkerer',
|
|
6
|
-
light: 'light',
|
|
7
|
-
lighter: 'lighter',
|
|
8
|
-
lighterer: 'lighterer',
|
|
9
|
-
monochrome: 'monochrome'
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export { ColorTheme };
|
|
13
|
-
//# sourceMappingURL=theme.js.map
|
package/types/theme.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sources":["../../src/types/theme.ts"],"sourcesContent":["import { ValueOf } from '@redsift/design-system';\n\nexport const ColorTheme = {\n default: 'default',\n dark: 'dark',\n darker: 'darker',\n darkerer: 'darkerer',\n light: 'light',\n lighter: 'lighter',\n lighterer: 'lighterer',\n monochrome: 'monochrome',\n} as const;\nexport type ColorTheme = ValueOf<typeof ColorTheme>;\n\nexport type SuccessDangerColorTheme = {\n success: string;\n warning: string;\n danger: string;\n neutral?: string;\n};\n\nexport type CustomColorTheme = Record<string, string>;\n\nexport type ChartTheme =\n | ColorTheme\n | SuccessDangerColorTheme\n | CustomColorTheme;\n"],"names":["ColorTheme","default","dark","darker","darkerer","light","lighter","lighterer","monochrome"],"mappings":"AAEO,MAAMA,UAAU,GAAG;AACxBC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,IAAI,EAAE,MAAM;AACZC,EAAAA,MAAM,EAAE,QAAQ;AAChBC,EAAAA,QAAQ,EAAE,UAAU;AACpBC,EAAAA,KAAK,EAAE,OAAO;AACdC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,SAAS,EAAE,WAAW;AACtBC,EAAAA,UAAU,EAAE,YAAA;AACd;;;;"}
|
package/utils/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { CategoryDatum, Statistics } from '../types/data.js';
|
|
2
|
-
|
|
3
|
-
type SortingMethod = 'none' | 'asc-key' | 'desc-key' | 'asc-value' | 'desc-value' | string[] | ((a: CategoryDatum, b: CategoryDatum) => 1 | -1);
|
|
4
|
-
declare const getSortingMethod: (sortingMethod: SortingMethod) => (a: CategoryDatum, b: CategoryDatum) => 1 | -1;
|
|
5
|
-
declare const isValidDate: (value: string) => boolean;
|
|
6
|
-
declare const mergeLegends: (arr1: Statistics, arr2: Statistics) => {
|
|
7
|
-
key: any;
|
|
8
|
-
value: any;
|
|
9
|
-
}[];
|
|
10
|
-
|
|
11
|
-
export { SortingMethod, getSortingMethod, isValidDate, mergeLegends };
|
package/utils/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["import { CategoryDatum, Statistics } from '../types';\n\nexport type SortingMethod =\n | 'none'\n | 'asc-key'\n | 'desc-key'\n | 'asc-value'\n | 'desc-value'\n | string[]\n | ((a: CategoryDatum, b: CategoryDatum) => 1 | -1);\n\nexport const getSortingMethod: (sortingMethod: SortingMethod) => (a: CategoryDatum, b: CategoryDatum) => 1 | -1 = (\n sortingMethod\n) => {\n if (sortingMethod === 'asc-key') {\n return (a: CategoryDatum, b: CategoryDatum) =>\n a.key === b.key ? (a.value > b.value ? -1 : 1) : a.key < b.key ? -1 : 1;\n } else if (sortingMethod === 'desc-key') {\n return (a: CategoryDatum, b: CategoryDatum) =>\n a.key === b.key ? (a.value > b.value ? 1 : -1) : a.key < b.key ? 1 : -1;\n } else if (sortingMethod === 'asc-value') {\n return (a: CategoryDatum, b: CategoryDatum) =>\n a.value === b.value ? (a.key > b.key ? -1 : 1) : a.value < b.value ? -1 : 1;\n } else if (sortingMethod === 'desc-value') {\n return (a: CategoryDatum, b: CategoryDatum) =>\n a.value === b.value ? (a.key > b.key ? 1 : -1) : a.value < b.value ? 1 : -1;\n } else if (typeof sortingMethod === 'function') {\n return sortingMethod;\n } else if (Array.isArray(sortingMethod)) {\n return (a: CategoryDatum, b: CategoryDatum) => {\n if (sortingMethod.indexOf(a.key) === -1) {\n return 1;\n }\n if (sortingMethod.indexOf(b.key) === -1) {\n return -1;\n }\n\n return sortingMethod.indexOf(a.key) === sortingMethod.indexOf(b.key)\n ? a.key > b.key\n ? 1\n : -1\n : sortingMethod.indexOf(a.key) < sortingMethod.indexOf(b.key)\n ? -1\n : 1;\n };\n }\n return () => 1;\n};\n\nexport const isValidDate = (value: string) => {\n const date = new Date(value);\n return !isNaN(date.getTime()) && date.toISOString().startsWith(value);\n};\n\nexport const mergeLegends = (arr1: Statistics, arr2: Statistics) => {\n const map = new Map();\n\n [...arr1, ...arr2].forEach((item) => {\n map.set(item.key, item.value);\n });\n\n return Array.from(map, ([key, value]) => ({ key, value }));\n};\n"],"names":["getSortingMethod","sortingMethod","a","b","key","value","Array","isArray","indexOf","isValidDate","date","Date","isNaN","getTime","toISOString","startsWith","mergeLegends","arr1","arr2","map","Map","forEach","item","set","from","_ref"],"mappings":"AAWaA,MAAAA,gBAAkG,GAC7GC,aAAa,IACV;EACH,IAAIA,aAAa,KAAK,SAAS,EAAE;AAC/B,IAAA,OAAO,CAACC,CAAgB,EAAEC,CAAgB,KACxCD,CAAC,CAACE,GAAG,KAAKD,CAA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