diff --git a/crates/re_edit_ui/src/lib.rs b/crates/re_edit_ui/src/lib.rs index 30d731b30f49..ed7dc3259eb8 100644 --- a/crates/re_edit_ui/src/lib.rs +++ b/crates/re_edit_ui/src/lib.rs @@ -11,7 +11,7 @@ mod visible; // ---- use egui::NumExt as _; -use re_types::components::{Color, MarkerSize, Name, Radius, ScalarScattering, StrokeWidth, Text}; +use re_types::components::{Color, MarkerSize, Name, Radius, StrokeWidth, Text}; use re_viewer_context::ViewerContext; // ---- @@ -43,23 +43,6 @@ fn edit_name_ui(_ctx: &ViewerContext<'_>, ui: &mut egui::Ui, value: &mut Name) - response } -fn edit_scatter_ui( - _ctx: &ViewerContext<'_>, - ui: &mut egui::Ui, - value: &mut ScalarScattering, -) -> egui::Response { - let scattered_text = if value.0 { "Scattered" } else { "Line" }; - - let outer_response = egui::ComboBox::from_id_source("scatter") - .selected_text(scattered_text) - .show_ui(ui, |ui| { - ui.selectable_value(&mut value.0, false, "Line") - | ui.selectable_value(&mut value.0, true, "Scattered") - }); - - outer_response.inner.unwrap_or(outer_response.response) -} - fn edit_radius_ui( _ctx: &ViewerContext<'_>, ui: &mut egui::Ui, @@ -113,7 +96,6 @@ pub fn register_editors(registry: &mut re_viewer_context::ComponentUiRegistry) { registry.add_editor(edit_marker_size_ui); registry.add_editor(edit_name_ui); registry.add_editor(edit_radius_ui); - registry.add_editor(edit_scatter_ui); registry.add_editor(edit_stroke_width_ui); registry.add_editor(edit_text_ui); registry.add_editor(visible::edit_visible); diff --git a/crates/re_types/definitions/rerun/components.fbs b/crates/re_types/definitions/rerun/components.fbs index 121d579150bc..d16de85f354f 100644 --- a/crates/re_types/definitions/rerun/components.fbs +++ b/crates/re_types/definitions/rerun/components.fbs @@ -25,7 +25,6 @@ include "./components/range1d.fbs"; include "./components/resolution.fbs"; include "./components/rotation3d.fbs"; include "./components/scalar.fbs"; -include "./components/scalar_scattering.fbs"; include "./components/stroke_width.fbs"; include "./components/tensor_data.fbs"; include "./components/texcoord2d.fbs"; diff --git a/crates/re_types/definitions/rerun/components/scalar_scattering.fbs b/crates/re_types/definitions/rerun/components/scalar_scattering.fbs deleted file mode 100644 index 39e03f6c759f..000000000000 --- a/crates/re_types/definitions/rerun/components/scalar_scattering.fbs +++ /dev/null @@ -1,19 +0,0 @@ -include "arrow/attributes.fbs"; -include "python/attributes.fbs"; -include "rust/attributes.fbs"; - -include "rerun/datatypes.fbs"; -include "rerun/attributes.fbs"; - -namespace rerun.components; - -// --- - -/// If true, a scalar will be shown as individual point in a scatter plot. -struct ScalarScattering ( - "attr.python.aliases": "bool", - "attr.python.array_aliases": "bool, npt.NDArray[np.bool_]", - "attr.rust.derive": "Default, Copy, PartialEq, PartialOrd, Eq" -) { - scattered: bool (order: 100); -} diff --git a/crates/re_types/src/components/.gitattributes b/crates/re_types/src/components/.gitattributes index e8ee3a8b8992..3275dfd96b81 100644 --- a/crates/re_types/src/components/.gitattributes +++ b/crates/re_types/src/components/.gitattributes @@ -28,7 +28,6 @@ range1d.rs linguist-generated=true resolution.rs linguist-generated=true rotation3d.rs linguist-generated=true scalar.rs linguist-generated=true -scalar_scattering.rs linguist-generated=true stroke_width.rs linguist-generated=true tensor_data.rs linguist-generated=true texcoord2d.rs linguist-generated=true diff --git a/crates/re_types/src/components/mod.rs b/crates/re_types/src/components/mod.rs index 827f6bfb5db7..bf970bcbcf8d 100644 --- a/crates/re_types/src/components/mod.rs +++ b/crates/re_types/src/components/mod.rs @@ -50,7 +50,6 @@ mod rotation3d; mod rotation3d_ext; mod scalar; mod scalar_ext; -mod scalar_scattering; mod stroke_width; mod stroke_width_ext; mod tensor_data; @@ -97,7 +96,6 @@ pub use self::range1d::Range1D; pub use self::resolution::Resolution; pub use self::rotation3d::Rotation3D; pub use self::scalar::Scalar; -pub use self::scalar_scattering::ScalarScattering; pub use self::stroke_width::StrokeWidth; pub use self::tensor_data::TensorData; pub use self::texcoord2d::Texcoord2D; diff --git a/crates/re_viewer/src/component_defaults/mod.rs b/crates/re_viewer/src/component_defaults/mod.rs index e53a5cc6f1e4..63421e3350ec 100644 --- a/crates/re_viewer/src/component_defaults/mod.rs +++ b/crates/re_viewer/src/component_defaults/mod.rs @@ -200,10 +200,6 @@ pub fn list_default_components( Rotation3D::default().to_arrow()?, ), (::name(), Scalar::default().to_arrow()?), - ( - ::name(), - ScalarScattering::default().to_arrow()?, - ), ( ::name(), StrokeWidth::default().to_arrow()?, diff --git a/docs/content/reference/types/components.md b/docs/content/reference/types/components.md index 31c346b7f636..60836ae770a1 100644 --- a/docs/content/reference/types/components.md +++ b/docs/content/reference/types/components.md @@ -40,7 +40,6 @@ on [Entities and Components](../../concepts/entity-component.md). * [`Resolution`](components/resolution.md): Pixel resolution width & height, e.g. of a camera sensor. * [`Rotation3D`](components/rotation3d.md): A 3D rotation, represented either by a quaternion or a rotation around axis. * [`Scalar`](components/scalar.md): A double-precision scalar. -* [`ScalarScattering`](components/scalar_scattering.md): If true, a scalar will be shown as individual point in a scatter plot. * [`StrokeWidth`](components/stroke_width.md): The width of a stroke specified in UI points. * [`TensorData`](components/tensor_data.md): A multi-dimensional `Tensor` of data. * [`Texcoord2D`](components/texcoord2d.md): A 2D texture UV coordinate. diff --git a/docs/content/reference/types/components/.gitattributes b/docs/content/reference/types/components/.gitattributes index 31c716006d5a..5b0baa0b1f8e 100644 --- a/docs/content/reference/types/components/.gitattributes +++ b/docs/content/reference/types/components/.gitattributes @@ -28,7 +28,6 @@ range1d.md linguist-generated=true resolution.md linguist-generated=true rotation3d.md linguist-generated=true scalar.md linguist-generated=true -scalar_scattering.md linguist-generated=true stroke_width.md linguist-generated=true tensor_data.md linguist-generated=true texcoord2d.md linguist-generated=true diff --git a/docs/content/reference/types/components/scalar_scattering.md b/docs/content/reference/types/components/scalar_scattering.md deleted file mode 100644 index 4526ddcbd0ef..000000000000 --- a/docs/content/reference/types/components/scalar_scattering.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "ScalarScattering" ---- - - -If true, a scalar will be shown as individual point in a scatter plot. - -## Fields - -* scattered: `bool` - -## API reference links - * 🌊 [C++ API docs for `ScalarScattering`](https://ref.rerun.io/docs/cpp/stable/structrerun_1_1components_1_1ScalarScattering.html) - * 🐍 [Python API docs for `ScalarScattering`](https://ref.rerun.io/docs/python/stable/common/components#rerun.components.ScalarScattering) - * 🦀 [Rust API docs for `ScalarScattering`](https://docs.rs/rerun/latest/rerun/components/struct.ScalarScattering.html) - - diff --git a/rerun_cpp/src/rerun/components.hpp b/rerun_cpp/src/rerun/components.hpp index 58477cdbe467..3f00d28e6321 100644 --- a/rerun_cpp/src/rerun/components.hpp +++ b/rerun_cpp/src/rerun/components.hpp @@ -29,7 +29,6 @@ #include "components/resolution.hpp" #include "components/rotation3d.hpp" #include "components/scalar.hpp" -#include "components/scalar_scattering.hpp" #include "components/stroke_width.hpp" #include "components/tensor_data.hpp" #include "components/texcoord2d.hpp" diff --git a/rerun_cpp/src/rerun/components/.gitattributes b/rerun_cpp/src/rerun/components/.gitattributes index d7cab86db5d6..f40618f10505 100644 --- a/rerun_cpp/src/rerun/components/.gitattributes +++ b/rerun_cpp/src/rerun/components/.gitattributes @@ -40,8 +40,6 @@ resolution.hpp linguist-generated=true rotation3d.hpp linguist-generated=true scalar.cpp linguist-generated=true scalar.hpp linguist-generated=true -scalar_scattering.cpp linguist-generated=true -scalar_scattering.hpp linguist-generated=true stroke_width.cpp linguist-generated=true stroke_width.hpp linguist-generated=true tensor_data.hpp linguist-generated=true diff --git a/rerun_cpp/src/rerun/components/scalar_scattering.cpp b/rerun_cpp/src/rerun/components/scalar_scattering.cpp deleted file mode 100644 index 757732c059d8..000000000000 --- a/rerun_cpp/src/rerun/components/scalar_scattering.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/cpp/mod.rs -// Based on "crates/re_types/definitions/rerun/components/scalar_scattering.fbs". - -#include "scalar_scattering.hpp" - -#include -#include - -namespace rerun::components {} - -namespace rerun { - const std::shared_ptr& Loggable::arrow_datatype( - ) { - static const auto datatype = arrow::boolean(); - return datatype; - } - - Result> Loggable::to_arrow( - const components::ScalarScattering* instances, size_t num_instances - ) { - // TODO(andreas): Allow configuring the memory pool. - arrow::MemoryPool* pool = arrow::default_memory_pool(); - auto datatype = arrow_datatype(); - - ARROW_ASSIGN_OR_RAISE(auto builder, arrow::MakeBuilder(datatype, pool)) - if (instances && num_instances > 0) { - RR_RETURN_NOT_OK(Loggable::fill_arrow_array_builder( - static_cast(builder.get()), - instances, - num_instances - )); - } - std::shared_ptr array; - ARROW_RETURN_NOT_OK(builder->Finish(&array)); - return array; - } - - rerun::Error Loggable::fill_arrow_array_builder( - arrow::BooleanBuilder* builder, const components::ScalarScattering* elements, - size_t num_elements - ) { - if (builder == nullptr) { - return rerun::Error(ErrorCode::UnexpectedNullArgument, "Passed array builder is null."); - } - if (elements == nullptr) { - return rerun::Error( - ErrorCode::UnexpectedNullArgument, - "Cannot serialize null pointer to arrow array." - ); - } - - static_assert(sizeof(*elements) == sizeof(elements->scattered)); - ARROW_RETURN_NOT_OK(builder->AppendValues( - reinterpret_cast(&elements->scattered), - static_cast(num_elements) - )); - - return Error::ok(); - } -} // namespace rerun diff --git a/rerun_cpp/src/rerun/components/scalar_scattering.hpp b/rerun_cpp/src/rerun/components/scalar_scattering.hpp deleted file mode 100644 index 8125a85a7dfe..000000000000 --- a/rerun_cpp/src/rerun/components/scalar_scattering.hpp +++ /dev/null @@ -1,57 +0,0 @@ -// DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/cpp/mod.rs -// Based on "crates/re_types/definitions/rerun/components/scalar_scattering.fbs". - -#pragma once - -#include "../result.hpp" - -#include -#include - -namespace arrow { - class Array; - class BooleanBuilder; - class DataType; -} // namespace arrow - -namespace rerun::components { - /// **Component**: If true, a scalar will be shown as individual point in a scatter plot. - struct ScalarScattering { - bool scattered; - - public: - ScalarScattering() = default; - - ScalarScattering(bool scattered_) : scattered(scattered_) {} - - ScalarScattering& operator=(bool scattered_) { - scattered = scattered_; - return *this; - } - }; -} // namespace rerun::components - -namespace rerun { - template - struct Loggable; - - /// \private - template <> - struct Loggable { - static constexpr const char Name[] = "rerun.components.ScalarScattering"; - - /// Returns the arrow data type this type corresponds to. - static const std::shared_ptr& arrow_datatype(); - - /// Serializes an array of `rerun::components::ScalarScattering` into an arrow array. - static Result> to_arrow( - const components::ScalarScattering* instances, size_t num_instances - ); - - /// Fills an arrow array builder with an array of this type. - static rerun::Error fill_arrow_array_builder( - arrow::BooleanBuilder* builder, const components::ScalarScattering* elements, - size_t num_elements - ); - }; -} // namespace rerun diff --git a/rerun_py/rerun_sdk/rerun/components/.gitattributes b/rerun_py/rerun_sdk/rerun/components/.gitattributes index 62c74553605c..3df5fe24099f 100644 --- a/rerun_py/rerun_sdk/rerun/components/.gitattributes +++ b/rerun_py/rerun_sdk/rerun/components/.gitattributes @@ -29,7 +29,6 @@ range1d.py linguist-generated=true resolution.py linguist-generated=true rotation3d.py linguist-generated=true scalar.py linguist-generated=true -scalar_scattering.py linguist-generated=true stroke_width.py linguist-generated=true tensor_data.py linguist-generated=true texcoord2d.py linguist-generated=true diff --git a/rerun_py/rerun_sdk/rerun/components/__init__.py b/rerun_py/rerun_sdk/rerun/components/__init__.py index bee8e3c8aec1..fcf59159f53d 100644 --- a/rerun_py/rerun_sdk/rerun/components/__init__.py +++ b/rerun_py/rerun_sdk/rerun/components/__init__.py @@ -47,13 +47,6 @@ from .resolution import Resolution, ResolutionBatch, ResolutionType from .rotation3d import Rotation3D, Rotation3DBatch, Rotation3DType from .scalar import Scalar, ScalarArrayLike, ScalarBatch, ScalarLike, ScalarType -from .scalar_scattering import ( - ScalarScattering, - ScalarScatteringArrayLike, - ScalarScatteringBatch, - ScalarScatteringLike, - ScalarScatteringType, -) from .stroke_width import StrokeWidth, StrokeWidthArrayLike, StrokeWidthBatch, StrokeWidthLike, StrokeWidthType from .tensor_data import TensorData, TensorDataBatch, TensorDataType from .texcoord2d import Texcoord2D, Texcoord2DBatch, Texcoord2DType @@ -183,11 +176,6 @@ "ScalarArrayLike", "ScalarBatch", "ScalarLike", - "ScalarScattering", - "ScalarScatteringArrayLike", - "ScalarScatteringBatch", - "ScalarScatteringLike", - "ScalarScatteringType", "ScalarType", "StrokeWidth", "StrokeWidthArrayLike", diff --git a/rerun_py/rerun_sdk/rerun/components/scalar_scattering.py b/rerun_py/rerun_sdk/rerun/components/scalar_scattering.py deleted file mode 100644 index 35a45dc5c63e..000000000000 --- a/rerun_py/rerun_sdk/rerun/components/scalar_scattering.py +++ /dev/null @@ -1,63 +0,0 @@ -# DO NOT EDIT! This file was auto-generated by crates/re_types_builder/src/codegen/python/mod.rs -# Based on "crates/re_types/definitions/rerun/components/scalar_scattering.fbs". - -# You can extend this class by creating a "ScalarScatteringExt" class in "scalar_scattering_ext.py". - -from __future__ import annotations - -from typing import TYPE_CHECKING, Any, Sequence, Union - -import numpy as np -import numpy.typing as npt -import pyarrow as pa -from attrs import define, field - -from .._baseclasses import BaseBatch, BaseExtensionType, ComponentBatchMixin - -__all__ = [ - "ScalarScattering", - "ScalarScatteringArrayLike", - "ScalarScatteringBatch", - "ScalarScatteringLike", - "ScalarScatteringType", -] - - -@define(init=False) -class ScalarScattering: - """**Component**: If true, a scalar will be shown as individual point in a scatter plot.""" - - def __init__(self: Any, scattered: ScalarScatteringLike): - """Create a new instance of the ScalarScattering component.""" - - # You can define your own __init__ function as a member of ScalarScatteringExt in scalar_scattering_ext.py - self.__attrs_init__(scattered=scattered) - - def __bool__(self) -> bool: - return self.scattered - - scattered: bool = field(converter=bool) - - -if TYPE_CHECKING: - ScalarScatteringLike = Union[ScalarScattering, bool] -else: - ScalarScatteringLike = Any - -ScalarScatteringArrayLike = Union[ScalarScattering, Sequence[ScalarScatteringLike], bool, npt.NDArray[np.bool_]] - - -class ScalarScatteringType(BaseExtensionType): - _TYPE_NAME: str = "rerun.components.ScalarScattering" - - def __init__(self) -> None: - pa.ExtensionType.__init__(self, pa.bool_(), self._TYPE_NAME) - - -class ScalarScatteringBatch(BaseBatch[ScalarScatteringArrayLike], ComponentBatchMixin): - _ARROW_TYPE = ScalarScatteringType() - - @staticmethod - def _native_to_pa_array(data: ScalarScatteringArrayLike, data_type: pa.DataType) -> pa.Array: - array = np.asarray(data, dtype=np.bool_).flatten() - return pa.array(array, type=data_type) diff --git a/tests/python/release_checklist/check_all_components_ui.py b/tests/python/release_checklist/check_all_components_ui.py index 4b1fb806f104..b2d445b657e2 100644 --- a/tests/python/release_checklist/check_all_components_ui.py +++ b/tests/python/release_checklist/check_all_components_ui.py @@ -137,7 +137,6 @@ def alternatives(self) -> list[Any] | None: ] ), "ScalarBatch": TestCase(3), - "ScalarScatteringBatch": TestCase(True), "StrokeWidthBatch": TestCase(2.0), "TensorDataBatch": TestCase( alternatives=[