Skip to content

[Bug]: [hugr-py] Hugr.render_dot() can make dot files that graphviz can't process #2879

@cqc-alec

Description

@cqc-alec

Description

The html labels can be arbitrarily long (specifically a Const(StaticArrayValue(...)) can be very long, but graphviz bails out if they exceed 16k. We probably shouldn't write such long labels (maybe just create a label with a prefix followed by ...).

Steps to Reproduce

from hugr import Hugr

with open ("longlabel.txt") as f:
    text = f.read()

h = Hugr.from_str(text)

g = h.render_dot()

g.view() # fails

longlabel.txt

Expected Behaviour

No response

Actual Behaviour

No response

Component

No response

Environment

Additional Context

No response

Metadata

Metadata

Labels

A-pythonArea: Python codeC-bugfixCategory: PR with bug fixP-help-wantedCall for participation: Good issues for third party contributors

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions