Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flag for rendering connections in a separated container from nodes #21

Open
ja0n opened this issue Jan 11, 2020 · 0 comments
Open

Flag for rendering connections in a separated container from nodes #21

ja0n opened this issue Jan 11, 2020 · 0 comments

Comments

@ja0n
Copy link
Owner

ja0n commented Jan 11, 2020

Maybe it's useful for something?

diff --git a/src/react/components/Container.js b/src/react/components/Container.js
index 03c3ac3..0420302 100644
--- a/src/react/components/Container.js
+++ b/src/react/components/Container.js
@@ -1,5 +1,4 @@
-import React from 'react';
-import Sticky from '../../Sticky';
+
 import { NodeList, Connections } from './index'
 
 export default class Container extends React.Component {
@@ -78,14 +77,18 @@ export default class Container extends React.Component {
       height: '100%',
       pointerEvents: 'none',
     }
+
+    const splitConnections = false;
     return (
       <div className="sticky__container">
         <div className="sticky__canvas">
           <svg style={style} className="svg-content" preserveAspectRatio="xMidYMid meet" ref={ref => this.buildUp(ref)} >
             {this.renderNodes()}
-            {this.renderConnections()}
+            {splitConnections || this.renderConnections()}
           </svg>
         </div>
+        <div className="sticky__connections" style={linesStyle} ref={ ref => { this.linesContainer = ref } }>
+            {splitConnections && this.renderConnections()}
+        </div>
       </div>
     );
   }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant