mathbox icon indicating copy to clipboard operation
mathbox copied to clipboard

Update the jupyter notebook example to use current version

Open ChristopherChudzicki opened this issue 2 years ago • 4 comments

See discussion in https://github.com/unconed/mathbox/pull/17

ChristopherChudzicki avatar Apr 02 '22 16:04 ChristopherChudzicki

Spent some time debugging this issue, and here are a few findings:

  • the original mathbox-bundle used in the example notebook was not UMD, and had both THREE and other examples (controls) bundled together, so that needs to be re-created here
  • searching the web, it seems that loading a UMD-style module (latest mathbox) in an AMD (requirejs in jupyter) environment will run into issues - see here

I tested vanilla THREE setup with OrbitControls and make it work independently in a notebook - happy to add that if there's interest. For now, this is just stuck on the module incompatibility, and I can't seem to find any obvious workarounds.

Creating an old-style bundle just for this use-case is probably unnecessary, so not quite sure where to go from here @sritchie / @ChristopherChudzicki

divisuals avatar Mar 28 '23 17:03 divisuals

Another related update - when I tried to use the library in another AMD/require environment (ObservableHQ), the UMD bundle isn't looking usable. Public notebook here has more details - re-capturing the summary:

Attempts to import new mathbox bundles (v2.3.1) fail so far. Even the helper notebook fails for all combinations! https://observablehq.com/@observablehq/module-require-debugger Library needs a few fixes - possibly similar problems encountered here, and a possible webpack resolution

For now, added older examples in this collection using similar structure from the Jupyter notebook

divisuals avatar Mar 29 '23 16:03 divisuals

Thank you for digging into these issues! I am swamped with some work that uses this code, so I won't have time to get to these for a while. Hopefully that is not a blocker on anything you're doing. I think it's important to get this fixed and to get that readback example working, eventually, so thank you again.

sritchie avatar Apr 04 '23 16:04 sritchie

Happy to help!

Having a cleaner webpack bundle would help but this isn't blocking my downstream experiments as I'm using (ESM) source directly. I will definitely raise issues/ pull requests for any urgent blockers. Thanks

divisuals avatar Apr 09 '23 19:04 divisuals