Skip to content

Commit

Permalink
Merge pull request #24 from janpasek97/frontend-vue-edge-description
Browse files Browse the repository at this point in the history
Issue #22 fixed displaying edges
  • Loading branch information
janpasek97 authored Dec 11, 2021
2 parents 837d4b1 + 29f00dd commit 54db0b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions sources/frontend/src/components/svg/Edge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
: `stroke:${style.strokeColor};stroke-width:${style.strokeWidth}`"
/>
<text class="wrap" :x="titleX" :y="titleY">
<tspan text-anchor="middle" :fill="style.textColor">{{ title }}</tspan>
<tspan text-anchor="middle" :fill="style.textColor">{{ edgeDescription }}</tspan>
</text>
</g>
</template>
Expand All @@ -25,7 +25,7 @@ export default {
endY: Number,
startOffset: Number,
endOffset: Number,
title: String,
attributes: Object,
highlighted: Boolean,
style: Object
},
Expand Down Expand Up @@ -76,7 +76,14 @@ export default {
},
endOffsetY() {
return this.endOffsetRatio * this.b
}
},
edgeDescription() {
let ret = ''
Object.keys(this.attributes).forEach(attr => {
ret = this.attributes[attr]
})
return ret
},
}
}
</script>
2 changes: 1 addition & 1 deletion sources/frontend/src/components/svg/SvgCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
:start-y="vertices[vertex_map[edge.from]].y"
:end-x="vertices[vertex_map[edge.to]].x"
:end-y="vertices[vertex_map[edge.to]].y"
:title="edge.attributes != null ? edge.attributes['3'] : ''"
:attributes="edge.attributes !== undefined ? edge.attributes : {}"
:style="style.edge"
:highlighted="edge.highlighted"
:start-offset="style.vertex.radius"
Expand Down

0 comments on commit 54db0b5

Please sign in to comment.