Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp/Add onto existing snippet examples #3602

Open
Haleshot opened this issue Jan 28, 2025 · 1 comment · May be fixed by #3743
Open

Revamp/Add onto existing snippet examples #3602

Haleshot opened this issue Jan 28, 2025 · 1 comment · May be fixed by #3743
Labels
enhancement New feature or request

Comments

@Haleshot
Copy link
Contributor

Haleshot commented Jan 28, 2025

Description

Improve existing snippet examples with support for interactive libraries like Plotly (which has explicit marimo support), HoloViews, leafmap, Pygwalker & Polars + SQL, etc. + popular data-science/engineering related snippets (dataframe-related/EDA-related).

Add a relevant docs page for snippets in general, existing support for loading custom snippets as introduced in this PR.

Reorganize/revamp the Club each of the snippets under their appropriate headings; pandas comes under the collapsible pandas heading, etc.

I intend to submit a PR for this issue.

Suggested solution

Will research well, short snippets in relation to the above.

Alternative

No response

Additional context

No response

@Haleshot Haleshot added the enhancement New feature or request label Jan 28, 2025
@Haleshot
Copy link
Contributor Author

Good place to add snippets docs here: https://docs.marimo.io/guides/editor_features/ ?
Seems to be appropriate.

mscolnick added a commit that referenced this issue Feb 14, 2025
)

## 📝 Summary

This PR (1/2) adds data visualization and manipulation snippets for
common DS libraries; relevant issue #3602. The snippets cover Pandas
(add to existing list), Polars, DuckDB, Altair (add to existing list),
and Matplotlib, aiding in what I believe is common (_"boilerplate"_)
coding lines for data analysis/engineering projects/workflows in
notebooks.

## 🔍 Description of Changes

<details>
<summary>Pandas Snippets (26-36)</summary>

| Category | Snippets |
|----------|----------|
| Core Operations | Memory Optimization, Data Types |
| Data Transformation | Pivot Tables, Reshaping, Merging |
| Time Series | Window Operations, DateTime Features |
| Analysis | Groupby, Aggregations, Boolean Filtering |

Key additions include memory optimization, efficient window operations,
and advanced datetime handling.
</details>

<details>
<summary>Polars Snippets (0-10)</summary>

| Category | Key Features |
|-----------|-------------|
| Core Operations | Lazy evaluation, joins, grouping |
| Performance | Memory optimization, efficient IO |
| Data Types | String ops, timestamps, categoricals |
| Analytics | Stats, window functions |

Focuses on high-performance data operations with lazy evaluation
patterns.
</details>

<details>
<summary>Altair Snippets (9-14)</summary>

| Category | Features |
|----------|----------|
| Basic Charts | Scatter, bar, histogram |
| Interactivity | Brushing, linking, filtering |
| Statistical Viz | Box plots, distributions |
| Multi-View | Faceting, dashboards |

Emphasizes interactive visualizations and statistical graphics.
</details>

<details>
<summary>Matplotlib Snippets (0-11)</summary>

| Category | Components |
|----------|------------|
| Basic Plotting | Line, scatter, histograms |
| Layout | Subplots, gridspec |
| Styling | Themes, annotations |
| Scientific Viz | Error bars, 3D plots |

Covers essential scientific visualization patterns.
</details>

_Note: This is part 1 of 2 PRs focused on enhancing existing snippets
sidebar panel._

## 📋 Checklist

- [x] I have read the [contributor
guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md).
- [ ] For large changes, or changes that affect the public API: this
change was discussed or approved through an issue, on
[Discord](https://marimo.io/discord?ref=pr), or the community
[discussions](https://github.com/marimo-team/marimo/discussions) (Please
provide a link if applicable).
- [ ] I have added tests for the changes made.
- [x] I have run the code and verified that it works as expected.

## 📜 Reviewers

@akshayka OR @mscolnick

---------

Co-authored-by: Akshay Agrawal <akshaykagrawal7@gmail.com>
Co-authored-by: Myles Scolnick <myles@marimo.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant