Skip to content

Commit d407b78

Browse files
author
Trent Willis
committed
Update navigation bar and support clearing data
1 parent f6944eb commit d407b78

File tree

4 files changed

+36
-6
lines changed

4 files changed

+36
-6
lines changed

app/controllers/application.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ export default Ember.Controller.extend({
2929
this.get('graph').setGraph(contents);
3030
this.set('showUploadModal', false);
3131
});
32+
},
33+
34+
clearData() {
35+
this.get('graph').clearGraph();
3236
}
3337
}
3438
})

app/services/graph.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ export default Ember.Service.extend({
4141
this.set('graph', graph);
4242
},
4343

44+
clearGraph() {
45+
this.set('data', null);
46+
this.set('graph', null);
47+
},
48+
4449
selectNode(node) {
4550
sessionStorage.setItem(SELECTED_NODE_STORAGE_KEY, node.id);
4651

app/styles/app.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
body {
2+
margin-top: 3.5rem;
3+
}
4+
5+
.global-nav {
6+
position: fixed;
7+
top: 0;
8+
width: 100%;
9+
z-index: 1;
10+
}
11+
112
.node text {
213
font: 10px sans-serif;
314
}
@@ -17,6 +28,7 @@
1728
vertical-align: top;
1829
overflow: hidden;
1930
}
31+
2032
.svg-content {
2133
display: inline-block;
2234
position: absolute;

app/templates/application.hbs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
1-
<section class="hero is-light">
1+
<section class="global-nav hero is-light">
22
<nav class="nav">
33
<div class="nav-left">
4-
{{link-to 'Home' 'index' class="nav-item is-tab" activeClass="is-active"}}
5-
{{link-to 'Slow Nodes' 'slow-nodes' class="nav-item is-tab" activeClass="is-active"}}
6-
<a class="nav-item" {{action (action (mut showUploadModal) true)}}>
7-
Select Data
8-
</a>
4+
{{link-to 'Graph' 'index' class="nav-item is-tab" activeClass="is-active"}}
5+
{{link-to 'Nodes' 'slow-nodes' class="nav-item is-tab" activeClass="is-active"}}
96
</div>
7+
108
<div class="nav-center">
119
<p class="nav-item title">
1210
Heimdall Visualizer
1311
</p>
1412
</div>
13+
1514
<div class="nav-right">
15+
{{#if (not graph.data)}}
16+
<a href="#" class="nav-item" {{action (action (mut showUploadModal) true)}}>
17+
Upload Data
18+
</a>
19+
{{else}}
20+
<a href="#" class="nav-item" {{action 'clearData'}}>
21+
Clear Data
22+
</a>
23+
{{/if}}
24+
1625
<a class="nav-item" href="https://github.com/rwjblue/heimdalljs-visualizer">
1726
<span class="icon">
1827
<i class="fa fa-github"></i>

0 commit comments

Comments
 (0)