passagemath-graphs 10.6.1rc1__cp310-cp310-musllinux_1_2_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- passagemath_graphs-10.6.1rc1.dist-info/METADATA +292 -0
- passagemath_graphs-10.6.1rc1.dist-info/RECORD +260 -0
- passagemath_graphs-10.6.1rc1.dist-info/WHEEL +5 -0
- passagemath_graphs-10.6.1rc1.dist-info/top_level.txt +2 -0
- passagemath_graphs.libs/libgcc_s-69c45f16.so.1 +0 -0
- passagemath_graphs.libs/libgmp-8e78bd9b.so.10.5.0 +0 -0
- passagemath_graphs.libs/libstdc++-1f1a71be.so.6.0.33 +0 -0
- sage/all__sagemath_graphs.py +39 -0
- sage/combinat/abstract_tree.py +2723 -0
- sage/combinat/all__sagemath_graphs.py +34 -0
- sage/combinat/binary_tree.py +5306 -0
- sage/combinat/cluster_algebra_quiver/all.py +22 -0
- sage/combinat/cluster_algebra_quiver/cluster_seed.py +5208 -0
- sage/combinat/cluster_algebra_quiver/interact.py +124 -0
- sage/combinat/cluster_algebra_quiver/mutation_class.py +625 -0
- sage/combinat/cluster_algebra_quiver/mutation_type.py +1555 -0
- sage/combinat/cluster_algebra_quiver/quiver.py +2290 -0
- sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py +2468 -0
- sage/combinat/designs/MOLS_handbook_data.py +570 -0
- sage/combinat/designs/all.py +58 -0
- sage/combinat/designs/bibd.py +1655 -0
- sage/combinat/designs/block_design.py +1071 -0
- sage/combinat/designs/covering_array.py +269 -0
- sage/combinat/designs/covering_design.py +530 -0
- sage/combinat/designs/database.py +5615 -0
- sage/combinat/designs/design_catalog.py +122 -0
- sage/combinat/designs/designs_pyx.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/designs/designs_pyx.pxd +21 -0
- sage/combinat/designs/designs_pyx.pyx +993 -0
- sage/combinat/designs/difference_family.py +3951 -0
- sage/combinat/designs/difference_matrices.py +279 -0
- sage/combinat/designs/evenly_distributed_sets.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/designs/evenly_distributed_sets.pyx +661 -0
- sage/combinat/designs/ext_rep.py +1064 -0
- sage/combinat/designs/gen_quadrangles_with_spread.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/designs/gen_quadrangles_with_spread.pyx +339 -0
- sage/combinat/designs/group_divisible_designs.py +361 -0
- sage/combinat/designs/incidence_structures.py +2357 -0
- sage/combinat/designs/latin_squares.py +581 -0
- sage/combinat/designs/orthogonal_arrays.py +2244 -0
- sage/combinat/designs/orthogonal_arrays_build_recursive.py +1780 -0
- sage/combinat/designs/orthogonal_arrays_find_recursive.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/designs/orthogonal_arrays_find_recursive.pyx +967 -0
- sage/combinat/designs/resolvable_bibd.py +815 -0
- sage/combinat/designs/steiner_quadruple_systems.py +1306 -0
- sage/combinat/designs/subhypergraph_search.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/designs/subhypergraph_search.pyx +530 -0
- sage/combinat/designs/twographs.py +306 -0
- sage/combinat/finite_state_machine.py +14874 -0
- sage/combinat/finite_state_machine_generators.py +2006 -0
- sage/combinat/graph_path.py +448 -0
- sage/combinat/interval_posets.py +3908 -0
- sage/combinat/nu_tamari_lattice.py +269 -0
- sage/combinat/ordered_tree.py +1446 -0
- sage/combinat/posets/all.py +46 -0
- sage/combinat/posets/bubble_shuffle.py +247 -0
- sage/combinat/posets/cartesian_product.py +493 -0
- sage/combinat/posets/d_complete.py +182 -0
- sage/combinat/posets/elements.py +273 -0
- sage/combinat/posets/forest.py +30 -0
- sage/combinat/posets/hasse_cython.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/posets/hasse_cython.pyx +174 -0
- sage/combinat/posets/hasse_diagram.py +3672 -0
- sage/combinat/posets/hochschild_lattice.py +158 -0
- sage/combinat/posets/incidence_algebras.py +794 -0
- sage/combinat/posets/lattices.py +5117 -0
- sage/combinat/posets/linear_extension_iterator.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/posets/linear_extension_iterator.pyx +292 -0
- sage/combinat/posets/linear_extensions.py +1037 -0
- sage/combinat/posets/mobile.py +275 -0
- sage/combinat/posets/moebius_algebra.py +776 -0
- sage/combinat/posets/poset_examples.py +2178 -0
- sage/combinat/posets/posets.py +9360 -0
- sage/combinat/rooted_tree.py +1070 -0
- sage/combinat/shard_order.py +239 -0
- sage/combinat/tamari_lattices.py +384 -0
- sage/combinat/yang_baxter_graph.py +923 -0
- sage/databases/all__sagemath_graphs.py +1 -0
- sage/databases/knotinfo_db.py +1231 -0
- sage/ext_data/all__sagemath_graphs.py +1 -0
- sage/ext_data/graphs/graph_plot_js.html +330 -0
- sage/ext_data/kenzo/CP2.txt +45 -0
- sage/ext_data/kenzo/CP3.txt +349 -0
- sage/ext_data/kenzo/CP4.txt +4774 -0
- sage/ext_data/kenzo/README.txt +49 -0
- sage/ext_data/kenzo/S4.txt +20 -0
- sage/graphs/all.py +42 -0
- sage/graphs/asteroidal_triples.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/asteroidal_triples.pyx +320 -0
- sage/graphs/base/all.py +1 -0
- sage/graphs/base/boost_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/boost_graph.pxd +106 -0
- sage/graphs/base/boost_graph.pyx +3045 -0
- sage/graphs/base/c_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/c_graph.pxd +106 -0
- sage/graphs/base/c_graph.pyx +5096 -0
- sage/graphs/base/dense_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/dense_graph.pxd +28 -0
- sage/graphs/base/dense_graph.pyx +801 -0
- sage/graphs/base/graph_backends.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/graph_backends.pxd +5 -0
- sage/graphs/base/graph_backends.pyx +797 -0
- sage/graphs/base/overview.py +85 -0
- sage/graphs/base/sparse_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/sparse_graph.pxd +90 -0
- sage/graphs/base/sparse_graph.pyx +1653 -0
- sage/graphs/base/static_dense_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/static_dense_graph.pxd +5 -0
- sage/graphs/base/static_dense_graph.pyx +1032 -0
- sage/graphs/base/static_sparse_backend.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/static_sparse_backend.pxd +27 -0
- sage/graphs/base/static_sparse_backend.pyx +1583 -0
- sage/graphs/base/static_sparse_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/static_sparse_graph.pxd +37 -0
- sage/graphs/base/static_sparse_graph.pyx +1375 -0
- sage/graphs/bipartite_graph.py +2732 -0
- sage/graphs/centrality.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/centrality.pyx +1038 -0
- sage/graphs/cographs.py +519 -0
- sage/graphs/comparability.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/comparability.pyx +851 -0
- sage/graphs/connectivity.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/connectivity.pxd +157 -0
- sage/graphs/connectivity.pyx +4813 -0
- sage/graphs/convexity_properties.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/convexity_properties.pxd +16 -0
- sage/graphs/convexity_properties.pyx +870 -0
- sage/graphs/digraph.py +4754 -0
- sage/graphs/digraph_generators.py +1993 -0
- sage/graphs/distances_all_pairs.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/distances_all_pairs.pxd +12 -0
- sage/graphs/distances_all_pairs.pyx +2938 -0
- sage/graphs/domination.py +1363 -0
- sage/graphs/dot2tex_utils.py +100 -0
- sage/graphs/edge_connectivity.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/edge_connectivity.pyx +1215 -0
- sage/graphs/generators/all.py +1 -0
- sage/graphs/generators/basic.py +1769 -0
- sage/graphs/generators/chessboard.py +538 -0
- sage/graphs/generators/classical_geometries.py +1611 -0
- sage/graphs/generators/degree_sequence.py +235 -0
- sage/graphs/generators/distance_regular.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/generators/distance_regular.pyx +2846 -0
- sage/graphs/generators/families.py +4759 -0
- sage/graphs/generators/intersection.py +565 -0
- sage/graphs/generators/platonic_solids.py +262 -0
- sage/graphs/generators/random.py +2623 -0
- sage/graphs/generators/smallgraphs.py +5741 -0
- sage/graphs/generators/world_map.py +724 -0
- sage/graphs/generic_graph.py +26867 -0
- sage/graphs/generic_graph_pyx.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/generic_graph_pyx.pxd +34 -0
- sage/graphs/generic_graph_pyx.pyx +1673 -0
- sage/graphs/genus.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/genus.pyx +622 -0
- sage/graphs/graph.py +9645 -0
- sage/graphs/graph_coloring.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_coloring.pyx +2284 -0
- sage/graphs/graph_database.py +1177 -0
- sage/graphs/graph_decompositions/all.py +1 -0
- sage/graphs/graph_decompositions/bandwidth.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/bandwidth.pyx +428 -0
- sage/graphs/graph_decompositions/clique_separators.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/clique_separators.pyx +616 -0
- sage/graphs/graph_decompositions/cutwidth.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/cutwidth.pyx +753 -0
- sage/graphs/graph_decompositions/fast_digraph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/fast_digraph.pxd +13 -0
- sage/graphs/graph_decompositions/fast_digraph.pyx +212 -0
- sage/graphs/graph_decompositions/graph_products.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/graph_products.pyx +508 -0
- sage/graphs/graph_decompositions/modular_decomposition.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/modular_decomposition.pxd +27 -0
- sage/graphs/graph_decompositions/modular_decomposition.pyx +1536 -0
- sage/graphs/graph_decompositions/slice_decomposition.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/slice_decomposition.pxd +18 -0
- sage/graphs/graph_decompositions/slice_decomposition.pyx +1106 -0
- sage/graphs/graph_decompositions/tree_decomposition.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/tree_decomposition.pxd +17 -0
- sage/graphs/graph_decompositions/tree_decomposition.pyx +1996 -0
- sage/graphs/graph_decompositions/vertex_separation.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/vertex_separation.pxd +5 -0
- sage/graphs/graph_decompositions/vertex_separation.pyx +1963 -0
- sage/graphs/graph_editor.py +82 -0
- sage/graphs/graph_generators.py +3314 -0
- sage/graphs/graph_generators_pyx.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_generators_pyx.pyx +95 -0
- sage/graphs/graph_input.py +812 -0
- sage/graphs/graph_latex.py +2064 -0
- sage/graphs/graph_list.py +410 -0
- sage/graphs/graph_plot.py +1756 -0
- sage/graphs/graph_plot_js.py +338 -0
- sage/graphs/hyperbolicity.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/hyperbolicity.pyx +1704 -0
- sage/graphs/hypergraph_generators.py +364 -0
- sage/graphs/independent_sets.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/independent_sets.pxd +13 -0
- sage/graphs/independent_sets.pyx +402 -0
- sage/graphs/isgci.py +1033 -0
- sage/graphs/isoperimetric_inequalities.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/isoperimetric_inequalities.pyx +489 -0
- sage/graphs/line_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/line_graph.pyx +743 -0
- sage/graphs/lovasz_theta.py +77 -0
- sage/graphs/matching.py +1633 -0
- sage/graphs/matching_covered_graph.py +3590 -0
- sage/graphs/orientations.py +1489 -0
- sage/graphs/partial_cube.py +459 -0
- sage/graphs/path_enumeration.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/path_enumeration.pyx +2040 -0
- sage/graphs/pq_trees.py +1129 -0
- sage/graphs/print_graphs.py +201 -0
- sage/graphs/schnyder.py +865 -0
- sage/graphs/spanning_tree.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/spanning_tree.pyx +1457 -0
- sage/graphs/strongly_regular_db.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/strongly_regular_db.pyx +3340 -0
- sage/graphs/traversals.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/traversals.pxd +9 -0
- sage/graphs/traversals.pyx +1872 -0
- sage/graphs/trees.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/trees.pxd +15 -0
- sage/graphs/trees.pyx +310 -0
- sage/graphs/tutte_polynomial.py +713 -0
- sage/graphs/views.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/views.pyx +794 -0
- sage/graphs/weakly_chordal.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/weakly_chordal.pyx +604 -0
- sage/groups/all__sagemath_graphs.py +1 -0
- sage/groups/perm_gps/all__sagemath_graphs.py +1 -0
- sage/groups/perm_gps/partn_ref/all__sagemath_graphs.py +1 -0
- sage/groups/perm_gps/partn_ref/refinement_graphs.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_graphs.pxd +38 -0
- sage/groups/perm_gps/partn_ref/refinement_graphs.pyx +1666 -0
- sage/knots/all.py +6 -0
- sage/knots/free_knotinfo_monoid.py +507 -0
- sage/knots/gauss_code.py +291 -0
- sage/knots/knot.py +682 -0
- sage/knots/knot_table.py +284 -0
- sage/knots/knotinfo.py +2900 -0
- sage/knots/link.py +4715 -0
- sage/sandpiles/all.py +13 -0
- sage/sandpiles/examples.py +225 -0
- sage/sandpiles/sandpile.py +6365 -0
- sage/topology/all.py +22 -0
- sage/topology/cell_complex.py +1214 -0
- sage/topology/cubical_complex.py +1976 -0
- sage/topology/delta_complex.py +1806 -0
- sage/topology/filtered_simplicial_complex.py +744 -0
- sage/topology/moment_angle_complex.py +823 -0
- sage/topology/simplicial_complex.py +5160 -0
- sage/topology/simplicial_complex_catalog.py +92 -0
- sage/topology/simplicial_complex_examples.py +1680 -0
- sage/topology/simplicial_complex_homset.py +205 -0
- sage/topology/simplicial_complex_morphism.py +836 -0
- sage/topology/simplicial_set.py +4102 -0
- sage/topology/simplicial_set_catalog.py +55 -0
- sage/topology/simplicial_set_constructions.py +2954 -0
- sage/topology/simplicial_set_examples.py +865 -0
- sage/topology/simplicial_set_morphism.py +1464 -0
@@ -0,0 +1 @@
|
|
1
|
+
# sage_setup: distribution = sagemath-graphs
|
@@ -0,0 +1,330 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<head>
|
3
|
+
<meta charset="utf-8">
|
4
|
+
<style>
|
5
|
+
.node {
|
6
|
+
stroke: #fff;
|
7
|
+
stroke-width: 1.5px;
|
8
|
+
}
|
9
|
+
|
10
|
+
.link {
|
11
|
+
fill:none;
|
12
|
+
stroke: #000;
|
13
|
+
stroke-opacity: .6;
|
14
|
+
opacity: .6
|
15
|
+
}
|
16
|
+
|
17
|
+
.directed {
|
18
|
+
fill:none;
|
19
|
+
stroke: #000;
|
20
|
+
stroke-opacity: .6;
|
21
|
+
opacity: .6
|
22
|
+
}
|
23
|
+
marker {
|
24
|
+
fill:#bbb;
|
25
|
+
}
|
26
|
+
#menu-container { position: absolute; bottom: 30px; right: 40px; cursor: default; }
|
27
|
+
|
28
|
+
#menu-message { position: absolute; bottom: 0px; right: 0px; white-space: nowrap;
|
29
|
+
display: none; background-color: #F5F5F5; padding: 10px; }
|
30
|
+
|
31
|
+
#menu-content { position: absolute; bottom: 0px; right: 0px;
|
32
|
+
display: none; background-color: #F5F5F5; border-bottom: 1px solid black;
|
33
|
+
border-right: 1px solid black; border-left: 1px solid black; }
|
34
|
+
|
35
|
+
#menu-content div { border-top: 1px solid black; padding: 10px; white-space: nowrap; }
|
36
|
+
|
37
|
+
#menu-content div:hover { background-color: #FEFEFE;; }
|
38
|
+
|
39
|
+
</style>
|
40
|
+
<!-- This is where the d3.js script will appear : -->
|
41
|
+
// D3JS_SCRIPT_HEREEEEEEEEEEE
|
42
|
+
<script type="text/javascript">
|
43
|
+
window.onload = function(){
|
44
|
+
var pos;
|
45
|
+
|
46
|
+
// Loads the graph data
|
47
|
+
var mydiv = document.getElementById("mygraph")
|
48
|
+
var graph_as_string = mydiv.innerHTML
|
49
|
+
var graph = eval('('+graph_as_string+')');
|
50
|
+
|
51
|
+
var width = document.documentElement.clientWidth-32;
|
52
|
+
var height = document.documentElement.clientHeight-32;
|
53
|
+
|
54
|
+
// List of colors
|
55
|
+
var color = d3.scale.category10();
|
56
|
+
|
57
|
+
var force = d3.layout.force()
|
58
|
+
.charge(graph.charge)
|
59
|
+
.linkDistance(graph.link_distance)
|
60
|
+
.linkStrength(graph.link_strength)
|
61
|
+
.gravity(graph.gravity)
|
62
|
+
.size([width, height])
|
63
|
+
.links(graph.links)
|
64
|
+
.nodes(graph.nodes);
|
65
|
+
|
66
|
+
// Adapts the graph layout to the javascript window's dimensions
|
67
|
+
if(graph.pos.length != 0){
|
68
|
+
center_and_scale(graph);
|
69
|
+
}
|
70
|
+
|
71
|
+
// SVG window
|
72
|
+
var svg = d3.select("body").append("svg")
|
73
|
+
.attr("width", width)
|
74
|
+
.attr("height", height)
|
75
|
+
.attr("pointer-events", "all") // Zoom+move management
|
76
|
+
.append('svg:g')
|
77
|
+
.call(d3.behavior.zoom().on("zoom", redraw_on_zoom))
|
78
|
+
.append('svg:g');
|
79
|
+
|
80
|
+
// Zooming
|
81
|
+
svg.append('svg:rect')
|
82
|
+
.attr('x', -10000)
|
83
|
+
.attr('y', -10000)
|
84
|
+
.attr('width', 2*10000)
|
85
|
+
.attr('height',2*10000)
|
86
|
+
.attr('fill', 'white');
|
87
|
+
|
88
|
+
var drag_in_progress = false;
|
89
|
+
function redraw_on_zoom() {
|
90
|
+
if(!drag_in_progress){
|
91
|
+
svg.attr("transform",
|
92
|
+
"translate(" + d3.event.translate + ") scale(" + d3.event.scale + ")");
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
// Edges
|
97
|
+
var link = svg.selectAll(".link")
|
98
|
+
.data(force.links())
|
99
|
+
.enter().append("path")
|
100
|
+
.attr("class", function(d) { return "link directed"; })
|
101
|
+
.attr("marker-end", function(d) { return "url(#directed)"; })
|
102
|
+
.style("stroke",function(d) { return d.color; })
|
103
|
+
.style("stroke-width", graph.edge_thickness+"px");
|
104
|
+
|
105
|
+
// Loops
|
106
|
+
var loops = svg.selectAll(".loop")
|
107
|
+
.data(graph.loops)
|
108
|
+
.enter().append("circle")
|
109
|
+
.attr("class", "link")
|
110
|
+
.attr("r", function(d) { return d.curve; })
|
111
|
+
.style("stroke",function(d) { return d.color; })
|
112
|
+
.style("stroke-width", graph.edge_thickness+"px");
|
113
|
+
|
114
|
+
// Nodes
|
115
|
+
var node = svg.selectAll(".node")
|
116
|
+
.data(force.nodes())
|
117
|
+
.enter().append("circle")
|
118
|
+
.attr("class", "node")
|
119
|
+
.attr("r", graph.vertex_size)
|
120
|
+
.style("fill", function(d) { return color(d.group); })
|
121
|
+
.call(force.drag()
|
122
|
+
.on('dragstart', function (){ drag_in_progress=true; })
|
123
|
+
.on('dragend' , function (){ drag_in_progress=false;}))
|
124
|
+
|
125
|
+
node.append("title").text(function(d) { return d.name; });
|
126
|
+
|
127
|
+
// Vertex labels
|
128
|
+
if(graph.vertex_labels){
|
129
|
+
var v_labels = svg.selectAll(".v_label")
|
130
|
+
.data(force.nodes())
|
131
|
+
.enter()
|
132
|
+
.append("svg:text")
|
133
|
+
.attr("vertical-align", "middle")
|
134
|
+
.text(function(d) { return d.name; })
|
135
|
+
}
|
136
|
+
// Edge labels
|
137
|
+
if(graph.edge_labels){
|
138
|
+
var e_labels = svg.selectAll(".e_label")
|
139
|
+
.data(force.links())
|
140
|
+
.enter()
|
141
|
+
.append("svg:text")
|
142
|
+
.attr("text-anchor", "middle")
|
143
|
+
.text(function(d) { return d.name; })
|
144
|
+
|
145
|
+
var l_labels = svg.selectAll(".l_label")
|
146
|
+
.data(graph.loops)
|
147
|
+
.enter()
|
148
|
+
.append("svg:text")
|
149
|
+
.attr("text-anchor", "middle")
|
150
|
+
.text(function(d,i) { return graph.loops[i].name; })
|
151
|
+
}
|
152
|
+
|
153
|
+
// Arrows, for directed graphs
|
154
|
+
if(graph.directed){
|
155
|
+
svg.append("svg:defs").selectAll("marker")
|
156
|
+
.data(["directed"])
|
157
|
+
.enter().append("svg:marker")
|
158
|
+
.attr("id", String)
|
159
|
+
// viewbox is a rectangle with bottom-left corder (0,-2), width 4 and height 4
|
160
|
+
.attr("viewBox", "0 -2 4 4")
|
161
|
+
// This formula took some time ... :-P
|
162
|
+
.attr("refX", Math.ceil(2*Math.sqrt(graph.vertex_size)))
|
163
|
+
.attr("refY", 0)
|
164
|
+
.attr("markerWidth", 4)
|
165
|
+
.attr("markerHeight", 4)
|
166
|
+
.attr("preserveAspectRatio",false)
|
167
|
+
.attr("orient", "auto")
|
168
|
+
.append("svg:path")
|
169
|
+
// triangles with endpoints (0,-2), (4,0), (0,2)
|
170
|
+
.attr("d", "M0,-2L4,0L0,2");
|
171
|
+
}
|
172
|
+
|
173
|
+
// The function 'line' takes as input a sequence of tuples, and returns a
|
174
|
+
// curve interpolating these points.
|
175
|
+
var line = d3.svg.line()
|
176
|
+
.interpolate("cardinal")
|
177
|
+
.tension(.2)
|
178
|
+
.x(function(d) {return d.x;})
|
179
|
+
.y(function(d) {return d.y;})
|
180
|
+
|
181
|
+
/////////////////////////////////////////////
|
182
|
+
// This is where all movements are defined //
|
183
|
+
/////////////////////////////////////////////
|
184
|
+
force.on("tick", function() {
|
185
|
+
|
186
|
+
// Position of vertices
|
187
|
+
node.attr("cx", function(d) { return d.x; })
|
188
|
+
.attr("cy", function(d) { return d.y; });
|
189
|
+
|
190
|
+
// Position of edges
|
191
|
+
link.attr("d", function(d) {
|
192
|
+
|
193
|
+
// Straight edges
|
194
|
+
if(d.curve == 0){
|
195
|
+
return "M" + d.source.x + "," + d.source.y + " L" + d.target.x + "," + d.target.y;
|
196
|
+
}
|
197
|
+
// Curved edges
|
198
|
+
else {
|
199
|
+
var p = third_point_of_curved_edge(d.source,d.target,d.curve)
|
200
|
+
return line([{'x':d.source.x,'y':d.source.y},
|
201
|
+
{'x':p[0],'y':p[1]},
|
202
|
+
{'x':d.target.x,'y':d.target.y}])
|
203
|
+
}
|
204
|
+
});
|
205
|
+
|
206
|
+
// Position of Loops
|
207
|
+
if(graph.loops.length!=0){
|
208
|
+
loops
|
209
|
+
.attr("cx",function(d) { return force.nodes()[d.source].x; })
|
210
|
+
.attr("cy",function(d) { return force.nodes()[d.source].y-d.curve; })
|
211
|
+
}
|
212
|
+
|
213
|
+
// Position of vertex labels
|
214
|
+
if(graph.vertex_labels){
|
215
|
+
v_labels
|
216
|
+
.attr("x",function(d) { return d.x+graph.vertex_size; })
|
217
|
+
.attr("y",function(d) { return d.y; })
|
218
|
+
}
|
219
|
+
// Position of the edge labels
|
220
|
+
if(graph.edge_labels){
|
221
|
+
e_labels
|
222
|
+
.attr("x",function(d) { return third_point_of_curved_edge(d.source,d.target,d.curve+3)[0]; })
|
223
|
+
.attr("y",function(d) { return third_point_of_curved_edge(d.source,d.target,d.curve+3)[1]; })
|
224
|
+
l_labels
|
225
|
+
.attr("x",function(d,i) { return force.nodes()[d.source].x; })
|
226
|
+
.attr("y",function(d,i) { return force.nodes()[d.source].y-2*d.curve-1; })
|
227
|
+
}
|
228
|
+
});
|
229
|
+
|
230
|
+
// Returns the coordinates of a point located at distance d from the
|
231
|
+
// barycenter of two points pa, pb.
|
232
|
+
function third_point_of_curved_edge(pa,pb,d){
|
233
|
+
var ox=pa.x,oy=pa.y,dx=pb.x,dy=pb.y;
|
234
|
+
var cx=(dx+ox)/2,cy=(dy+oy)/2;
|
235
|
+
var ny=-(dx-ox),nx=dy-oy;
|
236
|
+
var nn = Math.sqrt(nx*nx+ny*ny)
|
237
|
+
return [cx+d*nx/nn,cy+d*ny/nn]
|
238
|
+
}
|
239
|
+
|
240
|
+
// Applies a homothety to the points of the graph respecting the
|
241
|
+
// aspect ratio, so that the graph takes the whole javascript
|
242
|
+
// window and is centered
|
243
|
+
function center_and_scale(graph){
|
244
|
+
var minx = graph.pos[0][0];
|
245
|
+
var maxx = graph.pos[0][0];
|
246
|
+
var miny = graph.pos[0][1];
|
247
|
+
var maxy = graph.pos[0][1];
|
248
|
+
|
249
|
+
graph.nodes.forEach(function(d, i) {
|
250
|
+
maxx = Math.max(maxx, graph.pos[i][0]);
|
251
|
+
minx = Math.min(minx, graph.pos[i][0]);
|
252
|
+
maxy = Math.max(maxy, graph.pos[i][1]);
|
253
|
+
miny = Math.min(miny, graph.pos[i][1]);
|
254
|
+
});
|
255
|
+
|
256
|
+
var border = 60
|
257
|
+
var xspan = maxx - minx;
|
258
|
+
var yspan = maxy - miny;
|
259
|
+
|
260
|
+
var scale = Math.min((height-border)/yspan, (width-border)/xspan);
|
261
|
+
var xshift = (width-scale*xspan)/2
|
262
|
+
var yshift = (height-scale*yspan)/2
|
263
|
+
|
264
|
+
force.nodes().forEach(function(d, i) {
|
265
|
+
d.x = scale*(graph.pos[i][0] - minx) + xshift;
|
266
|
+
d.y = scale*(graph.pos[i][1] - miny) + yshift;
|
267
|
+
});
|
268
|
+
}
|
269
|
+
|
270
|
+
// Starts the automatic force layout
|
271
|
+
force.start();
|
272
|
+
if(graph.pos.length != 0){
|
273
|
+
force.tick();
|
274
|
+
force.stop();
|
275
|
+
graph.nodes.forEach(function(d, i) {
|
276
|
+
d.fixed=true;
|
277
|
+
});
|
278
|
+
|
279
|
+
}
|
280
|
+
|
281
|
+
}
|
282
|
+
// menu functions
|
283
|
+
|
284
|
+
function toggleMenu() {
|
285
|
+
|
286
|
+
var m = document.getElementById( 'menu-content' );
|
287
|
+
if ( m.style.display === 'block' ) m.style.display = 'none'
|
288
|
+
else m.style.display = 'block';
|
289
|
+
|
290
|
+
}
|
291
|
+
|
292
|
+
function saveAsSVG() {
|
293
|
+
|
294
|
+
var doctype = '<?xml version="1.0" standalone="no"?>'
|
295
|
+
+ '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">';
|
296
|
+
|
297
|
+
var our_style='<style>\
|
298
|
+
.node {stroke: #fff;stroke-width: 1.5px;}\
|
299
|
+
.link {fill:none;stroke: #000;stroke-opacity: .6;opacity: .6}\
|
300
|
+
.directed {fill:none;stroke: #000;stroke-opacity: .6;opacity: .6}\
|
301
|
+
marker {fill:#bbb;}</style>';
|
302
|
+
|
303
|
+
// serialize our SVG XML to a string.
|
304
|
+
var source = (new XMLSerializer()).serializeToString(d3.select('svg').node());
|
305
|
+
|
306
|
+
var styled_source = source.replace('"all"><g>', '"all">' + our_style + "<g>");
|
307
|
+
// create a file blob of our SVG.
|
308
|
+
var blob = new Blob([doctype + styled_source], { type: 'image/svg+xml;charset=utf-8' });
|
309
|
+
var a = document.body.appendChild( document.createElement( 'a' ) );
|
310
|
+
a.href = window.URL.createObjectURL( blob );
|
311
|
+
a.download = 'my_graph.svg';
|
312
|
+
a.click()
|
313
|
+
}
|
314
|
+
|
315
|
+
</script>
|
316
|
+
|
317
|
+
</head>
|
318
|
+
<body>
|
319
|
+
<div id="mygraph" style="display:none">
|
320
|
+
<!-- This is where the graph data generated by Sage will appear : -->
|
321
|
+
// GRAPH_DATA_HEREEEEEEEEEEE
|
322
|
+
</div>
|
323
|
+
<div id="menu-container" onclick="toggleMenu()">ⓘ
|
324
|
+
<div id="menu-message"></div>
|
325
|
+
<div id="menu-content">
|
326
|
+
<div onclick="saveAsSVG()">Save as SVG</div>
|
327
|
+
<div>Close Menu</div>
|
328
|
+
</div></div>
|
329
|
+
</body>
|
330
|
+
</html>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
* (show-structure ssz4 6)
|
2
|
+
|
3
|
+
Dimension = 0:
|
4
|
+
|
5
|
+
Vertices : (<<GBar>>)
|
6
|
+
|
7
|
+
Dimension = 1:
|
8
|
+
|
9
|
+
Dimension = 2:
|
10
|
+
|
11
|
+
Simplex : <<GBar<- (2)><- NIL>>>
|
12
|
+
|
13
|
+
Faces : (<AbSm 0 <<GBar>>> <AbSm 0 <<GBar>>> <AbSm 0 <<GBar>>>)
|
14
|
+
|
15
|
+
Simplex : <<GBar<- (1)><- NIL>>>
|
16
|
+
|
17
|
+
Faces : (<AbSm 0 <<GBar>>> <AbSm 0 <<GBar>>> <AbSm 0 <<GBar>>>)
|
18
|
+
|
19
|
+
Dimension = 3:
|
20
|
+
|
21
|
+
Simplex : <<GBar<- (1 1)><0 NIL><- NIL>>>
|
22
|
+
|
23
|
+
Faces : (<AbSm - <<GBar<- (1)><- NIL>>>> <AbSm - <<GBar<- (2)><- NIL>>>> <AbSm - <<GBar<- (1)><- NIL>>>> <AbSm 1-0 <<GBar>>>)
|
24
|
+
|
25
|
+
Simplex : <<GBar<1 (1)><- (1)><- NIL>>>
|
26
|
+
|
27
|
+
Faces : (<AbSm 1-0 <<GBar>>> <AbSm - <<GBar<- (1)><- NIL>>>> <AbSm - <<GBar<- (2)><- NIL>>>> <AbSm - <<GBar<- (1)><- NIL>>>>)
|
28
|
+
|
29
|
+
Simplex : <<GBar<0 (1)><- (1)><- NIL>>>
|
30
|
+
|
31
|
+
Faces : (<AbSm - <<GBar<- (1)><- NIL>>>> <AbSm - <<GBar<- (1)><- NIL>>>> <AbSm - <<GBar<- (1)><- NIL>>>> <AbSm - <<GBar<- (1)><- NIL>>>>)
|
32
|
+
|
33
|
+
Dimension = 4:
|
34
|
+
|
35
|
+
Simplex : <<GBar<1-0 (1)><1-0 NIL><- (1)><- NIL>>>
|
36
|
+
|
37
|
+
Faces : (<AbSm 0 <<GBar<- (1)><- NIL>>>> <AbSm 0 <<GBar<- (1)><- NIL>>>> <AbSm - <<GBar<0 (1)><- (1)><- NIL>>>> <AbSm 2 <<GBar<- (1)><- NIL>>>> <AbSm 2 <<GBar<- (1)><- NIL>>>>)
|
38
|
+
|
39
|
+
Simplex : <<GBar<2-0 (1)><1 (1)><0 NIL><- NIL>>>
|
40
|
+
|
41
|
+
Faces : (<AbSm 1 <<GBar<- (1)><- NIL>>>> <AbSm - <<GBar<1 (1)><- (1)><- NIL>>>> <AbSm - <<GBar<0 (1)><- (1)><- NIL>>>> <AbSm - <<GBar<- (1 1)><0 NIL><- NIL>>>> <AbSm 1 <<GBar<- (1)><- NIL>>>>)
|
42
|
+
|
43
|
+
Simplex : <<GBar<2-1 (1)><0 (1)><0 NIL><- NIL>>>
|
44
|
+
|
45
|
+
Faces : (<AbSm 2 <<GBar<- (1)><- NIL>>>> <AbSm - <<GBar<1 (1)><- (1)><- NIL>>>> <AbSm 1 <<GBar<- (1)><- NIL>>>> <AbSm - <<GBar<- (1 1)><0 NIL><- NIL>>>> <AbSm 0 <<GBar<- (1)><- NIL>>>>)
|