Skip to content

"None" value of hovertext is shown as String #1244

Closed
@pmercatoris

Description

@pmercatoris

In plotly 2.5.1, a None value of hovertext would result in the hoverinfo being skipped.
However, in 3.3.0, that is not the case. Instead, it will show the None as a string.

import plotly.graph_objs as go

test = go.Scatter(
    x=[0,1],
    y=[0,1],
    hovertext=[None, 'test'],
    mode='lines',
    hoverinfo='x+text',
)

In 2.5.1, test is:

{'hoverinfo': 'x+text',
 'hovertext': [None, 'test'],
 'mode': 'lines',
 'type': 'scatter',
 'x': [0, 1],
 'y': [0, 1]}

In 3.3.0, test is:

Scatter({
    'hoverinfo': 'x+text', 'hovertext': ['None', 'test'], 'mode': 'lines', 'x': [0, 1], 'y': [0, 1]
})

Resulting in this:

screenshot_2018-10-25_12-53-18

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions