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:
AndyLnd
2019-10-22 14:15:36 +02:00
committed by Moritz
parent 99dcc775b4
commit dcc38b23d8
14 changed files with 2525 additions and 504 deletions
+1 -1
View File
@@ -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';
+2 -1
View File
@@ -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()}