@banyan_cloud/roots 1.0.346 → 1.0.347

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/cjs/index.js CHANGED
@@ -25896,8 +25896,13 @@ var BaseVerticalBarChart = function BaseVerticalBarChart(_ref) {
25896
25896
  barColor2 = _ref.barColor2,
25897
25897
  xAxisTitle = _ref.xAxisTitle,
25898
25898
  yAxisTitle = _ref.yAxisTitle,
25899
- dataLabels = _ref.dataLabels,
25900
- tooltip = _ref.tooltip;
25899
+ tooltip = _ref.tooltip,
25900
+ legends = _ref.legends,
25901
+ chartOptions = _ref.chartOptions,
25902
+ chartDatasets = _ref.chartDatasets,
25903
+ xAxis = _ref.xAxis,
25904
+ yAxis = _ref.yAxis,
25905
+ styles = _ref.styles;
25901
25906
  if (loading) {
25902
25907
  return /*#__PURE__*/jsxRuntime.jsx(ChartSkeleton$1, {});
25903
25908
  }
@@ -25910,22 +25915,21 @@ var BaseVerticalBarChart = function BaseVerticalBarChart(_ref) {
25910
25915
  return seriesData.chartData[label][key] !== undefined;
25911
25916
  });
25912
25917
  }).map(function (key) {
25913
- return {
25918
+ return _objectSpread2({
25914
25919
  label: seriesData.metaData.keyData[key],
25915
25920
  backgroundColor: key === 'x1' ? barColor1 !== null && barColor1 !== void 0 ? barColor1 : COLORS.success : key === 'x2' ? barColor2 !== null && barColor2 !== void 0 ? barColor2 : COLORS.error : COLORS.warning,
25916
25921
  data: labels.map(function (label) {
25917
- // Only include data if it's defined
25918
25922
  return seriesData.chartData[label][key] !== undefined ? seriesData.chartData[label][key] : null;
25919
25923
  }),
25920
25924
  borderRadius: borderRadius,
25921
25925
  barThickness: barThickness
25922
- };
25926
+ }, chartDatasets);
25923
25927
  });
25924
25928
  var options = {
25925
25929
  responsive: true,
25926
25930
  maintainAspectRatio: false,
25927
25931
  // To allow custom height and width
25928
- plugins: {
25932
+ plugins: _objectSpread2({
25929
25933
  title: {
25930
25934
  display: true,
25931
25935
  font: {
@@ -25937,7 +25941,7 @@ var BaseVerticalBarChart = function BaseVerticalBarChart(_ref) {
25937
25941
  left: (title === null || title === void 0 ? void 0 : title.left) || 0
25938
25942
  }
25939
25943
  },
25940
- tooltip: _objectSpread2(_objectSpread2({}, tooltip), {}, {
25944
+ tooltip: _objectSpread2({
25941
25945
  borderWidth: (_tooltip$borderWidth = tooltip === null || tooltip === void 0 ? void 0 : tooltip.borderWidth) !== null && _tooltip$borderWidth !== void 0 ? _tooltip$borderWidth : 1,
25942
25946
  borderColor: (_tooltip$borderColor = tooltip === null || tooltip === void 0 ? void 0 : tooltip.borderColor) !== null && _tooltip$borderColor !== void 0 ? _tooltip$borderColor : COLORS.success,
25943
25947
  backgroundColor: 'rgba(255, 255, 255, 1)',
@@ -25956,7 +25960,7 @@ var BaseVerticalBarChart = function BaseVerticalBarChart(_ref) {
25956
25960
  label: function label(tooltipItem) {
25957
25961
  var _seriesData$metaData$;
25958
25962
  var label = (_seriesData$metaData$ = seriesData.metaData.controlsApplied[tooltipItem.label]) === null || _seriesData$metaData$ === void 0 ? void 0 : _seriesData$metaData$.x1;
25959
- return "".concat(tooltipItem.dataset.label, ": ").concat(label);
25963
+ return "".concat(tooltipItem.label, ": ").concat(label);
25960
25964
  },
25961
25965
  title: tooltip.displayTitle ? function (tooltipItems) {
25962
25966
  var _tooltipItems$;
@@ -25965,12 +25969,12 @@ var BaseVerticalBarChart = function BaseVerticalBarChart(_ref) {
25965
25969
  return '';
25966
25970
  }
25967
25971
  }
25968
- }),
25969
- legend: {
25972
+ }, tooltip),
25973
+ legend: _objectSpread2({
25970
25974
  display: false
25971
- },
25975
+ }, legends),
25972
25976
  // Enable the datalabels plugin
25973
- datalabels: _objectSpread2(_objectSpread2({}, dataLabels), {}, {
25977
+ datalabels: {
25974
25978
  anchor: 'end',
25975
25979
  align: 'top',
25976
25980
  // Align the labels above the bars
@@ -25985,10 +25989,10 @@ var BaseVerticalBarChart = function BaseVerticalBarChart(_ref) {
25985
25989
  formatter: function formatter(value, context) {
25986
25990
  return context.chart.data.labels[context.dataIndex];
25987
25991
  }
25988
- })
25989
- },
25992
+ }
25993
+ }, chartOptions),
25990
25994
  scales: {
25991
- x: {
25995
+ x: _objectSpread2({
25992
25996
  grid: {
25993
25997
  display: (gridOptions === null || gridOptions === void 0 ? void 0 : gridOptions.gridContainLabel) || true,
25994
25998
  color: 'rgba(255, 255, 255, 0.2)'
@@ -26011,8 +26015,8 @@ var BaseVerticalBarChart = function BaseVerticalBarChart(_ref) {
26011
26015
  family: 'Poppins'
26012
26016
  }
26013
26017
  }
26014
- },
26015
- y: {
26018
+ }, xAxis),
26019
+ y: _objectSpread2({
26016
26020
  grid: {
26017
26021
  display: true,
26018
26022
  color: 'rgba(255, 255, 255, 0.2)'
@@ -26032,15 +26036,15 @@ var BaseVerticalBarChart = function BaseVerticalBarChart(_ref) {
26032
26036
  family: 'Poppins'
26033
26037
  }
26034
26038
  }
26035
- }
26039
+ }, yAxis)
26036
26040
  }
26037
26041
  };
26038
26042
  return /*#__PURE__*/jsxRuntime.jsx("div", {
26039
- style: {
26043
+ style: _objectSpread2({
26040
26044
  width: width || '100%',
26041
26045
  // Default to full width if not provided
26042
- height: height || '100%' // Default to full height if not provided
26043
- },
26046
+ height: height || '100%'
26047
+ }, styles),
26044
26048
  children: /*#__PURE__*/jsxRuntime.jsx(reactChartjs2.Bar, {
26045
26049
  data: {
26046
26050
  labels: labels,