figpack 0.2.16__py3-none-any.whl → 0.2.17__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.
- figpack/__init__.py +2 -3
- figpack/core/__init__.py +2 -2
- figpack/core/_bundle_utils.py +56 -18
- figpack/core/extension_view.py +7 -25
- figpack/core/figpack_extension.py +0 -71
- figpack/figpack-figure-dist/assets/index-DBwmtEpB.js +91 -0
- figpack/figpack-figure-dist/assets/{index-D9a3K6eW.css → index-DHWczh-Q.css} +1 -1
- figpack/figpack-figure-dist/index.html +2 -2
- figpack/views/PlotlyExtension/PlotlyExtension.py +4 -50
- figpack/views/PlotlyExtension/_plotly_extension.py +46 -0
- figpack/views/PlotlyExtension/plotly_view.js +84 -80
- figpack/views/__init__.py +1 -0
- {figpack-0.2.16.dist-info → figpack-0.2.17.dist-info}/METADATA +1 -1
- figpack-0.2.17.dist-info/RECORD +43 -0
- figpack/figpack-figure-dist/assets/index-DtOnN02w.js +0 -846
- figpack/franklab/__init__.py +0 -5
- figpack/franklab/views/TrackAnimation.py +0 -154
- figpack/franklab/views/__init__.py +0 -9
- figpack/spike_sorting/__init__.py +0 -5
- figpack/spike_sorting/views/AutocorrelogramItem.py +0 -32
- figpack/spike_sorting/views/Autocorrelograms.py +0 -116
- figpack/spike_sorting/views/AverageWaveforms.py +0 -146
- figpack/spike_sorting/views/CrossCorrelogramItem.py +0 -35
- figpack/spike_sorting/views/CrossCorrelograms.py +0 -131
- figpack/spike_sorting/views/RasterPlot.py +0 -284
- figpack/spike_sorting/views/RasterPlotItem.py +0 -28
- figpack/spike_sorting/views/SpikeAmplitudes.py +0 -364
- figpack/spike_sorting/views/SpikeAmplitudesItem.py +0 -38
- figpack/spike_sorting/views/UnitMetricsGraph.py +0 -127
- figpack/spike_sorting/views/UnitSimilarityScore.py +0 -40
- figpack/spike_sorting/views/UnitsTable.py +0 -82
- figpack/spike_sorting/views/UnitsTableColumn.py +0 -40
- figpack/spike_sorting/views/UnitsTableRow.py +0 -36
- figpack/spike_sorting/views/__init__.py +0 -41
- figpack-0.2.16.dist-info/RECORD +0 -61
- {figpack-0.2.16.dist-info → figpack-0.2.17.dist-info}/WHEEL +0 -0
- {figpack-0.2.16.dist-info → figpack-0.2.17.dist-info}/entry_points.txt +0 -0
- {figpack-0.2.16.dist-info → figpack-0.2.17.dist-info}/licenses/LICENSE +0 -0
- {figpack-0.2.16.dist-info → figpack-0.2.17.dist-info}/top_level.txt +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
.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}: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}}
|
|
1
|
+
.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}: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}}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<link rel="icon" type="image/png" href="./assets/neurosift-logo-CLsuwLMO.png" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>figpack figure</title>
|
|
8
|
-
<script type="module" crossorigin src="./assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
8
|
+
<script type="module" crossorigin src="./assets/index-DBwmtEpB.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="./assets/index-DHWczh-Q.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="root"></div>
|
|
@@ -1,57 +1,10 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import numpy as np
|
|
3
|
-
import zarr
|
|
4
|
-
import urllib.request
|
|
5
|
-
import urllib.error
|
|
6
3
|
from datetime import date, datetime
|
|
7
4
|
|
|
8
5
|
import figpack
|
|
9
6
|
|
|
10
7
|
|
|
11
|
-
def _download_plotly_library():
|
|
12
|
-
url = "https://cdn.plot.ly/plotly-2.35.2.min.js"
|
|
13
|
-
try:
|
|
14
|
-
with urllib.request.urlopen(url) as response:
|
|
15
|
-
return response.read().decode("utf-8")
|
|
16
|
-
except urllib.error.URLError as e:
|
|
17
|
-
raise RuntimeError(f"Failed to download plotly library from {url}: {e}")
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def _load_javascript_code():
|
|
21
|
-
"""Load the JavaScript code from the plotly.js file"""
|
|
22
|
-
import os
|
|
23
|
-
|
|
24
|
-
js_path = os.path.join(os.path.dirname(__file__), "plotly_view.js")
|
|
25
|
-
try:
|
|
26
|
-
with open(js_path, "r", encoding="utf-8") as f:
|
|
27
|
-
return f.read()
|
|
28
|
-
except FileNotFoundError:
|
|
29
|
-
raise FileNotFoundError(
|
|
30
|
-
f"Could not find plotly.js at {js_path}. "
|
|
31
|
-
"Make sure the JavaScript file is present in the package."
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
# Download the plotly library and create the extension with additional files
|
|
36
|
-
try:
|
|
37
|
-
plotly_lib_js = _download_plotly_library()
|
|
38
|
-
additional_files = {"plotly.min.js": plotly_lib_js}
|
|
39
|
-
except Exception as e:
|
|
40
|
-
print(f"Warning: Could not download plotly library: {e}")
|
|
41
|
-
print("Extension will fall back to CDN loading")
|
|
42
|
-
additional_files = {}
|
|
43
|
-
|
|
44
|
-
# Create and register the plotly extension
|
|
45
|
-
_plotly_extension = figpack.FigpackExtension(
|
|
46
|
-
name="figpack_plotly",
|
|
47
|
-
javascript_code=_load_javascript_code(),
|
|
48
|
-
additional_files=additional_files,
|
|
49
|
-
version="1.0.0",
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
figpack.ExtensionRegistry.register(_plotly_extension)
|
|
53
|
-
|
|
54
|
-
|
|
55
8
|
class PlotlyFigure(figpack.ExtensionView):
|
|
56
9
|
"""
|
|
57
10
|
A Plotly graph visualization view using the plotly library.
|
|
@@ -66,9 +19,10 @@ class PlotlyFigure(figpack.ExtensionView):
|
|
|
66
19
|
Args:
|
|
67
20
|
fig: The plotly figure object
|
|
68
21
|
"""
|
|
69
|
-
#
|
|
70
|
-
|
|
71
|
-
|
|
22
|
+
# It's important that we only import conditionally, so we are not always downloading plotly
|
|
23
|
+
from ._plotly_extension import _plotly_extension
|
|
24
|
+
|
|
25
|
+
super().__init__(extension=_plotly_extension, view_type="plotly.PlotlyFigure")
|
|
72
26
|
|
|
73
27
|
self.fig = fig
|
|
74
28
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import urllib.request
|
|
2
|
+
import urllib.error
|
|
3
|
+
|
|
4
|
+
from ...core.figpack_extension import FigpackExtension
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def _load_javascript_code():
|
|
8
|
+
"""Load the JavaScript code from the plotly.js file"""
|
|
9
|
+
import os
|
|
10
|
+
|
|
11
|
+
js_path = os.path.join(os.path.dirname(__file__), "plotly_view.js")
|
|
12
|
+
try:
|
|
13
|
+
with open(js_path, "r", encoding="utf-8") as f:
|
|
14
|
+
return f.read()
|
|
15
|
+
except FileNotFoundError:
|
|
16
|
+
raise FileNotFoundError(
|
|
17
|
+
f"Could not find plotly.js at {js_path}. "
|
|
18
|
+
"Make sure the JavaScript file is present in the package."
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _download_plotly_library():
|
|
23
|
+
url = "https://cdn.plot.ly/plotly-2.35.2.min.js"
|
|
24
|
+
try:
|
|
25
|
+
with urllib.request.urlopen(url) as response:
|
|
26
|
+
return response.read().decode("utf-8")
|
|
27
|
+
except urllib.error.URLError as e:
|
|
28
|
+
raise RuntimeError(f"Failed to download plotly library from {url}: {e}")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# Download the plotly library and create the extension with additional files
|
|
32
|
+
try:
|
|
33
|
+
plotly_lib_js = _download_plotly_library()
|
|
34
|
+
additional_files = {"plotly.min.js": plotly_lib_js}
|
|
35
|
+
except Exception as e:
|
|
36
|
+
print(f"Warning: Could not download plotly library: {e}")
|
|
37
|
+
print("Extension will fall back to CDN loading")
|
|
38
|
+
additional_files = {}
|
|
39
|
+
|
|
40
|
+
# Create and register the plotly extension
|
|
41
|
+
_plotly_extension = FigpackExtension(
|
|
42
|
+
name="figpack-plotly",
|
|
43
|
+
javascript_code=_load_javascript_code(),
|
|
44
|
+
additional_files=additional_files,
|
|
45
|
+
version="1.0.0",
|
|
46
|
+
)
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
const loadFigureData = async (zarrGroup) => {
|
|
7
7
|
// Get the figure data from the zarr array
|
|
8
|
-
const data = await zarrGroup.
|
|
9
|
-
|
|
8
|
+
const data = await zarrGroup.getDatasetData(
|
|
9
|
+
"figure_data",
|
|
10
10
|
{},
|
|
11
11
|
);
|
|
12
12
|
if (!data || data.length === 0) {
|
|
@@ -24,83 +24,87 @@ const loadFigureData = async (zarrGroup) => {
|
|
|
24
24
|
return parsedData;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return {
|
|
63
|
-
destroy: () => {
|
|
64
|
-
window.Plotly.purge(container);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
} catch (error) {
|
|
69
|
-
console.error('Error rendering plotly figure:', error);
|
|
70
|
-
this.renderError(container, width, height, error.message);
|
|
71
|
-
return { destroy: () => {} };
|
|
27
|
+
const renderPlotlyFigure = async (params) => {
|
|
28
|
+
const { container, zarrGroup, width, height, onResize } = params;
|
|
29
|
+
container.innerHTML = "";
|
|
30
|
+
|
|
31
|
+
try {
|
|
32
|
+
const figureData = await loadFigureData(zarrGroup);
|
|
33
|
+
|
|
34
|
+
const makePlot = () => {
|
|
35
|
+
window.Plotly.newPlot(
|
|
36
|
+
container,
|
|
37
|
+
figureData.data || [],
|
|
38
|
+
{
|
|
39
|
+
...figureData.layout,
|
|
40
|
+
width: width,
|
|
41
|
+
height: height,
|
|
42
|
+
margin: { l: 50, r: 50, t: 50, b: 50 },
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
responsive: true,
|
|
46
|
+
displayModeBar: true,
|
|
47
|
+
displaylogo: false,
|
|
48
|
+
},
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
makePlot();
|
|
53
|
+
|
|
54
|
+
// Handle resize events
|
|
55
|
+
onResize((newWidth, newHeight) => {
|
|
56
|
+
window.Plotly.relayout(container, { width: newWidth, height: newHeight });
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
destroy: () => {
|
|
61
|
+
window.Plotly.purge(container);
|
|
72
62
|
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
display: flex;
|
|
81
|
-
align-items: center;
|
|
82
|
-
justify-content: center;
|
|
83
|
-
background-color: #f8f9fa;
|
|
84
|
-
border: 1px solid #dee2e6;
|
|
85
|
-
color: #6c757d;
|
|
86
|
-
font-family: system-ui, -apple-system, sans-serif;
|
|
87
|
-
font-size: 14px;
|
|
88
|
-
text-align: center;
|
|
89
|
-
padding: 20px;
|
|
90
|
-
box-sizing: border-box;
|
|
91
|
-
">
|
|
92
|
-
<div>
|
|
93
|
-
<div style="margin-bottom: 10px; font-weight: 500;">Force Graph Error</div>
|
|
94
|
-
<div style="font-size: 12px;">${message}</div>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
`;
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
})();
|
|
101
|
-
|
|
102
|
-
const joinPath = function(p1, p2) {
|
|
103
|
-
if (p1.endsWith('/')) p1 = p1.slice(0, -1);
|
|
104
|
-
if (p2.startsWith('/')) p2 = p2.slice(1);
|
|
105
|
-
return p1 + '/' + p2;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
} catch (error) {
|
|
66
|
+
console.error('Error rendering plotly figure:', error);
|
|
67
|
+
renderError(container, width, height, error.message);
|
|
68
|
+
return { destroy: () => {} };
|
|
69
|
+
}
|
|
106
70
|
};
|
|
71
|
+
|
|
72
|
+
const renderError = (container, width, height, message) => {
|
|
73
|
+
container.innerHTML = `
|
|
74
|
+
<div style="
|
|
75
|
+
width: ${width}px;
|
|
76
|
+
height: ${height}px;
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
background-color: #f8f9fa;
|
|
81
|
+
border: 1px solid #dee2e6;
|
|
82
|
+
color: #6c757d;
|
|
83
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
84
|
+
font-size: 14px;
|
|
85
|
+
text-align: center;
|
|
86
|
+
padding: 20px;
|
|
87
|
+
box-sizing: border-box;
|
|
88
|
+
">
|
|
89
|
+
<div>
|
|
90
|
+
<div style="margin-bottom: 10px; font-weight: 500;">Plotly Figure Error</div>
|
|
91
|
+
<div style="font-size: 12px;">${message}</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
`;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const registerExtension = () => {
|
|
98
|
+
const registerFPViewComponent = window.figpack_p1.registerFPViewComponent;
|
|
99
|
+
registerFPViewComponent({
|
|
100
|
+
name: "plotly.PlotlyFigure",
|
|
101
|
+
render: renderPlotlyFigure,
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// const registerFPViewContextCreator = window.figpack_p1.registerFPViewContextCreator;
|
|
105
|
+
|
|
106
|
+
const registerFPExtension = window.figpack_p1.registerFPExtension;
|
|
107
|
+
registerFPExtension({ name: "figpack-plotly" });
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
registerExtension();
|
figpack/views/__init__.py
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
figpack/__init__.py,sha256=L7c_2dCG-hFepQwb5tqJ_TQCeC9EcG_8Ckw-G0qzJQo,358
|
|
2
|
+
figpack/cli.py,sha256=xWF7J2BxUqOLvPu-Kje7Q6oGukTroXsLq8WN8vJgyw0,8321
|
|
3
|
+
figpack/core/__init__.py,sha256=7zU6O1piTk07aeCfbU81QqTgSHIO2n5MZ4LFNmsrtfs,192
|
|
4
|
+
figpack/core/_bundle_utils.py,sha256=Wkk8UjR51bBbIDjXPaZLUlUnSGXdQDLzh7c6fcmBiag,7976
|
|
5
|
+
figpack/core/_save_figure.py,sha256=52ny-m1ThGgxY4ZgMn7m33n8A2OCyezj8H8TMvw0Y8Q,1043
|
|
6
|
+
figpack/core/_server_manager.py,sha256=BTLeZtSbaJtAmtslAfgvp9C-SV0aJnn4WCpUJzd1Mlg,10997
|
|
7
|
+
figpack/core/_show_view.py,sha256=-5HT1MYSeVuEoaL3RNNyoCjYsZy4Jy9XLjljUqLuvV4,5146
|
|
8
|
+
figpack/core/_upload_bundle.py,sha256=54hdWayJJdRZdx7N9V2aH_X33KkR6hImMjN6tkBTLi8,14894
|
|
9
|
+
figpack/core/_view_figure.py,sha256=xKmOdrqV-tQTRAK3n3eQx75de5el2KNIbHXdkCIqxSg,4201
|
|
10
|
+
figpack/core/config.py,sha256=oOR7SlP192vuFhYlS-h14HnG-kd_3gaz0vshXch2RNc,173
|
|
11
|
+
figpack/core/extension_view.py,sha256=MUj66ccjQJGyOyHzyYNwMd84isN2DfEoZ3X-TSzemAs,1257
|
|
12
|
+
figpack/core/figpack_extension.py,sha256=KSJKlnLYueFnGa8QFMpbIF3CDMwnIZJOqsI0smz6cUc,2252
|
|
13
|
+
figpack/core/figpack_view.py,sha256=L--pBg-PjEiAE2Ry4u-1eZsRVu4j4-p-NKwtJSVnGj0,6304
|
|
14
|
+
figpack/core/zarr.py,sha256=LTWOIX6vuH25STYTQS9_apfnfYXmATAEQkil3z9eYKE,1634
|
|
15
|
+
figpack/figpack-figure-dist/index.html,sha256=-AYJ73sdkHFMO42neJncqX7JL6z6fwKb85GZ5ms3-PU,486
|
|
16
|
+
figpack/figpack-figure-dist/assets/index-DBwmtEpB.js,sha256=AqunXLMdM90hYVSFwRIZGfXHjTxRGS_yxaXuHQGN_K8,1098361
|
|
17
|
+
figpack/figpack-figure-dist/assets/index-DHWczh-Q.css,sha256=h2S75Y8qya6YPwvhWjYeFT54ILGWge4mCBsOW84OFhg,4859
|
|
18
|
+
figpack/figpack-figure-dist/assets/neurosift-logo-CLsuwLMO.png,sha256=g5m-TwrGh5f6-9rXtWV-znH4B0nHgc__0GWclRDLUHs,9307
|
|
19
|
+
figpack/views/Box.py,sha256=dH4Vxax4NPJExZSx8jAG6feMgkNU5mOPEf-lLOd41-4,2421
|
|
20
|
+
figpack/views/DataFrame.py,sha256=FAqrEddh3v0MNXlXA1DQzN34d9gacDXHUdiahIKlgOI,3401
|
|
21
|
+
figpack/views/Gallery.py,sha256=D6drCKfnPN6MNn3wjQV0i5FW2s3q9xP-X75q-PR4Sc8,3326
|
|
22
|
+
figpack/views/GalleryItem.py,sha256=b_upJno5P3ANSulbG-h3t6Xj56tPGJ7iVxqyiZu3zaQ,1244
|
|
23
|
+
figpack/views/Image.py,sha256=8eNWzednvpsz0EcaoK3GdWGBfCybT2pXnBhMlZMr4yA,3742
|
|
24
|
+
figpack/views/LayoutItem.py,sha256=wy8DggkIzZpU0F1zFIBceS7HpBb6lu-A3hpYINQzedk,1595
|
|
25
|
+
figpack/views/Markdown.py,sha256=8kScwS1XaiQt5KRcbWG1B4RNUbA_FG5fIUJcv6csB8g,1134
|
|
26
|
+
figpack/views/MatplotlibFigure.py,sha256=v4rc8sT9FcuHPrwljq9s-BUT5vlJiRDAf5tBP4YujAE,2423
|
|
27
|
+
figpack/views/MultiChannelTimeseries.py,sha256=loZ1zGyIC_VJbduR7EIBbFHFPEr8DRQw-QNQSFVSdHQ,8292
|
|
28
|
+
figpack/views/Spectrogram.py,sha256=9aJpzlOsOo7ReddR-i6riN2MG2RdveRS7m6MI2cCYjM,9336
|
|
29
|
+
figpack/views/Splitter.py,sha256=q29pBu4RJgr0o_m1Jliv5FrGGCm5_jhowMg8Xgh70gk,2019
|
|
30
|
+
figpack/views/TabLayout.py,sha256=bKLjeI_CnllThB6t7AwlP-Oh5mKbWt8hpubW5Zyj420,1910
|
|
31
|
+
figpack/views/TabLayoutItem.py,sha256=xmHA0JsW_6naJze4_mQuP_Fy0Nm17p2N7w_AsmVRp8k,880
|
|
32
|
+
figpack/views/TimeseriesGraph.py,sha256=VErwmzRqNFq1i2XEWzAHM6csbHry064did32AbxLMms,17700
|
|
33
|
+
figpack/views/__init__.py,sha256=jquSaF1bU_oT9oV-2KfFKiRb_CG-UGXFpFygGswHO2k,547
|
|
34
|
+
figpack/views/PlotlyExtension/PlotlyExtension.py,sha256=W8ucSnAaPOHVGvOXRt0DpdgGNLQRmfUUdKzHICuJKJ0,2151
|
|
35
|
+
figpack/views/PlotlyExtension/__init__.py,sha256=80Wy1mDMWyagjuR99ECxJePIYpRQ6TSyHkB0uZoBZ_0,70
|
|
36
|
+
figpack/views/PlotlyExtension/_plotly_extension.py,sha256=yZjG1NMGlQedeeLdV6TQWpi_NTm5Wfk5eWbXEdZbbFE,1455
|
|
37
|
+
figpack/views/PlotlyExtension/plotly_view.js,sha256=9BjgOPkqGl87SSonnb48nFeQV3UTIi1trpSPxd9qlKo,3055
|
|
38
|
+
figpack-0.2.17.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
39
|
+
figpack-0.2.17.dist-info/METADATA,sha256=AUDz3kVzdsB1qR9a4KCQ77B0rlYmNyQKeRK1I4K6oFY,4501
|
|
40
|
+
figpack-0.2.17.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
41
|
+
figpack-0.2.17.dist-info/entry_points.txt,sha256=l6d3siH2LxXa8qJGbjAqpIZtI5AkMSyDeoRDCzdrUto,45
|
|
42
|
+
figpack-0.2.17.dist-info/top_level.txt,sha256=lMKGaC5xWmAYBx9Ac1iMokm42KFnJFjmkP2ldyvOo-c,8
|
|
43
|
+
figpack-0.2.17.dist-info/RECORD,,
|