Comments (4)
After I thought about this overnight, it occurred to me that there might be a workaround. I'll see if it works later today; it might be possible to make this simply a recipe in the documentation.
from marimo.
I was able to hack this together by using a text field in another cell to get input to a filtering operation to preprocess the table, and then put them in a vstack. I'll try to get it looking better and do a writeup over the weekend.
from marimo.
Here's what I've got so far:
@app.cell
def __(mo):
filter_text = mo.ui.text()
return filter_text,
@app.cell
def __():
table_entries = [] # Edit this to have something actually interesting in there.
return table_entries,
@app.cell
def __(filter_text, table_entries, mo):
def _filter_on_column(column, text, dicts):
return [dct for dct in dicts if text in dct[column]]
_stack = mo.vstack(
(
mo.hstack(("Filter by:", filter_text), justify="end"),
mo.ui.table(
_filter_on_column("Column Name", filter_text.value, table_entries)
),
)
)
DOCUMENTATION_SECTION = f"{_stack}"
return DOCUMENTATION_SECTION,
I'm going to say that this will hold me for now, but there are a few possible areas of improvement, some of which may interfere with each other:
- I haven't tried to get it working with any input type besides "list of dicts"
- It would be nice to have regex or fuzzy search
- It would be nice if the matches were bolded or otherwise highlighted
from marimo.
... Of course, it also works to skip making the hstack
and just use the label
argument to text()
.
from marimo.
Related Issues (20)
- ASM_CONSTS[code] is not a function HOT 1
- regression bug (0.5.2->0.6.0): batch wrapped Switch looses it's on_change handler HOT 2
- I want to render bar chart based on the marimo buttons like day,week,month and year but bar chart is not rendering HOT 4
- Resuming session (refresh) loses stale status
- infinite loop with mo.state via function calling both getter and setter HOT 4
- `mo.ui.table()` view of polars dataframe fails in HTML export HOT 2
- Change md code-block style HOT 4
- ui.table renders `False` bools as `true` HOT 1
- Regression: Clicking in a cell doesn't move cursor [go-to-definition bundle] HOT 10
- Scratchpad HOT 5
- Marimo Islands Quirks (Pyodide initialization) HOT 4
- Relax Uniqueness Constraint for Write-only Variables HOT 5
- file_browser() option to select folder paths (and all files at once)
- Vim block select mode does not work
- Can't get github copilot to work with nginx and oauth2 HOT 1
- Marimo auto-markdown view modifies original code HOT 2
- The iframe element only supports the marimo.app HOT 2
- `mo.lazy` preview code shown in documentation running incorrectly HOT 1
- Sidebar mixed with command palette, original sidebar, etc HOT 1
- batch wrapped elements don't react to changes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from marimo.