DonJayamanne / typescript-notebook

Run JavaScript and TypeScript in node.js within VS Code notebooks with excellent support for debugging, tensorflowjs visulizations, plotly, danfojs, etc
https://marketplace.visualstudio.com/items?itemName=donjayamanne.typescript-notebook
MIT License
905 stars 40 forks source link

Add support for arquero #22

Closed DonJayamanne closed 3 years ago

DonJayamanne commented 3 years ago

https://github.com/uwdata/arquero

DonJayamanne commented 3 years ago

Should be able to get this in by tomorrow, was too easy. Screenshot from 2021-09-05 22-28-59 Screenshot from 2021-09-05 22-29-22

DonJayamanne commented 3 years ago

Automatically detect arquero tables & display HTML view Screenshot from 2021-09-05 23-03-32

DonJayamanne commented 3 years ago

@RandomFractals /cc

RandomFractals commented 3 years ago

This is very cool. I see you even managed to get arrow data loader working in that example with arrow data display.

Impressive and thank you for adding that data transformation library support. I think it's way better and more versatile than others I've seen that attempt to do similar things in JS.

RandomFractals commented 3 years ago

The one note I have about this setup, I think it would be better if JS libraries that are automatically imported still have qualifiers.

Then we don't have to implicitly import arquero, but in order to use it, we'd have to specify we want to use aq. in our JS/TS code cells.

I believe that would help you parse those code cells and dynamically import the required libraries for those common data and charts libraries to function. In essence, it would be very similar to what ObservableHQ does to speed up JS Notebooks development:

https://observablehq.com/@observablehq/stdlib?collection=@observablehq/introduction#additionalLibrariesSection

DonJayamanne commented 3 years ago

think it would be better if JS libraries that are automatically imported still have qualifiers.

Not sure what your mean by this. Are you suggesting I create a global variable aq and make it available for all notebooks and have it point to arquero? If that's the suggestion, then I'm not a fan of that. This is a node.js notebook, idea can write any node.js code.

Users can always write const aq = require('arquero') or import * as aq from 'arquero'

DonJayamanne commented 3 years ago

I think we can make that possible via some other mechanism, such as templates or some settings to always automatically import some motors. A template seems much better, this way the cell with the imports can be at the top and collapsed.

DonJayamanne commented 3 years ago

Basically I'll let users use renderers like yours & they'll work very well. Else I end up re-inventing the wheel and users are locked to a specific extension as I (notebook provider) control the mime type.

@RandomFractals I'm closing this issue for now, as this was originally created to support arquero. Please feel free to create a separate issue if you have other suggestions, you might be interested in the issue for observable notebooks/inspector.

RandomFractals commented 3 years ago

agreed. I am not a huge fan of globals either, and I see how that would restrict node.js notebooks to be used only with your kernel.

The less customizations you add the better. I am all for reusing and creating more rich renderers.

Exploring templates based on some common use cases is a good idea and we should probably create some as part of renderers with examples I started building or in this extension later.

Thanks for adding arquero support. This opens many doors for massaging data in JS notebooks.