You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+32-11Lines changed: 32 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ Returns a `PivotTableResult` dict containing the current `config` state.
57
57
|`values`|`list[str] \| None`|`None`| Column names to aggregate as measures. |
58
58
|`synthetic_measures`|`list[dict] \| None`|`None`| Derived measures computed from source-field sums (for example, ratio of sums). See [Synthetic Measures](#synthetic-measures-v1). |
59
59
|`aggregation`|`str \| dict[str, str]`|`"sum"`| Aggregation setting for raw value fields. A single string applies to every raw measure; a dict enables per-measure aggregation. See [Aggregation Functions](#aggregation-functions). |
60
-
|`interactive`|`bool`|`True`| Enable toolbar controls for reconfiguring the pivot. |
60
+
|`interactive`|`bool`|`True`| Enable end-user config controls. When `False`, the toolbar is hidden and header-menu sort/filter/show-values-as actions are disabled. |
61
61
62
62
#### Totals and Subtotals
63
63
@@ -99,9 +99,9 @@ Returns a `PivotTableResult` dict containing the current `config` state.
99
99
| Parameter | Type | Default | Description |
100
100
|-----------|------|---------|-------------|
101
101
|`on_cell_click`|`Callable[[], None] \| None`|`None`| Called when a user clicks a data cell. Read the payload from `st.session_state[key]`. |
102
-
|`on_config_change`|`Callable[[], None] \| None`|`None`| Called when the user changes the pivot config via the toolbar. |
102
+
|`on_config_change`|`Callable[[], None] \| None`|`None`| Called when the user changes the pivot config interactively, including toolbar and header-menu actions. |
103
103
|`enable_drilldown`|`bool`|`True`| Show an inline drill-down panel with source records when a cell is clicked. |
104
-
|`locked`|`bool`|`False`|Freeze toolbar config controls (rows/columns/values/per-measure aggregation/settings). Sorting and filtering via header menus remain available. |
104
+
|`locked`|`bool`|`False`|Viewer mode with exploration enabled. Toolbar config controls and settings toggles are disabled, while header-menu sorting/filtering and drill-down remain available. |
105
105
|`export_filename`|`str \| None`|`None`| Base filename (without extension) for exported files. Date and extension are appended automatically. Defaults to `"pivot-table"`. |
106
106
107
107
#### Data Control
@@ -137,6 +137,7 @@ Returns a `PivotTableResult` dict containing the current `config` state.
@@ -367,6 +381,7 @@ With 2+ row dimensions, enable subtotals to see group-level aggregations with co
367
381
```python
368
382
st_pivot_table(
369
383
df,
384
+
key="subtotals_example",
370
385
rows=["Region", "Category"],
371
386
columns=["Year"],
372
387
values=["Revenue"],
@@ -402,6 +417,7 @@ With 2+ column dimensions, column groups can be collapsed into subtotal columns.
402
417
```python
403
418
st_pivot_table(
404
419
df,
420
+
key="column_groups_example",
405
421
rows=["Region"],
406
422
columns=["Year", "Category"],
407
423
values=["Revenue"],
@@ -442,11 +458,12 @@ result = st_pivot_table(
442
458
443
459
### Locked Mode
444
460
445
-
Freeze toolbar config controls so end-users cannot change rows, columns, values, per-measure aggregation, or display settings. The entire utility menu (reset, swap, config import/export, data export, settings) is hidden. Sorting and filtering via header menus remain available.
461
+
Use `locked=True` for a viewer-mode experience with exploration enabled. Toolbar config controls stay locked so end-users cannot change rows, columns, values, per-measure aggregation, or settings toggles. Reset, Swap, config import/export, and data export are hidden, while the Settings gear remains visible so users can inspect settings and use Expand/Collapse All group controls. Header-menu sorting and filtering remain available, and drill-down still works.
446
462
447
463
```python
448
464
st_pivot_table(
449
465
df,
466
+
key="locked_mode_example",
450
467
rows=["Region"],
451
468
columns=["Year"],
452
469
values=["Revenue"],
@@ -467,7 +484,11 @@ When `interactive=True`, hovering over the top-right of the toolbar reveals util
467
484
|**Export Data**| Open the export popover (CSV / TSV / Clipboard). Use `export_filename` to customize the download filename. |
468
485
|**Settings** (gear icon) | Opens a popover with display toggles: Row Totals, Column Totals, Subtotals, Repeat Labels, Sticky Headers, and Expand/Collapse All group controls |
469
486
470
-
In **locked mode**, the entire utility menu (including Settings) is hidden. Only sorting and filtering via header menus remain available.
487
+
In **locked mode**, Reset, Swap, config import/export, and data export are hidden. The Settings gear remains visible, settings toggles are disabled, group expand/collapse actions remain available, and header-menu sorting and filtering stay enabled.
488
+
489
+
### Non-Interactive Mode
490
+
491
+
Set `interactive=False` to render a read-only pivot view. This hides the toolbar and disables header-menu config actions (sorting, filtering, and `Show Values As`). Cell clicks and drill-down remain available.
471
492
472
493
---
473
494
@@ -516,7 +537,7 @@ For total cells, `rowKey` or `colKey` will be `["Total"]` and the corresponding
516
537
517
538
### Config State
518
539
519
-
The returned `config` dict contains the full current configuration including any changes the user made via the toolbar. Use this to persist user customizations or synchronize multiple components.
540
+
The returned `config` dict contains the current supported configuration state, including interactive changes such as rows, columns, values, aggregation, totals, sorting, filtering, and display options. Use this to persist user customizations or synchronize multiple components.
Copy file name to clipboardExpand all lines: SKILL.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -471,7 +471,7 @@ When `interactive=True`, hovering over the top-right of the toolbar reveals util
471
471
|**Export Data**| Open the export popover (CSV / TSV / Clipboard). Use `export_filename` to customize the download filename. |
472
472
|**Settings** (gear icon) | Opens a popover with display toggles: Row Totals, Column Totals, Subtotals, Repeat Labels, Sticky Headers, and Expand/Collapse All group controls |
473
473
474
-
In **locked mode**, the entire utility menu (including Settings) is hidden. Only sorting and filtering via header menus remain available.
474
+
In **locked mode**, Reset, Swap, config import/export, and data export are hidden. The Settings gear remains visible, its toggles are disabled, and sorting/filtering via header menus remain available.
475
475
476
476
---
477
477
@@ -543,7 +543,7 @@ This section covers deploying the pivot table component (as a `.whl` file) into
543
543
544
544
```
545
545
To set up your SiS on SPCS app with the pivot table component, I need:
546
-
1. The path to your .whl file (e.g., ~/Downloads/streamlit_pivot_table-0.0.1-py3-none-any.whl)
546
+
1. The path to your .whl file (e.g., ~/Downloads/streamlit_pivot_table-0.1.0-py3-none-any.whl)
547
547
2. Do you have an existing SiS project directory with snowflake.yml, or should I create one from scratch?
548
548
3. What Snowflake table(s) will the app query?
549
549
4. What compute pool should the app run on? (e.g., MY_COMPUTE_POOL)
@@ -553,7 +553,7 @@ To set up your SiS on SPCS app with the pivot table component, I need:
553
553
554
554
**After the user responds**, derive these values from the `.whl` filename and use them in ALL subsequent steps:
555
555
556
-
-**`WHL_FILENAME`**: The `.whl` file name (e.g., `streamlit_pivot_table-0.0.1-py3-none-any.whl`)
556
+
-**`WHL_FILENAME`**: The `.whl` file name (e.g., `streamlit_pivot_table-0.1.0-py3-none-any.whl`)
557
557
-**`PACKAGE_NAME`**: The portion before the first version segment, with hyphens replaced by underscores (e.g., `streamlit_pivot_table`)
558
558
-**`TABLE_NAMES`**: The Snowflake table(s) the user wants to query
559
559
-**`COMPUTE_POOL`**: The SPCS compute pool name for the app runtime
0 commit comments