From c868c799e26bc27e5e1fb774b766ef09c452a8e6 Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Fri, 6 Dec 2024 21:42:11 -0500 Subject: [PATCH] more --- js/src/molstarview/widget.ts | 14 ++++++++++---- notebooks/molviewspec.ipynb | 24 ++++++++++++++---------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/js/src/molstarview/widget.ts b/js/src/molstarview/widget.ts index d5c07618..181feae2 100644 --- a/js/src/molstarview/widget.ts +++ b/js/src/molstarview/widget.ts @@ -13,8 +13,8 @@ import { PluginUIContext } from 'molstar/lib/mol-plugin-ui/context'; import { loadMVS } from 'molstar/lib/extensions/mvs/load'; import { MVSData } from 'molstar/lib/extensions/mvs/mvs-data'; import { MolViewSpec } from 'molstar/lib/extensions/mvs/behavior'; -import { PluginSpec } from 'molstar/lib/mol-plugin/spec'; -import { PluginUISpec } from 'molstar/lib/mol-plugin-ui/spec'; +import { PluginUISpec } from 'molstar/lib/mol-plugin-ui/spec'; +import { DefaultPluginSpec, PluginSpec } from 'molstar/lib/mol-plugin/spec'; // import { basicSpec } from "./ui" @@ -76,9 +76,15 @@ export class MolstarView extends widgets.DOMWidgetView { async initializeDisplay() { this.setupContainer(); + + var defaultSpec = DefaultPluginSpec(); var spec: PluginUISpec = { - behaviors: [PluginSpec.Behavior(MolViewSpec)] - } + ...defaultSpec, + behaviors: [ + ...defaultSpec.behaviors, + PluginSpec.Behavior(MolViewSpec) + ] + }; this.plugin = await createPluginUI({ target: this.container, render: (component, container) => { diff --git a/notebooks/molviewspec.ipynb b/notebooks/molviewspec.ipynb index 7632e067..f19ead5d 100644 --- a/notebooks/molviewspec.ipynb +++ b/notebooks/molviewspec.ipynb @@ -2,14 +2,26 @@ "cells": [ { "cell_type": "code", - "execution_count": 5, + "execution_count": 1, "id": "fedefdce-ce21-4c3c-90bd-27909fe17413", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "7eb38b3aa4f14a40adb50bae1d0937b2", + "model_id": "e74f2c3635cc4b89987bd72f1c25880b", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "f2dd1db95dca410fa8c99c6839f22ae0", "version_major": 2, "version_minor": 0 }, @@ -39,14 +51,6 @@ "view.load_spec(state)\n", "view" ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "721ddcc5-b651-460a-8405-af86b8cae20f", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": {