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

FileOptions size should be optional #250

Open
ad-si opened this issue Apr 17, 2023 · 4 comments
Open

FileOptions size should be optional #250

ad-si opened this issue Apr 17, 2023 · 4 comments

Comments

@ad-si
Copy link

ad-si commented Apr 17, 2023

https://hackage.haskell.org/package/Chart-diagrams-1.9.4/docs/Graphics-Rendering-Chart-Backend-Diagrams.html#t:FileOptions size field should be Maybe (Double, Double). If it's set to Nothing, the width and height attributes would simply be omitted from the exported <svg> tag.

@treeowl
Copy link

treeowl commented Apr 18, 2023

I don't know much about this, but is it sometimes useful to include one and omit the other? That would lead to (Maybe Double, Maybe Double).

@ad-si
Copy link
Author

ad-si commented Apr 18, 2023

Yeah, good idea, that would be even better!

But I just realized that probably the size is necessary to calculate the layout of the SVG. So maybe there are two sizes necessary. E.g.:

  • render_size :: (Double, Double)
  • output_size :: (Maybe Double, Maybe Double)

@olorin37
Copy link

Or one size, but with additional parameter telling whether to include it in final image or not.

(I don't know if the size is require to render layout - just giving the idea in case it is).

@ad-si
Copy link
Author

ad-si commented Feb 7, 2024

Or one size, but with additional parameter telling whether to include it in final image or not.

But you might want to calculate / generate it in a specific size (e.g. 1 mm == 1 px) and then display it at another size. So this might actually even be a good idea if it's not necessary to calculate the layout. Just as a way to have some control over the value magnitudes.

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

3 participants