dash-table icon indicating copy to clipboard operation
dash-table copied to clipboard

Support for embedded Graphs in Table Cell

Open hottes opened this issue 7 years ago • 3 comments

Hi,

I'm trying to embed a dash-common-component graph inside the cell of a dash-table. I have tried to generate the graph data and then adding it to the dash-table row data via: thisrow["Results"] = dcc.Graph(id='id-1', figure=pass_percent_bar, config={'displayModeBar': False})

but this doesn't seem to work. Is there a way to embed a graph into the cell of a dash-table? Thanks embed

hottes avatar Dec 10 '18 16:12 hottes

@hottes There is currently no way to embed components inside the table cells. Linking to the data types and data representation epic here: #166. You can also follow the evolution of this feature at the Dash level here: https://github.com/plotly/dash-renderer/issues/95.

Marc-Andre-Rivet avatar Dec 10 '18 17:12 Marc-Andre-Rivet

There are a couple of workarounds right now:

  1. For the chart above (solid blocks of color within a cell), you could implement this using custom linear-gradient styles. See the "diverging data bars" example in https://dash.plotly.com/datatable/conditional-formatting
  2. For simple spark lines, you could try using a custom sparkline font, see e.g. https://community.plotly.com/t/sparklines-as-fonts-embedding-minimal-sparklines-in-tables-components/39468
  3. You can embed arbitrary components in html.Table. You would need to embed your own sorting or filtering dropdowns in the headers of the table.
  4. You could create static images of charts and embed those images into cells with the markdown features. See https://plotly.com/python/static-image-export/

chriddyp avatar Jul 23 '20 23:07 chriddyp

Hi, I have successfully implemented the markdown feature to display images in my DataTable. However, I am wondering whether someone can tell me how I can size the images I want to display in the table. Is there an option I can add here to control the height for example? thanks!

Kirgizil avatar Jul 17 '21 19:07 Kirgizil