Skip to content

Commit 74b29a4

Browse files
committed
Fix pretty tables integration
1 parent 7ccd4c7 commit 74b29a4

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Graphs = "1"
3030
IterTools = "1.4"
3131
MetaGraphs = "0.7, 0.8"
3232
OMEinsum = "0.8, 0.9"
33-
PrettyTables = "2.2, 3"
33+
PrettyTables = "3"
3434
SimpleTraits = "0.9"
3535
SimpleValueGraphs = "0.4"
3636
SimpleWeightedGraphs = "1.2"

src/abstractmultilayergraph.jl

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,16 +1230,14 @@ function to_string(x::AbstractMultilayerGraph)
12301230

12311231
layers_names = name.(x.layers)
12321232
layers_underlying_graphs = typeof.(graph.(x.layers))
1233-
12341233
layers_table = pretty_table(
1235-
String,
12361234
hcat(layers_names, layers_underlying_graphs);
12371235
title="### LAYERS",
1238-
header=(["NAME", "UNDERLYING GRAPH"]),
1236+
column_labels=(["NAME", "UNDERLYING GRAPH"]),
12391237
alignment=:c,
1240-
header_alignment=:c,
1241-
header_crayon=crayon"yellow bold",
1242-
hlines=:all,
1238+
column_label_alignment=:c,
1239+
style=TextTableStyle(; first_line_column_label=crayon"yellow bold"),
1240+
table_format=TextTableFormat(; @text__all_horizontal_lines()),
12431241
)
12441242

12451243
interlayers_names = name.(values(x.interlayers))
@@ -1250,7 +1248,6 @@ function to_string(x::AbstractMultilayerGraph)
12501248
getproperty.(values(x.interlayers), Ref(:transfer_vertex_metadata))
12511249

12521250
interlayers_table = pretty_table(
1253-
String,
12541251
hcat(
12551252
interlayers_names,
12561253
interlayer_layer_1s,
@@ -1259,13 +1256,13 @@ function to_string(x::AbstractMultilayerGraph)
12591256
interlayer_tranfers,
12601257
);
12611258
title="### INTERLAYERS",
1262-
header=([
1259+
column_labels=([
12631260
"NAME", "LAYER 1", "LAYER 2", "UNDERLYING GRAPH", "TRANSFER VERTEX METADATA"
12641261
]),
12651262
alignment=:c,
1266-
header_alignment=:c,
1267-
header_crayon=crayon"yellow bold",
1268-
hlines=:all,
1263+
column_label_alignment=:c,
1264+
style=TextTableStyle(; first_line_column_label=crayon"yellow bold"),
1265+
table_format=TextTableFormat(; @text__all_horizontal_lines()),
12691266
)
12701267

12711268
return """

0 commit comments

Comments
 (0)