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