figpack 0.1.1__py3-none-any.whl → 0.1.3__py3-none-any.whl
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.
Potentially problematic release.
This version of figpack might be problematic. Click here for more details.
- figpack/__init__.py +3 -1
- figpack/cli.py +312 -0
- figpack/core/_bundle_utils.py +11 -1
- figpack/core/_show_view.py +34 -8
- figpack/core/{_upload_view.py → _upload_bundle.py} +140 -49
- figpack/core/figpack_view.py +32 -24
- figpack/figpack-gui-dist/assets/index-BDa2iJW9.css +1 -0
- figpack/figpack-gui-dist/assets/index-ByLxmrzp.js +846 -0
- figpack/figpack-gui-dist/assets/neurosift-logo-CLsuwLMO.png +0 -0
- figpack/figpack-gui-dist/index.html +4 -4
- figpack/spike_sorting/__init__.py +5 -0
- figpack/spike_sorting/views/AutocorrelogramItem.py +41 -0
- figpack/spike_sorting/views/Autocorrelograms.py +76 -0
- figpack/spike_sorting/views/CrossCorrelogramItem.py +45 -0
- figpack/spike_sorting/views/CrossCorrelograms.py +82 -0
- figpack/spike_sorting/views/UnitSimilarityScore.py +40 -0
- figpack/spike_sorting/views/UnitsTable.py +68 -0
- figpack/spike_sorting/views/UnitsTableColumn.py +40 -0
- figpack/spike_sorting/views/UnitsTableRow.py +36 -0
- figpack/spike_sorting/views/__init__.py +23 -0
- figpack/views/Image.py +82 -0
- figpack/views/Markdown.py +34 -0
- figpack/views/MatplotlibFigure.py +65 -0
- figpack/views/PlotlyFigure.py +58 -0
- figpack/views/__init__.py +4 -0
- figpack-0.1.3.dist-info/METADATA +126 -0
- figpack-0.1.3.dist-info/RECORD +38 -0
- figpack-0.1.3.dist-info/entry_points.txt +2 -0
- figpack-0.1.3.dist-info/top_level.txt +1 -0
- figpack/figpack-gui-dist/assets/index-BW-ONVCL.js +0 -65
- figpack/figpack-gui-dist/assets/index-CeWL3OeJ.css +0 -1
- figpack-0.1.1.dist-info/METADATA +0 -33
- figpack-0.1.1.dist-info/RECORD +0 -22
- figpack-0.1.1.dist-info/top_level.txt +0 -2
- figpack-gui/node_modules/flatted/python/flatted.py +0 -149
- {figpack-0.1.1.dist-info → figpack-0.1.3.dist-info}/WHEEL +0 -0
- {figpack-0.1.1.dist-info → figpack-0.1.3.dist-info}/licenses/LICENSE +0 -0
figpack/core/figpack_view.py
CHANGED
|
@@ -18,38 +18,46 @@ class FigpackView:
|
|
|
18
18
|
port: Union[int, None] = None,
|
|
19
19
|
open_in_browser: bool = False,
|
|
20
20
|
allow_origin: Union[str, None] = None,
|
|
21
|
+
upload: bool = False,
|
|
22
|
+
_dev: bool = False,
|
|
23
|
+
title: Union[str, None] = None,
|
|
24
|
+
description: Union[str, None] = None,
|
|
21
25
|
):
|
|
22
26
|
"""
|
|
23
27
|
Display the visualization component
|
|
24
|
-
"""
|
|
25
|
-
from ._show_view import _show_view
|
|
26
|
-
|
|
27
|
-
_show_view(
|
|
28
|
-
self, port=port, open_in_browser=open_in_browser, allow_origin=allow_origin
|
|
29
|
-
)
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
Args:
|
|
30
|
+
port: Port number for local server
|
|
31
|
+
open_in_browser: Whether to open in browser automatically
|
|
32
|
+
allow_origin: CORS allow origin header
|
|
33
|
+
upload: Whether to upload the figure
|
|
34
|
+
_dev: Development mode flag
|
|
35
|
+
title: Title for the browser tab and figure
|
|
36
|
+
description: Description text (markdown supported) for the figure
|
|
32
37
|
"""
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
Returns:
|
|
36
|
-
str: URL where the uploaded figure can be viewed
|
|
38
|
+
from ._show_view import _show_view
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
if _dev:
|
|
41
|
+
if port is None:
|
|
42
|
+
port = 3004
|
|
43
|
+
if allow_origin is not None:
|
|
44
|
+
raise ValueError("Cannot set allow_origin when _dev is True.")
|
|
45
|
+
allow_origin = "http://localhost:5173"
|
|
46
|
+
if upload:
|
|
47
|
+
raise ValueError("Cannot upload when _dev is True.")
|
|
43
48
|
|
|
44
|
-
|
|
49
|
+
print(
|
|
50
|
+
f"For development, run figpack-gui in dev mode and use http://localhost:5173?data=http://localhost:{port}/data.zarr"
|
|
51
|
+
)
|
|
45
52
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
_show_view(
|
|
54
|
+
self,
|
|
55
|
+
port=port,
|
|
56
|
+
open_in_browser=open_in_browser,
|
|
57
|
+
allow_origin=allow_origin,
|
|
58
|
+
upload=upload,
|
|
59
|
+
title=title,
|
|
60
|
+
description=description,
|
|
53
61
|
)
|
|
54
62
|
|
|
55
63
|
def _write_to_zarr_group(self, group: zarr.Group) -> None:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{font-family:system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;overflow:hidden}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}.status-bar{position:fixed;bottom:0;left:0;right:0;height:30px;background-color:#2a2a2a;color:#fff;display:flex;align-items:center;padding:0 12px;font-size:12px;border-top:1px solid #444;z-index:1000}.status-bar.warning{background-color:#ff9800;color:#000}.status-bar.error{background-color:#f44336;color:#fff}.status-bar.expired{background-color:#d32f2f;color:#fff}.manage-button{background-color:#444;color:#fff;border:none;padding:4px 8px;border-radius:4px;cursor:pointer;font-size:11px;height:22px;margin-left:12px;transition:background-color .2s}.manage-button:hover{background-color:#666}.about-button{background-color:#444;color:#fff;border:none;padding:4px 8px;border-radius:4px;cursor:pointer;font-size:11px;height:22px;margin-left:12px;transition:background-color .2s}.about-button:hover{background-color:#666}.about-dialog-overlay{position:fixed;inset:0;background-color:#00000080;display:flex;justify-content:center;align-items:center;z-index:2000}.about-dialog{background-color:#2a2a2a;color:#fff;border-radius:8px;max-width:600px;max-height:80vh;width:90%;box-shadow:0 4px 20px #0000004d;overflow:hidden}.about-dialog-header{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid #444}.about-dialog-header h2{margin:0;font-size:18px;font-weight:600}.about-dialog-close{background:none;border:none;color:#fff;font-size:24px;cursor:pointer;padding:0;width:30px;height:30px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:background-color .2s}.about-dialog-close:hover{background-color:#444}.about-dialog-content{padding:20px;overflow-y:auto;max-height:calc(80vh - 80px)}.about-dialog-description{line-height:1.6}.about-dialog-description h1,.about-dialog-description h2,.about-dialog-description h3{margin-top:0;margin-bottom:12px}.about-dialog-description p{margin-bottom:12px}.about-dialog-description code{background-color:#444;padding:2px 4px;border-radius:3px;font-family:Courier New,monospace;font-size:.9em}.about-dialog-description pre{background-color:#444;padding:12px;border-radius:4px;overflow-x:auto;margin-bottom:12px}.about-dialog-description ul,.about-dialog-description ol{margin-bottom:12px;padding-left:20px}.about-dialog-description blockquote{border-left:4px solid #666;padding-left:16px;margin:12px 0;font-style:italic}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}.status-bar{background-color:#f5f5f5;color:#333;border-top:1px solid #ddd}.status-bar.warning{background-color:#fff3cd;color:#856404;border-top:1px solid #ffeaa7}.status-bar.error,.status-bar.expired{background-color:#f8d7da;color:#721c24;border-top:1px solid #f5c6cb}.manage-button{background-color:#e0e0e0;color:#333;border:1px solid #ccc}.manage-button:hover{background-color:#d0d0d0}.about-button{background-color:#e0e0e0;color:#333;border:1px solid #ccc}.about-button:hover{background-color:#d0d0d0}.about-dialog{background-color:#fff;color:#333;box-shadow:0 4px 20px #00000026}.about-dialog-header{border-bottom:1px solid #ddd}.about-dialog-close{color:#333}.about-dialog-close:hover{background-color:#f0f0f0}.about-dialog-description code,.about-dialog-description pre{background-color:#f5f5f5;color:#333}.about-dialog-description blockquote{border-left:4px solid #ccc}}.VerticalToolbar{overflow:hidden;position:absolute}.HorizontalToolbar{display:flex;justify-content:center;align-items:center;overflow:hidden;margin:auto}.SortableTableWidget .MuiTableCell-root{padding:1px 0;font-size:12px;border:solid 1px #f0f0f0}.SortableTableWidget .MuiTableRow-root.selectedRow{background-color:#b5d1ff}.SortableTableWidget .MuiTableRow-root.currentRow{background-color:#95b1df}.SortCaretSpan{font-size:16px;color:gray;padding-left:3px;padding-right:5px;padding-top:2px}.SortableTableWidget .unitLabel{width:10px;height:10px;position:relative;display:inline-block}.SortableTableWidget .SortableTableCheckbox{padding:1px}.unitEntryBase{padding-right:13px;padding-top:10px}.unselectedUnitEntry{border:1px transparent solid;font-weight:400;color:#000;background-color:#fff}.selectedUnitEntry{border:1px solid blue;font-weight:700;color:#000;background-color:#b5d1ff}.unitIdsColumnLabelStyle{min-width:200px;font-weight:700;padding:7px 5px}.unitLabelsStyle{padding-right:3px;color:#333}.plotUnitLabel{text-align:left;margin-left:20px;margin-top:5px;font-weight:700}.plotWrapperButtonParent{display:inline-block}.plotWrapperStyleButton{padding-top:50px}.plotUnselectedStyle{border:3px solid rgb(202,224,231)}.plotSelectedStyle{border:3px solid #9999ff;background-color:#fff}.plotUnselectableStyle{border:3px solid transparent}.plotCurrentStyle{border:3px solid blue;background-color:#fff}.plotLabelStyle{font-weight:700;text-align:center;overflow:hidden;white-space:nowrap}
|