Skip to content
Snippets Groups Projects
Commit 70f59ba7 authored by Maximilian Giller's avatar Maximilian Giller
Browse files

Removed separat graph renderer element

parent e04bd012
No related branches found
No related tags found
1 merge request!2Implemented editor in the react framework
Pipeline #56561 passed
......@@ -21,3 +21,17 @@ div#ks-editor #sidepanel > * {
div#ks-editor #content {
display: flex;
}
div#ks-editor #box-select-layer {
position: relative;
}
div#ks-editor #box-select {
position: absolute;
z-index: 300000;
border-style: dotted;
border-color: #3e74cc;
border-width: 2px;
background-color: rgba(255, 255, 255, 0.5);
pointer-events: none;
}
import React from "react";
import PropTypes, { InferType } from "prop-types";
import { State } from "../state";
import * as Interactions from "../interactions";
import { Graph } from "../structures/graph/graph";
import { loadGraphJson } from "../../../datasets";
import { ToolPool } from "./toolpool";
import { ToolDetails } from "./tooldetails";
import { GraphRenderer } from "./graphrenderer";
import { SpaceSelect } from "./spaceselect";
import "./editor.css";
import ReactForceGraph2d from "react-force-graph-2d";
type propTypes = any;
type stateTypes = {
......@@ -171,7 +170,7 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> {
<ToolDetails />
</div>
{this.state.graph ? (
<GraphRenderer graphData={this.state.graph.data} />
<ReactForceGraph2d graphData={this.state.graph.data} />
) : undefined}
</div>
</div>
......
div#ks-editor #box-select-layer {
position: relative;
}
div#ks-editor #box-select {
position: absolute;
z-index: 300000;
border-style: dotted;
border-color: #3e74cc;
border-width: 2px;
background-color: rgba(255, 255, 255, 0.5);
pointer-events: none;
}
\ No newline at end of file
import React from "react";
import { ReactNode } from "react";
import ReactForceGraph2d from "react-force-graph-2d";
import { GraphData } from "../structures/graph/graph";
import "./graphrenderer.css";
type propTypes = {
graphData: GraphData;
};
export class GraphRenderer extends React.Component<propTypes> {
render(): ReactNode {
return (
<div id="box-select-layer">
<ReactForceGraph2d graphData={this.props.graphData} />
</div>
);
}
}
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