haskell-chart icon indicating copy to clipboard operation
haskell-chart copied to clipboard

FileOptions size should be optional

Open ad-si opened this issue 1 year ago • 4 comments

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.

ad-si avatar Apr 17 '23 21:04 ad-si

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).

treeowl avatar Apr 18 '23 20:04 treeowl

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)

ad-si avatar Apr 18 '23 20:04 ad-si

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).

olorin37 avatar Apr 24 '23 04:04 olorin37

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.

ad-si avatar Feb 07 '24 10:02 ad-si