Skip to content

Add alt text to all main documentation pages #672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed Documentation/Images/MyrheimMeyer.png
Binary file not shown.
104 changes: 78 additions & 26 deletions Documentation/SymbolsAndFunctions/HypergraphPlot.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ the ordering:
In[] := HypergraphPlot[{{1, 2, 3}, {3, 4, 5}, {5, 6, 7, 1}}]
```

<img src="/Documentation/Images/HypergraphPlot.png" width="478">
<img src="/Documentation/Images/HypergraphPlot.png"
width="478"
alt="Out[] = ... plot of a hypergraph with 3 hyperedges ...">

Edges of any arity can be mixed. The binary edges are displayed as non-filled arrows, and the unary edges are shown as
circles around the vertices:
Expand All @@ -25,23 +27,29 @@ circles around the vertices:
In[] := HypergraphPlot[{{1, 2, 3}, {3, 4}, {4, 3}, {4, 5, 6}, {1}, {6}, {6}}]
```

<img src="/Documentation/Images/BinaryAndUnaryEdgesPlot.png" width="478">
<img src="/Documentation/Images/BinaryAndUnaryEdgesPlot.png"
width="478"
alt="Out[] = ... plot of a hypergraph with binary and unary edges ...">

Self-loops are shown as convex polygons around the appropriate number of circular arrows:

```wl
In[] := HypergraphPlot[{{1, 1, 1}, {1, 2, 3}, {3, 4, 4}}]
```

<img src="/Documentation/Images/SelfLoopsPlot.png" width="478">
<img src="/Documentation/Images/SelfLoopsPlot.png"
width="478"
alt="Out[] = ... plot of a hypergraph with self-loops ...">

Note the difference between a hyper-self-loop and two binary edges pointing in opposite directions:

```wl
In[] := HypergraphPlot[{{1, 2, 1}, {2, 3}, {3, 2}}]
```

<img src="/Documentation/Images/HyperSelfLoopDoubleBinaryEdgesComparison.png" width="478">
<img src="/Documentation/Images/HyperSelfLoopDoubleBinaryEdgesComparison.png"
width="478"
alt="Out[] = ... plot of a hypergraph with a hyper-self-loop and 2 binary edges ...">

Multiedges are shown in a darker color (because of overlaid partially transparent polygons), or as separate polygons
depending on the layout (and are admittedly sometimes hard to understand):
Expand All @@ -50,7 +58,9 @@ depending on the layout (and are admittedly sometimes hard to understand):
In[] := HypergraphPlot[{{1, 2, 3}, {3, 4, 5}, {3, 4, 5}, {1, 6, 6}, {1, 6, 6}}]
```

<img src="/Documentation/Images/MultiedgesPlot.png" width="478">
<img src="/Documentation/Images/MultiedgesPlot.png"
width="478"
alt="Out[] = ... plot of a hypergraph with multiedges ...">

Many [`WolframModel`](WolframModelAndWolframModelEvolutionObject/WolframModelAndWolframModelEvolutionObject.md)
properties, such as [`"FinalStatePlot"`](WolframModelAndWolframModelEvolutionObject/Properties/PlotsOfStates.md)
Expand All @@ -68,7 +78,9 @@ case `"Cyclic"` should be used as the second argument to `HypergraphPlot`:
In[] := HypergraphPlot[{{1, 2, 3}, {3, 4, 5}, {5, 6, 7, 1}}, "Cyclic"]
```

<img src="/Documentation/Images/CyclicPlot.png" width="478">
<img src="/Documentation/Images/CyclicPlot.png"
width="478"
alt="Out[] = ... plot of a cyclic hypergraph with 3 hyperedges ...">

## GraphHighlight and GraphHighlightStyle

Expand All @@ -79,7 +91,9 @@ In[] := HypergraphPlot[{{1, 2, 3}, {3, 4, 5}, {5, 6, 7, 1}, {7, 8, 2}, {4,
9}, {9}}, GraphHighlight -> {{1, 2, 3}, 4, {9}}]
```

<img src="/Documentation/Images/PlotWithHighlight.png" width="478">
<img src="/Documentation/Images/PlotWithHighlight.png"
width="478"
alt="Out[] = ... plot of a hypergraph with highlighted vertices and edges ...">

For a hypergraph with multiedges, only the specified number of edges will be highlighted:

Expand All @@ -88,7 +102,9 @@ In[] := HypergraphPlot[{{1, 2, 3}, {1, 2, 3}, {3, 4}, {3, 4}, {3,
4}, {4}, {4}}, GraphHighlight -> {{1, 2, 3}, {3, 4}, {3, 4}, {4}}]
```

<img src="/Documentation/Images/PlotWithMultiedgeHighlight.png" width="478">
<img src="/Documentation/Images/PlotWithMultiedgeHighlight.png"
width="478"
alt="Out[] = ... plot of a hypergraph with partially highlighted multiedges ...">

The style of the highlight can be specified with **`GraphHighlightStyle`**:

Expand All @@ -98,7 +114,9 @@ In[] := HypergraphPlot[{{1, 2, 3}, {3, 4, 5}, {5, 6, 7, 1}, {7, 8, 2}, {4,
GraphHighlightStyle -> Directive[Darker @ Green, Thick]]
```

<img src="/Documentation/Images/PlotWithGreenHighlight.png" width="478">
<img src="/Documentation/Images/PlotWithGreenHighlight.png"
width="478"
alt="Out[] = ... plot of a hypergraph with green highlighted vertices and edges ...">

## "HyperedgeRendering"

Expand All @@ -113,7 +131,9 @@ In[] := HypergraphPlot[{{1, 2, 3}, {3, 4, 5}, {5, 6, 7, 1}, {7, 8, 2}, {4,
VertexLabels -> Automatic]
```

<img src="/Documentation/Images/SubgraphsHyperedgeRendering.png" width="478">
<img src="/Documentation/Images/SubgraphsHyperedgeRendering.png"
width="478"
alt="Out[] = ... plot of a hypergraph represented as a graph with multiple edges used for each hyperedge ...">

## VertexCoordinates

Expand All @@ -125,7 +145,9 @@ In[] := HypergraphPlot[{{1, 2, 3}, {2, 4, 5}, {2, 6, 7, 8}, {8, 9, 1}},
Axes -> True]
```

<img src="/Documentation/Images/PlotWithCustomCoordinates.png" width="478">
<img src="/Documentation/Images/PlotWithCustomCoordinates.png"
width="478"
alt="Out[] = ... plot of a hypergraph with custom vertex coordinates overlayed on top of axes ...">

Unfortunately, due to limitations of [`GraphEmbedding`](https://reference.wolfram.com/language/ref/GraphEmbedding.html),
specifying coordinates of two or more vertices breaks the scaling of distances. As a result, vertices and arrowheads
Expand All @@ -137,15 +159,19 @@ In[] := HypergraphPlot[{{1, 2, 3}, {2, 4, 5}, {2, 6, 7, 8}, {8, 9, 1}},
VertexCoordinates -> {1 -> {0, 0}, 2 -> {1, 0}}]
```

<img src="/Documentation/Images/IncorrectlyScaledPlot.png" width="466">
<img src="/Documentation/Images/IncorrectlyScaledPlot.png"
width="466"
alt="Out[] = ... plot of a hypergraph where vertices and arrowheads are too large ...">

```wl
In[] := HypergraphPlot[{{1, 2, 3}, {2, 4, 5}, {2, 6, 7, 8}, {8, 9, 1}},
VertexCoordinates -> {1 -> {0, 0}, 2 -> {1, 0}},
VertexSize -> 0.03, "ArrowheadLength" -> 0.06]
```

<img src="/Documentation/Images/PlotWithCompensatedScale.png" width="448">
<img src="/Documentation/Images/PlotWithCompensatedScale.png"
width="448"
alt="Out[] = ... plot of the same hypergraph with reasonably sized vertices and arrowheads ...">

## VertexLabels

Expand All @@ -157,7 +183,9 @@ In[] := HypergraphPlot[{{1, 2, 3}, {2, 4, 5}, {2, 6, 7, 8}, {8, 9, 1}},
VertexLabels -> Automatic]
```

<img src="/Documentation/Images/PlotWithVertexLabels.png" width="478">
<img src="/Documentation/Images/PlotWithVertexLabels.png"
width="478"
alt="Out[] = ... plot of a hypergraph with labeled vertices ...">

## VertexSize and "ArrowheadLength"

Expand All @@ -169,7 +197,9 @@ In[] := HypergraphPlot[{{1, 2, 3, 4}, {1, 5, 6}, {2, 7, 8}, {4, 6, 9}},
VertexSize -> 0.1, "ArrowheadLength" -> 0.3]
```

<img src="/Documentation/Images/PlotWithCustomElementSizes.png" width="478">
<img src="/Documentation/Images/PlotWithCustomElementSizes.png"
width="478"
alt="Out[] = ... plot of a hypergraph with enlarged vertices and arrowheads ...">

Note that unlike [`GraphPlot`](https://reference.wolfram.com/language/ref/GraphPlot.html), both vertices and arrowheads
have a fixed size relative to the layout (in fact, the arrowheads are drawn manually as polygons). This fixed size
Expand All @@ -184,7 +214,9 @@ In[] := HypergraphPlot[{{1, 2, 3}, {3, 4, 5}, {5, 6, 7}, {7, 8, 9}, {9, 10,
VertexStyle -> Transparent]
```

<img src="/Documentation/Images/PlotWithNoArrowsAndVertices.png" width="478">
<img src="/Documentation/Images/PlotWithNoArrowsAndVertices.png"
width="478"
alt="Out[] = ... plot of a hypergraph with no arrowheads and vertices ...">

As a neat example, one can even draw unordered hypergraphs:

Expand All @@ -196,7 +228,9 @@ In[] := HypergraphPlot[{{1, 2, 2}, {2, 3, 3}, {3, 1, 1}},
EdgeForm[Directive[Hue[0.63, 0.7, 0.5], Opacity[0.7]]]]|>]
```

<img src="/Documentation/Images/UnorderedPlot.png" width="478">
<img src="/Documentation/Images/UnorderedPlot.png"
width="478"
alt="Out[] = ... plot of a hypergraph with no edges and vertices, only polygons ...">

## "MaxImageSize"

Expand All @@ -207,13 +241,17 @@ hypergraphs. To demonstrate that, consider the difference:
In[] := HypergraphPlot[#, "MaxImageSize" -> 100] & /@ {{{1}}, {{1, 1}}, {{1, 2, 3}}}
```

<img src="/Documentation/Images/PlotWithMaxImageSize.png" width="254">
<img src="/Documentation/Images/PlotWithMaxImageSize.png"
width="254"
alt="Out[] = {... 3 small plots of hypergraphs of different sizes but consistent vertex sizes ...}">

```wl
In[] := HypergraphPlot[#, ImageSize -> 100] & /@ {{{1}}, {{1, 1}}, {{1, 2, 3}}}
```

<img src="/Documentation/Images/PlotWithImageSize.png" width="457">
<img src="/Documentation/Images/PlotWithImageSize.png"
width="457"
alt="Out[] = {... 3 small plots of hypergraphs of the smae size but different vertex sizes ...}">

## Style Options

Expand All @@ -226,7 +264,9 @@ In[] := HypergraphPlot[{{1, 2, 3}, {3, 4, 5}, {5, 6, 7, 1}, {7, 8, 2}, {4,
9}, {9}}, PlotStyle -> Directive[Blue, Dotted]]
```

<img src="/Documentation/Images/PlotWithCustomPlotStyle.png" width="478">
<img src="/Documentation/Images/PlotWithCustomPlotStyle.png"
width="478"
alt="Out[] = ... plot of a hypergraph with blue vertices and blue dotted edges ...">

**`VertexStyle`** works similar to [`GraphPlot`](https://reference.wolfram.com/language/ref/GraphPlot.html):

Expand All @@ -235,7 +275,9 @@ In[] := HypergraphPlot[{{1, 2, 3}, {3, 4, 5}, {5, 6, 7, 1}, {7, 8, 2}, {4,
9}, {9}}, PlotStyle -> Directive[Blue, Dotted], VertexStyle -> Red]
```

<img src="/Documentation/Images/PlotWithCustomVertexStyle.png" width="478">
<img src="/Documentation/Images/PlotWithCustomVertexStyle.png"
width="478"
alt="Out[] = ... plot of a hypergraph with red vertices and blue dotted edges ...">

**`EdgeStyle`** controls edge lines, and `"EdgePolygonStyle"` inherits from it (automatically adding transparency):

Expand All @@ -245,7 +287,9 @@ In[] := HypergraphPlot[{{1, 2, 3}, {3, 4, 5}, {5, 6, 7, 1}, {7, 8, 2}, {4,
EdgeStyle -> Darker @ Green]
```

<img src="/Documentation/Images/PlotWithCustomEdgeStyle.png" width="478">
<img src="/Documentation/Images/PlotWithCustomEdgeStyle.png"
width="478"
alt="Out[] = ... plot of a hypergraph with red vertices and green edge arrows and polygons ...">

Finally, **`"EdgePolygonStyle"`** controls the hyperedge polygons:

Expand All @@ -257,7 +301,9 @@ In[] := HypergraphPlot[{{1, 2, 3}, {3, 4, 5}, {5, 6, 7, 1}, {7, 8, 2}, {4,
Directive[Lighter[Green, 0.9], EdgeForm[Dotted]]]
```

<img src="/Documentation/Images/PlotWithCustomEdgePolygonStyle.png" width="478">
<img src="/Documentation/Images/PlotWithCustomEdgePolygonStyle.png"
width="478"
alt="Out[] = ... plot of a hypergraph with red vertices, green edge arrows and polygons with dotted edges ...">

It is possible to specify styles separately for each edge and vertex. Vertex styles are specified in the same order
as `Union @* Catenate` evaluated on the list of edges:
Expand All @@ -268,7 +314,9 @@ In[] := HypergraphPlot[{{1, 2, 3}, {3, 4, 5}, {5, 6, 7, 1}, {7, 8, 2}, {4,
VertexStyle -> ColorData[98] /@ Range[9]]
```

<img src="/Documentation/Images/PlotWithElementwiseStyles.png" width="478">
<img src="/Documentation/Images/PlotWithElementwiseStyles.png"
width="478"
alt="Out[] = ... plot of a hypergraph with differently colored vertices and edges ...">

Alternatively, one can specify different styles for different patterns of elements. In this case, styles are specified
as [`Association`](https://reference.wolfram.com/language/ref/Association.html)s with patterns for keys. This can be
Expand All @@ -283,7 +331,9 @@ In[] := HypergraphPlot[WolframModel[{{1, 2, 3}, {4, 5, 6}, {2, 5}, {5, 2}} ->
EdgeStyle -> <|{_, _} -> Darker @ Green, {_, _, _} -> Darker @ Red|>]
```

<img src="/Documentation/Images/PlotWithAritywiseStyles.png" width="478">
<img src="/Documentation/Images/PlotWithAritywiseStyles.png"
width="478"
alt="Out[] = ... plot of a hypergraph with green 2-edges and red 3-edges ...">

## Graphics Options

Expand All @@ -299,4 +349,6 @@ In[] := HypergraphPlot[WolframModel[{{1, 2}} -> {{1, 3}, {1, 3}, {3, 2}},
PlotRange -> {{30, 50}, {20, 40}}, Axes -> True]
```

<img src="/Documentation/Images/PlotOfHypergraphFragment.png" width="478">
<img src="/Documentation/Images/PlotOfHypergraphFragment.png"
width="478"
alt="Out[] = ... plot of a hypergraph fragment in black and white with gridlines and axes ...">
36 changes: 27 additions & 9 deletions Documentation/SymbolsAndFunctions/RulePlotOfWolframModel.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ In[] := RulePlot[WolframModel[{{1, 2}, {1, 2}} ->
{{3, 2}, {3, 2}, {2, 1}, {1, 3}}]]
```

<img src="/Documentation/Images/RulePlot.png" width="429">
<img src="/Documentation/Images/RulePlot.png"
width="429"
alt="Out[] = ... input subhypergraph -> output subhypergraph ...">

The shared elements between rule sides (vertices `1` and `2` in the example above) are put at the same positions in
the `RulePlot` and highlighted in a darker shade of blue. Shared edges are highlighted as well:
Expand All @@ -19,7 +21,9 @@ the `RulePlot` and highlighted in a darker shade of blue. Shared edges are highl
In[] := RulePlot[WolframModel[{{1, 2, 3}} -> {{1, 2, 3}, {3, 4, 5}}]]
```

<img src="/Documentation/Images/RulePlotWithSharedEdges.png" width="429">
<img src="/Documentation/Images/RulePlotWithSharedEdges.png"
width="429"
alt="Out[] = ... Wolfram model rule plot with the shared edge located at the same position on both sides ...">

Multiple rules can be plotted:

Expand All @@ -29,16 +33,22 @@ In[] := RulePlot[WolframModel[{{{1, 1, 2}} ->
{{1, 2, 1}, {3, 4, 2}} -> {{4, 3, 2}}}]]
```

<img src="/Documentation/Images/MultipleRulesPlot.png" width="808">
<img src="/Documentation/Images/MultipleRulesPlot.png"
width="808"
alt="Out[] = ... grid with 2 boxes showing different rules ...">

Passing
a [`WolframModelEvolutionObject`](/Documentation/SymbolsAndFunctions/WolframModelAndWolframModelEvolutionObject/WolframModelAndWolframModelEvolutionObject.md)
plots its [`"Rules"`](/Documentation/SymbolsAndFunctions/WolframModelAndWolframModelEvolutionObject/Properties/Rules.md)
property:

<img src="/Documentation/Images/RulePlotWolframModelEvolutionObjectInput.png" width="575">
<img src="/Documentation/Images/RulePlotWolframModelEvolutionObjectInput.png"
width="575"
alt="In[] := RulePlot[WolframModelEvolutionObject[...]]">

<img src="/Documentation/Images/RulePlot.png" width="429">
<img src="/Documentation/Images/RulePlot.png"
width="429"
alt="Out[] = ... input subhypergraph -> output subhypergraph ...">

Sometimes an incorrectly scaled layout might be produced due to the issue discussed above
in [`VertexCoordinates`](HypergraphPlot.md#vertexcoordinates):
Expand All @@ -48,7 +58,9 @@ In[] := RulePlot[WolframModel[{{1, 2}, {1, 3}, {1, 4}} ->
{{2, 2}, {2, 2}, {2, 5}, {3, 2}}]]
```

<img src="/Documentation/Images/IncorrectlyScaledRulePlot.png" width="429">
<img src="/Documentation/Images/IncorrectlyScaledRulePlot.png"
width="429"
alt="Out[] = ... rule plot where vertices and arrowheads are too large ...">

`VertexCoordinates` can be used in that case to specify the layout manually:

Expand All @@ -59,7 +71,9 @@ In[] := RulePlot[WolframModel[{{1, 2}, {1, 3}, {1, 4}} ->
4 -> {-1, 0}, 5 -> {2, 1}}]
```

<img src="/Documentation/Images/RulePlotWithCustomCoordinates.png" width="429">
<img src="/Documentation/Images/RulePlotWithCustomCoordinates.png"
width="429"
alt="Out[] = ... rule plot with reduced sizes for vertices and arrowheads ...">

Some of the [`HypergraphPlot`](HypergraphPlot.md) options are supported,
specifically [`GraphHighlightStyle`](HypergraphPlot.md#graphhighlight-and-graphhighlightstyle)
Expand All @@ -77,7 +91,9 @@ In[] := RulePlot[WolframModel[{{{1, 2}} -> {{1, 3}, {1, 3}, {3, 2}},
{{1, 2}, {1, 2}} -> {{1, 3}, {3, 2}}}], Spacings -> 0.03]
```

<img src="/Documentation/Images/RulePlotWithSmallSpacings.png" width="747">
<img src="/Documentation/Images/RulePlotWithSmallSpacings.png"
width="747"
alt="Out[] = ... plot of 2 rules with tight spaces between the rules and the frame ...">

**`"RulePartsAspectRatio"`** is used to control the aspect ratio of rule sides. As an example, it can be used to force
rule parts to be square:
Expand All @@ -87,4 +103,6 @@ In[] := RulePlot[WolframModel[{{1, 2}} -> {{1, 3}, {1, 3}, {3, 2}}],
"RulePartsAspectRatio" -> 1]
```

<img src="/Documentation/Images/SquareRulePlot.png" width="429">
<img src="/Documentation/Images/SquareRulePlot.png"
width="429"
alt="Out[] = ... rule plot with square rule parts ...">
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ In[] := graph = BlockRandom[
]
```

<img src="/Documentation/Images/AcyclicGraphTakeInput.png" width="478.2">
<img src="/Documentation/Images/AcyclicGraphTakeInput.png"
width="478.2"
alt="Out[] = ... directed acyclic graph with 10 vertices and multiple branches ...">

```wl
In[] := AcyclicGraphTake[graph, {1, 9}]
```

<img src="/Documentation/Images/AcyclicGraphTakeOutput.png" width="232.2">
<img src="/Documentation/Images/AcyclicGraphTakeOutput.png"
width="232.2"
alt="Out[] = ... subgraph of the input graph with only vertices between 1 and 9 remaining ...">
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ If the build directory were not clean, it would have "\*" at the end.
In[] := $SetReplaceBuildTime
```

<img src="/Documentation/Images/BuildTime.png" width="277">
<img src="/Documentation/Images/BuildTime.png"
width="277"
alt="Out[] = ... [Sun 12 Apr 2020 16:06:38 UTC] ...">

These constants are particularly useful for reporting issues with the code.
Loading