veritatisquam
Version:
Carbon charting components, lerna monorepo
35 lines (30 loc) • 726 B
text/typescript
import {
Component,
AfterViewInit
} from "@angular/core";
import { BaseChart } from "./base-chart.component";
import { TreemapChart } from "@carbon/charts";
/**
* Wrapper around `TreemapChart` in carbon charts library
*
* Most functions just call their equivalent from the chart library.
*/
export class TreemapChartComponent extends BaseChart implements AfterViewInit {
/**
* Runs after view init to create a chart, attach it to `elementRef` and draw it.
*/
ngAfterViewInit() {
this.chart = new TreemapChart(
this.elementRef.nativeElement,
{
data: this.data,
options: this.options
}
);
Object.assign(this, this.chart);
}
}