/
wrapper.js
38 lines (38 loc) · 1.48 KB
/
wrapper.js
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
define( [ 'plugin/charts/utilities', 'plugin/charts/others/heatmap/heatmap-plugin' ], function( Utilities, HeatMap ) {
return Backbone.View.extend({
initialize: function(app, options) {
var request_dictionary = Utilities.buildRequestDictionary( app.chart );
var index = 0;
var tmp_dict = { id : request_dictionary.id, groups : [] };
for ( var group_index in request_dictionary.groups ) {
var group = request_dictionary.groups[ group_index ];
tmp_dict.groups.push({
key : group.key,
columns : {
x: {
index : index++,
is_label : true
},
y: {
index : index++,
is_label : true
},
z: {
index : index++
}
}
});
}
options.request_dictionary = tmp_dict;
options.render = function( canvas_id, groups ) {
new HeatMap( app, {
chart : options.chart,
canvas_id : canvas_id,
groups : groups
});
return true;
};
Utilities.panelHelper( app, options );
}
});
});