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

Is it possible to fix Chart-diagrams to work with SVGFonts 1.8 #232

Closed
expipiplus1 opened this issue Oct 19, 2021 · 9 comments
Closed

Is it possible to fix Chart-diagrams to work with SVGFonts 1.8 #232

expipiplus1 opened this issue Oct 19, 2021 · 9 comments

Comments

@expipiplus1
Copy link

There are a few breaking changes which need to be accommodated. I had a glance at fixing these but some were non-obvious.

Graphics/Rendering/Chart/Backend/Diagrams.hs:398:59: error:
    Not in scope: ‘F.textSVG'’
    Perhaps you meant ‘F.textSVG’ (imported from Graphics.SVGFonts)
    Neither ‘Graphics.SVGFonts’,
            ‘Graphics.SVGFonts.CharReference’ nor ‘Graphics.SVGFonts.ReadFont’ exports ‘textSVG'’.
    |
398 |                 { textSizeWidth = realToFrac $ D2.width $ F.textSVG' (fontStyleToTextOpts env) text
    |                                                           ^^^^^^^^^^

Graphics/Rendering/Chart/Backend/Diagrams.hs:418:12: error:
    Not in scope: ‘F.textSVG_’
    Perhaps you meant ‘F.textSVG’ (imported from Graphics.SVGFonts)
    Neither ‘Graphics.SVGFonts’,
            ‘Graphics.SVGFonts.CharReference’ nor ‘Graphics.SVGFonts.ReadFont’ exports ‘textSVG_’.
    |
418 |          $ F.textSVG_ (fontStyleToTextOpts env) text
    |            ^^^^^^^^^^

Graphics/Rendering/Chart/Backend/Diagrams.hs:578:9: error:
    Not in scope: ‘F.mode’
    Neither ‘Graphics.SVGFonts’,
            ‘Graphics.SVGFonts.CharReference’ nor ‘Graphics.SVGFonts.ReadFont’ exports ‘mode’.
    |
578 |       , F.mode = F.INSIDE_H
    |         ^^^^^^

Graphics/Rendering/Chart/Backend/Diagrams.hs:578:18: error:
    Not in scope: data constructor ‘F.INSIDE_H’
    Neither ‘Graphics.SVGFonts’,
            ‘Graphics.SVGFonts.CharReference’ nor ‘Graphics.SVGFonts.ReadFont’ exports ‘INSIDE_H’.
    |
578 |       , F.mode = F.INSIDE_H
    |                  ^^^^^^^^^^

Graphics/Rendering/Chart/Backend/Diagrams.hs:581:9: error:
    Not in scope: ‘F.textWidth’
    Neither ‘Graphics.SVGFonts’,
            ‘Graphics.SVGFonts.CharReference’ nor ‘Graphics.SVGFonts.ReadFont’ exports ‘textWidth’.
    |
581 |       , F.textWidth = 1
    |         ^^^^^^^^^^^

Graphics/Rendering/Chart/Backend/Diagrams.hs:582:9: error:
    Not in scope: ‘F.textHeight’
    Neither ‘Graphics.SVGFonts’,
            ‘Graphics.SVGFonts.CharReference’ nor ‘Graphics.SVGFonts.ReadFont’ exports ‘textHeight’.
    |
582 |       , F.textHeight = scaledH -- _font_size fs
    |         ^^^^^^^^^^^^
@timbod7
Copy link
Owner

timbod7 commented Oct 21, 2021

I've always used stack to build the chart library, and note that https://www.stackage.org/lts-16.31 was the last lts release to include SVGfonts. I note that even the most recent nightly release doesn't include SVGFonts ?

@expipiplus1
Copy link
Author

Yeah, it's regrettable that SVGFonts has dropped off Stackage, although I guess if it's ever put back in it'll be the latest version.

@byorgey
Copy link
Contributor

byorgey commented Nov 15, 2021

Just wanted to mention here that I put together a migration guide for SVGFonts-1.8: https://github.com/diagrams/SVGFonts#porting-to-version-18 . If you like, I'd be happy to help put together a PR to update Chart.

@timbod7
Copy link
Owner

timbod7 commented Nov 15, 2021

Thanks @byorgey. I'll take a look at the migration advice.

@simonmichael
Copy link

+1, a release supporting current SVGFonts (and ideally, SVGFonts and Chart back in stackage) would help with hls packaging.

@414owen
Copy link

414owen commented May 20, 2022

It looks like @bravit made a revision to 1.9.3 that enabled SVGFonts 1.8: https://hackage.haskell.org/package/Chart-diagrams-1.9.3/revisions/

I'm still seeing errors (mainly Not in scope: ‘F.textSVG') though.

Am I missing something? I've set a bound in my project to < 1.8 to work around it.
I don't see any changes on master that would fix charts-diagrams for SVGFonts 1.8

@byorgey
Copy link
Contributor

byorgey commented May 20, 2022

Note that SVGFonts is back in Stackage now. My offer from above to help put together a PR to update Chart still stands. At this point maybe I will just put a PR together and see where it goes from there.

@bravit
Copy link
Collaborator

bravit commented May 21, 2022

Thanks, @byorgey, I'll look into this today.

@bravit
Copy link
Collaborator

bravit commented May 21, 2022

Fixed with 91d82bf

@bravit bravit closed this as completed May 21, 2022
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

6 participants