diff --git a/docs/conf.py b/docs/conf.py index a08e1d9..23a696f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -70,6 +70,8 @@ autodoc_pydantic_model_show_config_summary = False autodoc_pydantic_model_show_field_summary = True +# Autosectionlabel settings +autosectionlabel_prefix_document = True # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] diff --git a/src/statsplotly/constants.py b/src/statsplotly/constants.py index 2a39474..904f4d6 100644 --- a/src/statsplotly/constants.py +++ b/src/statsplotly/constants.py @@ -166,8 +166,8 @@ DEFAULT_MARKER_SIZE = 6 MIN_MARKER_SIZE = 4 MAX_MARKER_SIZE = 24 -DEFAULT_MARKER_LINE_COLOR = "grey" -DEFAULT_MARKER_LINE_WIDTH = 2 +DEFAULT_SCATTER3D_MARKER_LINE_COLOR = "white" +DEFAULT_SCATTER3D_MARKER_LINE_WIDTH = 1 DEFAULT_TRANSPARENCE_OPACITY = 0.8 DEFAULT_REGRESSION_LINE_OPACITY = 1 DEFAULT_REGRESSION_LINE_DASH = "dash" diff --git a/src/statsplotly/plot_objects/trace.py b/src/statsplotly/plot_objects/trace.py index bd3c2f0..253eb59 100644 --- a/src/statsplotly/plot_objects/trace.py +++ b/src/statsplotly/plot_objects/trace.py @@ -104,7 +104,6 @@ class _ScatterBaseTrace(BaseTrace): error_y: dict[str, Any] | None = None text: str | pd.Series | None = None textposition: str | None = None - hoverinfo: str = "x+y+name+text" @classmethod def build_trace( @@ -225,7 +224,7 @@ class ShadedTrace(_ScatterBaseTrace, _PlotlyTraceMixin): _PLOTLY_GRAPH_FCT = go.Scatter hoverinfo: str = "x+y+name+text" - line: dict[str, Any] + line: dict[str, Any] | None = None fill: str fillcolor: str | None @@ -398,8 +397,8 @@ def build_trace( "error_z": error_z_data, "marker": { "line": { - "color": constants.DEFAULT_MARKER_LINE_COLOR, - "width": constants.DEFAULT_MARKER_LINE_WIDTH, + "color": constants.DEFAULT_SCATTER3D_MARKER_LINE_COLOR, + "width": constants.DEFAULT_SCATTER3D_MARKER_LINE_WIDTH, } }, }, diff --git a/src/statsplotly/plot_specifiers/data/_core.py b/src/statsplotly/plot_specifiers/data/_core.py index 46e86e9..5c4c5dd 100644 --- a/src/statsplotly/plot_specifiers/data/_core.py +++ b/src/statsplotly/plot_specifiers/data/_core.py @@ -556,13 +556,17 @@ def _build_trace_data_from_pointer( data[pointer.color] if pointer.color in data.columns else pointer.color ) trace_data["size_data"] = ( - pd.Series( - range_normalize( - data[pointer.size].to_numpy(), - constants.MIN_MARKER_SIZE, - constants.MAX_MARKER_SIZE, - ), - name=pointer.size, + ( + pd.Series( + range_normalize( + data[pointer.size].to_numpy(), + constants.MIN_MARKER_SIZE, + constants.MAX_MARKER_SIZE, + ), + name=pointer.size, + ) + if data[pointer.size].max() > constants.MAX_MARKER_SIZE + else data[pointer.size] ) if pointer.size in data.columns else pointer.size diff --git a/tests/test_plot_objects.py b/tests/test_plot_objects.py index efc4657..25cdcca 100644 --- a/tests/test_plot_objects.py +++ b/tests/test_plot_objects.py @@ -94,7 +94,7 @@ def test_scatter3d_trace(example_3dtrace_data): "opacity": None, "symbol": None, "coloraxis": None, - "line": {"color": "grey", "width": 2}, + "line": {"color": "white", "width": 1}, }