@@ -61,18 +61,18 @@ to calculate its position and scale:
6161
6262 class XLines(LineCollection):
6363
64+ name = 'x'
65+
6466 def __init__(self, dataset: Dataset) -> None:
6567 xmin, xmax = dataset.morph_bounds.x_bounds
6668 ymin, ymax = dataset.morph_bounds.y_bounds
6769
6870 super().__init__([[xmin, ymin], [xmax, ymax]], [[xmin, ymax], [xmax, ymin]])
6971
70- def __str__(self) -> str:
71- return 'x'
7272
7373Since we inherit from :class:`.LineCollection` here, we don't need to define
7474the ``distance()`` and ``plot()`` methods (unless we want to override them).
75- We do override the ``__str__() `` method here since the default will result in
75+ We do set the ``name `` attribute here since the default will result in
7676a value of ``xlines`` and ``x`` makes more sense for use in the documentation
7777(see :class:`.ShapeFactory`).
7878
@@ -89,8 +89,8 @@ For the ``data-morph`` CLI to find your shape, you need to register it with the
89892. Add your shape to ``__all__`` in that module's ``__init__.py`` (*e.g.*, use
9090 ``src/data_morph/shapes/points/__init__.py`` for a new shape inheriting from
9191 :class:`.PointCollection`).
92- 3. Add an entry to the ``ShapeFactory._SHAPE_MAPPING `` dictionary in
93- ``src/data_morph/shapes/factory.py``.
92+ 3. Add an entry to the ``ShapeFactory._SHAPE_CLASSES `` tuple in
93+ ``src/data_morph/shapes/factory.py``, preserving alphabetical order .
9494
9595Test out the shape
9696------------------
0 commit comments