
    eCi'                    ~   S SK Jr  S SKJrJrJr  S SKrS SKJrJ	r	J
r
  S SKJr  S SKrS SKrS SKrS SKJr  S SKJr  S SKJr  S S	KJr  S S
KJrJrJrJrJr  S SKJ r    " S S5      r!\
\"\!4   r#\
\$\!4   r%\
\&\!4   r'\
\$\(\!4   r)\
\$\\\!4   r*\ " S S5      5       r+        SS jr,  S         SS jjr-S r.g)    )annotations)	dataclassfieldsfieldN)AnyCallableUnion)	Generator)ndarray)	DataFrame)Artist)Scale)
PROPERTIESProperty	RGBATupleDashPatternDashPatternWithOffset)PlotSpecErrorc                      \ rS rSr     S	         S
S jjrS r\SS j5       r\SS j5       r\SS j5       r	Sr
g)Mappable   Nc                    Ub  U[         ;   d   eUb  U[        R                  ;   d   eXl        X0l        X l        X@l        XPl        g)a  
Property that can be mapped from data or set directly, with flexible defaults.

Parameters
----------
val : Any
    Use this value as the default.
depend : str
    Use the value of this feature as the default.
rc : str
    Use the value of this rcParam as the default.
auto : bool
    The default value will depend on other parameters at compile time.
grouping : bool
    If True, use the mapped variable to define groups.

N)r   mplrcParams_val_rc_depend_auto	_grouping)selfvaldependrcautogroupings         M/home/james-whalen/.local/lib/python3.13/site-packages/seaborn/_marks/base.py__init__Mappable.__init__   sH    2 Z'''>%%%	
!    c                    U R                   b  S[        U R                   5       S3nU$ U R                  b  SU R                   S3nU$ U R                  b  SU R                   S3nU$ U R                  (       a  SnU$ SnU$ )z?Nice formatting for when object appears in Mark init signature.<>z<depend:z<rc:z<auto>z<undefined>)r   reprr   r   r   )r    ss     r&   __repr__Mappable.__repr__?   s    99 DO$A&A  \\%4<<.*A  XX!txxj"A
 	 ZZA  Ar)   c                    U R                   $ )z>Return the name of the feature to source a default value from.)r   r    s    r&   r"   Mappable.dependM   s     ||r)   c                    U R                   $ N)r   r2   s    r&   r%   Mappable.groupingR   s    ~~r)   c                    U R                   b  U R                   $ U R                  b)  [        R                  R	                  U R                  5      $ g)zGGet the default value for this feature, or access the relevant rcParam.N)r   r   r   r   getr2   s    r&   defaultMappable.defaultV   s@     99 99XX!<<##DHH-- "r)   )r   r   r   r   r   )NNNFT)
r!   r   r"   
str | Noner#   r;   r$   boolr%   r<   )returnr   )r=   r<   )__name__
__module____qualname____firstlineno__r'   r/   propertyr"   r%   r9   __static_attributes__ r)   r&   r   r      s     !"""" "" 	""
 "" ""H     . .r)   r   c                      \ rS rSr% Sr\" \S9rS\S'   \	S 5       r
\	S 5       r S       SS	 jjrSS
 jr        SS jr        SS jrSrg)Markh   z4Base class for objects that visually represent data.)default_factorydict
artist_kwsc                    [        U 5       Vs0 s HD  n[        UR                  [        5      (       d  M$  UR                  [        XR                  5      _MF     sn$ s  snf r5   )r   
isinstancer9   r   namegetattrr    fs     r&   _mappable_propsMark._mappable_propsn   sN     4:$<
3?a!))X. *AFFGD&&))<
 	
 
s
   #A$Ac                    [        U 5       Vs/ s HM  n[        UR                  [        5      (       d  M$  UR                  R                  (       d  MA  UR
                  PMO     sn$ s  snf r5   )r   rL   r9   r   r%   rM   rO   s     r&   _grouping_propsMark._grouping_propsu   sR    
 #4L
(q!))X. 34993E3E AFFL
 	
 
s   #A%A%A%Nc                   U R                   U   n[        R                  " U[        U5      5      n[	        U[
        5      (       + n[	        U[        R                  5      nU=(       a    UR                  S5      (       + nUS:X  a  U=(       a    X!;  nU(       aF  UR                  U5      nU(       a  U/[        U5      -  nU(       a  [        R                  " U5      nU$ X!;   a=  Ub  X#;  a  X   nOX2   n	X   n
 U	" U
5      nU(       a  [        R                   " U5      nU$ UR"                  b  U R%                  XR"                  U5      $ UR                  UR&                  5      nU(       a  U/[        U5      -  nU(       a  [        R                  " U5      nU$ ! [         a  n[        R                  " SU5      UeSnAff = f)a/  Obtain default, specified, or mapped value for a named feature.

Parameters
----------
data : DataFrame or dict with scalar values
    Container with data values for features that will be semantically mapped.
name : string
    Identity of the feature / semantic.
scales: dict
    Mapping from variable to corresponding scale object.

Returns
-------
value or array of values
    Outer return type depends on whether `data` is a dict (implying that
    we want a single value) or DataFrame (implying that we want an array
    of values with matching length).

stylewidthNzScaling operation)rQ   r   r8   r   rL   r   pdr   endswithstandardizelennparray	Exceptionr   _duringasarrayr"   _resolver9   )r    datarM   scalesfeaturepropdirectly_specifiedreturn_multiplereturn_arrayscalevalueerrr9   s                r&   rb   Mark._resolve   s   2 &&t,~~dHTN3!+GX!>>$T2<<8&Et}}W/E+E
 7?!3!H8H&&w/G")c$i/((7+N<~!3*
T#ElG **W-N>>% ==~~v>>""7??3i#d)+Ghhw'G# ! T'//0CTJPSSTs   9F 
G #F;;G c                l    SU;  a  SOUS   R                   nSU;  a  SOUS   R                   nX2:  a  gg)Nxr   y)	_priority)r    rd   ro   rp   s       r&   _infer_orientMark._infer_orient   s?     F"As(=(=F"As(=(=5r)   c                    [        5       e)z#Main interface for creating a plot.)NotImplementedError)r    split_generatorrd   orients       r&   _plot
Mark._plot   s     "##r)   c                    g r5   rD   )r    	variablesrk   rd   s       r&   _legend_artistMark._legend_artist   s     r)   rD   r5   )rc   zDataFrame | dict[str, Any]rM   strrd   dict[str, Scale] | Noner=   r   )rd   rI   r=   r~   )rv   zCallable[[], Generator]rd   dict[str, Scale]rw   r~   r=   None)r{   z	list[str]rk   r   rd   r   r=   zArtist | None)r>   r?   r@   rA   __doc__r   rI   rJ   __annotations__rB   rQ   rT   rb   rr   rx   r|   rC   rD   r)   r&   rF   rF   h   s    >T2J2
 
 
 
 +/	G(G G (	G
 
GR $0$ !$ 	$
 
$"+.8H	r)   rF   c           	     h    U R                    Vs0 s H  o3U R                  XU5      _M     nnU$ s  snf r5   )rQ   rb   )markrc   rd   rM   propss        r&   resolve_propertiesr      sB    
 =A<P<P<PDdmmD//<P 
  Ls   /c                   U R                  X S3U5      nU S3U R                  ;   a  U R                  X S3U5      nOU R                  USU5      nS	S jn[        R                  " U5      S:  a  [	        S U 5       5      (       al  [        U5      S:X  a  [        R                  R                  U5      $ U" U5      (       a  UO[        R                  n[        R                  R                  XE5      $ [        R                  " U5      S:X  a2  UR                  S   S:X  a  [        R                  R                  U5      $ [        R                  " U" USS9U[        R                  5      n[        R                  R                  XE5      $ )
a  
Obtain a default, specified, or mapped value for a color feature.

This method exists separately to support the relationship between a
color and its corresponding alpha. We want to respect alpha values that
are passed in specified (or mapped) color values but also make use of a
separate `alpha` variable, which can be mapped. This approach may also
be extended to support mapping of specific color channels (i.e.
luminance, chroma) in the future.

Parameters
----------
mark :
    Mark with the color property.
data :
    Container with data values for features that will be semantically mapped.
prefix :
    Support "color", "fillcolor", etc.

coloralphac                    [         R                  " U 5      R                  R                  S:g  =(       d%    [         R                  " U 5      R                  U5      $ )z5Detect "invisible" colors to set alpha appropriately.rP   )r]   r^   dtypekindisfiniteall)ro   axiss     r&   visibleresolve_color.<locals>.visible  s;     xx{  %%,HA0B0B40HHr)      c              3  B   #    U  H  n[        U[        5      v   M     g 7fr5   )rL   float).0ro   s     r&   	<genexpr> resolve_color.<locals>.<genexpr>  s     !F1*Q"6"6s         )r   r5   )rb   rQ   r]   ndimr   r\   r   colorsto_rgbananshapeto_rgba_arraywhere)r   rc   prefixrd   r   r   r   s          r&   resolve_colorr      s/   4 MM$(% 0&9E
4///dhe$4f=dGV4I 
wwu~c!F!FFFu:?::%%e,, RVVzz!!%//775>Q5;;q>Q#6::++E22Q/?zz''55r)   c                   [        U 5       Vs/ s H0  n[        UR                  [        5      (       d  M$  UR                  PM2     nnSS[
        R                  " SR                  U Vs/ s H	  nSU S3PM     sn5      SSSS9/nU R                  R                  S5      nSR                  / US S	 QUQUS	S  Q5      nX`l        U $ s  snf s  snf )
N z/    This mark defines the following properties:z, |N   z        )rX   initial_indentsubsequent_indent
r   )
r   rL   r9   r   rM   textwrapfilljoinr   split)r   rP   
propertiesptextdocstring_linesnew_docstrings          r&   document_propertiesr   *  s    "(,R,Q*QYY2Q&!&&,JR
9II4A1#Qx45W	
D ll((.OII 	!		 
	 M
 !LK# S
 5s   #CC(C
)r   rF   rc   r   rd   r   r=   zdict[str, Any])r   N)
r   rF   rc   zDataFrame | dictr   r~   rd   r   r=   zRGBATuple | ndarray)/
__future__r   dataclassesr   r   r   r   typingr   r   r	   collections.abcr
   numpyr]   pandasrY   
matplotlibr   r   r   matplotlib.artistr   seaborn._core.scalesr   seaborn._core.propertiesr   r   r   r   r   seaborn._core.exceptionsr   r   r<   MappableBoolr~   MappableStringr   MappableFloattupleMappableColorMappableStylerF   r   r   r   rD   r)   r&   <module>r      s   " 0 0  ' ' %      $ &  3B. B.N T8^$sH}%eXo&c5(*+c;(=xGH | | |~
)9 &*	26
26
26 26 $	26
 26pr)   