jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.37k stars 4.72k forks source link

Support for mdx instead of markdown #7376

Open arindampradhan opened 1 month ago

arindampradhan commented 1 month ago

Hi I need to render some react components which are already supported in mdx, it would be wonderful if I could pass data from python numpy to my react component in mdx in jypyter to render graphs

Problem

Integration with mdx: https://github.com/mdx-js/mdx

[py]

import numpy as np
import globals

data = np.array.rand(2,3)

globals.data = data

[mdx]

import {Chart} from './snowfall.js'
export const year = 2013

# Last year’s snowfall

In {year}, the snowfall was above average.
It was followed by a warm spring which caused
flood conditions in many of the nearby rivers.

<Chart year={year} data={global.data} color="#fcb32c" />

Proposed Solution

Additional context

JSX and react frontend has lot of charting tools like d3 which are very useful, it would be really helpful to show data from python exports to those frontend renders like mdx

### Tasks
RRosio commented 1 month ago

Thank you for opening this enhancement request @arindampradhan! This might be a good enhancement to begin with as an extension and have it move into core if there is overall consensus on doing so.