Skip to content

Commit

Permalink
Graphviewer: Option to suppress edge labels
Browse files Browse the repository at this point in the history
  • Loading branch information
thvitt committed Apr 16, 2019
1 parent df20ce5 commit cfcb48e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion graphviewer/graphviewer.py
Expand Up @@ -28,6 +28,7 @@ def prepare_agraph():
ignored_edges = request.args.get('ignored_edges', False)
direct_assertions = request.args.get('assertions', False)
paths_wo_timeline = request.args.get('paths_wo_timeline', False)
no_edge_labels = request.args.get('no_edge_labels', False)
tred = request.args.get('tred', False)
if nodes:
g = info.subgraph(*nodes, context=context, abs_dates=abs_dates, paths=extra, keep_timeline=True,
Expand All @@ -47,7 +48,7 @@ def prepare_agraph():
g.add_node('Cannot produce DAG!?') # FIXME improve error reporting
g = simplify_timeline(g)
g.add_nodes_from(nodes)
agraph = write_dot(g, target=None, highlight=nodes)
agraph = write_dot(g, target=None, highlight=nodes, edge_labels=not no_edge_labels)
agraph.graph_attr['basename'] = ",".join([str(node.filename.stem if hasattr(node, 'filename') else node) for node in nodes])
return agraph
else:
Expand Down
16 changes: 9 additions & 7 deletions graphviewer/templates/form.html
Expand Up @@ -8,24 +8,26 @@

<form method="get" class="pure-g-r pure-form">
<section class="pure-u-1-3">
<p><label for="nodes">Zentrale(r) Knoten: </label><input type="text" name="nodes" id="nodes" value="{{ nodes }}" placeholder="2 V H.13"></p>
<h3>Kontext:</h3>
<h3>Zentrale Knoten</h3>
<p><input type="text" name="nodes" id="nodes" value="{{ nodes }}" style="width: 100%;" placeholder="2 V H.13"></p>
<p><input type="checkbox" name="context" id="context" {% if context %}checked{% endif %}> <label for="context">Nachbarknoten</label></p>
<p><input type="checkbox" name="abs_dates" id="abs_dates" {% if abs_dates %}checked{% endif %}> <label for="abs_dates">absolute Datierungen rechtfertigen</label></p>
<p><input type="checkbox" name="assertions" id="assertions" {% if assertions %}checked{% endif %} <label for="assertions">unmittelbare Aussagen über Kernknoten</label> </p>
<p><input type="submit"></p></section>
</section>
<section class="pure-u-1-3">
<p><label for="extra">Pfade von/zu (falls verfügbar): </label>
<input type="text" name="extra" id="extra" value="{{ extra }}" placeholder="A, 2 H"><br />
<h3>Zusätzliche Pfade</h3>
<p><input type="checkbox" name="abs_dates" id="abs_dates" {% if abs_dates %}checked{% endif %}> <label for="abs_dates">absolute Datierungen rechtfertigen</label></p>
<p><label for="extra">Pfade von/zu (falls verfügbar): </label><br/>
<input type="text" name="extra" id="extra" value="{{ extra }}" placeholder="A, 2 H" style="width: 100%"><br />
<input type="checkbox" name="paths_wo_timeline" id="paths_wo_timeline" {% if paths_wo_timeline %}checked{% endif %}> <label for="paths_wo_timeline">ohne Timeline</label>
</p>
</section>
<section class="pure-u-1-3">
<h3>Kantenauswahl und -Gestaltung:</h3>
<h3>Kantenauswahl und -gestaltung:</h3>
<p><input type="checkbox" name="induced_edges" id="induced_edges" {% if induced_edges %}checked{% endif %}> <label for="induced_edges">alle induzierten Kanten</label></p>
<p><input type="checkbox" name="ignored_edges" id="ignored_edges" {% if ignored_edges %}checked{% endif %}> <label for="ignored_edges">ignorierte (graue) Kanten</label> </p>
<p><input type="checkbox" name="tred" id="tred" {% if tred %}checked{% endif %}> <label for="tred">Transitive Reduktion</label> </p>
<p><input type="submit"></p></section>
<p><input type="checkbox" name="no_edge_labels" id="no_edge_labels" {% if no_edge_labels %}checked{% endif %}> <label for="no_edge_labels">keine Kantenbeschriftung</label> </p>
</form>

{% endblock %}
Expand Down

0 comments on commit cfcb48e

Please sign in to comment.