Created
March 6, 2021 04:01
-
-
Save uztbt/e9f5a6ffa64e2f820ac456a2fc14381b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { RenderCustomNodeElementFn } from "react-d3-tree/lib/types/common"; | |
export const LogiNode: RenderCustomNodeElementFn = ({ nodeDatum, toggleNode}) => { | |
const [x, y] = [0, -50]; | |
const [width, height] = [100, 100]; | |
return( | |
<g> | |
<rect width={width} height={height} x={x} y={y} onClick={toggleNode}> | |
</rect> | |
<text | |
x={x+width/2} | |
y={y+height/2} | |
dominantBaseline="middle" | |
textAnchor="middle" | |
> | |
{nodeDatum.name} | |
</text> | |
</g> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment