Skip to content

Commit

Permalink
fix: visually unbreak the demo (because of a CSS api change on the wr…
Browse files Browse the repository at this point in the history
…apper component)
  • Loading branch information
0gust1 committed Sep 21, 2023
1 parent eb9092c commit 72c3816
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions src/lib/elements/StructureAlphaFold.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
| undefined;
const plugin = getContext<{ getPlugin: () => PluginContext }>('molstar').getPlugin();
let structure: Awaited<ReturnType<typeof plugin.builders.structure.createStructure>>;
//plugin.representation.structure.themes.colorThemeRegistry.add();
// FIXME: move this at molstar wrapper level.
// when unmounting + mounting again, molstar understably complains about the preset already being registred.
plugin.builders.structure.representation.registerPreset(QualityAssessmentPLDDTPreset);
const init = async () => {
Expand All @@ -49,7 +51,8 @@
await plugin.builders.structure.hierarchy.applyPreset(
trajectory,
'preset-structure-representation-ma-quality-assessment-plddt'
'preset-structure-representation-ma-quality-assessment-plddt',
params
);
//await plugin.builders.structure.hierarchy.applyPreset(model, 'default', params);
Expand Down
2 changes: 1 addition & 1 deletion src/routes/components/simple-controls/DemoControls.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
let selectedStructuresURLs = [...structuresURLs];
</script>

<MolstarWrapper class="h-96">
<MolstarWrapper class="" pluginCssClasses="h-96 w-full">
<svelte:fragment slot="inside">
{#each selectedStructuresURLs as structureURL (`${structureURL.url}-${structureURL.type}`)}
<StructureURL url={structureURL.url} type={structureURL.type} />
Expand Down
2 changes: 1 addition & 1 deletion src/routes/components/simple-elements/DemoRCSB.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<p class="text-xs">
Selected: <span class="text-violet-500">{selectedPdbIds.join(', ')}</span>
</p>
<MolstarWrapper class="h-96">
<MolstarWrapper class="h-96" pluginCssClasses="h-96 w-full">
<svelte:fragment slot="inside">
{#each selectedPdbIds as pdbId (pdbId)}
<StructureRCSB {pdbId} />
Expand Down
2 changes: 1 addition & 1 deletion src/routes/components/simple-elements/DemoURL.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
>{selectedStructuresURLs.map((e) => e.url).join(', ')}</span
>
</p>
<MolstarWrapper class="h-96">
<MolstarWrapper class="h-96" pluginCssClasses="h-96 w-full">
<svelte:fragment slot="inside">
{#each selectedStructuresURLs as structureURL (`${structureURL.url}-${structureURL.type}`)}
<StructureURL url={structureURL.url} type={structureURL.type} />
Expand Down
2 changes: 1 addition & 1 deletion src/routes/components/simple-elements/DemoURLChain.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
>{selectedStructuresURLs.map((e) => e.url).join(', ')}</span
>
</p>
<MolstarWrapper class="h-96">
<MolstarWrapper class="" pluginCssClasses="h-96 w-full">
<svelte:fragment slot="inside">
{#each selectedStructuresURLs as structureURL (`${structureURL.url}-${structureURL.type}-${structureURL.chainId}`)}
<StructureURLChain
Expand Down
2 changes: 1 addition & 1 deletion src/routes/getting-started/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export let structureType = 'mmcif';

#### Slots

You'll get 2 slots: `elements` and `controls`.
You'll get 2 slots: `inside` and `outside`.

Each component you'll inject in these two slots:
- will be rendered in a different container (depending on the slot).
Expand Down

0 comments on commit 72c3816

Please sign in to comment.