From 92cfc8978724078b1686b055a0523464557ffa8d Mon Sep 17 00:00:00 2001 From: codeanticode Date: Tue, 10 Sep 2024 18:26:48 -0400 Subject: [PATCH] init with def value --- jscatter/jscatter.py | 5 ++++- jscatter/widget.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/jscatter/jscatter.py b/jscatter/jscatter.py index 4d2536f..59848f0 100644 --- a/jscatter/jscatter.py +++ b/jscatter/jscatter.py @@ -9,7 +9,7 @@ from .annotations import Line, HLine, VLine, Rect from .encodings import Encodings -from .widget import JupyterScatter, SELECTION_DTYPE +from .widget import JupyterScatter, SELECTION_DTYPE, COORDINATE_DTYPE from .color_maps import okabe_ito, glasbey_light, glasbey_dark from .utils import any_not, to_ndc, tolist, uri_validator, to_scale_type, get_scale_type_from_df, get_domain_from_df, create_default_norm, create_labeling, get_histogram_from_df, sanitize_tooltip_properties, zerofy_missing_values from .types import Auto, Color, Scales, MouseModes, Auto, Reverse, Segment, Size, LegendPosition, VisualProperty, Labeling, TooltipPreviewType, TooltipPreviewImagePosition, TooltipPreviewImageSize, Undefined @@ -237,6 +237,8 @@ def __init__( self._filtered_points_ids = None self._filtered_points_idxs = None + self._center_positions = np.asarray([], dtype=COORDINATE_DTYPE) + self._transition_points = True self._transition_points_duration = DEFAULT_TRANSITION_POINTS_DURATION @@ -4188,6 +4190,7 @@ def widget(self): reticle=self._reticle, reticle_color=self.get_reticle_color(), selection=self._selected_points_idxs, + center_positions=self._center_positions, size=order_map(self._size_map, self._size_order) if self._size_map else self._size, size_by=self.js_size_by, size_domain=get_domain(self, 'size'), diff --git a/jscatter/widget.py b/jscatter/widget.py index 82bc235..c309167 100644 --- a/jscatter/widget.py +++ b/jscatter/widget.py @@ -19,6 +19,7 @@ ) SELECTION_DTYPE = 'uint32' +COORDINATE_DTYPE = 'float32' EVENT_TYPES = { "TOOLTIP": "tooltip", "VIEW_DOWNLOAD": "view_download",