Skip to content

Support for mdx instead of markdown #7376

Open

Description

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

  • Add frontend tooling like vite
  • Add vite-mdx
  • Support for a data connecter through socket to pass data from python to mdx files as variables
    • globals as common variable to pass data as json
    • from python dictionary it can easily be converted to javascript object
    • which is what is needed in most of the charting library in react

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

No tasks being tracked yet.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions