class documentation

class FrameLoaderView(View): (source)

Constructor: FrameLoaderView(**kwargs)

View In Hierarchy

Utility for animating panel state based on the given timeline_name.

Examples:

def on_load(self, ctx):
    panel.state.plot = {
        "type": "scatter",
        "x": [1, 2, 3],
        "y": [1, 2, 3],
    }

def render(self, ctx):
    panel.obj(
        "frame_data",
        view=types.FrameLoaderView(
            on_load_range=self.on_load_range,
            target="plot.selectedpoints",
        ),
    )
    panel.plot("plot")

def load_range(self, ctx, range_to_load):
    r = ctx.params.get("range")

    chunk = {}
    for i in range(r[0], r[1]):
        rendered_frame = [i]
        chunk[f"frame_data.frames[{i}]"] = rendered_frame

    ctx.panel.set_data(chunk)
    current_field = ctx.panel.state.selected_field or "default_field"
    ctx.panel.set_state("frame_data.signature", current_field + str(r))
Parameters
timeline_namethe name of the timeline to load if provided, otherwise the default timeline
on_load_rangethe operator to execute when the frame is loading
targetthe path to the property to animate
Method __init__ Undocumented

Inherited from View:

Method clone Undocumented
Method kwargs_to_json Undocumented
Method to_json Undocumented
Instance Variable caption Undocumented
Instance Variable component Undocumented
Instance Variable componentsProps Undocumented
Instance Variable container Undocumented
Instance Variable description Undocumented
Instance Variable label Undocumented
Instance Variable placeholder Undocumented
Instance Variable read_only Undocumented
Instance Variable space Undocumented
Instance Variable _kwargs Undocumented
def __init__(self, **kwargs): (source) ΒΆ