spateo.tdr.models.models_migration.arrow_model

Functions

_construct_arrow(, direction, tuple, numpy.ndarray] =, ...)

Create a 3D arrow model.

construct_arrow(→ Tuple[pyvista.PolyData, Optional[str]])

Create a 3D arrow model.

construct_arrows(→ Tuple[pyvista.PolyData, Optional[str]])

Create multiple 3D arrows model.

Module Contents

spateo.tdr.models.models_migration.arrow_model._construct_arrow(start_point: list | tuple | numpy.ndarray = (0.0, 0.0, 0.0), direction: list | tuple | numpy.ndarray = (1.0, 0.0, 0.0), tip_length: float = 0.25, tip_radius: float = 0.1, tip_resolution: int = 20, shaft_radius: float = 0.05, shaft_resolution: int = 20, scale: str | float | None = 'auto') pyvista.PolyData[source]

Create a 3D arrow model.

Parameters:
start_point

Start location in [x, y, z] of the arrow.

direction

Direction the arrow points to in [x, y, z].

tip_length

Length of the tip.

tip_radius

Radius of the tip.

tip_resolution

Number of faces around the tip.

shaft_radius

Radius of the shaft.

shaft_resolution

Number of faces around the shaft.

scale

Scale factor of the entire object. 'auto' scales to length of direction array.

Returns:

Arrow model.

spateo.tdr.models.models_migration.arrow_model.construct_arrow(start_point: list | tuple | numpy.ndarray, direction: list | tuple | numpy.ndarray, arrow_scale: int | float | None = None, key_added: str | None = 'arrow', label: str = 'arrow', color: str = 'gainsboro', alpha: float = 1.0, **kwargs) Tuple[pyvista.PolyData, str | None][source]

Create a 3D arrow model.

Parameters:
start_point

Start location in [x, y, z] of the arrow.

direction

Direction the arrow points to in [x, y, z].

arrow_scale

Scale factor of the entire object. ‘auto’ scales to length of direction array.

key_added

The key under which to add the labels.

label

The label of arrow model.

color

Color to use for plotting model.

alpha

The opacity of the color to use for plotting model.

**kwargs

Additional parameters that will be passed to _construct_arrow function.

Returns:

Arrow model. plot_cmap: Recommended colormap parameter values for plotting.

Return type:

model

spateo.tdr.models.models_migration.arrow_model.construct_arrows(start_points: numpy.ndarray, direction: numpy.ndarray = None, arrows_scale: numpy.ndarray | None = None, n_sampling: int | None = None, sampling_method: str = 'trn', factor: float = 1.0, key_added: str | None = 'arrow', label: str | list | numpy.ndarray = 'arrows', color: str | list | dict | numpy.ndarray = 'gainsboro', alpha: float | int | list | dict | numpy.ndarray = 1.0, **kwargs) Tuple[pyvista.PolyData, str | None][source]

Create multiple 3D arrows model.

Parameters:
start_points

List of Start location in [x, y, z] of the arrows.

direction

Direction the arrows points to in [x, y, z].

arrows_scale

Scale factor of the entire object.

n_sampling

n_sampling is the number of coordinates to keep after sampling. If there are too many coordinates in start_points, the generated arrows model will be too complex and unsightly, so sampling is used to reduce the number of coordinates.

sampling_method

The method to sample data points, can be one of ['trn', 'kmeans', 'random'].

factor

Scale factor applied to scaling array.

key_added

The key under which to add the labels.

label

The label of arrows models.

color

Color to use for plotting model.

alpha

The opacity of the color to use for plotting model.

**kwargs

Additional parameters that will be passed to _construct_arrow function.

Returns:

Arrows model. plot_cmap: Recommended colormap parameter values for plotting.

Return type:

model