Skip to content

Commit 3727fe3

Browse files
authored
Rename causal graph styles to TEG styles (#667)
## Changes * Renames outdated style names such as `$causalGraphVertexStyle` to modern TEG names such as `$eventVertexStyle`. * Does not change names used in `SetReplaceStyleData` to preserve backward compatibility for now. ## Comments * I only changed the TEG-related style names for now, as I need them for the `TokenEventGraph` property. ## Examples * No functionality is affected.
1 parent 2d4ddae commit 3727fe3

File tree

3 files changed

+39
-39
lines changed

3 files changed

+39
-39
lines changed

Kernel/A0$style.m

+25-25
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
PackageScope["$destroyedEdgeStyle"]
2828
PackageScope["$createdEdgeStyle"]
2929
PackageScope["$destroyedAndCreatedEdgeStyle"]
30-
PackageScope["$causalGraphVertexStyle"]
31-
PackageScope["$expressionVertexStyle"]
32-
PackageScope["$causalGraphInitialVertexStyle"]
33-
PackageScope["$causalGraphFinalVertexStyle"]
34-
PackageScope["$causalGraphEdgeStyle"]
35-
PackageScope["$causalGraphBackground"]
30+
PackageScope["$eventVertexStyle"]
31+
PackageScope["$tokenVertexStyle"]
32+
PackageScope["$initialEventVertexStyle"]
33+
PackageScope["$finalEventVertexStyle"]
34+
PackageScope["$causalEdgeStyle"]
35+
PackageScope["$tokenEventGraphBackground"]
3636
PackageScope["$vertexSize"]
3737
PackageScope["$arrowheadLengthFunction"]
3838
PackageScope["$edgeArrowheadShape"]
@@ -132,20 +132,20 @@
132132
combinedOptionsProperties[Graph][VertexStyle -> $vertexStyle, EdgeStyle -> $edgeLineStyle]
133133
|>,
134134
"CausalGraph" -> <|
135-
"VertexStyle" -> $causalGraphVertexStyle,
136-
"InitialVertexStyle" -> $causalGraphInitialVertexStyle,
137-
"FinalVertexStyle" -> $causalGraphFinalVertexStyle,
138-
"EdgeStyle" -> $causalGraphEdgeStyle,
139-
"Background" -> $causalGraphBackground,
140-
combinedOptionsProperties[Graph][VertexStyle -> $causalGraphVertexStyle, EdgeStyle -> $causalGraphEdgeStyle]
135+
"VertexStyle" -> $eventVertexStyle,
136+
"InitialVertexStyle" -> $initialEventVertexStyle,
137+
"FinalVertexStyle" -> $finalEventVertexStyle,
138+
"EdgeStyle" -> $causalEdgeStyle,
139+
"Background" -> $tokenEventGraphBackground,
140+
combinedOptionsProperties[Graph][VertexStyle -> $eventVertexStyle, EdgeStyle -> $causalEdgeStyle]
141141
|>,
142142
"ExpressionsEventsGraph" -> <|
143-
"EventVertexStyle" -> $causalGraphVertexStyle,
144-
"ExpressionVertexStyle" -> $expressionVertexStyle,
145-
"InitialVertexStyle" -> $causalGraphInitialVertexStyle,
146-
"FinalVertexStyle" -> $causalGraphFinalVertexStyle,
147-
"EdgeStyle" -> $causalGraphEdgeStyle,
148-
"Background" -> $causalGraphBackground
143+
"EventVertexStyle" -> $eventVertexStyle,
144+
"ExpressionVertexStyle" -> $tokenVertexStyle,
145+
"InitialVertexStyle" -> $initialEventVertexStyle,
146+
"FinalVertexStyle" -> $finalEventVertexStyle,
147+
"EdgeStyle" -> $causalEdgeStyle,
148+
"Background" -> $tokenEventGraphBackground
149149
|>,
150150
"Rule" -> <|
151151
"SharedElementHighlight" -> $sharedRuleElementsHighlight,
@@ -190,7 +190,7 @@
190190
"EvolutionCausalGraph" -> <|
191191
"StateVertexStyle" -> $statesGraphVertexStyle,
192192
"EvolutionEdgeStyle" -> $evolutionCausalGraphEvolutionEdgeStyle,
193-
"EventVertexStyle" -> $causalGraphVertexStyle,
193+
"EventVertexStyle" -> $eventVertexStyle,
194194
"CausalEdgeStyle" -> $evolutionCausalGraphCausalEdgeStyle
195195
|>,
196196
"BranchialGraph" -> <|
@@ -288,14 +288,14 @@
288288
$destroyedAndCreatedEdgeStyle -> Directive[Hue[0.02, 0.94, 0.83], Thick, AbsoluteDashing[{1, 3}]],
289289

290290
(* Causal graph *)
291-
$causalGraphVertexStyle -> Directive[Hue[0.11, 1, 0.97], EdgeForm[{Hue[0.11, 1, 0.97], Opacity[1]}]],
292-
$expressionVertexStyle ->
291+
$eventVertexStyle -> Directive[Hue[0.11, 1, 0.97], EdgeForm[{Hue[0.11, 1, 0.97], Opacity[1]}]],
292+
$tokenVertexStyle ->
293293
Directive[Hue[0.63, 0.66, 0.81], Opacity[0.1], EdgeForm[Directive[Hue[0.63, 0.7, 0.5], Opacity[0.7]]]],
294-
$causalGraphInitialVertexStyle ->
294+
$initialEventVertexStyle ->
295295
Directive[RGBColor[{0.259, 0.576, 1}], EdgeForm[{RGBColor[{0.259, 0.576, 1}], Opacity[1]}]],
296-
$causalGraphFinalVertexStyle -> Directive[White, EdgeForm[{Hue[0.11, 1, 0.97], Opacity[1]}]],
297-
$causalGraphEdgeStyle -> Hue[0, 1, 0.56],
298-
$causalGraphBackground -> None,
296+
$finalEventVertexStyle -> Directive[White, EdgeForm[{Hue[0.11, 1, 0.97], Opacity[1]}]],
297+
$causalEdgeStyle -> Hue[0, 1, 0.56],
298+
$tokenEventGraphBackground -> None,
299299

300300
(* HypergraphPlot *)
301301
$vertexSize -> 0.06,

Kernel/Multihistory.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
$genericMultihistoryIcon = GraphPlot[
2424
{DirectedEdge[0, 1], DirectedEdge[1, 2], DirectedEdge[1, 3]},
2525
GraphLayout -> "LayeredDigraphEmbedding",
26-
VertexStyle -> {1 -> style[$lightTheme][$expressionVertexStyle], style[$lightTheme][$causalGraphVertexStyle]},
27-
EdgeStyle -> Directive[style[$lightTheme][$causalGraphEdgeStyle], Arrowheads[0]],
26+
VertexStyle -> {1 -> style[$lightTheme][$tokenVertexStyle], style[$lightTheme][$eventVertexStyle]},
27+
EdgeStyle -> Directive[style[$lightTheme][$causalEdgeStyle], Arrowheads[0]],
2828
VertexCoordinates -> {{0, 1}, {0, 0}, {0, -1} . RotationMatrix[Pi / 4], {0, -1} . RotationMatrix[-Pi / 4]},
2929
VertexSize -> 0.5,
3030
PlotRange -> {{-1.3, 1.3}, {-1.3, 1.3}},
31-
Background -> style[$lightTheme][$causalGraphBackground]];
31+
Background -> style[$lightTheme][$tokenEventGraphBackground]];
3232

3333
Multihistory /: MakeBoxes[object : Multihistory[_, _], format_] := ModuleScope[
3434
type = objectType[object];

Kernel/WolframModelEvolutionObject.m

+11-11
Original file line numberDiff line numberDiff line change
@@ -771,16 +771,16 @@
771771
VertexStyle -> Replace[
772772
OptionValue[allOptionValues, VertexStyle],
773773
Automatic :> Join[
774-
{{"Event", _} -> style[$lightTheme][$causalGraphVertexStyle],
775-
{"Expression", _} -> style[$lightTheme][$expressionVertexStyle]},
774+
{{"Event", _} -> style[$lightTheme][$eventVertexStyle],
775+
{"Expression", _} -> style[$lightTheme][$tokenVertexStyle]},
776776
Cases[
777777
graphVertices,
778778
v : {"Event", e : 0 | Infinity} :> v -> style[$lightTheme][Switch[e,
779-
0, $causalGraphInitialVertexStyle,
780-
Infinity, $causalGraphFinalVertexStyle]],
779+
0, $initialEventVertexStyle,
780+
Infinity, $finalEventVertexStyle]],
781781
{1}]]],
782782
EdgeStyle -> Replace[
783-
OptionValue[allOptionValues, EdgeStyle], Automatic :> style[$lightTheme][$causalGraphEdgeStyle]],
783+
OptionValue[allOptionValues, EdgeStyle], Automatic :> style[$lightTheme][$causalEdgeStyle]],
784784
VertexLabels -> Replace[
785785
OptionValue[allOptionValues, VertexLabels], {
786786
automaticVertexLabelsPattern :> Replace[graphVertices, {
@@ -799,7 +799,7 @@
799799
2 ("TotalGenerationsCount" - "EdgeGenerationsList")} /.
800800
p_String :> propertyEvaluate[True, boundary][obj, caller, p]]}],
801801
Background -> Replace[
802-
OptionValue[allOptionValues, Background], Automatic :> style[$lightTheme][$causalGraphBackground]],
802+
OptionValue[allOptionValues, Background], Automatic :> style[$lightTheme][$tokenEventGraphBackground]],
803803
allOptionValues]
804804
];
805805

@@ -825,13 +825,13 @@ connecting them if the same event is a creator and a destroyer for the same expr
825825
VertexStyle -> Replace[
826826
OptionValue[allOptionValues, VertexStyle],
827827
Automatic -> Select[Head[#] =!= Rule || MatchQ[#[[1]], Alternatives @@ Keys[eventsToOutputs]] &] @ {
828-
style[$lightTheme][$causalGraphVertexStyle],
829-
0 -> style[$lightTheme][$causalGraphInitialVertexStyle],
830-
Infinity -> style[$lightTheme][$causalGraphFinalVertexStyle]}],
828+
style[$lightTheme][$eventVertexStyle],
829+
0 -> style[$lightTheme][$initialEventVertexStyle],
830+
Infinity -> style[$lightTheme][$finalEventVertexStyle]}],
831831
EdgeStyle -> Replace[
832-
OptionValue[allOptionValues, EdgeStyle], Automatic -> style[$lightTheme][$causalGraphEdgeStyle]],
832+
OptionValue[allOptionValues, EdgeStyle], Automatic -> style[$lightTheme][$causalEdgeStyle]],
833833
Background -> Replace[
834-
OptionValue[allOptionValues, Background], Automatic -> style[$lightTheme][$causalGraphBackground]],
834+
OptionValue[allOptionValues, Background], Automatic -> style[$lightTheme][$tokenEventGraphBackground]],
835835
allOptionValues]
836836
];
837837

0 commit comments

Comments
 (0)