Skip to content

Commit eabe2a2

Browse files
committed
wip
1 parent f83037b commit eabe2a2

16 files changed

+298
-144
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Connects nodes using svg lines
9090
></edge>
9191
```
9292

93-
Edges require node references `{ from: id|Object, to: String|Object }`, if nodes are refered by `id(String)` an array `nodes` must be passed:
93+
Edges require node references `{ from: id|Object, to: String|Object }`, if nodes are refered by `id(String)` an array `nodes` must be passed:
9494

9595
```html
9696
<edge
@@ -141,11 +141,11 @@ Surrounds a group of nodes with a rectangle, allows dragging multiple nodes.
141141

142142
### Port
143143

144-
Placed inside a node, automatically offsets edges to a determined position inside the nodes html (see Ports demo).
144+
Placed inside a node, automatically offsets edges to a their position inside the nodes html [Ports demo].
145145

146146
### Label
147147

148-
Create a label positioned relative to an edge
148+
Create a label node that is positioned along an edge
149149

150150
```html
151151
<v-label :edge="graph.edges[0]" :perc="50" :offset="{x: 0, y: -50}">
@@ -156,7 +156,7 @@ Create a label positioned relative to an edge
156156
### graph.js
157157

158158
Can be used to store edges and nodes.
159-
Contains utility methods to build graphs, position nodes, remove and create nodes, edges and so on.
159+
Contains utility methods to build graphs, layouts, remove and create nodes, edges and so on.
160160

161161
## Styling
162162

lib/svg-pan-zoom/svg-pan-zoom.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,9 @@ SvgPanZoom.prototype.getPublicInstance = function() {
676676
// Create cache
677677
if (!this.publicInstance) {
678678
this.publicInstance = this.pi = {
679+
options: this.options,
679680
// Pan
680-
enablePan: function() {that.options.panEnabled = true; return that.pi}
681+
enablePan: function() {that.options.panEnabled = true; return that.pi}
681682
, disablePan: function() {that.options.panEnabled = false; return that.pi}
682683
, isPanEnabled: function() {return !!that.options.panEnabled}
683684
, pan: function(point) {that.pan(point); return that.pi}

package-lock.json

+100-24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Edge.vue

-2
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ export default {
162162
util.lineLine(x1, y1, x2, y2, box[2], box[1], box[2], box[3]), // right
163163
util.lineLine(x1, y1, x2, y2, box[0], box[3], box[2], box[3]) // bottom
164164
].filter(i => i)
165-
166-
167165
const start = new Victor(x1, y1)
168166
return intersections
169167
.map(i => Object.assign(i, { distance: start.distance(new Victor(i.x, i.y)) }))

src/components/Group.vue

+5-6
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
:y="minY - padding.top - margin"
66
:width="width + (padding.left + padding.right) + margin * 2"
77
:height="height + (padding.top + padding.bottom) + margin * 2"
8-
@mousedown="onMousedown"
9-
>
10-
<div class="content" ref="content" :style="contentMargin">
11-
<slot>
12-
</slot>
13-
</div>
8+
@mousedown="onMousedown">
9+
<div class="content" ref="content" :style="contentMargin">
10+
<slot>
11+
</slot>
12+
</div>
1413
</foreignObject>
1514
</template>
1615

src/components/Label.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default {
2424
props: {
2525
edge: {
2626
type: Object,
27-
required: true // { id, pathd } required
27+
required: true // { id, pathd }
2828
},
2929
perc: {
3030
type: Number,

src/components/Markers.vue

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
<g>
33
<g v-for="marker in all" :key="marker.id">
44
<marker v-if="marker.type === 'arrow-start'"
5-
:id="marker.id" orient="auto"
6-
:markerWidth="13 * marker.scale"
7-
:markerHeight="13 * marker.scale"
8-
:refX="1 * marker.scale"
9-
:refY="5 * marker.scale">
10-
<path d="M0,5 L10,10 L10,0 L0,5" :style="`${marker.style};transform: scale(${marker.scale})`"/>
5+
:id="marker.id" orient="auto"
6+
:markerWidth="13 * marker.scale"
7+
:markerHeight="13 * marker.scale"
8+
:refX="1 * marker.scale"
9+
:refY="5 * marker.scale">
10+
<path d="M0,5 L10,10 L10,0 L0,5" :style="`${marker.style};transform: scale(${marker.scale})`"/>
1111
</marker>
1212
<marker v-if="marker.type === 'arrow-end'"
13-
:id="marker.id" orient="auto"
14-
:markerWidth="13 * marker.scale"
15-
:markerHeight="13 * marker.scale"
16-
:refX="9 * marker.scale"
17-
:refY="5 * marker.scale">
18-
<path d="M0,0 L0,10 L10,5 L0,0" :style="`${marker.style};transform: scale(${marker.scale})`"/>
13+
:id="marker.id" orient="auto"
14+
:markerWidth="13 * marker.scale"
15+
:markerHeight="13 * marker.scale"
16+
:refX="9 * marker.scale"
17+
:refY="5 * marker.scale">
18+
<path d="M0,0 L0,10 L10,5 L0,0" :style="`${marker.style};transform: scale(${marker.scale})`"/>
1919
</marker>
2020
</g>
2121
</g>

0 commit comments

Comments
 (0)