You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

polyline.tsx 808B

123456789101112131415161718192021222324252627282930313233
  1. import { PolylineShape, ShapeProps } from "types"
  2. import { Indicator, HoverIndicator } from "./indicator"
  3. import ShapeGroup from "./shape-g"
  4. function BasePolyline({
  5. points,
  6. fill = "none",
  7. stroke = "#999",
  8. strokeWidth = 1,
  9. }: ShapeProps<PolylineShape>) {
  10. return (
  11. <>
  12. <HoverIndicator as="polyline" points={points.toString()} />
  13. <polyline
  14. points={points.toString()}
  15. fill={fill}
  16. stroke={stroke}
  17. strokeWidth={strokeWidth}
  18. strokeLinecap="round"
  19. strokeLinejoin="round"
  20. />
  21. <Indicator as="polyline" points={points.toString()} />
  22. </>
  23. )
  24. }
  25. export default function Polyline({ id, point, points }: PolylineShape) {
  26. return (
  27. <ShapeGroup id={id} point={point}>
  28. <BasePolyline points={points} />
  29. </ShapeGroup>
  30. )
  31. }