RcsbFv3DCustom.tsx 1017 B

1234567891011121314151617181920212223242526272829303132
  1. import {RcsbFvStructureInterface} from "../RcsbFvStructure/RcsbFvStructure";
  2. import {CustomViewInterface} from "../RcsbFvSequence/SequenceViews/CustomView/CustomView";
  3. import {RcsbFv3DAbstract, RcsbFv3DAbstractInterface} from "./RcsbFv3DAbstract";
  4. import uniqid from "uniqid";
  5. export interface RcsbFv3DCustomInterface extends RcsbFv3DAbstractInterface {
  6. structurePanelConfig: RcsbFvStructureInterface;
  7. sequencePanelConfig: {
  8. config: CustomViewInterface;
  9. title?: string;
  10. subtitle?: string;
  11. };
  12. }
  13. export class RcsbFv3DCustom extends RcsbFv3DAbstract<{}> {
  14. constructor(config?: RcsbFv3DCustomInterface) {
  15. super(config);
  16. }
  17. init(config: RcsbFv3DCustomInterface) {
  18. this.elementId = config.elementId ?? "RcsbFv3D_mainDiv_"+uniqid();
  19. this.structureConfig = config.structurePanelConfig;
  20. this.sequenceConfig = {
  21. ...config.sequencePanelConfig,
  22. type:"custom"
  23. };
  24. this.cssConfig = config.cssConfig;
  25. }
  26. }