plotly.R icon indicating copy to clipboard operation
plotly.R copied to clipboard

Option to remove the white shadow in sankey type diagram

Open happyshows opened this issue 6 years ago • 7 comments

Brief description of the problem Hi I need to have a cleaner version of sankey diagram but couldn't find the option in API doc.

The dom class name is text-shadow, but in the doc There's no definition to include/exclude text shadow.

image

  plot_ly(
    type = "sankey",
    domain = c(
      x =  c(0,1),
      y =  c(0,1)
    ),
    orientation = "h",
    node = node,
    link = link,
    width = 2000,
    height = 3600) %>% 
  layout(
    title = "TBD",
    font = list(
      size = 10,
      color = 'white'
    ),
    plot_bgcolor = 'black',
    paper_bgcolor = 'black'
)

happyshows avatar Sep 14 '17 20:09 happyshows

Hi, I'm also trying to solve the same problem. Have you been able to do it?

miguelpatricio avatar Nov 29 '17 09:11 miguelpatricio

+1 and it would be great to be able to set the node font color

sharq1 avatar May 11 '18 11:05 sharq1

If you don't mind overriding styles with CSS, then here's the way to go:

.sankey {
  .node-label-text-path {
    text-shadow: none;
    fill: #fff !important;
  }
}

sharq1 avatar May 11 '18 12:05 sharq1

Same problem.

brienna avatar Sep 30 '20 07:09 brienna

Hello, in R, setting the link color and the paper_bgcolor as the same worked for me.

Sooner30 avatar Mar 30 '22 20:03 Sooner30

This is also a big issue for Python. Every text label is ghosted with the label one or two labels beneath it. Multi-item Sankey plots become uninterpretable.

Any recommendations to switch this off without CSS styles sheet would be fantastic.

Sum02dean avatar Aug 22 '22 10:08 Sum02dean

Still an issue for me in Python (plotly 5.10.0). Any updates?

ErikHartman avatar Sep 12 '22 09:09 ErikHartman

not yet fixed in 5.11 either. Apologies, the work around from Sharq1 for overriding with CSS. How do you that?

I got it working through the comment from Sooner30, also in python. => make the background transparent 'removes the shadow'.

start code = data = go.Sankey( node = node, link = link) layout = go.Layout( paper_bgcolor='rgba(0,0,0,0)', plot_bgcolor='rgba(0,0,0,0)' ) fig = go.Figure(data, layout=layout) end code =

pvdsg avatar Nov 01 '22 15:11 pvdsg