Skip to content

Commit

Permalink
Updated labels proptype
Browse files Browse the repository at this point in the history
  • Loading branch information
HammadTheOne committed Mar 12, 2021
1 parent c90429f commit 3010db8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 17 deletions.
3 changes: 1 addition & 2 deletions dash_bio/Molecule3dViewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ class Molecule3dViewer(Component):
- bonds (list; optional)
- atomLabelsShown (boolean; optional): Property to either show or hide labels
- selectedAtomIds (list; optional): Property that stores a list of all selected atoms
- labels (dict; optional): Labels corresponding to the atoms of the molecule. labels has the following type: list of dicts containing keys 'text', 'parameters'.
- labels (dict; optional): Labels corresponding to the atoms of the molecule. labels has the following type: list of dicts containing keys 'text'.
Those keys have the following types:
- text (string; optional): The label content
- parameters (dict; optional): Additional styling options. See https://dash.plotly.com/dash-bio/molecule3dviewer for details
- orbital (dict; optional): Add an isosurface from volumetric data provided in the `cube_file`. orbital has the following type: dict containing keys 'cube_file', 'iso_val', 'opacity', 'positiveVolumetricColor', 'negativeVolumetricColor'.
Those keys have the following types:
- cube_file (string; optional): The filepath containing raw volumetric data for vertex coloring
Expand Down
2 changes: 1 addition & 1 deletion dash_bio/bundle.js

Large diffs are not rendered by default.

7 changes: 1 addition & 6 deletions dash_bio/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -1712,17 +1712,12 @@
"type": {
"name": "arrayOf",
"value": {
"name": "exact",
"name": "shape",
"value": {
"text": {
"name": "string",
"description": "The label content",
"required": false
},
"parameters": {
"name": "object",
"description": "Additional styling options. See https://dash.plotly.com/dash-bio/molecule3dviewer for details",
"required": false
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion inst/deps/bundle.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions man/dashbioMolecule3dViewer.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ and should have two main dictionaries - atoms, bonds}

\item{selectedAtomIds}{Unnamed list. Property that stores a list of all selected atoms}

\item{labels}{List of lists containing elements 'text', 'parameters'.
\item{labels}{List of lists containing elements 'text'.
those elements have the following types:
- text (character; optional): the label content
- parameters (named list; optional): additional styling options. see https://dash.plotly.com/dash-bio/molecule3dviewer for detailss. Labels corresponding to the atoms of the molecule}
- text (character; optional): the label contents. Labels corresponding to the atoms of the molecule}

\item{orbital}{Lists containing elements 'cube_file', 'iso_val', 'opacity', 'positivevolumetriccolor', 'negativevolumetriccolor'.
those elements have the following types:
Expand Down
6 changes: 2 additions & 4 deletions src/lib/components/Molecule3dViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,14 @@ Molecule3dViewer.propTypes = {
* Labels corresponding to the atoms of the molecule
*/
labels: PropTypes.arrayOf(
PropTypes.exact({
PropTypes.shape({
/**
* The label content
*/
text: PropTypes.string,

/**
* Additional styling options. See https://dash.plotly.com/dash-bio/molecule3dviewer for details
* For additional styling keys, see https://3dmol.csb.pitt.edu/doc/types.html#LabelSpec
*/
parameters: PropTypes.object,
})
),

Expand Down

0 comments on commit 3010db8

Please sign in to comment.