Ë
    {�h¼  ã                   óN   — d dl mZ d dlZd dlmZ d dlmZ d„ Z		 	 	 	 	 	 	 	 dd„Z
y)é    )ÚNumberN)Ú
graph_objsc                 óv   — dt        | «      dz
  z  }t        | «      D ��cg c]  \  }}||z  |g‘Œ c}}S c c}}w )zº
    Makes a list of colors into a colorscale-acceptable form

    For documentation regarding to the form of the output, see
    https://plot.ly/python/reference/#mesh3d-colorscale
    g      ð?é   )ÚlenÚ	enumerate)ÚcolorsÚscaleÚiÚcolors       ú_/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/plotly/figure_factory/_2d_density.pyÚmake_linear_colorscaler   	   s<   € ð ”3�v“; ‘?Ñ#€EÜ/8¸Ó/@×A¡8 1 eˆQ�‰Y˜ÒÓAÐAùÓAs    5c
                 ó¢  — | |fD ]3  }
t        d„ |
D «       «      rŒt        j                  j                  d«      ‚ t	        | «      t	        |«      k7  rt        j                  j                  d«      ‚t        j                  |d«      }t        |«      }t        j                  |d«      }t        j                  |d«      }t        j                  | |ddt        |d   |d¬	«      ¬
«      }t        j                  | |d||dd¬«      }t        j                  | dt        |d   ¬«      d¬«      }t        j                  |dt        |d   ¬«      d¬«      }||||g}t        j                  dd|||	t        ddgdd¬«      t        ddgdd¬«      t        d¬«      ddt        ddgdd¬«      t        ddgdd¬«      ¬«      }t        j                  ||¬«      }|S )a=  
    **deprecated**, use instead
    :func:`plotly.express.density_heatmap`.

    :param (list|array) x: x-axis data for plot generation
    :param (list|array) y: y-axis data for plot generation
    :param (str|tuple|list) colorscale: either a plotly scale name, an rgb
        or hex color, a color tuple or a list or tuple of colors. An rgb
        color is of the form 'rgb(x, y, z)' where x, y, z belong to the
        interval [0, 255] and a color tuple is a tuple of the form
        (a, b, c) where a, b and c belong to [0, 1]. If colormap is a
        list, it must contain the valid color types aforementioned as its
        members.
    :param (int) ncontours: the number of 2D contours to draw on the plot
    :param (str) hist_color: the color of the plotted histograms
    :param (str) point_color: the color of the scatter points
    :param (str) point_size: the color of the scatter points
    :param (str) title: set the title for the plot
    :param (float) height: the height of the chart
    :param (float) width: the width of the chart

    Examples
    --------

    Example 1: Simple 2D Density Plot

    >>> from plotly.figure_factory import create_2d_density
    >>> import numpy as np

    >>> # Make data points
    >>> t = np.linspace(-1,1.2,2000)
    >>> x = (t**3)+(0.3*np.random.randn(2000))
    >>> y = (t**6)+(0.3*np.random.randn(2000))

    >>> # Create a figure
    >>> fig = create_2d_density(x, y)

    >>> # Plot the data
    >>> fig.show()

    Example 2: Using Parameters

    >>> from plotly.figure_factory import create_2d_density

    >>> import numpy as np

    >>> # Make data points
    >>> t = np.linspace(-1,1.2,2000)
    >>> x = (t**3)+(0.3*np.random.randn(2000))
    >>> y = (t**6)+(0.3*np.random.randn(2000))

    >>> # Create custom colorscale
    >>> colorscale = ['#7A4579', '#D56073', 'rgb(236,158,105)',
    ...              (1, 1, 0.2), (0.98,0.98,0.98)]

    >>> # Create a figure
    >>> fig = create_2d_density(x, y, colorscale=colorscale,
    ...       hist_color='rgb(255, 237, 222)', point_size=3)

    >>> # Plot the data
    >>> fig.show()
    c              3   ó<   K  — | ]  }t        |t        «      –— Œ y ­w)N)Ú
isinstancer   )Ú.0Úelements     r   ú	<genexpr>z$create_2d_density.<locals>.<genexpr>a   s   è ø€ ÒD°7”:˜g¤v×.ÑDùs   ‚z7All elements of your 'x' and 'y' lists must be numbers.z/Both lists 'x' and 'y' must be the same length.ÚrgbÚmarkersÚpointsr   gš™™™™™Ù?)r   ÚsizeÚopacity)ÚxÚyÚmodeÚnameÚmarkerÚdensityTF)r   r   r   Ú	ncontoursÚ
colorscaleÚreversescaleÚ	showscalez	x density)r   Úy2)r   r   r   Úyaxisz	y densityÚx2)r   r   r   Úxaxisg333333ë?)ÚdomainÚshowgridÚzerolineé2   )ÚtÚclosestr   )Ú
showlegendÚautosizeÚtitleÚheightÚwidthr'   r%   ÚmarginÚ	hovermodeÚbargapÚxaxis2Úyaxis2)ÚdataÚlayout)ÚallÚplotlyÚ
exceptionsÚPlotlyErrorr   ÚclrsÚvalidate_colorsr   r   ÚScatterÚdictÚHistogram2dContourÚ	HistogramÚLayoutÚFigure)r   r   r!   r    Ú
hist_colorÚpoint_colorÚ
point_sizer0   r1   r2   ÚarrayÚtrace1Útrace2Útrace3Útrace4r8   r9   Úfigs                     r   Úcreate_2d_densityrO      sä  € ðX �Q�ò ˆÜÑD¸eÔDÕDÜ×#Ñ#×/Ñ/ØIóð ðô ˆ1ƒv”�Q“ÒÜ×Ñ×+Ñ+Ø=ó
ð 	
ô ×%Ñ% j°%Ó8€JÜ'¨
Ó3€Jô ×%Ñ% j°%Ó8€JÜ×&Ñ& {°EÓ:€Kä×ÑØ
Ø
ØØÜ˜+ a™.¨zÀ3ÔGô€Fô ×*Ñ*Ø
Ø
ØØØØØô€Fô ×!Ñ!Ø
�+¤d°¸A±Ô&?Àtô€Fô ×!Ñ!Ø
�+¤d°¸A±Ô&?Àtô€Fð �F˜F FÐ+€Dä×ÑØØØØØÜ˜1˜d˜)¨e¸eÔDÜ˜1˜d˜)¨e¸eÔDÜ�bŒzØØÜ˜D !˜9¨u¸uÔEÜ˜D !˜9¨u¸uÔEô€Fô ×
Ñ
 ¨fÔ
5€CØ€Jó    )ÚEarthé   ©r   r   g      à?rS   é   z2D Density PlotéX  rU   )Únumbersr   Úplotly.exceptionsr;   Úplotly.colorsr	   r>   Úplotly.graph_objsr   r   rO   © rP   r   ú<module>r[      s7   ðÝ ã å Ý (òBð ØØØØØ
ØØ
ôGrP   