@oliasoft-open-source/charts-library 8.0.0-beta-1 → 8.0.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/README.md +430 -0
- package/dist/index.d.ts +992 -10
- package/dist/index.js +194 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19020,6 +19020,7 @@ var MouseEvents = /* @__PURE__ */ function(MouseEvents) {
|
|
|
19020
19020
|
MouseEvents["MOUSEUP"] = "mouseup";
|
|
19021
19021
|
return MouseEvents;
|
|
19022
19022
|
}({});
|
|
19023
|
+
/** Annotation shape identifiers. */
|
|
19023
19024
|
var AnnotationType$1 = /* @__PURE__ */ function(AnnotationType) {
|
|
19024
19025
|
AnnotationType["POINT"] = "point";
|
|
19025
19026
|
AnnotationType["BOX"] = "box";
|
|
@@ -19028,6 +19029,7 @@ var AnnotationType$1 = /* @__PURE__ */ function(AnnotationType) {
|
|
|
19028
19029
|
AnnotationType["LABEL"] = "label";
|
|
19029
19030
|
return AnnotationType;
|
|
19030
19031
|
}({});
|
|
19032
|
+
/** Allowed axes for annotation dragging. */
|
|
19031
19033
|
var DragAxis = /* @__PURE__ */ function(DragAxis) {
|
|
19032
19034
|
DragAxis["X"] = "x";
|
|
19033
19035
|
DragAxis["Y"] = "y";
|
|
@@ -19036,6 +19038,7 @@ var DragAxis = /* @__PURE__ */ function(DragAxis) {
|
|
|
19036
19038
|
}({});
|
|
19037
19039
|
//#endregion
|
|
19038
19040
|
//#region src/components/common/plugins/gradient-background-plugin/enums.ts
|
|
19041
|
+
/** Direction of the background gradient between chart-area edges or corners. */
|
|
19039
19042
|
var GradientDirection = /* @__PURE__ */ function(GradientDirection) {
|
|
19040
19043
|
GradientDirection[GradientDirection["TopToBottom"] = 0] = "TopToBottom";
|
|
19041
19044
|
GradientDirection[GradientDirection["BottomToTop"] = 1] = "BottomToTop";
|
|
@@ -19049,11 +19052,13 @@ var GradientDirection = /* @__PURE__ */ function(GradientDirection) {
|
|
|
19049
19052
|
}({});
|
|
19050
19053
|
//#endregion
|
|
19051
19054
|
//#region src/components/common/enums.ts
|
|
19055
|
+
/** Cartesian axis identifiers. */
|
|
19052
19056
|
var AxisType = /* @__PURE__ */ function(AxisType) {
|
|
19053
19057
|
AxisType["X"] = "x";
|
|
19054
19058
|
AxisType["Y"] = "y";
|
|
19055
19059
|
return AxisType;
|
|
19056
19060
|
}({});
|
|
19061
|
+
/** Legend/layout positions. Individual options accept only the positions relevant to their layout. */
|
|
19057
19062
|
var Position = /* @__PURE__ */ function(Position) {
|
|
19058
19063
|
Position["Bottom"] = "bottom";
|
|
19059
19064
|
Position["Top"] = "top";
|
|
@@ -19065,6 +19070,7 @@ var Position = /* @__PURE__ */ function(Position) {
|
|
|
19065
19070
|
Position["BottomRight"] = "bottom-right";
|
|
19066
19071
|
return Position;
|
|
19067
19072
|
}({});
|
|
19073
|
+
/** Chart.js chart-kind identifiers used by the library. */
|
|
19068
19074
|
var ChartType = /* @__PURE__ */ function(ChartType) {
|
|
19069
19075
|
ChartType["LINE"] = "line";
|
|
19070
19076
|
ChartType["BAR"] = "bar";
|
|
@@ -19073,6 +19079,7 @@ var ChartType = /* @__PURE__ */ function(ChartType) {
|
|
|
19073
19079
|
ChartType["SCATTER"] = "scatter";
|
|
19074
19080
|
return ChartType;
|
|
19075
19081
|
}({});
|
|
19082
|
+
/** CSS cursors used during chart interactions. */
|
|
19076
19083
|
var CursorStyle = /* @__PURE__ */ function(CursorStyle) {
|
|
19077
19084
|
CursorStyle["Pointer"] = "pointer";
|
|
19078
19085
|
CursorStyle["Initial"] = "initial";
|
|
@@ -19082,6 +19089,7 @@ var CursorStyle = /* @__PURE__ */ function(CursorStyle) {
|
|
|
19082
19089
|
CursorStyle["Move"] = "move";
|
|
19083
19090
|
return CursorStyle;
|
|
19084
19091
|
}({});
|
|
19092
|
+
/** Chart.js scale-family identifiers. */
|
|
19085
19093
|
var ScaleType = /* @__PURE__ */ function(ScaleType) {
|
|
19086
19094
|
ScaleType["Category"] = "category";
|
|
19087
19095
|
ScaleType["Linear"] = "linear";
|
|
@@ -19090,16 +19098,19 @@ var ScaleType = /* @__PURE__ */ function(ScaleType) {
|
|
|
19090
19098
|
ScaleType["TimeSeries"] = "timeseries";
|
|
19091
19099
|
return ScaleType;
|
|
19092
19100
|
}({});
|
|
19101
|
+
/** Cartesian rendering orientation; this does not select LineChart tooltip content. */
|
|
19093
19102
|
var ChartDirection = /* @__PURE__ */ function(ChartDirection) {
|
|
19094
19103
|
ChartDirection["VERTICAL"] = "vertical";
|
|
19095
19104
|
ChartDirection["HORIZONTAL"] = "horizontal";
|
|
19096
19105
|
return ChartDirection;
|
|
19097
19106
|
}({});
|
|
19107
|
+
/** Legacy tooltip label keys. */
|
|
19098
19108
|
var TooltipLabel = /* @__PURE__ */ function(TooltipLabel) {
|
|
19099
19109
|
TooltipLabel["Y"] = "yLabel";
|
|
19100
19110
|
TooltipLabel["X"] = "xLabel";
|
|
19101
19111
|
return TooltipLabel;
|
|
19102
19112
|
}({});
|
|
19113
|
+
/** Alignment identifiers used by chart layout and legend options. */
|
|
19103
19114
|
var AlignOptions = /* @__PURE__ */ function(AlignOptions) {
|
|
19104
19115
|
AlignOptions["End"] = "end";
|
|
19105
19116
|
AlignOptions["Start"] = "start";
|
|
@@ -19108,10 +19119,12 @@ var AlignOptions = /* @__PURE__ */ function(AlignOptions) {
|
|
|
19108
19119
|
AlignOptions["Left"] = "left";
|
|
19109
19120
|
return AlignOptions;
|
|
19110
19121
|
}({});
|
|
19122
|
+
/** Legacy point classification identifiers. */
|
|
19111
19123
|
var PointType = /* @__PURE__ */ function(PointType) {
|
|
19112
19124
|
PointType["Casing"] = "casing";
|
|
19113
19125
|
return PointType;
|
|
19114
19126
|
}({});
|
|
19127
|
+
/** Annotation shape identifiers. */
|
|
19115
19128
|
var AnnotationType = /* @__PURE__ */ function(AnnotationType) {
|
|
19116
19129
|
AnnotationType["Box"] = "box";
|
|
19117
19130
|
AnnotationType["Ellipse"] = "ellipse";
|
|
@@ -19120,6 +19133,7 @@ var AnnotationType = /* @__PURE__ */ function(AnnotationType) {
|
|
|
19120
19133
|
AnnotationType["Label"] = "label";
|
|
19121
19134
|
return AnnotationType;
|
|
19122
19135
|
}({});
|
|
19136
|
+
/** Point marker shapes compatible with Chart.js. */
|
|
19123
19137
|
var PointStyle = /* @__PURE__ */ function(PointStyle) {
|
|
19124
19138
|
PointStyle["Circle"] = "circle";
|
|
19125
19139
|
PointStyle["Square"] = "rect";
|
|
@@ -19127,10 +19141,12 @@ var PointStyle = /* @__PURE__ */ function(PointStyle) {
|
|
|
19127
19141
|
PointStyle["Triangle"] = "triangle";
|
|
19128
19142
|
return PointStyle;
|
|
19129
19143
|
}({});
|
|
19144
|
+
/** Hover interaction modes used by the library. */
|
|
19130
19145
|
var ChartHoverMode = /* @__PURE__ */ function(ChartHoverMode) {
|
|
19131
19146
|
ChartHoverMode["Nearest"] = "nearest";
|
|
19132
19147
|
return ChartHoverMode;
|
|
19133
19148
|
}({});
|
|
19149
|
+
/** Interaction mode identifiers; availability depends on the chart controls. */
|
|
19134
19150
|
var PanZoomMode = /* @__PURE__ */ function(PanZoomMode) {
|
|
19135
19151
|
PanZoomMode["X"] = "x";
|
|
19136
19152
|
PanZoomMode["Y"] = "y";
|
|
@@ -19138,10 +19154,12 @@ var PanZoomMode = /* @__PURE__ */ function(PanZoomMode) {
|
|
|
19138
19154
|
PanZoomMode["Z"] = "z";
|
|
19139
19155
|
return PanZoomMode;
|
|
19140
19156
|
}({});
|
|
19157
|
+
/** Keyboard modifier identifiers used by chart interactions. */
|
|
19141
19158
|
var Key = /* @__PURE__ */ function(Key) {
|
|
19142
19159
|
Key["Shift"] = "Shift";
|
|
19143
19160
|
return Key;
|
|
19144
19161
|
}({});
|
|
19162
|
+
/** DOM event names used by chart interaction handlers. */
|
|
19145
19163
|
var Events = /* @__PURE__ */ function(Events) {
|
|
19146
19164
|
Events["Mousemove"] = "mousemove";
|
|
19147
19165
|
Events["Mouseout"] = "mouseout";
|
|
@@ -19236,6 +19254,7 @@ var LOGARITHMIC_STEPS = [
|
|
|
19236
19254
|
1e3,
|
|
19237
19255
|
1e4
|
|
19238
19256
|
];
|
|
19257
|
+
/** Default categorical DS colour palette. Treat the exported array as read-only. */
|
|
19239
19258
|
var COLORS = [
|
|
19240
19259
|
"#3366cc",
|
|
19241
19260
|
"#dc3912",
|
|
@@ -23284,16 +23303,19 @@ var calloutConnectorPlugin = {
|
|
|
23284
23303
|
};
|
|
23285
23304
|
//#endregion
|
|
23286
23305
|
//#region src/components/line-chart/plugins/line-markers-plugin/types.ts
|
|
23306
|
+
/** Left/right attachment side for line markers. */
|
|
23287
23307
|
var LineMarkerSide = /* @__PURE__ */ function(LineMarkerSide) {
|
|
23288
23308
|
LineMarkerSide["Left"] = "left";
|
|
23289
23309
|
LineMarkerSide["Right"] = "right";
|
|
23290
23310
|
return LineMarkerSide;
|
|
23291
23311
|
}({});
|
|
23312
|
+
/** Orientation of a line marker. */
|
|
23292
23313
|
var LineMarkerDirection = /* @__PURE__ */ function(LineMarkerDirection) {
|
|
23293
23314
|
LineMarkerDirection["Vertical"] = "vertical";
|
|
23294
23315
|
LineMarkerDirection["Horizontal"] = "horizontal";
|
|
23295
23316
|
return LineMarkerDirection;
|
|
23296
23317
|
}({});
|
|
23318
|
+
/** Label placement relative to a line marker. */
|
|
23297
23319
|
var LineMarkerLabelPosition = /* @__PURE__ */ function(LineMarkerLabelPosition) {
|
|
23298
23320
|
LineMarkerLabelPosition["Left"] = "left";
|
|
23299
23321
|
LineMarkerLabelPosition["Right"] = "right";
|
|
@@ -23302,6 +23324,7 @@ var LineMarkerLabelPosition = /* @__PURE__ */ function(LineMarkerLabelPosition)
|
|
|
23302
23324
|
LineMarkerLabelPosition["OnLine"] = "onLine";
|
|
23303
23325
|
return LineMarkerLabelPosition;
|
|
23304
23326
|
}({});
|
|
23327
|
+
/** Horizontal alignment of marker label text. */
|
|
23305
23328
|
var LineMarkerTextAlign = /* @__PURE__ */ function(LineMarkerTextAlign) {
|
|
23306
23329
|
LineMarkerTextAlign["Left"] = "left";
|
|
23307
23330
|
LineMarkerTextAlign["Right"] = "right";
|
|
@@ -24679,6 +24702,44 @@ var LineChart = (props) => {
|
|
|
24679
24702
|
})]
|
|
24680
24703
|
}, getChartKey(state, languageKey));
|
|
24681
24704
|
};
|
|
24705
|
+
/**
|
|
24706
|
+
* Renders an interactive line chart with multiple axes, annotations, a legend and chart controls.
|
|
24707
|
+
*
|
|
24708
|
+
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
24709
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
24710
|
+
*
|
|
24711
|
+
* @remarks
|
|
24712
|
+
* Defaults: bottom X axis, left Y axis, visible lines and points, bottom-left legend, and zoom enabled.
|
|
24713
|
+
* Pan, data labels, minor grid lines and annotations are disabled. No fixed width or height is assigned.
|
|
24714
|
+
* Performance mode is enabled by default, disabling animations.
|
|
24715
|
+
* The linked reference lists the complete normalized default configuration.
|
|
24716
|
+
*
|
|
24717
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#linechart
|
|
24718
|
+
*
|
|
24719
|
+
* @param props - Chart data and options, plus optional header, subheader and table content.
|
|
24720
|
+
* @returns The chart canvas and its associated UI.
|
|
24721
|
+
* @example
|
|
24722
|
+
* ```tsx
|
|
24723
|
+
* <LineChart chart={{
|
|
24724
|
+
* data: {
|
|
24725
|
+
* datasets: [{
|
|
24726
|
+
* label: 'DS A',
|
|
24727
|
+
* data: [{ x: 0, y: 10 }, { x: 1, y: 20 }, { x: 2, y: 15 }],
|
|
24728
|
+
* }],
|
|
24729
|
+
* },
|
|
24730
|
+
* options: {
|
|
24731
|
+
* axes: {
|
|
24732
|
+
* x: [{ label: 'X', position: 'bottom' }],
|
|
24733
|
+
* y: [{ label: 'Y', position: 'left' }],
|
|
24734
|
+
* },
|
|
24735
|
+
* chartStyling: { height: 320 },
|
|
24736
|
+
* legend: { display: true, position: 'bottom-left' },
|
|
24737
|
+
* graph: { lineTension: 0.01, showDataLabels: false },
|
|
24738
|
+
* chartOptions: { showLine: true, showPoints: true },
|
|
24739
|
+
* },
|
|
24740
|
+
* }} />
|
|
24741
|
+
* ```
|
|
24742
|
+
*/
|
|
24682
24743
|
var LineChartWithLegend = (props) => {
|
|
24683
24744
|
const { options, data: { datasets = [] } = {} } = getDefaultProps$3(props);
|
|
24684
24745
|
return /* @__PURE__ */ jsx(LegendProvider, {
|
|
@@ -24690,12 +24751,17 @@ var LineChartWithLegend = (props) => {
|
|
|
24690
24751
|
//#endregion
|
|
24691
24752
|
//#region src/components/line-chart/initialize/initialize-line-chart.ts
|
|
24692
24753
|
/**
|
|
24693
|
-
*
|
|
24694
|
-
*
|
|
24695
|
-
*
|
|
24696
|
-
*
|
|
24697
|
-
*
|
|
24698
|
-
*
|
|
24754
|
+
* Updates the shared chart configuration, including the language and translated control labels.
|
|
24755
|
+
*
|
|
24756
|
+
* Call during application setup before rendering charts. Configuration is shared across chart instances;
|
|
24757
|
+
* this is not a per-chart configuration API. Each call sets the language key (default `en`) and updates
|
|
24758
|
+
* the supplied configuration entries. Non-primitive entries other than translations are shallow-copied.
|
|
24759
|
+
*
|
|
24760
|
+
* @param options - Language key, translations and other shared configuration entries.
|
|
24761
|
+
* @example
|
|
24762
|
+
* ```ts
|
|
24763
|
+
* initializeLineChart({ languageKey: 'en' });
|
|
24764
|
+
* ```
|
|
24699
24765
|
*/
|
|
24700
24766
|
var initializeLineChart = ({ languageKey = "en", ...options }) => {
|
|
24701
24767
|
setConfig(INIT_KEYS.LANGUAGE_KEY, languageKey);
|
|
@@ -24925,11 +24991,6 @@ var usePieChartConfig = (chart) => {
|
|
|
24925
24991
|
//#endregion
|
|
24926
24992
|
//#region src/components/pie-chart/pie-chart.tsx
|
|
24927
24993
|
Chart$1.register(LinearScale, CategoryScale, LogarithmicScale, ArcElement, plugin_legend, plugin_tooltip, plugin_title, index, plugin$1, plugin);
|
|
24928
|
-
/**
|
|
24929
|
-
* this is a pie chart component
|
|
24930
|
-
* @param {props: IPieChartProps} IPieChartProps
|
|
24931
|
-
* ./pie-chart.interface
|
|
24932
|
-
*/
|
|
24933
24994
|
var PieChart = (props) => {
|
|
24934
24995
|
setDefaultTheme();
|
|
24935
24996
|
const chart = getDefaultProps$2(props);
|
|
@@ -24971,6 +25032,41 @@ var PieChart = (props) => {
|
|
|
24971
25032
|
})
|
|
24972
25033
|
});
|
|
24973
25034
|
};
|
|
25035
|
+
/**
|
|
25036
|
+
* Renders pie segments with optional data labels, a legend and an inner cutout.
|
|
25037
|
+
*
|
|
25038
|
+
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
25039
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
25040
|
+
*
|
|
25041
|
+
* @remarks
|
|
25042
|
+
* Defaults: a full pie (cutout 0), a bottom legend, and no fixed width or height.
|
|
25043
|
+
* Data labels, stacking, zoom and pan are disabled. Pie charts do not have Cartesian axes.
|
|
25044
|
+
* Performance mode is enabled by default, disabling animations.
|
|
25045
|
+
* The linked reference lists the complete normalized default configuration.
|
|
25046
|
+
*
|
|
25047
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#piechart
|
|
25048
|
+
*
|
|
25049
|
+
* @param props - Chart data and options.
|
|
25050
|
+
* @returns The chart canvas and its associated UI.
|
|
25051
|
+
* @example
|
|
25052
|
+
* ```tsx
|
|
25053
|
+
* <PieChart chart={{
|
|
25054
|
+
* data: {
|
|
25055
|
+
* labels: ['A', 'B', 'C'],
|
|
25056
|
+
* datasets: [{
|
|
25057
|
+
* label: 'DS A',
|
|
25058
|
+
* data: [10, 20, 15],
|
|
25059
|
+
* backgroundColor: ['#3366cc', '#dc3912', '#ff9900'],
|
|
25060
|
+
* }],
|
|
25061
|
+
* },
|
|
25062
|
+
* options: {
|
|
25063
|
+
* chartStyling: { height: 320 },
|
|
25064
|
+
* legend: { display: true, position: 'bottom' },
|
|
25065
|
+
* graph: { cutout: 0, showDataLabels: false },
|
|
25066
|
+
* },
|
|
25067
|
+
* }} />
|
|
25068
|
+
* ```
|
|
25069
|
+
*/
|
|
24974
25070
|
var PieChartWithLegend = (props) => {
|
|
24975
25071
|
const { options } = getDefaultProps$2(props);
|
|
24976
25072
|
return /* @__PURE__ */ jsx(LegendProvider, {
|
|
@@ -39328,6 +39424,45 @@ var BarChart = (props) => {
|
|
|
39328
39424
|
})]
|
|
39329
39425
|
}, languageKey);
|
|
39330
39426
|
};
|
|
39427
|
+
/**
|
|
39428
|
+
* Renders vertical or horizontal bars with optional stacking, annotations and a legend.
|
|
39429
|
+
*
|
|
39430
|
+
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
39431
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
39432
|
+
*
|
|
39433
|
+
* @remarks
|
|
39434
|
+
* Defaults: vertical bars, a top-left legend, zero included in automatic scale bounds, and annotations enabled.
|
|
39435
|
+
* Zoom, pan, stacking and data labels are disabled. No fixed width or height is assigned.
|
|
39436
|
+
* Performance mode is enabled by default, disabling animations.
|
|
39437
|
+
* The linked reference lists the complete normalized default configuration.
|
|
39438
|
+
*
|
|
39439
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#barchart
|
|
39440
|
+
*
|
|
39441
|
+
* @param props - Chart data and options.
|
|
39442
|
+
* @returns The chart canvas and its associated UI.
|
|
39443
|
+
* @example
|
|
39444
|
+
* ```tsx
|
|
39445
|
+
* <BarChart chart={{
|
|
39446
|
+
* data: {
|
|
39447
|
+
* labels: ['A', 'B', 'C'],
|
|
39448
|
+
* datasets: [{
|
|
39449
|
+
* label: 'DS A',
|
|
39450
|
+
* data: [{ x: 'A', y: 10 }, { x: 'B', y: 20 }, { x: 'C', y: 15 }],
|
|
39451
|
+
* }],
|
|
39452
|
+
* },
|
|
39453
|
+
* options: {
|
|
39454
|
+
* direction: 'vertical',
|
|
39455
|
+
* axes: {
|
|
39456
|
+
* x: [{ label: 'Category', position: 'bottom' }],
|
|
39457
|
+
* y: [{ label: 'Value', position: 'left' }],
|
|
39458
|
+
* },
|
|
39459
|
+
* chartStyling: { height: 320 },
|
|
39460
|
+
* legend: { display: true, position: 'top-left' },
|
|
39461
|
+
* graph: { showDataLabels: false },
|
|
39462
|
+
* },
|
|
39463
|
+
* }} />
|
|
39464
|
+
* ```
|
|
39465
|
+
*/
|
|
39331
39466
|
var BarChartWithLegend = (props) => {
|
|
39332
39467
|
const { options } = getDefaultProps$1(props);
|
|
39333
39468
|
return /* @__PURE__ */ jsx(LegendProvider, {
|
|
@@ -39726,6 +39861,43 @@ var ScatterChart = (props) => {
|
|
|
39726
39861
|
})
|
|
39727
39862
|
});
|
|
39728
39863
|
};
|
|
39864
|
+
/**
|
|
39865
|
+
* Renders Cartesian points with a legend, optional annotations and a background gradient.
|
|
39866
|
+
*
|
|
39867
|
+
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
39868
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
39869
|
+
*
|
|
39870
|
+
* @remarks
|
|
39871
|
+
* Defaults: automatic width and height, a bottom-left legend, zero included in automatic scale bounds,
|
|
39872
|
+
* and annotations enabled. Zoom, pan, data labels, minor grid lines and the background gradient are disabled.
|
|
39873
|
+
* Performance mode is enabled by default, disabling animations.
|
|
39874
|
+
* The linked reference lists the complete normalized default configuration.
|
|
39875
|
+
*
|
|
39876
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#scatterchart
|
|
39877
|
+
*
|
|
39878
|
+
* @param props - Chart data and options.
|
|
39879
|
+
* @returns The chart canvas and its associated UI.
|
|
39880
|
+
* @example
|
|
39881
|
+
* ```tsx
|
|
39882
|
+
* <ScatterChart chart={{
|
|
39883
|
+
* data: {
|
|
39884
|
+
* datasets: [{
|
|
39885
|
+
* label: 'DS A',
|
|
39886
|
+
* data: [{ x: 1, y: 10 }, { x: 2, y: 20 }, { x: 3, y: 15 }],
|
|
39887
|
+
* }],
|
|
39888
|
+
* },
|
|
39889
|
+
* options: {
|
|
39890
|
+
* axes: {
|
|
39891
|
+
* x: [{ label: 'X', position: 'bottom' }],
|
|
39892
|
+
* y: [{ label: 'Y', position: 'left' }],
|
|
39893
|
+
* },
|
|
39894
|
+
* chartStyling: { height: 320 },
|
|
39895
|
+
* legend: { display: true, position: 'bottom-left' },
|
|
39896
|
+
* graph: { showDataLabels: false, showMinorGridlines: false },
|
|
39897
|
+
* },
|
|
39898
|
+
* }} />
|
|
39899
|
+
* ```
|
|
39900
|
+
*/
|
|
39729
39901
|
var ScatterChartWithLegend = (props) => {
|
|
39730
39902
|
const { options } = getDefaultProps(props);
|
|
39731
39903
|
return /* @__PURE__ */ jsx(LegendProvider, {
|
|
@@ -39737,6 +39909,17 @@ var ScatterChartWithLegend = (props) => {
|
|
|
39737
39909
|
//#region src/components/common/helpers/get-grouped-color-scheme/get-grouped-color-scheme.ts
|
|
39738
39910
|
extend([lchPlugin]);
|
|
39739
39911
|
var MIN_LIGHTNESS = 15;
|
|
39912
|
+
/**
|
|
39913
|
+
* Builds a darkest-first palette by varying LCH lightness while retaining the starting hue and chroma.
|
|
39914
|
+
*
|
|
39915
|
+
* @param length - Requested number of colours. Use a non-negative integer; zero returns an empty array.
|
|
39916
|
+
* @param startingColor - Colour understood by colord. A length of one returns this string unchanged.
|
|
39917
|
+
* @returns CSS LCH colour strings, except for the unchanged single-colour case.
|
|
39918
|
+
* @example
|
|
39919
|
+
* ```ts
|
|
39920
|
+
* const colors = getGroupedColorScheme(3, '#3366cc');
|
|
39921
|
+
* ```
|
|
39922
|
+
*/
|
|
39740
39923
|
var getGroupedColorScheme = (length, startingColor) => {
|
|
39741
39924
|
if (length === 1) return [startingColor];
|
|
39742
39925
|
const { h: hue, c: chroma } = colord(startingColor).toLch();
|
package/package.json
CHANGED