import { Computations } from './computations';
import { Prerendering } from './prerendering';
/**
 * Data Manager uses Computations and Prerendering modules in order and exposes the results
 */
export class DataManager {
    get containerDimensions() {
        return this.computations.containerDimensions;
    }
    get dieDimensions() {
        return this.computations.dieDimensions;
    }
    get radius() {
        return this.computations.radius;
    }
    get margin() {
        return this.computations.margin;
    }
    get horizontalScale() {
        return this.computations.horizontalScale;
    }
    get invertedHorizontalScale() {
        return this.computations.invertedHorizontalScale;
    }
    get verticalScale() {
        return this.computations.verticalScale;
    }
    get invertedVerticalScale() {
        return this.computations.invertedVerticalScale;
    }
    get labelsFontSize() {
        return this.prerendering.labelsFontSize;
    }
    get diesRenderInfo() {
        return this.prerendering.diesRenderInfo;
    }
    get data() {
        return this.dataMap;
    }
    constructor(wafermap) {
        this.wafermap = wafermap;
        this.computations = new Computations(wafermap);
        this.prerendering = new Prerendering(wafermap);
    }
    updateContainerDimensions() {
        this.computations.updateContainerDimensions();
        this.updateDataMap();
        this.updateLabelsFontSize();
    }
    updateScales() {
        this.computations.updateScales();
        this.updateDataMap();
        this.updateLabelsFontSize();
    }
    updateLabelsFontSize() {
        this.prerendering.updateLabelsFontSize();
    }
    updateDiesRenderInfo() {
        this.prerendering.updateDiesRenderInfo();
    }
    getWaferMapDie(point) {
        return this.dataMap.get(`${point.x}_${point.y}`);
    }
    updateDataMap() {
        this.dataMap = new Map(this.wafermap.dies.map(die => [`${die.x}_${die.y}`, die]));
    }
}
//# sourceMappingURL=data-manager.js.map