import Color from "chroma-js"; import { PencilIcon } from "components/Icons" import { useNodeStyles } from "./styles" import { EdgeDirection, Node, Point } from "types/graphs"; import { DAGEdge } from "./DAGEdge"; export interface NodeProp extends Node { height: number; width: number; onXClick?: () => void; onOpenClick?: () => void; debug?: boolean; edge?: { color: string; loc: Point; direction: EdgeDirection; } } export const DAGNode = ({ loc: [x, y], text, height, width, onXClick = () => { }, onOpenClick = () => { }, color, edge, debug = false, }: NodeProp) => { const { classes, theme } = useNodeStyles({ color, nodeHeight: height, nodeWidth: width, }); return <>
{text}
{ edge && (edge.direction === '1->2' ? : ) } }