@@ -4,12 +4,12 @@ import Image from "next/image";
44import { AlignLeft , ArrowDown , ArrowRight , ChevronDown , Lightbulb , Undo2 } from "lucide-react" ;
55import { Path } from "../page" ;
66import Input from "./Input" ;
7- import { Graph , GraphData } from "./model" ;
7+ import { Graph , GraphData , Link } from "./model" ;
88import { cn } from "@/lib/utils" ;
99import { TypeAnimation } from "react-type-animation" ;
1010import { DropdownMenu , DropdownMenuContent , DropdownMenuTrigger } from "@/components/ui/dropdown-menu" ;
1111import { prepareArg } from "../utils" ;
12- import { NodeObject } from "react-force-graph-2d" ;
12+ import { NodeObject , ForceGraphMethods } from "react-force-graph-2d" ;
1313
1414type PathData = {
1515 nodes : any [ ]
@@ -25,50 +25,6 @@ enum MessageTypes {
2525 Text ,
2626}
2727
28- const EDGE_STYLE = {
29- "line-color" : "gray" ,
30- "target-arrow-color" : "gray" ,
31- "opacity" : 0.5 ,
32- }
33-
34-
35- const PATH_EDGE_STYLE = {
36- width : 0.5 ,
37- "line-style" : "dashed" ,
38- "line-color" : "#FF66B3" ,
39- "arrow-scale" : 0.3 ,
40- "target-arrow-color" : "#FF66B3" ,
41- "opacity" : 1
42- }
43-
44- const SELECTED_PATH_EDGE_STYLE = {
45- width : 1 ,
46- "line-style" : "solid" ,
47- "line-color" : "#FF66B3" ,
48- "arrow-scale" : 0.6 ,
49- "target-arrow-color" : "#FF66B3" ,
50- } ;
51-
52- const NODE_STYLE = {
53- "border-width" : 0.5 ,
54- "color" : "gray" ,
55- "border-color" : "black" ,
56- "background-color" : "gray" ,
57- "opacity" : 0.5
58- }
59-
60- const PATH_NODE_STYLE = {
61- "border-width" : 0.5 ,
62- "border-color" : "#FF66B3" ,
63- "border-opacity" : 1 ,
64- }
65-
66- const SELECTED_PATH_NODE_STYLE = {
67- "border-width" : 1 ,
68- "border-color" : "#FF66B3" ,
69- "border-opacity" : 1 ,
70- } ;
71-
7228interface Message {
7329 type : MessageTypes ;
7430 text ?: string ;
@@ -85,7 +41,7 @@ interface Props {
8541 isPathResponse : boolean | undefined
8642 setIsPathResponse : ( isPathResponse : boolean | undefined ) => void
8743 setData : Dispatch < SetStateAction < GraphData > >
88- chartRef : any
44+ chartRef : React . MutableRefObject < ForceGraphMethods < Node , Link > >
8945}
9046
9147const SUGGESTIONS = [
0 commit comments