update(edges): filter edges of hidden nodes
* we don't want to show edges that go seemingly nowhere Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -32,10 +32,7 @@ const connectionLineVisible = controlledComputed(
|
|||||||
store.connectionHandleType
|
store.connectionHandleType
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
const groups = controlledComputed(
|
const groups = computed(() => groupEdgesByZLevel(store.getEdges, store.getNodes))
|
||||||
() => store.getEdges,
|
|
||||||
() => groupEdgesByZLevel(store.getEdges, store.getNodes),
|
|
||||||
)
|
|
||||||
</script>
|
</script>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ export default (state: State): ComputedGetters => {
|
|||||||
|
|
||||||
const getEdges = computed<GraphEdge[]>(() => {
|
const getEdges = computed<GraphEdge[]>(() => {
|
||||||
if (state.paneReady && state.dimensions.width && state.dimensions.height) {
|
if (state.paneReady && state.dimensions.width && state.dimensions.height) {
|
||||||
if (!state.onlyRenderVisibleElements) return state.edges.filter((e) => !e.hidden)
|
if (!state.onlyRenderVisibleElements)
|
||||||
|
return state.edges.filter((e) => !e.hidden && !e.targetNode.hidden && !e.sourceNode.hidden)
|
||||||
else
|
else
|
||||||
return state.edges.filter(
|
return state.edges.filter(
|
||||||
(e) =>
|
(e) =>
|
||||||
@@ -53,6 +54,8 @@ export default (state: State): ComputedGetters => {
|
|||||||
e.sourceNode.dimensions.height &&
|
e.sourceNode.dimensions.height &&
|
||||||
e.targetNode.dimensions.width &&
|
e.targetNode.dimensions.width &&
|
||||||
e.targetNode.dimensions.height &&
|
e.targetNode.dimensions.height &&
|
||||||
|
!e.targetNode.hidden &&
|
||||||
|
!e.sourceNode.hidden &&
|
||||||
isEdgeVisible({
|
isEdgeVisible({
|
||||||
sourcePos: e.sourceNode.computedPosition || { x: 0, y: 0 },
|
sourcePos: e.sourceNode.computedPosition || { x: 0, y: 0 },
|
||||||
targetPos: e.targetNode.computedPosition || { x: 0, y: 0 },
|
targetPos: e.targetNode.computedPosition || { x: 0, y: 0 },
|
||||||
|
|||||||
Reference in New Issue
Block a user