Skip to content

Commit dc6d5de

Browse files
allisonhorstAllison Horst
andauthored
update example readmes (#741)
Co-authored-by: Allison Horst <ahorst@ucsb.edu>
1 parent 0fc1f3d commit dc6d5de

File tree

9 files changed

+54
-12
lines changed

9 files changed

+54
-12
lines changed

examples/api/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This is an example Observable Framework project. It uses API logs data collected from [observablehq.com](observablehq.com), and visualizes them as heatmaps, histograms and bar charts.
44

5+
View the [live project](https://observablehq.com/framework/examples/api/).
6+
57
## Data loaders
68

79
The datasets used are static snapshots. We use an [Apache Arrow](https://arrow.apache.org/) file to handle the large number of API logs.

examples/chess/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Chess
2+
3+
This page displays chess rankings from the [International Chess Federation](http://ratings.fide.com/) for the past year.
4+
5+
View the [live project](https://observablehq.com/framework/examples/chess/).
6+
7+
## Data loaders
8+
9+
A single JavaScript data loader, `top-ranked-players.json.js`, accesses the data (in a Zip archive) from the site above, performs some basic wrangling, and writes the simplified snapshot of rankings in JSON format to standard out.
10+
11+
## Charts
12+
13+
Bump charts are made with [Observable Plot](https://observablehq.com/plot/), and highlight changes in ratings for the top Women’s and Men’s chess players over time.

examples/chess/docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ function bumpChart(data, width) {
117117

118118
<div class="grid">
119119
<div class="card">
120-
<h1>Womens</h1>
120+
<h1>Women’s</h1>
121121
${resize((width) => bumpChart(womens, width))}
122122
</div>
123123
<div class="card">
124-
<h1>Mens</h1>
124+
<h1>Men’s</h1>
125125
${resize((width) => bumpChart(mens, width))}
126126
</div>
127127
</div>

examples/eia/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ This is an example Observable Framework project, based on parts of the US Energy
44

55
Visit <a href="https://www.eia.gov/electricity/gridmonitor/about">About the EIA-930 data</a> to learn more about data collection and quality, the US electric grid, and balancing authorities responsible for nationwide electricity interchange.
66

7+
View the [live project](https://observablehq.com/framework/examples/eia/).
8+
79
Move the time slider above the map to see how the “[duck curve](https://en.wikipedia.org/wiki/Duck_curve)” of electricity demand varies during the day in different regions, with greater demand in before- and after-work hours, and lower demand during typical working hours.
810

911
## Data loaders

examples/google-analytics/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This dashboard tracks data from Google Analytics using the [Google Analytics Data API](https://developers.google.com/analytics/devguides/reporting/data/v1/quickstart-client-libraries). It contains a single page in `docs/index.md`.
44

5+
View the [live project](https://observablehq.com/framework/examples/google-analytics/).
6+
57
## Data loaders
68

79
To connect the data loaders to the Analytics API, you will need to set up a `.env` file at the root of this directory with three variables:
@@ -18,4 +20,4 @@ The Google Analytics [API Quickstart](https://developers.google.com/analytics/de
1820

1921
## Charts
2022

21-
The dashboard displays a variety of charts, made with Observable Plot. With the key numbers at the top, a line chart or an area chart. Activity by country is represented by a choropleth map. Active users use a horizon chart, faceted by channel. The “new vs. returning” chart is a Marimekko. Finally, the activity by day and hour is a punchcard chart. The code for each of these charts is available in [docs/index.md](https://github.com/observablehq/framework/blob/main/examples/google-analytics/docs/index.md).
23+
The dashboard displays a variety of charts, made with [Observable Plot](https://observablehq.com/plot/). With the key numbers at the top, a line chart or an area chart. Activity by country is represented by a choropleth map. Active users use a horizon chart, faceted by channel. The “new vs. returning” chart is a Marimekko. Finally, the activity by day and hour is a punchcard chart. The code for each of these charts is available in [docs/index.md](https://github.com/observablehq/framework/blob/main/examples/google-analytics/docs/index.md).

examples/hello-world/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Hello, world!
22

33
This is a minimal example Observable Framework project. It contains a single page in `docs/index.md`, with no configuration file.
4+
5+
View the [live project](https://observablehq.com/framework/examples/hello-world/).

examples/mortgage-rates/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Mortage tracker
22

3-
This is an example Observable Framework project. It uses a data loader to track the mortage rates published by Freddie Mac — Federal Home Loan Mortgage Corporation — every week since 1971.
3+
This is an example Observable Framework project that tracks mortage rates published by Freddie Mac — Federal Home Loan Mortgage Corporation — every week since 1971.
4+
5+
View the [live project](https://observablehq.com/framework/examples/mortgage-rates/).
46

57
## Data loader
68

7-
The `docs/data/pmms.csv.ts` loader fetches the data from Freddie Mac’s website. The original dataset is a csv file, with several columns that we don’t need and the classic American date format (month/day/year). The data loader restructures this dataset a little, by minimizing it to three columns (date, in ISO format; 30-year rate; 15-year rate).
9+
A single TypeScript data loader `docs/data/pmms.csv.ts` fetches the data from Freddie Mac’s website. The original dataset is a csv file, with several columns that we don’t need and the classic American date format (month/day/year). The data loader restructures this dataset a little, by minimizing it to three columns (date, in ISO format; 30-year rate; 15-year rate).
810

911
## Charts
1012

11-
The cards and charts reinterpret the original elements of Freddie Mac’s [PMMS dashboard](https://www.freddiemac.com/pmms). We’re using Observable Plot to draw the charts. The chart code is simple enough to be directly inlined in the page’s markdown `docs/index.md`.
13+
The cards and charts reinterpret the original elements of Freddie Mac’s [PMMS dashboard](https://www.freddiemac.com/pmms). We use [Observable Plot](https://observablehq.com/plot/) to draw the charts. The chart code is simple enough to be directly inlined in the page’s markdown `docs/index.md`.
Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
1+
# Penguin classification
12

2-
- Homebrew install python3
3-
- Create virtual & activate environment
3+
This is an example Observable Framework project that uses logistic regression (performed in a Python data loader) to classify penguins by species, based on body mass measurements. Charts highlights and explore which penguins are misclassified. [Learn more](https://journal.r-project.org/articles/RJ-2022-020/) about the penguins dataset.
4+
5+
View the [live project](https://observablehq.com/framework/examples/penguin-classification/).
6+
7+
## Data loader
8+
9+
The Python [data loader](../../docs/loaders.md) `predictions.csv.py` reads in the `penguins.csv` file, then performs logistic regression using scikit-learn's [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) function.
10+
11+
## Charts
12+
13+
All charts are drawn with [Observable Plot](https://observablehq/com/plot).
14+
15+
## Reuse this example
16+
17+
Copy the contents of the `penguins-classification` directory into a new Observable Framework project. Then, run the following set up steps (as needed) get started:
18+
19+
- If needed, install python3
20+
- Create and activate a virtual environment
421
- `$ python3 -m venv .venv`
522
- `$ source .venv/bin/activate`
623
- Pip install modules from requirements.txt
724
- `$ pip install -r requirements.txt`
8-
- Run the CLI
25+
- Run and preview the page
926
- `$ yarn`
1027
- `$ yarn dev`
28+
- Make changes to the page (`index.md`) or data loader and save to see instant updates in the [live preview](https://observablehq.com/framework/getting-started#test-live-preview)
1129

12-
[Learn more about deploying with Github actions](https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#requirements-file) for Python 3.6 & requirements.txt
13-
30+
[Learn more about deploying with Github actions](https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#requirements-file) for Python 3.6 & `requirements.txt`.

examples/plot/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Tracking Observable Plot
22

3-
This dashboard tracks several metrics about the development and usage of [Observable Plot](https://observablehq.com/plot/). It contains a single page in [`docs/index.md`](./docs/index.md), with no configuration file.
3+
This is an example Observable Framework project that tracks several metrics about the development and usage of [Observable Plot](https://observablehq.com/plot/). It contains a single page in [`docs/index.md`](./docs/index.md), with no configuration file.
4+
5+
View the [live project](https://observablehq.com/framework/examples/plot/).
46

57
## Data loaders
68

0 commit comments

Comments
 (0)