2018-01-17 00:10:32 +00:00
|
|
|
import Component from '@ember/component';
|
|
|
|
import { computed } from '@ember/object';
|
2019-10-15 18:32:58 +00:00
|
|
|
import { on } from '@ember/object/evented';
|
2018-01-17 00:10:32 +00:00
|
|
|
|
|
|
|
export default Component.extend({
|
|
|
|
timerTicks: 0,
|
|
|
|
|
2019-10-15 18:32:58 +00:00
|
|
|
startTimer: on('init', function() {
|
2018-01-17 00:10:32 +00:00
|
|
|
this.set(
|
|
|
|
'timer',
|
|
|
|
setInterval(() => {
|
|
|
|
this.incrementProperty('timerTicks');
|
|
|
|
}, 500)
|
|
|
|
);
|
2019-10-15 18:32:58 +00:00
|
|
|
}),
|
2018-01-17 00:10:32 +00:00
|
|
|
|
|
|
|
willDestroy() {
|
2019-03-26 07:46:44 +00:00
|
|
|
clearInterval(this.timer);
|
2018-01-17 00:10:32 +00:00
|
|
|
},
|
|
|
|
|
2018-07-12 23:44:17 +00:00
|
|
|
distributionBarDatum: computed(() => {
|
|
|
|
return [{ label: 'one', value: 10 }];
|
|
|
|
}),
|
|
|
|
|
2018-01-17 00:10:32 +00:00
|
|
|
distributionBarData: computed(() => {
|
|
|
|
return [
|
|
|
|
{ label: 'one', value: 10 },
|
|
|
|
{ label: 'two', value: 20 },
|
|
|
|
{ label: 'three', value: 30 },
|
|
|
|
];
|
|
|
|
}),
|
|
|
|
|
|
|
|
distributionBarDataWithClasses: computed(() => {
|
|
|
|
return [
|
|
|
|
{ label: 'Queued', value: 10, className: 'queued' },
|
|
|
|
{ label: 'Complete', value: 20, className: 'complete' },
|
|
|
|
{ label: 'Failed', value: 30, className: 'failed' },
|
|
|
|
];
|
|
|
|
}),
|
|
|
|
|
|
|
|
distributionBarDataRotating: computed('timerTicks', () => {
|
|
|
|
return [
|
|
|
|
{ label: 'one', value: Math.round(Math.random() * 50) },
|
|
|
|
{ label: 'two', value: Math.round(Math.random() * 50) },
|
|
|
|
{ label: 'three', value: Math.round(Math.random() * 50) },
|
|
|
|
];
|
|
|
|
}),
|
|
|
|
});
|