<div dir="ltr">The reason why it is not working is because you removed the container of the renderer from the DOM. <div>Therefore, you will have to set its container again... Basically it is rendering somewhere in a detached DOM element.</div><div><br></div><div>You can do that, or simply use CSS to hide that DOM element.</div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 26, 2018 at 8:15 AM Sgouros, Thomas <<a href="mailto:thomas_sgouros@brown.edu">thomas_sgouros@brown.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi All:<div><br></div><div>I have a vtk renderer in a ParaViewWeb application. I create it and then attach it to a container for display using the setContainer() method.</div><div><br></div><div><div> this.renderers.push(VtkRenderer.newInstance({</div><div> client: this.model.pvwClient,</div><div> viewId: result,</div><div> }) );</div><div> this.renderers[this.renderers.length - 1].setContainer(</div><div> document.getElementById(container));</div></div><div><br></div><div>This renders fine, and I can see the <div> I created and the <canvas> inside it that appears to be the vtkRenderer.</div><div><br></div><div>When I render the container invisible (through the click of a user button) in the render function of its container, it disappears obediently, but when I make it visible again, the canvas inside my container is missing. Not zero size, just not present. I tried explicitly calling the render() method of the vtkRenderer object, but that doesn't seem to do anything.</div><div><br></div><div>Here's what I'm doing:</div><div><br></div><div><div> <button onClick={()=>{</div><div> this.rendererTwoVisible = !this.rendererTwoVisible;</div><div> if (this.rendererTwoVisible) this.renderers[1].render(); // Doesn't do anything.</div><div> }}></div></div><div> ...</div><div><div> { this.rendererTwoVisible ? (</div><div> <div style={{display: 'table-cell',</div><div> width: '50%',</div><div> }}></div><div> <MyControlPanel model={this.model}</div><div> view={this.renderers[1]?this.renderers[1].getViewId():""}<br></div><div> /></div><div> <div id="renderContainerTwo"</div><div> style={{position: 'relative',</div><div> height: '80vh',</div><div> resize: 'both',</div><div> overflow: 'hidden',</div><div> zIndex: '10',</div><div> }}</div><div> /></div><div> </div></div><div> ) : null }</div></div><div><br></div><div>I feel like there is a render method I should be calling directly somewhere, but can't figure out what or where that should be. Any suggestions welcome,</div><div><br></div><div>Thank you,</div><div><br></div><div> -Tom</div><div><br></div><div><br></div></div>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
ParaView discussion is moving! Please visit <a href="https://discourse.paraview.org/" rel="noreferrer" target="_blank">https://discourse.paraview.org/</a> for future posts.<br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/paraview</a><br>
</blockquote></div>