Skip to content

Commit ac9a658

Browse files
committed
update web ui with some basic styling
1 parent e74923d commit ac9a658

File tree

3 files changed

+35
-21
lines changed

3 files changed

+35
-21
lines changed

priv/css/app.css

+11-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
display:none;
33
}
44

5-
#graph_container {
6-
height: 500px;
7-
border: 1px solid lightgray;
8-
}
5+
.bg-light {
6+
background-color: #37474f;
7+
}
8+
9+
.bg-dark {
10+
background-color: #263238;
11+
}
12+
13+
.hover-bg-dark:hover {
14+
background-color: #263238;
15+
}

priv/index.html

+18-16
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,24 @@
77
<link href="/css/app.css" rel="stylesheet" />
88
</head>
99
<body>
10-
<div class="fl w-20 pa2">
11-
<h1 class="f4 bold center mw6">Digraphs</h1>
12-
<ul id="graph_list" class="list pl0 ml0 mt0 center mw6 ba b--light-silver bb-0">
13-
<li data-template="graph-list-item" class="pa3 bb b--light-silver">
14-
<span data-name></span>
15-
<div class="cf mt2">
16-
<div data-protection class="fl w-30 light-silver"></div>
17-
<div data-cyclicity class="fl w-30 light-silver"></div>
18-
<div data-memory class="fl w-40 light-silver"></div>
19-
</div>
20-
</li>
21-
</ul>
22-
</div>
23-
<div class="fl w-80 pa2">
24-
<h1 class="f4 bold center mw6">&nbsp;</h1>
25-
<div id="graph_container"></div>
10+
<div class="flex absolute top-0 bottom-0 left-0 right-0">
11+
<div class="w-20 bg-light">
12+
<h1 class="f4 bold center mw6 bg-dark mv0 pv4 tc light-gray">Digraph Viewer</h1>
13+
<ul id="graph_list" class="list pl0 ml0 mt0 center mw6 mt2">
14+
<li data-template="graph-list-item" class="pa3 mt1 clr-light hover-bg-dark pointer">
15+
<span data-name class="light-silver"></span>
16+
<div class="cf mt2">
17+
<div data-protection class="fl w-30 gray"></div>
18+
<div data-cyclicity class="fl w-30 gray"></div>
19+
<div data-memory class="fl w-40 gray"></div>
20+
</div>
21+
</li>
22+
</ul>
23+
</div>
24+
<div class="w-80 pa2 flex flex-column">
25+
<h3 id="graph_header" class="mv2">test_graph</h3>
26+
<div id="graph_container" class="h-100 ba b--gray"></div>
27+
</div>
2628
</div>
2729
</body>
2830
<script src="/js/vis.min.js"></script>

priv/js/app.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@
8080
};
8181
var options = {};
8282
new vis.Network(container, data, options);
83-
selectedGraph = graphData;
83+
setSelectedGraph(graphData);
84+
}
85+
86+
function setSelectedGraph(graph) {
87+
selectedGraph = graph;
88+
document.getElementById('graph_header').innerText = graph.name || graph.id;
8489
}
8590
})();

0 commit comments

Comments
 (0)