1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-23 00:00:02 +01:00
VILLASweb/app/components/flow-plot.js
2017-01-25 12:54:34 +01:00

27 lines
736 B
JavaScript

import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'div',
classNames: [ 'flow-plot' ],
attributeBindings: [ 'style' ],
plot: null,
data: [],
options: {},
height: '85%',
setupPlot: Ember.on('didInsertElement', function() {
var plot = Ember.$.plot('#' + this.get('element').id, this.get('data'), this.get('options'));
this.set('plot', plot);
}),
updateData: Ember.observer('data.@each', function() {
// update plot
var plot = Ember.$.plot('#' + this.get('element').id, this.get('data'), this.get('options'));
this.set('plot', plot);
}),
style: Ember.computed('height', function() {
return Ember.String.htmlSafe("height: " + this.get('height') + ";");
})
});