Skip to content
Snippets Groups Projects
Commit 0db15dca authored by Matthias Konitzny's avatar Matthias Konitzny :fire:
Browse files

Fixed graph data loading to match new system

parent ff909d7f
No related branches found
No related tags found
No related merge requests found
...@@ -3,14 +3,15 @@ import screenfull from "screenfull"; ...@@ -3,14 +3,15 @@ import screenfull from "screenfull";
import PropTypes, { InferType } from "prop-types"; import PropTypes, { InferType } from "prop-types";
import "./display.css"; import "./display.css";
import { GraphNode, GraphRenderer } from "./renderer"; import { VisualGraphNode, GraphRenderer } from "./renderer";
import * as Helpers from "./helpers"; import * as Helpers from "./helpers";
import { Graph, Node } from "../common/graph/graph"; import { Graph } from "../common/graph/graph";
import { loadGraphJson } from "../common/datasets"; import { loadGraphJson } from "../common/datasets";
import NodeInfoBar from "./components/nodeinfo/nodeinfobar"; import NodeInfoBar from "./components/nodeinfo/nodeinfobar";
import FilterMenu from "./components/nodefilter/filtermenu"; import FilterMenu from "./components/nodefilter/filtermenu";
import SearchBar from "./components/searchbar"; import SearchBar from "./components/searchbar";
import expandicon from "./expand_icon.svg"; import expandicon from "./expand_icon.svg";
import { Node } from "../common/graph/node";
/** /**
* This component manages and renders a 3d-force-graph with additional menus to navigate, filter and view information on nodes. * This component manages and renders a 3d-force-graph with additional menus to navigate, filter and view information on nodes.
...@@ -63,7 +64,8 @@ class Display extends React.Component< ...@@ -63,7 +64,8 @@ class Display extends React.Component<
const fetchGraph = async () => { const fetchGraph = async () => {
const graphData = await loadGraphJson(this.props.spaceId); const graphData = await loadGraphJson(this.props.spaceId);
this.graph = Graph.fromSerializedObject(graphData); this.graph = new Graph();
this.graph.fromSerializedObject(graphData);
// console.log(this.graph); // console.log(this.graph);
this.setState({ graph: this.graph }); this.setState({ graph: this.graph });
}; };
...@@ -75,8 +77,8 @@ class Display extends React.Component< ...@@ -75,8 +77,8 @@ class Display extends React.Component<
} }
handleNodeChangeRequest(node: Node) { handleNodeChangeRequest(node: Node) {
this.rendererRef.current.focusOnNode(node as GraphNode); this.rendererRef.current.focusOnNode(node as VisualGraphNode);
this.rendererRef.current.displayNodeSelection(node as GraphNode); this.rendererRef.current.displayNodeSelection(node as VisualGraphNode);
this.handleNodeClicked(node); this.handleNodeClicked(node);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment