dash-seqviz 0.2.0__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {dash_seqviz-0.2.0/dash_seqviz.egg-info → dash_seqviz-0.2.2}/PKG-INFO +7 -7
  2. {dash_seqviz-0.2.0 → dash_seqviz-0.2.2}/README.md +6 -6
  3. {dash_seqviz-0.2.0 → dash_seqviz-0.2.2}/dash_seqviz/SeqViz.py +43 -10
  4. dash_seqviz-0.2.2/dash_seqviz/__init__.py +110 -0
  5. dash_seqviz-0.2.2/dash_seqviz/async-SeqViz.js +3 -0
  6. dash_seqviz-0.2.2/dash_seqviz/async-SeqViz.js.map +1 -0
  7. dash_seqviz-0.2.2/dash_seqviz/dash_seqviz.min.js +2 -0
  8. dash_seqviz-0.2.2/dash_seqviz/dash_seqviz.min.js.map +1 -0
  9. {dash_seqviz-0.2.0 → dash_seqviz-0.2.2}/dash_seqviz/metadata.json +1 -1
  10. {dash_seqviz-0.2.0 → dash_seqviz-0.2.2}/dash_seqviz/package-info.json +1 -1
  11. {dash_seqviz-0.2.0 → dash_seqviz-0.2.2/dash_seqviz.egg-info}/PKG-INFO +7 -7
  12. {dash_seqviz-0.2.0 → dash_seqviz-0.2.2}/package.json +1 -1
  13. dash_seqviz-0.2.0/dash_seqviz/__init__.py +0 -68
  14. dash_seqviz-0.2.0/dash_seqviz/async-SeqViz.js +0 -3
  15. dash_seqviz-0.2.0/dash_seqviz/async-SeqViz.js.map +0 -1
  16. dash_seqviz-0.2.0/dash_seqviz/dash_seqviz.min.js +0 -2
  17. dash_seqviz-0.2.0/dash_seqviz/dash_seqviz.min.js.map +0 -1
  18. {dash_seqviz-0.2.0 → dash_seqviz-0.2.2}/LICENSE +0 -0
  19. {dash_seqviz-0.2.0 → dash_seqviz-0.2.2}/MANIFEST.in +0 -0
  20. {dash_seqviz-0.2.0 → dash_seqviz-0.2.2}/dash_seqviz/_imports_.py +0 -0
  21. {dash_seqviz-0.2.0 → dash_seqviz-0.2.2}/dash_seqviz.egg-info/SOURCES.txt +0 -0
  22. {dash_seqviz-0.2.0 → dash_seqviz-0.2.2}/dash_seqviz.egg-info/dependency_links.txt +0 -0
  23. {dash_seqviz-0.2.0 → dash_seqviz-0.2.2}/dash_seqviz.egg-info/requires.txt +0 -0
  24. {dash_seqviz-0.2.0 → dash_seqviz-0.2.2}/dash_seqviz.egg-info/top_level.txt +0 -0
  25. {dash_seqviz-0.2.0 → dash_seqviz-0.2.2}/setup.cfg +0 -0
  26. {dash_seqviz-0.2.0 → dash_seqviz-0.2.2}/setup.py +0 -0
  27. {dash_seqviz-0.2.0 → dash_seqviz-0.2.2}/tests/test_usage.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dash_seqviz
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: A wrapper of the javascript DNA, RNA and protein sequence viewer
5
5
  Home-page: https://dash-seqviz.com
6
6
  Author: Evan Rees <evanroyrees@gmail.com>
@@ -128,7 +128,7 @@ if __name__ == '__main__':
128
128
 
129
129
  - **`colors`** (list): Array of colors for annotations, translations, and highlights.
130
130
 
131
- - **`bpColors`** (dict): Object mapping base pairs or indexes to custom colors.
131
+ - **`bp_colors`** (dict): Object mapping base pairs or indexes to custom colors.
132
132
  - Example: `{"A": "#FF0000", "T": "#00FF00", 12: "#0000FF"}`
133
133
 
134
134
  - **`style`** (dict): CSS styles for the outer container div.
@@ -138,13 +138,13 @@ if __name__ == '__main__':
138
138
  - Format: `{"linear": int}` (0-100)
139
139
  - Default: `{"linear": 50}`
140
140
 
141
- - **`showComplement`** (bool): Whether to show the complement sequence.
141
+ - **`show_complement`** (bool): Whether to show the complement sequence.
142
142
  - Default: `true`
143
143
 
144
- - **`rotateOnScroll`** (bool): Whether the circular viewer rotates on scroll.
144
+ - **`rotate_on_scroll`** (bool): Whether the circular viewer rotates on scroll.
145
145
  - Default: `true`
146
146
 
147
- - **`disableExternalFonts`** (bool): Whether to disable downloading external fonts.
147
+ - **`disable_external_fonts`** (bool): Whether to disable downloading external fonts.
148
148
  - Default: `false`
149
149
 
150
150
  - Deprecated (prefer parsing externally with `seqparse`):
@@ -152,8 +152,8 @@ if __name__ == '__main__':
152
152
  - **`accession`** (string): NCBI accession-ID
153
153
 
154
154
  - Events / Read-only:
155
- - **`onSelection`** (function): Called after selection events; selection returned also via `selection`
156
- - **`onSearch`** (function): Called after search; results returned also via `searchResults` (read-only)
155
+ - **`on_selection`** (function): Called after selection events; selection returned also via `selection`
156
+ - **`on_search`** (function): Called after search; results returned also via `search_results` (read-only)
157
157
 
158
158
  ## Examples
159
159
 
@@ -84,7 +84,7 @@ if __name__ == '__main__':
84
84
 
85
85
  - **`colors`** (list): Array of colors for annotations, translations, and highlights.
86
86
 
87
- - **`bpColors`** (dict): Object mapping base pairs or indexes to custom colors.
87
+ - **`bp_colors`** (dict): Object mapping base pairs or indexes to custom colors.
88
88
  - Example: `{"A": "#FF0000", "T": "#00FF00", 12: "#0000FF"}`
89
89
 
90
90
  - **`style`** (dict): CSS styles for the outer container div.
@@ -94,13 +94,13 @@ if __name__ == '__main__':
94
94
  - Format: `{"linear": int}` (0-100)
95
95
  - Default: `{"linear": 50}`
96
96
 
97
- - **`showComplement`** (bool): Whether to show the complement sequence.
97
+ - **`show_complement`** (bool): Whether to show the complement sequence.
98
98
  - Default: `true`
99
99
 
100
- - **`rotateOnScroll`** (bool): Whether the circular viewer rotates on scroll.
100
+ - **`rotate_on_scroll`** (bool): Whether the circular viewer rotates on scroll.
101
101
  - Default: `true`
102
102
 
103
- - **`disableExternalFonts`** (bool): Whether to disable downloading external fonts.
103
+ - **`disable_external_fonts`** (bool): Whether to disable downloading external fonts.
104
104
  - Default: `false`
105
105
 
106
106
  - Deprecated (prefer parsing externally with `seqparse`):
@@ -108,8 +108,8 @@ if __name__ == '__main__':
108
108
  - **`accession`** (string): NCBI accession-ID
109
109
 
110
110
  - Events / Read-only:
111
- - **`onSelection`** (function): Called after selection events; selection returned also via `selection`
112
- - **`onSearch`** (function): Called after search; results returned also via `searchResults` (read-only)
111
+ - **`on_selection`** (function): Called after selection events; selection returned also via `selection`
112
+ - **`on_search`** (function): Called after search; results returned also via `search_results` (read-only)
113
113
 
114
114
  ## Examples
115
115
 
@@ -44,18 +44,33 @@ Keyword arguments:
44
44
  - color (string; optional)
45
45
 
46
46
  - bpColors (dict; optional):
47
+ @deprecated since 0.2.2, use `bp_colors`. Removed in 0.3.0.
48
+
49
+ - bp_colors (dict; optional):
47
50
  Object mapping base pairs or indexes to custom colors.
48
51
 
49
52
  - colors (list of strings; optional):
50
53
  Array of colors for annotations, translations, and highlights.
51
54
 
52
- - disableExternalFonts (boolean; default False):
55
+ - disableExternalFonts (boolean; optional):
56
+ @deprecated since 0.2.2, use `disable_external_fonts`. Removed in
57
+ 0.3.0.
58
+
59
+ - disable_external_fonts (boolean; default False):
53
60
  Whether to disable downloading external fonts.
54
61
 
55
- - enableCopyEvent (boolean; default True):
62
+ - enableCopyEvent (boolean; optional):
63
+ @deprecated since 0.2.2, use `enable_copy_event`. Removed in
64
+ 0.3.0.
65
+
66
+ - enableSelectAllEvent (boolean; optional):
67
+ @deprecated since 0.2.2, use `enable_select_all_event`. Removed in
68
+ 0.3.0.
69
+
70
+ - enable_copy_event (boolean; default True):
56
71
  When False, disables the default copyEvent (ctrl/cmd + C).
57
72
 
58
- - enableSelectAllEvent (boolean; default True):
73
+ - enable_select_all_event (boolean; default True):
59
74
  When False, disables the default selectAllEvent (ctrl/cmd + A).
60
75
 
61
76
  - enzymes (list of dicts; optional):
@@ -114,7 +129,10 @@ Keyword arguments:
114
129
 
115
130
  - color (string; optional)
116
131
 
117
- - rotateOnScroll (boolean; default True):
132
+ - rotateOnScroll (boolean; optional):
133
+ @deprecated since 0.2.2, use `rotate_on_scroll`. Removed in 0.3.0.
134
+
135
+ - rotate_on_scroll (boolean; default True):
118
136
  Whether the circular viewer rotates on scroll.
119
137
 
120
138
  - search (dict; optional):
@@ -127,6 +145,9 @@ Keyword arguments:
127
145
  - mismatch (number; optional)
128
146
 
129
147
  - searchResults (list; optional):
148
+ @deprecated since 0.2.2, use `search_results`. Removed in 0.3.0.
149
+
150
+ - search_results (list; optional):
130
151
  Search results emitted by seqviz (read-only for Dash usage).
131
152
 
132
153
  - selection (dict; optional):
@@ -144,7 +165,10 @@ Keyword arguments:
144
165
  - seq (string; optional):
145
166
  The sequence to render. Can be DNA, RNA, or amino acid sequence.
146
167
 
147
- - showComplement (boolean; default True):
168
+ - showComplement (boolean; optional):
169
+ @deprecated since 0.2.2, use `show_complement`. Removed in 0.3.0.
170
+
171
+ - show_complement (boolean; default True):
148
172
  Whether to show the complement sequence.
149
173
 
150
174
  - translations (list of dicts; optional):
@@ -279,22 +303,31 @@ Keyword arguments:
279
303
  search: typing.Optional["Search"] = None,
280
304
  selection: typing.Optional["Selection"] = None,
281
305
  colors: typing.Optional[typing.Sequence[str]] = None,
282
- bpColors: typing.Optional[dict] = None,
306
+ bp_colors: typing.Optional[dict] = None,
283
307
  style: typing.Optional[typing.Any] = None,
284
308
  zoom: typing.Optional["Zoom"] = None,
309
+ show_complement: typing.Optional[bool] = None,
310
+ rotate_on_scroll: typing.Optional[bool] = None,
311
+ disable_external_fonts: typing.Optional[bool] = None,
312
+ on_selection: typing.Optional[typing.Any] = None,
313
+ on_search: typing.Optional[typing.Any] = None,
314
+ enable_copy_event: typing.Optional[bool] = None,
315
+ enable_select_all_event: typing.Optional[bool] = None,
316
+ search_results: typing.Optional[typing.Sequence] = None,
317
+ bpColors: typing.Optional[dict] = None,
285
318
  showComplement: typing.Optional[bool] = None,
286
319
  rotateOnScroll: typing.Optional[bool] = None,
287
320
  disableExternalFonts: typing.Optional[bool] = None,
288
- onSelection: typing.Optional[typing.Any] = None,
289
- onSearch: typing.Optional[typing.Any] = None,
290
321
  enableCopyEvent: typing.Optional[bool] = None,
291
322
  enableSelectAllEvent: typing.Optional[bool] = None,
323
+ onSelection: typing.Optional[typing.Any] = None,
324
+ onSearch: typing.Optional[typing.Any] = None,
292
325
  searchResults: typing.Optional[typing.Sequence] = None,
293
326
  **kwargs
294
327
  ):
295
- self._prop_names = ['id', 'annotations', 'bpColors', 'colors', 'disableExternalFonts', 'enableCopyEvent', 'enableSelectAllEvent', 'enzymes', 'highlights', 'name', 'primers', 'rotateOnScroll', 'search', 'searchResults', 'selection', 'seq', 'showComplement', 'style', 'translations', 'viewer', 'zoom']
328
+ self._prop_names = ['id', 'annotations', 'bpColors', 'bp_colors', 'colors', 'disableExternalFonts', 'disable_external_fonts', 'enableCopyEvent', 'enableSelectAllEvent', 'enable_copy_event', 'enable_select_all_event', 'enzymes', 'highlights', 'name', 'primers', 'rotateOnScroll', 'rotate_on_scroll', 'search', 'searchResults', 'search_results', 'selection', 'seq', 'showComplement', 'show_complement', 'style', 'translations', 'viewer', 'zoom']
296
329
  self._valid_wildcard_attributes = []
297
- self.available_properties = ['id', 'annotations', 'bpColors', 'colors', 'disableExternalFonts', 'enableCopyEvent', 'enableSelectAllEvent', 'enzymes', 'highlights', 'name', 'primers', 'rotateOnScroll', 'search', 'searchResults', 'selection', 'seq', 'showComplement', 'style', 'translations', 'viewer', 'zoom']
330
+ self.available_properties = ['id', 'annotations', 'bpColors', 'bp_colors', 'colors', 'disableExternalFonts', 'disable_external_fonts', 'enableCopyEvent', 'enableSelectAllEvent', 'enable_copy_event', 'enable_select_all_event', 'enzymes', 'highlights', 'name', 'primers', 'rotateOnScroll', 'rotate_on_scroll', 'search', 'searchResults', 'search_results', 'selection', 'seq', 'showComplement', 'show_complement', 'style', 'translations', 'viewer', 'zoom']
298
331
  self.available_wildcard_properties = []
299
332
  _explicit_args = kwargs.pop('_explicit_args')
300
333
  _locals = locals()
@@ -0,0 +1,110 @@
1
+ import json
2
+ import os as _os
3
+ import sys as _sys
4
+ import warnings as _warnings
5
+ from pathlib import Path
6
+
7
+ import dash as _dash
8
+
9
+ from ._imports_ import SeqViz as _GeneratedSeqViz
10
+
11
+ if not hasattr(_dash, 'development'):
12
+ print(
13
+ 'Dash was not successfully imported. '
14
+ 'Make sure you don\'t have a file '
15
+ 'named \n"dash.py" in your current directory.',
16
+ file=_sys.stderr,
17
+ )
18
+ _sys.exit(1)
19
+
20
+ _basepath = Path(__file__).parent
21
+ with open(_basepath / 'package-info.json') as f:
22
+ package = json.load(f)
23
+
24
+ package_name = package['name'].replace(' ', '_').replace('-', '_')
25
+ __version__ = package['version']
26
+
27
+ _async_resources = ["SeqViz"]
28
+
29
+ _js_dist = [
30
+ {
31
+ "relative_package_path": f"async-{resource}.js",
32
+ "external_url": (
33
+ f"https://unpkg.com/{package_name}@{__version__}"
34
+ f"/{__name__}/async-{resource}.js"
35
+ ),
36
+ "namespace": package_name,
37
+ "async": True,
38
+ }
39
+ for resource in _async_resources
40
+ ] + [
41
+ {
42
+ "relative_package_path": f"async-{resource}.js.map",
43
+ "external_url": (
44
+ f"https://unpkg.com/{package_name}@{__version__}"
45
+ f"/{__name__}/async-{resource}.js.map"
46
+ ),
47
+ "namespace": package_name,
48
+ "dynamic": True,
49
+ }
50
+ for resource in _async_resources
51
+ ] + [
52
+ {
53
+ 'relative_package_path': 'dash_seqviz.min.js',
54
+ 'namespace': package_name,
55
+ },
56
+ {
57
+ 'relative_package_path': 'dash_seqviz.min.js.map',
58
+ 'namespace': package_name,
59
+ 'dynamic': True,
60
+ },
61
+ ]
62
+
63
+ _css_dist = []
64
+
65
+
66
+ # Map of deprecated camelCase prop names to their snake_case replacements.
67
+ # Removed in dash-seqviz 0.3.0.
68
+ #
69
+ # Note: the upstream `onSelection` / `onSearch` JS callbacks are documented as
70
+ # props but Dash filters function-typed props out of the constructor at
71
+ # runtime, so they are not in this map — they were never settable from Python.
72
+ _DEPRECATED_PROPS = {
73
+ "bpColors": "bp_colors",
74
+ "showComplement": "show_complement",
75
+ "rotateOnScroll": "rotate_on_scroll",
76
+ "disableExternalFonts": "disable_external_fonts",
77
+ "enableCopyEvent": "enable_copy_event",
78
+ "enableSelectAllEvent": "enable_select_all_event",
79
+ "searchResults": "search_results",
80
+ }
81
+
82
+
83
+ class SeqViz(_GeneratedSeqViz):
84
+ """SeqViz Dash component.
85
+
86
+ Wraps the auto-generated component to emit ``DeprecationWarning`` when any
87
+ of the legacy camelCase props are used. The deprecated names continue to
88
+ work in 0.2.x and are removed in 0.3.0.
89
+
90
+ See the auto-generated parent class for the full prop reference.
91
+ """
92
+
93
+ def __init__(self, *args, **kwargs):
94
+ for _old, _new in _DEPRECATED_PROPS.items():
95
+ if _old in kwargs:
96
+ _warnings.warn(
97
+ f"`{_old}` is deprecated since dash-seqviz 0.2.2 and will "
98
+ f"be removed in 0.3.0. Use `{_new}` instead.",
99
+ DeprecationWarning,
100
+ stacklevel=2,
101
+ )
102
+ # snake_case wins on conflict
103
+ kwargs.setdefault(_new, kwargs.pop(_old))
104
+ super().__init__(*args, **kwargs)
105
+
106
+
107
+ SeqViz._js_dist = _js_dist
108
+ SeqViz._css_dist = _css_dist
109
+
110
+ __all__ = ["SeqViz"]