Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Dash interactive plots #2245

Open
1 of 7 tasks
mjpan opened this issue Nov 14, 2024 · 10 comments
Open
1 of 7 tasks

Support for Dash interactive plots #2245

mjpan opened this issue Nov 14, 2024 · 10 comments
Labels
💬 Discussion Requires some discussion and decision 🖰 GUI Related to GUI ✨New feature

Comments

@mjpan
Copy link

mjpan commented Nov 14, 2024

Description

Taipy supports Plotly already. however the charts are static. it would be great to support Dash objects, so that the charts can be interactive

Solution Proposed

it would be great to support Dash objects, so that the charts can be interactive

Acceptance Criteria

  • If applicable, a new demo code is provided to show the new feature in action.
  • Integration tests exhibiting how the functionality works are added.
  • Any new code is covered by a unit tested.
  • Check code coverage is at least 90%.
  • Related issue(s) in taipy-doc are created for documentation and Release Notes are updated.

Code of Conduct

  • I have checked the existing issues.
  • I am willing to work on this issue (optional)
@FlorianJacta
Copy link
Member

What do you mean by charts not being interactive in Taipy?

@jrobinAV
Copy link
Member

Hi @mjpan,

You can have an example of a slider controlling a chart in the getting started.

You can also have more advanced examples in the documentation page .

Cheers,

@jrobinAV
Copy link
Member

FYI,
#2059

@mjpan
Copy link
Author

mjpan commented Nov 17, 2024

I should be more specific. for my immediate need, what I would like is to have interactive table functionality and customizations, in the way that Dash DataTable allows. for example, I would like to define a custom sort for the table. that does not seem possible right now with either Taipy table, or Plotly table.

separately, from a broader perspective, it seems to make sense if generally, Dash plots were available.

@FlorianJacta
Copy link
Member

How is this not possible through Taipy? Any table can be sorted as you would like within Taipy. Do you have a document example from Dash so I can better understand what you are talking about?

Would you like to see an example of how to do it in Taipy? Taipy is fully interactive in this sense

@FlorianJacta FlorianJacta added 🖰 GUI Related to GUI 💬 Discussion Requires some discussion and decision labels Nov 18, 2024
@mjpan
Copy link
Author

mjpan commented Nov 20, 2024

if it is possible to define a custom sorting of a column in a Taipy table, then perhaps what I am asking for is documentation on how to do that…

@FlorianJacta
Copy link
Member

If I get this right, you want this feature from Dash AG grid right?

Taipy does not allow you to create buttons inside the table to do this sorting. The solution is to have a button next to your table that allows you to sort your table as you'd like using Pandas. We only support basic built-in sorting capabilities for tables.

I am not sure we want to incorporate Dash tables to do so, as the syntax is very different from Taipy. The goal would be to add these features that you think is lacking inside Taipy. We have already provided most of the features that I can see in their documentation.

We support:

  • conditional formatting,
  • sorting/filtering/selecting/paging
  • tooltips
  • edition
  • dropdown inside tables

Custom sorting is not a feature we have built-in for pages.

For charts, we support interactive plots:

GIF

from taipy.gui import Gui
import taipy.gui.builder as tgb
from math import cos, exp

value = 10

def compute_data(decay:int)->list:
    return [cos(i/6) * exp(-i*decay/600) for i in range(100)]

def slider_moved(state):
    state.data = compute_data(state.value)

with tgb.Page() as page:
    tgb.text(value="# Taipy Getting Started", mode="md")
    tgb.text(value="Value: {value}")
    tgb.slider(value="{value}", on_change=slider_moved)
    tgb.chart(data="{data}")

data = compute_data(value)

if __name__ == "__main__":
    Gui(page=page).run(title="Dynamic chart")

You can also get the selection you create on your charts like in this application:

https://covid-dashboard.taipy.cloud/Map

image

Could you list the features that you find useful and a link to some documentation if it exists? We will then be very happy to fulfill your needs if we can!

@mjpan
Copy link
Author

mjpan commented Nov 22, 2024

That's right -- I'd like to have the custom sorting feature in Dash AG Grid, and a lot of other features also look really nice, and thats because the team behind AG Grid has invested a lot of effort

At this point, it sounds like a philosophical topic of what Taipy should be. Does Taipy enable new features one by one to work with existing components? Does Taipy enable developers to bring in externally developed components? Are those 2 options mutually exclusive?

@jrobinAV jrobinAV changed the title support for Dash interactive plots Support for Dash interactive plots Nov 22, 2024
@FlorianJacta
Copy link
Member

Could you list these features you would like to have?

You can also integrate Javascript libraries through the extension API. You can also integrate Python objects producing HTML like this example.

@mjpan
Copy link
Author

mjpan commented Nov 22, 2024

if we're talking about a wishlist, and not restricting to tables, another reason that I would love to see Taipy being able to incorporate Dash, is to enable dash-vtk. VTK is a robust framework for 3d visualization, heavily leveraged in medical research domains. here is the link to their gallery. https://dash.gallery/dash-vtk-tutorials/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💬 Discussion Requires some discussion and decision 🖰 GUI Related to GUI ✨New feature
Projects
None yet
Development

No branches or pull requests

3 participants