2 var SensLabMap = Plugin.extend({
3 init: function(options, element) {
4 this._super(options, element);
6 this.elmt().on('show', this, this.on_show);
8 var query = manifold.query_store.find_analyzed_query(options.query_uuid);
9 this.method = query.object;
10 this.key = manifold.metadata.get_key(this.method);
12 /* Setup query and record handlers */
13 this.listen_query(options.query_uuid);
14 this.listen_query(options.query_all_uuid, 'all');
20 on_show: function(e) {
24 on_all_new_record: function(node) {
25 Senslab.normalize(node);
26 if (node.normalized) {
28 if ($.inArray(site, this.sites) == -1) {
29 this.sites.push(site);
30 this.nodes[site] = [];
32 this.nodes[site].push(node);
34 console.warn("node has no site:");
39 on_all_query_done: function() {
42 Senslab.createMaps($('#maps-container'), this.sites, this.nodes);
43 Senslab.notify = function(node) {
44 manifold.raise_event(self.options.query_uuid,
45 node.boot_state == "Alive" ? SET_REMOVED : SET_ADD,
51 $.plugin('SensLabMap', SensLabMap);