tangram-explore 0.3.0__py3-none-any.whl → 0.4.0__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.
@@ -21,7 +21,7 @@ import orjson
21
21
  import tangram_core
22
22
  from fastapi import APIRouter
23
23
  from fastapi.responses import Response
24
- from tangram_core.config import ExposeField
24
+ from tangram_core.config import FrontendMutable
25
25
 
26
26
  if TYPE_CHECKING:
27
27
  from typing import TypeAlias
@@ -200,13 +200,26 @@ class Session:
200
200
 
201
201
  @dataclass
202
202
  class ExploreConfig:
203
- enable_3d: Annotated[Literal["inherit"] | bool, ExposeField()] = "inherit"
203
+ enable_3d: Literal["inherit"] | bool = "inherit"
204
+
205
+
206
+ @dataclass
207
+ class ExploreFrontendConfig:
208
+ # NOTE: this is a limitation on the settings page: enums are not properly rendered
209
+ # in the dropdown so we have to "flatten" the enum ourselves.
210
+ enable_3d: Annotated[Literal["inherit", True, False], FrontendMutable()]
204
211
  """Whether to render scatter points in 3D"""
205
212
 
206
213
 
214
+ def into_frontend(config: ExploreConfig) -> ExploreFrontendConfig:
215
+ return ExploreFrontendConfig(enable_3d=config.enable_3d)
216
+
217
+
207
218
  plugin = tangram_core.Plugin(
208
219
  frontend_path="dist-frontend",
209
220
  routers=[router],
210
221
  config_class=ExploreConfig,
222
+ frontend_config_class=ExploreFrontendConfig,
223
+ into_frontend_config_function=into_frontend,
211
224
  lifespan=lifespan,
212
225
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tangram-explore
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Tangram plugin for exploring any Arrow-backed dataframe
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: arro3-core>=0.4.0
@@ -1,9 +1,9 @@
1
1
  tangram_explore/ExploreLayers.vue,sha256=VbqiWvqzZK8k6ZICTd5gxdhG_EzQjgpTyJcFZhBM308,4989
2
2
  tangram_explore/LayerList.vue,sha256=ozxx97TE_YY-G85h30R1XBVlRw48TNib_Ib5DvVqnb8,3804
3
- tangram_explore/__init__.py,sha256=gx4tqdO7b2vpv4r3SSmX-vUPVKwUDrcFybyrNoX8qRg,6383
3
+ tangram_explore/__init__.py,sha256=2FCh-0GwbzOEObQPu0znLYXZdB7kCVIttbyLpddVE4k,6861
4
4
  tangram_explore/index.ts,sha256=3vcsAtVYLq3blfchqVVQlRML0cH8mOkLoZKV7nRZMSY,2460
5
5
  tangram_explore/store.ts,sha256=UCTZEdiG-JaYuq51E-uIi0gd0cg314QuH3xSFPiYgO0,2326
6
- tangram_explore-0.3.0.dist-info/METADATA,sha256=EU6Eh6JE2UDI1F9_vQ_CVRQHPG_KwWzG4UxwSrMDyAQ,653
7
- tangram_explore-0.3.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
8
- tangram_explore-0.3.0.dist-info/entry_points.txt,sha256=-uGNZAL738Y1AixJRxmo9O8QwU26g33F6uLdVbtBbmM,64
9
- tangram_explore-0.3.0.dist-info/RECORD,,
6
+ tangram_explore-0.4.0.dist-info/METADATA,sha256=9eW-DBBEX6Ly-_JXAJ-VnC0xrmI_f-18lkM6113_7A4,653
7
+ tangram_explore-0.4.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
8
+ tangram_explore-0.4.0.dist-info/entry_points.txt,sha256=-uGNZAL738Y1AixJRxmo9O8QwU26g33F6uLdVbtBbmM,64
9
+ tangram_explore-0.4.0.dist-info/RECORD,,