Skip to content

BrushingExtension

Screen recording from U.S. County-to-County Migration example.

lonboard.layer_extension.BrushingExtension

Adds GPU-based data brushing functionalities to layers. It allows the layer to show/hide objects based on the current pointer position.

Example

An example is in the County-to-County Migration notebook.

Layer Properties

This extension dynamically enables the following properties onto the layer(s) where it is included:

brushing_enabled

Enable/disable brushing. If brushing is disabled, all objects are rendered.

  • Type: bool, optional
  • Default: True

brushing_target

The position used to filter each object by. One of the following:

  • "source": Use the primary position for each object. This can mean different things depending on the layer. It usually refers to the coordinates returned by getPosition or getSourcePosition accessors.
  • "target": Use the secondary position for each object. This may not be available in some layers. It usually refers to the coordinates returned by getTargetPosition accessor.
  • "source_target": Use both the primary position and secondary position for each object. Show object if either is in brushing range.
  • "custom": Some layers may not describe their data objects with one or two coordinates, for example PathLayer and PolygonLayer. Use this option with the get_brushing_target prop to provide a custom position that each object should be filtered by.

  • Type: str, optional

    One of: "source" | "target" | "source_target" | "custom"

  • Default: "source"

brushing_radius

The brushing radius centered at the pointer, in meters. If a data object is within this circle, it is rendered; otherwise it is hidden.

  • Type: float, optional
  • Default: 10000

get_brushing_target

An arbitrary position for each object that it will be filtered by.

Only effective if brushing_target is set to "custom".

  • Type: PointAccessor, optional
    • If a point is provided, it is used as the target for all rows.
    • If an array of points is provided, each value in the array will be used as the target for the row at the same row index.
  • Default: None.