@redsift/charts 8.0.0-alpha.0 → 8.0.0-alpha.2
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 +78 -45
- package/index.js +259 -241
- package/index.js.map +1 -1
- package/package.json +5 -5
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ScaleLinear as ScaleLinear$1,
|
|
1
|
+
import { BrushBehavior, ScaleLinear as ScaleLinear$1, ScaleOrdinal, Arc as Arc$1 } from 'd3';
|
|
2
2
|
import * as _redsift_design_system from '@redsift/design-system';
|
|
3
3
|
import { ValueOf, Comp, StylingProps } from '@redsift/design-system';
|
|
4
4
|
import { MutableRefObject, ComponentProps, ReactElement, ReactNode } from 'react';
|
|
@@ -9,6 +9,7 @@ import * as styled_components from 'styled-components';
|
|
|
9
9
|
import * as _react_spring_web from '@react-spring/web';
|
|
10
10
|
|
|
11
11
|
interface UseBrushProps {
|
|
12
|
+
brushRef: MutableRefObject<BrushBehavior<unknown> | undefined>;
|
|
12
13
|
svgRef: MutableRefObject<SVGSVGElement | SVGGElement | undefined>;
|
|
13
14
|
extent?: [[number, number], [number, number]];
|
|
14
15
|
scaleX: ScaleLinear$1<number, number>;
|
|
@@ -18,9 +19,7 @@ interface UseBrushProps {
|
|
|
18
19
|
onBrush?: (selection: [[number, number], [number, number]] | null, scaleX: ScaleLinear$1<number, number>, scaleY: ScaleLinear$1<number, number>) => void;
|
|
19
20
|
onBrushEnd?: (selection: [[number, number], [number, number]] | null, scaleX: ScaleLinear$1<number, number>, scaleY: ScaleLinear$1<number, number>) => void;
|
|
20
21
|
}
|
|
21
|
-
declare const useBrush: ({ svgRef, extent, scaleX, scaleY, isBrushable, isGridded, onBrush, onBrushEnd, }: UseBrushProps) =>
|
|
22
|
-
brush: MutableRefObject<BrushBehavior<unknown> | undefined>;
|
|
23
|
-
};
|
|
22
|
+
declare const useBrush: ({ brushRef: propsBrushRef, svgRef, extent, scaleX, scaleY, isBrushable, isGridded, onBrush, onBrushEnd, }: UseBrushProps) => void;
|
|
24
23
|
|
|
25
24
|
type JSONValue = string | number | boolean | {
|
|
26
25
|
[x: string]: JSONValue;
|
|
@@ -248,6 +247,15 @@ type StyledDataPointProps = Omit<DataPointProps<any>, 'data'> & {
|
|
|
248
247
|
$clickable: boolean;
|
|
249
248
|
};
|
|
250
249
|
|
|
250
|
+
declare const DataPoint: Comp<DataPointProps<any>, SVGGElement>;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Component style.
|
|
254
|
+
*/
|
|
255
|
+
declare const StyledDataPoint: styled_components.StyledComponent<_react_spring_web.AnimatedComponent<"g">, any, Omit<DataPointProps<any>, "data"> & {
|
|
256
|
+
$clickable: boolean;
|
|
257
|
+
}, never>;
|
|
258
|
+
|
|
251
259
|
/**
|
|
252
260
|
* Component props.
|
|
253
261
|
*/
|
|
@@ -293,6 +301,15 @@ declare const StyledArcs: styled_components.StyledComponent<"g", any, Omit<ArcsP
|
|
|
293
301
|
/**
|
|
294
302
|
* Component variant.
|
|
295
303
|
*/
|
|
304
|
+
declare const AxisVariant: {
|
|
305
|
+
readonly none: "none";
|
|
306
|
+
readonly line: "line";
|
|
307
|
+
readonly lineTick: "lineTick";
|
|
308
|
+
readonly tick: "tick";
|
|
309
|
+
readonly tickValue: "tickValue";
|
|
310
|
+
readonly default: "default";
|
|
311
|
+
};
|
|
312
|
+
type AxisVariant = ValueOf<typeof AxisVariant>;
|
|
296
313
|
declare const AxisPosition: {
|
|
297
314
|
top: string;
|
|
298
315
|
right: string;
|
|
@@ -319,6 +336,8 @@ interface AxisProps extends Omit<ComponentProps<'g'>, 'scale'> {
|
|
|
319
336
|
tickRotation?: number;
|
|
320
337
|
tickSize?: number;
|
|
321
338
|
tickValues?: TicksSpec;
|
|
339
|
+
/** Variant. */
|
|
340
|
+
variant?: AxisVariant;
|
|
322
341
|
/** X position. */
|
|
323
342
|
x?: number;
|
|
324
343
|
/** Y position. */
|
|
@@ -391,35 +410,6 @@ declare const StyledChartContainer: styled_components.StyledComponent<"div", any
|
|
|
391
410
|
declare const StyledChartContainerTitle: styled_components.StyledComponent<_redsift_design_system.Comp<_redsift_design_system.FlexboxProps, HTMLDivElement>, any, ChartContainerProps, never>;
|
|
392
411
|
declare const StyledChartContainerCaption: styled_components.StyledComponent<"p", any, ChartContainerProps, never>;
|
|
393
412
|
|
|
394
|
-
/**
|
|
395
|
-
* Component props.
|
|
396
|
-
*/
|
|
397
|
-
interface LegendProps extends ComponentProps<'ul'> {
|
|
398
|
-
/** Data. */
|
|
399
|
-
data: (CategoryDatum & {
|
|
400
|
-
color: string;
|
|
401
|
-
})[];
|
|
402
|
-
/** Variant. */
|
|
403
|
-
variant?: LabelVariant;
|
|
404
|
-
/** Width. */
|
|
405
|
-
width?: string;
|
|
406
|
-
}
|
|
407
|
-
type StyledLegendProps = Omit<LegendProps, 'data'> & {
|
|
408
|
-
$width?: LegendProps['width'];
|
|
409
|
-
};
|
|
410
|
-
|
|
411
|
-
declare const Legend: Comp<LegendProps, HTMLUListElement>;
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* Component style.
|
|
415
|
-
*/
|
|
416
|
-
declare const StyledLegend: styled_components.StyledComponent<"ul", any, Omit<LegendProps, "data"> & {
|
|
417
|
-
$width?: string | undefined;
|
|
418
|
-
}, never>;
|
|
419
|
-
declare const StyledLabel: styled_components.StyledComponent<"li", any, {
|
|
420
|
-
$color: string;
|
|
421
|
-
}, never>;
|
|
422
|
-
|
|
423
413
|
interface LocaleText$2 {
|
|
424
414
|
emptyChartText: string;
|
|
425
415
|
}
|
|
@@ -470,6 +460,55 @@ declare const StyledBarChartEmptyText: styled_components.StyledComponent<"div",
|
|
|
470
460
|
$textSize: number;
|
|
471
461
|
}, never>;
|
|
472
462
|
|
|
463
|
+
/**
|
|
464
|
+
* Component props.
|
|
465
|
+
*/
|
|
466
|
+
interface DotProps extends DataPointProps<DotDatum> {
|
|
467
|
+
/** A linear continuous scale defined over a numeric domain used to determine the x position based on the coordinates. */
|
|
468
|
+
scaleX: ScaleLinear$1<number, number, never>;
|
|
469
|
+
/** A linear continuous scale defined over a numeric domain used to determine the y position based on the coordinates. */
|
|
470
|
+
scaleY: ScaleLinear$1<number, number, never>;
|
|
471
|
+
}
|
|
472
|
+
type StyledDotProps = StyledDataPointProps & Omit<DotProps, 'scaleX' | 'scaleY'>;
|
|
473
|
+
|
|
474
|
+
declare const Dot: Comp<DotProps, SVGGElement>;
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Component style.
|
|
478
|
+
*/
|
|
479
|
+
declare const StyledDot: styled_components.StyledComponent<_redsift_design_system.Comp<DataPointProps<any>, SVGGElement>, any, Omit<DataPointProps<any>, "data"> & {
|
|
480
|
+
$clickable: boolean;
|
|
481
|
+
} & Omit<DotProps, "scaleX" | "scaleY">, never>;
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Component props.
|
|
485
|
+
*/
|
|
486
|
+
interface LegendProps extends ComponentProps<'ul'> {
|
|
487
|
+
/** Data. */
|
|
488
|
+
data: (CategoryDatum & {
|
|
489
|
+
color: string;
|
|
490
|
+
})[];
|
|
491
|
+
/** Variant. */
|
|
492
|
+
variant?: LabelVariant;
|
|
493
|
+
/** Width. */
|
|
494
|
+
width?: string;
|
|
495
|
+
}
|
|
496
|
+
type StyledLegendProps = Omit<LegendProps, 'data'> & {
|
|
497
|
+
$width?: LegendProps['width'];
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
declare const Legend: Comp<LegendProps, HTMLUListElement>;
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* Component style.
|
|
504
|
+
*/
|
|
505
|
+
declare const StyledLegend: styled_components.StyledComponent<"ul", any, Omit<LegendProps, "data"> & {
|
|
506
|
+
$width?: string | undefined;
|
|
507
|
+
}, never>;
|
|
508
|
+
declare const StyledLabel: styled_components.StyledComponent<"li", any, {
|
|
509
|
+
$color: string;
|
|
510
|
+
}, never>;
|
|
511
|
+
|
|
473
512
|
/**
|
|
474
513
|
* Component variant.
|
|
475
514
|
*/
|
|
@@ -557,16 +596,6 @@ declare const StyledPieChartEmptyText: styled_components.StyledComponent<"div",
|
|
|
557
596
|
$isDonut: boolean;
|
|
558
597
|
}, never>;
|
|
559
598
|
|
|
560
|
-
/**
|
|
561
|
-
* Component props.
|
|
562
|
-
*/
|
|
563
|
-
interface DotProps extends DataPointProps<DotDatum> {
|
|
564
|
-
/** A linear continuous scale defined over a numeric domain used to determine the x position based on the coordinates. */
|
|
565
|
-
scaleX: ScaleLinear$1<number, number, never>;
|
|
566
|
-
/** A linear continuous scale defined over a numeric domain used to determine the y position based on the coordinates. */
|
|
567
|
-
scaleY: ScaleLinear$1<number, number, never>;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
599
|
/**
|
|
571
600
|
* Component variant.
|
|
572
601
|
*/
|
|
@@ -614,7 +643,7 @@ interface ScatterPlotProps extends ChartContainerProps {
|
|
|
614
643
|
/** Method called on brush. */
|
|
615
644
|
onBrush?: (selection: [[number, number], [number, number]] | null, scaleX: ScaleLinear$1<number, number>, scaleY: ScaleLinear$1<number, number>) => void;
|
|
616
645
|
/** Method called on brush end. */
|
|
617
|
-
onBrushEnd?: (selection: [[number, number], [number, number]] | null, scaleX
|
|
646
|
+
onBrushEnd?: (selection: [[number, number], [number, number]] | null, scaleX?: ScaleLinear$1<number, number>, scaleY?: ScaleLinear$1<number, number>) => void;
|
|
618
647
|
/** Method to be called on a click on a dot. */
|
|
619
648
|
onDotClick?: (datum: DotDatum) => void;
|
|
620
649
|
/** ScatterPlot size. */
|
|
@@ -627,6 +656,10 @@ interface ScatterPlotProps extends ChartContainerProps {
|
|
|
627
656
|
tooltipVariant?: TooltipVariant;
|
|
628
657
|
/** Variant. */
|
|
629
658
|
variant?: ScatterPlotVariant;
|
|
659
|
+
/** X axis variant. */
|
|
660
|
+
xAxisVariant?: AxisVariant;
|
|
661
|
+
/** Y axis variant. */
|
|
662
|
+
yAxisVariant?: AxisVariant;
|
|
630
663
|
}
|
|
631
664
|
type StyledScatterPlotProps = ScatterPlotProps & {};
|
|
632
665
|
|
|
@@ -641,4 +674,4 @@ declare const StyledScatterPlotEmptyText: styled_components.StyledComponent<"div
|
|
|
641
674
|
$textSize: number;
|
|
642
675
|
}, never>;
|
|
643
676
|
|
|
644
|
-
export { AnyScale, Arc, ArcDatum, ArcProps, Arcs, ArcsProps, Axis, AxisPosition, AxisProps, Bar, BarChart, BarChartDimensions, BarChartProps, BarDatum, BarOrientation, BarProps, CategoryData, CategoryDatum, CategoryDim, ChartContainer, ChartContainerProps, ChartDimensions, ChartSize, ChartTheme, ColorTheme, Coordinates, CoordinatesCategoryData, CoordinatesCategoryDatum, CoordinatesCategoryDim, CustomColorTheme, Datum, DotDatum, JSONArray, JSONObject, JSONValue, LabelVariant, Legend, LegendProps, NumericValue, PieChart, PieChartDimensions, PieChartLabelVariant, PieChartProps, PieChartVariant, Scale, ScaleBand, ScaleLinear, ScaleLog, ScalePoint, ScaleSymlog, ScaleTime, ScaleTypeToScale, ScaleValue, ScaleWithBandwidth, ScatterPlot, ScatterPlotDimensions, ScatterPlotLabelVariant, ScatterPlotProps, ScatterPlotVariant, StringValue, StyledArc, StyledArcProps, StyledArcs, StyledArcsProps, StyledAxis, StyledAxisProps, StyledBar, StyledBarChart, StyledBarChartEmptyText, StyledBarChartProps, StyledBarProps, StyledChartContainer, StyledChartContainerCaption, StyledChartContainerProps, StyledChartContainerTitle, StyledLabel, StyledLegend, StyledLegendProps, StyledPieChart, StyledPieChartCenterText, StyledPieChartEmptyText, StyledPieChartProps, StyledScatterPlot, StyledScatterPlotEmptyText, StyledScatterPlotProps, SuccessDangerColorTheme, TicksSpec, TooltipVariant, UseBrushProps, UseColorProps, UseFormatCategoricalDataProps, UseZoomProps, empty, getColorScale, monochrome, scheme, successDangerScheme, useBrush, useColor, useFormatCategoricalData, useZoom };
|
|
677
|
+
export { AnyScale, Arc, ArcDatum, ArcProps, Arcs, ArcsProps, Axis, AxisPosition, AxisProps, AxisVariant, Bar, BarChart, BarChartDimensions, BarChartProps, BarDatum, BarOrientation, BarProps, CategoryData, CategoryDatum, CategoryDim, ChartContainer, ChartContainerProps, ChartDimensions, ChartSize, ChartTheme, ColorTheme, Coordinates, CoordinatesCategoryData, CoordinatesCategoryDatum, CoordinatesCategoryDim, CustomColorTheme, DataPoint, DataPointProps, Datum, Dot, DotDatum, DotProps, JSONArray, JSONObject, JSONValue, LabelVariant, Legend, LegendProps, NumericValue, PieChart, PieChartDimensions, PieChartLabelVariant, PieChartProps, PieChartVariant, Scale, ScaleBand, ScaleLinear, ScaleLog, ScalePoint, ScaleSymlog, ScaleTime, ScaleTypeToScale, ScaleValue, ScaleWithBandwidth, ScatterPlot, ScatterPlotDimensions, ScatterPlotLabelVariant, ScatterPlotProps, ScatterPlotVariant, StringValue, StyledArc, StyledArcProps, StyledArcs, StyledArcsProps, StyledAxis, StyledAxisProps, StyledBar, StyledBarChart, StyledBarChartEmptyText, StyledBarChartProps, StyledBarProps, StyledChartContainer, StyledChartContainerCaption, StyledChartContainerProps, StyledChartContainerTitle, StyledDataPoint, StyledDataPointProps, StyledDot, StyledDotProps, StyledLabel, StyledLegend, StyledLegendProps, StyledPieChart, StyledPieChartCenterText, StyledPieChartEmptyText, StyledPieChartProps, StyledScatterPlot, StyledScatterPlotEmptyText, StyledScatterPlotProps, SuccessDangerColorTheme, TicksSpec, TooltipVariant, UseBrushProps, UseColorProps, UseFormatCategoricalDataProps, UseZoomProps, empty, getColorScale, monochrome, scheme, successDangerScheme, useBrush, useColor, useFormatCategoricalData, useZoom };
|