2525
2626# The colors in the default property cycle have been changed
2727# to the category10 color palette used by Vega and d3 originally developed at Tableau.
28- DEFAULT_COLORS = ['#1f77b4' , '#ff7f0e' , '#2ca02c' , '#d62728' , '#9467bd' , '#8c564b' , '#e377c2' , '#7f7f7f' , '#bcbd22' , '#17becf' ]
28+ DEFAULT_COLORS = [
29+ "#1f77b4" ,
30+ "#ff7f0e" ,
31+ "#2ca02c" ,
32+ "#d62728" ,
33+ "#9467bd" ,
34+ "#8c564b" ,
35+ "#e377c2" ,
36+ "#7f7f7f" ,
37+ "#bcbd22" ,
38+ "#17becf" ,
39+ ]
40+
2941
3042class BasePlotObject (object ):
3143 """Base class for plotting objects."""
@@ -73,6 +85,7 @@ def to_dict(self):
7385 def __repr__ (self ):
7486 return self .color
7587
88+
7689@dataclass
7790class Line (object ):
7891 type : LineType
@@ -81,9 +94,9 @@ class Line(object):
8194
8295 def to_dict (self ):
8396 return {
84- ' type' : self .type ,
85- ' color' : self .color ,
86- ' thickness' : self .thickness ,
97+ " type" : self .type ,
98+ " color" : self .color ,
99+ " thickness" : self .thickness ,
87100 }
88101
89102
@@ -97,11 +110,11 @@ class Marker(object):
97110
98111 def to_dict (self ):
99112 return {
100- ' size' : self .size ,
101- ' type' : self .type ,
102- ' fill' : self .fill ,
103- ' line_color' : self .line_color ,
104- ' line_thickness' : self .line_thickness ,
113+ " size" : self .size ,
114+ " type" : self .type ,
115+ " fill" : self .fill ,
116+ " line_color" : self .line_color ,
117+ " line_thickness" : self .line_thickness ,
105118 }
106119
107120
@@ -591,15 +604,19 @@ def add_curve(self, curve: Curve):
591604 # inject default colors if no colors provided
592605 color = Style .parse_color (
593606 color = DEFAULT_COLORS [curve .order % len (DEFAULT_COLORS )],
594- alpha = curve .kwargs .get ("alpha" , 1.0 )
607+ alpha = curve .kwargs .get ("alpha" , 1.0 ),
595608 )
596609 style = curve .style # type: Style
597610 if (style .line .type != LineType .NONE ) and (not style .line .color ):
598611 style .line .color = color
599- logger .warning (f"'{ self .sid } .{ curve .sid } ': undefined line color set to: { color } " )
612+ logger .warning (
613+ f"'{ self .sid } .{ curve .sid } ': undefined line color set to: { color } "
614+ )
600615 if (style .marker .type != MarkerType .NONE ) and (not style .marker .fill ):
601616 style .marker .fill = color
602- logger .error (f"'{ self .sid } .{ curve .sid } ': undefined marker fill set to: { color } " )
617+ logger .error (
618+ f"'{ self .sid } .{ curve .sid } ': undefined marker fill set to: { color } "
619+ )
603620
604621 self .curves .append (curve )
605622
@@ -644,7 +661,7 @@ def add_data(
644661 count : Union [int , str ] = None ,
645662 dataset : str = None ,
646663 task : str = None ,
647- label : str = "__yid__" ,
664+ label : str = "__yid__" ,
648665 single_lines = False ,
649666 dim_reduction = None ,
650667 ** kwargs ,
@@ -664,8 +681,10 @@ def add_data(
664681 "a curve use 'label=None' instead."
665682 )
666683 if label == "__yid__" :
667- logger .warning ("No label provided on curve, using default label 'yid'. "
668- "To not plot a label use 'label=None'" )
684+ logger .warning (
685+ "No label provided on curve, using default label 'yid'. "
686+ "To not plot a label use 'label=None'"
687+ )
669688
670689 # experiment to resolve data
671690 experiment = self .experiment
0 commit comments