B
    >c8c             	   @   s  d dl mZ d dlZG dd deZd dl mZ d dlZG dd deZd dl mZ d dlZG dd deZd dl mZ d dlZG d	d
 d
eZd dl mZ d dlZG dd deZ	d dl mZ d dlZG dd deZ
ddd
ddddddg	Zd dlmZ d dlmZ d dlmZ dS )    )BaseTraceHierarchyTypeNc                   s   e Zd Zedd Zejdd Zedd Zejdd Zedd Zejd	d Zed
d Zedd Z	d fdd	Z
  ZS )Textfontc             C   s   | d S )a	  
        The 'color' property is a color and may be specified as:
          - A hex string (e.g. '#ff0000')
          - An rgb/rgba string (e.g. 'rgb(255,0,0)')
          - An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
          - An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
          - A named CSS color:
                aliceblue, antiquewhite, aqua, aquamarine, azure,
                beige, bisque, black, blanchedalmond, blue,
                blueviolet, brown, burlywood, cadetblue,
                chartreuse, chocolate, coral, cornflowerblue,
                cornsilk, crimson, cyan, darkblue, darkcyan,
                darkgoldenrod, darkgray, darkgrey, darkgreen,
                darkkhaki, darkmagenta, darkolivegreen, darkorange,
                darkorchid, darkred, darksalmon, darkseagreen,
                darkslateblue, darkslategray, darkslategrey,
                darkturquoise, darkviolet, deeppink, deepskyblue,
                dimgray, dimgrey, dodgerblue, firebrick,
                floralwhite, forestgreen, fuchsia, gainsboro,
                ghostwhite, gold, goldenrod, gray, grey, green,
                greenyellow, honeydew, hotpink, indianred, indigo,
                ivory, khaki, lavender, lavenderblush, lawngreen,
                lemonchiffon, lightblue, lightcoral, lightcyan,
                lightgoldenrodyellow, lightgray, lightgrey,
                lightgreen, lightpink, lightsalmon, lightseagreen,
                lightskyblue, lightslategray, lightslategrey,
                lightsteelblue, lightyellow, lime, limegreen,
                linen, magenta, maroon, mediumaquamarine,
                mediumblue, mediumorchid, mediumpurple,
                mediumseagreen, mediumslateblue, mediumspringgreen,
                mediumturquoise, mediumvioletred, midnightblue,
                mintcream, mistyrose, moccasin, navajowhite, navy,
                oldlace, olive, olivedrab, orange, orangered,
                orchid, palegoldenrod, palegreen, paleturquoise,
                palevioletred, papayawhip, peachpuff, peru, pink,
                plum, powderblue, purple, red, rosybrown,
                royalblue, rebeccapurple, saddlebrown, salmon,
                sandybrown, seagreen, seashell, sienna, silver,
                skyblue, slateblue, slategray, slategrey, snow,
                springgreen, steelblue, tan, teal, thistle, tomato,
                turquoise, violet, wheat, white, whitesmoke,
                yellow, yellowgreen

        Returns
        -------
        str
        color )selfr   r   R/var/www/cleansys/lib/python3.7/site-packages/plotly/graph_objs/sankey/__init__.pyr   	   s    1zTextfont.colorc             C   s   || d< d S )Nr   r   )r   valr   r   r   r   <   s    c             C   s   | d S )a  
        HTML font family - the typeface that will be applied by the web
        browser. The web browser will only be able to apply a font if
        it is available on the system which it operates. Provide
        multiple font families, separated by commas, to indicate the
        preference in which to apply fonts if they aren't available on
        the system. The plotly service (at https://plot.ly or on-
        premise) generates images on a server, where only a select
        number of fonts are installed and supported. These include
        "Arial", "Balto", "Courier New", "Droid Sans",, "Droid Serif",
        "Droid Sans Mono", "Gravitas One", "Old Standard TT", "Open
        Sans", "Overpass", "PT Sans Narrow", "Raleway", "Times New
        Roman".
    
        The 'family' property is a string and must be specified as:
          - A non-empty string

        Returns
        -------
        str
        familyr   )r   r   r   r   r	   B   s    zTextfont.familyc             C   s   || d< d S )Nr	   r   )r   r   r   r   r   r	   [   s    c             C   s   | d S )z
        The 'size' property is a number and may be specified as:
          - An int or float in the interval [1, inf]

        Returns
        -------
        int|float
        sizer   )r   r   r   r   r
   a   s    
zTextfont.sizec             C   s   || d< d S )Nr
   r   )r   r   r   r   r   r
   m   s    c             C   s   dS )Nsankeyr   )r   r   r   r   _parent_path_strs   s    zTextfont._parent_path_strc             C   s   dS )Nap          color

        family
            HTML font family - the typeface that will be applied by
            the web browser. The web browser will only be able to
            apply a font if it is available on the system which it
            operates. Provide multiple font families, separated by
            commas, to indicate the preference in which to apply
            fonts if they aren't available on the system. The
            plotly service (at https://plot.ly or on-premise)
            generates images on a server, where only a select
            number of fonts are installed and supported. These
            include "Arial", "Balto", "Courier New", "Droid Sans",,
            "Droid Serif", "Droid Sans Mono", "Gravitas One", "Old
            Standard TT", "Open Sans", "Overpass", "PT Sans
            Narrow", "Raleway", "Times New Roman".
        size

        r   )r   r   r   r   _prop_descriptionsy   s    zTextfont._prop_descriptionsNc                s  t t| d |dkri }n4t|| jr4| }nt|trJt|}nt	d|
dd| _ddlm} | | jd< | | jd	< | | jd
< |
dd}|dk	r|n|| d< |
d	d}|dk	r|n|| d	< |
d
d}|dk	r|n|| d
< | jf t|f| d| _dS )a  
        Construct a new Textfont object
        
        Sets the font for node labels

        Parameters
        ----------
        arg
            dict of properties compatible with this constructor or
            an instance of
            :class:`plotly.graph_objs.sankey.Textfont`
        color

        family
            HTML font family - the typeface that will be applied by
            the web browser. The web browser will only be able to
            apply a font if it is available on the system which it
            operates. Provide multiple font families, separated by
            commas, to indicate the preference in which to apply
            fonts if they aren't available on the system. The
            plotly service (at https://plot.ly or on-premise)
            generates images on a server, where only a select
            number of fonts are installed and supported. These
            include "Arial", "Balto", "Courier New", "Droid Sans",,
            "Droid Serif", "Droid Sans Mono", "Gravitas One", "Old
            Standard TT", "Open Sans", "Overpass", "PT Sans
            Narrow", "Raleway", "Times New Roman".
        size


        Returns
        -------
        Textfont
        textfontNzThe first argument to the plotly.graph_objs.sankey.Textfont 
constructor must be a dict or 
an instance of :class:`plotly.graph_objs.sankey.Textfont`skip_invalidFr   )r   r   r	   r
   )superr   __init__
isinstance	__class__to_plotly_jsondict_copycopy
ValueErrorpop_skip_invalidplotly.validators.sankeyr   ColorValidator_validatorsZFamilyValidatorZSizeValidator_process_kwargs)r   argr   r	   r
   kwargsZ
v_textfont_v)r   r   r   r      s,    #

zTextfont.__init__)NNNN)__name__
__module____qualname__propertyr   setterr	   r
   r   r   r   __classcell__r   r   )r   r   r      s   3r   c                   sj   e Zd Zedd Zejdd Zedd Zejdd Zedd Zed	d
 Zd fdd	Z	  Z
S )Streamc             C   s   | d S )a|  
        Sets the maximum number of points to keep on the plots from an
        incoming stream. If `maxpoints` is set to 50, only the newest
        50 points will be displayed on the plot.
    
        The 'maxpoints' property is a number and may be specified as:
          - An int or float in the interval [0, 10000]

        Returns
        -------
        int|float
        	maxpointsr   )r   r   r   r   r)      s    zStream.maxpointsc             C   s   || d< d S )Nr)   r   )r   r   r   r   r   r)      s    c             C   s   | d S )a  
        The stream id number links a data trace on a plot with a
        stream. See https://plot.ly/settings for more details.
    
        The 'token' property is a string and must be specified as:
          - A non-empty string

        Returns
        -------
        str
        tokenr   )r   r   r   r   r*     s    zStream.tokenc             C   s   || d< d S )Nr*   r   )r   r   r   r   r   r*     s    c             C   s   dS )Nr   r   )r   r   r   r   r     s    zStream._parent_path_strc             C   s   dS )Na          maxpoints
            Sets the maximum number of points to keep on the plots
            from an incoming stream. If `maxpoints` is set to 50,
            only the newest 50 points will be displayed on the
            plot.
        token
            The stream id number links a data trace on a plot with
            a stream. See https://plot.ly/settings for more
            details.
        r   )r   r   r   r   r     s    zStream._prop_descriptionsNc                s   t t| d |dkri }n4t|| jr4| }nt|trJt|}nt	d|
dd| _ddlm} | | jd< | | jd	< |
dd}|dk	r|n|| d< |
d	d}|dk	r|n|| d	< | jf t|f| d| _dS )
a  
        Construct a new Stream object
        
        Parameters
        ----------
        arg
            dict of properties compatible with this constructor or
            an instance of :class:`plotly.graph_objs.sankey.Stream`
        maxpoints
            Sets the maximum number of points to keep on the plots
            from an incoming stream. If `maxpoints` is set to 50,
            only the newest 50 points will be displayed on the
            plot.
        token
            The stream id number links a data trace on a plot with
            a stream. See https://plot.ly/settings for more
            details.

        Returns
        -------
        Stream
        streamNzThe first argument to the plotly.graph_objs.sankey.Stream 
constructor must be a dict or 
an instance of :class:`plotly.graph_objs.sankey.Stream`r   Fr   )r+   r)   r*   )r   r(   r   r   r   r   r   r   r   r   r   r   r   r+   ZMaxpointsValidatorr   ZTokenValidatorr   )r   r   r)   r*   r    Zv_streamr!   )r   r   r   r   ,  s&    

zStream.__init__)NNN)r"   r#   r$   r%   r)   r&   r*   r   r   r   r'   r   r   )r   r   r(      s   r(   c                   s  e Zd Zedd Zejdd Zedd Zejdd Zedd Zejd	d Zed
d Zejdd Zedd Z	e	jdd Z	edd Z
e
jdd Z
edd Zejdd Zedd Zejdd Zedd Zejdd Zedd Zejdd Zedd  Zejd!d  Zed"d# Zejd$d# Zed%d& Zejd'd& Zed(d) Zejd*d) Zed+d, Zejd-d, Zed.d/ Zejd0d/ Zed1d2 Zed3d4 Zd8 fd6d7	Z  ZS )9Nodec             C   s   | d S )a  
        Sets the `node` color. It can be a single value, or an array
        for specifying color for each `node`. If `node.color` is
        omitted, then the default `Plotly` color palette will be cycled
        through to have a variety of colors. These defaults are not
        fully opaque, to allow some visibility of what is beneath the
        node.
    
        The 'color' property is a color and may be specified as:
          - A hex string (e.g. '#ff0000')
          - An rgb/rgba string (e.g. 'rgb(255,0,0)')
          - An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
          - An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
          - A named CSS color:
                aliceblue, antiquewhite, aqua, aquamarine, azure,
                beige, bisque, black, blanchedalmond, blue,
                blueviolet, brown, burlywood, cadetblue,
                chartreuse, chocolate, coral, cornflowerblue,
                cornsilk, crimson, cyan, darkblue, darkcyan,
                darkgoldenrod, darkgray, darkgrey, darkgreen,
                darkkhaki, darkmagenta, darkolivegreen, darkorange,
                darkorchid, darkred, darksalmon, darkseagreen,
                darkslateblue, darkslategray, darkslategrey,
                darkturquoise, darkviolet, deeppink, deepskyblue,
                dimgray, dimgrey, dodgerblue, firebrick,
                floralwhite, forestgreen, fuchsia, gainsboro,
                ghostwhite, gold, goldenrod, gray, grey, green,
                greenyellow, honeydew, hotpink, indianred, indigo,
                ivory, khaki, lavender, lavenderblush, lawngreen,
                lemonchiffon, lightblue, lightcoral, lightcyan,
                lightgoldenrodyellow, lightgray, lightgrey,
                lightgreen, lightpink, lightsalmon, lightseagreen,
                lightskyblue, lightslategray, lightslategrey,
                lightsteelblue, lightyellow, lime, limegreen,
                linen, magenta, maroon, mediumaquamarine,
                mediumblue, mediumorchid, mediumpurple,
                mediumseagreen, mediumslateblue, mediumspringgreen,
                mediumturquoise, mediumvioletred, midnightblue,
                mintcream, mistyrose, moccasin, navajowhite, navy,
                oldlace, olive, olivedrab, orange, orangered,
                orchid, palegoldenrod, palegreen, paleturquoise,
                palevioletred, papayawhip, peachpuff, peru, pink,
                plum, powderblue, purple, red, rosybrown,
                royalblue, rebeccapurple, saddlebrown, salmon,
                sandybrown, seagreen, seashell, sienna, silver,
                skyblue, slateblue, slategray, slategrey, snow,
                springgreen, steelblue, tan, teal, thistle, tomato,
                turquoise, violet, wheat, white, whitesmoke,
                yellow, yellowgreen
          - A list or array of any of the above

        Returns
        -------
        str|numpy.ndarray
        r   r   )r   r   r   r   r   z  s    9z
Node.colorc             C   s   || d< d S )Nr   r   )r   r   r   r   r   r     s    c             C   s   | d S )z
        Sets the source reference on plot.ly for  color .
    
        The 'colorsrc' property must be specified as a string or
        as a plotly.grid_objs.Column object

        Returns
        -------
        str
        colorsrcr   )r   r   r   r   r-     s    zNode.colorsrcc             C   s   || d< d S )Nr-   r   )r   r   r   r   r   r-     s    c             C   s   | d S )a  
        Groups of nodes. Each group is defined by an array with the
        indices of the nodes it contains. Multiple groups can be
        specified.
    
        The 'groups' property is an info array that may be specified as:
        * a 2D list where:
          The 'groups[i][j]' property is a number and may be specified as:
          - An int or float

        Returns
        -------
        list
        groupsr   )r   r   r   r   r.     s    zNode.groupsc             C   s   || d< d S )Nr.   r   )r   r   r   r   r   r.     s    c             C   s   | d S )a  
        Determines which trace information appear when hovering nodes.
        If `none` or `skip` are set, no information is displayed upon
        hovering. But, if `none` is set, click and hover events are
        still fired.
    
        The 'hoverinfo' property is an enumeration that may be specified as:
          - One of the following enumeration values:
                ['all', 'none', 'skip']

        Returns
        -------
        Any
        	hoverinfor   )r   r   r   r   r/     s    zNode.hoverinfoc             C   s   || d< d S )Nr/   r   )r   r   r   r   r   r/     s    c             C   s   | d S )a	  
        The 'hoverlabel' property is an instance of Hoverlabel
        that may be specified as:
          - An instance of :class:`plotly.graph_objs.sankey.node.Hoverlabel`
          - A dict of string/value properties that will be passed
            to the Hoverlabel constructor
    
            Supported dict properties:
                
                align
                    Sets the horizontal alignment of the text
                    content within hover label box. Has an effect
                    only if the hover label text spans more two or
                    more lines
                alignsrc
                    Sets the source reference on plot.ly for  align
                    .
                bgcolor
                    Sets the background color of the hover labels
                    for this trace
                bgcolorsrc
                    Sets the source reference on plot.ly for
                    bgcolor .
                bordercolor
                    Sets the border color of the hover labels for
                    this trace.
                bordercolorsrc
                    Sets the source reference on plot.ly for
                    bordercolor .
                font
                    Sets the font used in hover labels.
                namelength
                    Sets the default length (in number of
                    characters) of the trace name in the hover
                    labels for all traces. -1 shows the whole name
                    regardless of length. 0-3 shows the first 0-3
                    characters, and an integer >3 will show the
                    whole name if it is less than that many
                    characters, but if it is longer, will truncate
                    to `namelength - 3` characters and add an
                    ellipsis.
                namelengthsrc
                    Sets the source reference on plot.ly for
                    namelength .

        Returns
        -------
        plotly.graph_objs.sankey.node.Hoverlabel
        
hoverlabelr   )r   r   r   r   r0     s    3zNode.hoverlabelc             C   s   || d< d S )Nr0   r   )r   r   r   r   r   r0   4  s    c             C   s   | d S )a<  
        Template string used for rendering the information that appear
        on hover box. Note that this will override `hoverinfo`.
        Variables are inserted using %{variable}, for example "y:
        %{y}". Numbers are formatted using d3-format's syntax
        %{variable:d3-format}, for example "Price: %{y:$.2f}".
        https://github.com/d3/d3-3.x-api-
        reference/blob/master/Formatting.md#d3_format for details on
        the formatting syntax. Dates are formatted using d3-time-
        format's syntax %{variable|d3-time-format}, for example "Day:
        %{2019-01-01|%A}". https://github.com/d3/d3-3.x-api-
        reference/blob/master/Time-Formatting.md#format for details on
        the date formatting syntax. The variables available in
        `hovertemplate` are the ones emitted as event data described at
        this link https://plot.ly/javascript/plotlyjs-events/#event-
        data. Additionally, every attributes that can be specified per-
        point (the ones that are `arrayOk: true`) are available.
        variables `value` and `label`. Anything contained in tag
        `<extra>` is displayed in the secondary box, for example
        "<extra>{fullData.name}</extra>". To hide the secondary box
        completely, use an empty tag `<extra></extra>`.
    
        The 'hovertemplate' property is a string and must be specified as:
          - A string
          - A number that will be converted to a string
          - A tuple, list, or one-dimensional numpy array of the above

        Returns
        -------
        str|numpy.ndarray
        hovertemplater   )r   r   r   r   r1   :  s    !zNode.hovertemplatec             C   s   || d< d S )Nr1   r   )r   r   r   r   r   r1   ]  s    c             C   s   | d S )z
        Sets the source reference on plot.ly for  hovertemplate .
    
        The 'hovertemplatesrc' property must be specified as a string or
        as a plotly.grid_objs.Column object

        Returns
        -------
        str
        hovertemplatesrcr   )r   r   r   r   r2   c  s    zNode.hovertemplatesrcc             C   s   || d< d S )Nr2   r   )r   r   r   r   r   r2   q  s    c             C   s   | d S )z
        The shown name of the node.
    
        The 'label' property is an array that may be specified as a tuple,
        list, numpy array, or pandas Series

        Returns
        -------
        numpy.ndarray
        labelr   )r   r   r   r   r3   w  s    z
Node.labelc             C   s   || d< d S )Nr3   r   )r   r   r   r   r   r3     s    c             C   s   | d S )z
        Sets the source reference on plot.ly for  label .
    
        The 'labelsrc' property must be specified as a string or
        as a plotly.grid_objs.Column object

        Returns
        -------
        str
        labelsrcr   )r   r   r   r   r4     s    zNode.labelsrcc             C   s   || d< d S )Nr4   r   )r   r   r   r   r   r4     s    c             C   s   | d S )a`  
        The 'line' property is an instance of Line
        that may be specified as:
          - An instance of :class:`plotly.graph_objs.sankey.node.Line`
          - A dict of string/value properties that will be passed
            to the Line constructor
    
            Supported dict properties:
                
                color
                    Sets the color of the `line` around each
                    `node`.
                colorsrc
                    Sets the source reference on plot.ly for  color
                    .
                width
                    Sets the width (in px) of the `line` around
                    each `node`.
                widthsrc
                    Sets the source reference on plot.ly for  width
                    .

        Returns
        -------
        plotly.graph_objs.sankey.node.Line
        liner   )r   r   r   r   r5     s    z	Node.linec             C   s   || d< d S )Nr5   r   )r   r   r   r   r   r5     s    c             C   s   | d S )z
        Sets the padding (in px) between the `nodes`.
    
        The 'pad' property is a number and may be specified as:
          - An int or float in the interval [0, inf]

        Returns
        -------
        int|float
        padr   )r   r   r   r   r6     s    zNode.padc             C   s   || d< d S )Nr6   r   )r   r   r   r   r   r6     s    c             C   s   | d S )z
        Sets the thickness (in px) of the `nodes`.
    
        The 'thickness' property is a number and may be specified as:
          - An int or float in the interval [1, inf]

        Returns
        -------
        int|float
        	thicknessr   )r   r   r   r   r7     s    zNode.thicknessc             C   s   || d< d S )Nr7   r   )r   r   r   r   r   r7     s    c             C   s   | d S )z
        The normalized horizontal position of the node.
    
        The 'x' property is an array that may be specified as a tuple,
        list, numpy array, or pandas Series

        Returns
        -------
        numpy.ndarray
        xr   )r   r   r   r   r8     s    zNode.xc             C   s   || d< d S )Nr8   r   )r   r   r   r   r   r8     s    c             C   s   | d S )z
        Sets the source reference on plot.ly for  x .
    
        The 'xsrc' property must be specified as a string or
        as a plotly.grid_objs.Column object

        Returns
        -------
        str
        xsrcr   )r   r   r   r   r9     s    z	Node.xsrcc             C   s   || d< d S )Nr9   r   )r   r   r   r   r   r9     s    c             C   s   | d S )z
        The normalized vertical position of the node.
    
        The 'y' property is an array that may be specified as a tuple,
        list, numpy array, or pandas Series

        Returns
        -------
        numpy.ndarray
        yr   )r   r   r   r   r:     s    zNode.yc             C   s   || d< d S )Nr:   r   )r   r   r   r   r   r:   !  s    c             C   s   | d S )z
        Sets the source reference on plot.ly for  y .
    
        The 'ysrc' property must be specified as a string or
        as a plotly.grid_objs.Column object

        Returns
        -------
        str
        ysrcr   )r   r   r   r   r;   '  s    z	Node.ysrcc             C   s   || d< d S )Nr;   r   )r   r   r   r   r   r;   5  s    c             C   s   dS )Nr   r   )r   r   r   r   r   ;  s    zNode._parent_path_strc             C   s   dS )Na          color
            Sets the `node` color. It can be a single value, or an
            array for specifying color for each `node`. If
            `node.color` is omitted, then the default `Plotly`
            color palette will be cycled through to have a variety
            of colors. These defaults are not fully opaque, to
            allow some visibility of what is beneath the node.
        colorsrc
            Sets the source reference on plot.ly for  color .
        groups
            Groups of nodes. Each group is defined by an array with
            the indices of the nodes it contains. Multiple groups
            can be specified.
        hoverinfo
            Determines which trace information appear when hovering
            nodes. If `none` or `skip` are set, no information is
            displayed upon hovering. But, if `none` is set, click
            and hover events are still fired.
        hoverlabel
            :class:`plotly.graph_objects.sankey.node.Hoverlabel`
            instance or dict with compatible properties
        hovertemplate
            Template string used for rendering the information that
            appear on hover box. Note that this will override
            `hoverinfo`. Variables are inserted using %{variable},
            for example "y: %{y}". Numbers are formatted using
            d3-format's syntax %{variable:d3-format}, for example
            "Price: %{y:$.2f}". https://github.com/d3/d3-3.x-api-
            reference/blob/master/Formatting.md#d3_format for
            details on the formatting syntax. Dates are formatted
            using d3-time-format's syntax %{variable|d3-time-
            format}, for example "Day: %{2019-01-01|%A}".
            https://github.com/d3/d3-3.x-api-
            reference/blob/master/Time-Formatting.md#format for
            details on the date formatting syntax. The variables
            available in `hovertemplate` are the ones emitted as
            event data described at this link
            https://plot.ly/javascript/plotlyjs-events/#event-data.
            Additionally, every attributes that can be specified
            per-point (the ones that are `arrayOk: true`) are
            available. variables `value` and `label`. Anything
            contained in tag `<extra>` is displayed in the
            secondary box, for example
            "<extra>{fullData.name}</extra>". To hide the secondary
            box completely, use an empty tag `<extra></extra>`.
        hovertemplatesrc
            Sets the source reference on plot.ly for  hovertemplate
            .
        label
            The shown name of the node.
        labelsrc
            Sets the source reference on plot.ly for  label .
        line
            :class:`plotly.graph_objects.sankey.node.Line` instance
            or dict with compatible properties
        pad
            Sets the padding (in px) between the `nodes`.
        thickness
            Sets the thickness (in px) of the `nodes`.
        x
            The normalized horizontal position of the node.
        xsrc
            Sets the source reference on plot.ly for  x .
        y
            The normalized vertical position of the node.
        ysrc
            Sets the source reference on plot.ly for  y .
        r   )r   r   r   r   r   A  s    FzNode._prop_descriptionsNc                s  t t| d |dkri }n4t|| jr4| }nt|trJt|}nt	d|
dd| _ddlm} | | jd< | | jd	< | | jd
< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< |
dd}|dk	rf|n|| d< |
d	d}|dk	r|n|| d	< |
d
d}|dk	r|n|| d
< |
dd}|dk	r|n|| d< |
dd}|dk	r|n|| d< |
dd}|dk	r|n|| d< |
dd}|dk	r2|n|| d< |
dd}|	dk	rT|	n|| d< |
dd}|
dk	rv|
n|| d< |
dd}|dk	r|n|| d< |
dd}|dk	r|n|| d< |
dd}|dk	r|n|| d< |
dd}|dk	r|n|| d< |
dd}|dk	r |n|| d< |
dd}|dk	rB|n|| d< |
dd}|dk	rd|n|| d< | jf t|f| d| _dS )a  
        Construct a new Node object
        
        The nodes of the Sankey plot.

        Parameters
        ----------
        arg
            dict of properties compatible with this constructor or
            an instance of :class:`plotly.graph_objs.sankey.Node`
        color
            Sets the `node` color. It can be a single value, or an
            array for specifying color for each `node`. If
            `node.color` is omitted, then the default `Plotly`
            color palette will be cycled through to have a variety
            of colors. These defaults are not fully opaque, to
            allow some visibility of what is beneath the node.
        colorsrc
            Sets the source reference on plot.ly for  color .
        groups
            Groups of nodes. Each group is defined by an array with
            the indices of the nodes it contains. Multiple groups
            can be specified.
        hoverinfo
            Determines which trace information appear when hovering
            nodes. If `none` or `skip` are set, no information is
            displayed upon hovering. But, if `none` is set, click
            and hover events are still fired.
        hoverlabel
            :class:`plotly.graph_objects.sankey.node.Hoverlabel`
            instance or dict with compatible properties
        hovertemplate
            Template string used for rendering the information that
            appear on hover box. Note that this will override
            `hoverinfo`. Variables are inserted using %{variable},
            for example "y: %{y}". Numbers are formatted using
            d3-format's syntax %{variable:d3-format}, for example
            "Price: %{y:$.2f}". https://github.com/d3/d3-3.x-api-
            reference/blob/master/Formatting.md#d3_format for
            details on the formatting syntax. Dates are formatted
            using d3-time-format's syntax %{variable|d3-time-
            format}, for example "Day: %{2019-01-01|%A}".
            https://github.com/d3/d3-3.x-api-
            reference/blob/master/Time-Formatting.md#format for
            details on the date formatting syntax. The variables
            available in `hovertemplate` are the ones emitted as
            event data described at this link
            https://plot.ly/javascript/plotlyjs-events/#event-data.
            Additionally, every attributes that can be specified
            per-point (the ones that are `arrayOk: true`) are
            available. variables `value` and `label`. Anything
            contained in tag `<extra>` is displayed in the
            secondary box, for example
            "<extra>{fullData.name}</extra>". To hide the secondary
            box completely, use an empty tag `<extra></extra>`.
        hovertemplatesrc
            Sets the source reference on plot.ly for  hovertemplate
            .
        label
            The shown name of the node.
        labelsrc
            Sets the source reference on plot.ly for  label .
        line
            :class:`plotly.graph_objects.sankey.node.Line` instance
            or dict with compatible properties
        pad
            Sets the padding (in px) between the `nodes`.
        thickness
            Sets the thickness (in px) of the `nodes`.
        x
            The normalized horizontal position of the node.
        xsrc
            Sets the source reference on plot.ly for  x .
        y
            The normalized vertical position of the node.
        ysrc
            Sets the source reference on plot.ly for  y .

        Returns
        -------
        Node
        nodeNzThe first argument to the plotly.graph_objs.sankey.Node 
constructor must be a dict or 
an instance of :class:`plotly.graph_objs.sankey.Node`r   Fr   )r<   r   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   ) r   r,   r   r   r   r   r   r   r   r   r   r   r   r<   r   r   ColorsrcValidatorZGroupsValidatorHoverinfoValidatorHoverlabelValidatorHovertemplateValidatorHovertemplatesrcValidatorLabelValidatorLabelsrcValidatorLineValidatorZPadValidatorZThicknessValidator
XValidatorZXsrcValidator
YValidatorZYsrcValidatorr   )r   r   r   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r    Zv_noder!   )r   r   r   r     sz    g

zNode.__init__)NNNNNNNNNNNNNNNNN)r"   r#   r$   r%   r   r&   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r   r   r   r'   r   r   )r   r   r,   v  sf   ;5#J                r,   c                   s  e Zd Zedd Zejdd Zedd Zejdd Zedd Zejd	d Zed
d Zejdd Zedd Z	e	jdd Z	edd Z
e
jdd Z
edd Zejdd Zedd Zejdd Zedd Zejdd Zedd Zejdd Zedd  Zejd!d  Zed"d# Zejd$d# Zed%d& Zejd'd& Zed(d) Zejd*d) Zed+d, Zejd-d, Zed.d/ Zejd0d/ Zed1d2 Zejd3d2 Zed4d5 Zed6d7 Zd; fd9d:	Z  ZS )<Linkc             C   s   | d S )a
  
        Sets the `link` color. It can be a single value, or an array
        for specifying color for each `link`. If `link.color` is
        omitted, then by default, a translucent grey link will be used.
    
        The 'color' property is a color and may be specified as:
          - A hex string (e.g. '#ff0000')
          - An rgb/rgba string (e.g. 'rgb(255,0,0)')
          - An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
          - An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
          - A named CSS color:
                aliceblue, antiquewhite, aqua, aquamarine, azure,
                beige, bisque, black, blanchedalmond, blue,
                blueviolet, brown, burlywood, cadetblue,
                chartreuse, chocolate, coral, cornflowerblue,
                cornsilk, crimson, cyan, darkblue, darkcyan,
                darkgoldenrod, darkgray, darkgrey, darkgreen,
                darkkhaki, darkmagenta, darkolivegreen, darkorange,
                darkorchid, darkred, darksalmon, darkseagreen,
                darkslateblue, darkslategray, darkslategrey,
                darkturquoise, darkviolet, deeppink, deepskyblue,
                dimgray, dimgrey, dodgerblue, firebrick,
                floralwhite, forestgreen, fuchsia, gainsboro,
                ghostwhite, gold, goldenrod, gray, grey, green,
                greenyellow, honeydew, hotpink, indianred, indigo,
                ivory, khaki, lavender, lavenderblush, lawngreen,
                lemonchiffon, lightblue, lightcoral, lightcyan,
                lightgoldenrodyellow, lightgray, lightgrey,
                lightgreen, lightpink, lightsalmon, lightseagreen,
                lightskyblue, lightslategray, lightslategrey,
                lightsteelblue, lightyellow, lime, limegreen,
                linen, magenta, maroon, mediumaquamarine,
                mediumblue, mediumorchid, mediumpurple,
                mediumseagreen, mediumslateblue, mediumspringgreen,
                mediumturquoise, mediumvioletred, midnightblue,
                mintcream, mistyrose, moccasin, navajowhite, navy,
                oldlace, olive, olivedrab, orange, orangered,
                orchid, palegoldenrod, palegreen, paleturquoise,
                palevioletred, papayawhip, peachpuff, peru, pink,
                plum, powderblue, purple, red, rosybrown,
                royalblue, rebeccapurple, saddlebrown, salmon,
                sandybrown, seagreen, seashell, sienna, silver,
                skyblue, slateblue, slategray, slategrey, snow,
                springgreen, steelblue, tan, teal, thistle, tomato,
                turquoise, violet, wheat, white, whitesmoke,
                yellow, yellowgreen
          - A list or array of any of the above

        Returns
        -------
        str|numpy.ndarray
        r   r   )r   r   r   r   r   S  s    6z
Link.colorc             C   s   || d< d S )Nr   r   )r   r   r   r   r   r     s    c             C   s   | d S )a^  
        The 'colorscales' property is a tuple of instances of
        Colorscale that may be specified as:
          - A list or tuple of instances of plotly.graph_objs.sankey.link.Colorscale
          - A list or tuple of dicts of string/value properties that
            will be passed to the Colorscale constructor
    
            Supported dict properties:
                
                cmax
                    Sets the upper bound of the color domain.
                cmin
                    Sets the lower bound of the color domain.
                colorscale
                    Sets the colorscale. The colorscale must be an
                    array containing arrays mapping a normalized
                    value to an rgb, rgba, hex, hsl, hsv, or named
                    color string. At minimum, a mapping for the
                    lowest (0) and highest (1) values are required.
                    For example, `[[0, 'rgb(0,0,255)'], [1,
                    'rgb(255,0,0)']]`. To control the bounds of the
                    colorscale in color space, use`cmin` and
                    `cmax`. Alternatively, `colorscale` may be a
                    palette name string of the following list: Grey
                    s,YlGnBu,Greens,YlOrRd,Bluered,RdBu,Reds,Blues,
                    Picnic,Rainbow,Portland,Jet,Hot,Blackbody,Earth
                    ,Electric,Viridis,Cividis.
                label
                    The label of the links to color based on their
                    concentration within a flow.
                name
                    When used in a template, named items are
                    created in the output figure in addition to any
                    items the figure already has in this array. You
                    can modify these items in the output figure by
                    making your own item with `templateitemname`
                    matching this `name` alongside your
                    modifications (including `visible: false` or
                    `enabled: false` to hide it). Has no effect
                    outside of a template.
                templateitemname
                    Used to refer to a named item in this array in
                    the template. Named items from the template
                    will be created even without a matching item in
                    the input figure, but you can modify one by
                    making an item with `templateitemname` matching
                    its `name`, alongside your modifications
                    (including `visible: false` or `enabled: false`
                    to hide it). If there is no template or no
                    matching item, this item will be hidden unless
                    you explicitly show it with `visible: true`.

        Returns
        -------
        tuple[plotly.graph_objs.sankey.link.Colorscale]
        colorscalesr   )r   r   r   r   rH     s    :zLink.colorscalesc             C   s   || d< d S )NrH   r   )r   r   r   r   r   rH     s    c             C   s   | d S )ap  
        When used in a template (as
        layout.template.data.sankey.link.colorscaledefaults), sets the
        default property values to use for elements of
        sankey.link.colorscales
    
        The 'colorscaledefaults' property is an instance of Colorscale
        that may be specified as:
          - An instance of :class:`plotly.graph_objs.sankey.link.Colorscale`
          - A dict of string/value properties that will be passed
            to the Colorscale constructor
    
            Supported dict properties:

        Returns
        -------
        plotly.graph_objs.sankey.link.Colorscale
        colorscaledefaultsr   )r   r   r   r   rI     s    zLink.colorscaledefaultsc             C   s   || d< d S )NrI   r   )r   r   r   r   r   rI     s    c             C   s   | d S )z
        Sets the source reference on plot.ly for  color .
    
        The 'colorsrc' property must be specified as a string or
        as a plotly.grid_objs.Column object

        Returns
        -------
        str
        r-   r   )r   r   r   r   r-     s    zLink.colorsrcc             C   s   || d< d S )Nr-   r   )r   r   r   r   r   r-     s    c             C   s   | d S )a  
        Determines which trace information appear when hovering links.
        If `none` or `skip` are set, no information is displayed upon
        hovering. But, if `none` is set, click and hover events are
        still fired.
    
        The 'hoverinfo' property is an enumeration that may be specified as:
          - One of the following enumeration values:
                ['all', 'none', 'skip']

        Returns
        -------
        Any
        r/   r   )r   r   r   r   r/     s    zLink.hoverinfoc             C   s   || d< d S )Nr/   r   )r   r   r   r   r   r/     s    c             C   s   | d S )a	  
        The 'hoverlabel' property is an instance of Hoverlabel
        that may be specified as:
          - An instance of :class:`plotly.graph_objs.sankey.link.Hoverlabel`
          - A dict of string/value properties that will be passed
            to the Hoverlabel constructor
    
            Supported dict properties:
                
                align
                    Sets the horizontal alignment of the text
                    content within hover label box. Has an effect
                    only if the hover label text spans more two or
                    more lines
                alignsrc
                    Sets the source reference on plot.ly for  align
                    .
                bgcolor
                    Sets the background color of the hover labels
                    for this trace
                bgcolorsrc
                    Sets the source reference on plot.ly for
                    bgcolor .
                bordercolor
                    Sets the border color of the hover labels for
                    this trace.
                bordercolorsrc
                    Sets the source reference on plot.ly for
                    bordercolor .
                font
                    Sets the font used in hover labels.
                namelength
                    Sets the default length (in number of
                    characters) of the trace name in the hover
                    labels for all traces. -1 shows the whole name
                    regardless of length. 0-3 shows the first 0-3
                    characters, and an integer >3 will show the
                    whole name if it is less than that many
                    characters, but if it is longer, will truncate
                    to `namelength - 3` characters and add an
                    ellipsis.
                namelengthsrc
                    Sets the source reference on plot.ly for
                    namelength .

        Returns
        -------
        plotly.graph_objs.sankey.link.Hoverlabel
        r0   r   )r   r   r   r   r0     s    3zLink.hoverlabelc             C   s   || d< d S )Nr0   r   )r   r   r   r   r   r0   P  s    c             C   s   | d S )a<  
        Template string used for rendering the information that appear
        on hover box. Note that this will override `hoverinfo`.
        Variables are inserted using %{variable}, for example "y:
        %{y}". Numbers are formatted using d3-format's syntax
        %{variable:d3-format}, for example "Price: %{y:$.2f}".
        https://github.com/d3/d3-3.x-api-
        reference/blob/master/Formatting.md#d3_format for details on
        the formatting syntax. Dates are formatted using d3-time-
        format's syntax %{variable|d3-time-format}, for example "Day:
        %{2019-01-01|%A}". https://github.com/d3/d3-3.x-api-
        reference/blob/master/Time-Formatting.md#format for details on
        the date formatting syntax. The variables available in
        `hovertemplate` are the ones emitted as event data described at
        this link https://plot.ly/javascript/plotlyjs-events/#event-
        data. Additionally, every attributes that can be specified per-
        point (the ones that are `arrayOk: true`) are available.
        variables `value` and `label`. Anything contained in tag
        `<extra>` is displayed in the secondary box, for example
        "<extra>{fullData.name}</extra>". To hide the secondary box
        completely, use an empty tag `<extra></extra>`.
    
        The 'hovertemplate' property is a string and must be specified as:
          - A string
          - A number that will be converted to a string
          - A tuple, list, or one-dimensional numpy array of the above

        Returns
        -------
        str|numpy.ndarray
        r1   r   )r   r   r   r   r1   V  s    !zLink.hovertemplatec             C   s   || d< d S )Nr1   r   )r   r   r   r   r   r1   y  s    c             C   s   | d S )z
        Sets the source reference on plot.ly for  hovertemplate .
    
        The 'hovertemplatesrc' property must be specified as a string or
        as a plotly.grid_objs.Column object

        Returns
        -------
        str
        r2   r   )r   r   r   r   r2     s    zLink.hovertemplatesrcc             C   s   || d< d S )Nr2   r   )r   r   r   r   r   r2     s    c             C   s   | d S )z
        The shown name of the link.
    
        The 'label' property is an array that may be specified as a tuple,
        list, numpy array, or pandas Series

        Returns
        -------
        numpy.ndarray
        r3   r   )r   r   r   r   r3     s    z
Link.labelc             C   s   || d< d S )Nr3   r   )r   r   r   r   r   r3     s    c             C   s   | d S )z
        Sets the source reference on plot.ly for  label .
    
        The 'labelsrc' property must be specified as a string or
        as a plotly.grid_objs.Column object

        Returns
        -------
        str
        r4   r   )r   r   r   r   r4     s    zLink.labelsrcc             C   s   || d< d S )Nr4   r   )r   r   r   r   r   r4     s    c             C   s   | d S )a`  
        The 'line' property is an instance of Line
        that may be specified as:
          - An instance of :class:`plotly.graph_objs.sankey.link.Line`
          - A dict of string/value properties that will be passed
            to the Line constructor
    
            Supported dict properties:
                
                color
                    Sets the color of the `line` around each
                    `link`.
                colorsrc
                    Sets the source reference on plot.ly for  color
                    .
                width
                    Sets the width (in px) of the `line` around
                    each `link`.
                widthsrc
                    Sets the source reference on plot.ly for  width
                    .

        Returns
        -------
        plotly.graph_objs.sankey.link.Line
        r5   r   )r   r   r   r   r5     s    z	Link.linec             C   s   || d< d S )Nr5   r   )r   r   r   r   r   r5     s    c             C   s   | d S )a  
        An integer number `[0..nodes.length - 1]` that represents the
        source node.
    
        The 'source' property is an array that may be specified as a tuple,
        list, numpy array, or pandas Series

        Returns
        -------
        numpy.ndarray
        sourcer   )r   r   r   r   rJ     s    zLink.sourcec             C   s   || d< d S )NrJ   r   )r   r   r   r   r   rJ     s    c             C   s   | d S )z
        Sets the source reference on plot.ly for  source .
    
        The 'sourcesrc' property must be specified as a string or
        as a plotly.grid_objs.Column object

        Returns
        -------
        str
        	sourcesrcr   )r   r   r   r   rK     s    zLink.sourcesrcc             C   s   || d< d S )NrK   r   )r   r   r   r   r   rK     s    c             C   s   | d S )a  
        An integer number `[0..nodes.length - 1]` that represents the
        target node.
    
        The 'target' property is an array that may be specified as a tuple,
        list, numpy array, or pandas Series

        Returns
        -------
        numpy.ndarray
        targetr   )r   r   r   r   rL     s    zLink.targetc             C   s   || d< d S )NrL   r   )r   r   r   r   r   rL     s    c             C   s   | d S )z
        Sets the source reference on plot.ly for  target .
    
        The 'targetsrc' property must be specified as a string or
        as a plotly.grid_objs.Column object

        Returns
        -------
        str
        	targetsrcr   )r   r   r   r   rM     s    zLink.targetsrcc             C   s   || d< d S )NrM   r   )r   r   r   r   r   rM   +  s    c             C   s   | d S )z
        A numeric value representing the flow volume value.
    
        The 'value' property is an array that may be specified as a tuple,
        list, numpy array, or pandas Series

        Returns
        -------
        numpy.ndarray
        valuer   )r   r   r   r   rN   1  s    z
Link.valuec             C   s   || d< d S )NrN   r   )r   r   r   r   r   rN   ?  s    c             C   s   | d S )z
        Sets the source reference on plot.ly for  value .
    
        The 'valuesrc' property must be specified as a string or
        as a plotly.grid_objs.Column object

        Returns
        -------
        str
        valuesrcr   )r   r   r   r   rO   E  s    zLink.valuesrcc             C   s   || d< d S )NrO   r   )r   r   r   r   r   rO   S  s    c             C   s   dS )Nr   r   )r   r   r   r   r   Y  s    zLink._parent_path_strc             C   s   dS )Na          color
            Sets the `link` color. It can be a single value, or an
            array for specifying color for each `link`. If
            `link.color` is omitted, then by default, a translucent
            grey link will be used.
        colorscales
            A tuple of
            :class:`plotly.graph_objects.sankey.link.Colorscale`
            instances or dicts with compatible properties
        colorscaledefaults
            When used in a template (as
            layout.template.data.sankey.link.colorscaledefaults),
            sets the default property values to use for elements of
            sankey.link.colorscales
        colorsrc
            Sets the source reference on plot.ly for  color .
        hoverinfo
            Determines which trace information appear when hovering
            links. If `none` or `skip` are set, no information is
            displayed upon hovering. But, if `none` is set, click
            and hover events are still fired.
        hoverlabel
            :class:`plotly.graph_objects.sankey.link.Hoverlabel`
            instance or dict with compatible properties
        hovertemplate
            Template string used for rendering the information that
            appear on hover box. Note that this will override
            `hoverinfo`. Variables are inserted using %{variable},
            for example "y: %{y}". Numbers are formatted using
            d3-format's syntax %{variable:d3-format}, for example
            "Price: %{y:$.2f}". https://github.com/d3/d3-3.x-api-
            reference/blob/master/Formatting.md#d3_format for
            details on the formatting syntax. Dates are formatted
            using d3-time-format's syntax %{variable|d3-time-
            format}, for example "Day: %{2019-01-01|%A}".
            https://github.com/d3/d3-3.x-api-
            reference/blob/master/Time-Formatting.md#format for
            details on the date formatting syntax. The variables
            available in `hovertemplate` are the ones emitted as
            event data described at this link
            https://plot.ly/javascript/plotlyjs-events/#event-data.
            Additionally, every attributes that can be specified
            per-point (the ones that are `arrayOk: true`) are
            available. variables `value` and `label`. Anything
            contained in tag `<extra>` is displayed in the
            secondary box, for example
            "<extra>{fullData.name}</extra>". To hide the secondary
            box completely, use an empty tag `<extra></extra>`.
        hovertemplatesrc
            Sets the source reference on plot.ly for  hovertemplate
            .
        label
            The shown name of the link.
        labelsrc
            Sets the source reference on plot.ly for  label .
        line
            :class:`plotly.graph_objects.sankey.link.Line` instance
            or dict with compatible properties
        source
            An integer number `[0..nodes.length - 1]` that
            represents the source node.
        sourcesrc
            Sets the source reference on plot.ly for  source .
        target
            An integer number `[0..nodes.length - 1]` that
            represents the target node.
        targetsrc
            Sets the source reference on plot.ly for  target .
        value
            A numeric value representing the flow volume value.
        valuesrc
            Sets the source reference on plot.ly for  value .
        r   )r   r   r   r   r   _  s    KzLink._prop_descriptionsNc                s  t t| d |dkri }n4t|| jr4| }nt|trJt|}nt	d|
dd| _ddlm} | | jd< | | jd	< | | jd
< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< |
dd}|dk	rt|n|| d< |
d	d}|dk	r|n|| d	< |
d
d}|dk	r|n|| d
< |
dd}|dk	r|n|| d< |
dd}|dk	r|n|| d< |
dd}|dk	r|n|| d< |
dd}|dk	r@|n|| d< |
dd}|	dk	rb|	n|| d< |
dd}|
dk	r|
n|| d< |
dd}|dk	r|n|| d< |
dd}|dk	r|n|| d< |
dd}|dk	r|n|| d< |
dd}|dk	r|n|| d< |
dd}|dk	r.|n|| d< |
dd}|dk	rP|n|| d< |
dd}|dk	rr|n|| d< |
dd}|dk	r|n|| d< | j f t|f| d| _dS )a  
        Construct a new Link object
        
        The links of the Sankey plot.

        Parameters
        ----------
        arg
            dict of properties compatible with this constructor or
            an instance of :class:`plotly.graph_objs.sankey.Link`
        color
            Sets the `link` color. It can be a single value, or an
            array for specifying color for each `link`. If
            `link.color` is omitted, then by default, a translucent
            grey link will be used.
        colorscales
            A tuple of
            :class:`plotly.graph_objects.sankey.link.Colorscale`
            instances or dicts with compatible properties
        colorscaledefaults
            When used in a template (as
            layout.template.data.sankey.link.colorscaledefaults),
            sets the default property values to use for elements of
            sankey.link.colorscales
        colorsrc
            Sets the source reference on plot.ly for  color .
        hoverinfo
            Determines which trace information appear when hovering
            links. If `none` or `skip` are set, no information is
            displayed upon hovering. But, if `none` is set, click
            and hover events are still fired.
        hoverlabel
            :class:`plotly.graph_objects.sankey.link.Hoverlabel`
            instance or dict with compatible properties
        hovertemplate
            Template string used for rendering the information that
            appear on hover box. Note that this will override
            `hoverinfo`. Variables are inserted using %{variable},
            for example "y: %{y}". Numbers are formatted using
            d3-format's syntax %{variable:d3-format}, for example
            "Price: %{y:$.2f}". https://github.com/d3/d3-3.x-api-
            reference/blob/master/Formatting.md#d3_format for
            details on the formatting syntax. Dates are formatted
            using d3-time-format's syntax %{variable|d3-time-
            format}, for example "Day: %{2019-01-01|%A}".
            https://github.com/d3/d3-3.x-api-
            reference/blob/master/Time-Formatting.md#format for
            details on the date formatting syntax. The variables
            available in `hovertemplate` are the ones emitted as
            event data described at this link
            https://plot.ly/javascript/plotlyjs-events/#event-data.
            Additionally, every attributes that can be specified
            per-point (the ones that are `arrayOk: true`) are
            available. variables `value` and `label`. Anything
            contained in tag `<extra>` is displayed in the
            secondary box, for example
            "<extra>{fullData.name}</extra>". To hide the secondary
            box completely, use an empty tag `<extra></extra>`.
        hovertemplatesrc
            Sets the source reference on plot.ly for  hovertemplate
            .
        label
            The shown name of the link.
        labelsrc
            Sets the source reference on plot.ly for  label .
        line
            :class:`plotly.graph_objects.sankey.link.Line` instance
            or dict with compatible properties
        source
            An integer number `[0..nodes.length - 1]` that
            represents the source node.
        sourcesrc
            Sets the source reference on plot.ly for  source .
        target
            An integer number `[0..nodes.length - 1]` that
            represents the target node.
        targetsrc
            Sets the source reference on plot.ly for  target .
        value
            A numeric value representing the flow volume value.
        valuesrc
            Sets the source reference on plot.ly for  value .

        Returns
        -------
        Link
        linkNzThe first argument to the plotly.graph_objs.sankey.Link 
constructor must be a dict or 
an instance of :class:`plotly.graph_objs.sankey.Link`r   Fr   )rP   r   rH   rI   r-   r/   r0   r1   r2   r3   r4   r5   rJ   rK   rL   rM   rN   rO   )!r   rG   r   r   r   r   r   r   r   r   r   r   r   rP   r   r   ZColorscalesValidatorZColorscaleValidatorr=   r>   r?   r@   rA   rB   rC   rD   ZSourceValidatorZSourcesrcValidatorZTargetValidatorZTargetsrcValidatorZValueValidatorZValuesrcValidatorr   )r   r   r   rH   rI   r-   r/   r0   r1   r2   r3   r4   r5   rJ   rK   rL   rM   rN   rO   r    Zv_linkr!   )r   r   r   r     s    m

zLink.__init__)NNNNNNNNNNNNNNNNNN)r"   r#   r$   r%   r   r&   rH   rI   r-   r/   r0   r1   r2   r3   r4   r5   rJ   rK   rL   rM   rN   rO   r   r   r   r'   r   r   )r   r   rG   O  sl   8<5#O                 rG   c            
       s   e Zd Zedd Zejdd Zedd Zejdd Zedd Zejd	d Zed
d Zejdd Zedd Z	e	jdd Z	edd Z
e
jdd Z
edd Zejdd Zedd Zejdd Zedd Zejdd Zedd Zedd Zd# fd!d"	Z  ZS )$
Hoverlabelc             C   s   | d S )a  
        Sets the horizontal alignment of the text content within hover
        label box. Has an effect only if the hover label text spans
        more two or more lines
    
        The 'align' property is an enumeration that may be specified as:
          - One of the following enumeration values:
                ['left', 'right', 'auto']
          - A tuple, list, or one-dimensional numpy array of the above

        Returns
        -------
        Any|numpy.ndarray
        alignr   )r   r   r   r   rR     s    zHoverlabel.alignc             C   s   || d< d S )NrR   r   )r   r   r   r   r   rR     s    c             C   s   | d S )z
        Sets the source reference on plot.ly for  align .
    
        The 'alignsrc' property must be specified as a string or
        as a plotly.grid_objs.Column object

        Returns
        -------
        str
        alignsrcr   )r   r   r   r   rS     s    zHoverlabel.alignsrcc             C   s   || d< d S )NrS   r   )r   r   r   r   r   rS     s    c             C   s   | d S )aq
  
        Sets the background color of the hover labels for this trace
    
        The 'bgcolor' property is a color and may be specified as:
          - A hex string (e.g. '#ff0000')
          - An rgb/rgba string (e.g. 'rgb(255,0,0)')
          - An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
          - An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
          - A named CSS color:
                aliceblue, antiquewhite, aqua, aquamarine, azure,
                beige, bisque, black, blanchedalmond, blue,
                blueviolet, brown, burlywood, cadetblue,
                chartreuse, chocolate, coral, cornflowerblue,
                cornsilk, crimson, cyan, darkblue, darkcyan,
                darkgoldenrod, darkgray, darkgrey, darkgreen,
                darkkhaki, darkmagenta, darkolivegreen, darkorange,
                darkorchid, darkred, darksalmon, darkseagreen,
                darkslateblue, darkslategray, darkslategrey,
                darkturquoise, darkviolet, deeppink, deepskyblue,
                dimgray, dimgrey, dodgerblue, firebrick,
                floralwhite, forestgreen, fuchsia, gainsboro,
                ghostwhite, gold, goldenrod, gray, grey, green,
                greenyellow, honeydew, hotpink, indianred, indigo,
                ivory, khaki, lavender, lavenderblush, lawngreen,
                lemonchiffon, lightblue, lightcoral, lightcyan,
                lightgoldenrodyellow, lightgray, lightgrey,
                lightgreen, lightpink, lightsalmon, lightseagreen,
                lightskyblue, lightslategray, lightslategrey,
                lightsteelblue, lightyellow, lime, limegreen,
                linen, magenta, maroon, mediumaquamarine,
                mediumblue, mediumorchid, mediumpurple,
                mediumseagreen, mediumslateblue, mediumspringgreen,
                mediumturquoise, mediumvioletred, midnightblue,
                mintcream, mistyrose, moccasin, navajowhite, navy,
                oldlace, olive, olivedrab, orange, orangered,
                orchid, palegoldenrod, palegreen, paleturquoise,
                palevioletred, papayawhip, peachpuff, peru, pink,
                plum, powderblue, purple, red, rosybrown,
                royalblue, rebeccapurple, saddlebrown, salmon,
                sandybrown, seagreen, seashell, sienna, silver,
                skyblue, slateblue, slategray, slategrey, snow,
                springgreen, steelblue, tan, teal, thistle, tomato,
                turquoise, violet, wheat, white, whitesmoke,
                yellow, yellowgreen
          - A list or array of any of the above

        Returns
        -------
        str|numpy.ndarray
        bgcolorr   )r   r   r   r   rT     s    4zHoverlabel.bgcolorc             C   s   || d< d S )NrT   r   )r   r   r   r   r   rT     s    c             C   s   | d S )z
        Sets the source reference on plot.ly for  bgcolor .
    
        The 'bgcolorsrc' property must be specified as a string or
        as a plotly.grid_objs.Column object

        Returns
        -------
        str
        
bgcolorsrcr   )r   r   r   r   rU     s    zHoverlabel.bgcolorsrcc             C   s   || d< d S )NrU   r   )r   r   r   r   r   rU     s    c             C   s   | d S )ar
  
        Sets the border color of the hover labels for this trace.
    
        The 'bordercolor' property is a color and may be specified as:
          - A hex string (e.g. '#ff0000')
          - An rgb/rgba string (e.g. 'rgb(255,0,0)')
          - An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
          - An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
          - A named CSS color:
                aliceblue, antiquewhite, aqua, aquamarine, azure,
                beige, bisque, black, blanchedalmond, blue,
                blueviolet, brown, burlywood, cadetblue,
                chartreuse, chocolate, coral, cornflowerblue,
                cornsilk, crimson, cyan, darkblue, darkcyan,
                darkgoldenrod, darkgray, darkgrey, darkgreen,
                darkkhaki, darkmagenta, darkolivegreen, darkorange,
                darkorchid, darkred, darksalmon, darkseagreen,
                darkslateblue, darkslategray, darkslategrey,
                darkturquoise, darkviolet, deeppink, deepskyblue,
                dimgray, dimgrey, dodgerblue, firebrick,
                floralwhite, forestgreen, fuchsia, gainsboro,
                ghostwhite, gold, goldenrod, gray, grey, green,
                greenyellow, honeydew, hotpink, indianred, indigo,
                ivory, khaki, lavender, lavenderblush, lawngreen,
                lemonchiffon, lightblue, lightcoral, lightcyan,
                lightgoldenrodyellow, lightgray, lightgrey,
                lightgreen, lightpink, lightsalmon, lightseagreen,
                lightskyblue, lightslategray, lightslategrey,
                lightsteelblue, lightyellow, lime, limegreen,
                linen, magenta, maroon, mediumaquamarine,
                mediumblue, mediumorchid, mediumpurple,
                mediumseagreen, mediumslateblue, mediumspringgreen,
                mediumturquoise, mediumvioletred, midnightblue,
                mintcream, mistyrose, moccasin, navajowhite, navy,
                oldlace, olive, olivedrab, orange, orangered,
                orchid, palegoldenrod, palegreen, paleturquoise,
                palevioletred, papayawhip, peachpuff, peru, pink,
                plum, powderblue, purple, red, rosybrown,
                royalblue, rebeccapurple, saddlebrown, salmon,
                sandybrown, seagreen, seashell, sienna, silver,
                skyblue, slateblue, slategray, slategrey, snow,
                springgreen, steelblue, tan, teal, thistle, tomato,
                turquoise, violet, wheat, white, whitesmoke,
                yellow, yellowgreen
          - A list or array of any of the above

        Returns
        -------
        str|numpy.ndarray
        bordercolorr   )r   r   r   r   rV     s    4zHoverlabel.bordercolorc             C   s   || d< d S )NrV   r   )r   r   r   r   r   rV   3  s    c             C   s   | d S )z
        Sets the source reference on plot.ly for  bordercolor .
    
        The 'bordercolorsrc' property must be specified as a string or
        as a plotly.grid_objs.Column object

        Returns
        -------
        str
        bordercolorsrcr   )r   r   r   r   rW   9  s    zHoverlabel.bordercolorsrcc             C   s   || d< d S )NrW   r   )r   r   r   r   r   rW   G  s    c             C   s   | d S )aA  
        Sets the font used in hover labels.
    
        The 'font' property is an instance of Font
        that may be specified as:
          - An instance of :class:`plotly.graph_objs.sankey.hoverlabel.Font`
          - A dict of string/value properties that will be passed
            to the Font constructor
    
            Supported dict properties:
                
                color
    
                colorsrc
                    Sets the source reference on plot.ly for  color
                    .
                family
                    HTML font family - the typeface that will be
                    applied by the web browser. The web browser
                    will only be able to apply a font if it is
                    available on the system which it operates.
                    Provide multiple font families, separated by
                    commas, to indicate the preference in which to
                    apply fonts if they aren't available on the
                    system. The plotly service (at https://plot.ly
                    or on-premise) generates images on a server,
                    where only a select number of fonts are
                    installed and supported. These include "Arial",
                    "Balto", "Courier New", "Droid Sans",, "Droid
                    Serif", "Droid Sans Mono", "Gravitas One", "Old
                    Standard TT", "Open Sans", "Overpass", "PT Sans
                    Narrow", "Raleway", "Times New Roman".
                familysrc
                    Sets the source reference on plot.ly for
                    family .
                size
    
                sizesrc
                    Sets the source reference on plot.ly for  size
                    .

        Returns
        -------
        plotly.graph_objs.sankey.hoverlabel.Font
        fontr   )r   r   r   r   rX   M  s    /zHoverlabel.fontc             C   s   || d< d S )NrX   r   )r   r   r   r   r   rX   ~  s    c             C   s   | d S )a  
        Sets the default length (in number of characters) of the trace
        name in the hover labels for all traces. -1 shows the whole
        name regardless of length. 0-3 shows the first 0-3 characters,
        and an integer >3 will show the whole name if it is less than
        that many characters, but if it is longer, will truncate to
        `namelength - 3` characters and add an ellipsis.
    
        The 'namelength' property is a integer and may be specified as:
          - An int (or float that will be cast to an int)
            in the interval [-1, 9223372036854775807]
          - A tuple, list, or one-dimensional numpy array of the above

        Returns
        -------
        int|numpy.ndarray
        
namelengthr   )r   r   r   r   rY     s    zHoverlabel.namelengthc             C   s   || d< d S )NrY   r   )r   r   r   r   r   rY     s    c             C   s   | d S )z
        Sets the source reference on plot.ly for  namelength .
    
        The 'namelengthsrc' property must be specified as a string or
        as a plotly.grid_objs.Column object

        Returns
        -------
        str
        namelengthsrcr   )r   r   r   r   rZ     s    zHoverlabel.namelengthsrcc             C   s   || d< d S )NrZ   r   )r   r   r   r   r   rZ     s    c             C   s   dS )Nr   r   )r   r   r   r   r     s    zHoverlabel._parent_path_strc             C   s   dS )Na          align
            Sets the horizontal alignment of the text content
            within hover label box. Has an effect only if the hover
            label text spans more two or more lines
        alignsrc
            Sets the source reference on plot.ly for  align .
        bgcolor
            Sets the background color of the hover labels for this
            trace
        bgcolorsrc
            Sets the source reference on plot.ly for  bgcolor .
        bordercolor
            Sets the border color of the hover labels for this
            trace.
        bordercolorsrc
            Sets the source reference on plot.ly for  bordercolor .
        font
            Sets the font used in hover labels.
        namelength
            Sets the default length (in number of characters) of
            the trace name in the hover labels for all traces. -1
            shows the whole name regardless of length. 0-3 shows
            the first 0-3 characters, and an integer >3 will show
            the whole name if it is less than that many characters,
            but if it is longer, will truncate to `namelength - 3`
            characters and add an ellipsis.
        namelengthsrc
            Sets the source reference on plot.ly for  namelength .
        r   )r   r   r   r   r     s    zHoverlabel._prop_descriptionsNc                s:  t t| d |dkri }n4t|| jr4| }nt|trJt|}nt	d|
dd| _ddlm} | | jd< | | jd	< | | jd
< | | jd< | | jd< | | jd< | | jd< | | jd< | | jd< |
dd}|dk	r|n|| d< |
d	d}|dk	r&|n|| d	< |
d
d}|dk	rH|n|| d
< |
dd}|dk	rj|n|| d< |
dd}|dk	r|n|| d< |
dd}|dk	r|n|| d< |
dd}|dk	r|n|| d< |
dd}|	dk	r|	n|| d< |
dd}|
dk	r|
n|| d< | jf t|f| d| _dS )a'  
        Construct a new Hoverlabel object
        
        Parameters
        ----------
        arg
            dict of properties compatible with this constructor or
            an instance of
            :class:`plotly.graph_objs.sankey.Hoverlabel`
        align
            Sets the horizontal alignment of the text content
            within hover label box. Has an effect only if the hover
            label text spans more two or more lines
        alignsrc
            Sets the source reference on plot.ly for  align .
        bgcolor
            Sets the background color of the hover labels for this
            trace
        bgcolorsrc
            Sets the source reference on plot.ly for  bgcolor .
        bordercolor
            Sets the border color of the hover labels for this
            trace.
        bordercolorsrc
            Sets the source reference on plot.ly for  bordercolor .
        font
            Sets the font used in hover labels.
        namelength
            Sets the default length (in number of characters) of
            the trace name in the hover labels for all traces. -1
            shows the whole name regardless of length. 0-3 shows
            the first 0-3 characters, and an integer >3 will show
            the whole name if it is less than that many characters,
            but if it is longer, will truncate to `namelength - 3`
            characters and add an ellipsis.
        namelengthsrc
            Sets the source reference on plot.ly for  namelength .

        Returns
        -------
        Hoverlabel
        r0   NzThe first argument to the plotly.graph_objs.sankey.Hoverlabel 
constructor must be a dict or 
an instance of :class:`plotly.graph_objs.sankey.Hoverlabel`r   Fr   )r0   rR   rS   rT   rU   rV   rW   rX   rY   rZ   )r   rQ   r   r   r   r   r   r   r   r   r   r   r   r0   ZAlignValidatorr   ZAlignsrcValidatorZBgcolorValidatorZBgcolorsrcValidatorZBordercolorValidatorZBordercolorsrcValidatorZFontValidatorZNamelengthValidatorZNamelengthsrcValidatorr   )r   r   rR   rS   rT   rU   rV   rW   rX   rY   rZ   r    Zv_hoverlabelr!   )r   r   r   r     sP    8

zHoverlabel.__init__)
NNNNNNNNNN)r"   r#   r$   r%   rR   r&   rS   rT   rU   rV   rW   rX   rY   rZ   r   r   r   r'   r   r   )r   r   rQ   }  s<   661#         rQ   c                   s   e Zd Zedd Zejdd Zedd Zejdd Zedd Zejd	d Zed
d Zejdd Zedd Z	edd Z
d fdd	Z  ZS )Domainc             C   s   | d S )a\  
        If there is a layout grid, use the domain for this column in
        the grid for this sankey trace .
    
        The 'column' property is a integer and may be specified as:
          - An int (or float that will be cast to an int)
            in the interval [0, 9223372036854775807]

        Returns
        -------
        int
        columnr   )r   r   r   r   r\   ^	  s    zDomain.columnc             C   s   || d< d S )Nr\   r   )r   r   r   r   r   r\   n	  s    c             C   s   | d S )aV  
        If there is a layout grid, use the domain for this row in the
        grid for this sankey trace .
    
        The 'row' property is a integer and may be specified as:
          - An int (or float that will be cast to an int)
            in the interval [0, 9223372036854775807]

        Returns
        -------
        int
        rowr   )r   r   r   r   r]   t	  s    z
Domain.rowc             C   s   || d< d S )Nr]   r   )r   r   r   r   r   r]   	  s    c             C   s   | d S )a  
        Sets the horizontal domain of this sankey trace (in plot
        fraction).
    
        The 'x' property is an info array that may be specified as:
    
        * a list or tuple of 2 elements where:
    (0) The 'x[0]' property is a number and may be specified as:
          - An int or float in the interval [0, 1]
    (1) The 'x[1]' property is a number and may be specified as:
          - An int or float in the interval [0, 1]

        Returns
        -------
        list
        r8   r   )r   r   r   r   r8   	  s    zDomain.xc             C   s   || d< d S )Nr8   r   )r   r   r   r   r   r8   	  s    c             C   s   | d S )a  
        Sets the vertical domain of this sankey trace (in plot
        fraction).
    
        The 'y' property is an info array that may be specified as:
    
        * a list or tuple of 2 elements where:
    (0) The 'y[0]' property is a number and may be specified as:
          - An int or float in the interval [0, 1]
    (1) The 'y[1]' property is a number and may be specified as:
          - An int or float in the interval [0, 1]

        Returns
        -------
        list
        r:   r   )r   r   r   r   r:   	  s    zDomain.yc             C   s   || d< d S )Nr:   r   )r   r   r   r   r   r:   	  s    c             C   s   dS )Nr   r   )r   r   r   r   r   	  s    zDomain._parent_path_strc             C   s   dS )Na          column
            If there is a layout grid, use the domain for this
            column in the grid for this sankey trace .
        row
            If there is a layout grid, use the domain for this row
            in the grid for this sankey trace .
        x
            Sets the horizontal domain of this sankey trace (in
            plot fraction).
        y
            Sets the vertical domain of this sankey trace (in plot
            fraction).
        r   )r   r   r   r   r   	  s    zDomain._prop_descriptionsNc       	         sD  t t| d |dkri }n4t|| jr4| }nt|trJt|}nt	d|
dd| _ddlm} | | jd< | | jd	< | | jd
< | | jd< |
dd}|dk	r|n|| d< |
d	d}|dk	r|n|| d	< |
d
d}|dk	r|n|| d
< |
dd}|dk	r|n|| d< | jf t|f| d| _dS )a  
        Construct a new Domain object
        
        Parameters
        ----------
        arg
            dict of properties compatible with this constructor or
            an instance of :class:`plotly.graph_objs.sankey.Domain`
        column
            If there is a layout grid, use the domain for this
            column in the grid for this sankey trace .
        row
            If there is a layout grid, use the domain for this row
            in the grid for this sankey trace .
        x
            Sets the horizontal domain of this sankey trace (in
            plot fraction).
        y
            Sets the vertical domain of this sankey trace (in plot
            fraction).

        Returns
        -------
        Domain
        domainNzThe first argument to the plotly.graph_objs.sankey.Domain 
constructor must be a dict or 
an instance of :class:`plotly.graph_objs.sankey.Domain`r   Fr   )r^   r\   r]   r8   r:   )r   r[   r   r   r   r   r   r   r   r   r   r   r   r^   ZColumnValidatorr   ZRowValidatorrE   rF   r   )	r   r   r\   r]   r8   r:   r    Zv_domainr!   )r   r   r   r   	  s2    

zDomain.__init__)NNNNN)r"   r#   r$   r%   r\   r&   r]   r8   r:   r   r   r   r'   r   r   )r   r   r[   Z	  s   r[   r0   rP   r<   )r<   )rP   )r0   )Zplotly.basedatatypesr   Z_BaseTraceHierarchyTyper   r   r   r(   r,   rG   rQ   r[   __all__Zplotly.graph_objs.sankeyr<   rP   r0   r   r   r   r   <module>   s\    a 
     Z      0   \ L