Reports are comprised of multiple Blocks, which wrap up Python objects, such as Pandas DataFrames, Visualisations, and Markdown. Datapane also includes layout blocks to add tabs, pages, and interactive selects to your reports.
We are always adding new components, and if you have some ideas on what you would like to use in your reports, please start a discussion on GitHub.
In this section we describe the Block types and provide examples. More detailed API usage can be found in our API docs.
If you pass your Python object into your without wrapping it in a specific block component, Datapane will try and automatically choose the best block type.
Datapane has three types of reports, which dictate sizing and layout:
Report: medium width and margins, optimized for mixed content
Article: small width and large margins, optimized for long-form text
Dashboard: full-width with no margins, optimized for grid layout and visualizations
The default type is report, and you can choose other types when you create your report as follows:
import datapane as dp​# Create a report (default)dp.Report(..., type=dp.ReportType.REPORT)​# Create a dashboarddp.Report(..., type=dp.ReportType.DASHBOARD)​# Create an articledp.Report(..., type=dp.ReportType.ARTICLE)
As well as explicitly specifying your block type (for instance, by using dp.Plot
), Datapane will try and choose the best block for your object if you pass it in directly, for instance as follows:
import datapane as dpimport pandas as pd​d = {'col1': [1, 2], 'col2': [3, 4]}df = pd.DataFrame(data=d)​dp.Report(df,"This is text")
The defaults are as follows:
Object Type | Datapane Block |
pandas DataFrame |
|
string |
|
Altair |
|
Bokeh |
|
Folium |
|
Matplotlib / Seaborn |
|
Plotly |
|