Skip to content

Scatter-3D redraw() causes a RENDER WARNING and doesn't update all the traces #1023

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

Closed
FMiscia opened this issue Oct 10, 2016 · 3 comments
Closed

Comments

@FMiscia
Copy link

FMiscia commented Oct 10, 2016

I have a scatter-3d plot with a data array of two traces: the first one is used to plot the funciton i want to show, the second one contains the clicked element with a different color. In this way when I click a point the point changes its color. Now this works, but quite often, the redraw method doesn't work for the second trace and i get this warning:

[.Offscreen-For-WebGL-049BA980]RENDER WARNING: Render count or primcount is 0.

here it is the snippet

        this.$.plot3d.on('plotly_click', function(d){
            var point_number = d.points[0].pointNumber
            var id = parseFloat(d.points[0].data.incrementalID[point_number])
            var index = util.issetArrayElement(data[1].incrementalID,id)
            if(index == -1){          
                data[1].x.push(d.points[0].x)
                data[1].y.push(d.points[0].y)
                data[1].z.push(d.points[0].z)
                data[1].incrementalID.push(id)
                data[1].uniqueID.push(parseFloat(d.points[0].data.uniqueID[point_number])
                Plotly.redraw(self.$.plot3d)
           } 
        })

Moreover, if i remove the point from the first trace, (so, the clicked point belongs only to the second trace ), the point disappears, so it seems like my second trace during the redraw is not redrawn at all.
Here it is the second snippet:

this.$.plot3d.on('plotly_click', function(d){
  point_number = d.points[0].pointNumber
  var id = parseFloat(d.points[0].data.incrementalID[point_number])
  var index_1 = util.issetArrayElement(data[1].incrementalID,id)
  var index_0 = util.issetArrayElement(data[0].incrementalID,id)
  if(index_1 == -1){          
    data[1].x.push(d.points[0].x)
    data[1].y.push(d.points[0].y)
    data[1].z.push(d.points[0].z)
    data[1].incrementalID.push(id)
    data[1].uniqueID.push(parseFloat(d.points[0].data.uniqueID[point_number]))
    util.removeArrayElement(data[0].x,index_0)
    util.removeArrayElement(data[0].y,index_0)
    util.removeArrayElement(data[0].z,index_0)
    util.removeArrayElement(data[0].incrementalID,index_0)
    util.removeArrayElement(data[0].uniqueID,index_0)
  }
  redrawing = true
  Plotly.redraw(self.$.plot3d)
})

I cannot figure out why

@etpinard
Copy link
Contributor

Thanks for the report.

Would you mind providing a fully reproducible example (as opposed to snippets), to make our life a little easier?

@FMiscia
Copy link
Author

FMiscia commented Oct 11, 2016

I'm sorry. Here it is a fully runnuble code. It's strange, because the point in the positive face (i just put one point there) works as expected (it changes its color), it's not the same for the other points.

In the code there's also the workaround for the issue #1025 (line 96)

@FMiscia
Copy link
Author

FMiscia commented Oct 13, 2016

It was my bad! My json data had all the numbers without quotes. Putting all the numbers as strings solved the problem.

Sorry.

ps: this doesn't solve the #1025

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

No branches or pull requests

2 participants