Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interrupt (null values) as gap mode for stacked scatter charts #3244

Closed
Bjodol opened this issue Nov 14, 2018 · 6 comments
Closed

Interrupt (null values) as gap mode for stacked scatter charts #3244

Bjodol opened this issue Nov 14, 2018 · 6 comments
Labels
feature something new

Comments

@Bjodol
Copy link

Bjodol commented Nov 14, 2018

Hi!

We have been evaluating a lot of charting frameworks and found that plotly is the one that fit our needs the best. However we have one major issue with it on the stacked scatter charts. Currently the only two supported gapModes is "infer zero" and "interpolate" which hinders us from fully commit to Plotly. In our application a null value signifies a data loss and replacing it with 0 provides a wrong picture as the 0 indicates that we have data and the value is 0 not that we actually in fact have a data loss.

I pulled down the code and saw that src/traces/scatter/plot.js:407 suggests interrupt as a future new mode. Is this covering null values not being shown in the area charts and is there an ETA for when this will arrive? If interrupt is something else, I would like to propose having a gap mode where null values aren't drawn in the stacked group.

@alexcjohnson
Copy link
Collaborator

Thanks @Bjodol, there definitely should be an issue open for this. That's right, we had discussed from the beginning that a third option to stackgaps making it clearer that a gap is really "missing" would be useful. There's also this commented-out portion in the attribute description:

'With *infer zero* we insert a zero at these locations.',
'With *interpolate* we linearly interpolate between existing',
'values, and extrapolate a constant beyond the existing values.'
// TODO - implement interrupt mode
// '*interrupt* omits this trace from the stack at this location by',
// 'dropping abruptly, midway between the existing and missing locations.'

which, as mentioned when we were originally discussing this feature would look something like:

screen shot 2018-06-04 at 9 43 50 am

Is that the kind of behavior you had in mind?

We don't have an ETA for this currently, but it's useful to know folks are interested. But the best way to get it to happen quickly would be either to submit a PR or to sponsor the project https://plot.ly/products/consulting-and-oem/

@alexcjohnson alexcjohnson added the feature something new label Nov 14, 2018
@Bjodol
Copy link
Author

Bjodol commented Nov 15, 2018

This is exactly the behavior I had in mind yes! I hope my interest would spark some priority on it. But knowing it is planned will probably make us go for plotly. Would love to submit a PR to it myself, but currently with hanging deadlines I cannot really invest the time in it now. And honestly I wouldn't even know where to start 😂

@warren-oneill
Copy link

warren-oneill commented Oct 15, 2020

Hi @Bjodol and @alexcjohnson, I just sent in a request to sponsor this issue getting done here https://plotly.com/get-pricing/.
I have a similar issue with intermittent timeseries data. As you can see in the plot below I'm getting a lot of zeros in the hover that I don't want to see.
Screenshot 2020-10-15 at 13 32 26

@warren-oneill
Copy link

However, I was able to remove all the zeroes from the plot by setting mode='none'. It's only the issues with the hover I am having.

@warren-oneill
Copy link

I ended up getting around the issues by using a stacked bar plot with no gaps or borders.

fig = go.Figure()
fig.add_trace(go.Bar(x=x, y=y, name=u, opacity=0.5, 
                                    marker=dict(line=dict(width=0))))
fig.update_layout(barmode='stack', bargap=0)

@gvwilson
Copy link
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

No branches or pull requests

4 participants