Giter VIP home page Giter VIP logo

Comments (4)

mwouts avatar mwouts commented on August 25, 2024 1

Hi @iainmwallace , thanks for suggesting this. I think it should be doable to make itables work in the context of a Shiny app.

Some developments would be required on our end because py-shiny does not seem to be directly compatible with the display function of IPython. At the current stage of development of py-shiny, the render.table decorator calls explicitely df.to_html
https://github.com/rstudio/py-shiny/blob/2655fb487412881d7a946f7b8db41f9746a85678/shiny/render/_render.py#L526. This is different to how itables currently works in notebooks, where we just override pd.DataFrame._repr_html_, cf.

pd.DataFrame._repr_html_ = _datatables_repr_

Before undertaking any such development, let me ask to the py-shiny developers whether they would consider supporting outputs coming from IPython.display calls.

from itables.

iainmwallace avatar iainmwallace commented on August 25, 2024 1

Fantastic, thanks @mwouts. The examples you posted on the other issue are really useful.

from itables.

mwouts avatar mwouts commented on August 25, 2024

I have been able to display a dataframe as an interactive datatable in a Shiny app with just ui.HTML(DT(df)), where DT is defined as

from itables.javascript import _datatables_repr_ as DT

See this comment for the full example (I am not sure at the moment if this is a sound approach!)

from itables.

mwouts avatar mwouts commented on August 25, 2024

Up-to-date tested examples are available at https://github.com/mwouts/itables/tree/main/tests/sample_python_apps

from itables.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.