@rcsb/rcsb-saguaro-app
Version:
RCSB 1D Saguaro Web App
32 lines • 1.04 kB
JavaScript
import * as dcm from "./RcsbDistributionConfig.dc.json";
const distributionConfig = dcm;
export class RcsbDistributionConfig {
constructor(dcm = distributionConfig) {
this.trackToBlockType = new Map();
this.trackConfig = new Map();
this.blockConfig = new Map();
this.distributionConfig = dcm;
this.processConfig();
}
getBlockType(trackType) {
return this.trackToBlockType.get(trackType);
}
getBlockConfig(type) {
return this.blockConfig.get(type);
}
getTrackConfig(type) {
return this.trackConfig.get(type);
}
processConfig() {
this.distributionConfig.blockConfig.forEach(bc => {
this.blockConfig.set(bc.type, bc);
bc.trackType.forEach(type => {
this.trackToBlockType.set(type, bc.type);
});
});
this.distributionConfig.trackConfig.forEach(tc => {
this.trackConfig.set(tc.type, tc);
});
}
}
//# sourceMappingURL=RcsbDistributionConfig.js.map