|
@@ -6,7 +6,7 @@
|
|
|
'flow-node--selected': !!nodeSelection[node.id]
|
|
|
}"
|
|
|
:status="status"
|
|
|
- :transform="'translate(' + node.x + ',' + node.y +')'"
|
|
|
+ :transform="nodePos"
|
|
|
@mousedown.stop.prevent="nodePointerDown"
|
|
|
@contextmenu.capture.prevent="nodeRightClick"
|
|
|
@dblclick="nodeDoubleClick"
|
|
@@ -54,7 +54,8 @@
|
|
|
ref="label"
|
|
|
class="flow-node__label"
|
|
|
v-bind="labelProps"
|
|
|
- text-anchor="middle">
|
|
|
+ text-anchor="middle"
|
|
|
+ dominant-baseline="middle">
|
|
|
<tspan
|
|
|
:key="'label-wrap' + i"
|
|
|
x="0"
|
|
@@ -100,10 +101,10 @@
|
|
|
class="flow-node__socket flow-node__socket--outputs"
|
|
|
>
|
|
|
<circle r="5" />
|
|
|
- <!--<rect
|
|
|
+ <rect
|
|
|
v-bind="outputLabelBGProps(0)"
|
|
|
class="flow-node__socket-detail--background"
|
|
|
- />-->
|
|
|
+ />
|
|
|
<text
|
|
|
ref="outputLabel"
|
|
|
class="flow-node__socket-detail"
|
|
@@ -120,7 +121,7 @@
|
|
|
:data-nodeid="node.id"
|
|
|
data-dir="in"
|
|
|
:x="-5"
|
|
|
- :y="-bodyProps.height/2-5"
|
|
|
+ :y="-bodyProps.height/2-2"
|
|
|
width="10"
|
|
|
height="10"
|
|
|
@mousedown.stop.prevent="triggerPointerDown($event, 'in')"
|
|
@@ -131,7 +132,7 @@
|
|
|
:data-nodeid="node.id"
|
|
|
data-dir="out"
|
|
|
:x="-5"
|
|
|
- :y="bodyProps.height/2 -5"
|
|
|
+ :y="bodyProps.height/2 -7"
|
|
|
width="10"
|
|
|
height="10"
|
|
|
@mousedown.stop.prevent="triggerPointerDown($event, 'out')"
|
|
@@ -167,21 +168,13 @@ export default {
|
|
|
'pointerLink': {type: Object, default: null},
|
|
|
'pointerTriggerLink': {type: Object, default: null},
|
|
|
'dragging': {type: Object, default: null}
|
|
|
- // 'activity': {type: Object, default: () => {}},
|
|
|
- // 'nodeStyle': {type: Object, default: () => {}}
|
|
|
- },
|
|
|
- data () {
|
|
|
- return {
|
|
|
- // maintain reference here?
|
|
|
- inputLabelRect: [],
|
|
|
- outputLabelRect: [],
|
|
|
- labelRect: {x: 0, y: 0, width: 0, height: 0}
|
|
|
- // bodyRect: {x: 0, y: 0, width: 0, height: 0}
|
|
|
- }
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters('flow', ['nodeCache', 'nodeData', 'registry', 'activity', 'nodeById', 'nodeSelection', 'nodeInputPos', 'nodeOutputPos']),
|
|
|
|
|
|
+ nodePos () {
|
|
|
+ return `translate(${this.node.x}, ${this.node.y})`
|
|
|
+ },
|
|
|
nodeDim () {
|
|
|
return this.nodeCache[this.node.id].dim
|
|
|
},
|
|
@@ -211,12 +204,12 @@ export default {
|
|
|
return utils.textWrap(this.node.label, wrapThreshold, opt.textWrap)
|
|
|
},
|
|
|
labelProps () {
|
|
|
+ const ldim = nodeSize.labelDim(this.node)
|
|
|
return {
|
|
|
x: 0,
|
|
|
y: 0,
|
|
|
fill: this.textColor,
|
|
|
- // transform: `translate(${-this.labelRect.width / 2},${-this.labelRect.height / 2})`
|
|
|
- transform: `translate(0,${-this.labelRect.height / 2})`
|
|
|
+ transform: `translate(0,${-ldim.height / 2 - 5})`
|
|
|
}
|
|
|
},
|
|
|
bodyProps () {
|
|
@@ -336,26 +329,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- watch: {
|
|
|
- // the only thing now that affects geometry
|
|
|
- 'node.label' (val, oldVal) {
|
|
|
- if (val === oldVal) { return }
|
|
|
- this.$nextTick(() => {
|
|
|
- this.labelRect = this.$refs.label.getBBox()
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- mounted () {
|
|
|
- // After render
|
|
|
- this.$nextTick(() => { // after mount we reupdate with new values
|
|
|
- if (!this.$refs.label) return
|
|
|
- this.labelRect = this.$refs.label.getBBox()
|
|
|
- this.$forceUpdate()
|
|
|
- })
|
|
|
- },
|
|
|
- udpated () {
|
|
|
- console.log('Node update')
|
|
|
- },
|
|
|
methods: {
|
|
|
nodePointerDown (ev) {
|
|
|
this.$emit('nodePointerDown', ev)
|
|
@@ -387,12 +360,12 @@ export default {
|
|
|
}
|
|
|
|
|
|
.flow-view:not(.activity) .flow-node {
|
|
|
- transition: all var(--transition-speed-fast);
|
|
|
+ transition: all var(--transition-speed);
|
|
|
}
|
|
|
|
|
|
.flow-node__body {
|
|
|
opacity:0.9;
|
|
|
- transition: all var(--transition-speed-fast);
|
|
|
+ transition: all var(--transition-speed);
|
|
|
}
|
|
|
|
|
|
.flow-node[status=running] .flow-node__body{
|
|
@@ -414,7 +387,7 @@ export default {
|
|
|
font-size:15px;
|
|
|
opacity:0;
|
|
|
fill: var(--normal);
|
|
|
- transition: all var(--transition-speed-fast);
|
|
|
+ transition: all var(--transition-speed);
|
|
|
}
|
|
|
|
|
|
.flow-linking .flow-node__src-detail {
|
|
@@ -426,7 +399,7 @@ export default {
|
|
|
pointer-events: none;
|
|
|
stroke-width:1;
|
|
|
opacity:0;
|
|
|
- transition: all var(--transition-speed-fast);
|
|
|
+ transition: all var(--transition-speed);
|
|
|
}
|
|
|
|
|
|
.flow-view:not(.activity) .flow-node__socket:hover {
|
|
@@ -438,12 +411,13 @@ export default {
|
|
|
opacity:1;
|
|
|
stroke-width:0 !important;
|
|
|
fill: #fff !default;
|
|
|
- transition: all var(--transition-speed-fast);
|
|
|
+ transition: all var(--transition-speed);
|
|
|
}
|
|
|
|
|
|
.flow-node__socket-detail--background {
|
|
|
stroke-width:0;
|
|
|
- transition:all var(--transition-speed-fast);
|
|
|
+
|
|
|
+ /*transition: all var(--transition-speed);*/
|
|
|
}
|
|
|
|
|
|
.flow-node__socket--match {
|
|
@@ -470,7 +444,7 @@ export default {
|
|
|
.flow-node__trigger {
|
|
|
pointer-events:none;
|
|
|
opacity:0;
|
|
|
- transition: all var(--transition-speed-fast);
|
|
|
+ transition: all var(--transition-speed);
|
|
|
}
|
|
|
|
|
|
.flow-triggers .flow-node__trigger {
|
|
@@ -507,8 +481,8 @@ for hidden
|
|
|
stroke: var(--node-selection);
|
|
|
stroke-dasharray:2,2;
|
|
|
pointer-events:none;
|
|
|
- transition: all var(--transition-speed-fast);
|
|
|
fill: var(--node-selection);
|
|
|
+ transition: all var(--transition-speed);
|
|
|
}
|
|
|
|
|
|
.flow-node--selected .flow-node__selection {
|