Browse Source

expose canvas props

Sebastian Bittrich 3 years ago
parent
commit
adb1364680
2 changed files with 8 additions and 2 deletions
  1. 2 1
      CHANGELOG.md
  2. 6 1
      src/viewer/index.ts

+ 2 - 1
CHANGELOG.md

@@ -2,10 +2,11 @@
 
 [Semantic Versioning](https://semver.org/)
 
-## Unreleased
+## [2.2.0] - 2022-02-22
 ### Added
 - Expose Quick Styles functionality
 - More fine-grained options for UI controls
+- Expose Canvas3DProps
 
 ## [2.1.2] - 2022-02-08
 ### General

+ 6 - 1
src/viewer/index.ts

@@ -46,6 +46,7 @@ import { ModelExport } from 'molstar/lib/extensions/model-export';
 import { exportHierarchy } from 'molstar/lib/extensions/model-export/export';
 import { GeometryExport } from 'molstar/lib/extensions/geo-export';
 import { Mp4Export } from 'molstar/lib/extensions/mp4-export';
+import { PartialCanvas3DProps } from 'molstar/lib/mol-canvas3d/canvas3d';
 
 /** package version, filled in at bundle build time */
 declare const __RCSB_MOLSTAR_VERSION__: string;
@@ -111,7 +112,7 @@ const DefaultViewerProps = {
     backgroundColor: ColorNames.white,
     showWelcomeToast: true
 };
-export type ViewerProps = typeof DefaultViewerProps
+export type ViewerProps = typeof DefaultViewerProps & { canvas3d: PartialCanvas3DProps }
 
 export class Viewer {
     private readonly _plugin: PluginUIContext;
@@ -140,6 +141,10 @@ export class Viewer {
                     controlsDisplay: o.layoutControlsDisplay,
                 },
             },
+            canvas3d: {
+                ...defaultSpec.canvas3d,
+                ...o.canvas3d
+            },
             components: {
                 ...defaultSpec.components,
                 controls: {