@oliasoft-open-source/charts-library 8.0.6 → 9.0.0-beta-1
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/index.d.ts +15 -2249
- package/dist/index.js +920 -894
- package/dist/src/components/bar-chart/bar-chart-const.d.ts +2 -0
- package/dist/src/components/bar-chart/bar-chart-default-props.d.ts +3 -0
- package/dist/src/components/bar-chart/bar-chart.d.ts +43 -0
- package/dist/src/components/bar-chart/bar-chart.interface.d.ts +252 -0
- package/dist/src/components/bar-chart/utils/get-bar-chart-data-labels.d.ts +10 -0
- package/dist/src/components/bar-chart/utils/get-bar-chart-scales.d.ts +4 -0
- package/dist/src/components/bar-chart/utils/get-bar-chart-tooltips.d.ts +6 -0
- package/dist/src/components/bar-chart/utils/use-bar-chart-config.d.ts +13 -0
- package/dist/src/components/bar-chart/utils/use-bar-chart-options.d.ts +54 -0
- package/dist/src/components/common/common.interface.d.ts +510 -0
- package/dist/src/components/common/controls-portal.d.ts +7 -0
- package/dist/src/components/common/enums.d.ts +104 -0
- package/dist/src/components/common/helpers/add-transparency/add-transparency.d.ts +1 -0
- package/dist/src/components/common/helpers/callout-helpers/callout-helpers.d.ts +25 -0
- package/dist/src/components/common/helpers/chart-border-plugin.d.ts +16 -0
- package/dist/src/components/common/helpers/chart-consts.d.ts +40 -0
- package/dist/src/components/common/helpers/chart-utils.d.ts +86 -0
- package/dist/src/components/common/helpers/custom-format-number.d.ts +1 -0
- package/dist/src/components/common/helpers/download-png.d.ts +3 -0
- package/dist/src/components/common/helpers/get-cartesian-scale-options.d.ts +28 -0
- package/dist/src/components/common/helpers/get-chart-annotation.d.ts +139 -0
- package/dist/src/components/common/helpers/get-chart-from-ctx.d.ts +1 -0
- package/dist/src/components/common/helpers/get-draggableData.d.ts +18 -0
- package/dist/src/components/common/helpers/get-grouped-color-scheme/get-grouped-color-scheme.d.ts +12 -0
- package/dist/src/components/common/helpers/input-normalizers.d.ts +15 -0
- package/dist/src/components/common/helpers/range/estimate-data-series-have-close-values.d.ts +8 -0
- package/dist/src/components/common/helpers/range/range.d.ts +33 -0
- package/dist/src/components/common/helpers/to-annotation.d.ts +4 -0
- package/dist/src/components/common/hooks/use-generated-labels.d.ts +4 -0
- package/dist/src/components/common/hooks/use-legend-state.d.ts +28 -0
- package/dist/src/components/common/hooks/use-legend.d.ts +4 -0
- package/dist/src/components/common/hooks/use-update-annotations.d.ts +4 -0
- package/dist/src/components/common/legend-component/legend-dropzone.d.ts +3 -0
- package/dist/src/components/common/legend-component/legend-interface.d.ts +50 -0
- package/dist/src/components/common/legend-component/legend-item/LegendItemLine.d.ts +5 -0
- package/dist/src/components/common/legend-component/legend-item/legend-item.d.ts +3 -0
- package/dist/src/components/common/legend-component/legend-panel.d.ts +3 -0
- package/dist/src/components/common/legend-component/legend-position-storage.d.ts +3 -0
- package/dist/src/components/common/legend-component/legend.d.ts +3 -0
- package/dist/src/components/common/legend-component/state/legend-action-types.d.ts +3 -0
- package/dist/src/components/common/legend-component/state/legend-context.d.ts +14 -0
- package/dist/src/components/common/legend-component/state/legend-state-reducer.d.ts +30 -0
- package/dist/src/components/common/legend-component/utils/create-style-object.d.ts +27 -0
- package/dist/src/components/common/legend-component/utils/get-generated-labels.d.ts +3 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-dragger-plugin.d.ts +15 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/annotation-position-storage.d.ts +7 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/enums.d.ts +23 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/event-helpers.d.ts +6 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/helpers.d.ts +53 -0
- package/dist/src/components/common/plugins/annotation-dragger-plugin/point-annotation-label.d.ts +5 -0
- package/dist/src/components/common/plugins/ellipsis-annotation-plugin/compute-ellipse-geometry.d.ts +9 -0
- package/dist/src/components/common/plugins/ellipsis-annotation-plugin/ellipsis-annotation-plugin.d.ts +18 -0
- package/dist/src/components/common/plugins/gradient-background-plugin/enums.d.ts +11 -0
- package/dist/src/components/common/plugins/gradient-background-plugin/gradient-background-plugin.d.ts +2 -0
- package/dist/src/components/line-chart/constants/default-translations.d.ts +25 -0
- package/dist/src/components/line-chart/constants/line-chart-consts.d.ts +13 -0
- package/dist/src/components/line-chart/controls/axes-options/axes-options-interfaces.d.ts +57 -0
- package/dist/src/components/line-chart/controls/axes-options/axes-options.d.ts +6 -0
- package/dist/src/components/line-chart/controls/axes-options/axes-validation.d.ts +8 -0
- package/dist/src/components/line-chart/controls/controls-interfaces.d.ts +19 -0
- package/dist/src/components/line-chart/controls/controls.d.ts +4 -0
- package/dist/src/components/line-chart/controls/drag-options-interfaces.d.ts +14 -0
- package/dist/src/components/line-chart/controls/drag-options.d.ts +23 -0
- package/dist/src/components/line-chart/controls/line-options.d.ts +19 -0
- package/dist/src/components/line-chart/hooks/use-chart-functions.d.ts +32 -0
- package/dist/src/components/line-chart/hooks/use-chart-options.d.ts +20 -0
- package/dist/src/components/line-chart/hooks/use-chart-plugins.d.ts +7 -0
- package/dist/src/components/line-chart/hooks/use-chart-state.d.ts +12 -0
- package/dist/src/components/line-chart/hooks/use-toggle-handler.d.ts +12 -0
- package/dist/src/components/line-chart/initialize/config.d.ts +12 -0
- package/dist/src/components/line-chart/initialize/initialize-line-chart.d.ts +17 -0
- package/dist/src/components/line-chart/line-chart-get-default-props.d.ts +3 -0
- package/dist/src/components/line-chart/line-chart.d.ts +42 -0
- package/dist/src/components/line-chart/line-chart.interface.d.ts +458 -0
- package/dist/src/components/line-chart/plugins/callout-plugin/callout-plugin.d.ts +11 -0
- package/dist/src/components/line-chart/plugins/callout-plugin/helpers.d.ts +42 -0
- package/dist/src/components/line-chart/plugins/chart-area-text-plugin.d.ts +17 -0
- package/dist/src/components/line-chart/plugins/line-chart.minor-gridlines-plugin.d.ts +8 -0
- package/dist/src/components/line-chart/plugins/line-markers-plugin/draw.d.ts +39 -0
- package/dist/src/components/line-chart/plugins/line-markers-plugin/line-markers-plugin.d.ts +10 -0
- package/dist/src/components/line-chart/plugins/line-markers-plugin/types.d.ts +204 -0
- package/dist/src/components/line-chart/plugins/line-markers-plugin/utils.d.ts +40 -0
- package/dist/src/components/line-chart/plugins/plugin-constants.d.ts +11 -0
- package/dist/src/components/line-chart/plugins/plugins.interface.d.ts +9 -0
- package/dist/src/components/line-chart/state/action-types.d.ts +12 -0
- package/dist/src/components/line-chart/state/helpers.d.ts +13 -0
- package/dist/src/components/line-chart/state/initial-state.d.ts +11 -0
- package/dist/src/components/line-chart/state/line-chart-reducer.d.ts +2 -0
- package/dist/src/components/line-chart/state/manage-state-in-local-storage.d.ts +15 -0
- package/dist/src/components/line-chart/state/state.interfaces.d.ts +26 -0
- package/dist/src/components/line-chart/utils/axis-formatting/axis-formatting.d.ts +2 -0
- package/dist/src/components/line-chart/utils/axis-scales/axis-scales.d.ts +18 -0
- package/dist/src/components/line-chart/utils/check-custom-option/check-custom-option.d.ts +12 -0
- package/dist/src/components/line-chart/utils/datalabels-alignment/datalabels-alignment.interface.d.ts +20 -0
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-condition.d.ts +8 -0
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-alignment-data.d.ts +11 -0
- package/dist/src/components/line-chart/utils/datalabels-alignment/get-datalabels-position.d.ts +6 -0
- package/dist/src/components/line-chart/utils/enums.d.ts +4 -0
- package/dist/src/components/line-chart/utils/generate-line-chart-datasets.d.ts +8 -0
- package/dist/src/components/line-chart/utils/get-annotations-data.d.ts +8 -0
- package/dist/src/components/line-chart/utils/get-axes-data-from-metasets.d.ts +5 -0
- package/dist/src/components/line-chart/utils/get-axis-range-by-type.d.ts +9 -0
- package/dist/src/components/line-chart/utils/get-line-chart-data-labels.d.ts +16 -0
- package/dist/src/components/line-chart/utils/get-line-chart-scales.d.ts +5 -0
- package/dist/src/components/line-chart/utils/get-line-chart-tooltips.d.ts +31 -0
- package/dist/src/components/line-chart/utils/line-chart-utils.d.ts +24 -0
- package/dist/src/components/line-chart/utils/translations/get-translations.d.ts +8 -0
- package/dist/src/components/pie-chart/pie-chart-defalut-props.interface.d.ts +50 -0
- package/dist/src/components/pie-chart/pie-chart-get-default-props.d.ts +3 -0
- package/dist/src/components/pie-chart/pie-chart.d.ts +38 -0
- package/dist/src/components/pie-chart/pie-chart.interface.d.ts +150 -0
- package/dist/src/components/pie-chart/use-pie-chart-config.d.ts +42 -0
- package/dist/src/components/scatter-chart/hooks/use-scatter-chart-config.d.ts +69 -0
- package/dist/src/components/scatter-chart/scatter-chart-default-props.interface.d.ts +73 -0
- package/dist/src/components/scatter-chart/scatter-chart-get-default-props.d.ts +4 -0
- package/dist/src/components/scatter-chart/scatter-chart.d.ts +41 -0
- package/dist/src/components/scatter-chart/scatter-chart.interface.d.ts +193 -0
- package/dist/src/components/scatter-chart/utils/get-scales-config.d.ts +5 -0
- package/dist/src/components/scatter-chart/utils/get-tooltip-config.d.ts +21 -0
- package/package.json +34 -34
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { IPieChartProps } from './pie-chart.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Renders pie segments with optional data labels, a legend and an inner cutout.
|
|
4
|
+
*
|
|
5
|
+
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
6
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* Defaults: a full pie (cutout 0), a bottom legend, and no fixed width or height.
|
|
10
|
+
* Data labels, stacking, zoom and pan are disabled. Pie charts do not have Cartesian axes.
|
|
11
|
+
* Performance mode is enabled by default, disabling animations.
|
|
12
|
+
* The linked reference lists the complete normalized default configuration.
|
|
13
|
+
*
|
|
14
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#piechart
|
|
15
|
+
*
|
|
16
|
+
* @param props - Chart data and options.
|
|
17
|
+
* @returns The chart canvas and its associated UI.
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <PieChart chart={{
|
|
21
|
+
* data: {
|
|
22
|
+
* labels: ['A', 'B', 'C'],
|
|
23
|
+
* datasets: [{
|
|
24
|
+
* label: 'DS A',
|
|
25
|
+
* data: [10, 20, 15],
|
|
26
|
+
* backgroundColor: ['#3366cc', '#dc3912', '#ff9900'],
|
|
27
|
+
* }],
|
|
28
|
+
* },
|
|
29
|
+
* options: {
|
|
30
|
+
* chartStyling: { height: 320 },
|
|
31
|
+
* legend: { display: true, position: 'bottom' },
|
|
32
|
+
* graph: { cutout: 0, showDataLabels: false },
|
|
33
|
+
* },
|
|
34
|
+
* }} />
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare const PieChartWithLegend: (props: IPieChartProps) => import("react").JSX.Element;
|
|
38
|
+
export { PieChartWithLegend as PieChart };
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import type { DeepPartial, IChartDataLabelsOptions, IChartGeneratedLabel, IChartLegendItemFilter, ICommonChartOptions, ICommonData, ICommonDataValue, ICommonDataset, ICommonLegend, ICommonOptions, ICommonStyling, ICommonTooltip } from '../common/common.interface';
|
|
2
|
+
/** PieChart legend configuration and DS-based visibility filtering. */
|
|
3
|
+
export interface IPieLegend extends ICommonLegend {
|
|
4
|
+
/** Filters legend items using `hideLegend` on the DS at the corresponding item index. */
|
|
5
|
+
useDataset?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** Pie geometry and data-label rendering options. */
|
|
8
|
+
export interface IPieGraph {
|
|
9
|
+
/** Draws labels on data elements. */
|
|
10
|
+
showDataLabels?: boolean;
|
|
11
|
+
/** Enables stacked rendering where supported. */
|
|
12
|
+
stacked?: boolean;
|
|
13
|
+
/** Inner radius of the pie: a pixel value or percentage string. Defaults to 0. */
|
|
14
|
+
cutout?: number | string;
|
|
15
|
+
}
|
|
16
|
+
/** PieChart-specific options layered over the common chart options. */
|
|
17
|
+
export interface IPieOptions extends ICommonOptions {
|
|
18
|
+
/** Geometry, grid and data-label rendering options. */
|
|
19
|
+
graph?: IPieGraph;
|
|
20
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
21
|
+
legend?: IPieLegend;
|
|
22
|
+
/** Compatibility field; pie charts do not render Cartesian axes. */
|
|
23
|
+
axes?: unknown;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
/** Object-form pie value with optional display styling and related labels. */
|
|
27
|
+
export interface IPieDataValue extends ICommonDataValue {
|
|
28
|
+
/** Display text associated with this element. */
|
|
29
|
+
label: string;
|
|
30
|
+
/** Outline width in canvas pixels. */
|
|
31
|
+
borderWidth: string | number;
|
|
32
|
+
/** Numeric value or axis coordinate represented by this item. */
|
|
33
|
+
value: number;
|
|
34
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
35
|
+
backgroundColor?: string | string[];
|
|
36
|
+
/** Canvas colour used for the element outline. */
|
|
37
|
+
borderColor?: string;
|
|
38
|
+
/** Labels associated with the input data. */
|
|
39
|
+
labels: string[];
|
|
40
|
+
}
|
|
41
|
+
/** Input pie DS containing object-form values. */
|
|
42
|
+
export interface IPieChartDataset extends ICommonDataset {
|
|
43
|
+
/** Values rendered by the chart or DS. */
|
|
44
|
+
data: IPieDataValue[];
|
|
45
|
+
/** Excludes this entry from the legend where supported. */
|
|
46
|
+
hideLegend?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/** Pie labels, DS definitions and legacy unit metadata. */
|
|
49
|
+
export interface IPieData {
|
|
50
|
+
/** Labels associated with the input data. */
|
|
51
|
+
labels?: string[];
|
|
52
|
+
/** DS definitions in rendering order. */
|
|
53
|
+
datasets?: IPieChartDataset[];
|
|
54
|
+
/** Legacy X-unit metadata on the input data object. */
|
|
55
|
+
xUnit?: string;
|
|
56
|
+
/** Legacy Y-unit metadata on the input data object. */
|
|
57
|
+
yUnit?: string;
|
|
58
|
+
}
|
|
59
|
+
/** Normalized PieChart input structure. */
|
|
60
|
+
export interface IPieChartData extends ICommonData {
|
|
61
|
+
/** Values rendered by the chart or DS. */
|
|
62
|
+
data: IPieData;
|
|
63
|
+
/** Configuration for this chart or generated element. */
|
|
64
|
+
options: IPieOptions;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Partial PieChart options accepted at the component boundary.
|
|
68
|
+
* Only settings supported by the pie normalizer affect rendering.
|
|
69
|
+
*/
|
|
70
|
+
export type IPieOptionsInput = Omit<DeepPartial<IPieOptions>, 'title' | 'graph' | 'legend' | 'chartStyling' | 'tooltip' | 'chartOptions' | 'interactions'> & {
|
|
71
|
+
[key: string]: unknown;
|
|
72
|
+
/** Chart title; an array represents multiple lines. */
|
|
73
|
+
title?: unknown;
|
|
74
|
+
/** Geometry, grid and data-label rendering options. */
|
|
75
|
+
graph?: DeepPartial<IPieGraph>;
|
|
76
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
77
|
+
legend?: Omit<DeepPartial<IPieLegend>, 'position' | 'align'> & {
|
|
78
|
+
/** Visual placement of this element; does not select LineChart tooltip axes. */
|
|
79
|
+
position?: string;
|
|
80
|
+
/** Alignment within the available layout space. */
|
|
81
|
+
align?: string;
|
|
82
|
+
[key: string]: unknown;
|
|
83
|
+
};
|
|
84
|
+
/** Chart sizing and visual layout settings. */
|
|
85
|
+
chartStyling?: DeepPartial<ICommonStyling> & {
|
|
86
|
+
[key: string]: unknown;
|
|
87
|
+
};
|
|
88
|
+
/** Tooltip visibility, formatting and supported callbacks. */
|
|
89
|
+
tooltip?: DeepPartial<ICommonTooltip>;
|
|
90
|
+
/** Initial interaction and rendering controls. */
|
|
91
|
+
chartOptions?: DeepPartial<ICommonChartOptions>;
|
|
92
|
+
/** Callbacks for legend and pointer interactions. */
|
|
93
|
+
interactions?: DeepPartial<ICommonOptions['interactions']> & {
|
|
94
|
+
[key: string]: unknown;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
/** Consumer-facing PieChart configuration; point input accepts numbers or partial value objects. */
|
|
98
|
+
export interface IPieChartDataInput extends Omit<IPieChartData, 'data' | 'options'> {
|
|
99
|
+
/** Values rendered by the chart or DS. */
|
|
100
|
+
data?: Omit<DeepPartial<IPieChartData['data']>, 'datasets'> & {
|
|
101
|
+
/** DS definitions in rendering order. */
|
|
102
|
+
datasets?: Array<(Omit<DeepPartial<IPieChartDataset>, 'data'> & {
|
|
103
|
+
/** Values rendered by the chart or DS. */
|
|
104
|
+
data?: Array<DeepPartial<IPieDataValue> | number>;
|
|
105
|
+
[key: string]: unknown;
|
|
106
|
+
}) | object | null>;
|
|
107
|
+
};
|
|
108
|
+
/** Configuration for this chart or generated element. */
|
|
109
|
+
options?: IPieOptionsInput;
|
|
110
|
+
}
|
|
111
|
+
/** Props accepted by the PieChart React component. */
|
|
112
|
+
export interface IPieChartProps {
|
|
113
|
+
/** Chart data and options. Omitted optional settings are resolved by the component defaults. */
|
|
114
|
+
chart: IPieChartDataInput;
|
|
115
|
+
/** Legacy top-level field; use `chart.testId`, which is read by the component normalizer. */
|
|
116
|
+
testId?: string | null;
|
|
117
|
+
}
|
|
118
|
+
/** PieChart alias for generated legend label metadata. */
|
|
119
|
+
export type IPieGeneratedLabel = IChartGeneratedLabel;
|
|
120
|
+
/** PieChart alias for legend visibility metadata. */
|
|
121
|
+
export type IPieLegendItemFilter = IChartLegendItemFilter;
|
|
122
|
+
/** PieChart alias for data-label plugin settings. */
|
|
123
|
+
export type IPiesDataLabelsOptions = IChartDataLabelsOptions;
|
|
124
|
+
/** Generated pie DS with annotation and legend metadata. */
|
|
125
|
+
export interface IGeneratedPieChartDataset {
|
|
126
|
+
/** Display text associated with this element. */
|
|
127
|
+
label: string;
|
|
128
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
129
|
+
backgroundColor: string[];
|
|
130
|
+
/** Canvas colour used for the element outline. */
|
|
131
|
+
borderColor: string;
|
|
132
|
+
/** Outline width in canvas pixels. */
|
|
133
|
+
borderWidth: number;
|
|
134
|
+
/** Alternating dash and gap lengths in canvas pixels. */
|
|
135
|
+
borderDash: number[];
|
|
136
|
+
/** Shape identifier retained for the generated annotation DS. */
|
|
137
|
+
annotationType?: string;
|
|
138
|
+
/** Values rendered by the chart or DS. */
|
|
139
|
+
data: IPieDataValue[];
|
|
140
|
+
/** Excludes this entry from the legend where supported. */
|
|
141
|
+
hideLegend?: boolean;
|
|
142
|
+
/** Groups DS entries for legend display. */
|
|
143
|
+
displayGroup?: string | number;
|
|
144
|
+
/** Marks a generated DS as annotation data rather than plotted input data. */
|
|
145
|
+
isAnnotation?: boolean;
|
|
146
|
+
/** Index of the source annotation in the annotation collection. */
|
|
147
|
+
annotationIndex?: number;
|
|
148
|
+
}
|
|
149
|
+
/** Generated PieChart DS collection. */
|
|
150
|
+
export type TGeneratedPieChartDatasets = IGeneratedPieChartDataset[];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ActiveElement, Chart, Chart as ChartJS, ChartEvent, LegendItem, Plugin, TooltipItem } from 'chart.js';
|
|
2
|
+
import { IGeneratedPieChartDataset, IPieDataValue, IPiesDataLabelsOptions } from './pie-chart.interface';
|
|
3
|
+
import { IPieChartDefaultProps } from './pie-chart-defalut-props.interface';
|
|
4
|
+
import { UnusedParameter } from '../common/common.interface';
|
|
5
|
+
interface ILegendPlugin extends Plugin {
|
|
6
|
+
chart?: Chart;
|
|
7
|
+
}
|
|
8
|
+
export declare const usePieChartConfig: (chart: IPieChartDefaultProps) => {
|
|
9
|
+
generatedDatasets: IGeneratedPieChartDataset[] | {
|
|
10
|
+
label?: string;
|
|
11
|
+
hidden?: boolean;
|
|
12
|
+
data: IPieDataValue[];
|
|
13
|
+
hideLegend?: boolean;
|
|
14
|
+
borderWidth: number;
|
|
15
|
+
borderColor: string;
|
|
16
|
+
backgroundColor: string | string[];
|
|
17
|
+
}[];
|
|
18
|
+
getTitle: () => {
|
|
19
|
+
display: boolean;
|
|
20
|
+
text: string | string[];
|
|
21
|
+
} | {
|
|
22
|
+
display?: undefined;
|
|
23
|
+
text?: undefined;
|
|
24
|
+
};
|
|
25
|
+
legendClick: (_: UnusedParameter, legendItem?: LegendItem, legend?: ILegendPlugin) => void;
|
|
26
|
+
onClick: (_evt: ChartEvent, _elements: ActiveElement[], chartInstance: ChartJS) => void;
|
|
27
|
+
onHover: (evt: ChartEvent, hoveredItems: ActiveElement[]) => void;
|
|
28
|
+
getDatalabels: () => IPiesDataLabelsOptions;
|
|
29
|
+
getLegend: () => object;
|
|
30
|
+
getToolTips: () => {
|
|
31
|
+
callbacks: {
|
|
32
|
+
title: (tooltipItem: TooltipItem<any>[]) => string;
|
|
33
|
+
label: (tooltipItem: TooltipItem<any>) => string;
|
|
34
|
+
};
|
|
35
|
+
padding: number;
|
|
36
|
+
boxWidth: number;
|
|
37
|
+
boxHeight: number;
|
|
38
|
+
boxPadding: number;
|
|
39
|
+
usePointStyle: boolean;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ActiveElement, AnimationSpec, Chart, ChartEvent } from 'chart.js';
|
|
2
|
+
import { IScatterChartDefaultProps } from '../scatter-chart-default-props.interface.js';
|
|
3
|
+
import { RefObject } from 'react';
|
|
4
|
+
import { ICommonHoveredItems, TChart } from '../../common/common.interface.js';
|
|
5
|
+
import { TGeneratedScatterChartDatasets } from '../scatter-chart.interface';
|
|
6
|
+
export declare const useScatterChartConfig: (chart: IScatterChartDefaultProps, chartRef: RefObject<TChart | null>) => {
|
|
7
|
+
generatedDatasets: TGeneratedScatterChartDatasets;
|
|
8
|
+
scatterOptions: {
|
|
9
|
+
width?: number | string;
|
|
10
|
+
height?: number | string;
|
|
11
|
+
maintainAspectRatio: boolean;
|
|
12
|
+
staticChartHeight: boolean;
|
|
13
|
+
performanceMode: boolean;
|
|
14
|
+
onClick: (_evt: ChartEvent, _elements: ActiveElement[], chartInstance: Chart) => void;
|
|
15
|
+
onHover: (evt: ChartEvent, hoveredItems: ICommonHoveredItems[]) => void;
|
|
16
|
+
interactions: {
|
|
17
|
+
onLegendClick: (_: import("../../common/common.interface.js").UnusedParameter, legendItem: import("chart.js").LegendItem) => void;
|
|
18
|
+
onHover: (evt: ChartEvent, hoveredItems: ICommonHoveredItems[]) => void;
|
|
19
|
+
};
|
|
20
|
+
scales: {
|
|
21
|
+
x: import("../../common/common.interface.js").ICommonScaleOptions;
|
|
22
|
+
y: import("../../common/common.interface.js").ICommonScaleOptions;
|
|
23
|
+
};
|
|
24
|
+
animation: Partial<AnimationSpec<"scatter">>;
|
|
25
|
+
plugins: {
|
|
26
|
+
legend: {
|
|
27
|
+
position: any;
|
|
28
|
+
align: 'center' | 'start' | 'end';
|
|
29
|
+
labels: {
|
|
30
|
+
boxHeight: number;
|
|
31
|
+
boxWidth: number | undefined;
|
|
32
|
+
usePointStyle: boolean | undefined;
|
|
33
|
+
};
|
|
34
|
+
onClick: (_: import("../../common/common.interface.js").UnusedParameter, legendItem: import("chart.js").LegendItem) => void;
|
|
35
|
+
display: boolean;
|
|
36
|
+
events: never[];
|
|
37
|
+
};
|
|
38
|
+
customLegendPlugin: {
|
|
39
|
+
htmlLegend: any;
|
|
40
|
+
};
|
|
41
|
+
title: {
|
|
42
|
+
display: boolean;
|
|
43
|
+
text: string | string[];
|
|
44
|
+
} | {
|
|
45
|
+
display?: undefined;
|
|
46
|
+
text?: undefined;
|
|
47
|
+
};
|
|
48
|
+
annotation: {
|
|
49
|
+
annotations: {};
|
|
50
|
+
};
|
|
51
|
+
chartAreaBorder: {
|
|
52
|
+
borderColor: string;
|
|
53
|
+
};
|
|
54
|
+
datalabels: {
|
|
55
|
+
display: boolean;
|
|
56
|
+
};
|
|
57
|
+
tooltip: {
|
|
58
|
+
enabled: boolean;
|
|
59
|
+
callbacks: {
|
|
60
|
+
title: (tooltipItems: import("chart.js").TooltipItem<'scatter'>[]) => string | undefined;
|
|
61
|
+
label: (tooltipItems: import("../utils/get-tooltip-config.js").IScatterTooltipItem) => string;
|
|
62
|
+
};
|
|
63
|
+
backgroundColor: string;
|
|
64
|
+
displayColors: boolean;
|
|
65
|
+
padding: number;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ChartEvent } from 'chart.js';
|
|
2
|
+
import type { ICommonAdditionalAxesOptions, ICommonAnnotations, ICommonCustomLegend, ICommonLegend, ICommonScales } from '../common/common.interface.js';
|
|
3
|
+
import type { ChartDirection } from '../common/enums.js';
|
|
4
|
+
import type { IScatterAxes, IScatterChartDataset } from './scatter-chart.interface';
|
|
5
|
+
export interface IDefaultChartStyling {
|
|
6
|
+
width?: number | string;
|
|
7
|
+
height?: number | string;
|
|
8
|
+
maintainAspectRatio: boolean;
|
|
9
|
+
staticChartHeight: boolean;
|
|
10
|
+
performanceMode: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface IDefaultTooltip {
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
tooltips: boolean;
|
|
15
|
+
showLabelsInTooltips: boolean;
|
|
16
|
+
backgroundColor: string;
|
|
17
|
+
displayColors: boolean;
|
|
18
|
+
scientificNotation: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface IDefaultScatterGraph {
|
|
21
|
+
showMinorGridlines: boolean;
|
|
22
|
+
showDataLabels: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface IDefaultScatterLegend extends ICommonLegend {
|
|
25
|
+
customLegend?: ICommonCustomLegend<any>;
|
|
26
|
+
}
|
|
27
|
+
interface IDefaultChartOptions {
|
|
28
|
+
enableZoom: boolean;
|
|
29
|
+
enablePan: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface IDefaultInteractions {
|
|
32
|
+
onLegendClick?: (text: string, hidden: boolean) => void;
|
|
33
|
+
onHover?: (event: ChartEvent, datasetIndex: number, index: number, generatedDataset: IScatterChartDataset[]) => void;
|
|
34
|
+
onUnhover?: (event?: ChartEvent, datasetIndex?: number, index?: number, generatedDataset?: IScatterChartDataset[]) => void;
|
|
35
|
+
onAnimationComplete?: () => void;
|
|
36
|
+
}
|
|
37
|
+
interface IDefaultChartData {
|
|
38
|
+
labels: string[];
|
|
39
|
+
datasets: IScatterChartDataset[];
|
|
40
|
+
}
|
|
41
|
+
export interface IDefaultScatterOptions {
|
|
42
|
+
title: string | string[];
|
|
43
|
+
chartStyling: IDefaultChartStyling;
|
|
44
|
+
tooltip: IDefaultTooltip;
|
|
45
|
+
graph: IDefaultScatterGraph;
|
|
46
|
+
axes: IScatterAxes;
|
|
47
|
+
scales?: ICommonScales;
|
|
48
|
+
additionalAxesOptions: ICommonAdditionalAxesOptions;
|
|
49
|
+
legend: IDefaultScatterLegend;
|
|
50
|
+
chartOptions: IDefaultChartOptions;
|
|
51
|
+
interactions: IDefaultInteractions;
|
|
52
|
+
annotations?: ICommonAnnotations;
|
|
53
|
+
direction: ChartDirection;
|
|
54
|
+
}
|
|
55
|
+
export interface IScatterChartDefaultProps {
|
|
56
|
+
testId: string | null;
|
|
57
|
+
data: IDefaultChartData;
|
|
58
|
+
options: {
|
|
59
|
+
title: string | string[];
|
|
60
|
+
chartStyling: IDefaultChartStyling;
|
|
61
|
+
tooltip: IDefaultTooltip;
|
|
62
|
+
graph: IDefaultScatterGraph;
|
|
63
|
+
axes: IScatterAxes;
|
|
64
|
+
scales?: ICommonScales;
|
|
65
|
+
additionalAxesOptions: ICommonAdditionalAxesOptions;
|
|
66
|
+
legend: IDefaultScatterLegend;
|
|
67
|
+
chartOptions: IDefaultChartOptions;
|
|
68
|
+
interactions: IDefaultInteractions;
|
|
69
|
+
annotations?: ICommonAnnotations;
|
|
70
|
+
direction: ChartDirection;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IScatterChartDefaultProps } from './scatter-chart-default-props.interface.js';
|
|
2
|
+
import { IScatterChartProps, IScatterOptionsInput } from './scatter-chart.interface';
|
|
3
|
+
export declare const normalizeScatterOptions: (options?: IScatterOptionsInput) => IScatterChartDefaultProps['options'];
|
|
4
|
+
export declare const getDefaultProps: (props: IScatterChartProps) => IScatterChartDefaultProps;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import 'chartjs-adapter-date-fns';
|
|
2
|
+
import { IScatterChartProps } from './scatter-chart.interface.js';
|
|
3
|
+
/**
|
|
4
|
+
* Renders Cartesian points with a legend, optional annotations and a background gradient.
|
|
5
|
+
*
|
|
6
|
+
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
7
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* Defaults: automatic width and height, a bottom-left legend, zero included in automatic scale bounds,
|
|
11
|
+
* and annotations enabled. Zoom, pan, data labels, minor grid lines and the background gradient are disabled.
|
|
12
|
+
* Performance mode is enabled by default, disabling animations.
|
|
13
|
+
* The linked reference lists the complete normalized default configuration.
|
|
14
|
+
*
|
|
15
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#scatterchart
|
|
16
|
+
*
|
|
17
|
+
* @param props - Chart data and options.
|
|
18
|
+
* @returns The chart canvas and its associated UI.
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <ScatterChart chart={{
|
|
22
|
+
* data: {
|
|
23
|
+
* datasets: [{
|
|
24
|
+
* label: 'DS A',
|
|
25
|
+
* data: [{ x: 1, y: 10 }, { x: 2, y: 20 }, { x: 3, y: 15 }],
|
|
26
|
+
* }],
|
|
27
|
+
* },
|
|
28
|
+
* options: {
|
|
29
|
+
* axes: {
|
|
30
|
+
* x: [{ label: 'X', position: 'bottom' }],
|
|
31
|
+
* y: [{ label: 'Y', position: 'left' }],
|
|
32
|
+
* },
|
|
33
|
+
* chartStyling: { height: 320 },
|
|
34
|
+
* legend: { display: true, position: 'bottom-left' },
|
|
35
|
+
* graph: { showDataLabels: false, showMinorGridlines: false },
|
|
36
|
+
* },
|
|
37
|
+
* }} />
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
declare const ScatterChartWithLegend: (props: IScatterChartProps) => import("react").JSX.Element;
|
|
41
|
+
export { ScatterChartWithLegend as ScatterChart };
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import type { DeepPartial, IChartDataLabelsOptions, IChartGeneratedLabel, IChartLegendItemFilter, ICommonAdditionalAxesOptions, ICommonAnnotations, ICommonAnnotationsData, ICommonAxis, ICommonData, ICommonDataValue, ICommonDataset, ICommonLegend, ICommonOptions, ICommonScales } from '../common/common.interface';
|
|
2
|
+
import type { ChartDirection } from '../common/enums.js';
|
|
3
|
+
/** ScatterChart legend configuration and compatibility flags. */
|
|
4
|
+
export interface IScatterLegend extends ICommonLegend {
|
|
5
|
+
/** Compatibility flag retained by the normalizer; currently does not change ScatterChart legend rendering. */
|
|
6
|
+
useDataset?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** ScatterChart grid and data-label rendering options. */
|
|
9
|
+
export interface IScatterGraph {
|
|
10
|
+
/** Draws intermediate grid lines between the main ticks. */
|
|
11
|
+
showMinorGridlines?: boolean;
|
|
12
|
+
/** Draws labels on data elements. */
|
|
13
|
+
showDataLabels?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** ScatterChart tooltip settings resolved by its default-props helper. */
|
|
16
|
+
export interface IScatterTooltip {
|
|
17
|
+
/** Whether this feature is active. */
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
/** Enables hover tooltips. Defaults to true. */
|
|
20
|
+
tooltips?: boolean;
|
|
21
|
+
/** Includes the optional point label in supported tooltips. Defaults to false. */
|
|
22
|
+
showLabelsInTooltips: boolean;
|
|
23
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
24
|
+
backgroundColor?: string;
|
|
25
|
+
/** Whether the tooltip includes colour swatches. */
|
|
26
|
+
displayColors?: boolean;
|
|
27
|
+
/** Allows scientific notation when formatting tooltip numbers. Defaults to true. */
|
|
28
|
+
scientificNotation?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** Ordered horizontal and vertical ScatterChart axis collections. */
|
|
31
|
+
export interface IScatterAxes {
|
|
32
|
+
/** Horizontal axis definitions in order. */
|
|
33
|
+
x: ICommonAxis<'top' | 'bottom'>[];
|
|
34
|
+
/** Vertical axis definitions in order. */
|
|
35
|
+
y: ICommonAxis<'left' | 'right'>[];
|
|
36
|
+
[key: string]: ICommonAxis[];
|
|
37
|
+
}
|
|
38
|
+
/** ScatterChart options layered over common Cartesian settings. */
|
|
39
|
+
export interface IScatterOptions extends ICommonOptions {
|
|
40
|
+
/** Geometry, grid and data-label rendering options. */
|
|
41
|
+
graph?: IScatterGraph;
|
|
42
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
43
|
+
legend?: IScatterLegend;
|
|
44
|
+
/** Axis descriptions. Configure horizontal axes in `x` and vertical axes in `y`. */
|
|
45
|
+
axes?: IScatterAxes;
|
|
46
|
+
/** Chart.js scale configuration keyed by scale ID. */
|
|
47
|
+
scales?: ICommonScales;
|
|
48
|
+
/** Scale behaviour, bounds and tick settings shared across the chart axes. */
|
|
49
|
+
additionalAxesOptions?: ICommonAdditionalAxesOptions;
|
|
50
|
+
/** Chart orientation. Support and interpretation depend on the chart component. */
|
|
51
|
+
direction?: ChartDirection;
|
|
52
|
+
}
|
|
53
|
+
/** A scatter point with an optional display label. */
|
|
54
|
+
export interface IScatterDataValue extends ICommonDataValue {
|
|
55
|
+
/** Display text associated with this element. */
|
|
56
|
+
label?: string;
|
|
57
|
+
}
|
|
58
|
+
/** Input scatter DS and its legend visibility. */
|
|
59
|
+
export interface IScatterChartDataset extends ICommonDataset {
|
|
60
|
+
/** Values rendered by the chart or DS. */
|
|
61
|
+
data: IScatterDataValue[];
|
|
62
|
+
/** Excludes this entry from the legend where supported. */
|
|
63
|
+
hideLegend?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/** Scatter labels, DS definitions and legacy unit metadata. */
|
|
66
|
+
export interface IScatterData {
|
|
67
|
+
/** Labels associated with the input data. */
|
|
68
|
+
labels?: string[];
|
|
69
|
+
/** DS definitions in rendering order. */
|
|
70
|
+
datasets?: IScatterChartDataset[];
|
|
71
|
+
/** Legacy X-unit metadata on the input data object. */
|
|
72
|
+
xUnit?: string;
|
|
73
|
+
/** Legacy Y-unit metadata on the input data object. */
|
|
74
|
+
yUnit?: string;
|
|
75
|
+
}
|
|
76
|
+
/** Normalized ScatterChart input structure. */
|
|
77
|
+
export interface IScatterChartData extends ICommonData {
|
|
78
|
+
/** Values rendered by the chart or DS. */
|
|
79
|
+
data: IScatterData;
|
|
80
|
+
/** Configuration for this chart or generated element. */
|
|
81
|
+
options: IScatterOptions;
|
|
82
|
+
}
|
|
83
|
+
/** Compatibility input for a ScatterChart axis. */
|
|
84
|
+
type ILooseScatterAxis = DeepPartial<ICommonAxis<string>> & {
|
|
85
|
+
[key: string]: unknown;
|
|
86
|
+
};
|
|
87
|
+
/** Compatibility annotation input normalized by ScatterChart. */
|
|
88
|
+
type ILooseScatterAnnotation = Omit<DeepPartial<ICommonAnnotationsData>, 'annotationAxis'> & {
|
|
89
|
+
[key: string]: unknown;
|
|
90
|
+
/** Axis on which `value` and `endValue` locate the annotation. */
|
|
91
|
+
annotationAxis?: string;
|
|
92
|
+
/** Chart or annotation kind. */
|
|
93
|
+
type?: string;
|
|
94
|
+
/** Numeric value or axis coordinate represented by this item. */
|
|
95
|
+
value?: number | string | null;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Partial ScatterChart options accepted at the component boundary.
|
|
99
|
+
* Unknown fields are accepted for compatibility, not guaranteed to be forwarded.
|
|
100
|
+
*/
|
|
101
|
+
export type IScatterOptionsInput = Omit<DeepPartial<IScatterOptions>, 'title' | 'direction' | 'axes' | 'legend' | 'chartStyling' | 'interactions' | 'annotations' | 'scales'> & {
|
|
102
|
+
[key: string]: unknown;
|
|
103
|
+
/** Chart title; an array represents multiple lines. */
|
|
104
|
+
title?: unknown;
|
|
105
|
+
/** Chart orientation. Support and interpretation depend on the chart component. */
|
|
106
|
+
direction?: string;
|
|
107
|
+
/** Axis descriptions. Configure horizontal axes in `x` and vertical axes in `y`. */
|
|
108
|
+
axes?: {
|
|
109
|
+
/** Horizontal axis definitions in order. */
|
|
110
|
+
x?: ILooseScatterAxis[];
|
|
111
|
+
/** Vertical axis definitions in order. */
|
|
112
|
+
y?: ILooseScatterAxis[];
|
|
113
|
+
[key: string]: ILooseScatterAxis[] | undefined;
|
|
114
|
+
};
|
|
115
|
+
/** Chart.js scale configuration keyed by scale ID. */
|
|
116
|
+
scales?: Record<string, unknown>;
|
|
117
|
+
/** Legend visibility, placement and custom rendering options. */
|
|
118
|
+
legend?: Omit<DeepPartial<IScatterLegend>, 'position' | 'align'> & {
|
|
119
|
+
/** Visual placement of this element; does not select LineChart tooltip axes. */
|
|
120
|
+
position?: string;
|
|
121
|
+
/** Alignment within the available layout space. */
|
|
122
|
+
align?: string;
|
|
123
|
+
[key: string]: unknown;
|
|
124
|
+
};
|
|
125
|
+
/** Chart sizing and visual layout settings. */
|
|
126
|
+
chartStyling?: {
|
|
127
|
+
[key: string]: unknown;
|
|
128
|
+
};
|
|
129
|
+
/** Callbacks for legend and pointer interactions. */
|
|
130
|
+
interactions?: DeepPartial<ICommonOptions['interactions']> & {
|
|
131
|
+
/** Compatibility interaction input; configure zoom through `chartOptions.enableZoom`. */
|
|
132
|
+
enableZoom?: boolean;
|
|
133
|
+
/** Compatibility interaction input; configure pan through `chartOptions.enablePan`. */
|
|
134
|
+
enablePan?: boolean;
|
|
135
|
+
[key: string]: unknown;
|
|
136
|
+
};
|
|
137
|
+
/** Annotation visibility, interaction and geometry configuration. */
|
|
138
|
+
annotations?: (Omit<DeepPartial<ICommonAnnotations>, 'annotationsData'> & {
|
|
139
|
+
/** Annotation definitions in drawing order. */
|
|
140
|
+
annotationsData?: ILooseScatterAnnotation[];
|
|
141
|
+
}) | null;
|
|
142
|
+
};
|
|
143
|
+
/** Consumer-facing ScatterChart configuration with optional datasets and options. */
|
|
144
|
+
export interface IScatterChartDataInput extends Omit<IScatterChartData, 'data' | 'options'> {
|
|
145
|
+
/** Values rendered by the chart or DS. */
|
|
146
|
+
data?: Omit<DeepPartial<IScatterChartData['data']>, 'datasets'> & {
|
|
147
|
+
/** DS definitions in rendering order. */
|
|
148
|
+
datasets?: Array<DeepPartial<IScatterChartDataset> | object | null>;
|
|
149
|
+
};
|
|
150
|
+
/** Configuration for this chart or generated element. */
|
|
151
|
+
options?: IScatterOptionsInput;
|
|
152
|
+
}
|
|
153
|
+
/** Props accepted by the ScatterChart React component. */
|
|
154
|
+
export interface IScatterChartProps {
|
|
155
|
+
/** Chart data and options. Omitted optional settings are resolved by the component defaults. */
|
|
156
|
+
chart: IScatterChartDataInput;
|
|
157
|
+
/** Legacy top-level field; use `chart.testId`, which is read by the component normalizer. */
|
|
158
|
+
testId?: string | null;
|
|
159
|
+
}
|
|
160
|
+
/** ScatterChart alias for generated legend label metadata. */
|
|
161
|
+
export type IScatterGeneratedLabel = IChartGeneratedLabel;
|
|
162
|
+
/** ScatterChart alias for legend visibility metadata. */
|
|
163
|
+
export type IScatterLegendItemFilter = IChartLegendItemFilter;
|
|
164
|
+
/** ScatterChart alias for data-label plugin settings. */
|
|
165
|
+
export type IScatterDataLabelsOptions = IChartDataLabelsOptions;
|
|
166
|
+
/** Generated scatter DS with annotation and legend metadata. */
|
|
167
|
+
export interface IGeneratedScatterChartDataset {
|
|
168
|
+
/** Display text associated with this element. */
|
|
169
|
+
label: string;
|
|
170
|
+
/** Canvas fill colour; arrays provide per-element colours where supported. */
|
|
171
|
+
backgroundColor: string[];
|
|
172
|
+
/** Canvas colour used for the element outline. */
|
|
173
|
+
borderColor: string;
|
|
174
|
+
/** Outline width in canvas pixels. */
|
|
175
|
+
borderWidth: number;
|
|
176
|
+
/** Alternating dash and gap lengths in canvas pixels. */
|
|
177
|
+
borderDash: number[];
|
|
178
|
+
/** Shape identifier retained for the generated annotation DS. */
|
|
179
|
+
annotationType?: string;
|
|
180
|
+
/** Values rendered by the chart or DS. */
|
|
181
|
+
data: IScatterDataValue[];
|
|
182
|
+
/** Excludes this entry from the legend where supported. */
|
|
183
|
+
hideLegend?: boolean;
|
|
184
|
+
/** Groups DS entries for legend display. */
|
|
185
|
+
displayGroup?: string | number;
|
|
186
|
+
/** Marks a generated DS as annotation data rather than plotted input data. */
|
|
187
|
+
isAnnotation?: boolean;
|
|
188
|
+
/** Index of the source annotation in the annotation collection. */
|
|
189
|
+
annotationIndex?: number;
|
|
190
|
+
}
|
|
191
|
+
/** Generated ScatterChart DS collection. */
|
|
192
|
+
export type TGeneratedScatterChartDatasets = IGeneratedScatterChartDataset[];
|
|
193
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IDefaultScatterOptions } from '../scatter-chart-default-props.interface.js';
|
|
2
|
+
export declare const getScatterChartScales: (options: IDefaultScatterOptions) => {
|
|
3
|
+
x: import("../../common/common.interface.js").ICommonScaleOptions;
|
|
4
|
+
y: import("../../common/common.interface.js").ICommonScaleOptions;
|
|
5
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TooltipItem } from 'chart.js';
|
|
2
|
+
import { IDefaultScatterOptions } from '../scatter-chart-default-props.interface.js';
|
|
3
|
+
interface IRawData {
|
|
4
|
+
x: number | string;
|
|
5
|
+
y: number | string;
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface IScatterTooltipItem extends TooltipItem<'scatter'> {
|
|
9
|
+
raw: IRawData;
|
|
10
|
+
}
|
|
11
|
+
export declare const getTooltipsConfig: (options: IDefaultScatterOptions) => {
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
callbacks: {
|
|
14
|
+
title: (tooltipItems: TooltipItem<'scatter'>[]) => string | undefined;
|
|
15
|
+
label: (tooltipItems: IScatterTooltipItem) => string;
|
|
16
|
+
};
|
|
17
|
+
backgroundColor: string;
|
|
18
|
+
displayColors: boolean;
|
|
19
|
+
padding: number;
|
|
20
|
+
};
|
|
21
|
+
export {};
|