-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patha-dot.html
More file actions
44 lines (41 loc) · 816 Bytes
/
a-dot.html
File metadata and controls
44 lines (41 loc) · 816 Bytes
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
<link rel="import" href="../polymer/polymer.html">
<script src="../vis/dist/vis.min.js"></script>
<link href="../vis/dist/vis.css" rel="stylesheet" type="text/css" />
<dom-module id="a-dot">
<template>
<style>
:host {
display: block;
}
#container {
width: 100%;
height: 100%;
}
</style>
<div id="container">
</div>
</template>
<script>
Polymer({
is: 'a-dot',
properties: {
dot: {
type: String,
notify: true
}
},
listeners: {
'dot-changed': 'dotChanged'
},
dotChanged: function() {
this._graph && this._graph.setData({
dot: this.dot
});
},
ready: function() {
var parsedData = vis.network.convertDot(this.dot);
this._graph = new vis.Network(this.$.container, parsedData, parsedData.options);
}
});
</script>
</dom-module>