Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Can't set marker opacity if also setting marker symbol #203

Closed
slishak opened this issue May 18, 2018 · 3 comments
Closed

Can't set marker opacity if also setting marker symbol #203

slishak opened this issue May 18, 2018 · 3 comments

Comments

@slishak
Copy link

slishak commented May 18, 2018

In the following example, the marker opacity is always 1 if I set a marker symbol. For the second trace, I haven't set a marker so the marker opacity is respected. The legend is drawn with the correct opacity. If I use plotly.offline.plot to plot the figure outside Dash it looks ok.

import dash
import dash_core_components as dcc
import dash_html_components as html
import random

app = dash.Dash()

n_points = 50

x = list(range(n_points))
data = [
    {
        'x': x,
        'y': [random.random() for _ in range(n_points)],
        'marker': {'symbol': 'x', 'opacity': 0.05, 'size': 20},
        'mode': 'markers',
        'type': 'scattergl',
    },
    {
        'x': x,
        'y': [random.random() for _ in range(n_points)],
        'marker': {'opacity': 0.05, 'size': 20},
        'mode': 'markers',
        'type': 'scattergl',
    },
]
fig = {'data': data, 'layout': {}}

app.layout = html.Div(children=[
    dcc.Graph(
        id='example-graph',
        figure=fig,
    )
])


if __name__ == '__main__':
    app.run_server(debug=True)

image

@bcdunbar
Copy link

@slishak What version are you using?

I ran the above and marker opacity and symbol work as expected.

dash 0.21.1
dash-core-components 0.23.0
dash-html-components 0.11.0
plotly 2.7.0

@slishak
Copy link
Author

slishak commented Jun 25, 2018

Sorry, should have written the versions in the issue. This appears to have been fixed by dash-core-components 0.23.0. The issue above occurs (in Chrome) with:

dash==0.21.1
dash-core-components==0.22.2
dash-html-components==0.11.0
dash-renderer==0.13.0
plotly==2.7.0

@slishak slishak closed this as completed Jun 25, 2018
@bcdunbar
Copy link

@slishak thanks for clarifying

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants