plotly / plotly/dash

enable creating a `dash.data_table.from_dataframe` helper function

Open
#1,738 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature P3
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

Something like this:

table = dash_table.DataTable(
    id='table',
    columns=[{"name": i, "id": i} for i in df.columns],
    data=df.to_dict('records'),
)

is a lot of cognitive overload - ppl need to think about list comprehension, dictionary in lists (i.e. records), methods of pandas likedf.to_dict, etc. It would be nice if we could just do this:

table = dash_table.from_dataframe(df, id="table")

Obviously we'd still need to think of columns and data inside the callback, but for the purpose of just displaying something inside the layout it's more concise.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing DataTable implementation and its handling of columns and data. Define the dataframe helper around the shown dash_table.from_dataframe(df, id="table") usage, and verify that it produces the equivalent table for displaying a pandas dataframe in a layout.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
data-visualization
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.