Feature Description
I notice that you do some of the lifting to get matplotlib charts to work via JS in each rendered page:
// Load the `matplotlib` package with necessary environment hook
await mainPyodide.loadPackage("matplotlib");
// Set the backend for matplotlib to be interactive.
await mainPyodide.runPythonAsync(`
import matplotlib
matplotlib.use("module://matplotlib_pyodide.html5_canvas_backend")
from matplotlib import pyplot as plt
`);
I wonder if it would also be useful to allow config either globally or locally that would allow a user to specify in header or _quarto.yml things like:
which would create something like:
await mainPyodide.loadPackage("pandas");
or optionally something like:
- pyodide-pip
- pandas, ["import pandas as pd", "pd.options.display.max_rows = 5"]
to generate:
await mainPyodide.loadPackage("pandas");
await mainPyodide.runPythonAsync(`
import pandas as pd
pd.options.display.max_rows = 5
`);
Alternatively, keep pyodide-pip as a simple list and then allow:
- pyodide-init
- import pandas as pd
- pd.options.display.max_rows = 5
- etc
Feature Description
I notice that you do some of the lifting to get
matplotlibcharts to work via JS in each rendered page:I wonder if it would also be useful to allow config either globally or locally that would allow a user to specify in header or
_quarto.ymlthings like:which would create something like:
await mainPyodide.loadPackage("pandas");or optionally something like:
to generate:
Alternatively, keep
pyodide-pipas a simple list and then allow: