Browse Source

more docs

bioinsilico 3 years ago
parent
commit
4eb65c6168

+ 17 - 5
README.md

@@ -301,12 +301,16 @@ From the root of the project:
     
 and navigate to `localhost:PORT-NUMBER/build/examples/`
 
-### Main Classes and Methods
+### Library Documentation
+TypeScript full classes documentation can be found [here](https://rcsb.github.io/rcsb-saguaro-3d/globals.html).
+
+### Main Classes and Interfaces
 
 #### Assembly view
-Class **`RcsbFv3DAssembly`** (`src/RcsbFv3D/RcsbFv3DAssembly.tsx`) builds a predefined view for PDB entries. This method is used in the RCSB PDB web portal 
+Class **`RcsbFv3DAssembly`** (`src/RcsbFv3D/RcsbFv3DAssembly.tsx`) builds a predefined 1D/3D view for PDB entries. This method is used in the RCSB PDB web portal 
 to display 1D features on PDB entries (ex: [4hhb](https://www.rcsb.org/3d-sequence/4HHB)). Its configuration requires a single PDB ID. 
-In addition, `RcsbFvAdditionalConfig` allows to configure the feature viewer as describe in [rcsb-saguaro-app API]("https://rcsb.github.io/rcsb-saguaro-app/index.html")
+In addition, `additionalConfig` allows to configure the feature viewer as describe in rcsb-saguaro-app [API]("https://rcsb.github.io/rcsb-saguaro-app/interfaces/rcsbfvadditionalconfig.html").
+This parameter exposes the board configuration through the attribute `boardConfig` ([ref]("https://rcsb.github.io/rcsb-saguaro/interfaces/rcsbfvboardconfiginterface.html")).  
 ```typescript
 interface RcsbFv3DAssemblyInterface extends RcsbFv3DAbstractInterface {
    config: {
@@ -378,11 +382,19 @@ export interface FeatureViewInterface {
     sequenceSelectionChangeCallback: (plugin: SaguaroPluginPublicInterface, selectorManager: RcsbFvSelectorManager, sequenceRegion: Array<RcsbFvTrackDataElementInterface>) => void;
     sequenceElementClickCallback: (plugin: SaguaroPluginPublicInterface, selectorManager: RcsbFvSelectorManager, d: RcsbFvTrackDataElementInterface) => void;
     sequenceHoverCallback: (plugin: SaguaroPluginPublicInterface, selectorManager: RcsbFvSelectorManager, hoverRegion: Array<RcsbFvTrackDataElementInterface>) => void;
-    structureSelectionCallback: (plugin: SaguaroPluginPublicInterface, pfv: RcsbFv, selection: RcsbFvSelectorManager) => void;
-    structureHoverCallback: (plugin: SaguaroPluginPublicInterface, pfv: RcsbFv, selection: RcsbFvSelectorManager) => void;
+    structureSelectionCallback: (plugin: SaguaroPluginPublicInterface, pfv: RcsbFv, selectorManager: RcsbFvSelectorManager) => void;
+    structureHoverCallback: (plugin: SaguaroPluginPublicInterface, pfv: RcsbFv, selectorManager: RcsbFvSelectorManager) => void;
 }
 ```
 
+`plugin: SaguaroPluginPublicInterface` exposes the interface to interact with the molstar plugin
+and change model representations ([ref]("https://rcsb.github.io/rcsb-saguaro-3d/interfaces/saguaropluginpublicinterface.html")). 
+It provides multiple methods such as hide, display or select to modify how structural data is displayed. The parameter `pfv: RcsbFv` 
+allows to access the feature viewer API ([ref]("https://rcsb.github.io/rcsb-saguaro/classes/rcsbfv.html")). It exposes methods to modify 
+selections, change board configuration, zoom or adding new tracks.
+ 
+Source code example can be found in `src/examples/single-chain/index.tsx`
+
 Contributing
 ---
 All contributions are welcome. Please, make a pull request or open an issue.

+ 17 - 6
docs/index.html

@@ -366,15 +366,20 @@ document.addEventListener("DOMContentLoaded", function (event) {
 				</a>
 				<pre><code>npm <span class="hljs-builtin-name">run</span> buildExamples</code></pre><p>From the root of the project:</p>
 				<pre><code>http-server -p PORT-<span class="hljs-built_in">NUMBER</span></code></pre><p>and navigate to <code>localhost:PORT-NUMBER/build/examples/</code></p>
-				<a href="#main-classes-and-methods" id="main-classes-and-methods" style="color: inherit; text-decoration: none;">
-					<h3>Main Classes and Methods</h3>
+				<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 view for PDB entries. This method is used in the RCSB PDB web portal
+				<p>Class <strong><code>RcsbFv3DAssembly</code></strong> (<code>src/RcsbFv3D/RcsbFv3DAssembly.tsx</code>) builds a predefined 1D/3D view for PDB entries. This method is used in the RCSB PDB web portal
 					to display 1D features on PDB entries (ex: <a href="https://www.rcsb.org/3d-sequence/4HHB">4hhb</a>). Its configuration requires a single PDB ID.
-				In addition, <code>RcsbFvAdditionalConfig</code> allows to configure the feature viewer as describe in <a href="%22https://rcsb.github.io/rcsb-saguaro-app/index.html%22">rcsb-saguaro-app API</a></p>
+					In addition, <code>additionalConfig</code> allows to configure the feature viewer as describe in rcsb-saguaro-app <a href="%22https://rcsb.github.io/rcsb-saguaro-app/interfaces/rcsbfvadditionalconfig.html%22">API</a>.
+				This parameter exposes the board configuration through the attribute <code>boardConfig</code> (<a href="%22https://rcsb.github.io/rcsb-saguaro/interfaces/rcsbfvboardconfiginterface.html%22">ref</a>).  </p>
 				<pre><code class="language-typescript"><span class="hljs-keyword">interface</span> RcsbFv3DAssemblyInterface <span class="hljs-keyword">extends</span> RcsbFv3DAbstractInterface {
    <span class="hljs-attr">config</span>: {
         <span class="hljs-attr">entryId</span>: <span class="hljs-built_in">string</span>;
@@ -431,9 +436,15 @@ document.addEventListener("DOMContentLoaded", function (event) {
     sequenceSelectionChangeCallback: <span class="hljs-function">(<span class="hljs-params">plugin: SaguaroPluginPublicInterface, selectorManager: RcsbFvSelectorManager, sequenceRegion: <span class="hljs-built_in">Array</span>&lt;RcsbFvTrackDataElementInterface&gt;</span>) =&gt;</span> <span class="hljs-built_in">void</span>;
     sequenceElementClickCallback: <span class="hljs-function">(<span class="hljs-params">plugin: SaguaroPluginPublicInterface, selectorManager: RcsbFvSelectorManager, d: RcsbFvTrackDataElementInterface</span>) =&gt;</span> <span class="hljs-built_in">void</span>;
     sequenceHoverCallback: <span class="hljs-function">(<span class="hljs-params">plugin: SaguaroPluginPublicInterface, selectorManager: RcsbFvSelectorManager, hoverRegion: <span class="hljs-built_in">Array</span>&lt;RcsbFvTrackDataElementInterface&gt;</span>) =&gt;</span> <span class="hljs-built_in">void</span>;
-    structureSelectionCallback: <span class="hljs-function">(<span class="hljs-params">plugin: SaguaroPluginPublicInterface, pfv: RcsbFv, selection: RcsbFvSelectorManager</span>) =&gt;</span> <span class="hljs-built_in">void</span>;
-    structureHoverCallback: <span class="hljs-function">(<span class="hljs-params">plugin: SaguaroPluginPublicInterface, pfv: RcsbFv, selection: RcsbFvSelectorManager</span>) =&gt;</span> <span class="hljs-built_in">void</span>;
+    structureSelectionCallback: <span class="hljs-function">(<span class="hljs-params">plugin: SaguaroPluginPublicInterface, pfv: RcsbFv, selectorManager: RcsbFvSelectorManager</span>) =&gt;</span> <span class="hljs-built_in">void</span>;
+    structureHoverCallback: <span class="hljs-function">(<span class="hljs-params">plugin: SaguaroPluginPublicInterface, pfv: RcsbFv, selectorManager: RcsbFvSelectorManager</span>) =&gt;</span> <span class="hljs-built_in">void</span>;
 }</code></pre>
+				<p><code>plugin: SaguaroPluginPublicInterface</code> exposes the interface to interact with the molstar plugin
+					and change model representations (<a href="%22https://rcsb.github.io/rcsb-saguaro-3d/interfaces/saguaropluginpublicinterface.html%22">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="%22https://rcsb.github.io/rcsb-saguaro/classes/rcsbfv.html%22">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>

+ 6 - 6
docs/interfaces/featureviewinterface.html

@@ -240,7 +240,7 @@
 				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
 					<a name="structurehovercallback" class="tsd-anchor"></a>
 					<h3>structure<wbr>Hover<wbr>Callback</h3>
-					<div class="tsd-signature tsd-kind-icon">structure<wbr>Hover<wbr>Callback<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span>plugin<span class="tsd-signature-symbol">: </span><a href="saguaropluginpublicinterface.html" class="tsd-signature-type">SaguaroPluginPublicInterface</a>, pfv<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">RcsbFv</span>, selection<span class="tsd-signature-symbol">: </span><a href="../classes/rcsbfvselectormanager.html" class="tsd-signature-type">RcsbFvSelectorManager</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></div>
+					<div class="tsd-signature tsd-kind-icon">structure<wbr>Hover<wbr>Callback<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span>plugin<span class="tsd-signature-symbol">: </span><a href="saguaropluginpublicinterface.html" class="tsd-signature-type">SaguaroPluginPublicInterface</a>, pfv<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">RcsbFv</span>, selectorManager<span class="tsd-signature-symbol">: </span><a href="../classes/rcsbfvselectormanager.html" class="tsd-signature-type">RcsbFvSelectorManager</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></div>
 					<aside class="tsd-sources">
 						<ul>
 							<li>Defined in src/RcsbFvSequence/SequenceViews/CustomView.tsx:41</li>
@@ -251,7 +251,7 @@
 						<ul class="tsd-parameters">
 							<li class="tsd-parameter-signature">
 								<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property">
-									<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>plugin<span class="tsd-signature-symbol">: </span><a href="saguaropluginpublicinterface.html" class="tsd-signature-type">SaguaroPluginPublicInterface</a>, pfv<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">RcsbFv</span>, selection<span class="tsd-signature-symbol">: </span><a href="../classes/rcsbfvselectormanager.html" class="tsd-signature-type">RcsbFvSelectorManager</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
+									<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>plugin<span class="tsd-signature-symbol">: </span><a href="saguaropluginpublicinterface.html" class="tsd-signature-type">SaguaroPluginPublicInterface</a>, pfv<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">RcsbFv</span>, selectorManager<span class="tsd-signature-symbol">: </span><a href="../classes/rcsbfvselectormanager.html" class="tsd-signature-type">RcsbFvSelectorManager</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
 								</ul>
 								<ul class="tsd-descriptions">
 									<li class="tsd-description">
@@ -264,7 +264,7 @@
 												<h5>pfv: <span class="tsd-signature-type">RcsbFv</span></h5>
 											</li>
 											<li>
-												<h5>selection: <a href="../classes/rcsbfvselectormanager.html" class="tsd-signature-type">RcsbFvSelectorManager</a></h5>
+												<h5>selectorManager: <a href="../classes/rcsbfvselectormanager.html" class="tsd-signature-type">RcsbFvSelectorManager</a></h5>
 											</li>
 										</ul>
 										<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
@@ -277,7 +277,7 @@
 				<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
 					<a name="structureselectioncallback" class="tsd-anchor"></a>
 					<h3>structure<wbr>Selection<wbr>Callback</h3>
-					<div class="tsd-signature tsd-kind-icon">structure<wbr>Selection<wbr>Callback<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span>plugin<span class="tsd-signature-symbol">: </span><a href="saguaropluginpublicinterface.html" class="tsd-signature-type">SaguaroPluginPublicInterface</a>, pfv<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">RcsbFv</span>, selection<span class="tsd-signature-symbol">: </span><a href="../classes/rcsbfvselectormanager.html" class="tsd-signature-type">RcsbFvSelectorManager</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></div>
+					<div class="tsd-signature tsd-kind-icon">structure<wbr>Selection<wbr>Callback<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">(</span>plugin<span class="tsd-signature-symbol">: </span><a href="saguaropluginpublicinterface.html" class="tsd-signature-type">SaguaroPluginPublicInterface</a>, pfv<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">RcsbFv</span>, selectorManager<span class="tsd-signature-symbol">: </span><a href="../classes/rcsbfvselectormanager.html" class="tsd-signature-type">RcsbFvSelectorManager</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">void</span></div>
 					<aside class="tsd-sources">
 						<ul>
 							<li>Defined in src/RcsbFvSequence/SequenceViews/CustomView.tsx:40</li>
@@ -288,7 +288,7 @@
 						<ul class="tsd-parameters">
 							<li class="tsd-parameter-signature">
 								<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property">
-									<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>plugin<span class="tsd-signature-symbol">: </span><a href="saguaropluginpublicinterface.html" class="tsd-signature-type">SaguaroPluginPublicInterface</a>, pfv<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">RcsbFv</span>, selection<span class="tsd-signature-symbol">: </span><a href="../classes/rcsbfvselectormanager.html" class="tsd-signature-type">RcsbFvSelectorManager</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
+									<li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>plugin<span class="tsd-signature-symbol">: </span><a href="saguaropluginpublicinterface.html" class="tsd-signature-type">SaguaroPluginPublicInterface</a>, pfv<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">RcsbFv</span>, selectorManager<span class="tsd-signature-symbol">: </span><a href="../classes/rcsbfvselectormanager.html" class="tsd-signature-type">RcsbFvSelectorManager</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
 								</ul>
 								<ul class="tsd-descriptions">
 									<li class="tsd-description">
@@ -301,7 +301,7 @@
 												<h5>pfv: <span class="tsd-signature-type">RcsbFv</span></h5>
 											</li>
 											<li>
-												<h5>selection: <a href="../classes/rcsbfvselectormanager.html" class="tsd-signature-type">RcsbFvSelectorManager</a></h5>
+												<h5>selectorManager: <a href="../classes/rcsbfvselectormanager.html" class="tsd-signature-type">RcsbFvSelectorManager</a></h5>
 											</li>
 										</ul>
 										<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>

+ 2 - 2
src/RcsbFvSequence/SequenceViews/CustomView.tsx

@@ -37,8 +37,8 @@ export interface FeatureViewInterface {
     sequenceSelectionChangeCallback: (plugin: SaguaroPluginPublicInterface, selectorManager: RcsbFvSelectorManager, sequenceRegion: Array<RcsbFvTrackDataElementInterface>) => void;
     sequenceElementClickCallback: (plugin: SaguaroPluginPublicInterface, selectorManager: RcsbFvSelectorManager, d: RcsbFvTrackDataElementInterface) => void;
     sequenceHoverCallback: (plugin: SaguaroPluginPublicInterface, selectorManager: RcsbFvSelectorManager, hoverRegion: Array<RcsbFvTrackDataElementInterface>) => void;
-    structureSelectionCallback: (plugin: SaguaroPluginPublicInterface, pfv: RcsbFv, selection: RcsbFvSelectorManager) => void;
-    structureHoverCallback: (plugin: SaguaroPluginPublicInterface, pfv: RcsbFv, selection: RcsbFvSelectorManager) => void;
+    structureSelectionCallback: (plugin: SaguaroPluginPublicInterface, pfv: RcsbFv, selectorManager: RcsbFvSelectorManager) => void;
+    structureHoverCallback: (plugin: SaguaroPluginPublicInterface, pfv: RcsbFv, selectorManager: RcsbFvSelectorManager) => void;
 }
 
 export class BlockSelectorManager {