RcsbFv3DUniprot.tsx 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import {RcsbFv3DAbstract, RcsbFv3DAbstractInterface} from "./RcsbFv3DAbstract";
  2. import {RcsbFvAdditionalConfig} from "@rcsb/rcsb-saguaro-app/build/dist/RcsbFvWeb/RcsbFvModule/RcsbFvModuleInterface";
  3. import uniqid from "uniqid";
  4. import {UniprotPfvFactory} from "../RcsbFvSequence/SequenceViews/RcsbView/PfvFactoryImplementation/UniprotPfvFactory";
  5. import {
  6. UniprotCallbackManager
  7. } from "../RcsbFvSequence/SequenceViews/RcsbView/CallbackManagerImplementation/UniprotCallbackManager";
  8. export interface RcsbFv3DUniprotInterface extends RcsbFv3DAbstractInterface {
  9. config: {
  10. upAcc: string;
  11. title?: string;
  12. subtitle?: string;
  13. };
  14. additionalConfig?:RcsbFvAdditionalConfig;
  15. }
  16. export class RcsbFv3DUniprot extends RcsbFv3DAbstract<{upAcc:string}> {
  17. constructor(config?:RcsbFv3DUniprotInterface){
  18. super(config);
  19. }
  20. protected init(upData: RcsbFv3DUniprotInterface): void {
  21. this.elementId = upData.elementId ?? "RcsbFv3D_mainDiv_"+uniqid();
  22. this.structureConfig = {};
  23. this.sequenceConfig = {
  24. type: "rcsb",
  25. config:{
  26. rcsbId: upData.config.upAcc,
  27. additionalConfig: upData.additionalConfig,
  28. pfvFactory:UniprotPfvFactory,
  29. pfvParams:{
  30. upAcc:upData.config.upAcc
  31. },
  32. callbackManager: UniprotCallbackManager,
  33. buildPfvOnMount: true
  34. }
  35. }
  36. }
  37. }