[Paraview] vtk renderer

Sebastien Jourdain sebastien.jourdain at kitware.com
Thu Jun 7 15:42:55 EDT 2018


The renderer will ask for its container size when you call resize() on it.
So if that container keep growing due to the setup of your css, the size
propagation won't go to the server as the container will never shrink.

You need to fix the width in some way like you did for the height. You can
use 50vw or use a mix of absolute/relative position in your dom hierarchy.

On Thu, Jun 7, 2018 at 12:35 PM Sgouros, Thomas <thomas_sgouros at brown.edu>
wrote:

> Hi Sebastien:
>
> Looks like this:
>
>             <div id="renderContainerTwo"
>                  style={{position: 'relative',
>                          height: '80vh',
>                          overflow: 'hidden',
>                          zIndex: '10',
>                         }}
>             />
>
> Another data point: when I shrink or grow the window in the vertical, the
> *height* of the canvas element changes in both directions, but the width
> only changes when I grow the window and not when I shrink it. Maybe what
> you're saying though is that I should travel up the hierarchy and see where
> I'm setting heights and widths in non-parallel ways?
>
> Thank you,
>
>  -Tom
>
>
> On Thu, Jun 7, 2018 at 2:28 PM, Sebastien Jourdain <
> sebastien.jourdain at kitware.com> wrote:
>
>> Hi Tom,
>>
>> That would be a ParaViewWeb question. The issue is related to the css for
>> your div that contains the renderer.
>> To allow the renderer to shrink you need to set "overflow: hidden;"
>> assuming the rest of the size of the div is defined by other constraints.
>>
>> Seb
>>
>> On Thu, Jun 7, 2018 at 11:41 AM Sgouros, Thomas <thomas_sgouros at brown.edu>
>> wrote:
>>
>>> Hi All:
>>>
>>> I'm not sure if this is a VTK question or a Paraview question, so
>>> apologies in advance. In a ParaViewWeb application, I have a vtkRenderer in
>>> a div in another div, etc. The vtkRenderer seems to adjust when I make the
>>> window it's in bigger or the container, but it does not resize when I make
>>> the window smaller. Using the browser's element viewer, I can see the
>>> <canvas> object inside, and see its width reach when I expand elements and
>>> refuse to react when I contract the window or container.
>>>
>>> When I create the vtk renderer, I use this code:
>>>
>>>            this.renderers.push(VtkRenderer.newInstance({
>>>                   client: this.model.pvwClient,
>>>                   viewId: result,
>>>                 }) );
>>>
>>>     ... and then later...
>>>
>>>       SizeHelper.onSizeChange(() => {
>>>         this.renderers[0].resize();
>>>         this.renderers[1].resize();
>>>       });
>>>       SizeHelper.startListening();
>>>
>>> I invoke the SizeHelper.triggerChange() method regularly and it seems to
>>> work, though again only to make the renderer bigger.
>>>
>>> Should I be resizing these with a direct call to some method? What is
>>> the way I should be doing this?
>>>
>>> Thank you,
>>>
>>>  -Tom
>>>
>>>
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> ParaView discussion is moving! Please visit
>>> https://discourse.paraview.org/ for future posts.
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the ParaView Wiki at:
>>> http://paraview.org/Wiki/ParaView
>>>
>>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> https://public.kitware.com/mailman/listinfo/paraview
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/paraview/attachments/20180607/f550f1d5/attachment.html>


More information about the ParaView mailing list