Skip to content

Commit

Permalink
Merge pull request #24 from zotko/fix/duplicate-legend-elements
Browse files Browse the repository at this point in the history
fix: hide index traces by default to prevent legend duplicates
  • Loading branch information
zotko authored Jan 13, 2025
2 parents 2ef3806 + 059cf58 commit 7d8e22d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/demo.html

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions xyz2graph/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,8 @@ def create_figure(self) -> go.Figure:
)
index_trace_indices = []
for trace in index_traces:
# Prevent duplicates in legend
trace.visible = False
fig.add_trace(trace)
index_trace_indices.append(len(fig.data) - 1)

Expand Down

0 comments on commit 7d8e22d

Please sign in to comment.