:tocdepth: 3 :py:mod:`gws.base.legend.core` ============================== .. py:module:: gws.base.legend.core **Source code:** :source:`gws.base.legend.core` Module Contents --------------- .. py:function:: combine_outputs(lros: list[gws.LegendRenderOutput], options: dict = None) -> Optional[gws.LegendRenderOutput] Combine multiple LegendRenderOutputs into a single output. :param lros: A list of legend render outputs to combine. :param options: Optional combination settings (currently unused). :returns: A new LegendRenderOutput containing the combined image, or None if no images were provided. .. py:class:: Config(*args, **kwargs) Bases: :py:obj:`gws.ConfigWithAccess` Layer legend confuguration. .. py:attribute:: cacheMaxAge :type: gws.Duration :value: '1d' Max cache age for remote legends. .. py:attribute:: options :type: Optional[dict] Provider-dependent legend options. .. py:class:: Object Bases: :py:obj:`gws.Legend` Generic legend object. .. py:attribute:: cacheMaxAge :type: int .. py:attribute:: options :type: dict .. py:method:: configure() Configuration hook. .. py:function:: output_to_bytes(lro: gws.LegendRenderOutput) -> Optional[bytes] Convert a LegendRenderOutput to raw image bytes. :param lro: The legend render output object. :returns: The image encoded as bytes if available, otherwise None. .. py:function:: output_to_image(lro: gws.LegendRenderOutput) -> Optional[gws.Image] Extract an image object from a LegendRenderOutput. :param lro: The legend render output object. :returns: The image object if available, otherwise None (e.g. when only HTML is set). .. py:function:: output_to_image_path(lro: gws.LegendRenderOutput) -> Optional[str] Resolve the file path to the image of a LegendRenderOutput. :param lro: The legend render output object. :returns: Path to the image file if available, otherwise None. .. py:class:: Props(*args, **kwargs) Bases: :py:obj:`gws.Props` Object properties. .. py:attribute:: type :type: str