From e9ed9c862c868eeeb07e7db2e9c7e797df0b9ddb Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Thu, 25 Jul 2024 16:25:00 -0700 Subject: [PATCH] WIP - chart resizing doesn't work --- .../timeseries-results-menu.component.scss | 8 ++++---- .../timeseries-chart.component.ts | 6 ++++-- .../timeseries-chart/timeseries-chart.module.ts | 16 +++++++++------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/app/components/results-menu/timeseries-results-menu/timeseries-results-menu.component.scss b/src/app/components/results-menu/timeseries-results-menu/timeseries-results-menu.component.scss index e400f1192..37323cfaa 100644 --- a/src/app/components/results-menu/timeseries-results-menu/timeseries-results-menu.component.scss +++ b/src/app/components/results-menu/timeseries-results-menu/timeseries-results-menu.component.scss @@ -60,9 +60,9 @@ } .ts-layer-list { - // flex: 1 1 500px; - flex-basis: 650px; - flex-grow: 0; + flex: 1 1 500px; + //flex-basis: 650px; + //flex-grow: 0; } .ts-layer-list-header { @@ -268,4 +268,4 @@ label { } .ts-column-2 { margin: 25px; -} \ No newline at end of file +} diff --git a/src/app/components/timeseries-chart/timeseries-chart.component.ts b/src/app/components/timeseries-chart/timeseries-chart.component.ts index 2b4fb2049..d7ee20b6a 100644 --- a/src/app/components/timeseries-chart/timeseries-chart.component.ts +++ b/src/app/components/timeseries-chart/timeseries-chart.component.ts @@ -75,7 +75,7 @@ export class TimeseriesChartComponent implements OnInit { ...data.mean }) this.svg.selectChildren().remove(); - + this.drawChart(); } @@ -154,8 +154,9 @@ export class TimeseriesChartComponent implements OnInit { public updateAxis(_axis, _value) { } + public onResized() { - this.createSVG(); + // this.createSVG(); } private createSVG() { @@ -171,6 +172,7 @@ export class TimeseriesChartComponent implements OnInit { .append('g') .attr('transform', `translate(${this.margin.left}, ${this.margin.top})`); this.drawChart(); + } } diff --git a/src/app/components/timeseries-chart/timeseries-chart.module.ts b/src/app/components/timeseries-chart/timeseries-chart.module.ts index 31fbde5a2..3123de73d 100644 --- a/src/app/components/timeseries-chart/timeseries-chart.module.ts +++ b/src/app/components/timeseries-chart/timeseries-chart.module.ts @@ -7,17 +7,19 @@ import { TranslateModule } from "@ngx-translate/core"; import { TimeseriesChartComponent } from './timeseries-chart.component'; import { MatIconModule } from '@angular/material/icon'; import { MatTableModule } from '@angular/material/table'; +import {ResizedEventModule} from '@directives/resized.directive'; @NgModule({ declarations: [TimeseriesChartComponent], - imports: [ - CommonModule, - MatSharedModule, - TranslateModule, - MatTableModule, - MatIconModule - ], + imports: [ + CommonModule, + MatSharedModule, + TranslateModule, + MatTableModule, + MatIconModule, + ResizedEventModule + ], exports: [ TimeseriesChartComponent, ]