figpack 0.2.22__py3-none-any.whl → 0.2.23__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.

@@ -9,7 +9,7 @@
9
9
  // Allow script injection from trusted domains (see src/main.tsx)
10
10
  window.script_injection_allowed_domains = ['https://manage.figpack.org', 'https://figpack.org'];
11
11
  </script>
12
- <script type="module" crossorigin src="./assets/index-LugXZ9DB.js"></script>
12
+ <script type="module" crossorigin src="./assets/index-CLEO_r6_.js"></script>
13
13
  <link rel="stylesheet" crossorigin href="./assets/index-V5m_wCvw.css">
14
14
  </head>
15
15
  <body>
@@ -0,0 +1,72 @@
1
+ """
2
+ MountainLayout view for figpack - a workspace-style layout container with left panel and split right panel
3
+ """
4
+
5
+ from typing import List
6
+
7
+ from ..core.figpack_view import FigpackView
8
+ from ..core.zarr import Group
9
+ from .MountainLayoutItem import MountainLayoutItem
10
+
11
+
12
+ class MountainLayout(FigpackView):
13
+ """
14
+ A workspace-style layout container view that provides:
15
+ - Left panel with view buttons (top) and control views (bottom)
16
+ - Right panel split into north and south tab workspaces
17
+ - Views can be opened/closed and reopened in either workspace area
18
+ """
19
+
20
+ def __init__(
21
+ self,
22
+ *,
23
+ items: List[MountainLayoutItem],
24
+ ):
25
+ """
26
+ Initialize a MountainLayout view
27
+
28
+ Args:
29
+ items: List of MountainLayoutItem objects containing the child views.
30
+ Control items (is_control=True) will appear in the bottom-left panel.
31
+ Regular items will have buttons in the top-left panel and can be opened
32
+ in the north/south workspaces on the right.
33
+ """
34
+ self.items = items
35
+
36
+ def write_to_zarr_group(self, group: Group) -> None:
37
+ """
38
+ Write the MountainLayout data to a Zarr group
39
+
40
+ This method serializes the mountain layout structure and all its child views
41
+ into a Zarr group format that can be read by the frontend components.
42
+ Each item's view is written to its own subgroup within the main layout group.
43
+
44
+ Args:
45
+ group: Zarr group to write data into
46
+ """
47
+ # Set the view type identifier for the frontend
48
+ group.attrs["view_type"] = "MountainLayout"
49
+
50
+ # Create a list to store metadata for all layout items
51
+ items_metadata = []
52
+
53
+ # Process each mountain layout item
54
+ for i, item in enumerate(self.items):
55
+ # Generate a unique name for this item's subgroup
56
+ item_name = f"mountain_item_{i}"
57
+
58
+ # Store item metadata (label, is_control, etc.) for the frontend
59
+ item_metadata = item.to_dict()
60
+ item_metadata["name"] = item_name
61
+ items_metadata.append(item_metadata)
62
+
63
+ # Create a subgroup for this item's view
64
+ item_group = group.create_group(item_name)
65
+
66
+ # Recursively write the child view to the subgroup
67
+ # This allows any figpack view to be contained within a mountain layout item
68
+ item.view.write_to_zarr_group(item_group)
69
+
70
+ # Store the complete items metadata in the group attributes
71
+ # This will be used by the frontend to render the mountain layout structure
72
+ group.attrs["items"] = items_metadata
@@ -0,0 +1,50 @@
1
+ """
2
+ MountainLayoutItem class for figpack MountainLayout view - represents an item in a mountain layout container
3
+ """
4
+
5
+ from typing import Optional, Union
6
+
7
+ from ..core.figpack_view import FigpackView
8
+
9
+
10
+ class MountainLayoutItem:
11
+ """
12
+ Represents an item in a MountainLayout with label, view, and control properties
13
+ """
14
+
15
+ def __init__(
16
+ self,
17
+ *,
18
+ label: str,
19
+ view: FigpackView,
20
+ is_control: bool = False,
21
+ control_height: Optional[int] = None,
22
+ ):
23
+ """
24
+ Initialize a MountainLayoutItem
25
+
26
+ Args:
27
+ label: The label text to display for this item
28
+ view: The figpack view to be contained in this layout item
29
+ is_control: Whether this item is a control view (shows in bottom-left panel)
30
+ control_height: Height in pixels for control views (optional)
31
+ """
32
+ self.label = label
33
+ self.view = view
34
+ self.is_control = is_control
35
+ self.control_height = control_height
36
+
37
+ def to_dict(self) -> dict:
38
+ """
39
+ Convert the MountainLayoutItem to a dictionary for serialization
40
+
41
+ Returns:
42
+ Dictionary representation of the MountainLayoutItem
43
+ """
44
+ result = {
45
+ "label": self.label,
46
+ "is_control": self.is_control,
47
+ }
48
+ if self.control_height is not None:
49
+ result["control_height"] = self.control_height
50
+ return result
figpack/views/__init__.py CHANGED
@@ -6,6 +6,8 @@ from .Image import Image
6
6
  from .LayoutItem import LayoutItem
7
7
  from .Markdown import Markdown
8
8
  from .MatplotlibFigure import MatplotlibFigure
9
+ from .MountainLayout import MountainLayout
10
+ from .MountainLayoutItem import MountainLayoutItem
9
11
  from .MultiChannelTimeseries import MultiChannelTimeseries
10
12
  from .Spectrogram import Spectrogram
11
13
  from .Splitter import Splitter
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: figpack
3
- Version: 0.2.22
3
+ Version: 0.2.23
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
@@ -71,6 +71,7 @@ Requires-Dist: linkify-it-py>=2.0; extra == "docs"
71
71
  Requires-Dist: sphinx-copybutton>=0.5; extra == "docs"
72
72
  Requires-Dist: lindi; extra == "docs"
73
73
  Requires-Dist: nibabel; extra == "docs"
74
+ Requires-Dist: Pillow; extra == "docs"
74
75
  Dynamic: license-file
75
76
 
76
77
  # figpack
@@ -1,4 +1,4 @@
1
- figpack/__init__.py,sha256=sMXkyPxhrdjrhsIHvpeWouU8v-ma9iB555gukt3GYSA,358
1
+ figpack/__init__.py,sha256=f85A9_sMa531iN6j4yjwBPfkP5QftcXsYoL6NfMDqdg,358
2
2
  figpack/cli.py,sha256=s1mGQuFSntxiIvU6OWwHVlM9Cj-l1zMQ3OzFFe1-5ZE,11089
3
3
  figpack/extensions.py,sha256=mILB4_F1RHkca4I7t88zh74IX8VCmfT7XFZZT4XYdNw,13009
4
4
  figpack/core/__init__.py,sha256=7zU6O1piTk07aeCfbU81QqTgSHIO2n5MZ4LFNmsrtfs,192
@@ -14,8 +14,8 @@ figpack/core/extension_view.py,sha256=FSBXdhFEWicLi0jhkuRdS-a8CNsULrEqqIKtYfV3tm
14
14
  figpack/core/figpack_extension.py,sha256=KSJKlnLYueFnGa8QFMpbIF3CDMwnIZJOqsI0smz6cUc,2252
15
15
  figpack/core/figpack_view.py,sha256=TsIvP7PUMwYl5M0G6zZ0xHI0mqkLRltfWj_SNyWVh1w,6454
16
16
  figpack/core/zarr.py,sha256=LTWOIX6vuH25STYTQS9_apfnfYXmATAEQkil3z9eYKE,1634
17
- figpack/figpack-figure-dist/index.html,sha256=ZmqQ65aE4-JOvreupG53NsLL-y4v-lKCasSXWW_kbL8,688
18
- figpack/figpack-figure-dist/assets/index-LugXZ9DB.js,sha256=mo9NtSZhhlIJUO_SZYvySMcqyLIsuawXKr5Nv-qZyXY,1103007
17
+ figpack/figpack-figure-dist/index.html,sha256=1_rZQVk_M3zMcSb6VmiqSyH3yqHiirvOw5XDNE-gJDQ,688
18
+ figpack/figpack-figure-dist/assets/index-CLEO_r6_.js,sha256=4qrioRNRLnfC3Kd0coraHxna05w3sK5lHnebHWv26a0,1108269
19
19
  figpack/figpack-figure-dist/assets/index-V5m_wCvw.css,sha256=WRtQLW6SNlTlLtepSOt89t1z41SD7XzYUyRldqowjMM,7286
20
20
  figpack/figpack-figure-dist/assets/neurosift-logo-CLsuwLMO.png,sha256=g5m-TwrGh5f6-9rXtWV-znH4B0nHgc__0GWclRDLUHs,9307
21
21
  figpack/views/Box.py,sha256=oN_OJH2pK_hH26k0eFCFjlfuJssVqKvw20GxYK1HX7g,2419
@@ -26,20 +26,22 @@ figpack/views/Image.py,sha256=Nc8XNKQBm79iN6omZIsYEU6daNa_X3_IIbmt4q1Zb8k,3741
26
26
  figpack/views/LayoutItem.py,sha256=wy8DggkIzZpU0F1zFIBceS7HpBb6lu-A3hpYINQzedk,1595
27
27
  figpack/views/Markdown.py,sha256=ojUmeVf7gEh4nUSnbyg62dKNpwgQOLFDYV84w2NS5EQ,1133
28
28
  figpack/views/MatplotlibFigure.py,sha256=697xTOkNxcwYZrLoYOzh4CuME4NDUpIYzX-ckLE5aWU,2422
29
+ figpack/views/MountainLayout.py,sha256=JGvrhzqLR2im5d-m0TsZNy06KOR5iGfDlinrRqHpQsQ,2680
30
+ figpack/views/MountainLayoutItem.py,sha256=arYO1pD9RpXfHQKxtFagl66bjqSzEdafIf8ldDEMTD0,1451
29
31
  figpack/views/MultiChannelTimeseries.py,sha256=6AkEbAsdM6fvZVsa3jakIjEcx6LNWhF0fbS00e33heM,8291
30
32
  figpack/views/Spectrogram.py,sha256=jcm26ucHedKDnBA5xnAUu9tW-g-ZutT-kw1EIhYm66E,9335
31
33
  figpack/views/Splitter.py,sha256=BR2L-8aqicTubS1rSzsQ3XnhoJcX5GcfEnVWtEWEs0w,2016
32
34
  figpack/views/TabLayout.py,sha256=AqdHPLcP2-caWjxbkC8r8m60z8n_eyZrIBGOOPSVNCs,1908
33
35
  figpack/views/TabLayoutItem.py,sha256=xmHA0JsW_6naJze4_mQuP_Fy0Nm17p2N7w_AsmVRp8k,880
34
36
  figpack/views/TimeseriesGraph.py,sha256=QL2eVqzB5QiGkIO5-vVf6PD9E0AHffI6VJeWvxsQ9HM,17691
35
- figpack/views/__init__.py,sha256=jquSaF1bU_oT9oV-2KfFKiRb_CG-UGXFpFygGswHO2k,547
37
+ figpack/views/__init__.py,sha256=V09R6vFRzhY7ANevWomM7muFfUieXZEjGimPiMHpey4,641
36
38
  figpack/views/PlotlyExtension/PlotlyExtension.py,sha256=LOFSqbm46UZ7HsHTDxUPnNB33ydYQvEkRVK-TSKkzK4,2149
37
39
  figpack/views/PlotlyExtension/__init__.py,sha256=80Wy1mDMWyagjuR99ECxJePIYpRQ6TSyHkB0uZoBZ_0,70
38
40
  figpack/views/PlotlyExtension/_plotly_extension.py,sha256=yZjG1NMGlQedeeLdV6TQWpi_NTm5Wfk5eWbXEdZbbFE,1455
39
41
  figpack/views/PlotlyExtension/plotly_view.js,sha256=9BjgOPkqGl87SSonnb48nFeQV3UTIi1trpSPxd9qlKo,3055
40
- figpack-0.2.22.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
41
- figpack-0.2.22.dist-info/METADATA,sha256=Oo8BeMFpu2i1LnBI5ruW_jvaeOyxd9jxdwhseLNDLkY,4579
42
- figpack-0.2.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
- figpack-0.2.22.dist-info/entry_points.txt,sha256=l6d3siH2LxXa8qJGbjAqpIZtI5AkMSyDeoRDCzdrUto,45
44
- figpack-0.2.22.dist-info/top_level.txt,sha256=lMKGaC5xWmAYBx9Ac1iMokm42KFnJFjmkP2ldyvOo-c,8
45
- figpack-0.2.22.dist-info/RECORD,,
42
+ figpack-0.2.23.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
43
+ figpack-0.2.23.dist-info/METADATA,sha256=02jVfnIuE2kIKrbr90w-1rJQkVptz8Yvk3IXT-qn1Kw,4618
44
+ figpack-0.2.23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
+ figpack-0.2.23.dist-info/entry_points.txt,sha256=l6d3siH2LxXa8qJGbjAqpIZtI5AkMSyDeoRDCzdrUto,45
46
+ figpack-0.2.23.dist-info/top_level.txt,sha256=lMKGaC5xWmAYBx9Ac1iMokm42KFnJFjmkP2ldyvOo-c,8
47
+ figpack-0.2.23.dist-info/RECORD,,