2023-05-11 11:41:04 +00:00
|
|
|
// nivo
|
|
|
|
import { ResponsiveScatterPlot, ScatterPlotSvgProps } from "@nivo/scatterplot";
|
|
|
|
// types
|
|
|
|
import { TGraph } from "./types";
|
|
|
|
// constants
|
|
|
|
import { CHARTS_THEME, DEFAULT_MARGIN } from "constants/graph";
|
|
|
|
|
2023-11-08 15:01:46 +00:00
|
|
|
export const ScatterPlotGraph: React.FC<TGraph & Omit<ScatterPlotSvgProps<any>, "height" | "width">> = ({
|
|
|
|
height = "400px",
|
|
|
|
width = "100%",
|
|
|
|
margin,
|
|
|
|
theme,
|
|
|
|
...rest
|
|
|
|
}) => (
|
2023-05-11 11:41:04 +00:00
|
|
|
<div style={{ height, width }}>
|
|
|
|
<ResponsiveScatterPlot
|
2023-05-11 12:08:46 +00:00
|
|
|
margin={{ ...DEFAULT_MARGIN, ...(margin ?? {}) }}
|
2023-11-01 07:00:21 +00:00
|
|
|
animate
|
2023-05-11 12:08:46 +00:00
|
|
|
theme={{ ...CHARTS_THEME, ...(theme ?? {}) }}
|
2023-05-11 11:41:04 +00:00
|
|
|
{...rest}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|