diff --git a/package.json b/package.json index 636a15fe8..fdb09a554 100644 --- a/package.json +++ b/package.json @@ -143,5 +143,6 @@ "@semantic-release/npm", "@semantic-release/github" ] - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/src/components/chart-elements/AreaChart/AreaChart.tsx b/src/components/chart-elements/AreaChart/AreaChart.tsx index 470d96edb..da257eaa2 100644 --- a/src/components/chart-elements/AreaChart/AreaChart.tsx +++ b/src/components/chart-elements/AreaChart/AreaChart.tsx @@ -384,58 +384,20 @@ const AreaChart = React.forwardRef((props, ref) ); })} - {categories.map((category, idx) => { + {categories.map((category) => { const gradientId = (categoryColors.get(category) ?? BaseColors.Gray).replace("#", ""); - return ( { - const { cx, cy, stroke, strokeLinecap, strokeLinejoin, strokeWidth, dataKey } = - props; - return ( - onDotClick(props, event)} - /> - ); - }} - dot={(props: any) => { - const { - stroke, - strokeLinecap, - strokeLinejoin, - strokeWidth, - cx, - cy, - dataKey, - index, - } = props; - - if ( - (hasOnlyOneValueForThisKey(data, category) && - !(activeDot || (activeLegend && activeLegend !== category))) || - (activeDot?.index === index && activeDot?.dataKey === category) - ) { + return ( + { + const { cx, cy, stroke, strokeLinecap, strokeLinejoin, strokeWidth, dataKey } = + props; return ( ((props, ref) onClick={(dotProps: any, event) => onDotClick(props, event)} /> ); + }} + dot={(props: any) => { + const { + stroke, + strokeLinecap, + strokeLinejoin, + strokeWidth, + cx, + cy, + dataKey, + index, + } = props; + + if ( + (hasOnlyOneValueForThisKey(data, category) && + !(activeDot || (activeLegend && activeLegend !== category))) || + (activeDot?.index === index && activeDot?.dataKey === category) + ) { + return ( + onDotClick(props, event)} + /> + ); + } + return ; + }} + key={category} + label={ + dataLabelOptions?.[category] == null + ? undefined + : { + style: { + fontSize: `${dataLabelOptions?.[category].fontSize ?? 12}px`, + fontWeight: "300", + fill: categoryColors.get(category) ?? BaseColors.Gray, + stroke: "#000", + strokeWidth: 0.3, + }, + position: dataLabelOptions[category].position ?? "top", + offset: dataLabelOptions?.[category].offset ?? 10, + angle: dataLabelOptions?.[category].angle ?? 0, + } } - return ; - }} - key={category} - label={ - dataLabelOptions?.[category] == null - ? undefined - : { - style: { - fontSize: `${dataLabelOptions?.[category].fontSize ?? 12}px`, - fontWeight: "300", - fill: categoryColors.get(category) ?? BaseColors.Gray, - stroke: "#000", - strokeWidth: 0.3, - }, - position: dataLabelOptions[category].position ?? "top", - offset: dataLabelOptions?.[category].offset ?? 10, - angle: dataLabelOptions?.[category].angle ?? 0, - } - } - name={category} - type={curveType} - dataKey={category} - stroke="" - fill={`url(#${gradientId})`} - strokeWidth={2} - strokeLinejoin="round" - strokeLinecap="round" - isAnimationActive={showAnimation} - animationDuration={animationDuration} - stackId={stack ? "a" : undefined} - connectNulls={connectNulls} - /> - )})} + name={category} + type={curveType} + dataKey={category} + stroke="" + fill={`url(#${gradientId})`} + strokeWidth={2} + strokeLinejoin="round" + strokeLinecap="round" + isAnimationActive={showAnimation} + animationDuration={animationDuration} + stackId={stack ? "a" : undefined} + connectNulls={connectNulls} + /> + ); + })} {onValueChange ? categories.map((category) => ( ( return data.reduce((acc: FormattedDataT[], item, index) => { const prev = acc[index - 1]; const value = item.value; - const valueToCompareWith = isPreviousCalculation ? (prev?.value ?? maxValue) : maxValue; + const valueToCompareWith = isPreviousCalculation ? prev?.value ?? maxValue : maxValue; const calculationHeight = isPreviousCalculation - ? (prev?.barHeight ?? realHeight) + ? prev?.barHeight ?? realHeight : realHeight; const normalizedValue = value / valueToCompareWith; diff --git a/src/components/chart-elements/ScatterChart/ScatterChart.tsx b/src/components/chart-elements/ScatterChart/ScatterChart.tsx index 7ca5548d2..c54d90b89 100644 --- a/src/components/chart-elements/ScatterChart/ScatterChart.tsx +++ b/src/components/chart-elements/ScatterChart/ScatterChart.tsx @@ -205,7 +205,6 @@ const ScatterChart = React.forwardRef((props, const categories = constructCategories(data, category); const categoryColors = constructCategoryColors(categories, colors); - //maybe rename getYAxisDomain to getAxisDomain const xAxisDomain = getYAxisDomain(autoMinXValue, minXValue, maxXValue); const yAxisDomain = getYAxisDomain(autoMinYValue, minYValue, maxYValue); diff --git a/src/components/chart-elements/common/utils.ts b/src/components/chart-elements/common/utils.ts index dd014040b..0fb7b8cdf 100644 --- a/src/components/chart-elements/common/utils.ts +++ b/src/components/chart-elements/common/utils.ts @@ -22,7 +22,7 @@ export const getYAxisDomain = ( minValue: number | undefined, maxValue: number | undefined, ) => { - const minDomain = autoMinValue ? "auto" : (minValue ?? 0); + const minDomain = autoMinValue ? "auto" : minValue ?? 0; const maxDomain = maxValue ?? "auto"; return [minDomain, maxDomain]; }; diff --git a/src/components/input-elements/DateRangePicker/DateRangePicker.tsx b/src/components/input-elements/DateRangePicker/DateRangePicker.tsx index 59596f60f..d692fc7c0 100644 --- a/src/components/input-elements/DateRangePicker/DateRangePicker.tsx +++ b/src/components/input-elements/DateRangePicker/DateRangePicker.tsx @@ -318,7 +318,7 @@ const DateRangePicker = React.forwardRef(( getSelectButtonColors(hasValue(value), disabled), )} > - {value ? (valueToNameMapping.get(value) ?? selectPlaceholder) : selectPlaceholder} + {value ? valueToNameMapping.get(value) ?? selectPlaceholder : selectPlaceholder} ((props, ref) => { )} - {value ? (valueToNameMapping.get(value) ?? placeholder) : placeholder} + {value ? valueToNameMapping.get(value) ?? placeholder : placeholder}