nadavrot/layout

Supporting html labels

Opened this issue · 2 comments

drahnr commented

Hey, thank you for writing the crate. I am currently working with an svg generation library that makes use of html like labels (https://graphviz.org/doc/info/shapes.html#html) which this crate does not support just yet.

Would you be interested in accepting a PR for support?

Thank you for reaching out. This feature is indeed missing. Can you tell me more how you plan to implement this feature?

drahnr commented

My initial idea would be to add < and > as bracket like enclosings, and using the content inbetween as input to either https://crates.io/crates/hard-xml or https://crates.io/crates/xml-rs and defining all supported items manually.
Text is natively supported in SVGs: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/text

Rendering tables is the most tricky part, so I'd punt on that for now, https://tink.uk/accessible-svg-tables/ outlines a path to get there, but it requires a few more moving parts, i.e. how to size the table elements - I am not yet sure if one can avoid to do text and glyph placement to obtain i.e. the width of a column.