mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-01 17:39:39 +02:00
refactor(ts): make port effect native
This commit is contained in:
parent
2868ced2d3
commit
b6759e75df
113 changed files with 4140 additions and 4554 deletions
|
|
@ -27,6 +27,8 @@ import {
|
|||
termValue,
|
||||
type GraphNode,
|
||||
type GraphLink,
|
||||
directedGraphLinkProps,
|
||||
DEFAULT_GRAPH_NODE_COLOR,
|
||||
} from "@/lib/graph-utils";
|
||||
import type { ForceGraphProps } from "react-force-graph-2d";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
|
|
@ -120,7 +122,7 @@ function paintNode(showLabels: boolean) {
|
|||
const y = node.y ?? 0;
|
||||
ctx.beginPath();
|
||||
ctx.arc(x, y, radius, 0, 2 * Math.PI);
|
||||
ctx.fillStyle = node.color ?? "#5b80ff";
|
||||
ctx.fillStyle = node.color ?? DEFAULT_GRAPH_NODE_COLOR;
|
||||
ctx.fill();
|
||||
if (!showLabels || globalScale < 0.7) return;
|
||||
const fontSize = Math.max(10 / globalScale, 2);
|
||||
|
|
@ -257,7 +259,7 @@ export default function GraphPage() {
|
|||
nodeCanvasObject={paintNode(view.showLabels)}
|
||||
linkCanvasObjectMode={() => "after"}
|
||||
linkCanvasObject={paintLink}
|
||||
linkColor={() => "rgba(120,120,140,0.32)"}
|
||||
{...directedGraphLinkProps}
|
||||
nodePointerAreaPaint={(node, color, ctx) => {
|
||||
ctx.fillStyle = color;
|
||||
ctx.beginPath();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue