Circles.tsx 406 Bytes
Newer Older
Yoon, Daeki's avatar
Yoon, Daeki committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { ScaleLinear } from "d3-scale";
import React from "react";

type Props = {
  dataset: number[][];
  xScale: ScaleLinear<number, number>;
  yScale: ScaleLinear<number, number>;
};

export const Circles = ({ dataset, xScale, yScale }: Props) => {
  return (
    <g>
      {dataset.map((d) => (
        <circle key={d[0]} cx={xScale(d[0])} cy={yScale(d[1])} r={3}></circle>
      ))}
    </g>
  );
};