Multiple pages
Datapane allows you to add multiple pages to a report as follows:
1
import altair as alt
2
from vega_datasets import data
3
import datapane as dp
4
5
source = data.cars()
6
7
plot = alt.Chart(source).mark_circle(size=60).encode(
8
x='Horsepower',
9
y='Miles_per_Gallon',
10
tooltip=['Name', 'Horsepower', 'Miles_per_Gallon']
11
).interactive()
12
13
report = dp.Report(
14
dp.Page(
15
dp.Text("This report explains how to add multiple pages. ![](https://images.unsplash.com/photo-1551288049-bebda4e38f71?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1470&q=80)"),
16
title = "Introduction"),
17
dp.Page(
18
dp.Plot(plot),
19
title = "Chart"
20
),
21
dp.Page(
22
dp.DataTable(source),
23
title = "Data"
24
)
25
)
26
27
report.upload(name="Multi-page report")
Copied!
Running that code generates the following report:
Last modified 2mo ago
Copy link