1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="tf-node-info.html">
<dom-module id="tf-graph-info">
<template>
<style>
:host {
font-size: 12px;
margin: 0;
padding: 0;
display: block;
}
h2 {
padding: 0;
text-align: center;
margin: 0;
}
</style>
<template is="dom-if" if="{{selectedNode}}">
<paper-material elevation="1" class="card">
<tf-node-info graph-hierarchy='[[graphHierarchy]]'
flat-graph="[[graph]]"
node-name='[[selectedNode]]'
highlighted-node='{{highlightedNode}}'>
</tf-node-info>
</paper-material>
</template>
</template>
<script>
(function() {
Polymer({
is: 'tf-graph-info',
properties: {
title: String,
graphHierarchy: Object,
graph: Object,
// Two-ways
selectedNode: {
type: String,
notify: true
},
highlightedNode: {
type: String,
notify: true
}
},
listeners: {
'node-list-item-click': '_nodeListItemClicked',
'node-list-item-mouseover': '_nodeListItemMouseover',
'node-list-item-mouseout': '_nodeListItemMouseout'
},
_nodeListItemClicked: function(event) {
this.selectedNode = event.detail.nodeName;
},
_nodeListItemMouseover: function(event) {
this.highlightedNode = event.detail.nodeName;
},
_nodeListItemMouseout: function() {
this.highlightedNode = null;
}
});
})();
</script>
</dom-module>
|