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

Already on GitHub? Sign in to your account

Small floats are being rendered in exponential form and ignored #32

Closed
jfischoff opened this Issue Mar 31, 2013 · 5 comments

Comments

Projects
None yet
6 participants

Anything below 0.1 gets written out in exponential form i.e: "1e-2". Appearantly svg cannot parse a float in that form ... at least for stroke width, and some other attributes.

Owner

byorgey commented Mar 31, 2013

Can you also give precise information about which browser/other program you are using to view the SVGs? The SVG spec certainly allows this format for numbers (http://www.w3.org/TR/SVG/types.html#DataTypeNumber) but it may be that whatever SVG renderer you are using does not.

It doesn't work in the OSX finder preview, and Safari Version 6.0.3 (8536.28.10). Works fine in chrome and gimp.

My guess is that a workaround in blaze svg to render only decimal numbers would fix this, although it's frustrated that apple screwed this up.

Owner

fryguybob commented Mar 31, 2013

I experimented a little with emitting fewer digits to decrease the size of
the output a little while ago but similar code would need to be changed to
avoid IEEE scientific notation. In my case I used a newtype wrapper with a
different show instance here:
https://github.com/diagrams/diagrams-svg/blob/master/src/Graphics/Rendering/SVG.hs#L61-L65.
If it is just the linewidth that is parsing incorrectly then this isn't
that big of a change.

On Sun, Mar 31, 2013 at 2:41 PM, Jonathan Fischoff <notifications@github.com

wrote:

My guess is that a workaround in blaze svg to render only decimal numbers
would fix this, although it's frustrated that apple screwed this up.


Reply to this email directly or view it on GitHubhttps://github.com/diagrams/diagrams-svg/issues/32#issuecomment-15695833
.

I actually don't think it is just line width. I'll figure out the extent of the the issue.

On Mar 31, 2013, at 12:02 PM, Ryan Yates notifications@github.com wrote:

I experimented a little with emitting fewer digits to decrease the size of
the output a little while ago but similar code would need to be changed to
avoid IEEE scientific notation. In my case I used a newtype wrapper with a
different show instance here:
https://github.com/diagrams/diagrams-svg/blob/master/src/Graphics/Rendering/SVG.hs#L61-L65.
If it is just the linewidth that is parsing incorrectly then this isn't
that big of a change.

On Sun, Mar 31, 2013 at 2:41 PM, Jonathan Fischoff <notifications@github.com

wrote:

My guess is that a workaround in blaze svg to render only decimal numbers
would fix this, although it's frustrated that apple screwed this up.


Reply to this email directly or view it on GitHubhttps://github.com/diagrams/diagrams-svg/issues/32#issuecomment-15695833
.


Reply to this email directly or view it on GitHub.

@bergey bergey added bug and removed bug labels Aug 21, 2014

@cchalmers cchalmers referenced this issue Mar 27, 2015

Merged

State #74

@cchalmers cchalmers closed this in #74 Apr 1, 2015

@cchalmers cchalmers reopened this Apr 1, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment