feat(plugins): add controls
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user