diff --git a/js/src/molstarview/representation.ts b/js/src/molstarview/representation.ts index 78967a36..5e7671d5 100644 --- a/js/src/molstarview/representation.ts +++ b/js/src/molstarview/representation.ts @@ -1,11 +1,8 @@ -import { Dict } from "@jupyter-widgets/base" -import { StructureRef } from "molstar/lib/mol-plugin-state/manager/structure/hierarchy-state" -import { PluginUIContext } from "molstar/lib/mol-plugin-ui/context" export -function addRepresentation(plugin: PluginUIContext, params, strucIndex){ - var st: StructureRef = plugin.managers.structure.hierarchy.current.structures[strucIndex] - console.log("Calling from addRepresentation", st, params, strucIndex) +function addRepresentation(plugin, params, modelIndex){ + var st = plugin.managers.structure.hierarchy.current.structures[modelIndex] + console.log("Calling from addRepresentation", st, params, modelIndex) var components = st.components plugin.dataTransaction(async () => { for (const component of components) { @@ -19,6 +16,6 @@ export function removeRepresentation(){ } -export +export function clearRepresentation(){ } diff --git a/js/src/molstarview/widget.ts b/js/src/molstarview/widget.ts index 3d9a1257..4560215b 100644 --- a/js/src/molstarview/widget.ts +++ b/js/src/molstarview/widget.ts @@ -9,7 +9,6 @@ import { PLUGIN_VERSION } from 'molstar/lib/mol-plugin/version'; import './light.css'; // npx sass node_modules/molstar/lib/mol-plugin-ui/skin/light.scss > light.css import * as representation from "./representation"; import { renderReact18 } from "molstar/lib/mol-plugin-ui/react18"; -import { PluginUIContext } from 'molstar/lib/mol-plugin-ui/context'; // import { basicSpec } from "./ui" @@ -48,8 +47,8 @@ export class MolstarModel extends widgets.DOMWidgetModel { // Custom View. Renders the widget model. export class MolstarView extends widgets.DOMWidgetView { - plugin: PluginUIContext; - container: HTMLDivElement; + plugin: any; + container: any; isLeader: boolean; _focused: boolean; _synced_model_ids: any;