ShapeFactory#
- class data_morph.shapes.factory.ShapeFactory(dataset: Dataset)[source]#
Bases:
object
Factory for generating shape objects based on data.
- Parameters:
dataset (Dataset) – The starting dataset to morph into other shapes.
- AVAILABLE_SHAPES: list[str] = ['bullseye', 'circle', 'diamond', 'dots', 'down_parab', 'h_lines', 'heart', 'high_lines', 'left_parab', 'rectangle', 'right_parab', 'rings', 'scatter', 'slant_down', 'slant_up', 'star', 'up_parab', 'v_lines', 'wide_lines', 'x']#
The list of available shapes, which can be visualized with
plot_available_shapes()
.
- generate_shape(shape: str, **kwargs) Shape [source]#
Generate the shape object based on the dataset.
- Parameters:
shape (str) – The desired shape. See
AVAILABLE_SHAPES
.**kwargs – Additional keyword arguments to pass down when creating the shape.
- Returns:
An shape object of the requested type.
- Return type:
- plot_available_shapes() Axes [source]#
Plot the available target shapes.
- Returns:
The
Axes
object containing the plot.- Return type:
See also
AVAILABLE_SHAPES
The list of available shapes.