Skip to content

Commit

Permalink
more component docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Oct 19, 2023
1 parent fb4c19b commit 6aadfeb
Show file tree
Hide file tree
Showing 13 changed files with 344 additions and 94 deletions.
Empty file.
35 changes: 35 additions & 0 deletions docs/dashboards/_examples/gapminder-content.qmd
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/>.

:::
1 change: 1 addition & 0 deletions docs/dashboards/_examples/gapminder-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions docs/dashboards/_examples/leaflet.qmd
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)
```
73 changes: 24 additions & 49 deletions docs/dashboards/_examples/valuebox.qmd
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()
```
```

Loading

0 comments on commit 6aadfeb

Please sign in to comment.