RcsbFv3DUniprot.tsx 1.6 KB

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