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

An Options method with AlgebraOfGraphics.FigureGrid as the first argument #275

Closed
dmbates opened this issue Apr 4, 2022 · 6 comments
Closed

Comments

@dmbates
Copy link

dmbates commented Apr 4, 2022

I haven't taken things apart to discover what the sequence of operations for a call to Options(...) is, but it seems that in recent versions of AlgebraOfGraphics the type of object returned by draw, AlgebraOfGraphics.FigureGrid, is no longer recognized as an object to be plotted. I needed to change from

Options(draw(...); caption="...", ...)

to

Options(draw(....).figure; caption="...", ...)

If you could give me a hint of where to look I would be willing to create a PR.

@dmbates
Copy link
Author

dmbates commented Apr 4, 2022

I should have looked more closely - FigureGrid is mentioned in src/outputs/aog.jl. I'm not sure what has gone wrong for me. I do keep getting warnings of the form

┌ Warning: Error requiring `AlgebraOfGraphics` from `Books`
│   exception =
│    LoadError: ArgumentError: Package Books does not have AlgebraOfGraphics in its dependencies:- You may have a partially installed environment. Try `Pkg.instantiate()`
│      to ensure all packages in the environment are installed.
│    - Or, if you have Books checked out for development and have
│      added AlgebraOfGraphics as a dependency but haven't updated your primary
│      environment's manifest file, try `Pkg.resolve()`.
│    - Otherwise you may need to report an issue with Books
│    Stacktrace:
│      [1] macro expansion
│        @ ./loading.jl:1051 [inlined]

when I load Books. Is there a particular order of using directives that I should be using? Right now my order is

using Books: Books

using Reexport
@reexport using AlgebraOfGraphics
@reexport using Arrow
@reexport using Books
@reexport using CairoMakie
...

@rikhuijzer
Copy link
Collaborator

rikhuijzer commented Apr 4, 2022

You can ignore that error. It is just a problem that Requires.jl hasn't solved yet. It should not introduce any problems.

So everything works if you use draw(....).figure?

EDIT: I just triggered CI to test whether it fails here too meaning that AlgebraOfGraphics.jl changed something.

@dmbates
Copy link
Author

dmbates commented Apr 4, 2022

Thanks for checking. Yes, it works if I use draw(....).figure.

@rikhuijzer
Copy link
Collaborator

rikhuijzer commented Apr 6, 2022

It was able to reproduce your issue. I've now added AlgebraOfGraphics.jl to the Project.toml which solved the issue for me. Now, also passing fg works. Please let me know if that's not the case.

The drawback of adding AlgebraOfGraphics.jl to the Project.toml is that it gets installed for anyone who installs Books.jl. However, the package isn't too big so it's a fair tradeoff, especially if it solves problems. The error should now also be gone.

EDIT: Should be fixed in Books.jl v1.2.5.

@dmbates
Copy link
Author

dmbates commented Apr 7, 2022

Thanks for addressing this, Rik. I should give you a heads-up that I have looking into quarto and have started converting our book to quarto format. I have experience with R and Rmarkdown and the quarto system has a familiar feel to it. I appreciate what you have done in Books.jl and the response that you have provided to us but I will probably go with quarto in the future.

@rikhuijzer
Copy link
Collaborator

Thanks for addressing this, Rik. I should give you a heads-up that I have looking into quarto and have started converting our book to quarto format. I have experience with R and Rmarkdown and the quarto system has a familiar feel to it. I appreciate what you have done in Books.jl and the response that you have provided to us but I will probably go with quarto in the future.

Yeah sure no worries. Like I said on https://books.huijzer.xyz/, there are some fundamental problems with Books.jl which also cannot easily be solved. For my own projects, I do still use the package, but I'm also aware that it isn't super great.

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