Code
Sample data:
| Category | Count | |
|---|---|---|
| 0 | Geospatial | 15 |
| 1 | Data Science | 12 |
| 2 | Python | 20 |
| 3 | Visualization | 8 |
This example demonstrates how Quarto notebooks work on hosted websites:
This notebook includes the following execution settings (see raw metadata above):
eval: true - Execute code during buildecho: true - Show source codewarning: false - Hide warningscache: true - Cache results for faster rebuildscode-fold: show - Code is visible but can be collapsedcode-tools: true - Adds download source buttonSample data:
| Category | Count | |
|---|---|---|
| 0 | Geospatial | 15 |
| 1 | Data Science | 12 |
| 2 | Python | 20 |
| 3 | Visualization | 8 |
Replace this notebook with your own content or delete this example directory.
When you run quarto render or quarto publish:
For truly executable Python in the browser, you’d need solutions like JupyterLite or Pyodide integration (advanced setup).
# Example with Plotly - remains interactive after hosting
# Uncomment to use (requires: pip install plotly)
import plotly.express as px
import plotly.io as pio
# Set renderer for notebook/HTML output
pio.renderers.default = "notebook"
fig = px.bar(df, x='Category', y='Count',
title='Interactive Bar Chart (Try hovering!)',
color='Count')
fig.show()
# Other interactive widget libraries that work well:
# - plotly (charts and graphs)
# - folium (maps)
# - ipyleaflet (geospatial maps)
# - bokeh (visualizations)For true interactivity after hosting, use JavaScript-based widgets like Plotly. These remain interactive in the browser without re-executing Python code.