From fdeb303c90cc941b3e85920c8b59cc323a5f77b0 Mon Sep 17 00:00:00 2001 From: Hanjin Liu Date: Tue, 26 Mar 2024 23:31:07 +0900 Subject: [PATCH] fix docs --- docs/categorical/cat_num.md | 6 +++--- whitecanvas/layers/_primitive/markers.py | 10 ++-------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/docs/categorical/cat_num.md b/docs/categorical/cat_num.md index 991a617a..f6385b23 100644 --- a/docs/categorical/cat_num.md +++ b/docs/categorical/cat_num.md @@ -229,17 +229,17 @@ canvas = new_canvas("plotly", size=(400, 300)) canvas.show() ``` -Each marker size can represent a numerical value. `with_size` will map the numerical +Each marker size can represent a numerical value. `update_size` will map the numerical values of a column to the size of the markers. -``` python +``` python hl_lines="6" #!name: categorical_axis_stripplot_by_size canvas = new_canvas("matplotlib") ( canvas .cat_x(df, x="category", y="observation") .add_stripplot() - .with_size("temperature") + .update_size("temperature") ) canvas.show() ``` diff --git a/whitecanvas/layers/_primitive/markers.py b/whitecanvas/layers/_primitive/markers.py index e3e4fd44..a8fda535 100644 --- a/whitecanvas/layers/_primitive/markers.py +++ b/whitecanvas/layers/_primitive/markers.py @@ -38,12 +38,7 @@ from typing_extensions import Self from whitecanvas.layers import group as _lg - from whitecanvas.layers._mixin import ( - ConstEdge, - ConstFace, - MultiEdge, - MultiFace, - ) + from whitecanvas.layers._mixin import ConstEdge, ConstFace, MultiEdge, MultiFace _void = _Void() _Face = TypeVar("_Face", bound=FaceNamespace) @@ -67,8 +62,7 @@ class Markers( if TYPE_CHECKING: - def __new__(cls, *args, **kwargs) -> Markers[ConstFace, ConstEdge, float]: - ... + def __new__(cls, *args, **kwargs) -> Markers[ConstFace, ConstEdge, float]: ... def __init__( self,