-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a4d8780
commit 1fe67d0
Showing
12 changed files
with
68 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,18 +4,17 @@ authors = ["Rik Huijzer <[email protected]>"] | |
version = "0.1.0" | ||
|
||
[deps] | ||
AlgebraOfGraphics = "cbdf2221-f076-402e-a563-3d30da359d67" | ||
Books = "939d5c6b-51ae-42e7-97ca-7564d0d4ad91" | ||
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" | ||
CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2" | ||
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" | ||
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" | ||
Gadfly = "c91e804a-d5a3-530f-b6f0-dfbca275c004" | ||
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316" | ||
MCMCChains = "c7f686f2-ff18-58e9-bc7b-31028e88f75d" | ||
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" | ||
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76" | ||
|
||
# Only setting compat entries when there is not already one in the main Project.toml. | ||
[compat] | ||
Gadfly = "1.3" | ||
Latexify = "0.15" | ||
MCMCChains = "4.9" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@debug "Loading AlgebraOfGraphics support into Books via Requires" | ||
|
||
using AlgebraOfGraphics | ||
using CairoMakie | ||
|
||
function convert_output(path, fg::AlgebraOfGraphics.FigureGrid; caption=nothing, label=nothing) | ||
im_dir = joinpath(BUILD_DIR, "im") | ||
mkpath(im_dir) | ||
|
||
if isnothing(path) | ||
# Not determining some random name here, because it would require cleanups too. | ||
msg = """ | ||
It is not possible to write an image without specifying a path. | ||
Use `Options(p; filename=filename)` where `p` is a AlgebraOfGraphics plot. | ||
""" | ||
throw(ErrorException(msg)) | ||
end | ||
file, _ = method_name(path) | ||
|
||
println("Writing plot images for $file") | ||
svg_filename = "$file.svg" | ||
svg_path = joinpath(im_dir, svg_filename) | ||
# Explicit rm due to https://github.com/JuliaIO/FileIO.jl/issues/338. | ||
rm(svg_path; force=true) | ||
AlgebraOfGraphics.save(svg_path, fg) | ||
|
||
png_filename = "$file.png" | ||
png_path = joinpath(im_dir, png_filename) | ||
rm(png_path; force=true) | ||
px_per_unit = 3 # Ensure high resolution. | ||
AlgebraOfGraphics.save(png_path, fg; px_per_unit) | ||
|
||
im_link = joinpath("im", svg_filename) | ||
caption, label = caption_label(path, caption, label) | ||
pandoc_image(file, png_path; caption, label) | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
[deps] | ||
AlgebraOfGraphics = "cbdf2221-f076-402e-a563-3d30da359d67" | ||
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" | ||
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
Gadfly = "c91e804a-d5a3-530f-b6f0-dfbca275c004" | ||
MCMCChains = "c7f686f2-ff18-58e9-bc7b-31028e88f75d" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
||
# Only setting compat entries when there is not already one in the main Project.toml. | ||
[compat] | ||
Documenter = "0.26" | ||
Gadfly = "1.3" | ||
MCMCChains = "4.9" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters