Skip to content

Commit e160839

Browse files
committed
fix context not found error
1 parent 0c20edb commit e160839

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GraphTensorNetworks"
22
uuid = "0978c8c2-34f6-49c7-9826-ea2cc20dabd2"
33
authors = ["GiggleLiu <cacate0129@gmail.com> and contributors"]
4-
version = "0.2.3"
4+
version = "0.2.4"
55

66
[deps]
77
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"

src/visualize.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function get_rescaler(locs::AbstractVector{<:Tuple}, pad)
5252
return Rescaler(promote(xmin, xmax, ymin, ymax, pad)...)
5353
end
5454

55-
default_vertex_style(scale, stroke_color, fill_color) = compose(context(), Viznet.nodestyle(:default, r=0.15cm*scale), Compose.stroke(stroke_color), fill(fill_color), linewidth(0.3mm*scale))
55+
default_vertex_style(scale, stroke_color, fill_color) = compose(Compose.context(), Viznet.nodestyle(:default, r=0.15cm*scale), Compose.stroke(stroke_color), fill(fill_color), linewidth(0.3mm*scale))
5656
default_text_style(scale, color) = Viznet.textstyle(:default, fontsize(4pt*scale), fill(color))
5757
default_edge_style(scale, color) = Viznet.bondstyle(:default, Compose.stroke(color), linewidth(0.3mm*scale))
5858

@@ -101,7 +101,7 @@ function show_graph(locations, edges;
101101
kwargs...)
102102
if length(locations) == 0
103103
dx, dy = 12cm, 12cm
104-
img = Compose.compose(context())
104+
img = Compose.compose(Compose.context())
105105
else
106106
img, (dx, dy) = viz_atoms(locations, edges; vertex_colors=vertex_colors, edge_colors=edge_colors, texts=texts, config=GraphDisplayConfig(; config_plotting(locations)..., kwargs...))
107107
end
@@ -121,9 +121,9 @@ function fit_image(rescaler::Rescaler, image_size, imgs...)
121121
Y = rescaler.ymax - rescaler.ymin + 2*rescaler.pad
122122
img_rescale = image_size/max(X, Y)*cm
123123
if Y < X
124-
return Compose.compose(context(0, 0, 1.0, X/Y), imgs...), (X*img_rescale, Y*img_rescale)
124+
return Compose.compose(Compose.context(0, 0, 1.0, X/Y), imgs...), (X*img_rescale, Y*img_rescale)
125125
else
126-
return Compose.compose(context(0, 0, Y/X, 1.0), imgs...), (X*img_rescale, Y*img_rescale)
126+
return Compose.compose(Compose.context(0, 0, Y/X, 1.0), imgs...), (X*img_rescale, Y*img_rescale)
127127
end
128128
end
129129

@@ -178,7 +178,7 @@ function _viz_atoms(locs, edges, vertex_colors, edge_colors, texts, config, resc
178178
edge_styles[k] >> (locs[i], locs[j])
179179
end
180180
end
181-
Compose.compose(context(), img1)
181+
Compose.compose(Compose.context(), img1)
182182
end
183183

184184
"""
@@ -257,4 +257,4 @@ function spring_layout(g::AbstractGraph,
257257
map!(z -> scaler(z, min_y, max_y), locs_y, locs_y)
258258

259259
return collect(zip(locs_x, locs_y))
260-
end
260+
end

0 commit comments

Comments
 (0)