wolfhece.assets.curve.zones_asset ================================= .. py:module:: wolfhece.assets.curve.zones_asset .. autoapi-nested-parse:: Curve asset factory producing native Zones for mapviewer rendering. Module Contents --------------- .. py:class:: CurveZonesAsset(curves: Sequence[Sequence[tuple[float, float]]], *, labels: Sequence[str] | None = None, x_bounds: tuple[float, float] | None = None, y_bounds: tuple[float, float] | None = None, clamp_projected_points: bool = True, sort_by_x: bool = True, colors: Sequence[tuple[int, int, int] | tuple[int, int, int, int]] | None = None, curve_styles: Sequence[dict] | None = None, canvas_origin: tuple[float, float] = (0.0, 0.0), canvas_size: tuple[float, float] = (100.0, 100.0), area_fraction: tuple[float, float, float, float] = (0.1, 0.1, 0.8, 0.3), line_width: float = 1.5, line_alpha: int = 255, show_area_frame: bool = True, frame_color: tuple[int, int, int] = (40, 40, 40), show_axes: bool = False, axes_color: tuple[int, int, int] = (25, 25, 25), axes_line_width: float = 1.2, show_grid: bool = False, grid_color: tuple[int, int, int] = (120, 120, 120), grid_line_width: float = 0.8, grid_dx: float = 1.0, grid_dy: float = 1.0, show_x_ticks: bool = False, show_y_ticks: bool = False, show_x_tick_labels: bool = False, show_y_tick_labels: bool = False, x_tick_position: str = 'inside', y_tick_position: str = 'inside', x_tick_format: str = '', y_tick_format: str = '', legend_visible: bool = False, legend_text_color: tuple[int, int, int] = (0, 0, 0), idx: str = 'curve_plot', parent=None, mapviewer=None) Build polyline curves in a rectangular sub-area of a canvas. .. py:attribute:: DEFAULT_COLORS :type: tuple[tuple[int, int, int, int], Ellipsis] :value: ((41, 98, 255, 255), (0, 166, 118, 255), (255, 122, 69, 255), (138, 79, 255, 255), (255, 178, 0, 255)) .. py:attribute:: _source_curves_cache :value: () .. py:attribute:: x_bounds .. py:attribute:: y_bounds .. py:attribute:: clamp_projected_points :value: True .. py:attribute:: sort_by_x :value: True .. py:attribute:: projection_matrix .. py:attribute:: model .. py:attribute:: canvas_x .. py:attribute:: canvas_y .. py:attribute:: canvas_width .. py:attribute:: canvas_height .. py:attribute:: area_fraction .. py:attribute:: line_width .. py:attribute:: line_alpha .. py:attribute:: show_area_frame :value: True .. py:attribute:: frame_color :value: (40, 40, 40) .. py:attribute:: show_axes :value: False .. py:attribute:: axes_color :value: (25, 25, 25) .. py:attribute:: axes_line_width .. py:attribute:: show_grid :value: False .. py:attribute:: grid_color :value: (120, 120, 120) .. py:attribute:: grid_line_width .. py:attribute:: grid_dx .. py:attribute:: grid_dy .. py:attribute:: show_x_ticks :value: False .. py:attribute:: show_y_ticks :value: False .. py:attribute:: show_x_tick_labels :value: False .. py:attribute:: show_y_tick_labels :value: False .. py:attribute:: x_tick_position :value: '' .. py:attribute:: y_tick_position :value: '' .. py:attribute:: x_tick_format :value: '' .. py:attribute:: y_tick_format :value: '' .. py:attribute:: legend_visible :value: False .. py:attribute:: legend_text_color .. py:attribute:: idx :value: '' .. py:attribute:: parent :value: None .. py:attribute:: mapviewer :value: None .. py:attribute:: _colors :value: [] .. py:attribute:: _curve_styles :value: [] .. py:method:: _normalize_curve_styles(styles: Sequence[dict] | None) -> list[dict] .. py:method:: _freeze_source_curves(curves: Sequence[Sequence[tuple[float, float]]]) -> tuple[tuple[tuple[float, float], Ellipsis], Ellipsis] :staticmethod: .. py:method:: _infer_bounds_from_source(source_curves: tuple[tuple[tuple[float, float], Ellipsis], Ellipsis]) -> tuple[tuple[float, float], tuple[float, float]] :staticmethod: .. py:method:: _normalize_bounds(provided: tuple[float, float] | None, auto_bounds: tuple[float, float], *, axis_name: str) -> tuple[float, float] :staticmethod: .. py:method:: _compute_projection_matrix(x_bounds: tuple[float, float], y_bounds: tuple[float, float]) -> tuple[tuple[float, float, float], tuple[float, float, float], tuple[float, float, float]] :staticmethod: .. py:method:: _project_point(x: float, y: float) -> tuple[float, float] .. py:method:: _project_source_curves(source_curves: tuple[tuple[tuple[float, float], Ellipsis], Ellipsis]) -> list[list[tuple[float, float]]] .. py:method:: _project_point_unclamped(x: float, y: float) -> tuple[float, float] .. py:method:: _add_line(target_zone: wolfhece.PyVertexvectors.zone, name: str, p0: tuple[float, float], p1: tuple[float, float], *, color: tuple[int, int, int], width: float, z_value: float) -> None .. py:method:: _validate_area_fraction(area_fraction: tuple[float, float, float, float]) -> None :staticmethod: .. py:method:: _normalize_colors(colors: Sequence[tuple[int, int, int] | tuple[int, int, int, int]] | None) -> list[tuple[int, int, int, int]] .. py:method:: _area_rect() -> tuple[float, float, float, float] .. py:method:: _grid_values(lo: float, hi: float, step: float) -> list[float] :staticmethod: .. py:method:: datetime_to_timestamp(dt: datetime.datetime) -> float :staticmethod: Convert a datetime to a UTC POSIX timestamp (float seconds). Naive datetimes are assumed to be in UTC. .. py:method:: _format_tick_value(value: float, fmt: str = '') -> str :staticmethod: Format a tick value. If *fmt* is a strftime pattern (contains ``%``), *value* is interpreted as a UTC POSIX timestamp and formatted with that pattern. Otherwise compact numeric ``:.6g`` formatting is used. .. py:method:: to_zones() -> wolfhece.PyVertexvectors.Zones Build and return a Zones object containing curve geometry.