Skip to content

Commit

Permalink
chore: address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
georgi-sla committed Feb 21, 2024
1 parent 9df33d8 commit 2feed75
Show file tree
Hide file tree
Showing 16 changed files with 426 additions and 427 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<app-header></app-header>

<main class='container-fluid px-0'>
<div class='container'>
<app-stock-list></app-stock-list>
<app-action-buttons></app-action-buttons>
</div>
<div class='container'>
<app-stock-list></app-stock-list>
<app-action-buttons></app-action-buttons>
</div>
</main>

<app-footer></app-footer>
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@ import { TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';

describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AppComponent],
}).compileComponents();
});
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AppComponent],
}).compileComponents();
});

it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});

it(`should have the 'grid-charts-integration' title`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('grid-charts-integration');
});
it(`should have the 'grid-charts-integration' title`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('grid-charts-integration');
});

it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, grid-charts-integration');
});
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, grid-charts-integration');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ import { ActionButtonsComponent } from './components/action-buttons/action-butto
templateUrl: './app.component.html'
})
export class AppComponent {
title = 'grid-charts-integration';
title = 'grid-charts-integration';
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { routes } from './app.routes';

export const appConfig: ApplicationConfig = {
providers: [provideRouter(routes), importProvidersFrom([BrowserAnimationsModule])]
providers: [provideRouter(routes), importProvidersFrom([BrowserAnimationsModule])]
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ import { ChartsModule } from '@progress/kendo-angular-charts';
styleUrl: './day.component.scss'
})
export class DayChartComponent {
@Input() public data: number[] = [];
@Input() public changePct: number = 0;
@Input() public data: number[] = [];
@Input() public changePct: number = 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ import { TooltipsModule } from '@progress/kendo-angular-tooltip';
templateUrl: './pie-donut.component.html',
})
export class PieDonutComponent {
@Input() public data: Stock[] = [];
@Input() public chartConfiguration: ChartConfig = { seriesType: 'pie', stack: false };
public expanded = false;
@Input() public data: Stock[] = [];
@Input() public chartConfiguration: ChartConfig = { seriesType: 'pie', stack: false };
public expanded = false;

public iconDownload: SVGIcon = downloadIcon;
public iconGear: SVGIcon = gearIcon;
public iconDownload: SVGIcon = downloadIcon;
public iconGear: SVGIcon = gearIcon;

public selectedSeries = 'price';
public series: object[] = series;
public seriesTypes: string[] = seriesTypes.circularSeries;
public getTitle = getTitle;
public selectedSeries = 'price';
public series: object[] = series;
public seriesTypes: string[] = seriesTypes.circularSeries;
public getTitle = getTitle;

public onValueChange(chartName: string) {
this.chartConfiguration.seriesType = getChartType(chartName) as SeriesType;
}
public onValueChange(chartName: string) {
this.chartConfiguration.seriesType = getChartType(chartName) as SeriesType;
}

public exportChart(chart: ChartComponent): void {
chart.exportImage().then((data) => {
saveAs(data, 'chart.png');
});
}
public exportChart(chart: ChartComponent): void {
chart.exportImage().then((data) => {
saveAs(data, 'chart.png');
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { CommonModule } from '@angular/common';
templateUrl: './scatter-bubble.component.html',
})
export class ScatterBubbleComponent {
@Input() public chartConfiguration: ChartConfig = { seriesType: 'pie', stack: false };
@Input() public chartConfiguration: ChartConfig = { seriesType: 'pie', stack: false };
@Input() public set data(value: Stock[]) {
this.stockData = value.map((item, index) => {
item.index = index;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
templateUrl: './select-chart-type.component.html',
})
export class SelectChartTypeComponent {
@Input() public data?: any[];
@Input() public chartName?: string;
@Output() public valueChange = new EventEmitter<string>();
@Input() public data?: any[];
@Input() public chartName?: string;
@Output() public valueChange = new EventEmitter<string>();

public onChange(chartName: string) {
this.valueChange.emit(chartName);
}
public onChange(chartName: string) {
this.valueChange.emit(chartName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
templateUrl: './select-series.component.html',
})
export class SelectSeriesComponent {
@Input() public data: object[] = [];
@Output() public valueChange = new EventEmitter<string[]>();
@Input() public data: object[] = [];
@Output() public valueChange = new EventEmitter<string[]>();

public selectedSeries: string[] = ['price', 'pe'];
public selectedSeries: string[] = ['price', 'pe'];

public onChange(value: string[]): void {
this.selectedSeries = value;
this.valueChange.emit(value);
}
public onChange(value: string[]): void {
this.selectedSeries = value;
this.valueChange.emit(value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,31 @@ import { CommonModule } from '@angular/common';
templateUrl: './window.component.html',
})
export class WindowComponent {
@Input() public data: Stock[] = [];
@Input() public chartConfiguration: ChartConfig = {
seriesType: 'line',
stack: false,
};
public isBubbleOrSeriesChart(): boolean {
return (
this.chartConfiguration.seriesType === 'scatter' ||
this.chartConfiguration.seriesType === 'bubble'
);
}
@Input() public data: Stock[] = [];
@Input() public chartConfiguration: ChartConfig = {
seriesType: 'line',
stack: false,
};
public isBubbleOrSeriesChart(): boolean {
return (
this.chartConfiguration.seriesType === 'scatter' ||
this.chartConfiguration.seriesType === 'bubble'
);
}

public isCircularChart(): boolean {
return (
this.chartConfiguration.seriesType === 'pie' ||
this.chartConfiguration.seriesType === 'donut'
);
}
public isCircularChart(): boolean {
return (
this.chartConfiguration.seriesType === 'pie' ||
this.chartConfiguration.seriesType === 'donut'
);
}

public isSimpleChart(): boolean {
return (
this.chartConfiguration.seriesType !== 'pie' &&
this.chartConfiguration.seriesType !== 'donut' &&
this.chartConfiguration.seriesType !== 'scatter' &&
this.chartConfiguration.seriesType !== 'bubble'
);
}
public isSimpleChart(): boolean {
return (
this.chartConfiguration.seriesType !== 'pie' &&
this.chartConfiguration.seriesType !== 'donut' &&
this.chartConfiguration.seriesType !== 'scatter' &&
this.chartConfiguration.seriesType !== 'bubble'
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { CommonModule } from '@angular/common';
encapsulation: ViewEncapsulation.None
})
export class StockListComponent {
@ViewChild('gridmenu') public gridContextMenu: ContextMenuComponent | undefined;
@ViewChild('gridmenu') public gridContextMenu: ContextMenuComponent | undefined;
@ViewChild('grid') public grid: GridComponent | undefined;

public infoIcon: SVGIcon = infoCircleIcon;
Expand Down
Loading

0 comments on commit 2feed75

Please sign in to comment.