rustworkx icon indicating copy to clipboard operation
rustworkx copied to clipboard

Add interactive playground for users to try rustworkx

Open IvanIsCoding opened this issue 9 months ago • 5 comments

Follow up combining #1420 and the wheels built on #1449. Edit: the diff is now smaller; of course we still depend on #1449 to add the code that built the wheel

This PR:

  • Introduces jupyterlite-sphinx and jupyterlite-pyodide-kernel as dependencies
  • Creates a playground page with rustworkx, users can run it in the browser
  • The playground uses Pyodide from a CDN, Jupyterlite assets (around 16MB), and a rustworkx wheel that is checked into the git repository

IvanIsCoding avatar May 19 '25 20:05 IvanIsCoding

Here's a look at the preview: Playground_Preview

We could come with more ideas for the demo to auto-execute. Moreover, we could start adding more interactive snippets throughout the documentation

IvanIsCoding avatar May 19 '25 20:05 IvanIsCoding

Pull Request Test Coverage Report for Build 18793201117

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 94.186%

Totals Coverage Status
Change from base Build 18781234584: 0.0%
Covered Lines: 18272
Relevant Lines: 19400

💛 - Coveralls

coveralls avatar May 19 '25 20:05 coveralls

I updated the demo to plot the Petersen Graph. It showcases our functionalities a little bit more.

Petersen_Graph_Demo

IvanIsCoding avatar May 20 '25 02:05 IvanIsCoding

Here's a look at the preview: Playground_Preview

We could come with more ideas for the demo to auto-execute. Moreover, we could start adding more interactive snippets throughout the documentation

I reverted to this state to keep the playground cleaner.

I think we could add an interactive Matplotlib section in a seaparate place. Maybe we could even have a page that interacts with Graphviz via https://www.npmjs.com/package/@hpcc-js/wasm-graphviz + Pyodide.

IvanIsCoding avatar May 30 '25 02:05 IvanIsCoding

This is not ready yet, but upon thinking:

  • I will try to make this depend on #1449
  • There will be an environment variable: if the variable is set, we enable the interactive playground. If it is not, we ignore the page and jupyterlite-sphinx
  • For deployment to rustworkx.org and rustworkx.org/dev, we'll need to chain the Pixi workflow to the docs. Essentially, it will first build the WASM extension and then publish the docs

This way, we can avoid manually having to update the binary. We also won't have to check it in our Git tree.

IvanIsCoding avatar Oct 24 '25 22:10 IvanIsCoding