Skip to content

Commit e19e94c

Browse files
Small fix/circles as points (#334)
* re-enable showing circles as points * fix pre-commit local ignore * fixes circles as points
1 parent 2bc64cb commit e19e94c

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/napari_spatialdata/_scatterwidgets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
from napari_spatialdata._model import DataModel
2828
from napari_spatialdata._widgets import AListWidget, ComponentWidget
29+
from napari_spatialdata.constants.config import POINT_SIZE_SCATTERPLOT_WIDGET
2930

3031
__all__ = [
3132
"PlotWidget",
@@ -343,7 +344,7 @@ def __init__(self, viewer: Viewer | None, model: DataModel) -> None:
343344

344345
# Create a separate ScatterPlotItem for the highlighted point
345346
self.hovered_point = pg.ScatterPlotItem(
346-
pen=pg.mkPen("r", width=2), symbol="o", size=6, brush=pg.mkBrush(255, 0, 0)
347+
pen=pg.mkPen("r", width=2), symbol="o", size=POINT_SIZE_SCATTERPLOT_WIDGET, brush=pg.mkBrush(255, 0, 0)
347348
)
348349
self.scatter_plot.addItem(self.hovered_point)
349350

src/napari_spatialdata/_viewer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
from napari_spatialdata._model import DataModel
2525
from napari_spatialdata.constants import config
26+
from napari_spatialdata.constants.config import CIRCLES_AS_POINTS
2627
from napari_spatialdata.utils._utils import (
2728
_adjust_channels_order,
2829
_get_ellipses_from_circles,
@@ -531,7 +532,6 @@ def get_sdata_circles(self, sdata: SpatialData, key: str, selected_cs: str, mult
531532
),
532533
}
533534

534-
CIRCLES_AS_POINTS = True
535535
version = get_napari_version()
536536
kwargs: dict[str, Any] = (
537537
{"edge_width": 0.0}

src/napari_spatialdata/constants/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
POINT_THRESHOLD = 100000
33
N_CIRCLES_WARNING_THRESHOLD = 250000
44
N_SHAPES_WARNING_THRESHOLD = 10000
5-
POINT_SIZE_SCATTERPLOT_WIDGET = 5
5+
POINT_SIZE_SCATTERPLOT_WIDGET = 6
6+
CIRCLES_AS_POINTS = True

0 commit comments

Comments
 (0)