Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting html labels #19

Open
drahnr opened this issue Sep 21, 2023 · 2 comments
Open

Supporting html labels #19

drahnr opened this issue Sep 21, 2023 · 2 comments

Comments

@drahnr
Copy link

drahnr commented Sep 21, 2023

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?

@nadavrot
Copy link
Owner

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

@drahnr
Copy link
Author

drahnr commented Sep 22, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants