@oliasoft-open-source/charts-library 3.5.4-beta-1 → 3.5.4-beta-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/dist/index.js CHANGED
@@ -24544,122 +24544,116 @@ const TextLabelPosition = {
24544
24544
  BOTTOM_CENTER: "bottom-center",
24545
24545
  BOTTOM_RIGHT: "bottom-right"
24546
24546
  };
24547
- const defaultAxes$1 = (axes) => ({
24548
- x: (axes == null ? void 0 : axes.x) || [{}],
24549
- y: (axes == null ? void 0 : axes.y) || [{}]
24550
- });
24551
- const defaultAdditionalAxesOptions$1 = (options) => ({
24552
- chartScaleType: (options == null ? void 0 : options.chartScaleType) || "linear",
24553
- reverse: (options == null ? void 0 : options.reverse) || false,
24554
- beginAtZero: (options == null ? void 0 : options.beginAtZero) ?? false,
24555
- stepSize: options == null ? void 0 : options.stepSize,
24556
- suggestedMin: options == null ? void 0 : options.suggestedMin,
24557
- suggestedMax: options == null ? void 0 : options.suggestedMax,
24558
- range: options == null ? void 0 : options.range,
24559
- autoAxisPadding: (options == null ? void 0 : options.autoAxisPadding) ?? false
24560
- });
24561
- const defaultChartStyling$2 = (options) => ({
24562
- width: options == null ? void 0 : options.width,
24563
- height: options == null ? void 0 : options.height,
24564
- maintainAspectRatio: (options == null ? void 0 : options.maintainAspectRatio) ?? false,
24565
- staticChartHeight: (options == null ? void 0 : options.staticChartHeight) ?? false,
24566
- performanceMode: (options == null ? void 0 : options.performanceMode) ?? true,
24567
- squareAspectRatio: options == null ? void 0 : options.squareAspectRatio,
24568
- layoutPadding: (options == null ? void 0 : options.layoutPadding) || {
24569
- top: 0,
24570
- bottom: 20,
24571
- left: 0,
24572
- right: 0
24573
- }
24574
- });
24575
- const defaultTooltip$2 = (tooltip) => ({
24576
- tooltips: (tooltip == null ? void 0 : tooltip.tooltips) ?? true,
24577
- showLabelsInTooltips: (tooltip == null ? void 0 : tooltip.showLabelsInTooltips) ?? false,
24578
- hideSimulationName: (tooltip == null ? void 0 : tooltip.hideSimulationName) ?? false
24579
- });
24580
- const defaultGraph$2 = (graph) => ({
24581
- lineTension: (graph == null ? void 0 : graph.lineTension) ?? 0.01,
24582
- spanGaps: (graph == null ? void 0 : graph.spanGaps) ?? false,
24583
- showDataLabels: (graph == null ? void 0 : graph.showDataLabels) ?? false,
24584
- showMinorGridlines: (graph == null ? void 0 : graph.showMinorGridlines) ?? false
24585
- });
24586
- const defaultAnnotations$1 = (annotations) => {
24587
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
24588
- return {
24589
- labelAnnotation: {
24590
- showLabel: ((_a2 = annotations == null ? void 0 : annotations.labelAnnotation) == null ? void 0 : _a2.showLabel) ?? false,
24591
- text: ((_b2 = annotations == null ? void 0 : annotations.labelAnnotation) == null ? void 0 : _b2.text) ?? "",
24592
- position: ((_c2 = annotations == null ? void 0 : annotations.labelAnnotation) == null ? void 0 : _c2.position) ?? TextLabelPosition.BOTTOM_RIGHT,
24593
- fontSize: ((_d2 = annotations == null ? void 0 : annotations.labelAnnotation) == null ? void 0 : _d2.fontSize) ?? 12,
24594
- xOffset: ((_e2 = annotations == null ? void 0 : annotations.labelAnnotation) == null ? void 0 : _e2.xOffset) ?? 5,
24595
- yOffset: ((_f2 = annotations == null ? void 0 : annotations.labelAnnotation) == null ? void 0 : _f2.yOffset) ?? 5,
24596
- maxWidth: ((_g2 = annotations == null ? void 0 : annotations.labelAnnotation) == null ? void 0 : _g2.maxWidth) ?? 300,
24597
- lineHeight: ((_h2 = annotations == null ? void 0 : annotations.labelAnnotation) == null ? void 0 : _h2.lineHeight) ?? 12
24598
- },
24599
- showAnnotations: (annotations == null ? void 0 : annotations.showAnnotations) ?? false,
24600
- controlAnnotation: (annotations == null ? void 0 : annotations.controlAnnotation) ?? false,
24601
- annotationsData: (annotations == null ? void 0 : annotations.annotationsData) ?? []
24602
- };
24603
- };
24604
- const defaultLegend$2 = (legend2) => ({
24605
- display: (legend2 == null ? void 0 : legend2.display) ?? true,
24606
- position: (legend2 == null ? void 0 : legend2.position) ?? Position.BottomLeft,
24607
- align: (legend2 == null ? void 0 : legend2.align) ?? AlignOptions.Center,
24608
- customLegend: (legend2 == null ? void 0 : legend2.customLegend) ?? {
24609
- customLegendPlugin: null,
24610
- customLegendContainerID: ""
24611
- },
24612
- usePointStyle: (legend2 == null ? void 0 : legend2.usePointStyle) ?? true
24613
- });
24614
- const defaultChartOptions$2 = (options) => ({
24615
- showPoints: (options == null ? void 0 : options.showPoints) ?? true,
24616
- enableZoom: (options == null ? void 0 : options.enableZoom) ?? true,
24617
- enablePan: (options == null ? void 0 : options.enablePan) ?? false,
24618
- showLine: (options == null ? void 0 : options.showLine) ?? true,
24619
- closeOnOutsideClick: (options == null ? void 0 : options.closeOnOutsideClick) ?? false
24620
- });
24621
- const defaultInteractions$2 = (interactions) => ({
24622
- onLegendClick: interactions == null ? void 0 : interactions.onLegendClick,
24623
- onHover: interactions == null ? void 0 : interactions.onHover,
24624
- onUnhover: interactions == null ? void 0 : interactions.onUnhover,
24625
- onAnimationComplete: interactions == null ? void 0 : interactions.onAnimationComplete
24626
- });
24627
- const defaultDragData$1 = (dragData) => ({
24628
- enableDragData: (dragData == null ? void 0 : dragData.enableDragData) ?? false,
24629
- showTooltip: (dragData == null ? void 0 : dragData.showTooltip) ?? true,
24630
- roundPoints: (dragData == null ? void 0 : dragData.roundPoints) ?? true,
24631
- dragX: (dragData == null ? void 0 : dragData.dragX) ?? true,
24632
- dragY: (dragData == null ? void 0 : dragData.dragY) ?? true,
24633
- onDragStart: dragData == null ? void 0 : dragData.onDragStart,
24634
- onDrag: dragData == null ? void 0 : dragData.onDrag,
24635
- onDragEnd: dragData == null ? void 0 : dragData.onDragEnd
24636
- });
24637
24547
  const getDefaultProps$2 = (props) => {
24638
- const chart2 = (props == null ? void 0 : props.chart) || {};
24639
- const options = (chart2 == null ? void 0 : chart2.options) || {};
24640
- return {
24641
- persistenceId: (chart2 == null ? void 0 : chart2.persistenceId) ?? "",
24642
- controlsPortalId: (chart2 == null ? void 0 : chart2.controlsPortalId) ?? "",
24643
- testId: (chart2 == null ? void 0 : chart2.testId) ?? null,
24644
- data: chart2 == null ? void 0 : chart2.data,
24548
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2;
24549
+ props.chart.options = props.chart.options || {};
24550
+ props.chart.options.axes = props.chart.options.axes || {};
24551
+ props.chart.options.additionalAxesOptions = props.chart.options.additionalAxesOptions || {};
24552
+ props.chart.options.chartStyling = props.chart.options.chartStyling || {};
24553
+ props.chart.options.tooltip = props.chart.options.tooltip || {};
24554
+ props.chart.options.graph = props.chart.options.graph || {};
24555
+ props.chart.options.annotations = props.chart.options.annotations || {};
24556
+ props.chart.options.legend = props.chart.options.legend || {};
24557
+ props.chart.options.legend.customLegend = props.chart.options.legend.customLegend || { customLegendPlugin: null, customLegendContainerID: "" };
24558
+ props.chart.options.chartOptions = props.chart.options.chartOptions || {};
24559
+ props.chart.options.interactions = props.chart.options.interactions || {};
24560
+ props.chart.options.dragData = props.chart.options.dragData || {};
24561
+ const chart2 = {
24562
+ persistenceId: props.chart.persistenceId ?? "",
24563
+ controlsPortalId: props.chart.controlsPortalId ?? null,
24564
+ testId: props.chart.testId ?? null,
24565
+ data: props.chart.data,
24645
24566
  options: {
24646
- title: (options == null ? void 0 : options.title) ?? "",
24647
- scales: (options == null ? void 0 : options.scales) ?? {},
24648
- axes: defaultAxes$1(options == null ? void 0 : options.axes),
24649
- additionalAxesOptions: defaultAdditionalAxesOptions$1(
24650
- options == null ? void 0 : options.additionalAxesOptions
24651
- ),
24652
- chartStyling: defaultChartStyling$2(options == null ? void 0 : options.chartStyling),
24653
- tooltip: defaultTooltip$2(options == null ? void 0 : options.tooltip),
24654
- graph: defaultGraph$2(options == null ? void 0 : options.graph),
24655
- annotations: defaultAnnotations$1(options == null ? void 0 : options.annotations),
24656
- legend: defaultLegend$2(options == null ? void 0 : options.legend),
24657
- chartOptions: defaultChartOptions$2(options == null ? void 0 : options.chartOptions),
24658
- interactions: defaultInteractions$2(options == null ? void 0 : options.interactions),
24659
- dragData: defaultDragData$1(options == null ? void 0 : options.dragData),
24660
- depthType: (options == null ? void 0 : options.depthType) ?? {}
24567
+ title: props.chart.options.title || "",
24568
+ scales: props.chart.options.scales || {},
24569
+ axes: {
24570
+ x: props.chart.options.axes.x || [{}],
24571
+ y: props.chart.options.axes.y || [{}]
24572
+ },
24573
+ additionalAxesOptions: {
24574
+ chartScaleType: props.chart.options.additionalAxesOptions.chartScaleType || "linear",
24575
+ reverse: props.chart.options.additionalAxesOptions.reverse || false,
24576
+ beginAtZero: props.chart.options.additionalAxesOptions.beginAtZero || false,
24577
+ stepSize: props.chart.options.additionalAxesOptions.stepSize,
24578
+ suggestedMin: props.chart.options.additionalAxesOptions.suggestedMin,
24579
+ suggestedMax: props.chart.options.additionalAxesOptions.suggestedMax,
24580
+ range: props.chart.options.additionalAxesOptions.range,
24581
+ autoAxisPadding: props.chart.options.additionalAxesOptions.autoAxisPadding ?? false
24582
+ },
24583
+ chartStyling: {
24584
+ width: props.chart.options.chartStyling.width,
24585
+ height: props.chart.options.chartStyling.height,
24586
+ maintainAspectRatio: props.chart.options.chartStyling.maintainAspectRatio || false,
24587
+ staticChartHeight: props.chart.options.chartStyling.staticChartHeight || false,
24588
+ performanceMode: props.chart.options.chartStyling.performanceMode ?? true,
24589
+ squareAspectRatio: props.chart.options.chartStyling.squareAspectRatio || false,
24590
+ layoutPadding: props.chart.options.chartStyling.layoutPadding || {
24591
+ top: 0,
24592
+ bottom: 20,
24593
+ left: 0,
24594
+ right: 0
24595
+ }
24596
+ },
24597
+ tooltip: {
24598
+ tooltips: props.chart.options.tooltip.tooltips ?? true,
24599
+ showLabelsInTooltips: props.chart.options.tooltip.showLabelsInTooltips || false,
24600
+ hideSimulationName: props.chart.options.tooltip.hideSimulationName || false
24601
+ },
24602
+ graph: {
24603
+ lineTension: props.chart.options.graph.lineTension || 0.01,
24604
+ spanGaps: props.chart.options.graph.spanGaps || false,
24605
+ showDataLabels: props.chart.options.graph.showDataLabels || false,
24606
+ showMinorGridlines: props.chart.options.graph.showMinorGridlines || false
24607
+ },
24608
+ annotations: {
24609
+ labelAnnotation: {
24610
+ showLabel: ((_a2 = props.chart.options.annotations.labelAnnotation) == null ? void 0 : _a2.showLabel) ?? false,
24611
+ text: ((_b2 = props.chart.options.annotations.labelAnnotation) == null ? void 0 : _b2.text) ?? "",
24612
+ position: ((_c2 = props.chart.options.annotations.labelAnnotation) == null ? void 0 : _c2.position) ?? TextLabelPosition.BOTTOM_RIGHT,
24613
+ fontSize: ((_d2 = props.chart.options.annotations.labelAnnotation) == null ? void 0 : _d2.fontSize) ?? 12,
24614
+ xOffset: ((_e2 = props.chart.options.annotations.labelAnnotation) == null ? void 0 : _e2.xOffset) ?? 5,
24615
+ yOffset: ((_f2 = props.chart.options.annotations.labelAnnotation) == null ? void 0 : _f2.yOffset) ?? 5,
24616
+ maxWidth: ((_g2 = props.chart.options.annotations.labelAnnotation) == null ? void 0 : _g2.maxWidth) ?? 300,
24617
+ lineHeight: ((_h2 = props.chart.options.annotations.labelAnnotation) == null ? void 0 : _h2.lineHeight) ?? 12
24618
+ },
24619
+ showAnnotations: props.chart.options.annotations.showAnnotations ?? false,
24620
+ controlAnnotation: props.chart.options.annotations.controlAnnotation || false,
24621
+ annotationsData: props.chart.options.annotations.annotationsData || []
24622
+ },
24623
+ legend: {
24624
+ display: props.chart.options.legend.display ?? true,
24625
+ position: props.chart.options.legend.position || "bottom-left",
24626
+ align: props.chart.options.legend.align || "center",
24627
+ customLegend: props.chart.options.legend.customLegend,
24628
+ usePointStyle: props.chart.options.legend.usePointStyle ?? true
24629
+ },
24630
+ chartOptions: {
24631
+ showPoints: props.chart.options.chartOptions.showPoints ?? true,
24632
+ enableZoom: props.chart.options.chartOptions.enableZoom || true,
24633
+ enablePan: props.chart.options.chartOptions.enablePan || false,
24634
+ showLine: props.chart.options.chartOptions.showLine ?? true,
24635
+ closeOnOutsideClick: props.chart.options.chartOptions.closeOnOutsideClick || false
24636
+ },
24637
+ interactions: {
24638
+ onLegendClick: props.chart.options.interactions.onLegendClick,
24639
+ onPointHover: (_i2 = props.chart.options.interactions) == null ? void 0 : _i2.onPointHover,
24640
+ onPointUnhover: (_j2 = props.chart.options.interactions) == null ? void 0 : _j2.onPointUnhover,
24641
+ onAnimationComplete: props.chart.options.interactions.onAnimationComplete
24642
+ },
24643
+ depthType: props.chart.options.depthType,
24644
+ dragData: {
24645
+ enableDragData: props.chart.options.dragData.enableDragData ?? false,
24646
+ showTooltip: props.chart.options.dragData.showTooltip ?? true,
24647
+ roundPoints: props.chart.options.dragData.roundPoints ?? true,
24648
+ dragX: props.chart.options.dragData.dragX ?? true,
24649
+ dragY: props.chart.options.dragData.dragY ?? true,
24650
+ onDragStart: props.chart.options.dragData.onDragStart,
24651
+ onDrag: props.chart.options.dragData.onDrag,
24652
+ onDragEnd: props.chart.options.dragData.onDragEnd
24653
+ }
24661
24654
  }
24662
24655
  };
24656
+ return chart2;
24663
24657
  };
24664
24658
  const DEFAULT_POINT_RADIUS = 2;
24665
24659
  const DEFAULT_HOVER_RADIUS = 5;