Exemplo n.º 1
0
    def __init__(self,
                 arg=None,
                 customdata=None,
                 customdatasrc=None,
                 dimensions=None,
                 dimensiondefaults=None,
                 domain=None,
                 hoverinfo=None,
                 hoverinfosrc=None,
                 ids=None,
                 idssrc=None,
                 labelfont=None,
                 legendgroup=None,
                 line=None,
                 name=None,
                 opacity=None,
                 rangefont=None,
                 selectedpoints=None,
                 showlegend=None,
                 stream=None,
                 tickfont=None,
                 uid=None,
                 uirevision=None,
                 visible=None,
                 **kwargs):
        """
        Construct a new Parcoords object
        
        Parallel coordinates for multidimensional exploratory data
        analysis. The samples are specified in `dimensions`. The colors
        are set in `line.color`.

        Parameters
        ----------
        arg
            dict of properties compatible with this constructor or
            an instance of plotly.graph_objs.Parcoords
        customdata
            Assigns extra data each datum. This may be useful when
            listening to hover, click and selection events. Note
            that, "scatter" traces also appends customdata items in
            the markers DOM elements
        customdatasrc
            Sets the source reference on plot.ly for  customdata .
        dimensions
            The dimensions (variables) of the parallel coordinates
            chart. 2..60 dimensions are supported.
        dimensiondefaults
            When used in a template (as
            layout.template.data.parcoords.dimensiondefaults), sets
            the default property values to use for elements of
            parcoords.dimensions
        domain
            plotly.graph_objs.parcoords.Domain instance or dict
            with compatible properties
        hoverinfo
            Determines which trace information appear on hover. If
            `none` or `skip` are set, no information is displayed
            upon hovering. But, if `none` is set, click and hover
            events are still fired.
        hoverinfosrc
            Sets the source reference on plot.ly for  hoverinfo .
        ids
            Assigns id labels to each datum. These ids for object
            constancy of data points during animation. Should be an
            array of strings, not numbers or any other type.
        idssrc
            Sets the source reference on plot.ly for  ids .
        labelfont
            Sets the font for the `dimension` labels.
        legendgroup
            Sets the legend group for this trace. Traces part of
            the same legend group hide/show at the same time when
            toggling legend items.
        line
            plotly.graph_objs.parcoords.Line instance or dict with
            compatible properties
        name
            Sets the trace name. The trace name appear as the
            legend item and on hover.
        opacity
            Sets the opacity of the trace.
        rangefont
            Sets the font for the `dimension` range values.
        selectedpoints
            Array containing integer indices of selected points.
            Has an effect only for traces that support selections.
            Note that an empty array means an empty selection where
            the `unselected` are turned on for all points, whereas,
            any other non-array values means no selection all where
            the `selected` and `unselected` styles have no effect.
        showlegend
            Determines whether or not an item corresponding to this
            trace is shown in the legend.
        stream
            plotly.graph_objs.parcoords.Stream instance or dict
            with compatible properties
        tickfont
            Sets the font for the `dimension` tick values.
        uid

        uirevision
            Controls persistence of some user-driven changes to the
            trace: `constraintrange` in `parcoords` traces, as well
            as some `editable: true` modifications such as `name`
            and `colorbar.title`. Defaults to `layout.uirevision`.
            Note that other user-driven trace attribute changes are
            controlled by `layout` attributes: `trace.visible` is
            controlled by `layout.legend.uirevision`,
            `selectedpoints` is controlled by
            `layout.selectionrevision`, and `colorbar.(x|y)`
            (accessible with `config: {editable: true}`) is
            controlled by `layout.editrevision`. Trace changes are
            tracked by `uid`, which only falls back on trace index
            if no `uid` is provided. So if your app can add/remove
            traces before the end of the `data` array, such that
            the same trace has a different index, you can still
            preserve user-driven changes if you give each trace a
            `uid` that stays with it as it moves.
        visible
            Determines whether or not this trace is visible. If
            "legendonly", the trace is not drawn, but can appear as
            a legend item (provided that the legend itself is
            visible).

        Returns
        -------
        Parcoords
        """
        super(Parcoords, self).__init__('parcoords')

        # 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.Parcoords 
constructor must be a dict or 
an instance of plotly.graph_objs.Parcoords""")

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

        # Import validators
        # -----------------
        from plotly.validators import (parcoords as v_parcoords)

        # Initialize validators
        # ---------------------
        self._validators['customdata'] = v_parcoords.CustomdataValidator()
        self._validators['customdatasrc'] = v_parcoords.CustomdatasrcValidator(
        )
        self._validators['dimensions'] = v_parcoords.DimensionsValidator()
        self._validators['dimensiondefaults'] = v_parcoords.DimensionValidator(
        )
        self._validators['domain'] = v_parcoords.DomainValidator()
        self._validators['hoverinfo'] = v_parcoords.HoverinfoValidator()
        self._validators['hoverinfosrc'] = v_parcoords.HoverinfosrcValidator()
        self._validators['ids'] = v_parcoords.IdsValidator()
        self._validators['idssrc'] = v_parcoords.IdssrcValidator()
        self._validators['labelfont'] = v_parcoords.LabelfontValidator()
        self._validators['legendgroup'] = v_parcoords.LegendgroupValidator()
        self._validators['line'] = v_parcoords.LineValidator()
        self._validators['name'] = v_parcoords.NameValidator()
        self._validators['opacity'] = v_parcoords.OpacityValidator()
        self._validators['rangefont'] = v_parcoords.RangefontValidator()
        self._validators[
            'selectedpoints'] = v_parcoords.SelectedpointsValidator()
        self._validators['showlegend'] = v_parcoords.ShowlegendValidator()
        self._validators['stream'] = v_parcoords.StreamValidator()
        self._validators['tickfont'] = v_parcoords.TickfontValidator()
        self._validators['uid'] = v_parcoords.UidValidator()
        self._validators['uirevision'] = v_parcoords.UirevisionValidator()
        self._validators['visible'] = v_parcoords.VisibleValidator()

        # Populate data dict with properties
        # ----------------------------------
        _v = arg.pop('customdata', None)
        self['customdata'] = customdata if customdata is not None else _v
        _v = arg.pop('customdatasrc', None)
        self[
            'customdatasrc'] = customdatasrc if customdatasrc is not None else _v
        _v = arg.pop('dimensions', None)
        self['dimensions'] = dimensions if dimensions is not None else _v
        _v = arg.pop('dimensiondefaults', None)
        self[
            'dimensiondefaults'] = dimensiondefaults if dimensiondefaults is not None else _v
        _v = arg.pop('domain', None)
        self['domain'] = domain if domain is not None else _v
        _v = arg.pop('hoverinfo', None)
        self['hoverinfo'] = hoverinfo if hoverinfo is not None else _v
        _v = arg.pop('hoverinfosrc', None)
        self['hoverinfosrc'] = hoverinfosrc if hoverinfosrc is not None else _v
        _v = arg.pop('ids', None)
        self['ids'] = ids if ids is not None else _v
        _v = arg.pop('idssrc', None)
        self['idssrc'] = idssrc if idssrc is not None else _v
        _v = arg.pop('labelfont', None)
        self['labelfont'] = labelfont if labelfont is not None else _v
        _v = arg.pop('legendgroup', None)
        self['legendgroup'] = legendgroup if legendgroup is not None else _v
        _v = arg.pop('line', None)
        self['line'] = line if line is not None else _v
        _v = arg.pop('name', None)
        self['name'] = name if name is not None else _v
        _v = arg.pop('opacity', None)
        self['opacity'] = opacity if opacity is not None else _v
        _v = arg.pop('rangefont', None)
        self['rangefont'] = rangefont if rangefont is not None else _v
        _v = arg.pop('selectedpoints', None)
        self[
            'selectedpoints'] = selectedpoints if selectedpoints is not None else _v
        _v = arg.pop('showlegend', None)
        self['showlegend'] = showlegend if showlegend is not None else _v
        _v = arg.pop('stream', None)
        self['stream'] = stream if stream is not None else _v
        _v = arg.pop('tickfont', None)
        self['tickfont'] = tickfont if tickfont is not None else _v
        _v = arg.pop('uid', None)
        self['uid'] = uid if uid is not None else _v
        _v = arg.pop('uirevision', None)
        self['uirevision'] = uirevision if uirevision is not None else _v
        _v = arg.pop('visible', None)
        self['visible'] = visible if visible is not None else _v

        # Read-only literals
        # ------------------
        from _plotly_utils.basevalidators import LiteralValidator
        self._props['type'] = 'parcoords'
        self._validators['type'] = LiteralValidator(plotly_name='type',
                                                    parent_name='parcoords',
                                                    val='parcoords')
        arg.pop('type', None)

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

        # Reset skip_invalid
        # ------------------
        self._skip_invalid = False
Exemplo n.º 2
0
    def __init__(self,
                 arg=None,
                 customdata=None,
                 customdatasrc=None,
                 dimensions=None,
                 domain=None,
                 hoverinfo=None,
                 hoverinfosrc=None,
                 hoverlabel=None,
                 ids=None,
                 idssrc=None,
                 labelfont=None,
                 legendgroup=None,
                 line=None,
                 name=None,
                 opacity=None,
                 rangefont=None,
                 selectedpoints=None,
                 showlegend=None,
                 stream=None,
                 tickfont=None,
                 uid=None,
                 visible=None,
                 **kwargs):
        """
        Construct a new Parcoords object
        
        Parallel coordinates for multidimensional exploratory data
        analysis. The samples are specified in `dimensions`. The colors
        are set in `line.color`.

        Parameters
        ----------
        arg
            dict of properties compatible with this constructor or
            an instance of plotly.graph_objs.Parcoords
        customdata
            Assigns extra data each datum. This may be useful when
            listening to hover, click and selection events. Note
            that, *scatter* traces also appends customdata items in
            the markers DOM elements
        customdatasrc
            Sets the source reference on plot.ly for  customdata .
        dimensions
            The dimensions (variables) of the parallel coordinates
            chart. 2..60 dimensions are supported.
        domain
            plotly.graph_objs.parcoords.Domain instance or dict
            with compatible properties
        hoverinfo
            Determines which trace information appear on hover. If
            `none` or `skip` are set, no information is displayed
            upon hovering. But, if `none` is set, click and hover
            events are still fired.
        hoverinfosrc
            Sets the source reference on plot.ly for  hoverinfo .
        hoverlabel
            plotly.graph_objs.parcoords.Hoverlabel instance or dict
            with compatible properties
        ids
            Assigns id labels to each datum. These ids for object
            constancy of data points during animation. Should be an
            array of strings, not numbers or any other type.
        idssrc
            Sets the source reference on plot.ly for  ids .
        labelfont
            Sets the font for the `dimension` labels.
        legendgroup
            Sets the legend group for this trace. Traces part of
            the same legend group hide/show at the same time when
            toggling legend items.
        line
            plotly.graph_objs.parcoords.Line instance or dict with
            compatible properties
        name
            Sets the trace name. The trace name appear as the
            legend item and on hover.
        opacity
            Sets the opacity of the trace.
        rangefont
            Sets the font for the `dimension` range values.
        selectedpoints
            Array containing integer indices of selected points.
            Has an effect only for traces that support selections.
            Note that an empty array means an empty selection where
            the `unselected` are turned on for all points, whereas,
            any other non-array values means no selection all where
            the `selected` and `unselected` styles have no effect.
        showlegend
            Determines whether or not an item corresponding to this
            trace is shown in the legend.
        stream
            plotly.graph_objs.parcoords.Stream instance or dict
            with compatible properties
        tickfont
            Sets the font for the `dimension` tick values.
        uid

        visible
            Determines whether or not this trace is visible. If
            *legendonly*, the trace is not drawn, but can appear as
            a legend item (provided that the legend itself is
            visible).

        Returns
        -------
        Parcoords
        """
        super(Parcoords, self).__init__('parcoords')

        # 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.Parcoords 
constructor must be a dict or 
an instance of plotly.graph_objs.Parcoords""")

        # Import validators
        # -----------------
        from plotly.validators import (parcoords as v_parcoords)

        # Initialize validators
        # ---------------------
        self._validators['customdata'] = v_parcoords.CustomdataValidator()
        self._validators['customdatasrc'] = v_parcoords.CustomdatasrcValidator(
        )
        self._validators['dimensions'] = v_parcoords.DimensionsValidator()
        self._validators['domain'] = v_parcoords.DomainValidator()
        self._validators['hoverinfo'] = v_parcoords.HoverinfoValidator()
        self._validators['hoverinfosrc'] = v_parcoords.HoverinfosrcValidator()
        self._validators['hoverlabel'] = v_parcoords.HoverlabelValidator()
        self._validators['ids'] = v_parcoords.IdsValidator()
        self._validators['idssrc'] = v_parcoords.IdssrcValidator()
        self._validators['labelfont'] = v_parcoords.LabelfontValidator()
        self._validators['legendgroup'] = v_parcoords.LegendgroupValidator()
        self._validators['line'] = v_parcoords.LineValidator()
        self._validators['name'] = v_parcoords.NameValidator()
        self._validators['opacity'] = v_parcoords.OpacityValidator()
        self._validators['rangefont'] = v_parcoords.RangefontValidator()
        self._validators[
            'selectedpoints'] = v_parcoords.SelectedpointsValidator()
        self._validators['showlegend'] = v_parcoords.ShowlegendValidator()
        self._validators['stream'] = v_parcoords.StreamValidator()
        self._validators['tickfont'] = v_parcoords.TickfontValidator()
        self._validators['uid'] = v_parcoords.UidValidator()
        self._validators['visible'] = v_parcoords.VisibleValidator()

        # Populate data dict with properties
        # ----------------------------------
        _v = arg.pop('customdata', None)
        self.customdata = customdata if customdata is not None else _v
        _v = arg.pop('customdatasrc', None)
        self.customdatasrc = customdatasrc if customdatasrc is not None else _v
        _v = arg.pop('dimensions', None)
        self.dimensions = dimensions if dimensions is not None else _v
        _v = arg.pop('domain', None)
        self.domain = domain if domain is not None else _v
        _v = arg.pop('hoverinfo', None)
        self.hoverinfo = hoverinfo if hoverinfo is not None else _v
        _v = arg.pop('hoverinfosrc', None)
        self.hoverinfosrc = hoverinfosrc if hoverinfosrc is not None else _v
        _v = arg.pop('hoverlabel', None)
        self.hoverlabel = hoverlabel if hoverlabel is not None else _v
        _v = arg.pop('ids', None)
        self.ids = ids if ids is not None else _v
        _v = arg.pop('idssrc', None)
        self.idssrc = idssrc if idssrc is not None else _v
        _v = arg.pop('labelfont', None)
        self.labelfont = labelfont if labelfont is not None else _v
        _v = arg.pop('legendgroup', None)
        self.legendgroup = legendgroup if legendgroup is not None else _v
        _v = arg.pop('line', None)
        self.line = line if line is not None else _v
        _v = arg.pop('name', None)
        self.name = name if name is not None else _v
        _v = arg.pop('opacity', None)
        self.opacity = opacity if opacity is not None else _v
        _v = arg.pop('rangefont', None)
        self.rangefont = rangefont if rangefont is not None else _v
        _v = arg.pop('selectedpoints', None)
        self.selectedpoints = selectedpoints if selectedpoints is not None else _v
        _v = arg.pop('showlegend', None)
        self.showlegend = showlegend if showlegend is not None else _v
        _v = arg.pop('stream', None)
        self.stream = stream if stream is not None else _v
        _v = arg.pop('tickfont', None)
        self.tickfont = tickfont if tickfont is not None else _v
        _v = arg.pop('uid', None)
        self.uid = uid if uid is not None else _v
        _v = arg.pop('visible', None)
        self.visible = visible if visible is not None else _v

        # Read-only literals
        # ------------------
        from _plotly_utils.basevalidators import LiteralValidator
        self._props['type'] = 'parcoords'
        self._validators['type'] = LiteralValidator(plotly_name='type',
                                                    parent_name='parcoords')

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