Skip to content

Commit 851a2df

Browse files
committed
js viz: removal of empty hyperedges
1 parent a37c507 commit 851a2df

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/viz/drawing.jl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,16 @@ function draw(
101101
with_he_metadata_hover::Bool=false
102102
) where {H<:AbstractSimpleHypergraph}
103103

104+
# generate a copy of the hypergraph to remove empty hyperedges
105+
_h = deepcopy(h)
106+
prune_hypergraph!(_h)
107+
104108
w = widget_graph(
105-
JSON3.write(h.v2he),
106-
JSON3.write(h.he2v),
109+
JSON3.write(_h.v2he),
110+
JSON3.write(_h.he2v),
107111
element;
108-
v_meta=h.v_meta,
109-
he_meta=h.he_meta,
112+
v_meta=_h.v_meta,
113+
he_meta=_h.he_meta,
110114
width=width,
111115
height=height,
112116
radius=radius,
@@ -129,7 +133,7 @@ function draw(
129133
with_he_labels=with_he_labels,
130134
he_labels=he_labels,
131135
with_he_metadata_hover=with_he_metadata_hover
132-
)
136+
)
133137

134138
display(w)
135139
end

0 commit comments

Comments
 (0)