diff --git a/docs/source/api/axes/Axes.rst b/docs/source/api/axes/Axes.rst new file mode 100644 index 000000000..7a98ce384 --- /dev/null +++ b/docs/source/api/axes/Axes.rst @@ -0,0 +1,44 @@ +.. _api.Axes: + +Axes +**** + +==== +Axes +==== +.. currentmodule:: fastplotlib.axes + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: Axes_api + + Axes + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: Axes_api + + Axes.auto_grid + Axes.basis + Axes.color + Axes.colors + Axes.grids + Axes.intersection + Axes.offset + Axes.visible + Axes.world_object + Axes.x + Axes.y + Axes.z + +Methods +~~~~~~~ +.. autosummary:: + :toctree: Axes_api + + Axes.update + Axes.update_using_bbox + Axes.update_using_camera + diff --git a/docs/source/api/axes/Grid.rst b/docs/source/api/axes/Grid.rst new file mode 100644 index 000000000..e40ecb907 --- /dev/null +++ b/docs/source/api/axes/Grid.rst @@ -0,0 +1,66 @@ +.. _api.Grid: + +Grid +**** + +==== +Grid +==== +.. currentmodule:: fastplotlib.axes + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: Grid_api + + Grid + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: Grid_api + + Grid.axis_color + Grid.axis_thickness + Grid.cast_shadow + Grid.children + Grid.geometry + Grid.id + Grid.infinite + Grid.major_color + Grid.major_step + Grid.major_thickness + Grid.material + Grid.minor_color + Grid.minor_step + Grid.minor_thickness + Grid.parent + Grid.receive_shadow + Grid.render_mask + Grid.render_order + Grid.thickness_space + Grid.up + Grid.visible + +Methods +~~~~~~~ +.. autosummary:: + :toctree: Grid_api + + Grid.add + Grid.add_event_handler + Grid.clear + Grid.get_bounding_box + Grid.get_bounding_sphere + Grid.get_geometry_bounding_box + Grid.get_world_bounding_box + Grid.get_world_bounding_sphere + Grid.handle_event + Grid.iter + Grid.look_at + Grid.release_pointer_capture + Grid.remove + Grid.remove_event_handler + Grid.set_pointer_capture + Grid.traverse + diff --git a/docs/source/api/axes/Grids.rst b/docs/source/api/axes/Grids.rst new file mode 100644 index 000000000..d6af4d408 --- /dev/null +++ b/docs/source/api/axes/Grids.rst @@ -0,0 +1,59 @@ +.. _api.Grids: + +Grids +***** + +===== +Grids +===== +.. currentmodule:: fastplotlib.axes + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: Grids_api + + Grids + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: Grids_api + + Grids.cast_shadow + Grids.children + Grids.geometry + Grids.id + Grids.material + Grids.parent + Grids.receive_shadow + Grids.render_mask + Grids.render_order + Grids.up + Grids.visible + Grids.xy + Grids.xz + Grids.yz + +Methods +~~~~~~~ +.. autosummary:: + :toctree: Grids_api + + Grids.add + Grids.add_event_handler + Grids.clear + Grids.get_bounding_box + Grids.get_bounding_sphere + Grids.get_geometry_bounding_box + Grids.get_world_bounding_box + Grids.get_world_bounding_sphere + Grids.handle_event + Grids.iter + Grids.look_at + Grids.release_pointer_capture + Grids.remove + Grids.remove_event_handler + Grids.set_pointer_capture + Grids.traverse + diff --git a/docs/source/api/axes/Ruler.rst b/docs/source/api/axes/Ruler.rst new file mode 100644 index 000000000..e0641b821 --- /dev/null +++ b/docs/source/api/axes/Ruler.rst @@ -0,0 +1,74 @@ +.. _api.Ruler: + +Ruler +***** + +===== +Ruler +===== +.. currentmodule:: fastplotlib.axes + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: Ruler_api + + Ruler + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: Ruler_api + + Ruler.cast_shadow + Ruler.children + Ruler.color + Ruler.end_pos + Ruler.end_value + Ruler.geometry + Ruler.id + Ruler.label + Ruler.line + Ruler.line_width + Ruler.material + Ruler.min_tick_distance + Ruler.parent + Ruler.points + Ruler.receive_shadow + Ruler.render_mask + Ruler.render_order + Ruler.start_pos + Ruler.start_value + Ruler.text + Ruler.tick_format + Ruler.tick_marker + Ruler.tick_side + Ruler.tick_size + Ruler.ticks + Ruler.ticks_at_end_points + Ruler.up + Ruler.visible + +Methods +~~~~~~~ +.. autosummary:: + :toctree: Ruler_api + + Ruler.add + Ruler.add_event_handler + Ruler.clear + Ruler.get_bounding_box + Ruler.get_bounding_sphere + Ruler.get_geometry_bounding_box + Ruler.get_world_bounding_box + Ruler.get_world_bounding_sphere + Ruler.handle_event + Ruler.iter + Ruler.look_at + Ruler.release_pointer_capture + Ruler.remove + Ruler.remove_event_handler + Ruler.set_pointer_capture + Ruler.traverse + Ruler.update + diff --git a/docs/source/api/axes/index.rst b/docs/source/api/axes/index.rst new file mode 100644 index 000000000..92703eff6 --- /dev/null +++ b/docs/source/api/axes/index.rst @@ -0,0 +1,10 @@ +Axes +**** + +.. toctree:: + :maxdepth: 1 + + Grid + Grids + Ruler + Axes diff --git a/docs/source/api/graphic_features/TextureArray.rst b/docs/source/api/graphic_features/TextureArray.rst index 004881282..e57431ca7 100644 --- a/docs/source/api/graphic_features/TextureArray.rst +++ b/docs/source/api/graphic_features/TextureArray.rst @@ -22,7 +22,10 @@ Properties TextureArray.buffer TextureArray.col_indices + TextureArray.colorspace + TextureArray.cpu_buffer TextureArray.row_indices + TextureArray.shape TextureArray.value Methods diff --git a/docs/source/api/graphic_features/TextureYUV.rst b/docs/source/api/graphic_features/TextureYUV.rst new file mode 100644 index 000000000..485de904b --- /dev/null +++ b/docs/source/api/graphic_features/TextureYUV.rst @@ -0,0 +1,39 @@ +.. _api.TextureYUV: + +TextureYUV +********** + +========== +TextureYUV +========== +.. currentmodule:: fastplotlib.graphics.features + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: TextureYUV_api + + TextureYUV + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: TextureYUV_api + + TextureYUV.colorrange + TextureYUV.colorspace + TextureYUV.cpu_buffer + TextureYUV.texture + TextureYUV.value + +Methods +~~~~~~~ +.. autosummary:: + :toctree: TextureYUV_api + + TextureYUV.add_event_handler + TextureYUV.block_events + TextureYUV.clear_event_handlers + TextureYUV.remove_event_handler + TextureYUV.set_value + diff --git a/docs/source/api/graphic_features/index.rst b/docs/source/api/graphic_features/index.rst index 71268ddab..db0b52103 100644 --- a/docs/source/api/graphic_features/index.rst +++ b/docs/source/api/graphic_features/index.rst @@ -22,6 +22,8 @@ Graphic Features VertexPointSizes UniformSize TextureArray + TextureYUV + tuple ImageCmap ImageVmin ImageVmax diff --git a/docs/source/api/graphic_features/tuple.rst b/docs/source/api/graphic_features/tuple.rst new file mode 100644 index 000000000..2c0c9c662 --- /dev/null +++ b/docs/source/api/graphic_features/tuple.rst @@ -0,0 +1,31 @@ +.. _api.tuple: + +tuple +***** + +===== +tuple +===== +.. currentmodule:: fastplotlib.graphics.features + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: tuple_api + + tuple + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: tuple_api + + +Methods +~~~~~~~ +.. autosummary:: + :toctree: tuple_api + + tuple.count + tuple.index + diff --git a/docs/source/api/graphics/Graphic.rst b/docs/source/api/graphics/Graphic.rst index f94892949..b2bf0ddd0 100644 --- a/docs/source/api/graphics/Graphic.rst +++ b/docs/source/api/graphics/Graphic.rst @@ -24,6 +24,7 @@ Properties Graphic.alpha_mode Graphic.axes Graphic.block_events + Graphic.block_handlers Graphic.deleted Graphic.event_handlers Graphic.name diff --git a/docs/source/api/graphics/ImageGraphic.rst b/docs/source/api/graphics/ImageGraphic.rst index e6d02c54b..b95b47907 100644 --- a/docs/source/api/graphics/ImageGraphic.rst +++ b/docs/source/api/graphics/ImageGraphic.rst @@ -24,8 +24,11 @@ Properties ImageGraphic.alpha_mode ImageGraphic.axes ImageGraphic.block_events + ImageGraphic.block_handlers ImageGraphic.cmap ImageGraphic.cmap_interpolation + ImageGraphic.colorspace + ImageGraphic.cpu_buffer ImageGraphic.data ImageGraphic.deleted ImageGraphic.event_handlers diff --git a/docs/source/api/graphics/ImageVolumeGraphic.rst b/docs/source/api/graphics/ImageVolumeGraphic.rst index 8031f12f1..c0465944d 100644 --- a/docs/source/api/graphics/ImageVolumeGraphic.rst +++ b/docs/source/api/graphics/ImageVolumeGraphic.rst @@ -24,6 +24,7 @@ Properties ImageVolumeGraphic.alpha_mode ImageVolumeGraphic.axes ImageVolumeGraphic.block_events + ImageVolumeGraphic.block_handlers ImageVolumeGraphic.cmap ImageVolumeGraphic.cmap_interpolation ImageVolumeGraphic.data diff --git a/docs/source/api/graphics/ImageYUVGraphic.rst b/docs/source/api/graphics/ImageYUVGraphic.rst new file mode 100644 index 000000000..54c7c3c1a --- /dev/null +++ b/docs/source/api/graphics/ImageYUVGraphic.rst @@ -0,0 +1,67 @@ +.. _api.ImageYUVGraphic: + +ImageYUVGraphic +*************** + +=============== +ImageYUVGraphic +=============== +.. currentmodule:: fastplotlib + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: ImageYUVGraphic_api + + ImageYUVGraphic + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: ImageYUVGraphic_api + + ImageYUVGraphic.alpha + ImageYUVGraphic.alpha_mode + ImageYUVGraphic.axes + ImageYUVGraphic.block_events + ImageYUVGraphic.block_handlers + ImageYUVGraphic.cmap + ImageYUVGraphic.cmap_interpolation + ImageYUVGraphic.colorrange + ImageYUVGraphic.colorspace + ImageYUVGraphic.cpu_buffer + ImageYUVGraphic.data + ImageYUVGraphic.deleted + ImageYUVGraphic.event_handlers + ImageYUVGraphic.interpolation + ImageYUVGraphic.name + ImageYUVGraphic.offset + ImageYUVGraphic.right_click_menu + ImageYUVGraphic.rotation + ImageYUVGraphic.scale + ImageYUVGraphic.supported_events + ImageYUVGraphic.tooltip_format + ImageYUVGraphic.visible + ImageYUVGraphic.vmax + ImageYUVGraphic.vmin + ImageYUVGraphic.world_object + +Methods +~~~~~~~ +.. autosummary:: + :toctree: ImageYUVGraphic_api + + ImageYUVGraphic.add_axes + ImageYUVGraphic.add_event_handler + ImageYUVGraphic.add_linear_region_selector + ImageYUVGraphic.add_linear_selector + ImageYUVGraphic.add_polygon_selector + ImageYUVGraphic.add_rectangle_selector + ImageYUVGraphic.clear_event_handlers + ImageYUVGraphic.format_pick_info + ImageYUVGraphic.map_model_to_world + ImageYUVGraphic.map_world_to_model + ImageYUVGraphic.remove_event_handler + ImageYUVGraphic.reset_vmin_vmax + ImageYUVGraphic.rotate + diff --git a/docs/source/api/graphics/LineCollection.rst b/docs/source/api/graphics/LineCollection.rst index 5d0603ab7..de0a8330c 100644 --- a/docs/source/api/graphics/LineCollection.rst +++ b/docs/source/api/graphics/LineCollection.rst @@ -24,6 +24,7 @@ Properties LineCollection.alpha_mode LineCollection.axes LineCollection.block_events + LineCollection.block_handlers LineCollection.cmap LineCollection.colors LineCollection.data diff --git a/docs/source/api/graphics/LineGraphic.rst b/docs/source/api/graphics/LineGraphic.rst index 867f1bfbb..834bce0a9 100644 --- a/docs/source/api/graphics/LineGraphic.rst +++ b/docs/source/api/graphics/LineGraphic.rst @@ -24,6 +24,7 @@ Properties LineGraphic.alpha_mode LineGraphic.axes LineGraphic.block_events + LineGraphic.block_handlers LineGraphic.cmap LineGraphic.color_mode LineGraphic.colors diff --git a/docs/source/api/graphics/LineStack.rst b/docs/source/api/graphics/LineStack.rst index e7ac21343..a922b9edc 100644 --- a/docs/source/api/graphics/LineStack.rst +++ b/docs/source/api/graphics/LineStack.rst @@ -24,6 +24,7 @@ Properties LineStack.alpha_mode LineStack.axes LineStack.block_events + LineStack.block_handlers LineStack.cmap LineStack.colors LineStack.data diff --git a/docs/source/api/graphics/MeshGraphic.rst b/docs/source/api/graphics/MeshGraphic.rst index ec27f1e4e..c2cf895e1 100644 --- a/docs/source/api/graphics/MeshGraphic.rst +++ b/docs/source/api/graphics/MeshGraphic.rst @@ -24,6 +24,7 @@ Properties MeshGraphic.alpha_mode MeshGraphic.axes MeshGraphic.block_events + MeshGraphic.block_handlers MeshGraphic.clim MeshGraphic.cmap MeshGraphic.colors diff --git a/docs/source/api/graphics/PolygonGraphic.rst b/docs/source/api/graphics/PolygonGraphic.rst index 94c75f999..c52031d67 100644 --- a/docs/source/api/graphics/PolygonGraphic.rst +++ b/docs/source/api/graphics/PolygonGraphic.rst @@ -24,6 +24,7 @@ Properties PolygonGraphic.alpha_mode PolygonGraphic.axes PolygonGraphic.block_events + PolygonGraphic.block_handlers PolygonGraphic.clim PolygonGraphic.cmap PolygonGraphic.colors diff --git a/docs/source/api/graphics/ScatterCollection.rst b/docs/source/api/graphics/ScatterCollection.rst new file mode 100644 index 000000000..92fa92a78 --- /dev/null +++ b/docs/source/api/graphics/ScatterCollection.rst @@ -0,0 +1,70 @@ +.. _api.ScatterCollection: + +ScatterCollection +***************** + +================= +ScatterCollection +================= +.. currentmodule:: fastplotlib + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: ScatterCollection_api + + ScatterCollection + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: ScatterCollection_api + + ScatterCollection.alpha + ScatterCollection.alpha_mode + ScatterCollection.axes + ScatterCollection.block_events + ScatterCollection.block_handlers + ScatterCollection.cmap + ScatterCollection.colors + ScatterCollection.data + ScatterCollection.deleted + ScatterCollection.event_handlers + ScatterCollection.graphics + ScatterCollection.markers + ScatterCollection.metadatas + ScatterCollection.name + ScatterCollection.names + ScatterCollection.offset + ScatterCollection.offsets + ScatterCollection.right_click_menu + ScatterCollection.rotation + ScatterCollection.rotations + ScatterCollection.scale + ScatterCollection.sizes + ScatterCollection.supported_events + ScatterCollection.tooltip_format + ScatterCollection.visible + ScatterCollection.visibles + ScatterCollection.world_object + +Methods +~~~~~~~ +.. autosummary:: + :toctree: ScatterCollection_api + + ScatterCollection.add_axes + ScatterCollection.add_event_handler + ScatterCollection.add_graphic + ScatterCollection.add_linear_region_selector + ScatterCollection.add_linear_selector + ScatterCollection.add_polygon_selector + ScatterCollection.add_rectangle_selector + ScatterCollection.clear_event_handlers + ScatterCollection.format_pick_info + ScatterCollection.map_model_to_world + ScatterCollection.map_world_to_model + ScatterCollection.remove_event_handler + ScatterCollection.remove_graphic + ScatterCollection.rotate + diff --git a/docs/source/api/graphics/ScatterGraphic.rst b/docs/source/api/graphics/ScatterGraphic.rst index f9dcd2487..0406fa8cc 100644 --- a/docs/source/api/graphics/ScatterGraphic.rst +++ b/docs/source/api/graphics/ScatterGraphic.rst @@ -24,6 +24,7 @@ Properties ScatterGraphic.alpha_mode ScatterGraphic.axes ScatterGraphic.block_events + ScatterGraphic.block_handlers ScatterGraphic.cmap ScatterGraphic.color_mode ScatterGraphic.colors diff --git a/docs/source/api/graphics/ScatterStack.rst b/docs/source/api/graphics/ScatterStack.rst new file mode 100644 index 000000000..22aaa4d5d --- /dev/null +++ b/docs/source/api/graphics/ScatterStack.rst @@ -0,0 +1,72 @@ +.. _api.ScatterStack: + +ScatterStack +************ + +============ +ScatterStack +============ +.. currentmodule:: fastplotlib + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: ScatterStack_api + + ScatterStack + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: ScatterStack_api + + ScatterStack.alpha + ScatterStack.alpha_mode + ScatterStack.axes + ScatterStack.block_events + ScatterStack.block_handlers + ScatterStack.cmap + ScatterStack.colors + ScatterStack.data + ScatterStack.deleted + ScatterStack.event_handlers + ScatterStack.graphics + ScatterStack.markers + ScatterStack.metadatas + ScatterStack.name + ScatterStack.names + ScatterStack.offset + ScatterStack.offsets + ScatterStack.right_click_menu + ScatterStack.rotation + ScatterStack.rotations + ScatterStack.scale + ScatterStack.separation + ScatterStack.separation_axis + ScatterStack.sizes + ScatterStack.supported_events + ScatterStack.tooltip_format + ScatterStack.visible + ScatterStack.visibles + ScatterStack.world_object + +Methods +~~~~~~~ +.. autosummary:: + :toctree: ScatterStack_api + + ScatterStack.add_axes + ScatterStack.add_event_handler + ScatterStack.add_graphic + ScatterStack.add_linear_region_selector + ScatterStack.add_linear_selector + ScatterStack.add_polygon_selector + ScatterStack.add_rectangle_selector + ScatterStack.clear_event_handlers + ScatterStack.format_pick_info + ScatterStack.map_model_to_world + ScatterStack.map_world_to_model + ScatterStack.remove_event_handler + ScatterStack.remove_graphic + ScatterStack.rotate + diff --git a/docs/source/api/graphics/SurfaceGraphic.rst b/docs/source/api/graphics/SurfaceGraphic.rst index 228dbede1..2eb32500b 100644 --- a/docs/source/api/graphics/SurfaceGraphic.rst +++ b/docs/source/api/graphics/SurfaceGraphic.rst @@ -24,6 +24,7 @@ Properties SurfaceGraphic.alpha_mode SurfaceGraphic.axes SurfaceGraphic.block_events + SurfaceGraphic.block_handlers SurfaceGraphic.clim SurfaceGraphic.cmap SurfaceGraphic.colors diff --git a/docs/source/api/graphics/TextGraphic.rst b/docs/source/api/graphics/TextGraphic.rst index da4909686..e4deb0113 100644 --- a/docs/source/api/graphics/TextGraphic.rst +++ b/docs/source/api/graphics/TextGraphic.rst @@ -24,6 +24,7 @@ Properties TextGraphic.alpha_mode TextGraphic.axes TextGraphic.block_events + TextGraphic.block_handlers TextGraphic.deleted TextGraphic.event_handlers TextGraphic.face_color diff --git a/docs/source/api/graphics/VectorsGraphic.rst b/docs/source/api/graphics/VectorsGraphic.rst index ec7d891c0..728029851 100644 --- a/docs/source/api/graphics/VectorsGraphic.rst +++ b/docs/source/api/graphics/VectorsGraphic.rst @@ -24,6 +24,7 @@ Properties VectorsGraphic.alpha_mode VectorsGraphic.axes VectorsGraphic.block_events + VectorsGraphic.block_handlers VectorsGraphic.deleted VectorsGraphic.directions VectorsGraphic.event_handlers diff --git a/docs/source/api/graphics/index.rst b/docs/source/api/graphics/index.rst index bac85e6c1..6253b68a7 100644 --- a/docs/source/api/graphics/index.rst +++ b/docs/source/api/graphics/index.rst @@ -8,6 +8,7 @@ Graphics LineGraphic ScatterGraphic ImageGraphic + ImageYUVGraphic ImageVolumeGraphic VectorsGraphic MeshGraphic @@ -16,3 +17,5 @@ Graphics TextGraphic LineCollection LineStack + ScatterCollection + ScatterStack diff --git a/docs/source/api/layouts/imgui_figure.rst b/docs/source/api/layouts/imgui_figure.rst index 46e0c6ed3..fc3471afc 100644 --- a/docs/source/api/layouts/imgui_figure.rst +++ b/docs/source/api/layouts/imgui_figure.rst @@ -31,6 +31,7 @@ Properties ImguiFigure.names ImguiFigure.renderer ImguiFigure.shape + ImguiFigure.std_right_click_menu Methods ~~~~~~~ diff --git a/docs/source/api/layouts/subplot.rst b/docs/source/api/layouts/subplot.rst index 0916859b9..994a252fd 100644 --- a/docs/source/api/layouts/subplot.rst +++ b/docs/source/api/layouts/subplot.rst @@ -42,6 +42,8 @@ Properties Subplot.toolbar Subplot.tooltip Subplot.viewport + Subplot.x_range + Subplot.y_range Methods ~~~~~~~ @@ -52,12 +54,15 @@ Methods Subplot.add_graphic Subplot.add_image Subplot.add_image_volume + Subplot.add_image_yuv Subplot.add_line Subplot.add_line_collection Subplot.add_line_stack Subplot.add_mesh Subplot.add_polygon Subplot.add_scatter + Subplot.add_scatter_collection + Subplot.add_scatter_stack Subplot.add_surface Subplot.add_text Subplot.add_vectors diff --git a/docs/source/api/selectors/CollectionHighlightSelector.rst b/docs/source/api/selectors/CollectionHighlightSelector.rst new file mode 100644 index 000000000..4ebd29fce --- /dev/null +++ b/docs/source/api/selectors/CollectionHighlightSelector.rst @@ -0,0 +1,42 @@ +.. _api.CollectionHighlightSelector: + +CollectionHighlightSelector +*************************** + +=========================== +CollectionHighlightSelector +=========================== +.. currentmodule:: fastplotlib + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: CollectionHighlightSelector_api + + CollectionHighlightSelector + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: CollectionHighlightSelector_api + + CollectionHighlightSelector.alpha + CollectionHighlightSelector.color + CollectionHighlightSelector.graphics + CollectionHighlightSelector.lut + CollectionHighlightSelector.lut_wrap + CollectionHighlightSelector.selection + +Methods +~~~~~~~ +.. autosummary:: + :toctree: CollectionHighlightSelector_api + + CollectionHighlightSelector.add_event_handler + CollectionHighlightSelector.add_graphic + CollectionHighlightSelector.append + CollectionHighlightSelector.clear + CollectionHighlightSelector.remove + CollectionHighlightSelector.remove_event_handler + CollectionHighlightSelector.remove_graphic + diff --git a/docs/source/api/selectors/HighlightSelector.rst b/docs/source/api/selectors/HighlightSelector.rst new file mode 100644 index 000000000..82b09e86c --- /dev/null +++ b/docs/source/api/selectors/HighlightSelector.rst @@ -0,0 +1,42 @@ +.. _api.HighlightSelector: + +HighlightSelector +***************** + +================= +HighlightSelector +================= +.. currentmodule:: fastplotlib + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: HighlightSelector_api + + HighlightSelector + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: HighlightSelector_api + + HighlightSelector.alpha + HighlightSelector.color + HighlightSelector.graphics + HighlightSelector.lut + HighlightSelector.lut_wrap + HighlightSelector.selection + +Methods +~~~~~~~ +.. autosummary:: + :toctree: HighlightSelector_api + + HighlightSelector.add_event_handler + HighlightSelector.add_graphic + HighlightSelector.append + HighlightSelector.clear + HighlightSelector.remove + HighlightSelector.remove_event_handler + HighlightSelector.remove_graphic + diff --git a/docs/source/api/selectors/ImageHighlightSelector.rst b/docs/source/api/selectors/ImageHighlightSelector.rst new file mode 100644 index 000000000..2c2a0a23e --- /dev/null +++ b/docs/source/api/selectors/ImageHighlightSelector.rst @@ -0,0 +1,45 @@ +.. _api.ImageHighlightSelector: + +ImageHighlightSelector +********************** + +====================== +ImageHighlightSelector +====================== +.. currentmodule:: fastplotlib + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: ImageHighlightSelector_api + + ImageHighlightSelector + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: ImageHighlightSelector_api + + ImageHighlightSelector.alpha + ImageHighlightSelector.color + ImageHighlightSelector.graphics + ImageHighlightSelector.lut + ImageHighlightSelector.lut_wrap + ImageHighlightSelector.options_alpha + ImageHighlightSelector.options_color + ImageHighlightSelector.selection + ImageHighlightSelector.selection_options + +Methods +~~~~~~~ +.. autosummary:: + :toctree: ImageHighlightSelector_api + + ImageHighlightSelector.add_event_handler + ImageHighlightSelector.add_graphic + ImageHighlightSelector.append + ImageHighlightSelector.clear + ImageHighlightSelector.remove + ImageHighlightSelector.remove_event_handler + ImageHighlightSelector.remove_graphic + diff --git a/docs/source/api/selectors/ImageVisibilitySelector.rst b/docs/source/api/selectors/ImageVisibilitySelector.rst new file mode 100644 index 000000000..89f59a701 --- /dev/null +++ b/docs/source/api/selectors/ImageVisibilitySelector.rst @@ -0,0 +1,37 @@ +.. _api.ImageVisibilitySelector: + +ImageVisibilitySelector +*********************** + +======================= +ImageVisibilitySelector +======================= +.. currentmodule:: fastplotlib + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: ImageVisibilitySelector_api + + ImageVisibilitySelector + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: ImageVisibilitySelector_api + + ImageVisibilitySelector.axis + ImageVisibilitySelector.selection + +Methods +~~~~~~~ +.. autosummary:: + :toctree: ImageVisibilitySelector_api + + ImageVisibilitySelector.add_event_handler + ImageVisibilitySelector.append + ImageVisibilitySelector.clear + ImageVisibilitySelector.pop + ImageVisibilitySelector.remove + ImageVisibilitySelector.remove_event_handler + diff --git a/docs/source/api/selectors/LinearRegionSelector.rst b/docs/source/api/selectors/LinearRegionSelector.rst index eb48497cd..07baa200f 100644 --- a/docs/source/api/selectors/LinearRegionSelector.rst +++ b/docs/source/api/selectors/LinearRegionSelector.rst @@ -25,6 +25,7 @@ Properties LinearRegionSelector.axes LinearRegionSelector.axis LinearRegionSelector.block_events + LinearRegionSelector.block_handlers LinearRegionSelector.deleted LinearRegionSelector.edge_color LinearRegionSelector.event_handlers diff --git a/docs/source/api/selectors/LinearRegionSelectors.rst b/docs/source/api/selectors/LinearRegionSelectors.rst new file mode 100644 index 000000000..64e5675d4 --- /dev/null +++ b/docs/source/api/selectors/LinearRegionSelectors.rst @@ -0,0 +1,57 @@ +.. _api.LinearRegionSelectors: + +LinearRegionSelectors +********************* + +===================== +LinearRegionSelectors +===================== +.. currentmodule:: fastplotlib + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: LinearRegionSelectors_api + + LinearRegionSelectors + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: LinearRegionSelectors_api + + LinearRegionSelectors.alpha + LinearRegionSelectors.alpha_mode + LinearRegionSelectors.axes + LinearRegionSelectors.block_events + LinearRegionSelectors.block_handlers + LinearRegionSelectors.deleted + LinearRegionSelectors.event_handlers + LinearRegionSelectors.name + LinearRegionSelectors.offset + LinearRegionSelectors.right_click_menu + LinearRegionSelectors.rotation + LinearRegionSelectors.scale + LinearRegionSelectors.selection + LinearRegionSelectors.supported_events + LinearRegionSelectors.tooltip_format + LinearRegionSelectors.visible + LinearRegionSelectors.world_object + +Methods +~~~~~~~ +.. autosummary:: + :toctree: LinearRegionSelectors_api + + LinearRegionSelectors.add_axes + LinearRegionSelectors.add_event_handler + LinearRegionSelectors.append + LinearRegionSelectors.clear + LinearRegionSelectors.clear_event_handlers + LinearRegionSelectors.format_pick_info + LinearRegionSelectors.map_model_to_world + LinearRegionSelectors.map_world_to_model + LinearRegionSelectors.remove + LinearRegionSelectors.remove_event_handler + LinearRegionSelectors.rotate + diff --git a/docs/source/api/selectors/LinearSelector.rst b/docs/source/api/selectors/LinearSelector.rst index 2aa334748..e0e98bc13 100644 --- a/docs/source/api/selectors/LinearSelector.rst +++ b/docs/source/api/selectors/LinearSelector.rst @@ -25,6 +25,7 @@ Properties LinearSelector.axes LinearSelector.axis LinearSelector.block_events + LinearSelector.block_handlers LinearSelector.deleted LinearSelector.edge_color LinearSelector.event_handlers diff --git a/docs/source/api/selectors/LinearSelectors.rst b/docs/source/api/selectors/LinearSelectors.rst new file mode 100644 index 000000000..87204d070 --- /dev/null +++ b/docs/source/api/selectors/LinearSelectors.rst @@ -0,0 +1,57 @@ +.. _api.LinearSelectors: + +LinearSelectors +*************** + +=============== +LinearSelectors +=============== +.. currentmodule:: fastplotlib + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: LinearSelectors_api + + LinearSelectors + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: LinearSelectors_api + + LinearSelectors.alpha + LinearSelectors.alpha_mode + LinearSelectors.axes + LinearSelectors.block_events + LinearSelectors.block_handlers + LinearSelectors.deleted + LinearSelectors.event_handlers + LinearSelectors.name + LinearSelectors.offset + LinearSelectors.right_click_menu + LinearSelectors.rotation + LinearSelectors.scale + LinearSelectors.selection + LinearSelectors.supported_events + LinearSelectors.tooltip_format + LinearSelectors.visible + LinearSelectors.world_object + +Methods +~~~~~~~ +.. autosummary:: + :toctree: LinearSelectors_api + + LinearSelectors.add_axes + LinearSelectors.add_event_handler + LinearSelectors.append + LinearSelectors.clear + LinearSelectors.clear_event_handlers + LinearSelectors.format_pick_info + LinearSelectors.map_model_to_world + LinearSelectors.map_world_to_model + LinearSelectors.remove + LinearSelectors.remove_event_handler + LinearSelectors.rotate + diff --git a/docs/source/api/selectors/PolygonSelectors.rst b/docs/source/api/selectors/PolygonSelectors.rst new file mode 100644 index 000000000..b670e8bfd --- /dev/null +++ b/docs/source/api/selectors/PolygonSelectors.rst @@ -0,0 +1,57 @@ +.. _api.PolygonSelectors: + +PolygonSelectors +**************** + +================ +PolygonSelectors +================ +.. currentmodule:: fastplotlib + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: PolygonSelectors_api + + PolygonSelectors + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: PolygonSelectors_api + + PolygonSelectors.alpha + PolygonSelectors.alpha_mode + PolygonSelectors.axes + PolygonSelectors.block_events + PolygonSelectors.block_handlers + PolygonSelectors.deleted + PolygonSelectors.event_handlers + PolygonSelectors.name + PolygonSelectors.offset + PolygonSelectors.right_click_menu + PolygonSelectors.rotation + PolygonSelectors.scale + PolygonSelectors.selection + PolygonSelectors.supported_events + PolygonSelectors.tooltip_format + PolygonSelectors.visible + PolygonSelectors.world_object + +Methods +~~~~~~~ +.. autosummary:: + :toctree: PolygonSelectors_api + + PolygonSelectors.add_axes + PolygonSelectors.add_event_handler + PolygonSelectors.append + PolygonSelectors.clear + PolygonSelectors.clear_event_handlers + PolygonSelectors.format_pick_info + PolygonSelectors.map_model_to_world + PolygonSelectors.map_world_to_model + PolygonSelectors.remove + PolygonSelectors.remove_event_handler + PolygonSelectors.rotate + diff --git a/docs/source/api/selectors/PositionsHighlightSelector.rst b/docs/source/api/selectors/PositionsHighlightSelector.rst new file mode 100644 index 000000000..6c2722b60 --- /dev/null +++ b/docs/source/api/selectors/PositionsHighlightSelector.rst @@ -0,0 +1,42 @@ +.. _api.PositionsHighlightSelector: + +PositionsHighlightSelector +************************** + +========================== +PositionsHighlightSelector +========================== +.. currentmodule:: fastplotlib + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: PositionsHighlightSelector_api + + PositionsHighlightSelector + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: PositionsHighlightSelector_api + + PositionsHighlightSelector.alpha + PositionsHighlightSelector.color + PositionsHighlightSelector.graphics + PositionsHighlightSelector.lut + PositionsHighlightSelector.lut_wrap + PositionsHighlightSelector.selection + +Methods +~~~~~~~ +.. autosummary:: + :toctree: PositionsHighlightSelector_api + + PositionsHighlightSelector.add_event_handler + PositionsHighlightSelector.add_graphic + PositionsHighlightSelector.append + PositionsHighlightSelector.clear + PositionsHighlightSelector.remove + PositionsHighlightSelector.remove_event_handler + PositionsHighlightSelector.remove_graphic + diff --git a/docs/source/api/selectors/RectangleSelector.rst b/docs/source/api/selectors/RectangleSelector.rst index 51f6801a4..a9a8d9fd5 100644 --- a/docs/source/api/selectors/RectangleSelector.rst +++ b/docs/source/api/selectors/RectangleSelector.rst @@ -25,6 +25,7 @@ Properties RectangleSelector.axes RectangleSelector.axis RectangleSelector.block_events + RectangleSelector.block_handlers RectangleSelector.deleted RectangleSelector.edge_color RectangleSelector.event_handlers diff --git a/docs/source/api/selectors/RectangleSelectors.rst b/docs/source/api/selectors/RectangleSelectors.rst new file mode 100644 index 000000000..ae9d562c3 --- /dev/null +++ b/docs/source/api/selectors/RectangleSelectors.rst @@ -0,0 +1,57 @@ +.. _api.RectangleSelectors: + +RectangleSelectors +****************** + +================== +RectangleSelectors +================== +.. currentmodule:: fastplotlib + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: RectangleSelectors_api + + RectangleSelectors + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: RectangleSelectors_api + + RectangleSelectors.alpha + RectangleSelectors.alpha_mode + RectangleSelectors.axes + RectangleSelectors.block_events + RectangleSelectors.block_handlers + RectangleSelectors.deleted + RectangleSelectors.event_handlers + RectangleSelectors.name + RectangleSelectors.offset + RectangleSelectors.right_click_menu + RectangleSelectors.rotation + RectangleSelectors.scale + RectangleSelectors.selection + RectangleSelectors.supported_events + RectangleSelectors.tooltip_format + RectangleSelectors.visible + RectangleSelectors.world_object + +Methods +~~~~~~~ +.. autosummary:: + :toctree: RectangleSelectors_api + + RectangleSelectors.add_axes + RectangleSelectors.add_event_handler + RectangleSelectors.append + RectangleSelectors.clear + RectangleSelectors.clear_event_handlers + RectangleSelectors.format_pick_info + RectangleSelectors.map_model_to_world + RectangleSelectors.map_world_to_model + RectangleSelectors.remove + RectangleSelectors.remove_event_handler + RectangleSelectors.rotate + diff --git a/docs/source/api/selectors/SelectionVector.rst b/docs/source/api/selectors/SelectionVector.rst new file mode 100644 index 000000000..10acf180e --- /dev/null +++ b/docs/source/api/selectors/SelectionVector.rst @@ -0,0 +1,35 @@ +.. _api.SelectionVector: + +SelectionVector +*************** + +=============== +SelectionVector +=============== +.. currentmodule:: fastplotlib + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: SelectionVector_api + + SelectionVector + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: SelectionVector_api + + SelectionVector.selection + +Methods +~~~~~~~ +.. autosummary:: + :toctree: SelectionVector_api + + SelectionVector.add_selector + SelectionVector.append + SelectionVector.clear + SelectionVector.clear_selectables + SelectionVector.remove + diff --git a/docs/source/api/selectors/SelectorCollection.rst b/docs/source/api/selectors/SelectorCollection.rst new file mode 100644 index 000000000..9b4d24929 --- /dev/null +++ b/docs/source/api/selectors/SelectorCollection.rst @@ -0,0 +1,57 @@ +.. _api.SelectorCollection: + +SelectorCollection +****************** + +================== +SelectorCollection +================== +.. currentmodule:: fastplotlib + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: SelectorCollection_api + + SelectorCollection + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: SelectorCollection_api + + SelectorCollection.alpha + SelectorCollection.alpha_mode + SelectorCollection.axes + SelectorCollection.block_events + SelectorCollection.block_handlers + SelectorCollection.deleted + SelectorCollection.event_handlers + SelectorCollection.name + SelectorCollection.offset + SelectorCollection.right_click_menu + SelectorCollection.rotation + SelectorCollection.scale + SelectorCollection.selection + SelectorCollection.supported_events + SelectorCollection.tooltip_format + SelectorCollection.visible + SelectorCollection.world_object + +Methods +~~~~~~~ +.. autosummary:: + :toctree: SelectorCollection_api + + SelectorCollection.add_axes + SelectorCollection.add_event_handler + SelectorCollection.append + SelectorCollection.clear + SelectorCollection.clear_event_handlers + SelectorCollection.format_pick_info + SelectorCollection.map_model_to_world + SelectorCollection.map_world_to_model + SelectorCollection.remove + SelectorCollection.remove_event_handler + SelectorCollection.rotate + diff --git a/docs/source/api/selectors/VisibilitySelector.rst b/docs/source/api/selectors/VisibilitySelector.rst new file mode 100644 index 000000000..2b03c5914 --- /dev/null +++ b/docs/source/api/selectors/VisibilitySelector.rst @@ -0,0 +1,38 @@ +.. _api.VisibilitySelector: + +VisibilitySelector +****************** + +================== +VisibilitySelector +================== +.. currentmodule:: fastplotlib + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: VisibilitySelector_api + + VisibilitySelector + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: VisibilitySelector_api + + VisibilitySelector.lut + VisibilitySelector.lut_wrap + VisibilitySelector.selection + +Methods +~~~~~~~ +.. autosummary:: + :toctree: VisibilitySelector_api + + VisibilitySelector.add_event_handler + VisibilitySelector.append + VisibilitySelector.clear + VisibilitySelector.pop + VisibilitySelector.remove + VisibilitySelector.remove_event_handler + diff --git a/docs/source/api/selectors/index.rst b/docs/source/api/selectors/index.rst index 4a0caf8af..b33c5216e 100644 --- a/docs/source/api/selectors/index.rst +++ b/docs/source/api/selectors/index.rst @@ -7,3 +7,15 @@ Selectors LinearSelector LinearRegionSelector RectangleSelector + HighlightSelector + PositionsHighlightSelector + CollectionHighlightSelector + ImageHighlightSelector + VisibilitySelector + ImageVisibilitySelector + SelectorCollection + LinearSelectors + LinearRegionSelectors + RectangleSelectors + PolygonSelectors + SelectionVector diff --git a/docs/source/api/tools/HistogramLUTTool.rst b/docs/source/api/tools/HistogramLUTTool.rst index b3498dd68..d22ca3900 100644 --- a/docs/source/api/tools/HistogramLUTTool.rst +++ b/docs/source/api/tools/HistogramLUTTool.rst @@ -24,9 +24,11 @@ Properties HistogramLUTTool.alpha_mode HistogramLUTTool.axes HistogramLUTTool.block_events + HistogramLUTTool.block_handlers HistogramLUTTool.cmap HistogramLUTTool.deleted HistogramLUTTool.event_handlers + HistogramLUTTool.histogram HistogramLUTTool.images HistogramLUTTool.name HistogramLUTTool.offset @@ -53,5 +55,4 @@ Methods HistogramLUTTool.map_world_to_model HistogramLUTTool.remove_event_handler HistogramLUTTool.rotate - HistogramLUTTool.set_data diff --git a/docs/source/api/utils.rst b/docs/source/api/utils.rst index be7b1a049..6222e22c6 100644 --- a/docs/source/api/utils.rst +++ b/docs/source/api/utils.rst @@ -4,7 +4,3 @@ fastplotlib.utils .. currentmodule:: fastplotlib.utils .. automodule:: fastplotlib.utils.functions :members: - -.. currentmodule:: fastplotlib.utils -.. automodule:: fastplotlib.utils._plot_helpers - :members: diff --git a/docs/source/api/widgets/NDWidget.rst b/docs/source/api/widgets/NDWidget.rst new file mode 100644 index 000000000..7a09f3bbb --- /dev/null +++ b/docs/source/api/widgets/NDWidget.rst @@ -0,0 +1,35 @@ +.. _api.NDWidget: + +NDWidget +******** + +======== +NDWidget +======== +.. currentmodule:: fastplotlib + +Constructor +~~~~~~~~~~~ +.. autosummary:: + :toctree: NDWidget_api + + NDWidget + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: NDWidget_api + + NDWidget.figure + NDWidget.indices + NDWidget.ndgraphics + NDWidget.ranges + +Methods +~~~~~~~ +.. autosummary:: + :toctree: NDWidget_api + + NDWidget.close + NDWidget.show + diff --git a/docs/source/api/widgets/index.rst b/docs/source/api/widgets/index.rst index 5cb5299f6..c60b3c485 100644 --- a/docs/source/api/widgets/index.rst +++ b/docs/source/api/widgets/index.rst @@ -4,4 +4,5 @@ Widgets .. toctree:: :maxdepth: 1 + NDWidget ImageWidget diff --git a/docs/source/generate_api.py b/docs/source/generate_api.py index 0be967a36..5ca237f57 100644 --- a/docs/source/generate_api.py +++ b/docs/source/generate_api.py @@ -9,6 +9,7 @@ from fastplotlib.layouts import Subplot from fastplotlib import graphics from fastplotlib.graphics import features, selectors +from fastplotlib import axes from fastplotlib import tools from fastplotlib import widgets from fastplotlib import utils @@ -22,6 +23,7 @@ GRAPHICS_DIR = API_DIR.joinpath("graphics") GRAPHIC_FEATURES_DIR = API_DIR.joinpath("graphic_features") SELECTORS_DIR = API_DIR.joinpath("selectors") +AXES_DIR = API_DIR.joinpath("axes") TOOLS_DIR = API_DIR.joinpath("tools") WIDGETS_DIR = API_DIR.joinpath("widgets") UI_DIR = API_DIR.joinpath("ui") @@ -33,6 +35,7 @@ GRAPHICS_DIR, GRAPHIC_FEATURES_DIR, SELECTORS_DIR, + AXES_DIR, TOOLS_DIR, WIDGETS_DIR, UI_DIR, @@ -370,6 +373,33 @@ def main(): source_path=TOOLS_DIR.joinpath(f"{tool_cls.__name__}.rst"), ) + ############################################################################## + # ** Aes classes ** # + axes_classes = [getattr(axes, obj) for obj in axes.__all__] + + axes_class_names = [a.__name__ for a in axes_classes] + + axes_class_names_str = "\n ".join([""] + axes_class_names) + + with open(AXES_DIR.joinpath("index.rst"), "w") as f: + f.write( + f"Axes\n" + f"****\n" + f"\n" + f".. toctree::\n" + f" :maxdepth: 1\n" + f"{axes_class_names_str}\n" + ) + + for axes_cls in axes_classes: + generate_page( + page_name=axes_cls.__name__, + classes=[axes_cls], + modules=["fastplotlib.axes"], + source_path=AXES_DIR.joinpath(f"{axes_cls.__name__}.rst"), + ) + + ############################################################################## # ** Widget classes ** # widget_classes = [getattr(widgets, w) for w in widgets.__all__] @@ -424,7 +454,6 @@ def main(): ############################################################################## utils_str = generate_functions_module(utils.functions, "fastplotlib.utils") - utils_str += generate_functions_module(utils._plot_helpers, "fastplotlib.utils", generate_header=False) with open(API_DIR.joinpath("utils.rst"), "w") as f: f.write(utils_str) @@ -475,14 +504,15 @@ def write_table(name, feature_cls): continue f.write(f"{graphic_cls.__name__}\n") f.write("-" * len(graphic_cls.__name__) + "\n\n") - for name, type_ in graphic_cls._features.items(): - if isinstance(type_, tuple): - for t in type_: - if t is None: - continue - f.write(write_table(name, t)) - else: - f.write(write_table(name, type_)) + if hasattr(graphic_cls, "_features"): # some selectors like Highlight etc. don't have "graphic features" + for name, type_ in graphic_cls._features.items(): + if isinstance(type_, tuple): + for t in type_: + if t is None: + continue + f.write(write_table(name, t)) + else: + f.write(write_table(name, type_)) if __name__ == "__main__": diff --git a/docs/source/user_guide/event_tables.rst b/docs/source/user_guide/event_tables.rst index 42f168bea..0342807e1 100644 --- a/docs/source/user_guide/event_tables.rst +++ b/docs/source/user_guide/event_tables.rst @@ -603,6 +603,143 @@ deleted | value | bool | True when graphic was deleted | +----------+------+-------------------------------+ +ImageYUVGraphic +--------------- + +data +^^^^ + +**event info dict** + ++----------+--------------------------------------+--------------------------------------------------+ +| dict key | type | description | ++==========+======================================+==================================================+ +| key | slice, index, numpy-like fancy index | key at which image data was sliced/fancy indexed | ++----------+--------------------------------------+--------------------------------------------------+ +| value | np.ndarray | float | new data values | ++----------+--------------------------------------+--------------------------------------------------+ + +vmin +^^^^ + +**event info dict** + ++----------+-------+----------------+ +| dict key | type | description | ++==========+=======+================+ +| value | float | new vmin value | ++----------+-------+----------------+ + +vmax +^^^^ + +**event info dict** + ++----------+-------+----------------+ +| dict key | type | description | ++==========+=======+================+ +| value | float | new vmax value | ++----------+-------+----------------+ + +interpolation +^^^^^^^^^^^^^ + +**event info dict** + ++----------+------+--------------------------------------------+ +| dict key | type | description | ++==========+======+============================================+ +| value | str | new interpolation method, nearest | linear | ++----------+------+--------------------------------------------+ + +name +^^^^ + +**event info dict** + ++----------+------+--------------------+ +| dict key | type | description | ++==========+======+====================+ +| value | str | user provided name | ++----------+------+--------------------+ + +offset +^^^^^^ + +**event info dict** + ++----------+---------------------------------+----------------------+ +| dict key | type | description | ++==========+=================================+======================+ +| value | np.ndarray[float, float, float] | new offset (x, y, z) | ++----------+---------------------------------+----------------------+ + +rotation +^^^^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------------------+ +| dict key | type | description | ++==========+========================================+=========================+ +| value | np.ndarray[float, float, float, float] | new rotation quaternion | ++----------+----------------------------------------+-------------------------+ + +scale +^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------+ +| dict key | type | description | ++==========+========================================+=============+ +| value | np.ndarray[float, float, float, float] | new scale | ++----------+----------------------------------------+-------------+ + +alpha +^^^^^ + +**event info dict** + ++----------+-------+-----------------+ +| dict key | type | description | ++==========+=======+=================+ +| value | float | new alpha value | ++----------+-------+-----------------+ + +alpha_mode +^^^^^^^^^^ + +**event info dict** + ++----------+------+----------------+ +| dict key | type | description | ++==========+======+================+ +| value | str | new alpha mode | ++----------+------+----------------+ + +visible +^^^^^^^ + +**event info dict** + ++----------+------+---------------------+ +| dict key | type | description | ++==========+======+=====================+ +| value | bool | new visibility bool | ++----------+------+---------------------+ + +deleted +^^^^^^^ + +**event info dict** + ++----------+------+-------------------------------+ +| dict key | type | description | ++==========+======+===============================+ +| value | bool | True when graphic was deleted | ++----------+------+-------------------------------+ + ImageVolumeGraphic ------------------ @@ -1860,93 +1997,978 @@ deleted | value | bool | True when graphic was deleted | +----------+------+-------------------------------+ -LinearSelector --------------- +ScatterCollection +----------------- -selection -^^^^^^^^^ +data +^^^^ -**extra attributes** +**event info dict** -+--------------------+----------+----------------------------------+ -| attribute | type | description | -+====================+==========+==================================+ -| get_selected_index | callable | returns index under the selector | -+--------------------+----------+----------------------------------+ ++----------+----------------------------------------------+--------------------------------------------------------+ +| dict key | type | description | ++==========+==============================================+========================================================+ +| key | slice, index (int) or numpy-like fancy index | key at which vertex positions data were indexed/sliced | ++----------+----------------------------------------------+--------------------------------------------------------+ +| value | int | float | array-like | new data values for points that were changed | ++----------+----------------------------------------------+--------------------------------------------------------+ + +sizes +^^^^^ **event info dict** -+----------+-------+-------------------------------+ -| dict key | type | description | -+==========+=======+===============================+ -| value | float | new x or y value of selection | -+----------+-------+-------------------------------+ ++----------+----------------------------------------------+----------------------------------------------+ +| dict key | type | description | ++==========+==============================================+==============================================+ +| key | slice, index (int) or numpy-like fancy index | key at which point sizes were indexed/sliced | ++----------+----------------------------------------------+----------------------------------------------+ +| value | int | float | array-like | new size values for points that were changed | ++----------+----------------------------------------------+----------------------------------------------+ -name -^^^^ +sizes +^^^^^ **event info dict** -+----------+------+--------------------+ -| dict key | type | description | -+==========+======+====================+ -| value | str | user provided name | -+----------+------+--------------------+ ++----------+-------+----------------+ +| dict key | type | description | ++==========+=======+================+ +| value | float | new size value | ++----------+-------+----------------+ -offset +colors ^^^^^^ **event info dict** -+----------+---------------------------------+----------------------+ -| dict key | type | description | -+==========+=================================+======================+ -| value | np.ndarray[float, float, float] | new offset (x, y, z) | -+----------+---------------------------------+----------------------+ ++------------+--------------------------------------+------------------------------------------------------+ +| dict key | type | description | ++============+======================================+======================================================+ +| key | slice, index, numpy-like fancy index | index/slice at which colors were indexed/sliced | ++------------+--------------------------------------+------------------------------------------------------+ +| value | np.ndarray [n_points_changed, RGBA] | new color values for points that were changed | ++------------+--------------------------------------+------------------------------------------------------+ +| user_value | str or array-like | user input value that was parsed into the RGBA array | ++------------+--------------------------------------+------------------------------------------------------+ -rotation -^^^^^^^^ +colors +^^^^^^ **event info dict** -+----------+----------------------------------------+-------------------------+ -| dict key | type | description | -+==========+========================================+=========================+ -| value | np.ndarray[float, float, float, float] | new rotation quaternion | -+----------+----------------------------------------+-------------------------+ ++----------+--------------------------------------------------+-----------------+ +| dict key | type | description | ++==========+==================================================+=================+ +| value | str | pygfx.Color | np.ndarray | Sequence[float] | new color value | ++----------+--------------------------------------------------+-----------------+ -scale -^^^^^ +cmap +^^^^ **event info dict** -+----------+----------------------------------------+-------------+ -| dict key | type | description | -+==========+========================================+=============+ -| value | np.ndarray[float, float, float, float] | new scale | -+----------+----------------------------------------+-------------+ ++----------+-------+--------------------------------+ +| dict key | type | description | ++==========+=======+================================+ +| key | slice | key at cmap colors were sliced | ++----------+-------+--------------------------------+ +| value | str | new cmap to set at given slice | ++----------+-------+--------------------------------+ -alpha -^^^^^ +markers +^^^^^^^ **event info dict** -+----------+-------+-----------------+ -| dict key | type | description | -+==========+=======+=================+ -| value | float | new alpha value | -+----------+-------+-----------------+ ++----------+----------------------------------------------+------------------------------------------------+ +| dict key | type | description | ++==========+==============================================+================================================+ +| key | slice, index (int) or numpy-like fancy index | key at which markers were indexed/sliced | ++----------+----------------------------------------------+------------------------------------------------+ +| value | str | np.ndarray[str] | new marker values for points that were changed | ++----------+----------------------------------------------+------------------------------------------------+ -alpha_mode -^^^^^^^^^^ +markers +^^^^^^^ **event info dict** -+----------+------+----------------+ -| dict key | type | description | -+==========+======+================+ -| value | str | new alpha mode | -+----------+------+----------------+ ++----------+------------+------------------+ +| dict key | type | description | ++==========+============+==================+ +| value | str | None | new marker value | ++----------+------------+------------------+ + +edge_colors +^^^^^^^^^^^ + +**event info dict** + ++----------+--------------------------------------------------+----------------+ +| dict key | type | description | ++==========+==================================================+================+ +| value | str | np.ndarray | pygfx.Color | Sequence[float] | new edge_color | ++----------+--------------------------------------------------+----------------+ + +edge_colors +^^^^^^^^^^^ + +**event info dict** + ++------------+--------------------------------------+------------------------------------------------------+ +| dict key | type | description | ++============+======================================+======================================================+ +| key | slice, index, numpy-like fancy index | index/slice at which colors were indexed/sliced | ++------------+--------------------------------------+------------------------------------------------------+ +| value | np.ndarray [n_points_changed, RGBA] | new color values for points that were changed | ++------------+--------------------------------------+------------------------------------------------------+ +| user_value | str or array-like | user input value that was parsed into the RGBA array | ++------------+--------------------------------------+------------------------------------------------------+ + +edge_width +^^^^^^^^^^ + +**event info dict** + ++----------+-------+----------------+ +| dict key | type | description | ++==========+=======+================+ +| value | float | new edge_width | ++----------+-------+----------------+ + +image +^^^^^ + +**event info dict** + ++----------+--------------------------------------+--------------------------------------------------+ +| dict key | type | description | ++==========+======================================+==================================================+ +| key | slice, index, numpy-like fancy index | key at which image data was sliced/fancy indexed | ++----------+--------------------------------------+--------------------------------------------------+ +| value | np.ndarray | float | new data values | ++----------+--------------------------------------+--------------------------------------------------+ + +size_space +^^^^^^^^^^ + +**event info dict** + ++----------+------+------------------------------+ +| dict key | type | description | ++==========+======+==============================+ +| value | str | 'screen' | 'world' | 'model' | ++----------+------+------------------------------+ + +point_rotations +^^^^^^^^^^^^^^^ + +**event info dict** + ++----------+-------+----------------+ +| dict key | type | description | ++==========+=======+================+ +| value | float | new edge_width | ++----------+-------+----------------+ + +point_rotations +^^^^^^^^^^^^^^^ + +**event info dict** + ++----------+----------------------------------------------+--------------------------------------------------+ +| dict key | type | description | ++==========+==============================================+==================================================+ +| key | slice, index (int) or numpy-like fancy index | key at which point rotations were indexed/sliced | ++----------+----------------------------------------------+--------------------------------------------------+ +| value | int | float | array-like | new rotation values for points that were changed | ++----------+----------------------------------------------+--------------------------------------------------+ + +name +^^^^ + +**event info dict** + ++----------+------+--------------------+ +| dict key | type | description | ++==========+======+====================+ +| value | str | user provided name | ++----------+------+--------------------+ + +offset +^^^^^^ + +**event info dict** + ++----------+---------------------------------+----------------------+ +| dict key | type | description | ++==========+=================================+======================+ +| value | np.ndarray[float, float, float] | new offset (x, y, z) | ++----------+---------------------------------+----------------------+ + +rotation +^^^^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------------------+ +| dict key | type | description | ++==========+========================================+=========================+ +| value | np.ndarray[float, float, float, float] | new rotation quaternion | ++----------+----------------------------------------+-------------------------+ + +scale +^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------+ +| dict key | type | description | ++==========+========================================+=============+ +| value | np.ndarray[float, float, float, float] | new scale | ++----------+----------------------------------------+-------------+ + +alpha +^^^^^ + +**event info dict** + ++----------+-------+-----------------+ +| dict key | type | description | ++==========+=======+=================+ +| value | float | new alpha value | ++----------+-------+-----------------+ + +alpha_mode +^^^^^^^^^^ + +**event info dict** + ++----------+------+----------------+ +| dict key | type | description | ++==========+======+================+ +| value | str | new alpha mode | ++----------+------+----------------+ + +visible +^^^^^^^ + +**event info dict** + ++----------+------+---------------------+ +| dict key | type | description | ++==========+======+=====================+ +| value | bool | new visibility bool | ++----------+------+---------------------+ + +deleted +^^^^^^^ + +**event info dict** + ++----------+------+-------------------------------+ +| dict key | type | description | ++==========+======+===============================+ +| value | bool | True when graphic was deleted | ++----------+------+-------------------------------+ + +ScatterStack +------------ + +data +^^^^ + +**event info dict** + ++----------+----------------------------------------------+--------------------------------------------------------+ +| dict key | type | description | ++==========+==============================================+========================================================+ +| key | slice, index (int) or numpy-like fancy index | key at which vertex positions data were indexed/sliced | ++----------+----------------------------------------------+--------------------------------------------------------+ +| value | int | float | array-like | new data values for points that were changed | ++----------+----------------------------------------------+--------------------------------------------------------+ + +sizes +^^^^^ + +**event info dict** + ++----------+----------------------------------------------+----------------------------------------------+ +| dict key | type | description | ++==========+==============================================+==============================================+ +| key | slice, index (int) or numpy-like fancy index | key at which point sizes were indexed/sliced | ++----------+----------------------------------------------+----------------------------------------------+ +| value | int | float | array-like | new size values for points that were changed | ++----------+----------------------------------------------+----------------------------------------------+ + +sizes +^^^^^ + +**event info dict** + ++----------+-------+----------------+ +| dict key | type | description | ++==========+=======+================+ +| value | float | new size value | ++----------+-------+----------------+ + +colors +^^^^^^ + +**event info dict** + ++------------+--------------------------------------+------------------------------------------------------+ +| dict key | type | description | ++============+======================================+======================================================+ +| key | slice, index, numpy-like fancy index | index/slice at which colors were indexed/sliced | ++------------+--------------------------------------+------------------------------------------------------+ +| value | np.ndarray [n_points_changed, RGBA] | new color values for points that were changed | ++------------+--------------------------------------+------------------------------------------------------+ +| user_value | str or array-like | user input value that was parsed into the RGBA array | ++------------+--------------------------------------+------------------------------------------------------+ + +colors +^^^^^^ + +**event info dict** + ++----------+--------------------------------------------------+-----------------+ +| dict key | type | description | ++==========+==================================================+=================+ +| value | str | pygfx.Color | np.ndarray | Sequence[float] | new color value | ++----------+--------------------------------------------------+-----------------+ + +cmap +^^^^ + +**event info dict** + ++----------+-------+--------------------------------+ +| dict key | type | description | ++==========+=======+================================+ +| key | slice | key at cmap colors were sliced | ++----------+-------+--------------------------------+ +| value | str | new cmap to set at given slice | ++----------+-------+--------------------------------+ + +markers +^^^^^^^ + +**event info dict** + ++----------+----------------------------------------------+------------------------------------------------+ +| dict key | type | description | ++==========+==============================================+================================================+ +| key | slice, index (int) or numpy-like fancy index | key at which markers were indexed/sliced | ++----------+----------------------------------------------+------------------------------------------------+ +| value | str | np.ndarray[str] | new marker values for points that were changed | ++----------+----------------------------------------------+------------------------------------------------+ + +markers +^^^^^^^ + +**event info dict** + ++----------+------------+------------------+ +| dict key | type | description | ++==========+============+==================+ +| value | str | None | new marker value | ++----------+------------+------------------+ + +edge_colors +^^^^^^^^^^^ + +**event info dict** + ++----------+--------------------------------------------------+----------------+ +| dict key | type | description | ++==========+==================================================+================+ +| value | str | np.ndarray | pygfx.Color | Sequence[float] | new edge_color | ++----------+--------------------------------------------------+----------------+ + +edge_colors +^^^^^^^^^^^ + +**event info dict** + ++------------+--------------------------------------+------------------------------------------------------+ +| dict key | type | description | ++============+======================================+======================================================+ +| key | slice, index, numpy-like fancy index | index/slice at which colors were indexed/sliced | ++------------+--------------------------------------+------------------------------------------------------+ +| value | np.ndarray [n_points_changed, RGBA] | new color values for points that were changed | ++------------+--------------------------------------+------------------------------------------------------+ +| user_value | str or array-like | user input value that was parsed into the RGBA array | ++------------+--------------------------------------+------------------------------------------------------+ + +edge_width +^^^^^^^^^^ + +**event info dict** + ++----------+-------+----------------+ +| dict key | type | description | ++==========+=======+================+ +| value | float | new edge_width | ++----------+-------+----------------+ + +image +^^^^^ + +**event info dict** + ++----------+--------------------------------------+--------------------------------------------------+ +| dict key | type | description | ++==========+======================================+==================================================+ +| key | slice, index, numpy-like fancy index | key at which image data was sliced/fancy indexed | ++----------+--------------------------------------+--------------------------------------------------+ +| value | np.ndarray | float | new data values | ++----------+--------------------------------------+--------------------------------------------------+ + +size_space +^^^^^^^^^^ + +**event info dict** + ++----------+------+------------------------------+ +| dict key | type | description | ++==========+======+==============================+ +| value | str | 'screen' | 'world' | 'model' | ++----------+------+------------------------------+ + +point_rotations +^^^^^^^^^^^^^^^ + +**event info dict** + ++----------+-------+----------------+ +| dict key | type | description | ++==========+=======+================+ +| value | float | new edge_width | ++----------+-------+----------------+ + +point_rotations +^^^^^^^^^^^^^^^ + +**event info dict** + ++----------+----------------------------------------------+--------------------------------------------------+ +| dict key | type | description | ++==========+==============================================+==================================================+ +| key | slice, index (int) or numpy-like fancy index | key at which point rotations were indexed/sliced | ++----------+----------------------------------------------+--------------------------------------------------+ +| value | int | float | array-like | new rotation values for points that were changed | ++----------+----------------------------------------------+--------------------------------------------------+ + +name +^^^^ + +**event info dict** + ++----------+------+--------------------+ +| dict key | type | description | ++==========+======+====================+ +| value | str | user provided name | ++----------+------+--------------------+ + +offset +^^^^^^ + +**event info dict** + ++----------+---------------------------------+----------------------+ +| dict key | type | description | ++==========+=================================+======================+ +| value | np.ndarray[float, float, float] | new offset (x, y, z) | ++----------+---------------------------------+----------------------+ + +rotation +^^^^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------------------+ +| dict key | type | description | ++==========+========================================+=========================+ +| value | np.ndarray[float, float, float, float] | new rotation quaternion | ++----------+----------------------------------------+-------------------------+ + +scale +^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------+ +| dict key | type | description | ++==========+========================================+=============+ +| value | np.ndarray[float, float, float, float] | new scale | ++----------+----------------------------------------+-------------+ + +alpha +^^^^^ + +**event info dict** + ++----------+-------+-----------------+ +| dict key | type | description | ++==========+=======+=================+ +| value | float | new alpha value | ++----------+-------+-----------------+ + +alpha_mode +^^^^^^^^^^ + +**event info dict** + ++----------+------+----------------+ +| dict key | type | description | ++==========+======+================+ +| value | str | new alpha mode | ++----------+------+----------------+ + +visible +^^^^^^^ + +**event info dict** + ++----------+------+---------------------+ +| dict key | type | description | ++==========+======+=====================+ +| value | bool | new visibility bool | ++----------+------+---------------------+ + +deleted +^^^^^^^ + +**event info dict** + ++----------+------+-------------------------------+ +| dict key | type | description | ++==========+======+===============================+ +| value | bool | True when graphic was deleted | ++----------+------+-------------------------------+ + +LinearSelector +-------------- + +selection +^^^^^^^^^ + +**extra attributes** + ++--------------------+----------+----------------------------------+ +| attribute | type | description | ++====================+==========+==================================+ +| get_selected_index | callable | returns index under the selector | ++--------------------+----------+----------------------------------+ + +**event info dict** + ++----------+-------+-------------------------------+ +| dict key | type | description | ++==========+=======+===============================+ +| value | float | new x or y value of selection | ++----------+-------+-------------------------------+ + +name +^^^^ + +**event info dict** + ++----------+------+--------------------+ +| dict key | type | description | ++==========+======+====================+ +| value | str | user provided name | ++----------+------+--------------------+ + +offset +^^^^^^ + +**event info dict** + ++----------+---------------------------------+----------------------+ +| dict key | type | description | ++==========+=================================+======================+ +| value | np.ndarray[float, float, float] | new offset (x, y, z) | ++----------+---------------------------------+----------------------+ + +rotation +^^^^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------------------+ +| dict key | type | description | ++==========+========================================+=========================+ +| value | np.ndarray[float, float, float, float] | new rotation quaternion | ++----------+----------------------------------------+-------------------------+ + +scale +^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------+ +| dict key | type | description | ++==========+========================================+=============+ +| value | np.ndarray[float, float, float, float] | new scale | ++----------+----------------------------------------+-------------+ + +alpha +^^^^^ + +**event info dict** + ++----------+-------+-----------------+ +| dict key | type | description | ++==========+=======+=================+ +| value | float | new alpha value | ++----------+-------+-----------------+ + +alpha_mode +^^^^^^^^^^ + +**event info dict** + ++----------+------+----------------+ +| dict key | type | description | ++==========+======+================+ +| value | str | new alpha mode | ++----------+------+----------------+ + +visible +^^^^^^^ + +**event info dict** + ++----------+------+---------------------+ +| dict key | type | description | ++==========+======+=====================+ +| value | bool | new visibility bool | ++----------+------+---------------------+ + +deleted +^^^^^^^ + +**event info dict** + ++----------+------+-------------------------------+ +| dict key | type | description | ++==========+======+===============================+ +| value | bool | True when graphic was deleted | ++----------+------+-------------------------------+ + +LinearRegionSelector +-------------------- + +selection +^^^^^^^^^ + +**extra attributes** + ++----------------------+----------+------------------------------------+ +| attribute | type | description | ++======================+==========+====================================+ +| get_selected_indices | callable | returns indices under the selector | ++----------------------+----------+------------------------------------+ +| get_selected_data | callable | returns data under the selector | ++----------------------+----------+------------------------------------+ + +**event info dict** + ++----------+------------+-----------------------------+ +| dict key | type | description | ++==========+============+=============================+ +| value | np.ndarray | new [min, max] of selection | ++----------+------------+-----------------------------+ + +name +^^^^ + +**event info dict** + ++----------+------+--------------------+ +| dict key | type | description | ++==========+======+====================+ +| value | str | user provided name | ++----------+------+--------------------+ + +offset +^^^^^^ + +**event info dict** + ++----------+---------------------------------+----------------------+ +| dict key | type | description | ++==========+=================================+======================+ +| value | np.ndarray[float, float, float] | new offset (x, y, z) | ++----------+---------------------------------+----------------------+ + +rotation +^^^^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------------------+ +| dict key | type | description | ++==========+========================================+=========================+ +| value | np.ndarray[float, float, float, float] | new rotation quaternion | ++----------+----------------------------------------+-------------------------+ + +scale +^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------+ +| dict key | type | description | ++==========+========================================+=============+ +| value | np.ndarray[float, float, float, float] | new scale | ++----------+----------------------------------------+-------------+ + +alpha +^^^^^ + +**event info dict** + ++----------+-------+-----------------+ +| dict key | type | description | ++==========+=======+=================+ +| value | float | new alpha value | ++----------+-------+-----------------+ + +alpha_mode +^^^^^^^^^^ + +**event info dict** + ++----------+------+----------------+ +| dict key | type | description | ++==========+======+================+ +| value | str | new alpha mode | ++----------+------+----------------+ + +visible +^^^^^^^ + +**event info dict** + ++----------+------+---------------------+ +| dict key | type | description | ++==========+======+=====================+ +| value | bool | new visibility bool | ++----------+------+---------------------+ + +deleted +^^^^^^^ + +**event info dict** + ++----------+------+-------------------------------+ +| dict key | type | description | ++==========+======+===============================+ +| value | bool | True when graphic was deleted | ++----------+------+-------------------------------+ + +RectangleSelector +----------------- + +selection +^^^^^^^^^ + +**extra attributes** + ++----------------------+----------+------------------------------------+ +| attribute | type | description | ++======================+==========+====================================+ +| get_selected_indices | callable | returns indices under the selector | ++----------------------+----------+------------------------------------+ +| get_selected_data | callable | returns data under the selector | ++----------------------+----------+------------------------------------+ + +**event info dict** + ++----------+------------+-------------------------------------------+ +| dict key | type | description | ++==========+============+===========================================+ +| value | np.ndarray | new [xmin, xmax, ymin, ymax] of selection | ++----------+------------+-------------------------------------------+ + +name +^^^^ + +**event info dict** + ++----------+------+--------------------+ +| dict key | type | description | ++==========+======+====================+ +| value | str | user provided name | ++----------+------+--------------------+ + +offset +^^^^^^ + +**event info dict** + ++----------+---------------------------------+----------------------+ +| dict key | type | description | ++==========+=================================+======================+ +| value | np.ndarray[float, float, float] | new offset (x, y, z) | ++----------+---------------------------------+----------------------+ + +rotation +^^^^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------------------+ +| dict key | type | description | ++==========+========================================+=========================+ +| value | np.ndarray[float, float, float, float] | new rotation quaternion | ++----------+----------------------------------------+-------------------------+ + +scale +^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------+ +| dict key | type | description | ++==========+========================================+=============+ +| value | np.ndarray[float, float, float, float] | new scale | ++----------+----------------------------------------+-------------+ + +alpha +^^^^^ + +**event info dict** + ++----------+-------+-----------------+ +| dict key | type | description | ++==========+=======+=================+ +| value | float | new alpha value | ++----------+-------+-----------------+ + +alpha_mode +^^^^^^^^^^ + +**event info dict** + ++----------+------+----------------+ +| dict key | type | description | ++==========+======+================+ +| value | str | new alpha mode | ++----------+------+----------------+ + +visible +^^^^^^^ + +**event info dict** + ++----------+------+---------------------+ +| dict key | type | description | ++==========+======+=====================+ +| value | bool | new visibility bool | ++----------+------+---------------------+ + +deleted +^^^^^^^ + +**event info dict** + ++----------+------+-------------------------------+ +| dict key | type | description | ++==========+======+===============================+ +| value | bool | True when graphic was deleted | ++----------+------+-------------------------------+ + +HighlightSelector +----------------- + +PositionsHighlightSelector +-------------------------- + +CollectionHighlightSelector +--------------------------- + +ImageHighlightSelector +---------------------- + +VisibilitySelector +------------------ + +ImageVisibilitySelector +----------------------- + +SelectorCollection +------------------ + +name +^^^^ + +**event info dict** + ++----------+------+--------------------+ +| dict key | type | description | ++==========+======+====================+ +| value | str | user provided name | ++----------+------+--------------------+ + +offset +^^^^^^ + +**event info dict** + ++----------+---------------------------------+----------------------+ +| dict key | type | description | ++==========+=================================+======================+ +| value | np.ndarray[float, float, float] | new offset (x, y, z) | ++----------+---------------------------------+----------------------+ + +rotation +^^^^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------------------+ +| dict key | type | description | ++==========+========================================+=========================+ +| value | np.ndarray[float, float, float, float] | new rotation quaternion | ++----------+----------------------------------------+-------------------------+ + +scale +^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------+ +| dict key | type | description | ++==========+========================================+=============+ +| value | np.ndarray[float, float, float, float] | new scale | ++----------+----------------------------------------+-------------+ + +alpha +^^^^^ + +**event info dict** + ++----------+-------+-----------------+ +| dict key | type | description | ++==========+=======+=================+ +| value | float | new alpha value | ++----------+-------+-----------------+ + +alpha_mode +^^^^^^^^^^ + +**event info dict** + ++----------+------+----------------+ +| dict key | type | description | ++==========+======+================+ +| value | str | new alpha mode | ++----------+------+----------------+ visible ^^^^^^^ @@ -1970,29 +2992,99 @@ deleted | value | bool | True when graphic was deleted | +----------+------+-------------------------------+ -LinearRegionSelector --------------------- +LinearSelectors +--------------- -selection -^^^^^^^^^ +name +^^^^ -**extra attributes** +**event info dict** -+----------------------+----------+------------------------------------+ -| attribute | type | description | -+======================+==========+====================================+ -| get_selected_indices | callable | returns indices under the selector | -+----------------------+----------+------------------------------------+ -| get_selected_data | callable | returns data under the selector | -+----------------------+----------+------------------------------------+ ++----------+------+--------------------+ +| dict key | type | description | ++==========+======+====================+ +| value | str | user provided name | ++----------+------+--------------------+ + +offset +^^^^^^ **event info dict** -+----------+------------+-----------------------------+ -| dict key | type | description | -+==========+============+=============================+ -| value | np.ndarray | new [min, max] of selection | -+----------+------------+-----------------------------+ ++----------+---------------------------------+----------------------+ +| dict key | type | description | ++==========+=================================+======================+ +| value | np.ndarray[float, float, float] | new offset (x, y, z) | ++----------+---------------------------------+----------------------+ + +rotation +^^^^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------------------+ +| dict key | type | description | ++==========+========================================+=========================+ +| value | np.ndarray[float, float, float, float] | new rotation quaternion | ++----------+----------------------------------------+-------------------------+ + +scale +^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------+ +| dict key | type | description | ++==========+========================================+=============+ +| value | np.ndarray[float, float, float, float] | new scale | ++----------+----------------------------------------+-------------+ + +alpha +^^^^^ + +**event info dict** + ++----------+-------+-----------------+ +| dict key | type | description | ++==========+=======+=================+ +| value | float | new alpha value | ++----------+-------+-----------------+ + +alpha_mode +^^^^^^^^^^ + +**event info dict** + ++----------+------+----------------+ +| dict key | type | description | ++==========+======+================+ +| value | str | new alpha mode | ++----------+------+----------------+ + +visible +^^^^^^^ + +**event info dict** + ++----------+------+---------------------+ +| dict key | type | description | ++==========+======+=====================+ +| value | bool | new visibility bool | ++----------+------+---------------------+ + +deleted +^^^^^^^ + +**event info dict** + ++----------+------+-------------------------------+ +| dict key | type | description | ++==========+======+===============================+ +| value | bool | True when graphic was deleted | ++----------+------+-------------------------------+ + +LinearRegionSelectors +--------------------- name ^^^^ @@ -2082,29 +3174,99 @@ deleted | value | bool | True when graphic was deleted | +----------+------+-------------------------------+ -RectangleSelector ------------------ +RectangleSelectors +------------------ -selection -^^^^^^^^^ +name +^^^^ -**extra attributes** +**event info dict** -+----------------------+----------+------------------------------------+ -| attribute | type | description | -+======================+==========+====================================+ -| get_selected_indices | callable | returns indices under the selector | -+----------------------+----------+------------------------------------+ -| get_selected_data | callable | returns data under the selector | -+----------------------+----------+------------------------------------+ ++----------+------+--------------------+ +| dict key | type | description | ++==========+======+====================+ +| value | str | user provided name | ++----------+------+--------------------+ + +offset +^^^^^^ **event info dict** -+----------+------------+-------------------------------------------+ -| dict key | type | description | -+==========+============+===========================================+ -| value | np.ndarray | new [xmin, xmax, ymin, ymax] of selection | -+----------+------------+-------------------------------------------+ ++----------+---------------------------------+----------------------+ +| dict key | type | description | ++==========+=================================+======================+ +| value | np.ndarray[float, float, float] | new offset (x, y, z) | ++----------+---------------------------------+----------------------+ + +rotation +^^^^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------------------+ +| dict key | type | description | ++==========+========================================+=========================+ +| value | np.ndarray[float, float, float, float] | new rotation quaternion | ++----------+----------------------------------------+-------------------------+ + +scale +^^^^^ + +**event info dict** + ++----------+----------------------------------------+-------------+ +| dict key | type | description | ++==========+========================================+=============+ +| value | np.ndarray[float, float, float, float] | new scale | ++----------+----------------------------------------+-------------+ + +alpha +^^^^^ + +**event info dict** + ++----------+-------+-----------------+ +| dict key | type | description | ++==========+=======+=================+ +| value | float | new alpha value | ++----------+-------+-----------------+ + +alpha_mode +^^^^^^^^^^ + +**event info dict** + ++----------+------+----------------+ +| dict key | type | description | ++==========+======+================+ +| value | str | new alpha mode | ++----------+------+----------------+ + +visible +^^^^^^^ + +**event info dict** + ++----------+------+---------------------+ +| dict key | type | description | ++==========+======+=====================+ +| value | bool | new visibility bool | ++----------+------+---------------------+ + +deleted +^^^^^^^ + +**event info dict** + ++----------+------+-------------------------------+ +| dict key | type | description | ++==========+======+===============================+ +| value | bool | True when graphic was deleted | ++----------+------+-------------------------------+ + +PolygonSelectors +---------------- name ^^^^ @@ -2194,3 +3356,6 @@ deleted | value | bool | True when graphic was deleted | +----------+------+-------------------------------+ +SelectionVector +--------------- + diff --git a/fastplotlib/__init__.py b/fastplotlib/__init__.py index c4626a041..00e31c977 100644 --- a/fastplotlib/__init__.py +++ b/fastplotlib/__init__.py @@ -1,5 +1,3 @@ -from pathlib import Path - from ._version import __version__, version_info # this must be the first import for auto-canvas detection @@ -15,7 +13,7 @@ from .graphics import * from .graphics.features import GraphicFeatureEvent from .graphics.selectors import * -from .graphics.utils import pause_events +from .graphics.utils import pause_events, get_nearest_graphics, get_nearest_graphics_indices from .legends import * from .tools import * diff --git a/fastplotlib/axes/__init__.py b/fastplotlib/axes/__init__.py new file mode 100644 index 000000000..bf9f72e04 --- /dev/null +++ b/fastplotlib/axes/__init__.py @@ -0,0 +1,8 @@ +from ._axes import Grid, Grids, Ruler, Axes + +__all__ = [ + "Grid", + "Grids", + "Ruler", + "Axes", +] diff --git a/fastplotlib/graphics/_axes.py b/fastplotlib/axes/_axes.py similarity index 76% rename from fastplotlib/graphics/_axes.py rename to fastplotlib/axes/_axes.py index 56ca792a4..dfd488f86 100644 --- a/fastplotlib/graphics/_axes.py +++ b/fastplotlib/axes/_axes.py @@ -1,3 +1,5 @@ +import math + import numpy as np import pygfx @@ -5,7 +7,6 @@ from ..utils.enums import RenderQueue - GRID_PLANES = ["xy", "xz", "yz"] CANONICAL_BAIS = np.array([[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]) @@ -143,6 +144,110 @@ def yz(self) -> Grid: return self._yz +class Ruler(pygfx.Ruler): + """pygfx.Ruler subclass that adds a rotated axis label.""" + + def __init__(self, *, color="#fff", alpha_mode=None, render_queue=None, **kwargs): + super().__init__( + color=color, alpha_mode=alpha_mode, render_queue=render_queue, **kwargs + ) + self._label = pygfx.Text( + screen_space=True, + anchor="middle-center", + font_size=16, + material=pygfx.TextMaterial( + color=color, + alpha_mode="auto", + render_queue=RenderQueue.overlay + 50, + aa=True, + ), + ) + self._label.visible = False + self.add(self._label) + + @property + def label(self) -> pygfx.Text: + """Axis label. Set text via ``label.set_text('label text')``""" + return self._label + + @property + def color(self): + return self._text.material.color + + @color.setter + def color(self, color): + self._text.material.color = color + self._line.material.color = color + self._points.material.edge_color = color + self._label.material.color = color + + def update(self, camera, canvas_size): + stats = super().update(camera, canvas_size) + self._update_label() + return stats + + def _update_label(self): + # update the label position + t1, t2 = self._visible_part_coords + if t1 == t2: + self._label.visible = False + return + self._label.visible = True + + mid_t = 0.5 * (t1 + t2) + mid_pos = self._start_pos * (1 - mid_t) + self._end_pos * mid_t + + world_vec = self._end_pos - self._start_pos + world_len = np.linalg.norm(world_vec) + screen_len = np.linalg.norm(self._screen_vec) + + if world_len > 0 and screen_len > 0: + world_dir = world_vec / world_len + # perpendicular in the xy plane: CCW = "left", CW = "right" + if self.tick_side == "left": + perp_world = np.array([-world_dir[1], world_dir[0], 0.0]) + else: + perp_world = np.array([world_dir[1], -world_dir[0], 0.0]) + + # same perpendicular in screen space, for projecting tick label rects + screen_dir = self._screen_vec / screen_len + if self.tick_side == "left": + px, py = -screen_dir[1], screen_dir[0] + else: + px, py = screen_dir[1], -screen_dir[0] + + # max extent of tick labels in the perpendicular direction. + # tick labels are unrotated screen-space text, so we project their + # axis-aligned _rect onto (px, py) directly. + visible_blocks = [ + b + for b in self.text._text_blocks + if b._rect.width > 0 or b._rect.height > 0 + ] + if visible_blocks: + tick_extent_px = max( + max(px, 0) * b._rect.right + + min(px, 0) * b._rect.left + + max(py, 0) * b._rect.top + + min(py, 0) * b._rect.bottom + for b in visible_blocks + ) + else: + tick_extent_px = 0.0 + + offset_px = max(tick_extent_px, 0.0) + self._label.font_size + mid_pos = mid_pos + (offset_px / (screen_len / world_len)) * perp_world + + self._label.local.position = mid_pos + + vec = self._visible_part_screen_vec + angle = math.atan2(vec[1], vec[0]) + # pylinalg uses [x, y, z, w] quaternion format + self._label.local.rotation = np.array( + [0.0, 0.0, math.sin(angle / 2), math.cos(angle / 2)] + ) + + class Axes: def __init__( self, @@ -191,15 +296,9 @@ def __init__( ) # create ruler for each dim - self._x = pygfx.Ruler( - alpha_mode="solid", render_queue=RenderQueue.axes, **x_kwargs - ) - self._y = pygfx.Ruler( - alpha_mode="solid", render_queue=RenderQueue.axes, **y_kwargs - ) - self._z = pygfx.Ruler( - alpha_mode="solid", render_queue=RenderQueue.axes, **z_kwargs - ) + self._x = Ruler(alpha_mode="solid", render_queue=RenderQueue.axes, **x_kwargs) + self._y = Ruler(alpha_mode="solid", render_queue=RenderQueue.axes, **y_kwargs) + self._z = Ruler(alpha_mode="solid", render_queue=RenderQueue.axes, **z_kwargs) # We render the lines and ticks as solid, but enable aa for text for prettier glyphs for ruler in self._x, self._y, self._z: @@ -208,6 +307,7 @@ def __init__( ruler.text.material.depth_compare = "<=" ruler.text.material.alpha_mode = "auto" ruler.text.material.aa = True + ruler.label.material.depth_compare = "<=" self._offset = offset @@ -319,7 +419,7 @@ def basis(self, basis: np.ndarray): # apply quaternion to each of x, y, z rulers for dim, cbasis, new_basis in zip(["x", "y", "z"], CANONICAL_BAIS, basis): - ruler: pygfx.Ruler = getattr(self, dim) + ruler: Ruler = getattr(self, dim) ruler.local.rotation = quat_from_vecs(cbasis, new_basis) @property @@ -332,17 +432,17 @@ def offset(self, value: np.ndarray): self._offset = value @property - def x(self) -> pygfx.Ruler: + def x(self) -> Ruler: """x axis ruler""" return self._x @property - def y(self) -> pygfx.Ruler: + def y(self) -> Ruler: """y axis ruler""" return self._y @property - def z(self) -> pygfx.Ruler: + def z(self) -> Ruler: """z axis ruler""" return self._z @@ -364,6 +464,16 @@ def colors(self, colors: tuple[pygfx.Color | str]): for dim, color in zip(["x", "y", "z"], colors): getattr(self, dim).line.material.color = color + @property + def color(self) -> pygfx.Color: + """get or set a single color for all rulers""" + return self._x.color + + @color.setter + def color(self, color: pygfx.Color | str): + for ruler in (self._x, self._y, self._z): + ruler.color = color + @property def auto_grid(self) -> bool: """auto adjust the grid on each render cycle""" @@ -390,6 +500,7 @@ def intersection(self) -> tuple[float, float, float] | None: def intersection(self, intersection: tuple[float, float, float] | None): """ intersection point of [x, y, z] rulers. + Set (0, 0, 0) for origin Set to `None` to follow when panning through the scene with orthographic projection """ @@ -411,10 +522,9 @@ def _get_view_state(self) -> tuple[bytes, tuple[int, int], tuple[int, int], byte return (cam_matrix, viewport.rect, viewport.logical_size, scale) - def update_using_bbox(self, bbox): """ - Update the w.r.t. the given bbox + Update the axes w.r.t. the given bbox Parameters ---------- @@ -440,6 +550,33 @@ def update_using_bbox(self, bbox): self.update(bbox, intersection) + def _auto_intersection_pos(self, xpos, ypos, width, height): + # returns the intersection position for the axis so they are placed in the bottom left corner + margin = 4 + + y_blocks = [b for b in self.y.text._text_blocks if b._rect.width > 0] + y_extent = ( + max(abs(b._rect.left) for b in y_blocks) + if y_blocks + else 6 * self.y.text.font_size + ) + if self.y._label._text_blocks: + # label center is tick_extent + font_size from ruler; body adds font_size/2 more + y_extent += 1.5 * self.y._label.font_size + + x_blocks = [b for b in self.x.text._text_blocks if b._rect.height > 0] + x_extent = ( + max(abs(b._rect.bottom) for b in x_blocks) + if x_blocks + else 1.5 * self.x.text.font_size + ) + if self.x._label._text_blocks: + x_extent += 1.5 * self.x._label.font_size + + return self._plot_area.map_screen_to_world( + (xpos + y_extent + margin, ypos + height - x_extent - margin) + ) + def update_using_camera(self): """ Update the axes w.r.t the current camera state @@ -491,12 +628,7 @@ def update_using_camera(self): if self.intersection is None: if self._plot_area.camera.fov == 0: - # place the ruler close to the left and bottom edges of the viewport - # TODO: determine this for perspective projections - xscreen_10, yscreen_10 = xpos + (width * 0.1), ypos + (height * 0.9) - intersection = self._plot_area.map_screen_to_world( - (xscreen_10, yscreen_10) - ) + intersection = self._auto_intersection_pos(xpos, ypos, width, height) else: # force origin since None is not supported for Persepctive projections self._intersection = (0, 0, 0) diff --git a/fastplotlib/graphics/_base.py b/fastplotlib/graphics/_base.py index edccf2e8d..95a941f8b 100644 --- a/fastplotlib/graphics/_base.py +++ b/fastplotlib/graphics/_base.py @@ -18,7 +18,6 @@ import pygfx from .features import ( - BufferManager, Deleted, Name, Offset, @@ -28,7 +27,7 @@ AlphaMode, Visible, ) -from ._axes import Axes +from ..axes import Axes HexStr: TypeAlias = str WorldObjectID: TypeAlias = int diff --git a/fastplotlib/graphics/utils.py b/fastplotlib/graphics/utils.py index f32d80809..0fc1aa088 100644 --- a/fastplotlib/graphics/utils.py +++ b/fastplotlib/graphics/utils.py @@ -1,6 +1,9 @@ from contextlib import contextmanager -from typing import Callable, Iterable +from typing import Callable, Iterable, Sequence +import numpy as np + +from ._collection_base import GraphicCollection from ._base import Graphic @@ -44,3 +47,79 @@ def pause_events(*graphics: Graphic, event_handlers: Iterable[Callable] = None): g.block_handlers.clear() else: g.block_events = value + + +def get_nearest_graphics_indices( + pos: tuple[float, float] | tuple[float, float, float], + graphics: Sequence[Graphic] | GraphicCollection, +) -> np.ndarray[int]: + """ + Returns indices of the nearest ``graphics`` to the passed position ``pos`` in world space + in order of closest to furtherst. Uses the distance between ``pos`` and the center of the + bounding sphere for each graphic. + + Parameters + ---------- + pos: (x, y) | (x, y, z) + position in world space, z-axis is ignored when calculating L2 norms if ``pos`` is 2D + + graphics: Sequence, i.e. array, list, tuple, etc. of Graphic | GraphicCollection + the graphics from which to return a sorted array of graphics in order of closest + to furthest graphic + + Returns + ------- + ndarray[int] + indices of the nearest nearest graphics to ``pos`` in order + + """ + if isinstance(graphics, GraphicCollection): + graphics = graphics.graphics + + if not all(isinstance(g, Graphic) for g in graphics): + raise TypeError("all elements of `graphics` must be Graphic objects") + + pos = np.asarray(pos).ravel() + + if pos.shape != (2,) and pos.shape != (3,): + raise TypeError( + f"pos.shape must be (2,) or (3,), the shape of pos you have passed is: {pos.shape}" + ) + + # get centers + centers = np.empty(shape=(len(graphics), len(pos))) + for i in range(centers.shape[0]): + centers[i] = graphics[i].world_object.get_world_bounding_sphere()[: len(pos)] + + # l2 + distances = np.linalg.norm(centers[:, : len(pos)] - pos, ord=2, axis=1) + + sort_indices = np.argsort(distances) + return sort_indices + + +def get_nearest_graphics( + pos: tuple[float, float] | tuple[float, float, float], + graphics: Sequence[Graphic] | GraphicCollection, +) -> np.ndarray[Graphic]: + """ + Returns the nearest ``graphics`` to the passed position ``pos`` in world space. + Uses the distance between ``pos`` and the center of the bounding sphere for each graphic. + + Parameters + ---------- + pos: (x, y) | (x, y, z) + position in world space, z-axis is ignored when calculating L2 norms if ``pos`` is 2D + + graphics: Sequence, i.e. array, list, tuple, etc. of Graphic | GraphicCollection + the graphics from which to return a sorted array of graphics in order of closest + to furthest graphic + + Returns + ------- + ndarray[Graphic] + nearest graphics to ``pos`` in order + + """ + sort_indices = get_nearest_graphics_indices(pos, graphics) + return np.asarray(graphics)[sort_indices] diff --git a/fastplotlib/layouts/_subplot.py b/fastplotlib/layouts/_subplot.py index 73f669fe5..f9534b683 100644 --- a/fastplotlib/layouts/_subplot.py +++ b/fastplotlib/layouts/_subplot.py @@ -9,7 +9,7 @@ from ._utils import create_camera, create_controller from ._plot_area import PlotArea from ._frame import Frame -from ..graphics._axes import Axes +from ..axes import Axes class Subplot(PlotArea): diff --git a/fastplotlib/utils/__init__.py b/fastplotlib/utils/__init__.py index cb6a240d1..f454c7930 100644 --- a/fastplotlib/utils/__init__.py +++ b/fastplotlib/utils/__init__.py @@ -5,7 +5,6 @@ from .enums import * from .functions import * from .gpu import enumerate_adapters, select_adapter, print_wgpu_report -from ._plot_helpers import * from .protocols import ARRAY_LIKE_ATTRS, ArrayProtocol, FutureProtocol, CudaArrayProtocol diff --git a/fastplotlib/utils/_plot_helpers.py b/fastplotlib/utils/_plot_helpers.py deleted file mode 100644 index 12afe1cb2..000000000 --- a/fastplotlib/utils/_plot_helpers.py +++ /dev/null @@ -1,82 +0,0 @@ -from typing import Sequence - -import numpy as np - -from ..graphics._base import Graphic -from ..graphics._collection_base import GraphicCollection - - -def get_nearest_graphics_indices( - pos: tuple[float, float] | tuple[float, float, float], - graphics: Sequence[Graphic] | GraphicCollection, -) -> np.ndarray[int]: - """ - Returns indices of the nearest ``graphics`` to the passed position ``pos`` in world space - in order of closest to furtherst. Uses the distance between ``pos`` and the center of the - bounding sphere for each graphic. - - Parameters - ---------- - pos: (x, y) | (x, y, z) - position in world space, z-axis is ignored when calculating L2 norms if ``pos`` is 2D - - graphics: Sequence, i.e. array, list, tuple, etc. of Graphic | GraphicCollection - the graphics from which to return a sorted array of graphics in order of closest - to furthest graphic - - Returns - ------- - ndarray[int] - indices of the nearest nearest graphics to ``pos`` in order - - """ - if isinstance(graphics, GraphicCollection): - graphics = graphics.graphics - - if not all(isinstance(g, Graphic) for g in graphics): - raise TypeError("all elements of `graphics` must be Graphic objects") - - pos = np.asarray(pos).ravel() - - if pos.shape != (2,) and pos.shape != (3,): - raise TypeError( - f"pos.shape must be (2,) or (3,), the shape of pos you have passed is: {pos.shape}" - ) - - # get centers - centers = np.empty(shape=(len(graphics), len(pos))) - for i in range(centers.shape[0]): - centers[i] = graphics[i].world_object.get_world_bounding_sphere()[: len(pos)] - - # l2 - distances = np.linalg.norm(centers[:, : len(pos)] - pos, ord=2, axis=1) - - sort_indices = np.argsort(distances) - return sort_indices - - -def get_nearest_graphics( - pos: tuple[float, float] | tuple[float, float, float], - graphics: Sequence[Graphic] | GraphicCollection, -) -> np.ndarray[Graphic]: - """ - Returns the nearest ``graphics`` to the passed position ``pos`` in world space. - Uses the distance between ``pos`` and the center of the bounding sphere for each graphic. - - Parameters - ---------- - pos: (x, y) | (x, y, z) - position in world space, z-axis is ignored when calculating L2 norms if ``pos`` is 2D - - graphics: Sequence, i.e. array, list, tuple, etc. of Graphic | GraphicCollection - the graphics from which to return a sorted array of graphics in order of closest - to furthest graphic - - Returns - ------- - ndarray[Graphic] - nearest graphics to ``pos`` in order - - """ - sort_indices = get_nearest_graphics_indices(pos, graphics) - return np.asarray(graphics)[sort_indices] diff --git a/tests/test_plot_helpers.py b/tests/test_plot_helpers.py index b4abe55fc..bc2bb663f 100644 --- a/tests/test_plot_helpers.py +++ b/tests/test_plot_helpers.py @@ -25,7 +25,7 @@ def test_get_nearest_graphics(): fig[0, 0].add_scatter(np.array([[0, 12, 0]])) # check distances - nearest = fpl.utils.get_nearest_graphics((0, 12), lines) + nearest = fpl.get_nearest_graphics((0, 12), lines) assert nearest[0] is lines[1] # closest assert nearest[1] is lines[0] assert nearest[2] is lines[3]