/** * Created by mm28969 on 11/8/16. */ import {areaLayoutCreator, ScaleTypeEnum, ScaleContainerTypeEnum} from "../mmviz-layout/index"; import {AreaComponentSvg} from "../mmviz-component-svg/index"; import {DetailsFocusTypeEnum, DetailsBehavior} from "../mmviz-behavior/index"; import {ChartBuilderSvg} from "./builder"; export class AreaChartBuilderSvg extends ChartBuilderSvg { component; constructor(selector: string) { super(selector); this.component = new AreaComponentSvg(selector); this.detailsBehavior = new DetailsBehavior(selector, this.component.selector); this.detailsBehavior.focusTypeEnum = DetailsFocusTypeEnum.DATA; } createView(){ super.createView(); this.chartView.addContentTypeClass("area-content"); return this; } updateView(): AreaChartBuilderSvg { let viewModel: any, layouter: Function, layoutExtender = areaLayoutCreator(this.colorScaleKey); super.updateView(); this.layoutScale .xScaleSetup(ScaleTypeEnum.LINEAR) .yScaleSetup(ScaleTypeEnum.LINEAR); // setup color scale super.mapColorScale(); layouter = layoutExtender(this.dataModel,this.layoutScale); this.displayAxies(); viewModel = layouter(); this.component.updateView(this.chartView.stage, viewModel); super.updateComponents(); return this; } resizeView(){ return this.updateView(); } }