fix(chart): resize chart on sidebar expand/collapse (#1816)

This commit is contained in:
Denis Strigo 2018-08-09 15:24:44 +03:00 committed by Dmitry Nehaychik
parent f20c371c17
commit aa8e7cdf27
16 changed files with 393 additions and 172 deletions

View file

@ -15,6 +15,7 @@ import { EarningService } from './earning.service';
import { OrdersProfitChartService } from './orders-profit-chart.service';
import { TrafficBarService } from './traffic-bar.service';
import { ProfitBarAnimationChartService } from './profit-bar-animation-chart.service';
import { LayoutService } from './layout.service';
const SERVICES = [
UserService,
@ -31,6 +32,7 @@ const SERVICES = [
OrdersProfitChartService,
TrafficBarService,
ProfitBarAnimationChartService,
LayoutService,
];
@NgModule({

View file

@ -0,0 +1,20 @@
import { Injectable } from '@angular/core';
import { Observable, Subject } from 'rxjs';
import { delay, share } from 'rxjs/operators';
@Injectable()
export class LayoutService {
protected layoutSize$ = new Subject();
changeLayoutSize() {
this.layoutSize$.next();
}
onChangeLayoutSize(): Observable<any> {
return this.layoutSize$.pipe(
share(),
delay(1),
);
}
}