Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for mdx instead of markdown #7376

Open
arindampradhan opened this issue May 18, 2024 · 1 comment
Open

Support for mdx instead of markdown #7376

arindampradhan opened this issue May 18, 2024 · 1 comment

Comments

@arindampradhan
Copy link

arindampradhan commented May 18, 2024

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.
@arindampradhan arindampradhan added enhancement status:Needs Triage Applied to issues that need triage labels May 18, 2024
@RRosio
Copy link
Collaborator

RRosio commented May 21, 2024

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.

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

No branches or pull requests

2 participants