Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
hainm committed Dec 7, 2024
1 parent 9d2ede1 commit c868c79
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
14 changes: 10 additions & 4 deletions js/src/molstarview/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) => {
Expand Down
24 changes: 14 additions & 10 deletions notebooks/molviewspec.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down Expand Up @@ -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": {
Expand Down

0 comments on commit c868c79

Please sign in to comment.