plotly / plotly/plotly.R

'hovertemplate' not passable as an attribute into a dataframe in a sankey diagram's nodes/links

Open
#2,090 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description


The 'hovertemplate' attribute is not working when passed into the 'nodes' or 'links' dataframes in a sankey diagram. "Node" and "link" are arguments for the sankey's links and nodes and are of type dataframe which contain arbitrary data for the links and nodes, as well as attributes of links and nodes (see plotly::schema() for a list of all available attributes for each trace). Reprex here is unnecessary since my question is why 'hovertemplate' cannot be passed into the 'nodes' or 'links' as attributes when other attributes such as 'color' and 'hoverinfo' are passable? Is there any workaround to this?



fig <- plot_ly(
      type = "sankey",
      orientation = "h",
      node = nodes, # dataframe which includes sankey trace data and attributes
      link = links, # dataframe which includes sankey trace data and attributes
      valueformat = ".0f")

fig 

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

No implementation file or test is named. Start by inspecting plotly::schema() for Sankey node and link attributes, then trace how the node and link dataframes are converted; done means determining why hovertemplate differs from color and hoverinfo and documenting a confirmed workaround or supported behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
plotly, r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.