123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425 |
- <!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@rcsb/rcsb-saguaro-3d</title><meta name="description" content="Documentation for @rcsb/rcsb-saguaro-3d"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script async src="assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">@rcsb/rcsb-saguaro-3d</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><h1> @rcsb/rcsb-saguaro-3d </h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><div class="tsd-panel tsd-typography">
- <a href="#rcsb-saguaro-3d" id="rcsb-saguaro-3d" style="color: inherit; text-decoration: none;">
- <h1>rcsb-saguaro-3D</h1>
- </a>
- <p>RCSB Saguaro Web 3D is an open-source library built on the top of the <a href="https://rcsb.github.io/rcsb-saguaro">RCSB Saguaro 1D Feature Viewer</a>
- and <a href="https://github.com/rcsb/rcsb-Molstar">RCSB Molstar</a> designed to display protein features at the <a href="https://www.rcsb.org">RCSB Web Site</a>.
- The package collects protein annotations from the <a href="https://1d-coordinates.rcsb.org">1D Coordinate Server</a>
- and the main <a href="https://data.rcsb.org">RCSB Data API</a> and generates Protein Feature Summaries.
- The package allows access to RCSB Saguaro and Molstar methods to add or change the displayed data. </p>
- <div id="pfv"></div>
- <script crossorigin src="https://unpkg.com/react@17/umd/react.production.min.js"></script>
- <script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script>
- <script crossorigin src="https://cdn.jsdelivr.net/npm/@rcsb/rcsb-saguaro-3d/build/dist/app.js"></script>
- <script type="text/javascript">
- var __assign = (this && this.__assign) || function () {
- __assign = Object.assign || function(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
- t[p] = s[p];
- }
- return t;
- };
- return __assign.apply(this, arguments);
- };
- var rowConfigChainA = [
- {
- trackId: "sequenceTrack",
- trackHeight: 20,
- trackColor: "#F9F9F9",
- displayType: "sequence" /* SEQUENCE */,
- nonEmptyDisplay: true,
- rowTitle: "CHAIN A",
- trackData: [
- {
- begin: 1,
- value: "CGVPAIQPVLSGLSRIVNGEEAVPGSWPWQVSLQDKTGFHFCGGSLINENWVVTAAHCGVTTSDVVVAGEFDQGSSSEKIQKLKIAKVFKNSKYNSLTINNDITLLKLSTAASFSQTVSAVCLPSASDDFAAGTTCVTTGWGLTRYTNANTPDRLQQASLPLLSNTNCKKYWGTKIKDAMICAGASGVSSCMGDSGGPLVCKKNGAWTLVGIVSWGSSTCSTSTPGVYARVTALVNWVQQTLAAN"
- }
- ]
- }, {
- trackId: "blockTrack",
- trackHeight: 20,
- trackColor: "#F9F9F9",
- displayType: "block" /* BLOCK */,
- displayColor: "#76ae91",
- rowTitle: "FEATURE",
- trackData: [{
- begin: 20,
- end: 25
- }, {
- begin: 150,
- end: 160
- }]
- }
- ];
- var rowConfigChainB = [
- {
- trackId: "sequenceTrack",
- trackHeight: 20,
- trackColor: "#F9F9F9",
- displayType: "sequence" /* SEQUENCE */,
- nonEmptyDisplay: true,
- rowTitle: "CHAIN B",
- trackData: [
- {
- begin: 1,
- value: "TEFGSELKSFPEVVGKTVDQAREYFTLHYPQYDVYFLPEGSPVTLDLRYNRVRVFYNPGTNVVNHVPHVG"
- }
- ]
- }, {
- trackId: "blockTrack",
- trackHeight: 20,
- trackColor: "#F9F9F9",
- displayType: "block" /* BLOCK */,
- displayColor: "#f17070",
- rowTitle: "FEATURE",
- trackData: [{
- begin: 20,
- end: 50
- }]
- }
- ];
- var fvConfigChainA = {
- boardId: "1acb.A_board",
- boardConfig: {
- range: {
- min: 1,
- max: 245
- },
- disableMenu:true,
- rowTitleWidth: 80,
- trackWidth: 670,
- includeAxis: true
- },
- rowConfig: rowConfigChainA,
- sequenceSelectionChangeCallback: function (plugin, selectorManager, sequenceRegion) {
- selectorManager.clearSelection("select", { modelId: "1acb_board", labelAsymId: "A" });
- plugin.clearSelection("select", { modelId: "1acb_board", labelAsymId: "A" });
- if (sequenceRegion.length > 0) {
- var regions = sequenceRegion.map(function (r) {
- var _a;
- return ({
- modelId: "1acb_board",
- labelAsymId: "A",
- region: { begin: r.begin, end: (_a = r.end) !== null && _a !== void 0 ? _a : r.begin, source: "sequence" }
- });
- });
- selectorManager.addSelectionFromMultipleRegions(regions, "select");
- plugin.select(regions.map(function (r) { return (__assign(__assign({}, r), { begin: r.region.begin, end: r.region.end })); }), "select", "add");
- }
- else {
- plugin.resetCamera();
- }
- },
- sequenceElementClickCallback: function (plugin, selectorManager, d) {
- var _a;
- if (d != null)
- plugin.cameraFocus("1acb_board", "A", d.begin, (_a = d.end) !== null && _a !== void 0 ? _a : d.begin);
- },
- sequenceHoverCallback: function (plugin, selectorManager, elements) {
- if (elements == null || elements.length == 0)
- plugin.clearSelection("hover");
- else
- plugin.select(elements.map(function (e) {
- var _a;
- return ({
- modelId: "1acb_board",
- labelAsymId: "A",
- begin: e.begin,
- end: (_a = e.end) !== null && _a !== void 0 ? _a : e.begin
- });
- }), "hover", "set");
- },
- structureSelectionCallback: function (plugin, pfv, selection) {
- var sel = selection.getSelectionWithCondition("1acb_board", "A", "select");
- if (sel == null) {
- pfv.clearSelection("select");
- plugin.resetCamera();
- }
- else {
- pfv.setSelection({ elements: sel.regions, mode: "select" });
- }
- },
- structureHoverCallback: function (plugin, pfv, selection) {
- var sel = selection.getSelectionWithCondition("1acb_board", "A", "hover");
- if (sel == null)
- pfv.clearSelection("hover");
- else
- pfv.setSelection({ elements: sel.regions, mode: "hover" });
- }
- };
- var fvConfigChainB = {
- boardId: "1acb.B_board",
- boardConfig: {
- range: {
- min: 1,
- max: 70
- },
- disableMenu:true,
- rowTitleWidth: 80,
- trackWidth: 670,
- includeAxis: true
- },
- rowConfig: rowConfigChainB,
- sequenceSelectionChangeCallback: function (plugin, selectorManager, sequenceRegion) {
- selectorManager.clearSelection("select", { modelId: "1acb_board", labelAsymId: "B" });
- plugin.clearSelection("select", { modelId: "1acb_board", labelAsymId: "B" });
- if (sequenceRegion.length > 0) {
- var regions = sequenceRegion.map(function (r) {
- var _a;
- return ({
- modelId: "1acb_board",
- labelAsymId: "B",
- region: { begin: r.begin, end: (_a = r.end) !== null && _a !== void 0 ? _a : r.begin, source: "sequence" }
- });
- });
- selectorManager.addSelectionFromMultipleRegions(regions, "select");
- plugin.select(regions.map(function (r) { return (__assign(__assign({}, r), { begin: r.region.begin, end: r.region.end })); }), "select", "add");
- }
- else {
- plugin.resetCamera();
- }
- },
- sequenceElementClickCallback: function (plugin, selectorManager, d) {
- var _a;
- if (d != null)
- plugin.cameraFocus("1acb_board", "B", d.begin, (_a = d.end) !== null && _a !== void 0 ? _a : d.begin);
- },
- sequenceHoverCallback: function (plugin, selectorManager, elements) {
- if (elements == null || elements.length == 0)
- plugin.clearSelection("hover");
- else
- plugin.select(elements.map(function (e) {
- var _a;
- return ({
- modelId: "1acb_board",
- labelAsymId: "B",
- begin: e.begin,
- end: (_a = e.end) !== null && _a !== void 0 ? _a : e.begin
- });
- }), "hover", "set");
- },
- structureSelectionCallback: function (plugin, pfv, selection) {
- var sel = selection.getSelectionWithCondition("1acb_board", "B", "select");
- if (sel == null) {
- pfv.clearSelection("select");
- plugin.resetCamera();
- }
- else {
- pfv.setSelection({ elements: sel.regions, mode: "select" });
- }
- },
- structureHoverCallback: function (plugin, pfv, selection) {
- var sel = selection.getSelectionWithCondition("1acb_board", "B", "hover");
- if (sel == null)
- pfv.clearSelection("hover");
- else
- pfv.setSelection({ elements: sel.regions, mode: "hover" });
- }
- };
- var blockChainA = {
- blockId: "chainA",
- featureViewConfig: [fvConfigChainA]
- };
- var blockChainB = {
- blockId: "chainB",
- featureViewConfig: [fvConfigChainB]
- };
- var blockSelectorElement = function (blockSelectorManager) {
- return (React.createElement("div", null,
- React.createElement("select", { onChange: function (e) {
- blockSelectorManager.setActiveBlock(e.target.value);
- } },
- React.createElement("option", { value: "chainA" }, "Chain A"),
- React.createElement("option", { value: "chainB" }, "Chain B"))));
- };
- var customConfig = {
- blockConfig: [blockChainA, blockChainB],
- blockSelectorElement: blockSelectorElement
- };
- var sequenceConfig = {
- title: undefined,
- subtitle: undefined,
- config: customConfig
- };
- var MolstarConfig = {
- loadConfig: {
- loadMethod: "loadPdbIds",
- loadParams: [{
- pdbId: "1acb",
- id: "1acb_board"
- }]
- },
- pluginConfig: {
- showImportControls: true,
- showSessionControls: false
- },
- };
- document.addEventListener("DOMContentLoaded", function (event) {
- var panel3d = new RcsbFv3D.custom({
- elementId: "pfv",
- structurePanelConfig: MolstarConfig,
- sequencePanelConfig: sequenceConfig,
- cssConfig: {
- overwriteCss:true,
- rootPanel:{
- display:"flex",
- flexDirection:"column-reverse"
- },
- structurePanel:{
- width: 750,
- height: 700
- },
- sequencePanel:{
- width:750,
- marginBottom:5
- }
- },
- });
- panel3d.render();
- });
- </script>
- <a href="#cdn-javascript" id="cdn-javascript" style="color: inherit; text-decoration: none;">
- <h3>CDN JavaScript</h3>
- </a>
- <p><code><script src="https://cdn.jsdelivr.net/npm/@rcsb/rcsb-saguaro-3d/build/dist/app.js" type="text/javascript"></script></code></p>
- <a href="#node-module-instalation" id="node-module-instalation" style="color: inherit; text-decoration: none;">
- <h3>Node Module Instalation</h3>
- </a>
- <p><code>npm install @rcsb/rcsb-saguaro-3d</code></p>
- <a href="#building-amp-running" id="building-amp-running" style="color: inherit; text-decoration: none;">
- <h2>Building & Running</h2>
- </a>
- <a href="#build-app" id="build-app" style="color: inherit; text-decoration: none;">
- <h3>Build app</h3>
- </a>
- <pre><code><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-0">install</span><br/><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-0">run</span><span class="hl-1"> </span><span class="hl-0">buildApp</span>
- </code></pre>
- <a href="#build-examples" id="build-examples" style="color: inherit; text-decoration: none;">
- <h3>Build examples</h3>
- </a>
- <pre><code><span class="hl-0">npm</span><span class="hl-1"> </span><span class="hl-0">run</span><span class="hl-1"> </span><span class="hl-0">buildExamples</span>
- </code></pre>
- <p>From the root of the project:</p>
- <pre><code><span class="hl-0">npx</span><span class="hl-1"> </span><span class="hl-0">http</span><span class="hl-1">-</span><span class="hl-0">server</span><span class="hl-1"> -</span><span class="hl-0">p</span><span class="hl-1"> </span><span class="hl-2">PORT</span><span class="hl-1">-</span><span class="hl-2">NUMBER</span>
- </code></pre>
- <p>and navigate to <code>localhost:PORT-NUMBER/build/examples/</code></p>
- <a href="#library-documentation" id="library-documentation" style="color: inherit; text-decoration: none;">
- <h3>Library Documentation</h3>
- </a>
- <p>TypeScript full classes documentation can be found <a href="https://rcsb.github.io/rcsb-saguaro-3d/globals.html">here</a>.</p>
- <a href="#main-classes-and-interfaces" id="main-classes-and-interfaces" style="color: inherit; text-decoration: none;">
- <h3>Main Classes and Interfaces</h3>
- </a>
- <a href="#assembly-view" id="assembly-view" style="color: inherit; text-decoration: none;">
- <h4>Assembly view</h4>
- </a>
- <p>Class <strong><code>RcsbFv3DAssembly</code></strong> (<code>src/RcsbFv3D/RcsbFv3DAssembly.tsx</code>) builds a predefined 1D/3D view for PDB assemblies. This method is used in the RCSB PDB web portal
- to display 1D positional features of PDB models (ex: <a href="https://www.rcsb.org/3d-sequence/4HHB">4hhb</a>). Its configuration requires a single PDB Id.
- In addition, <code>additionalConfig</code> allows to configure the feature viewer as describe in rcsb-saguaro-app <a href="https://rcsb.github.io/rcsb-saguaro-app/interfaces/rcsbfvadditionalconfig.html">API</a>.
- This parameter exposes the board configuration through the attribute <code>boardConfig</code> (<a href="https://rcsb.github.io/rcsb-saguaro/interfaces/rcsbfvboardconfiginterface.html">ref</a>).
- The component will be mounted in the html element with id <code>elementId</code>. If there is no html element in the current document,
- a new div element will be added, and the component will be displayed in full screen mode. </p>
- <pre><code class="language-typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-4">RcsbFv3DAssemblyInterface</span><span class="hl-1"> </span><span class="hl-3">extends</span><span class="hl-1"> </span><span class="hl-4">RcsbFv3DAbstractInterface</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">elementId</span><span class="hl-1">: </span><span class="hl-5">"htmlElement"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-0">config</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-0">entryId</span><span class="hl-1">: </span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">title</span><span class="hl-1">?: </span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">subtitle</span><span class="hl-1">?: </span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> };</span><br/><span class="hl-1"> </span><span class="hl-0">additionalConfig</span><span class="hl-1">?: </span><span class="hl-4">RcsbFvAdditionalConfig</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
- </code></pre>
- <p>Source code example can be found in <code>src/examples/assembly/index.ts</code>.</p>
- <a href="#custom-view" id="custom-view" style="color: inherit; text-decoration: none;">
- <h4>Custom view</h4>
- </a>
- <p>Class <strong><code>RcsbFv3DCustom</code></strong> file <code>src/RcsbFv3D/RcsbFv3DCustom.tsx</code> builds a customized view between one or more feature viewers and a single Molstar plugin.
- The configuration interface encodes the parameters for the feature viewers (<code>sequencePanelConfig</code>), the Molstar plugin (<code>structurePanelConfig</code>) and
- their dynamic interaction.</p>
- <pre><code class="language-typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-4">RcsbFv3DCustomInterface</span><span class="hl-1"> </span><span class="hl-3">extends</span><span class="hl-1"> </span><span class="hl-4">RcsbFv3DAbstractInterface</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">elementId</span><span class="hl-1">: </span><span class="hl-5">"htmlElement"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-0">structurePanelConfig</span><span class="hl-1">: </span><span class="hl-4">RcsbFvStructureInterface</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">sequencePanelConfig</span><span class="hl-1">: {</span><br/><span class="hl-1"> </span><span class="hl-0">config</span><span class="hl-1">: </span><span class="hl-4">CustomViewInterface</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">title</span><span class="hl-1">?: </span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">subtitle</span><span class="hl-1">?: </span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> };</span><br/><span class="hl-1">}</span>
- </code></pre>
- <p><img src="https://raw.githubusercontent.com/rcsb/rcsb-saguaro-3d/master/.github/img/config_img.png" alt="Alt text" title="Custom config schema"></p>
- <a href="#structural-panel" id="structural-panel" style="color: inherit; text-decoration: none;">
- <h5>Structural Panel</h5>
- </a>
- <p>The structural panel configuration <code>structurePanelConfig: RcsbFvStructureInterface</code> includes the loading configuration for the 3D structural data
- and the Molstar plugin. A full description of the structural panel configuration can be found <a href="https://rcsb.github.io/rcsb-saguaro-3d/interfaces/rcsbfvstructureinterface.html">here</a>. </p>
- <pre><code class="language-typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-4">RcsbFvStructureInterface</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">loadConfig</span><span class="hl-1">: </span><span class="hl-4">LoadMolstarInterface</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">pluginConfig</span><span class="hl-1">?: </span><span class="hl-4">Partial</span><span class="hl-1"><</span><span class="hl-4">ViewerProps</span><span class="hl-1">>;</span><br/><span class="hl-1">}</span>
- </code></pre>
- <p>The attribute <code>loadConfig: LoadMolstarInterface</code> encodes the configuration for loading the 3D structural data. </p>
- <pre><code class="language-typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-4">LoadMolstarInterface</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">loadMethod</span><span class="hl-1">: </span><span class="hl-4">LoadMethod</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">loadParams</span><span class="hl-1">: </span><span class="hl-4">LoadParams</span><span class="hl-1"> | </span><span class="hl-4">Array</span><span class="hl-1"><</span><span class="hl-4">LoadParams</span><span class="hl-1">>;</span><br/><span class="hl-1">}</span>
- </code></pre>
- <ul>
- <li><code>loadMethod: LoadMethod</code> is an enumerated value that indicates the source of the structural models<pre><code class="language-typescript"><span class="hl-3">enum</span><span class="hl-1"> </span><span class="hl-4">LoadMethod</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-2">loadPdbId</span><span class="hl-1"> = </span><span class="hl-5">"loadPdbId"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">loadPdbIds</span><span class="hl-1"> = </span><span class="hl-5">"loadPdbIds"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-2">loadStructureFromUrl</span><span class="hl-1"> = </span><span class="hl-5">"loadStructureFromUrl"</span><br/><span class="hl-1">}</span>
- </code></pre>
- </li>
- <li><code>loadParams: LoadParams | Array<LoadParams></code> encode the parameters needed to collect and load the data. If <code>id</code> is provided, it can be used to identify the 3D models
- in the methods defined by <code>SaguaroPluginPublicInterface</code></li>
- </ul>
- <pre><code class="language-typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-4">LoadParams</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">id</span><span class="hl-1">?: </span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">pdbId</span><span class="hl-1">?: </span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">url</span><span class="hl-1">?: </span><span class="hl-4">string</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-0">isBinary</span><span class="hl-1">?: </span><span class="hl-4">boolean</span><br/><span class="hl-1">}</span>
- </code></pre>
- <a href="#sequence-panel" id="sequence-panel" style="color: inherit; text-decoration: none;">
- <h5>Sequence panel</h5>
- </a>
- <p>The sequence panel organizes information in different blocks where each block encodes the configuration
- (<code>blockConfig</code>) to display one or more feature viewers. Only a single block can be displayed at a time. The optional parameter <code>blockSelectorElement</code> defines a React component
- that renders the html element used to change the displayed block. The class <code>BlockSelectorManager</code> is used to select which block is
- displayed are those that are hidden. For example, <code>blockSelectorManager.setActiveBlock("myBlock")</code> will display the feature viewers defined in the block
- with <code>blockId</code> <code>"myBlock"</code> (see <code>FeatureBlockInterface</code>) and hide the others. Additionally, <code>blockChangeCallback</code> defines a function that will be executed
- when the displayed block changes.</p>
- <pre><code class="language-typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-4">CustomViewInterface</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">blockConfig</span><span class="hl-1">: </span><span class="hl-4">FeatureBlockInterface</span><span class="hl-1"> | </span><span class="hl-4">Array</span><span class="hl-1"><</span><span class="hl-4">FeatureBlockInterface</span><span class="hl-1">>;</span><br/><span class="hl-1"> </span><span class="hl-6">blockSelectorElement</span><span class="hl-1">?: (</span><span class="hl-0">blockSelector</span><span class="hl-1">: </span><span class="hl-4">BlockSelectorManager</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-4">JSX</span><span class="hl-1">.</span><span class="hl-4">Element</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-6">blockChangeCallback</span><span class="hl-1">?: (</span><span class="hl-0">plugin</span><span class="hl-1">: </span><span class="hl-4">SaguaroPluginPublicInterface</span><span class="hl-1">, </span><span class="hl-0">pfvList</span><span class="hl-1">: </span><span class="hl-4">Array</span><span class="hl-1"><</span><span class="hl-4">RcsbFv</span><span class="hl-1">>, </span><span class="hl-0">selection</span><span class="hl-1">: </span><span class="hl-4">RcsbFvSelectorManager</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-4">void</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
- </code></pre>
- <p>Source code example can be found in <code>src/examples/multiple-chain/index.ts</code>.</p>
- <p>Each block must contain a unique block identifier (<code>blockId</code>) and the configuration for all the feature viewers that will be rendered
- when the block is activated (<code>featureViewConfig</code>).</p>
- <pre><code class="language-typescript"><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-4">FeatureBlockInterface</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">blockId</span><span class="hl-1">:</span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">featureViewConfig</span><span class="hl-1">: </span><span class="hl-4">Array</span><span class="hl-1"><</span><span class="hl-4">FeatureViewInterface</span><span class="hl-1">> | </span><span class="hl-4">FeatureViewInterface</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
- </code></pre>
- <p>The interface for each feature viewer defines its dynamic interaction with the Molstar plugin through different event callbacks functions</p>
- <ul>
- <li><code>sequenceSelectionChangeCallback</code> defines how the Molstar plugin reacts when the feature viewer selection changes</li>
- <li><code>sequenceElementClickCallback</code> defines how the Molstar plugin reacts when a feature viewer element (positional annotation) is clicked</li>
- <li><code>sequenceHoverCallback</code> defines how the Molstar plugin reacts when the mouse hovers the feature viewer or any of its elements</li>
- <li><code>structureSelectionCallback</code> defines how the protein feature viewer reacts when the Molstar plugin selection changes</li>
- <li><code>structureHoverCallback</code> defines how the protein feature viewer reacts when displayed models on the Molstar plugin are hovered</li>
- </ul>
- <pre><code class="language-typescript"><span class="hl-7">export</span><span class="hl-1"> </span><span class="hl-3">interface</span><span class="hl-1"> </span><span class="hl-4">FeatureViewInterface</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-0">boardId</span><span class="hl-1">?:</span><span class="hl-4">string</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">boardConfig</span><span class="hl-1">: </span><span class="hl-4">RcsbFvBoardConfigInterface</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-0">rowConfig</span><span class="hl-1">: </span><span class="hl-4">Array</span><span class="hl-1"><</span><span class="hl-4">RcsbFvRowConfigInterface</span><span class="hl-1">>;</span><br/><span class="hl-1"> </span><span class="hl-6">sequenceSelectionChangeCallback</span><span class="hl-1">: (</span><span class="hl-0">plugin</span><span class="hl-1">: </span><span class="hl-4">SaguaroPluginPublicInterface</span><span class="hl-1">, </span><span class="hl-0">selectorManager</span><span class="hl-1">: </span><span class="hl-4">RcsbFvSelectorManager</span><span class="hl-1">, </span><span class="hl-0">sequenceRegion</span><span class="hl-1">: </span><span class="hl-4">Array</span><span class="hl-1"><</span><span class="hl-4">RcsbFvTrackDataElementInterface</span><span class="hl-1">>) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-4">void</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-6">sequenceElementClickCallback</span><span class="hl-1">: (</span><span class="hl-0">plugin</span><span class="hl-1">: </span><span class="hl-4">SaguaroPluginPublicInterface</span><span class="hl-1">, </span><span class="hl-0">selectorManager</span><span class="hl-1">: </span><span class="hl-4">RcsbFvSelectorManager</span><span class="hl-1">, </span><span class="hl-0">d</span><span class="hl-1">: </span><span class="hl-4">RcsbFvTrackDataElementInterface</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-4">void</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-6">sequenceHoverCallback</span><span class="hl-1">: (</span><span class="hl-0">plugin</span><span class="hl-1">: </span><span class="hl-4">SaguaroPluginPublicInterface</span><span class="hl-1">, </span><span class="hl-0">selectorManager</span><span class="hl-1">: </span><span class="hl-4">RcsbFvSelectorManager</span><span class="hl-1">, </span><span class="hl-0">hoverRegion</span><span class="hl-1">: </span><span class="hl-4">Array</span><span class="hl-1"><</span><span class="hl-4">RcsbFvTrackDataElementInterface</span><span class="hl-1">>) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-4">void</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-6">structureSelectionCallback</span><span class="hl-1">: (</span><span class="hl-0">plugin</span><span class="hl-1">: </span><span class="hl-4">SaguaroPluginPublicInterface</span><span class="hl-1">, </span><span class="hl-0">pfv</span><span class="hl-1">: </span><span class="hl-4">RcsbFv</span><span class="hl-1">, </span><span class="hl-0">selectorManager</span><span class="hl-1">: </span><span class="hl-4">RcsbFvSelectorManager</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-4">void</span><span class="hl-1">;</span><br/><span class="hl-1"> </span><span class="hl-6">structureHoverCallback</span><span class="hl-1">: (</span><span class="hl-0">plugin</span><span class="hl-1">: </span><span class="hl-4">SaguaroPluginPublicInterface</span><span class="hl-1">, </span><span class="hl-0">pfv</span><span class="hl-1">: </span><span class="hl-4">RcsbFv</span><span class="hl-1">, </span><span class="hl-0">selectorManager</span><span class="hl-1">: </span><span class="hl-4">RcsbFvSelectorManager</span><span class="hl-1">) </span><span class="hl-3">=></span><span class="hl-1"> </span><span class="hl-4">void</span><span class="hl-1">;</span><br/><span class="hl-1">}</span>
- </code></pre>
- <p><code>plugin: SaguaroPluginPublicInterface</code> exposes the interface to interact with the Molstar plugin
- and change model representations (<a href="https://rcsb.github.io/rcsb-saguaro-3d/interfaces/saguaropluginpublicinterface.html">ref</a>).
- It provides multiple methods such as hide, display or select to modify how structural data is displayed. The parameter <code>pfv: RcsbFv</code>
- allows to access the feature viewer API (<a href="https://rcsb.github.io/rcsb-saguaro/classes/rcsbfv.html">ref</a>). It exposes methods to modify
- selections, change board configuration, zoom or adding new tracks.</p>
- <p>Source code example can be found in <code>src/examples/single-chain/index.tsx</code></p>
- <a href="#contributing" id="contributing" style="color: inherit; text-decoration: none;">
- <h2>Contributing</h2>
- </a>
- <p>All contributions are welcome. Please, make a pull request or open an issue.</p>
- <a href="#license" id="license" style="color: inherit; text-decoration: none;">
- <h2>License</h2>
- </a>
- <p>The MIT License</p>
- <pre><code><span class="hl-6">Copyright</span><span class="hl-1"> (</span><span class="hl-0">c</span><span class="hl-1">) </span><span class="hl-8">2021</span><span class="hl-1"> - </span><span class="hl-0">now</span><span class="hl-1">, </span><span class="hl-2">RCSB</span><span class="hl-1"> </span><span class="hl-2">PDB</span><span class="hl-1"> </span><span class="hl-0">and</span><span class="hl-1"> </span><span class="hl-0">contributors</span>
- </code></pre>
- <p>Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:</p>
- <p>The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.</p>
- <p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.</p>
- </div></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class="current"><a href="modules.html">Modules</a></li><li class=" tsd-kind-module"><a href="modules/RcsbFv3DAssembly.html">Rcsb<wbr/>Fv3DAssembly</a></li><li class=" tsd-kind-module"><a href="modules/RcsbFv3DCustom.html">Rcsb<wbr/>Fv3DCustom</a></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-namespace"><span class="tsd-kind-icon">Namespace</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="assets/main.js"></script></body></html>
|