|
@@ -5,7 +5,7 @@
|
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
|
ref="svg"
|
|
|
class="view"
|
|
|
- :class="{'flow-linking':linking || stickySockets}"
|
|
|
+ :class="{ 'flow-linking':linking || stickySockets, 'activity':dragging || pointerLink.active }"
|
|
|
@dragover.prevent
|
|
|
@drop="managerDrop"
|
|
|
:width="width"
|
|
@@ -13,7 +13,7 @@
|
|
|
<defs>
|
|
|
<marker id="head" orient="auto" markerWidth="2" markerHeight="4"
|
|
|
refX="0.1" refY="2">
|
|
|
- <path d="M0,0 V4 L2,2 Z"/>
|
|
|
+ <path d="M0,0 V4 L2,2 Z" fill="rgba(0,0,0,0.5)"/>
|
|
|
</marker>
|
|
|
<filter
|
|
|
id="highlight-border"
|
|
@@ -26,12 +26,12 @@
|
|
|
<feMorphology in="SourceGraphic" result="MORPH" operator="dilate" radius="1" />
|
|
|
<feColorMatrix
|
|
|
in="MORPH" result="BORDER" type="matrix"
|
|
|
- values=".7 0 0 0 0, 0 .7 0 0 0, 0 0 .7 0 0, 0 0 0 1 0"/>
|
|
|
+ values=".4 0 0 0 0, 0 .4 0 0 0, 0 0 .4 0 0, 0 0 0 .7 0"/>
|
|
|
<feColorMatrix
|
|
|
result = "matrixOut"
|
|
|
in = "SourceGraphic"
|
|
|
type = "matrix"
|
|
|
- values = ".2 0 0 0 0, 0 .2 0 0 0, 0 0 .2 0 0, 0 0 0 1 0"/>
|
|
|
+ values = ".7 0 0 0 0, 0 .7 0 0 0, 0 0 .7 0 0, 0 0 0 1 0"/>
|
|
|
<feGaussianBlur
|
|
|
result="blurOut"
|
|
|
in="matrixOut"
|
|
@@ -75,17 +75,7 @@
|
|
|
<flow-pan-zoom
|
|
|
ref="panzoom"
|
|
|
v-model="panzoom">
|
|
|
- <flow-link
|
|
|
- v-for="(link,i) in nodeData.links"
|
|
|
- :key="i"
|
|
|
- v-bind="linkProps(link)"
|
|
|
- @click="linkRemove(link)"
|
|
|
- />
|
|
|
<!-- mouse link-->
|
|
|
- <flow-link
|
|
|
- v-if="pointerLink.active"
|
|
|
- v-bind="pointerLink.props"
|
|
|
- />
|
|
|
<flow-node
|
|
|
ref="nodes"
|
|
|
v-for="(n,i) of nodeData.nodes"
|
|
@@ -95,11 +85,23 @@
|
|
|
@nodePointerDown.prevent="nodeDragStart($event,i)"
|
|
|
@socketPointerDown="socketPointerDown(n.id,...arguments)"
|
|
|
/>
|
|
|
+ <flow-link
|
|
|
+ v-for="(link,i) in nodeData.links"
|
|
|
+ :key="i"
|
|
|
+ v-bind="linkProps(link)"
|
|
|
+ @click="linkRemove(link)"
|
|
|
+ />
|
|
|
+ <flow-link
|
|
|
+ v-if="pointerLink.active"
|
|
|
+ v-bind="pointerLink.props"
|
|
|
+ />
|
|
|
+
|
|
|
</flow-pan-zoom>
|
|
|
</svg>
|
|
|
<div class="flow-container__control">
|
|
|
<button @click="$emit('funcsPanelToggle')">Panel</button>
|
|
|
- <button @click="panzoomReset">Reset view</button>
|
|
|
+ <button @click="stickySockets=!stickySockets"> {{ stickySockets? 'Hide':'Show' }} sockets </button>
|
|
|
+ <button v-if="panzoom.x!=0 || panzoom.y!=0 || panzoom.zoom!=1" @click="panzoomReset">Reset view</button>
|
|
|
|
|
|
</div>
|
|
|
<div class="flow-container__info">
|
|
@@ -121,8 +123,7 @@ export default {
|
|
|
'value': {type: Object, default: () => {}},
|
|
|
'registry': {type: Object, default: () => {}},
|
|
|
'width': {type: String, default: '800px'},
|
|
|
- 'height': {type: String, default: '600px'},
|
|
|
- 'stickySockets': {type: Boolean, default: false}
|
|
|
+ 'height': {type: String, default: '600px'}
|
|
|
},
|
|
|
data () {
|
|
|
// const cloned = JSON.parse(JSON.stringify(this.value)) // initial?
|
|
@@ -132,6 +133,7 @@ export default {
|
|
|
dragging: null,
|
|
|
|
|
|
linking: false,
|
|
|
+ stickySockets: false,
|
|
|
pointerLink: {active: false, props: {}, src: {}}
|
|
|
}
|
|
|
},
|
|
@@ -279,9 +281,10 @@ export default {
|
|
|
const targetNodeId = ev.target.getAttribute('data-nodeid')
|
|
|
const targetIn = ev.target.getAttribute('data-in')
|
|
|
const targetOut = ev.target.getAttribute('data-out')
|
|
|
+
|
|
|
// Not a node or same node
|
|
|
if (targetNodeId === undefined || targetNodeId === nodeId) {
|
|
|
- console.error('LINK: target is not a socket/ same socket')
|
|
|
+ console.error('LINK: target is not a socket or is node')
|
|
|
return
|
|
|
}
|
|
|
let link
|
|
@@ -339,7 +342,6 @@ export default {
|
|
|
}
|
|
|
if (ev.button !== 0) return // first button
|
|
|
if (ev.shiftKey) {
|
|
|
- console.log('Shifting:', tnode)
|
|
|
this.socketPointerDown(tnode.id, ev, {out: 0})
|
|
|
return
|
|
|
}
|
|
@@ -448,25 +450,26 @@ function guid () {
|
|
|
|
|
|
.flow-container__control {
|
|
|
position:absolute;
|
|
|
- top: 0px;
|
|
|
- left: 0px;
|
|
|
+ top: 20px;
|
|
|
+ left: 20px;
|
|
|
display:flex;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
+ color: #FFF;
|
|
|
}
|
|
|
.flow-container__control button {
|
|
|
display:flex;
|
|
|
justify-content: center;
|
|
|
margin:0;
|
|
|
padding:14px;
|
|
|
+ color:#333;
|
|
|
}
|
|
|
.flow-container__info {
|
|
|
position:absolute;
|
|
|
bottom:10px;
|
|
|
left:10px;
|
|
|
padding:2px;
|
|
|
- font-size:8px;
|
|
|
- color: #777;
|
|
|
+ font-size:9px;
|
|
|
}
|
|
|
.flow-container .svg.view {
|
|
|
border:none;
|
|
@@ -480,17 +483,16 @@ function guid () {
|
|
|
stroke:transparent !important;
|
|
|
}
|
|
|
.flow-linking .flow-node__socket {
|
|
|
- fill: #AFAFAF !important;
|
|
|
- stroke: #AFAFAF !important;
|
|
|
+ fill: #444 !important;
|
|
|
+ stroke: #444 !important;
|
|
|
}
|
|
|
.flow-linking .flow-node__socket:hover {
|
|
|
- stroke-width:5;
|
|
|
}
|
|
|
-.flow-linking .flow-node__socket--match {
|
|
|
- stroke-width:5;
|
|
|
- stroke:#2a2 !important;
|
|
|
- fill:#2a2 !important;
|
|
|
- filter: url(#highlight);
|
|
|
+.flow-linking .flow-node__socket--match,
|
|
|
+.flow-node__socket--match {
|
|
|
+ stroke:#2f2 !important;
|
|
|
+ fill:#2f2 !important;
|
|
|
+ filter: url(#highlight-border);
|
|
|
}
|
|
|
.flow-linking .flow-node__socket--match:hover {
|
|
|
stroke:#0F0 !important;
|