Skip to content

Commit e3e046c

Browse files
authored
Merge branch 'master' into master
2 parents ceb51c6 + 2fed095 commit e3e046c

35 files changed

+2503
-2106
lines changed

.github/workflows/CI.yml

Lines changed: 53 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: CI
32
on:
43
pull_request:
@@ -8,45 +7,76 @@ on:
87
branches:
98
- master
109
tags: '*'
10+
# needed to allow julia-actions/cache to delete old caches that it has created
11+
permissions:
12+
actions: write
13+
contents: read
1114
jobs:
1215
test:
13-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
16+
name: Tests, Julia ${{ matrix.version }} - ${{ matrix.os }}
1417
runs-on: ${{ matrix.os }}
1518
strategy:
1619
fail-fast: false
1720
matrix:
1821
version:
19-
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
20-
- 'nightly'
22+
- '1'
2123
os:
2224
- ubuntu-latest
25+
- windows
26+
- macos
2327
arch:
2428
- x64
2529
steps:
26-
- name: Checkout
27-
uses: actions/checkout@v2
28-
- uses: julia-actions/setup-julia@v1
30+
# Cancel ongoing CI test runs if pushing to branch again before the previous tests
31+
# have finished
32+
- name: Cancel ongoing test runs for previous commits
33+
uses: styfle/[email protected]
34+
with:
35+
access_token: ${{ github.token }}
36+
37+
# Do tests
38+
- uses: actions/checkout@v4
39+
- uses: julia-actions/setup-julia@v2
2940
with:
3041
version: ${{ matrix.version }}
3142
arch: ${{ matrix.arch }}
32-
- uses: actions/cache@v1
33-
env:
34-
cache-name: cache-artifacts
35-
with:
36-
path: ~/.julia/artifacts
37-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
38-
restore-keys: |
39-
${{ runner.os }}-test-${{ env.cache-name }}-
40-
${{ runner.os }}-test-
41-
${{ runner.os }}-
42-
- name: Install latex
43-
run: sudo apt-get update && sudo apt-get install -y texlive-full texlive-luatex latexmk
44-
- name: Install master branch of Makie et al
45-
run: julia --project=@. -e 'using Pkg; pkg"add Makie CairoMakie MakieCore"'
43+
- uses: julia-actions/cache@v2
4644
- uses: julia-actions/julia-buildpkg@v1
4745
- uses: julia-actions/julia-runtest@v1
48-
- uses: actions/upload-artifact@v3
46+
env:
47+
DISPLAY: ':0'
48+
with:
49+
prefix: xvfb-run -s '-screen 0 1024x768x24'
50+
- uses: actions/upload-artifact@v4
4951
if: always()
5052
with:
5153
name: test_images
52-
path: test/test_images/
54+
path: test_images/
55+
docs:
56+
name: Build and deploy documentation
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Install binary dependencies
60+
run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
61+
- uses: actions/checkout@v4
62+
- name: Download all workflow run artifacts
63+
uses: actions/download-artifact@v4
64+
- uses: julia-actions/setup-julia@latest
65+
with:
66+
version: '1'
67+
- uses: julia-actions/cache@v2
68+
- name: Install documentation dependencies
69+
run: |
70+
xvfb-run -s '-screen 0 1024x768x24' julia --project=docs -e '
71+
using Pkg
72+
Pkg.develop(PackageSpec(path=pwd()))
73+
# Pkg.add([PackageSpec(name = "DocumenterVitepress", rev = "master"), PackageSpec(name = "Makie", rev = "master"), PackageSpec(name = "MakieCore", rev = "master"), PackageSpec(name = "CairoMakie", rev = "master")])
74+
Pkg.instantiate()'
75+
env:
76+
DISPLAY: ':0'
77+
- name: Build and deploy
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
80+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key
81+
DISPLAY: ':0'
82+
run: xvfb-run -s '-screen 0 1024x768x24' julia --project=docs/ docs/make.jl deploy

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
/dev/
77
/docs/build/
88
/docs/site/
9-
9+
/docs/Manifest.toml
1010
test/test_images

Project.toml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,49 @@
11
name = "MakieTeX"
22
uuid = "6d554a22-29e7-47bd-aee5-0c5f06619414"
3-
authors = ["Anshul Singhvi"]
4-
version = "0.3"
3+
authors = ["Anshul Singhvi <[email protected]>, and contributors"]
4+
version = "0.4.1"
55

66
[deps]
7+
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
78
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
8-
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
99
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
1010
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
1111
Ghostscript_jll = "61579ee1-b43e-5ca0-a5da-69d92c66a64b"
1212
Glib_jll = "7746bdde-850d-59dc-9ae8-88ece973131d"
1313
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
1414
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
15-
Perl_jll = "83958c19-0796-5285-893e-a1267f8ec499"
1615
Poppler_jll = "9c32591e-4766-534b-9725-b71a8799265b"
16+
Rsvg = "c4c386cf-5103-5370-be45-f3a111cca3b8"
17+
Typstry = "f0ed7684-a786-439e-b1e3-3b82803b501e"
1718
tectonic_jll = "d7dd28d6-a5e6-559c-9131-7eb760cdacc5"
1819

20+
[weakdeps]
21+
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
22+
23+
[extensions]
24+
MakieTeXCairoMakieExt = "CairoMakie"
25+
1926
[compat]
2027
Cairo = "1.0.5"
21-
CairoMakie = "0.10"
28+
CairoMakie = "0.12.2"
2229
Colors = "0.9, 0.10, 0.11, 0.12"
2330
DocStringExtensions = "0.8, 0.9"
31+
Ghostscript_jll = "9"
32+
Glib_jll = "2"
2433
LaTeXStrings = "1"
25-
Makie = "0.18, 0.19"
26-
Poppler_jll = "21.9"
27-
julia = "1"
34+
Makie = "0.21.2"
35+
Poppler_jll = "21.9, 22, 23"
36+
Rsvg = "1"
37+
julia = "1.9"
38+
Typstry = "0.2"
39+
tectonic_jll = "0"
2840

2941
[extras]
42+
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
3043
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
44+
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
3145
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
46+
WGLMakie = "276b4fcb-3e11-5398-bf8b-a0c2d153d008"
3247

3348
[targets]
34-
test = ["Test", "Downloads"]
49+
test = ["Test", "Downloads", "CairoMakie", "GLMakie", "WGLMakie"]

README.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
# <img src="https://user-images.githubusercontent.com/32143268/165514916-4337e55a-18ec-4831-ab0f-11ebcb679600.svg" alt="MakieTeX.jl" height="50" align = "top">
2+
3+
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliaplots.github.io/MakieTeX.jl/stable/)
4+
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliaplots.github.io/MakieTeX.jl/dev/)
5+
[![Build Status](https://github.com/JuliaPlots/MakieTeX.jl/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/JuliaPlots/MakieTeX.jl/actions/workflows/CI.yml?query=branch%3Amaster)
6+
27
## <a href = "https://www.latex-project.org/"><img src="https://upload.wikimedia.org/wikipedia/commons/9/92/LaTeX_logo.svg" alt="LaTeX" height="30" align = "top"></a> integration for <a href = "https://www.github.com/MakieOrg/Makie.jl"><img src="https://raw.githubusercontent.com/MakieOrg/Makie.jl/master/assets/logo.png" alt="Makie.jl" height="30" align = "top"></a>
38

49
<img src="https://user-images.githubusercontent.com/32143268/169671023-4d4c8cf7-eb3d-4ee1-8634-8b73fa38d31c.svg" height=400></img>
510

611

7-
MakieTeX allows you to draw and visualize arbitrary TeX documents in Makie! You can insert anything from a single line of math to a large and complex TikZ diagram.
12+
MakieTeX allows you to draw and visualize arbitrary vector documents (TEX, Typst, PDF, SVG) in Makie! You can insert anything from a single line of math to a large and complex TikZ diagram.
813

9-
It works by compiling a stand-alone <img src="https://upload.wikimedia.org/wikipedia/commons/9/92/LaTeX_logo.svg" alt="LaTeX" height="20" align = "center"></a> document to PDF. For CairoMakie, the PDF is read and rendered directly, and a raster image is rendered in GLMakie.
14+
It works by compiling a stand-alone $\LaTeX$ document to PDF. For CairoMakie, the PDF is read and rendered directly, and a raster image is rendered in GLMakie.
1015

1116
### Quick start
1217
```julia
1318
using Makie, MakieTeX
1419
using CairoMakie # or whichever other backend
1520
fig = Figure()
16-
l1 = Label(
21+
l1 = LTeX(
1722
fig[1, 1], L"A \emph{convex} function $f \in C$ is \textcolor{blue}{denoted} as \tikz{\draw[line width=1pt, >->] (0, -2pt) arc (-180:0:8pt);}";
1823
tellwidth = false, tellheight = true
1924
)
@@ -25,6 +30,14 @@ fig
2530
```
2631
<img src="https://user-images.githubusercontent.com/32143268/170724177-d7cf9d16-8feb-4f6e-bb22-68fa8269066c.svg" height=300></img>
2732

33+
You can also plot SVGs and PDFs in a similar manner using the `SVGDocument` and `PDFDocument` types. The easiest way to construct these is to use constructors of the form:
34+
```julia
35+
SVGDocument(read("file.svg", String))
36+
PDFDocument(read("file.pdf", String))
37+
```
38+
and you can pass them in the same places you would pass CachedTeX.
39+
40+
Some examples of using PDF and SVG are in the documentation linked at the top of the README, as well as in other packages like SwarmMakie.
2841

2942
You need not install anything for MakieTeX to work, since we ship a minimal TeX renderer called [`tectonic`](https://tectonic-typesetting.github.io/en-US/) (based on XeLaTeX). This will download any missing packages when it encounters them the first time. However, it will likely not know about any local packages or TEXMF paths, nor will it be able to render advanced features like TikZ graphs which require LuaTeX. The latexmk/lualatex combination will also likely be faster, and able to use advanced features like calling to other languages with `pythontex` (oh, the heresy!)
3043

@@ -43,7 +56,7 @@ We provide a layoutable object, `LTeX`, which aims to solve this. `LTeX`s are f
4356
An example follows:
4457

4558
```julia
46-
fig = Figure(resolution = (400, 300));
59+
fig = Figure(size = (400, 300));
4760
tex1 = LTeX(fig[1, 1], L"\int \mathbf E \cdot d\mathbf a = \frac{Q_{encl}}{4\pi\epsilon_0}", scale=1);
4861
tex2 = LTeX(fig[2, 1], L"\int \mathbf E \cdot d\mathbf a = \frac{Q_{encl}}{4\pi\epsilon_0}", scale=2);
4962
fig
@@ -90,7 +103,7 @@ This example is from [Texample.net](https://texample.net/tikz/examples/title-gra
90103
using MakieTeX, CairoMakie, Makie
91104
td = TeXDocument(read(download("https://texample.net/media/tikz/examples/TEX/title-graphics.tex"), String))
92105
fig = Figure()
93-
lt = Label(fig[1, 1], td; tellheight=false)
106+
lt = LTeX(fig[1, 1], td; tellheight=false)
94107
ax = Axis(fig[1, 2])
95108
lines!(ax, rand(10); color = 1:10)
96109
fig

docs/Data.toml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
data_config_version = 0
2+
uuid = "c9f88755-cec1-4fc7-a16e-0de771f0bcda"
3+
name = "microbench-graph"
4+
plugins = ["store", "defaults", "memorise"]
5+
6+
[config.defaults.storage._]
7+
checksum = "auto"
8+
9+
[[file-icons]]
10+
uuid = "da0197d0-a0bd-4c7d-a3d6-54b8d28addfc"
11+
description = "Source files for the custom icon-font used by the File-Icons package"
12+
13+
[[file-icons.storage]]
14+
driver = "git"
15+
checksum = "k12:93dff68faee99aed4240d426603a717c"
16+
clone = true
17+
path = "svg"
18+
remote = "https://github.com/file-icons/icons.git"
19+
revision = "e6e6e6ac8cb1d91867167c228c00a667f4d47101"
20+
21+
[[file-icons.loader]]
22+
driver = "tar"
23+
24+
[[file-icons-devopicons]]
25+
uuid = "20e42fdd-10db-44f8-8b18-205158e48afe"
26+
description = "Heavily-optimised version of the Devicons icon-font"
27+
28+
[[file-icons-devopicons.storage]]
29+
driver = "git"
30+
checksum = "k12:96bb50765d4b99ec67e6c21ae6654f54"
31+
clone = true
32+
path = "svg"
33+
remote = "https://github.com/file-icons/DevOpicons.git"
34+
revision = "2c2bf2bdb6507b8e4bfe695c1d54d639fbfed479"
35+
36+
[[file-icons-devopicons.loader]]
37+
driver = "tar"
38+
39+
[[file-icons-mfixx]]
40+
uuid = "d4cd9be5-869c-4b63-a0ec-8fb172c192f2"
41+
description = "Optimised version of the MFizz icon font"
42+
43+
[[file-icons-mfixx.storage]]
44+
driver = "git"
45+
checksum = "k12:a839aaf0f57a1a63d0ed2b5c13546850"
46+
clone = true
47+
path = "svg"
48+
remote = "https://github.com/file-icons/MFixx.git"
49+
revision = "9bc4e3734898a07d3ff1b452f90446368d6baf12"
50+
51+
[[file-icons-mfixx.loader]]
52+
driver = "tar"
53+
54+
[[go-logo-solid]]
55+
uuid = "09662418-cff6-4456-88ee-4a348b771eef"
56+
description = "Solid go logo"
57+
58+
[[go-logo-solid.storage]]
59+
driver = "web"
60+
checksum = "k12:de75d60ae2c948cc904d129afb8efb37"
61+
url = "https://raw.githubusercontent.com/file-icons/icons/master/svg/Go-Old.svg"
62+
63+
[[go-logo-solid.loader]]
64+
driver = "passthrough"
65+
66+
[[linguist-langs]]
67+
uuid = "6ef087f1-17ee-4d7e-93bb-8a3b49c0fc69"
68+
description = "Linguist language data listing"
69+
70+
[[linguist-langs.storage]]
71+
driver = "web"
72+
checksum = "k12:aa2cd4d4a862c53b0fc0e53e381f798d"
73+
url = "https://github.com/github-linguist/linguist/raw/4a807b475da9715fb20c5bbed34d0e2d97879e3a/lib/linguist/languages.yml"
74+
75+
[[linguist-langs.loader]]
76+
driver = "yaml"
77+
78+
[[microbench]]
79+
uuid = "acf3ac73-6fea-49c6-9612-cc056a2f49b2"
80+
description = "Julia Microbenchmark data"
81+
82+
[[microbench.storage]]
83+
driver = "web"
84+
checksum = "k12:9d670b7cf573b71e7f9ef8773c3d278c"
85+
url = "https://raw.githubusercontent.com/JuliaLang/Microbenchmarks/master/bin/benchmarks.csv"
86+
87+
[[microbench.loader]]
88+
driver = "csv"
89+
90+
[microbench.loader.args]
91+
header = ["language", "benchmark", "time"]

0 commit comments

Comments
 (0)