@oliasoft-open-source/charts-library 5.9.0-beta-12 → 5.9.0-beta-13

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 CHANGED
@@ -656,7 +656,7 @@ export declare interface ILineChartDataInput extends Omit<ILineChartData, 'data'
656
656
  lineHeight?: number;
657
657
  data?: Array<DeepPartial<ICommonDataValue> | null>;
658
658
  [key: string]: unknown;
659
- }) | object | null>;
659
+ }) | object | null> | object;
660
660
  };
661
661
  options?: ILineChartOptionsInput;
662
662
  }
@@ -726,9 +726,9 @@ export declare type ILineChartOptionsInput = Omit<DeepPartial<ILineChartOptions>
726
726
  tooltip?: unknown;
727
727
  [key: string]: unknown;
728
728
  };
729
- annotations?: (DeepPartial<ICommonAnnotations> & {
729
+ annotations?: (Omit<DeepPartial<ICommonAnnotations>, 'annotationsData'> & {
730
730
  annotationsData?: ILooseLineAnnotation[];
731
- }) | null;
731
+ }) | ILooseLineAnnotation[] | null;
732
732
  additionalAxesOptions?: DeepPartial<ILineChartAdditionalAxesOptions> & {
733
733
  range?: ILineRange | ILineChartRange | Record<string, ILineChartRange | undefined>;
734
734
  } & Record<string, unknown>;
@@ -802,6 +802,7 @@ declare type ILooseLineAnnotation = DeepPartial<ICommonAnnotationsData> & {
802
802
 
803
803
  declare type ILooseLineAxis = DeepPartial<ILineChartAxis<string>> & {
804
804
  [key: string]: unknown;
805
+ stepSize?: unknown;
805
806
  };
806
807
 
807
808
  declare type ILooseScatterAnnotation = DeepPartial<ICommonAnnotationsData> & {
package/dist/index.js CHANGED
@@ -20171,36 +20171,43 @@ var defaultAnnotationsData$2 = (annotationsData) => {
20171
20171
  })) : [];
20172
20172
  };
20173
20173
  var defaultAnnotations$2 = (annotations) => ({
20174
- labelAnnotation: {
20175
- showLabel: annotations?.labelAnnotation?.showLabel ?? false,
20176
- text: annotations?.labelAnnotation?.text ?? "",
20177
- position: annotations?.labelAnnotation?.position ?? TextLabelPosition.BOTTOM_RIGHT,
20178
- fontSize: annotations?.labelAnnotation?.fontSize ?? 12,
20179
- xOffset: annotations?.labelAnnotation?.xOffset ?? 5,
20180
- yOffset: annotations?.labelAnnotation?.yOffset ?? 5,
20181
- maxWidth: annotations?.labelAnnotation?.maxWidth ?? 300,
20182
- lineHeight: annotations?.labelAnnotation?.lineHeight ?? 12
20183
- },
20184
- showAnnotations: annotations?.showAnnotations ?? false,
20185
- controlAnnotation: annotations?.controlAnnotation ?? false,
20186
- enableDragAnnotation: annotations?.enableDragAnnotation ?? false,
20187
- enableCalloutAnnotation: annotations?.enableCalloutAnnotation ?? false,
20188
- verticalMarkersAnnotation: {
20189
- enabled: annotations?.verticalMarkersAnnotation?.enabled ?? false,
20190
- itemGapPx: annotations?.verticalMarkersAnnotation?.itemGapPx ?? 4,
20191
- edgePaddingPx: annotations?.verticalMarkersAnnotation?.edgePaddingPx ?? 8,
20192
- stickToEdge: annotations?.verticalMarkersAnnotation?.stickToEdge ?? true,
20193
- stickSide: annotations?.verticalMarkersAnnotation?.stickSide ?? "right",
20194
- reverse: annotations?.verticalMarkersAnnotation?.reverse ?? false,
20195
- xValue: annotations?.verticalMarkersAnnotation?.xValue,
20196
- yStartValue: annotations?.verticalMarkersAnnotation?.yStartValue,
20197
- color: annotations?.verticalMarkersAnnotation?.color ?? "rgba(20,20,20,0.9)",
20198
- opacity: annotations?.verticalMarkersAnnotation?.opacity ?? 1,
20199
- lineWidth: annotations?.verticalMarkersAnnotation?.lineWidth ?? 1,
20200
- lineDash: annotations?.verticalMarkersAnnotation?.lineDash ?? [],
20201
- items: annotations?.verticalMarkersAnnotation?.items ?? []
20202
- },
20203
- annotationsData: defaultAnnotationsData$2(annotations?.annotationsData)
20174
+ ...!Array.isArray(annotations) ? annotations : {},
20175
+ ...Array.isArray(annotations) ? { annotationsData: annotations } : {},
20176
+ ...(() => {
20177
+ const annotationConfig = Array.isArray(annotations) ? void 0 : annotations;
20178
+ return {
20179
+ labelAnnotation: {
20180
+ showLabel: annotationConfig?.labelAnnotation?.showLabel ?? false,
20181
+ text: annotationConfig?.labelAnnotation?.text ?? "",
20182
+ position: annotationConfig?.labelAnnotation?.position ?? TextLabelPosition.BOTTOM_RIGHT,
20183
+ fontSize: annotationConfig?.labelAnnotation?.fontSize ?? 12,
20184
+ xOffset: annotationConfig?.labelAnnotation?.xOffset ?? 5,
20185
+ yOffset: annotationConfig?.labelAnnotation?.yOffset ?? 5,
20186
+ maxWidth: annotationConfig?.labelAnnotation?.maxWidth ?? 300,
20187
+ lineHeight: annotationConfig?.labelAnnotation?.lineHeight ?? 12
20188
+ },
20189
+ showAnnotations: annotationConfig?.showAnnotations ?? false,
20190
+ controlAnnotation: annotationConfig?.controlAnnotation ?? false,
20191
+ enableDragAnnotation: annotationConfig?.enableDragAnnotation ?? false,
20192
+ enableCalloutAnnotation: annotationConfig?.enableCalloutAnnotation ?? false,
20193
+ verticalMarkersAnnotation: {
20194
+ enabled: annotationConfig?.verticalMarkersAnnotation?.enabled ?? false,
20195
+ itemGapPx: annotationConfig?.verticalMarkersAnnotation?.itemGapPx ?? 4,
20196
+ edgePaddingPx: annotationConfig?.verticalMarkersAnnotation?.edgePaddingPx ?? 8,
20197
+ stickToEdge: annotationConfig?.verticalMarkersAnnotation?.stickToEdge ?? true,
20198
+ stickSide: annotationConfig?.verticalMarkersAnnotation?.stickSide ?? "right",
20199
+ reverse: annotationConfig?.verticalMarkersAnnotation?.reverse ?? false,
20200
+ xValue: annotationConfig?.verticalMarkersAnnotation?.xValue,
20201
+ yStartValue: annotationConfig?.verticalMarkersAnnotation?.yStartValue,
20202
+ color: annotationConfig?.verticalMarkersAnnotation?.color ?? "rgba(20,20,20,0.9)",
20203
+ opacity: annotationConfig?.verticalMarkersAnnotation?.opacity ?? 1,
20204
+ lineWidth: annotationConfig?.verticalMarkersAnnotation?.lineWidth ?? 1,
20205
+ lineDash: annotationConfig?.verticalMarkersAnnotation?.lineDash ?? [],
20206
+ items: annotationConfig?.verticalMarkersAnnotation?.items ?? []
20207
+ },
20208
+ annotationsData: defaultAnnotationsData$2(Array.isArray(annotations) ? annotations : annotations?.annotationsData)
20209
+ };
20210
+ })()
20204
20211
  });
20205
20212
  var defaultLegend$3 = (legend) => ({
20206
20213
  display: legend?.display ?? true,
@@ -20254,7 +20261,7 @@ var normalizeLineChartOptions = (options = {}) => ({
20254
20261
  dragData: defaultDragData$1(options?.dragData),
20255
20262
  depthType: options?.depthType ?? {}
20256
20263
  });
20257
- var normalizeLineDatasets = (datasets) => (datasets ?? []).map((dataset) => {
20264
+ var normalizeLineDatasets = (datasets) => (Array.isArray(datasets) ? datasets : []).map((dataset) => {
20258
20265
  const normalizedDataset = dataset && typeof dataset === "object" ? dataset : {};
20259
20266
  return {
20260
20267
  ...normalizedDataset,
@@ -37503,7 +37510,7 @@ var normalizeBarOptions = (options = {}) => ({
37503
37510
  interactions: defaultInteractions$1(options?.interactions),
37504
37511
  dragData: defaultDragData(options?.dragData)
37505
37512
  });
37506
- var normalizeBarDatasets = (datasets) => (datasets ?? []).map((dataset) => {
37513
+ var normalizeBarDatasets = (datasets) => (Array.isArray(datasets) ? datasets : []).map((dataset) => {
37507
37514
  const normalizedDataset = dataset && typeof dataset === "object" ? dataset : {};
37508
37515
  return {
37509
37516
  ...normalizedDataset,
@@ -37802,7 +37809,7 @@ var defaultInteractions = (interactions) => ({
37802
37809
  });
37803
37810
  var defaultChartData = (data) => ({
37804
37811
  labels: data?.labels ?? [],
37805
- datasets: (data?.datasets ?? []).map((dataset) => {
37812
+ datasets: (Array.isArray(data?.datasets) ? data.datasets : []).map((dataset) => {
37806
37813
  const normalizedDataset = dataset && typeof dataset === "object" ? dataset : {};
37807
37814
  return {
37808
37815
  ...normalizedDataset,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/charts-library",
3
- "version": "5.9.0-beta-12",
3
+ "version": "5.9.0-beta-13",
4
4
  "description": "React Chart Library (based on Chart.js and react-chart-js-2)",
5
5
  "homepage": "https://gitlab.com/oliasoft-open-source/charts-library",
6
6
  "bugs": {