-
Notifications
You must be signed in to change notification settings - Fork 284
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
Julia Makie resolution
depreciated.
#7817
Comments
Thanks, that's good to know. We probably will need to be careful. At the very least, we'd add version checks for the time being, since I don't think we can assume everyone will have instantly updated to 0.20 |
I was having some issue today reproducing results I had yesterday using GLMakie + Quarto. Running some tests I had added CairoMakie to my Project.toml but was suprised to find changes even though I didn't ever load CairoMakie. One issue with the current So, when CairoMakie is not in the environment everything is fine. But when it is the theme is overridden and the Makie warning isn't shown as |
I'm trying to understand the context here. Do I understand correctly that this is unrelated to the |
My apologies for my confusing comment. The depreciation of
Note how Quarto's
This line is contained in a try-catch block that calls import CairoMakie .
So, if a user uses the following in Quarto, the output will actually depend on if they have CairoMakie available in the environment. using GLMakie # NOTE NOT CairoMakie
f = Figure(size = (100,100)) If CairoMakie is not available the I will try to put together a MWE that illustrates this. |
I understand you now. Since you have more experience with Makie than we do, would you be willing to write a PR that addresses these issues in a way that works for 0.20.0 and doesn't for 0.19.0? I'd be more than happy to help you on the Quarto side. |
MWE. no_cairomakie.pdf and with_cairomakie.pdf shows the results without and with CairoMakie in the environment, respectively.
|
I am happy to help. I have an idea of how to handle the various versions, but it would probably be a hack. The fact that 0.20.0 now interprets the size
B/c of this there may be a much better way to integrate Makie w/ Quarto. I will ping the Makie devs on Julia's slack to this issue to try to get their thoughts. |
We earnestly do not mind hacks at all in Quarto as long as the improvement in user experience is worth it (and I agree with you that getting good high-DPI support would be 100% worth it!) |
Side note:
This is a bit inaccurate. When using other formats such as ---
title: Title
jupyter: julia-1.9
format:
revealjs: default
html: default
---
```{julia}
@warn "This is a warning message"
``` |
Welp, I spent most of the day getting a working PR put together. However, unfortunately, the required corporate contributor agreement is problematic. The time and energy that it will take, from both our sides, will far outweigh the value of my contribution. If you see another path forward, let me know. |
Totally understood, and I apologize, I should have let you know ahead of time. It's not something we control on our end either. |
I can't tell what's going wrong here, what are the actual theme values for resolution that quarto sets for you? Does the wide image actually correspond to that? In principle, setting resolution should still work as before, only the effective pixel size of the output changes because the |
@jkrumbiegel (first, thanks for Makie!) By default, Quarto calls CairoMakie.update_theme!(resolution=(fig_width, fig_height)) Where I'm not sure what @agerlach originally asked, but as a Quarto dev, I can tell you that what we'd like to be able to offer is "as-good-as-possible" defaults across the many different formats and configurations that Quarto covers. It seems that Quarto should be setting Final question -- and I apologize -- How should we check for the version of CairoMakie? We'd like to do the right thing for v0.20, but not break in older installs. I'm assuming the recommended way is to iterate through |
@cscheid I certainly understand why its needed. I pinged the Makie and Quarto users on Julia slack to the issue. jkrembiegel is one of the Makie devs.
@jkrumbiegel The default values used by Quarto are dependent on the document format. See the defaults here. The pdfs I posted above were prints of a "HTML Slides (reveal.js)" which defaults to 9 x 5. Quarto injects a "startup cell" into the intermediate jupyter notebook that runs https://github.com/quarto-dev/quarto-cli/blob/a2b6663ad987e01e0ae9f13206b8017857052ced/src/resources/jupyter/lang/julia/setup.jl which sets quarto-cli/src/resources/jupyter/lang/julia/setup.jl Lines 47 to 71 in a2b6663
![]() However, if CairoMakie is not available in the stacked environment the setting is not overridden. This is generated using the exact same Quarto code but w/ CairoMakie removed from the environment. So, I see a couple of issues.
|
Have there been any further developments on this issue? The Quarto/CairoMakie combination is important to me and I would be happy to help in whatever way I can to come up with workarounds, etc. |
Not yet as this is scheduled for 1.5 as you can see from the milestone on the right. We'll update here where there is.
Thanks a lot for offering your help. We welcome PR, provided that a contributor agreement can be signed. (https://github.com/quarto-dev/quarto-cli/blob/main/.github/CONTRIBUTING.md#to-submit-a-contribution-using-a-pull-request) We'll get to 1.5 issues, once 1.4 is released, which should be soon. |
To follow up on some of the points made by @agerlach and @jkrumbiegel
julia> import Pkg, UUIDs
julia> makie_uuid = UUIDs.UUID("ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a")
UUID("ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a")
julia> deps = Pkg.dependencies();
julia> haskey(deps, makie_uuid) # is the Makie package available?
true and establish the version as julia> deps[makie_uuid].version
v"0.20.4"
julia> deps[makie_uuid].is_direct_dep
false in which case, as far as I know, you can't So, if If @jkrumbiegel and @agerlach think this approach makes sense I could create a PR or just describe the approach in a bit more detail so that a PR can be created at Posit. |
This issue is affecting our book written in Quarto. See the visualizations in this chapter: https://juliaearth.github.io/geospatial-data-science-with-julia/02-geoviz.html |
@juliohm A temporary fix to avoid warnings appearing in the output is to add
to the code blocks creating the figures. Of course, a long-term solution is still needed. |
Thank you @dmbates , I agree. I am positive that Quarto maintainers are taking a look into it 🙏🏽 |
@juliohm That doesn't look like the same issue to me. I can't see how a DPI setting could cause a mangled output like that. Can you open a new issue? Thank you. |
@cscheid I can't see it either. It is hard to isolate the issue given that it is getting worse with time. Can this issue be considered a high-priority bug? It was opened > 3 months already, and is starting to compromise our ability to deliver educational content as end-users of Quarto + Julia. |
Sorry, can you say more about how this specific bug is compromising your ability to deliver content? I understand that we'd like to fix the DPI issues, but I currently don't estimate this bug to be more urgent than the other bugs that we are handling on a daily basis. As always, this is an open source project, and if you have the time and willingness to contribute an appropriate fix, we'll be happy to take it. (WRT your other bug, I don't see how it could be related to the deprecation of |
We cannot update the book, nor trigger the CI to update the deployed book online. There are chapters and improvements in the works, and we are currently unable to push these additions because it will break the whole set of visualizations already deployed. |
Can you share the high-level steps to fix this issue? We have Julia skills, and can try to find people with JS/TS skills to help. |
I believe @agerlach shared its investigation first at #7817 (comment) and then on this comment #7817 (comment) showing what is currently done in This bug here is related to Hope this helps. Thanks for considering contributing a PR ! |
@juliohm I've dug into this issue a bit and I have a hard time imagining that what you are experiencing is related to my OP. I do have some suggestions for you to test
I originally made a PR that address the OP, HOWEVER, contributing to this project requires signing legal documents that would be doable, but extremely painful given the size of my organization. I would encourage you to look at my fork/PR for inspiration. |
@cscheid @cderv The more that I've thought about this issue the more I am convinced that Quarto is trying to do too much with respect to plotting in setup.jl. My primary issue with it is that it loads Plots/ Makie simply if it is a users environment even if they don't want it loaded. I would prefer setup.jl to simply define the following and put the onus on the user to configure the size of whatever plotting package they are using. This can be aided via documentation.
|
@agerlach understood. I'm going to have to discuss this with the team because it will be a breaking change to our previous behavior, but what you're saying makes sense. |
I can confirm that this does not fix the issue, probably unrelated then. |
The issue reported above where the figure is displayed with stripes is caused by a new version of Cairo_jll. I am fixing Cairo_jll at v1.16 now to get the correct plots. I don't know why this only happens in Quarto though. |
@juliohm are you using svg or png? I assume svg since png is a binary format. In some modes, quarto or pandoc are modifying svg files to circumvent certain issues like conflicts between assets on a page. I filed an issue about such a bug some weeks ago which was fixed in pandoc but isn't yet in released quarto. Might be that the new Cairo version outputs slightly different svg code that surfaced another bug in this transformation code. I would cross check the svg code of a broken svg using quarto with the same svg rendered outside of quarto. |
We use SVG. Only one chapter uses PNG because of the large number of figures. |
quarto-cli/src/resources/jupyter/lang/julia/setup.jl
Line 58 in a2b6663
Makie recently made a release that adds High DPI support (#2544 & #2346) which depreciates
resolution
in favor ofsize
. I suspect this change will be positive for Quarto integration. See their blog post for additional details as the breaking change if more than just changing the kwarg name.Currently, setting
resolution
overrides the High DPI upgrades. A depreciation warning is shown, but doesn't appear in final documents by default.A current work around is to reset the Makie theme to the default via
set_theme!()
The text was updated successfully, but these errors were encountered: