Skip to content
Snippets Groups Projects
Commit 881df3cf authored by Maximilian Giller's avatar Maximilian Giller :squid:
Browse files

Removed bad static objects

parent 2ed1decd
No related branches found
No related tags found
1 merge request!2Implemented editor in the react framework
Pipeline #56648 passed
...@@ -18,11 +18,6 @@ type stateTypes = { ...@@ -18,11 +18,6 @@ type stateTypes = {
}; };
export class Editor extends React.PureComponent<propTypes, stateTypes> { export class Editor extends React.PureComponent<propTypes, stateTypes> {
// TODO: Not a long term solution!
public static globalState: State;
public static globalGraph: Graph;
public static globalRenderer: any;
constructor(props: propTypes) { constructor(props: propTypes) {
super(props); super(props);
this.loadGraph = this.loadGraph.bind(this); this.loadGraph = this.loadGraph.bind(this);
...@@ -64,8 +59,6 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> { ...@@ -64,8 +59,6 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> {
// Create global objects // Create global objects
const newState = new State(); const newState = new State();
const newGraph = Graph.parse(data); const newGraph = Graph.parse(data);
Editor.globalState = newState;
Editor.globalGraph = newGraph;
// Is valid and parsed successfully? // Is valid and parsed successfully?
// TODO: Check doesn't work for some reason, always returns true, even tho it should be considered defined // TODO: Check doesn't work for some reason, always returns true, even tho it should be considered defined
...@@ -75,12 +68,6 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> { ...@@ -75,12 +68,6 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> {
// return false; // return false;
// } // }
// Create renderer
// console.log("Creating renderer ...");
// const renderTarget = document.getElementById("2d-graph");
// const renderWidth = renderTarget.offsetWidth;
// Editor.globalRenderer = ForceGraph()(renderTarget);
// // Subscribe to interactions // // Subscribe to interactions
// console.log("Subscribing to events ..."); // console.log("Subscribing to events ...");
// Editor.globalRenderer // Editor.globalRenderer
...@@ -122,11 +109,6 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> { ...@@ -122,11 +109,6 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> {
// ) // )
// .onLinkClick((link: any) => Editor.globalState.onLinkClick(link)); // .onLinkClick((link: any) => Editor.globalState.onLinkClick(link));
// // Connect update event
// Editor.globalGraph.onChangeCallbacks.push((data) => {
// Editor.globalRenderer.graphData(data);
// });
// Set as new state // Set as new state
console.log(newGraph); console.log(newGraph);
this.setState({ this.setState({
......
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