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

vendor penguins data #19

Merged
merged 4 commits into from
Oct 18, 2024
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
4 changes: 3 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
- name: Create Github Deployment
uses: bobheadxi/deployments@v0.4.3
id: deployment
if: ${{ !github.event.pull_request.head.repo.fork }}
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -52,6 +53,7 @@ jobs:
logs: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"

- name: Netlify docs preview
if: ${{ !github.event.pull_request.head.repo.fork }}
run: |
npm install -g netlify-cli
# push main branch to production, others to preview --
Expand All @@ -67,7 +69,7 @@ jobs:

- name: Update Github Deployment
uses: bobheadxi/deployments@v0.4.3
if: ${{ always() }}
if: ${{ !github.event.pull_request.head.repo.fork && always() }}
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 2 additions & 4 deletions docs/get-started/controls-click-actions.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ You can add cell click actions using the onClick argument, which accepts the fol
import htmltools
from reactable import Reactable, Column, JS, embed_css

from reactable.data import cars_93
from palmerpenguins import load_penguins
from reactable.data import cars_93, penguins
import polars as pl


embed_css()

penguins = load_penguins()
pl_penguins = pl.from_pandas(penguins)
pl_penguins = penguins.to_polars()
```


Expand Down
6 changes: 2 additions & 4 deletions docs/get-started/controls-filtering.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ title: Filtering

```{python}
from reactable import Reactable, Column, JS, embed_css
from reactable.data import cars_93
from reactable.data import cars_93, penguins

from palmerpenguins import load_penguins
import polars as pl

embed_css()

penguins = load_penguins()
pl_penguins = pl.from_pandas(penguins)
pl_penguins = penguins.to_polars()

cars = cars_93[:20, ["manufacturer", "model", "type", "air_bags", "price"]]
```
Expand Down
5 changes: 2 additions & 3 deletions docs/get-started/controls-sorting.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ jupyter: python3

```{python}
from reactable import Reactable, Column, embed_css
from reactable.data import penguins

from palmerpenguins import load_penguins
import polars as pl


embed_css()

penguins = load_penguins()
pl_penguins = pl.from_pandas(penguins)
pl_penguins = penguins.to_polars()
```

Tables are sortable by default. You can sort a column by clicking on its header, or sort multiple columns by holding the shift key while sorting.
Expand Down
5 changes: 2 additions & 3 deletions docs/get-started/structure-column-groups.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ title: Column headers
import polars as pl

from reactable import Reactable, Column, ColGroup, embed_css
from palmerpenguins import load_penguins
from reactable.data import penguins

penguins = load_penguins()
pl_penguins = pl.from_pandas(penguins)
pl_penguins = penguins.to_polars()

embed_css()
```
Expand Down
5 changes: 2 additions & 3 deletions docs/get-started/structure-details.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ title: Expandable details

```{python}
from reactable import Reactable, Column, ColFormat, JS, embed_css
from reactable.data import penguins

from palmerpenguins import load_penguins
import polars as pl


embed_css()

penguins = load_penguins()
pl_penguins = pl.from_pandas(penguins)
pl_penguins = penguins.to_polars()
```

You can make rows expandable with additional content through details, which takes an Python or JavaScript render function. See [Custom Rendering](./format-custom-rendering.qmd) for details on how to use render functions.
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ dependencies = [
"IPython",
"importlib-metadata",
"importlib-resources",
"palmerpenguins",
"typing_extensions>=3.10.0.0",
]
requires-python = ">=3.9"
Expand Down
12 changes: 12 additions & 0 deletions reactable/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"cars_93",
"co2",
"nottem",
"penguins",
"prices",
"sleep",
"starwars",
Expand Down Expand Up @@ -53,6 +54,17 @@
)
)

penguins = SimpleFrame.read_csv(BIG_DATA / "penguins.csv").cast(
dict(
bill_length_mm=float,
bill_depth_mm=float,
flipper_length_mm=float,
body_mass_g=float,
year=int,
sex=str
),
na_char="NA"
)

prices = SimpleFrame.from_dict(
{
Expand Down
Loading
Loading