Simple one-pager
If you only have a single dataframe and a couple of charts, you can wrap them inside a Datapane report as follows:
1
import datapane as dp
2
import altair as alt
3
from vega_datasets import data
4
5
source = data.cars()
6
7
plot1 = alt.Chart(source).mark_circle(size=60).encode(
8
x='Horsepower',
9
y='Miles_per_Gallon',
10
color='Origin',
11
tooltip=['Name', 'Origin', 'Horsepower', 'Miles_per_Gallon']
12
).interactive()
13
14
15
report = dp.Report(
16
dp.Text("## Simple Datapane Report with plot and table"),
17
dp.Plot(plot1),
18
dp.DataTable(source)
19
)
20
21
report.upload(name="Hello world")
Copied!
Running that code generates the following report:
Last modified 2mo ago
Copy link