figpack 0.2.11__tar.gz → 0.2.12__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.

Potentially problematic release.


This version of figpack might be problematic. Click here for more details.

Files changed (92) hide show
  1. {figpack-0.2.11 → figpack-0.2.12}/MANIFEST.in +1 -1
  2. {figpack-0.2.11/figpack.egg-info → figpack-0.2.12}/PKG-INFO +1 -1
  3. {figpack-0.2.11 → figpack-0.2.12}/figpack/__init__.py +1 -1
  4. figpack-0.2.12/figpack/views/PlotlyExtension/plotly_view.js +106 -0
  5. {figpack-0.2.11 → figpack-0.2.12/figpack.egg-info}/PKG-INFO +1 -1
  6. {figpack-0.2.11 → figpack-0.2.12}/figpack.egg-info/SOURCES.txt +1 -0
  7. {figpack-0.2.11 → figpack-0.2.12}/pyproject.toml +1 -1
  8. {figpack-0.2.11 → figpack-0.2.12}/LICENSE +0 -0
  9. {figpack-0.2.11 → figpack-0.2.12}/README.md +0 -0
  10. {figpack-0.2.11 → figpack-0.2.12}/figpack/cli.py +0 -0
  11. {figpack-0.2.11 → figpack-0.2.12}/figpack/core/__init__.py +0 -0
  12. {figpack-0.2.11 → figpack-0.2.12}/figpack/core/_bundle_utils.py +0 -0
  13. {figpack-0.2.11 → figpack-0.2.12}/figpack/core/_save_figure.py +0 -0
  14. {figpack-0.2.11 → figpack-0.2.12}/figpack/core/_server_manager.py +0 -0
  15. {figpack-0.2.11 → figpack-0.2.12}/figpack/core/_show_view.py +0 -0
  16. {figpack-0.2.11 → figpack-0.2.12}/figpack/core/_upload_bundle.py +0 -0
  17. {figpack-0.2.11 → figpack-0.2.12}/figpack/core/_view_figure.py +0 -0
  18. {figpack-0.2.11 → figpack-0.2.12}/figpack/core/config.py +0 -0
  19. {figpack-0.2.11 → figpack-0.2.12}/figpack/core/extension_view.py +0 -0
  20. {figpack-0.2.11 → figpack-0.2.12}/figpack/core/figpack_extension.py +0 -0
  21. {figpack-0.2.11 → figpack-0.2.12}/figpack/core/figpack_view.py +0 -0
  22. {figpack-0.2.11 → figpack-0.2.12}/figpack/figpack-figure-dist/assets/index-D9a3K6eW.css +0 -0
  23. {figpack-0.2.11 → figpack-0.2.12}/figpack/figpack-figure-dist/assets/index-DvunBzII.js +0 -0
  24. {figpack-0.2.11 → figpack-0.2.12}/figpack/figpack-figure-dist/assets/neurosift-logo-CLsuwLMO.png +0 -0
  25. {figpack-0.2.11 → figpack-0.2.12}/figpack/figpack-figure-dist/index.html +0 -0
  26. {figpack-0.2.11 → figpack-0.2.12}/figpack/franklab/__init__.py +0 -0
  27. {figpack-0.2.11 → figpack-0.2.12}/figpack/franklab/views/TrackAnimation.py +0 -0
  28. {figpack-0.2.11 → figpack-0.2.12}/figpack/franklab/views/__init__.py +0 -0
  29. {figpack-0.2.11 → figpack-0.2.12}/figpack/spike_sorting/__init__.py +0 -0
  30. {figpack-0.2.11 → figpack-0.2.12}/figpack/spike_sorting/views/AutocorrelogramItem.py +0 -0
  31. {figpack-0.2.11 → figpack-0.2.12}/figpack/spike_sorting/views/Autocorrelograms.py +0 -0
  32. {figpack-0.2.11 → figpack-0.2.12}/figpack/spike_sorting/views/AverageWaveforms.py +0 -0
  33. {figpack-0.2.11 → figpack-0.2.12}/figpack/spike_sorting/views/CrossCorrelogramItem.py +0 -0
  34. {figpack-0.2.11 → figpack-0.2.12}/figpack/spike_sorting/views/CrossCorrelograms.py +0 -0
  35. {figpack-0.2.11 → figpack-0.2.12}/figpack/spike_sorting/views/RasterPlot.py +0 -0
  36. {figpack-0.2.11 → figpack-0.2.12}/figpack/spike_sorting/views/RasterPlotItem.py +0 -0
  37. {figpack-0.2.11 → figpack-0.2.12}/figpack/spike_sorting/views/SpikeAmplitudes.py +0 -0
  38. {figpack-0.2.11 → figpack-0.2.12}/figpack/spike_sorting/views/SpikeAmplitudesItem.py +0 -0
  39. {figpack-0.2.11 → figpack-0.2.12}/figpack/spike_sorting/views/UnitMetricsGraph.py +0 -0
  40. {figpack-0.2.11 → figpack-0.2.12}/figpack/spike_sorting/views/UnitSimilarityScore.py +0 -0
  41. {figpack-0.2.11 → figpack-0.2.12}/figpack/spike_sorting/views/UnitsTable.py +0 -0
  42. {figpack-0.2.11 → figpack-0.2.12}/figpack/spike_sorting/views/UnitsTableColumn.py +0 -0
  43. {figpack-0.2.11 → figpack-0.2.12}/figpack/spike_sorting/views/UnitsTableRow.py +0 -0
  44. {figpack-0.2.11 → figpack-0.2.12}/figpack/spike_sorting/views/__init__.py +0 -0
  45. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/Box.py +0 -0
  46. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/DataFrame.py +0 -0
  47. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/Gallery.py +0 -0
  48. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/GalleryItem.py +0 -0
  49. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/Image.py +0 -0
  50. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/LayoutItem.py +0 -0
  51. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/Markdown.py +0 -0
  52. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/MatplotlibFigure.py +0 -0
  53. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/MultiChannelTimeseries.py +0 -0
  54. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/PlotlyExtension/PlotlyExtension.py +0 -0
  55. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/PlotlyExtension/__init__.py +0 -0
  56. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/Spectrogram.py +0 -0
  57. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/Splitter.py +0 -0
  58. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/TabLayout.py +0 -0
  59. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/TabLayoutItem.py +0 -0
  60. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/TimeseriesGraph.py +0 -0
  61. {figpack-0.2.11 → figpack-0.2.12}/figpack/views/__init__.py +0 -0
  62. {figpack-0.2.11 → figpack-0.2.12}/figpack.egg-info/dependency_links.txt +0 -0
  63. {figpack-0.2.11 → figpack-0.2.12}/figpack.egg-info/entry_points.txt +0 -0
  64. {figpack-0.2.11 → figpack-0.2.12}/figpack.egg-info/requires.txt +0 -0
  65. {figpack-0.2.11 → figpack-0.2.12}/figpack.egg-info/top_level.txt +0 -0
  66. {figpack-0.2.11 → figpack-0.2.12}/setup.cfg +0 -0
  67. {figpack-0.2.11 → figpack-0.2.12}/tests/test_average_waveforms.py +0 -0
  68. {figpack-0.2.11 → figpack-0.2.12}/tests/test_box.py +0 -0
  69. {figpack-0.2.11 → figpack-0.2.12}/tests/test_cli.py +0 -0
  70. {figpack-0.2.11 → figpack-0.2.12}/tests/test_core.py +0 -0
  71. {figpack-0.2.11 → figpack-0.2.12}/tests/test_dataframe.py +0 -0
  72. {figpack-0.2.11 → figpack-0.2.12}/tests/test_extension_system.py +0 -0
  73. {figpack-0.2.11 → figpack-0.2.12}/tests/test_figpack_view.py +0 -0
  74. {figpack-0.2.11 → figpack-0.2.12}/tests/test_gallery.py +0 -0
  75. {figpack-0.2.11 → figpack-0.2.12}/tests/test_image.py +0 -0
  76. {figpack-0.2.11 → figpack-0.2.12}/tests/test_markdown.py +0 -0
  77. {figpack-0.2.11 → figpack-0.2.12}/tests/test_matplotlib_figure.py +0 -0
  78. {figpack-0.2.11 → figpack-0.2.12}/tests/test_multichannel_timeseries.py +0 -0
  79. {figpack-0.2.11 → figpack-0.2.12}/tests/test_plotly_figure.py +0 -0
  80. {figpack-0.2.11 → figpack-0.2.12}/tests/test_raster_plot.py +0 -0
  81. {figpack-0.2.11 → figpack-0.2.12}/tests/test_server_manager.py +0 -0
  82. {figpack-0.2.11 → figpack-0.2.12}/tests/test_show_view.py +0 -0
  83. {figpack-0.2.11 → figpack-0.2.12}/tests/test_spectrogram.py +0 -0
  84. {figpack-0.2.11 → figpack-0.2.12}/tests/test_spike_amplitudes.py +0 -0
  85. {figpack-0.2.11 → figpack-0.2.12}/tests/test_spike_sorting_correlograms.py +0 -0
  86. {figpack-0.2.11 → figpack-0.2.12}/tests/test_splitter.py +0 -0
  87. {figpack-0.2.11 → figpack-0.2.12}/tests/test_tablayout.py +0 -0
  88. {figpack-0.2.11 → figpack-0.2.12}/tests/test_timeseries_graph.py +0 -0
  89. {figpack-0.2.11 → figpack-0.2.12}/tests/test_track_animation.py +0 -0
  90. {figpack-0.2.11 → figpack-0.2.12}/tests/test_units_table.py +0 -0
  91. {figpack-0.2.11 → figpack-0.2.12}/tests/test_upload_bundle.py +0 -0
  92. {figpack-0.2.11 → figpack-0.2.12}/tests/test_view_figure.py +0 -0
@@ -2,7 +2,7 @@ include README.md
2
2
  include LICENSE
3
3
  include pyproject.toml
4
4
  recursive-include figpack *.py
5
+ recursive-include figpack *.js
5
6
  recursive-include figpack/figpack-figure-dist *
6
7
  global-exclude __pycache__
7
8
  global-exclude *.py[co]
8
-
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: figpack
3
- Version: 0.2.11
3
+ Version: 0.2.12
4
4
  Summary: A Python package for creating shareable, interactive visualizations in the browser
5
5
  Author-email: Jeremy Magland <jmagland@flatironinstitute.org>
6
6
  License: Apache-2.0
@@ -2,7 +2,7 @@
2
2
  figpack - A Python package for creating shareable, interactive visualizations in the browser
3
3
  """
4
4
 
5
- __version__ = "0.2.11"
5
+ __version__ = "0.2.12"
6
6
 
7
7
  from .cli import view_figure
8
8
  from .core import FigpackView, FigpackExtension, ExtensionRegistry, ExtensionView
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Plotly Extension for figpack
3
+ * Provides interactive graph visualization using Plotly library
4
+ */
5
+
6
+ const loadFigureData = async (zarrGroup) => {
7
+ // Get the figure data from the zarr array
8
+ const data = await zarrGroup.file.getDatasetData(
9
+ joinPath(zarrGroup.path, "figure_data"),
10
+ {},
11
+ );
12
+ if (!data || data.length === 0) {
13
+ throw new Error("Empty figure data");
14
+ }
15
+
16
+ // Convert the uint8 array back to string
17
+ const uint8Array = new Uint8Array(data);
18
+ const decoder = new TextDecoder("utf-8");
19
+ const jsonString = decoder.decode(uint8Array);
20
+
21
+ // Parse the JSON string
22
+ const parsedData = JSON.parse(jsonString);
23
+
24
+ return parsedData;
25
+ };
26
+
27
+ (function() {
28
+ window.figpackExtensions = window.figpackExtensions || {};
29
+
30
+ window.figpackExtensions['figpack_plotly'] = {
31
+ render: async function(container, zarrGroup, width, height, onResize) {
32
+ container.innerHTML = '';
33
+
34
+ try {
35
+ const figureData = await loadFigureData(zarrGroup);
36
+
37
+ const makePlot = () => {
38
+ window.Plotly.newPlot(
39
+ container,
40
+ figureData.data || [],
41
+ {
42
+ ...figureData.layout,
43
+ width: width,
44
+ height: height,
45
+ margin: { l: 50, r: 50, t: 50, b: 50 },
46
+ },
47
+ {
48
+ responsive: true,
49
+ displayModeBar: true,
50
+ displaylogo: false,
51
+ },
52
+ )
53
+ };
54
+
55
+ makePlot();
56
+
57
+ // Handle resize events
58
+ onResize((newWidth, newHeight) => {
59
+ window.Plotly.relayout(container, {width: newWidth, height: newHeight});
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: () => {} };
72
+ }
73
+ },
74
+
75
+ renderError: function(container, width, height, message) {
76
+ container.innerHTML = `
77
+ <div style="
78
+ width: ${width}px;
79
+ height: ${height}px;
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;
106
+ };
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: figpack
3
- Version: 0.2.11
3
+ Version: 0.2.12
4
4
  Summary: A Python package for creating shareable, interactive visualizations in the browser
5
5
  Author-email: Jeremy Magland <jmagland@flatironinstitute.org>
6
6
  License: Apache-2.0
@@ -61,6 +61,7 @@ figpack/views/TimeseriesGraph.py
61
61
  figpack/views/__init__.py
62
62
  figpack/views/PlotlyExtension/PlotlyExtension.py
63
63
  figpack/views/PlotlyExtension/__init__.py
64
+ figpack/views/PlotlyExtension/plotly_view.js
64
65
  tests/test_average_waveforms.py
65
66
  tests/test_box.py
66
67
  tests/test_cli.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "figpack"
7
- version = "0.2.11"
7
+ version = "0.2.12"
8
8
  description = "A Python package for creating shareable, interactive visualizations in the browser"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes