Feat/minimap (#44)
* feat: New minimap * imporved preview * better start values * smarter destructure * getNodesInside refactor * refactor(minimap): add maskColor and nodeBorderRadius props * refactor(gitignore): add dist * refactor(minimap): show empty minimap when there are no nodes closes #39
This commit is contained in:
@@ -149,7 +149,7 @@ class App extends PureComponent {
|
||||
snapGrid={[16, 16]}
|
||||
>
|
||||
<MiniMap
|
||||
style={{ position: 'absolute', right: 10, bottom: 10 }}
|
||||
style={{ position: 'absolute', right: 10, bottom: 10, backgroundColor: '#f8f8f8'}}
|
||||
nodeColor={n => {
|
||||
if (n.type === 'input') return 'blue';
|
||||
if (n.type === 'output') return 'green';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
|
||||
import Graph, { removeElements, addEdge, getOutgoers } from 'react-flow';
|
||||
import Graph, { removeElements, addEdge, getOutgoers, MiniMap } from 'react-flow';
|
||||
|
||||
const onNodeDragStop = node => console.log('drag stop', node);
|
||||
|
||||
@@ -68,6 +68,7 @@ class App extends PureComponent {
|
||||
style={{ width: '100%', height: '100%' }}
|
||||
backgroundType="lines"
|
||||
>
|
||||
<MiniMap />
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => this.onAdd()}
|
||||
|
||||
Reference in New Issue
Block a user