Skip to content

Bug? Question about synchronicity contract of JupyterRenderCanvas #204

@tlambert03

Description

@tlambert03

Hey @almarklein

While working with rendercanvas.jupyter.JupyterRenderCanvas in ndv, I found that all scene updates appears to be one step behind my interactions. So, for example, if I toggle a checkbox to hide one of the objects in the scene, or change the data in a texture, the immediate result of the interaction is to render the state resulting from the previous interaction.

The workaround I came up with was:

class JupyterRenderCanvas(rendercanvas.jupyter.JupyterRenderCanvas):
    def get_frame(self) -> Any:
        self._process_events()
        self._draw_and_present(force_sync=True)
        return self._last_image

however, I suspect I'm not quite understanding the contract of the ABC there. Can you help me understand? is get_frame() designed to be asynchronous? Is this likely a bug in how I'm invoking request_draw(animate)? (fwiw, my request_draw pattern is working fine in Qt and Wx, it's just the jupyter backend that is one-step-behind... And furthermore: it's only in pygfx; vispy going through jupyter-rfb seems fin)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions