feat(plugins): add controls

This commit is contained in:
moklick
2019-10-07 21:45:56 +02:00
parent 48973c5e0b
commit 2fd8a36c88
4 changed files with 62 additions and 23 deletions

View File

@@ -1,6 +1,6 @@
import React, { PureComponent } from 'react';
import Graph, { isEdge, removeElements, getOutgoers, MiniMap } from '../../../src';
import Graph, { isEdge, removeElements, getOutgoers, MiniMap, Controls } from '../../../src';
import SpecialNode from './SpecialNode';
import InputNode from './InputNode';
@@ -156,6 +156,7 @@ class App extends PureComponent {
return '#FFCC00';
}}
/>
<Controls />
<button
type="button"
onClick={() => this.onAdd()}
@@ -163,28 +164,6 @@ class App extends PureComponent {
>
add
</button>
{this.state.graphLoaded && (
<div className="controls">
<button
type="button"
onClick={() => this.onFitView()}
>
fit
</button>
<button
type="button"
onClick={() => this.onZoomIn()}
>
zoom in
</button>
<button
type="button"
onClick={() => this.onZoomOut()}
>
zoom out
</button>
</div>
)}
</Graph>
);
}