|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="de" dir="ltr">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>Assignment</title>
|
|
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='fonts/roboto.css') }}">
|
|
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.min.css') }}">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
|
|
|
|
<script src="https://unpkg.com/konva@4.0.7/konva.min.js"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<main>
|
|
|
|
<div id="errorbar">You have to select at least 2 nodes</div>
|
|
|
|
<div id="canvas" class="canvas"></div>
|
|
|
|
<nav>
|
|
|
|
<button type="button" onclick="create_node()">
|
|
|
|
<img src="{{ url_for('static', filename='imgs/plus.svg') }}">
|
|
|
|
<h1>Create</h1>
|
|
|
|
</button>
|
|
|
|
<button type="button" onclick="create_edge()">
|
|
|
|
<img src="{{ url_for('static', filename='imgs/drawing.svg') }}">
|
|
|
|
<h1>Connect</h1>
|
|
|
|
</button>
|
|
|
|
<button type="button" onclick="find_path(selected)">
|
|
|
|
<img src="{{ url_for('static', filename='imgs/share.svg') }}">
|
|
|
|
<h1>Find Path</h1>
|
|
|
|
</button>
|
|
|
|
<button type="button" onclick="delete_edge(selected)">
|
|
|
|
<img src="{{ url_for('static', filename='imgs/drawing.svg') }}">
|
|
|
|
<h1>Delete Edge</h1>
|
|
|
|
</button>
|
|
|
|
</nav>
|
|
|
|
<footer>
|
|
|
|
<div id="infobar"></div>
|
|
|
|
<button type="button" onclick="save_graph()">
|
|
|
|
<h1>Save Graph</h1>
|
|
|
|
</button>
|
|
|
|
<button type="button" onclick="clear_graph()">
|
|
|
|
<h1>Clear Graph</h1>
|
|
|
|
</button>
|
|
|
|
<button type="button" data-activeon="auto_layout" onclick="toggle_auto_layout()">
|
|
|
|
<h1>Automatic Layout</h1>
|
|
|
|
</button>
|
|
|
|
</footer>
|
|
|
|
</main>
|
|
|
|
<script>
|
|
|
|
var nodes = {{ nodes|safe }};
|
|
|
|
var edges = {{ edges|safe }};
|
|
|
|
const url = "http://{{ request.host|safe }}/";
|
|
|
|
</script>
|
|
|
|
<script src="{{ url_for('static', filename='js/canvas.js')}}"></script>
|
|
|
|
</body>
|
|
|
|
</html>
|