-
Notifications
You must be signed in to change notification settings - Fork 5
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
Force svg+xml for GraphViz object as a workaround #268
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #268 +/- ##
=======================================
Coverage 90.64% 90.64%
=======================================
Files 16 16
Lines 2170 2170
=======================================
Hits 1967 1967
Misses 203 203 ☔ View full report in Codecov by Sentry. |
Lets wait for @FraserP117 input before merging |
@@ -459,6 +459,40 @@ function convert_strategy(strategy::Symbol) | |||
end | |||
end | |||
|
|||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm reviewing/testing locally now. Apologies for the delay!
This is a good workaround until the GraphViz package can be updated from the deprecated Cstring vector representation. I did
in src/cairo.jl to
and that seems to fix the render bug. |
Very nice stuff @bvdmitri. I have tested this locally in VSCodium and Jupyter notebook. Both work quite well. When using Jupyter notebook, I do seem to get an error relating to the Cairo.jl renderer being unavailable - see the enclosed screenshots. We could hold it up and investigate further but I favour passing this PR and improving from there. Perhaps we can implement the fix that @jhlq used above - in the form of a PR to Cairo.jl? |
I think |
@FraserP117 gave me this idea in our private conversation and it actually worked pretty neatly!
Reference https://docs.julialang.org/en/v1/base/io-network/#Multimedia-I/O
The implementation wraps the GraphViz object in a "wrapper" that does only "support"
![Screenshot 2025-02-04 at 09 43 31](https://private-user-images.githubusercontent.com/6557701/409470125-0d5747bd-5ff2-4bef-94e3-2de253330ec4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1MDE2MjMsIm5iZiI6MTczOTUwMTMyMywicGF0a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YXR1cmU9NjAxOWYzMjU4ZjUxZjVlMmQwYzM4NTFlNDkzYTFkNjg5Yjk0MGVhYWEzZjdhNWQwYjk2ZGFhYzA4ZmZmMjYyNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.PhrLr1A2n0kkAOqntgL2FXwBFdua0PN7itDVeULLmeo)
svg
andtext
display formats.So now if display supports
svg
it will automatically show the svg image, otherwise it fallbacks to the dot strings as @FraserP117 planned originally. e.g compare: