wolfhece.assets.pie.zones_asset =============================== .. py:module:: wolfhece.assets.pie.zones_asset Module Contents --------------- .. py:class:: PieZonesAsset(values: Sequence[float], center: tuple[float, float] = (0.0, 0.0), radius: float = 10.0, *, labels: Sequence[str] | None = None, colors: Sequence[tuple[int, int, int] | tuple[int, int, int, int]] | None = None, start_angle_deg: float = 90.0, clockwise: bool = False, sectors_as_independent_zones: bool = False, legend_visible: bool = True, legend_show_percent: bool = True, legend_show_value: bool = False, legend_offset_factor: float = 0.65, legend_position_mode: str = 'auto', legend_positions: Sequence[tuple[float, float] | None] | None = None, legend_text_color: tuple[int, int, int] = (0, 0, 0), fill_clock_animation: bool = False, fill_anim_speed: float = 1.0, smoothing: bool = True, border_enabled: bool = True, border_width: float = 1.0, border_color: tuple[int, int, int] = (25, 25, 25), store_fraction_in_z: bool = True, idx: str = 'pie_chart', parent=None, mapviewer=None) Pie asset factory producing native Zones for mapviewer rendering. .. py:attribute:: DEFAULT_COLORS :type: tuple[tuple[int, int, int, int], Ellipsis] :value: ((41, 98, 255, 235), (0, 166, 118, 235), (255, 122, 69, 235), (138, 79, 255, 235), (255, 178, 0,... .. py:attribute:: model .. py:attribute:: center_x .. py:attribute:: center_y .. py:attribute:: radius .. py:attribute:: start_angle_deg .. py:attribute:: clockwise :value: False .. py:attribute:: sectors_as_independent_zones :value: False .. py:attribute:: legend_visible :value: True .. py:attribute:: legend_show_percent :value: True .. py:attribute:: legend_show_value :value: False .. py:attribute:: legend_offset_factor .. py:attribute:: legend_position_mode :value: 'auto' .. py:attribute:: legend_positions .. py:attribute:: legend_text_color .. py:attribute:: fill_clock_animation :value: False .. py:attribute:: fill_anim_speed .. py:attribute:: smoothing :value: True .. py:attribute:: border_enabled :value: True .. py:attribute:: border_width .. py:attribute:: border_color :value: (25, 25, 25) .. py:attribute:: store_fraction_in_z :value: True .. py:attribute:: idx :value: '' .. py:attribute:: parent :value: None .. py:attribute:: mapviewer :value: None .. py:attribute:: _colors .. py:method:: _normalize_legend_positions(positions: Sequence[tuple[float, float] | None] | None) -> list[tuple[float, float] | None] .. py:method:: _to_rgba(color: tuple[int, Ellipsis]) -> tuple[int, int, int, int] .. py:method:: _normalize_colors(colors: Sequence[tuple[int, int, int] | tuple[int, int, int, int]] | None) -> list[tuple[int, int, int, int]] .. py:method:: _slice_color(idx: int) -> tuple[int, int, int, int] .. py:method:: _legend_text(slc: wolfhece.assets.pie.distribution.PieSlice) -> str .. py:method:: _legend_color_for_fill(rgba: tuple[int, int, int, int]) -> tuple[int, int, int] Return fixed legend text color for exterior positioning. Legends are now outside pie sectors, so contrast with fill is irrelevant. Use the configured legend_text_color for consistency across all legend items. .. py:method:: _sector_centroid(slc: wolfhece.assets.pie.distribution.PieSlice) -> tuple[float, float] Centroid of a circular sector in world coordinates. .. py:method:: _slice_mid_angle_rad(slc: wolfhece.assets.pie.distribution.PieSlice) -> float .. py:method:: _legend_alignment_for_x(x: float) -> str .. py:method:: _legend_world_height(slc: wolfhece.assets.pie.distribution.PieSlice) -> float Legend text height in world units, scaled to slice size. .. py:method:: _legend_width_factor(legend_text: str) -> float Approximate width/height ratio of rendered legend text. .. py:method:: _legend_world_length(slc: wolfhece.assets.pie.distribution.PieSlice, legend_text: str) -> float .. py:method:: _legend_bbox(x: float, y: float, width: float, height: float, alignment: str) -> tuple[float, float, float, float] .. py:method:: _bbox_overlap_area(bbox1: tuple[float, float, float, float], bbox2: tuple[float, float, float, float]) -> float .. py:method:: _bbox_circle_penalty(bbox: tuple[float, float, float, float]) -> float .. py:method:: _auto_legend_radial_factor() -> float .. py:method:: _auto_legend_layout(slices: Sequence[wolfhece.assets.pie.distribution.PieSlice]) -> list[tuple[float, float, str, float, float]] .. py:method:: _legend_layout(slices: Sequence[wolfhece.assets.pie.distribution.PieSlice]) -> list[tuple[float, float, str, float, float]] .. py:method:: _nb_arc_points(angle_delta_deg: float) -> int .. py:method:: _sector_vertices(start_deg: float, end_deg: float, z_value: float) -> list[wolfhece.PyVertexvectors.wolfvertex] .. py:method:: _configure_vector_style(vec: wolfhece.PyVertexvectors.vector, rgba: tuple[int, int, int, int], slc: wolfhece.assets.pie.distribution.PieSlice, legend_layout: tuple[float, float, str, float, float] | None = None) -> None .. py:method:: to_zones() -> wolfhece.PyVertexvectors.Zones Build and return a native Zones object representing the pie chart. .. py:method:: add_to_mapviewer(mapviewer, id: str | None = None, ToCheck: bool = True) -> wolfhece.PyVertexvectors.Zones Build and add the pie as a vector object in a mapviewer. .. py:function:: build_pie_zones(values: Sequence[float], center: tuple[float, float], radius: float, **kwargs) -> wolfhece.PyVertexvectors.Zones Convenience function returning a pie chart as Zones.