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

Examples README #738

Merged
merged 4 commits into from
Feb 9, 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
34 changes: 17 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,41 +24,41 @@ jobs:
'examples/*/yarn.lock'
- run: yarn --frozen-lockfile
- run: yarn build
- name: Build example "api"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/api
- name: Build example "chess"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/chess
- name: Build example "eia"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/eia
env:
EIA_KEY: ${{ secrets.EIA_KEY }}
- name: Build example "google-analytics"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/google-analytics
env:
GA_PROPERTY_ID: ${{ vars.GA_PROPERTY_ID }}
GA_CLIENT_EMAIL: ${{ secrets.GA_CLIENT_EMAIL }}
GA_PRIVATE_KEY: ${{ secrets.GA_PRIVATE_KEY }}
- name: Build example "eia"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/eia
env:
EIA_KEY: ${{ secrets.EIA_KEY }}
- name: Build example "hello-world"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/hello-world
- name: Build example "plot"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/plot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build example "pmms"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/pmms
- name: Build example "api"
- name: Build example "mortgage-rates"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/api
- name: Build example "python"
working-directory: examples/mortgage-rates
- name: Build example "penguin-classification"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
yarn --frozen-lockfile && yarn build
working-directory: examples/python
working-directory: examples/penguin-classification
- name: Build example "plot"
run: yarn --frozen-lockfile && yarn build
working-directory: examples/plot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: mkdir dist/examples && for i in examples/*; do if [ -d $i/dist ]; then mv -v $i/dist dist/examples/$(basename $i); fi; done
- uses: cloudflare/pages-action@1
with:
Expand Down
14 changes: 14 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Observable Framework examples

*First:* [Get started with Observable Framework](https://observablehq.com/framework/getting-started)

*This repository shows different flavors and features of what you can build with Framework:*

- **API** — Millions of API requests, stored in Arrow format, are analyzed in a report. [[code](./api)] [[live project](https://observablehq.com/framework/examples/api/)]
- **Chess** — A data loader that retrieves several large zip files from the FIDE, extracts information about the top 10 players, and displays a rank chart. [[code](./chess)] [[live project](https://observablehq.com/framework/examples/chess/)]
- **EIA** — JavaScript data loaders retrieve hourly data from the U.S. Energy Information Administration API to produce a map and time series charts. [[code](./eia)] [[live project](https://observablehq.com/framework/examples/eia/)]
- **Google analytics** — Load data from the G.A. API and analyze your website’s traffic. [[code](./google-analytics)] [[live project](https://observablehq.com/framework/examples/google-analytics/)]
- **Hello, world!** — A minimal test. [[code](./hello-world)] [[live project](https://observablehq.com/framework/examples/hello-world/)]
- **Plot** — TypeScript data loaders that access metadata from the Observable Plot Github repo. [[code](./plot)] [[live project](https://observablehq.com/framework/examples/plot/)]
- **Mortgage rates** — A small dashboard reproducing Freddie Mac’s historic mortgage rates dashboard. [[code](./mortgage-rates)] [[live project](https://observablehq.com/framework/examples/mortgage-rates/)]
- **Penguin classification** — In a Python data loader, we use logistic regression to predict penguin species based on body size measurements. [[code](./penguin-classification)] [[live project](https://observablehq.com/framework/examples/penguin-classification/)]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
toc: false
---

# Classification prediction
# Penguin classification

```js
const predictions = FileAttachment("data/predictions.csv").csv({typed: true});
Expand Down