diff --git a/src/charts/PieChart/PieChart.tsx b/src/charts/PieChart/PieChart.tsx
index a91b8b2..c84dba8 100644
--- a/src/charts/PieChart/PieChart.tsx
+++ b/src/charts/PieChart/PieChart.tsx
@@ -25,8 +25,6 @@ const PieLabel = styled.text`
pointer-events: none;
`;
-const { light, dark } = themes;
-
export default function PieChart({
theme = 'light',
data,
@@ -60,7 +58,7 @@ export default function PieChart({
const groupAccessor = (d: Data) => d[label ?? ''];
const groups: d3.InternMap
= d3.group(data, groupAccessor);
return Array.from(groups).map((group) => group[0]);
- }, [label]);
+ }, [label, data]);
// ********************
// STEP 2. Determine chart dimensions
diff --git a/src/charts/ScatterPlot/ScatterPlot.tsx b/src/charts/ScatterPlot/ScatterPlot.tsx
index 6977f3d..0774336 100644
--- a/src/charts/ScatterPlot/ScatterPlot.tsx
+++ b/src/charts/ScatterPlot/ScatterPlot.tsx
@@ -30,8 +30,6 @@ import { Label } from '../../components/Label';
import { ThemeProvider } from 'styled-components';
-const { light, dark } = themes;
-
export default function ScatterPlot({
theme = 'light',
data,
@@ -74,7 +72,7 @@ export default function ScatterPlot({
const groupAccessor = (d: Data) => d[groupBy ?? ''];
const groups = d3.group(data, groupAccessor);
return groupBy ? Array.from(groups).map((group) => group[0]) : [yKey];
- }, [groupBy, yKey]);
+ }, [groupBy, yKey, data]);
const xAccessor: xAccessorFunc = useMemo(() => {
return xType === 'number' ? (d) => d[xKey] : (d) => new Date(d[xKey]);
diff --git a/src/components/ColorLegend.tsx b/src/components/ColorLegend.tsx
index 15075e2..1905171 100644
--- a/src/components/ColorLegend.tsx
+++ b/src/components/ColorLegend.tsx
@@ -151,7 +151,7 @@ export const ColorLegend = ({
return (
)}
{(type === 'top' || type === 'bottom') &&
- horizontalTicks.map((tick) => (
+ horizontalTicks.map((tick, i) => (
@@ -167,10 +167,10 @@ function Axi({
))}
{(type === 'right' || type === 'left') &&
- verticalTicks.map((tick) => (
+ verticalTicks.map((tick, i) => (
diff --git a/src/components/DiscreteAxis.tsx b/src/components/DiscreteAxis.tsx
index 1319820..c574bd9 100644
--- a/src/components/DiscreteAxis.tsx
+++ b/src/components/DiscreteAxis.tsx
@@ -129,7 +129,7 @@ export const DiscreteAxis = React.memo(
{ticks.map((tick: any, i: number) => (
@@ -143,7 +143,7 @@ export const DiscreteAxis = React.memo(
{ticks.map((tick: any, i: number) => (
diff --git a/src/components/VoronoiWrapper.tsx b/src/components/VoronoiWrapper.tsx
index dc07172..bbec776 100644
--- a/src/components/VoronoiWrapper.tsx
+++ b/src/components/VoronoiWrapper.tsx
@@ -18,7 +18,7 @@ export const VoronoiWrapper = React.memo(
{data.map((element: Data, i: number) => (