@quillsql/react 2.13.10 → 2.13.12

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.
@@ -93,10 +93,10 @@ function BarChart({ colors, colorMap, yAxisFields, data, containerStyle, classNa
93
93
  fields: yAxisFields,
94
94
  });
95
95
  }, xAxisFormat: xAxisFormat, xAxisField: xAxisField, colors: colors, comparison: comparison, dateFilter: dateFilter }));
96
- }, position: { y: 0 } }), sortYAxisFields(yAxisFields).map((elem) => {
96
+ }, position: { y: 0 } }), sortYAxisFields(yAxisFields).map((elem, index) => {
97
97
  return ((0, jsx_runtime_1.jsx)(recharts_1.Bar, { name: elem.label, dataKey: elem.field, stackId: isStacked ? elem.field.replace('comparison_', '') : undefined, type: "linear", fill: getCustomColor(elem.field) ??
98
98
  (0, color_1.selectColor)(elem, colors.length >= yAxisFields.length / (comparison ? 2 : 1)
99
99
  ? colors
100
- : (0, color_1.generateArrayFromColor)(colors.slice(0, 2), yAxisFields.length), yAxisFields.findIndex((field) => field.field === elem.field?.replace('comparison_', ''))), isAnimationActive: isAnimationActive, onClick: onClickChartElement }, elem.field));
100
+ : (0, color_1.generateArrayFromColor)(colors.slice(0, 2), yAxisFields.length), yAxisFields.findIndex((field) => field.field === elem.field?.replace('comparison_', ''))), isAnimationActive: isAnimationActive, onClick: data && data.length && onClickChartElement ? () => onClickChartElement(data[index]) : undefined }, elem.field));
101
101
  })] }) }) }));
102
102
  }
@@ -183,6 +183,6 @@ function LineChart({ colors, colorMap = {}, yAxisFields, data, containerStyle, c
183
183
  return ((0, jsx_runtime_1.jsx)(recharts_1.Area, { name: elem.label, type: "linear", dataKey: elem.field, stroke: getCustomColor(index, elem.field) ??
184
184
  (0, color_1.selectColor)(elem, colors, index - numComparisons), fill: `url(#${uniqueId})`, strokeWidth: 2, dot: false, strokeDasharray: comparison && comparisonLineStyle === 'dashed' && index > 0
185
185
  ? '5 5'
186
- : undefined, isAnimationActive: isAnimationActive, onClick: onClickChartElement }, elem.field));
186
+ : undefined, isAnimationActive: isAnimationActive, onClick: data && data.length && onClickChartElement ? () => onClickChartElement(data[index]) : undefined }, elem.field));
187
187
  })] }) }) }));
188
188
  }
@@ -87,10 +87,10 @@ export default function BarChart({ colors, colorMap, yAxisFields, data, containe
87
87
  fields: yAxisFields,
88
88
  });
89
89
  }, xAxisFormat: xAxisFormat, xAxisField: xAxisField, colors: colors, comparison: comparison, dateFilter: dateFilter }));
90
- }, position: { y: 0 } }), sortYAxisFields(yAxisFields).map((elem) => {
90
+ }, position: { y: 0 } }), sortYAxisFields(yAxisFields).map((elem, index) => {
91
91
  return (_jsx(Bar, { name: elem.label, dataKey: elem.field, stackId: isStacked ? elem.field.replace('comparison_', '') : undefined, type: "linear", fill: getCustomColor(elem.field) ??
92
92
  selectColor(elem, colors.length >= yAxisFields.length / (comparison ? 2 : 1)
93
93
  ? colors
94
- : generateArrayFromColor(colors.slice(0, 2), yAxisFields.length), yAxisFields.findIndex((field) => field.field === elem.field?.replace('comparison_', ''))), isAnimationActive: isAnimationActive, onClick: onClickChartElement }, elem.field));
94
+ : generateArrayFromColor(colors.slice(0, 2), yAxisFields.length), yAxisFields.findIndex((field) => field.field === elem.field?.replace('comparison_', ''))), isAnimationActive: isAnimationActive, onClick: data && data.length && onClickChartElement ? () => onClickChartElement(data[index]) : undefined }, elem.field));
95
95
  })] }) }) }));
96
96
  }
@@ -177,6 +177,6 @@ export default function LineChart({ colors, colorMap = {}, yAxisFields, data, co
177
177
  return (_jsx(Area, { name: elem.label, type: "linear", dataKey: elem.field, stroke: getCustomColor(index, elem.field) ??
178
178
  selectColor(elem, colors, index - numComparisons), fill: `url(#${uniqueId})`, strokeWidth: 2, dot: false, strokeDasharray: comparison && comparisonLineStyle === 'dashed' && index > 0
179
179
  ? '5 5'
180
- : undefined, isAnimationActive: isAnimationActive, onClick: onClickChartElement }, elem.field));
180
+ : undefined, isAnimationActive: isAnimationActive, onClick: data && data.length && onClickChartElement ? () => onClickChartElement(data[index]) : undefined }, elem.field));
181
181
  })] }) }) }));
182
182
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillsql/react",
3
- "version": "2.13.10",
3
+ "version": "2.13.12",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/esm/index.js",