Пример #1
0
    def __init__(
        self,
        arg=None,
        angularaxis=None,
        bgcolor=None,
        domain=None,
        gridshape=None,
        radialaxis=None,
        sector=None,
        **kwargs
    ):
        """
        Construct a new Polar object
        
        Parameters
        ----------
        arg
            dict of properties compatible with this constructor or
            an instance of plotly.graph_objs.layout.Polar
        angularaxis
            plotly.graph_objs.layout.polar.AngularAxis instance or
            dict with compatible properties
        bgcolor
            Set the background color of the subplot
        domain
            plotly.graph_objs.layout.polar.Domain instance or dict
            with compatible properties
        gridshape
            Determines if the radial axis grid lines and angular
            axis line are drawn as "circular" sectors or as
            "linear" (polygon) sectors. Has an effect only when the
            angular axis has `type` "category". Note that
            `radialaxis.angle` is snapped to the angle of the
            closest vertex when `gridshape` is "circular" (so that
            radial axis scale is the same as the data scale).
        radialaxis
            plotly.graph_objs.layout.polar.RadialAxis instance or
            dict with compatible properties
        sector
            Sets angular span of this polar subplot with two angles
            (in degrees). Sector are assumed to be spanned in the
            counterclockwise direction with 0 corresponding to
            rightmost limit of the polar subplot.

        Returns
        -------
        Polar
        """
        super(Polar, self).__init__('polar')

        # Validate arg
        # ------------
        if arg is None:
            arg = {}
        elif isinstance(arg, self.__class__):
            arg = arg.to_plotly_json()
        elif isinstance(arg, dict):
            arg = copy.copy(arg)
        else:
            raise ValueError(
                """\
The first argument to the plotly.graph_objs.layout.Polar 
constructor must be a dict or 
an instance of plotly.graph_objs.layout.Polar"""
            )

        # Handle skip_invalid
        # -------------------
        self._skip_invalid = kwargs.pop('skip_invalid', False)

        # Import validators
        # -----------------
        from plotly.validators.layout import (polar as v_polar)

        # Initialize validators
        # ---------------------
        self._validators['angularaxis'] = v_polar.AngularAxisValidator()
        self._validators['bgcolor'] = v_polar.BgcolorValidator()
        self._validators['domain'] = v_polar.DomainValidator()
        self._validators['gridshape'] = v_polar.GridshapeValidator()
        self._validators['radialaxis'] = v_polar.RadialAxisValidator()
        self._validators['sector'] = v_polar.SectorValidator()

        # Populate data dict with properties
        # ----------------------------------
        _v = arg.pop('angularaxis', None)
        self['angularaxis'] = angularaxis if angularaxis is not None else _v
        _v = arg.pop('bgcolor', None)
        self['bgcolor'] = bgcolor if bgcolor is not None else _v
        _v = arg.pop('domain', None)
        self['domain'] = domain if domain is not None else _v
        _v = arg.pop('gridshape', None)
        self['gridshape'] = gridshape if gridshape is not None else _v
        _v = arg.pop('radialaxis', None)
        self['radialaxis'] = radialaxis if radialaxis is not None else _v
        _v = arg.pop('sector', None)
        self['sector'] = sector if sector is not None else _v

        # Process unknown kwargs
        # ----------------------
        self._process_kwargs(**dict(arg, **kwargs))

        # Reset skip_invalid
        # ------------------
        self._skip_invalid = False
Пример #2
0
    def __init__(self,
                 arg=None,
                 angularaxis=None,
                 bargap=None,
                 barmode=None,
                 bgcolor=None,
                 domain=None,
                 gridshape=None,
                 hole=None,
                 radialaxis=None,
                 sector=None,
                 uirevision=None,
                 **kwargs):
        """
        Construct a new Polar object
        
        Parameters
        ----------
        arg
            dict of properties compatible with this constructor or
            an instance of plotly.graph_objs.layout.Polar
        angularaxis
            plotly.graph_objs.layout.polar.AngularAxis instance or
            dict with compatible properties
        bargap
            Sets the gap between bars of adjacent location
            coordinates. Values are unitless, they represent
            fractions of the minimum difference in bar positions in
            the data.
        barmode
            Determines how bars at the same location coordinate are
            displayed on the graph. With "stack", the bars are
            stacked on top of one another With "overlay", the bars
            are plotted over one another, you might need to an
            "opacity" to see multiple bars.
        bgcolor
            Set the background color of the subplot
        domain
            plotly.graph_objs.layout.polar.Domain instance or dict
            with compatible properties
        gridshape
            Determines if the radial axis grid lines and angular
            axis line are drawn as "circular" sectors or as
            "linear" (polygon) sectors. Has an effect only when the
            angular axis has `type` "category". Note that
            `radialaxis.angle` is snapped to the angle of the
            closest vertex when `gridshape` is "circular" (so that
            radial axis scale is the same as the data scale).
        hole
            Sets the fraction of the radius to cut out of the polar
            subplot.
        radialaxis
            plotly.graph_objs.layout.polar.RadialAxis instance or
            dict with compatible properties
        sector
            Sets angular span of this polar subplot with two angles
            (in degrees). Sector are assumed to be spanned in the
            counterclockwise direction with 0 corresponding to
            rightmost limit of the polar subplot.
        uirevision
            Controls persistence of user-driven changes in axis
            attributes, if not overridden in the individual axes.
            Defaults to `layout.uirevision`.

        Returns
        -------
        Polar
        """
        super(Polar, self).__init__('polar')

        # Validate arg
        # ------------
        if arg is None:
            arg = {}
        elif isinstance(arg, self.__class__):
            arg = arg.to_plotly_json()
        elif isinstance(arg, dict):
            arg = copy.copy(arg)
        else:
            raise ValueError("""\
The first argument to the plotly.graph_objs.layout.Polar 
constructor must be a dict or 
an instance of plotly.graph_objs.layout.Polar""")

        # Handle skip_invalid
        # -------------------
        self._skip_invalid = kwargs.pop('skip_invalid', False)

        # Import validators
        # -----------------
        from plotly.validators.layout import (polar as v_polar)

        # Initialize validators
        # ---------------------
        self._validators['angularaxis'] = v_polar.AngularAxisValidator()
        self._validators['bargap'] = v_polar.BargapValidator()
        self._validators['barmode'] = v_polar.BarmodeValidator()
        self._validators['bgcolor'] = v_polar.BgcolorValidator()
        self._validators['domain'] = v_polar.DomainValidator()
        self._validators['gridshape'] = v_polar.GridshapeValidator()
        self._validators['hole'] = v_polar.HoleValidator()
        self._validators['radialaxis'] = v_polar.RadialAxisValidator()
        self._validators['sector'] = v_polar.SectorValidator()
        self._validators['uirevision'] = v_polar.UirevisionValidator()

        # Populate data dict with properties
        # ----------------------------------
        _v = arg.pop('angularaxis', None)
        self['angularaxis'] = angularaxis if angularaxis is not None else _v
        _v = arg.pop('bargap', None)
        self['bargap'] = bargap if bargap is not None else _v
        _v = arg.pop('barmode', None)
        self['barmode'] = barmode if barmode is not None else _v
        _v = arg.pop('bgcolor', None)
        self['bgcolor'] = bgcolor if bgcolor is not None else _v
        _v = arg.pop('domain', None)
        self['domain'] = domain if domain is not None else _v
        _v = arg.pop('gridshape', None)
        self['gridshape'] = gridshape if gridshape is not None else _v
        _v = arg.pop('hole', None)
        self['hole'] = hole if hole is not None else _v
        _v = arg.pop('radialaxis', None)
        self['radialaxis'] = radialaxis if radialaxis is not None else _v
        _v = arg.pop('sector', None)
        self['sector'] = sector if sector is not None else _v
        _v = arg.pop('uirevision', None)
        self['uirevision'] = uirevision if uirevision is not None else _v

        # Process unknown kwargs
        # ----------------------
        self._process_kwargs(**dict(arg, **kwargs))

        # Reset skip_invalid
        # ------------------
        self._skip_invalid = False