Skip to content

Commit

Permalink
Fix needle plot domain annotations and add textangle nad margins prop (
Browse files Browse the repository at this point in the history
…#565)

* Minor fix for mol3d proptype

* Adding textangle prop and automatic offset

* Updated CHANGELOG

* Added selectData and clickData props

* Removing console.logs

* Removing selectionData adding margins prop
  • Loading branch information
HammadTheOne authored Jul 26, 2021
1 parent 5ffa60f commit 3f1df2f
Show file tree
Hide file tree
Showing 58 changed files with 252 additions and 96 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
### Fixed
* [#561](https://github.com/plotly/dash-bio/pull/561) Repeated re-rendering of the Molecule3dViewer component caused the viewer zoom to decrease multiplicatively.
This fix also exposes the `zoom` and `zoomTo` props for this component.
* [#565](https://github.com/plotly/dash-bio/pull/565) Fixed major domain annotation positioning for the NeedlePlot component and exposed `textangle` prop to allow domain annotation text to be angled relative to the horizontal axis.
### Changed
- [#562](https://github.com/plotly/dash-bio/pull/562) Changed package scripts to 3 main build scripts: `build:js`, `build:backends`, and `build` to combined them. This brings the dash-bio build process in-line with the process for other Dash component libraries. As part of this change, `__init__.py` now also uses relative imports to load components (for more info, see [#534](https://github.com/plotly/dash-bio/issues/534)).

### Added
* [#563](https://github.com/plotly/dash-bio/pull/563) Added component generation support for Dash Julia.
* [#565](https://github.com/plotly/dash-bio/pull/565) Added `selectData` and `clickData` props to NeedlePlot to expose event data for callbacks.

## [0.7.0] - 2021-04-19

Expand Down
6 changes: 3 additions & 3 deletions R/dashbioNeedlePlot.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# AUTO GENERATED FILE - DO NOT EDIT

dashbioNeedlePlot <- function(id=NULL, domainStyle=NULL, mutationData=NULL, needleStyle=NULL, rangeSlider=NULL, xlabel=NULL, ylabel=NULL) {
dashbioNeedlePlot <- function(id=NULL, clickData=NULL, domainStyle=NULL, margin=NULL, mutationData=NULL, needleStyle=NULL, rangeSlider=NULL, xlabel=NULL, ylabel=NULL) {

props <- list(id=id, domainStyle=domainStyle, mutationData=mutationData, needleStyle=needleStyle, rangeSlider=rangeSlider, xlabel=xlabel, ylabel=ylabel)
props <- list(id=id, clickData=clickData, domainStyle=domainStyle, margin=margin, mutationData=mutationData, needleStyle=needleStyle, rangeSlider=rangeSlider, xlabel=xlabel, ylabel=ylabel)
if (length(props) > 0) {
props <- props[!vapply(props, is.null, logical(1))]
}
component <- list(
props = props,
type = 'NeedlePlot',
namespace = 'dash_bio',
propNames = c('id', 'domainStyle', 'mutationData', 'needleStyle', 'rangeSlider', 'xlabel', 'ylabel'),
propNames = c('id', 'clickData', 'domainStyle', 'margin', 'mutationData', 'needleStyle', 'rangeSlider', 'xlabel', 'ylabel'),
package = 'dashBio'
)

Expand Down
2 changes: 1 addition & 1 deletion dash_bio/Molecule3dViewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class Molecule3dViewer(Component):
- chain (string; optional):
Chain that the residue is located on.
- res (number; optional):
- resi (number; optional):
The index value used to identify the residue; residues are
numbered sequentially starting from 1."""
@_explicitize_args
Expand Down
23 changes: 18 additions & 5 deletions dash_bio/NeedlePlot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,28 @@ class NeedlePlot(Component):
callbacks. The ID needs to be unique across all of the components
in an app.
- domainStyle (dict; default { displayMinorDomains: False, domainColor: [ '#8dd3c7', '#ffffb3', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', '#fccde5', '#d9d9d9', '#bc80bd', '#ccebc5', '#ffed6f', '#8dd3c7', '#ffffb3', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', ],}):
- clickData (list; optional):
An array of the points on the graph that have been clicked with
Plotly.js clickEvents.
- domainStyle (dict; default { displayMinorDomains: False, domainColor: [ '#8dd3c7', '#ffffb3', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', '#fccde5', '#d9d9d9', '#bc80bd', '#ccebc5', '#ffed6f', '#8dd3c7', '#ffffb3', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', ], textangle: 0,}):
Options for the protein domain coloring.
`domainStyle` is a dict with keys:
- displayMinorDomains (boolean; optional)
- displayMinorDomains (boolean; optional):
The prop x sometimes contains smaller domains (e.g. multi-site
mutations), if True, these are displayed.
- domainColor (list; optional)
- textangle (number; optional):
Sets the angle at which the domain annotation text is drawn
with respect to the horizontal.
- margin (dict; default {t: 100, l: 40, r: 0, b: 40}):
Margins of the plot.
- mutationData (dict; default { x: [], y: [], domains: [], mutationGroups: [],}):
The data that are displayed on the plot.
Expand Down Expand Up @@ -64,12 +77,12 @@ class NeedlePlot(Component):
- ylabel (string; optional):
Title of the y-axis."""
@_explicitize_args
def __init__(self, id=Component.UNDEFINED, mutationData=Component.UNDEFINED, xlabel=Component.UNDEFINED, ylabel=Component.UNDEFINED, rangeSlider=Component.UNDEFINED, needleStyle=Component.UNDEFINED, domainStyle=Component.UNDEFINED, **kwargs):
self._prop_names = ['id', 'domainStyle', 'mutationData', 'needleStyle', 'rangeSlider', 'xlabel', 'ylabel']
def __init__(self, id=Component.UNDEFINED, mutationData=Component.UNDEFINED, margin=Component.UNDEFINED, xlabel=Component.UNDEFINED, ylabel=Component.UNDEFINED, rangeSlider=Component.UNDEFINED, needleStyle=Component.UNDEFINED, domainStyle=Component.UNDEFINED, clickData=Component.UNDEFINED, **kwargs):
self._prop_names = ['id', 'clickData', 'domainStyle', 'margin', 'mutationData', 'needleStyle', 'rangeSlider', 'xlabel', 'ylabel']
self._type = 'NeedlePlot'
self._namespace = 'dash_bio'
self._valid_wildcard_attributes = []
self.available_properties = ['id', 'domainStyle', 'mutationData', 'needleStyle', 'rangeSlider', 'xlabel', 'ylabel']
self.available_properties = ['id', 'clickData', 'domainStyle', 'margin', 'mutationData', 'needleStyle', 'rangeSlider', 'xlabel', 'ylabel']
self.available_wildcard_properties = []
_explicit_args = kwargs.pop('_explicit_args')
_locals = locals()
Expand Down
6 changes: 3 additions & 3 deletions dash_bio/async-alignment.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/async-alignment.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dash_bio/async-circos.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dash_bio/async-ideogram.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dash_bio/async-igv.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/async-moleculeviewer2.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/async-moleculeviewer2.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dash_bio/async-moleculeviewer3.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/async-moleculeviewer3.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/async-needle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/async-needle.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dash_bio/async-nglmoleculeviewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/async-nglmoleculeviewer.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/async-onco.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/async-onco.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dash_bio/async-pileup.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/async-pileup.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/async-sequence.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/async-sequence.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/async-speck.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dash_bio/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/bundle.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dash_bio/dash_bio-shared.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/dash_bio-shared.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 3f1df2f

Please sign in to comment.