UNPKG

@rcsb/rcsb-saguaro-app

Version:
24 lines (23 loc) 1.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AnnotationsBlockFactory = void 0; const tslib_1 = require("tslib"); class AnnotationsBlockFactory { constructor(annotationBlockManager, annotationTrackFactory, trackModifier) { this.annotationsBlockData = new Array(); this.annotationBlockManager = annotationBlockManager; this.trackFactory = annotationTrackFactory; this.trackConfigModifier = trackModifier; } getBlock(annotationsRequestContext, annotations) { return tslib_1.__awaiter(this, void 0, void 0, function* () { yield this.annotationBlockManager.setData(annotationsRequestContext, annotations); yield Promise.all(this.annotationBlockManager.getTracks().map((track) => tslib_1.__awaiter(this, void 0, void 0, function* () { var _a; this.annotationsBlockData.push(Object.assign(Object.assign({}, yield this.trackFactory.getTrack(track)), yield ((_a = this.trackConfigModifier) === null || _a === void 0 ? void 0 : _a.call(this, track)))); }))); return this.annotationsBlockData; }); } } exports.AnnotationsBlockFactory = AnnotationsBlockFactory;