Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,5 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
esbuild
.DS_Stores
.DS_Stores
uv.lock
19 changes: 19 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Development Notes

## Setup

Run `make install` to install esbuild (for bundling JavaScript) and project dependencies.

## Building JavaScript

After modifying files in `js/`, rebuild the bundles:

```bash
./esbuild --bundle --format=esm --outfile=drawdata/static/scatter_widget.js js/scatter_widget.js
```

Or use `make js` for watch mode during development.

## Dependencies

**NEVER add dev tools (ruff, pytest, etc.) or demo-only dependencies (altair, etc.) to the main `dependencies` list in pyproject.toml.** The library should only depend on what it actually needs at runtime: anywidget. Pandas, polars, and numpy are lazy imports - users install them if they want those features.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ clean:


docs:
marimo -y export html-wasm --output docs --mode edit demo.py
rm -rf docs
uv run marimo -y export html-wasm --output docs --mode edit demo.py
53 changes: 21 additions & 32 deletions demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import marimo

__generated_with = "0.13.6"
__generated_with = "0.19.6"
app = marimo.App(width="medium")


Expand All @@ -24,19 +24,17 @@ def _():

@app.cell(hide_code=True)
def _(mo):
mo.md(
r"""
mo.md(r"""
# Drawing a `ScatterChart`

This notebook contains a demo of the `ScatterWidget` inside of the [drawdata](https://github.com/koaning/drawdata) library. You should see that as you draw data, that the chart below updates.
"""
)
""")
return


@app.cell(hide_code=True)
def _(ScatterWidget, mo):
widget = mo.ui.anywidget(ScatterWidget(height=350))
widget = mo.ui.anywidget(ScatterWidget(height=400, width=400))
widget
return (widget,)

Expand All @@ -62,32 +60,23 @@ def _(mo, widget):
color="color",
)

top_hist = (
base_bar
.encode(
alt.X("x:Q")
# when using bins, the axis scale is set through
# the bin extent, so we do not specify the scale here
# (which would be ignored anyway)
.bin(maxbins=30, extent=xscale.domain).stack(None).title(""),
alt.Y("count()").stack(None).title(""),
alt.Color("color:N", scale=colscale),
)
.properties(height=60)
)

right_hist = (
base_bar
.encode(
alt.Y("y:Q")
.bin(maxbins=30, extent=yscale.domain)
.stack(None)
.title(""),
alt.X("count()").stack(None).title(""),
alt.Color("color:N"),
)
.properties(width=60)
)
top_hist = base_bar.encode(
alt.X("x:Q")
# when using bins, the axis scale is set through
# the bin extent, so we do not specify the scale here
# (which would be ignored anyway)
.bin(maxbins=30, extent=xscale.domain)
.stack(None)
.title(""),
alt.Y("count()").stack(None).title(""),
alt.Color("color:N", scale=colscale),
).properties(height=60)

right_hist = base_bar.encode(
alt.Y("y:Q").bin(maxbins=30, extent=yscale.domain).stack(None).title(""),
alt.X("count()").stack(None).title(""),
alt.Color("color:N"),
).properties(width=60)

out = top_hist & (points | right_hist)

Expand Down
22 changes: 0 additions & 22 deletions docs/assets/ConnectedDataExplorerComponent-FS-m-lCY.js

This file was deleted.

11 changes: 0 additions & 11 deletions docs/assets/VegaLite-D07JSyC_.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/__vite-browser-external-CIEyP2s7.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/_baseEach-DHNYGtOc.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/_baseMap-BXW0_SVK.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/_baseUniq-BlNMZyiw.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/_createAggregator-ReXtltZy.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/any-language-editor-v6ntzTrV.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/apl-CXdQSnD-.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/arc-Cuwikxov.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/assets/architectureDiagram-IEHRJDOE-DJyOE9c0.js

This file was deleted.

Loading