PySheets / pysheets

Source for PySheets
Other
120 stars 7 forks source link

Instructions on how to use with angular #124

Open AbdealiLoKo opened 3 weeks ago

AbdealiLoKo commented 3 weeks ago

Hi wanted to try this out with an angular application I was creating to showcase some analytics with plotly.

Any instructions on how to use pysheets with angular / react kind of frameworks ?

laffra commented 3 weeks ago

PySheets is rendered as a top-level application needing to bootstrap PyScript, PyOdide, WASM, etc. I am not sure what kind of integration you have in mind as you mention plotly as well as Angluar.

The simplest integration would be to include an iframe in your existing Angular/React application and embed PySheets that way.

You can also host just one of the resulting charts or previews from a given PySheets sheet. I did that for a given sheet and used the context menu to copy the image. In PySheets, chart previews as loaded as a data URL:

image

But, maybe you can explain what kind of integration you have in mind specifically.

AbdealiLoKo commented 3 weeks ago

Hmm, I have an app similar to chartstudio where I was asking users to enter some data on the left. And based on that show some analysis on the right.

Today I use aggrid, but it doesn't give a nice excel feel.

So I was hoping to render a Excel like pysheets on the left and have a 'onChange' hook that allows me to render my own dashboard and analysis on the right based on the user provided data.

From your comment, it seems like to do something similar I would need to redo my right side analytics dashboard inside pysheets ?

laffra commented 1 week ago

That is definitely possible and can be done from within your sheet. This is what the Chess example does. The cell function modifies the Sheet's UI in that way. If you want to reuse your sidebar code in multiple sheets, you could publish it on PyPI and then import the package in each sheet you want to use the dashboard. This would be a very nice application of PySheets.