Skip to content

Commit a42a9b8

Browse files
committed
update tagbot
1 parent 836a1ab commit a42a9b8

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

.github/workflows/TagBot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ jobs:
1313
with:
1414
token: ${{ secrets.GITHUB_TOKEN }}
1515
ssh: ${{ secrets.DOCUMENTER_KEY }}
16-
registry: Happy-Diode/Miskatonic

project/vizugrid.jl

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
using UnitDiskMapping
2+
using UnitDiskMapping.TikzGraph
23

34
function print_mapback(folder::String)
45
for (p, sub) in ((Cross{true}(), "crosscon"), (Cross{false}(), "cross"),
5-
(Turn(), "turn"))
6+
(Branch(), "branch"), (TCon(), "tcon"))
67
println()
78
println(typeof(p))
89
for (bc, bcs) in allbcs(p)
@@ -75,15 +76,4 @@ function latex_config(p::Pattern, config)
7576
end
7677
s *= raw"\end{matrix}\end{equation*}"
7778
return s
78-
end
79-
80-
using UnitDiskMapping, Graphs
81-
82-
g = SimpleGraph(5)
83-
for (i,j) in [(1,2), (2,4), (1,3), (3,4), (4,5), (1,5)]
84-
add_edge!(g, i, j)
85-
end
86-
ug = embed_graph(g)
87-
join(["$((ci.I[1],ci.I[2]))" for ci in findall(!iszero, ug.content)], ", ")
88-
ug2 = apply_gadgets!(copy(ug))[1]
89-
join(["$((ci.I[1],ci.I[2]))" for ci in findall(!iszero, ug2.content)], ", ")
79+
end

src/tikz/tikz.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module TikzGraph
22
export rgbcolor!, Node, Line, BoundingBox, Mesh, Canvas, >>, command, canvas, generate_standalone, StringElement, PlainText, uselib!
3-
export Cycle, Controls, annotate, Annotate, autoid!, vizgraph!
3+
export Cycle, Controls, annotate, Annotate, autoid!, vizgraph!, writepdf
44

55
const instance_counter = Ref(0)
66
abstract type AbstractTikzElement end
@@ -99,7 +99,7 @@ function Mesh(xmin, xmax, ymin, ymax; step="1.0cm", draw="gray", line_width=0.03
9999
Mesh(xmin, xmax, ymin, ymax, build_props(; step=step, draw=draw, line_width=line_width, kwargs...))
100100
end
101101
function command(grid::Mesh)
102-
return "\\draw[$(parse_args(String[], grid.props))] ($(grid.xmin),$(grid.ymin)) grid ($(grid.xmax),$(grid.ymax));"
102+
return "\\draw[$(parse_args(String[], grid.props))] ($(grid.xmin-1e-3),$(grid.ymin-1e-3)) grid ($(grid.xmax),$(grid.ymax));"
103103
end
104104

105105
struct Cycle end
@@ -184,6 +184,11 @@ function Base.write(io::IO, canvas::Canvas)
184184
write(io, generate_standalone(canvas))
185185
end
186186

187+
function writepdf(filename::AbstractString, canvas::Canvas)
188+
write(filename, canvas)
189+
run(`latexmk -pdf $filename -output-directory=$(dirname(filename))`)
190+
end
191+
187192
function vizgraph!(c::Canvas, locations::AbstractVector, edges; fills=fill("black", length(locations)),
188193
texts=fill("", length(locations)), ids=[autoid!() for i=1:length(locations)], minimum_size="0.4cm",
189194
draw="", line_width="1pt", edgecolors=fill("black", length(edges)))

0 commit comments

Comments
 (0)