Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 committed Apr 10, 2024
1 parent 4734735 commit 79fa62a
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 79 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ jobs:
- uses: julia-actions/julia-runtest@v1
with:
prefix: xvfb-run -s '-screen 0 1024x768x24'
env:
DISPLAY: 0
env:
DISPLAY: 0
- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
155 changes: 78 additions & 77 deletions test/tex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@ end
mkpath(joinpath(example_path, "texample"))

names = [
"rotated-triangle",
"city",
"planets",
"model-physics",
"smart-description",
"or-gate",
"polar-plot",
"dominoes",
"cielab"
"cielab",
]

for name in names
Expand Down Expand Up @@ -139,23 +138,6 @@ end

end

# @testset "Integrating with Axis" begin
# fig = Figure(fontsize = 12, size = (300, 300))
# ax = Axis(
# fig[1,1];
# xlabel = LaTeXString("time (\$t\$) in arbitrary units"),
# ylabel = LaTeXString("here we go fellas"),
# title = LaTeXString(raw"A \emph{convex} function $f \in C$ is \textcolor{blue}{denoted} as \tikz{\draw[line width=1pt, >->] (0, -2pt) arc (-180:0:8pt);}"),
# xtickformat = x -> latexstring.("a_{" .* string.(x) .* "}"),
# )
# # plot to the axis
# heatmap!(ax, Makie.peaks())

# @test_nowarn save_test("integrated_axis", fig)

# @test true
# end

@testset "Links" begin
td = TeXDocument(raw"""
\documentclass{standalone}
Expand All @@ -182,69 +164,88 @@ end
@test_nowarn save_test("link", fig)
end

# @testset "Text override" begin
# @testset "Font scaling" begin
# @test_nowarn begin
# fig = Figure(); l = l = Label(fig[1, 1], Makie.LaTeXString(raw"""A function that is convex is \raisebox{-2pt}{\tikz{\draw[line width=1pt, >->] (0, 0) arc (-180:0:8pt);}}
# """), textsize=16); fig
# end
# end
# @testset "Theming" begin
# @test_nowarn begin
# fig = with_theme(theme_dark()) do
# fig = Figure(fontsize = 12, size = (300, 300))
# ax = Axis(
# fig[1,1];
# xlabel = LaTeXString("time (\$t\$) in arbitrary units"),
# ylabel = LaTeXString("here we go fellas"),
# title = LaTeXString(raw"A \emph{convex} function $f \in C$ is \textcolor{blue}{denoted} as \tikz{\draw[line width=1pt, >->] (0, -2pt) arc (-180:0:8pt);}"),
# xtickformat = x -> latexstring.("a_{" .* string.(x) .* "}"),
# )
# # plot to the axis
# heatmap!(ax, Makie.peaks(); colormap = :inferno)
# fig
# end
# @test_nowarn save_test("theming", fig)
# end
# end
#=
# @testset "Rotated alignment for axis label" begin
# fig = Figure(; figure_padding = 100)
# ax1 = Axis(
# fig[1, 1];
# xtickformat = x -> latexstring.("a_{" .* string.(x) .* "}"),
# ylabel = L"\displaystyle \Phi(\vec x) = f(\vec x) + g(V)",
# #ylabelpadding = 15
# )
# heatmap!(ax1, Makie.peaks())
# scatter!(ax1.blockscene, ax1.blockscene.plots[end-6].plots[1].plots[1][1]; markersize = 10, color = :steelblue)
@testset "Integrating with Axis" begin
fig = Figure(fontsize = 12, size = (300, 300))
ax = Axis(
fig[1,1];
xlabel = LaTeXString("time (\$t\$) in arbitrary units"),
ylabel = LaTeXString("here we go fellas"),
title = LaTeXString(raw"A \emph{convex} function $f \in C$ is \textcolor{blue}{denoted} as \tikz{\draw[line width=1pt, >->] (0, -2pt) arc (-180:0:8pt);}"),
xtickformat = x -> latexstring.("a_{" .* string.(x) .* "}"),
)
# plot to the axis
heatmap!(ax, Makie.peaks())
# @test_nowarn save_test("axislabel_align", fig)
@test_nowarn save_test("integrated_axis", fig)
# end
@test true
end
# @testset "Rotation" begin

# fig = Figure()
# ax = fig[1, 1] = Axis(fig)
# pos = (500, 500)
# posis = Point2f[]
# scatter!(ax, posis, markersize=10)
# for r in range(0, stop=2pi, length=20)
# p = pos .+ (sin(r) * 100.0, cos(r) * 100)
# push!(posis, p)
# text!(ax, L"test",
# position=p,
# textsize=50,
# rotation=1.5pi - r,
# align=(:center, :center)
# )
# end
# fig
@testset "Text override" begin
@testset "Font scaling" begin
@test_nowarn begin
fig = Figure(); l = l = Label(fig[1, 1], Makie.LaTeXString(raw"""A function that is convex is \raisebox{-2pt}{\tikz{\draw[line width=1pt, >->] (0, 0) arc (-180:0:8pt);}}
"""), textsize=16); fig
end
end
@testset "Theming" begin
@test_nowarn begin
fig = with_theme(theme_dark()) do
fig = Figure(fontsize = 12, size = (300, 300))
ax = Axis(
fig[1,1];
xlabel = LaTeXString("time (\$t\$) in arbitrary units"),
ylabel = LaTeXString("here we go fellas"),
title = LaTeXString(raw"A \emph{convex} function $f \in C$ is \textcolor{blue}{denoted} as \tikz{\draw[line width=1pt, >->] (0, -2pt) arc (-180:0:8pt);}"),
xtickformat = x -> latexstring.("a_{" .* string.(x) .* "}"),
)
# plot to the axis
heatmap!(ax, Makie.peaks(); colormap = :inferno)
fig
end
@test_nowarn save_test("theming", fig)
end
end
# @test_nowarn save_test("rotation", fig)
# end
@testset "Rotated alignment for axis label" begin
fig = Figure(; figure_padding = 100)
ax1 = Axis(
fig[1, 1];
xtickformat = x -> latexstring.("a_{" .* string.(x) .* "}"),
ylabel = L"\displaystyle \Phi(\vec x) = f(\vec x) + g(V)",
#ylabelpadding = 15
)
heatmap!(ax1, Makie.peaks())
scatter!(ax1.blockscene, ax1.blockscene.plots[end-6].plots[1].plots[1][1]; markersize = 10, color = :steelblue)
# end
@test_nowarn save_test("axislabel_align", fig)
end
@testset "Rotation" begin
fig = Figure()
ax = fig[1, 1] = Axis(fig)
pos = (500, 500)
posis = Point2f[]
scatter!(ax, posis, markersize=10)
for r in range(0, stop=2pi, length=20)
p = pos .+ (sin(r) * 100.0, cos(r) * 100)
push!(posis, p)
text!(ax, L"test",
position=p,
textsize=50,
rotation=1.5pi - r,
align=(:center, :center)
)
end
fig
@test_nowarn save_test("rotation", fig)
end
end
=#
end

0 comments on commit 79fa62a

Please sign in to comment.