-
Notifications
You must be signed in to change notification settings - Fork 858
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
344 additions
and
94 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
title: "Gapminder: Development Indicators by Continent" | ||
format: | ||
dashboard: | ||
orientation: columns | ||
--- | ||
|
||
```{python} | ||
import plotly.express as px | ||
df = px.data.gapminder() | ||
``` | ||
|
||
## Column | ||
|
||
```{python} | ||
#| title: Population | ||
px.area(df, x="year", y="pop", color="continent", | ||
line_group="country") | ||
``` | ||
|
||
|
||
```{python} | ||
#| title: Life Expectancy | ||
px.line(df, x="year", y="lifeExp", color="continent", | ||
line_group="country") | ||
``` | ||
|
||
::: {.card .flow} | ||
|
||
Gapminder combines data from multiple sources into | ||
unique coherent time-series that can’t be found | ||
elsewhere. Learn more about the Gampminder dataset at | ||
<https://www.gapminder.org/data/>. | ||
|
||
::: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: "Leaflet" | ||
format: dashboard | ||
--- | ||
|
||
|
||
```{python} | ||
from ipyleaflet import Map, basemaps, basemap_to_tiles | ||
Map(basemap=basemap_to_tiles(basemaps.OpenStreetMap.Mapnik), | ||
center=(48.204793, 350.121558), zoom=2) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,48 @@ | ||
--- | ||
title: "Value Boxes" | ||
format: dashboard | ||
engine: knitr | ||
--- | ||
|
||
## Row | ||
|
||
::: {.valuebox icon="facebook" title="Foo" color="primary"} | ||
42 | ||
|
||
Text below | ||
::: | ||
|
||
::: {.valuebox icon="google" color="primary"} | ||
Foo | ||
|
||
100 | ||
::: | ||
|
||
::: {.valuebox color="primary"} | ||
|
||
50 | ||
::: | ||
|
||
|
||
## Row | ||
|
||
```{r} | ||
spam = 50 | ||
``` | ||
|
||
```{python} | ||
#| component: valuebox | ||
dict( | ||
value = 22, | ||
color = "secondary" | ||
) | ||
articles = 45 | ||
comments = 126 | ||
``` | ||
|
||
## Row | ||
|
||
```{python} | ||
#| component: valuebox | ||
#| color: primary | ||
#| title: "Articles per day" | ||
#| icon: pencil | ||
#| color: blue | ||
33 | ||
articles | ||
``` | ||
|
||
|
||
```{python} | ||
#| component: valuebox | ||
#| title: "Comments per day" | ||
dict( | ||
value = 44, | ||
color = "secondary" | ||
icon = "pencil", | ||
color = "blue", | ||
value = comments | ||
) | ||
``` | ||
|
||
```{r} | ||
#| component: valuebox | ||
#| title: "Spam per day" | ||
## Row | ||
|
||
|
||
```{python} | ||
import numpy as np | ||
import matplotlib.pyplot as plt | ||
r = np.arange(0, 2, 0.01) | ||
theta = 2 * np.pi * r | ||
fig, ax = plt.subplots( | ||
subplot_kw = {'projection': 'polar'} | ||
list( | ||
icon = "trash", | ||
color = "orange", | ||
value = spam | ||
) | ||
ax.plot(theta, r) | ||
ax.set_rticks([0.5, 1, 1.5, 2]) | ||
ax.grid(True) | ||
plt.show() | ||
``` | ||
``` | ||
|
Oops, something went wrong.