[docs]classParallelCoordinateSeries(Series,SeriesWithAddEventListener,SeriesWithCursor):"""Represents a single series within a ParallelCoordinateChart. This series is associated with one ParallelCoordinateChart and is used to visualize data across the chart's axes. """def__init__(self,chart:Chart):""" Initialize a ParallelCoordinateSeries. Args: chart (Chart): The parent ParallelCoordinateChart to which this series belongs. theme (Themes): The theme of the series, default is `Themes.White`. name (str, optional): The name of the series. Defaults to None. """Series.__init__(self,chart)self.data=Noneself.instance.send(self.id,'addSeries',{'chart':self.chart.id},)
[docs]defset_data(self,data:dict[str,float]):""" Set data points for the series. Data is provided as a dictionary mapping axis names to values. Each axis name must match the axes defined in the associated ParallelCoordinateChart. Args: data (dict[str, float]): A dictionary where the keys are axis names and the values are the corresponding data values. Returns: The instance of the series for fluent interface. """self.data=dataself.instance.send(self.id,'setData',{'data':data})returnself
[docs]defget_data(self)->dict[str,float]|None:""" Retrieve the data of the series. The data is returned as a dictionary mapping axis names to their corresponding values. Returns: dict[str, float] | None: A dictionary of axis-value pairs if data is set, otherwise None. """returnself.data
[docs]defset_color(self,color:ColorInput|None):"""Set a color fill for the series. Args: color (Color): Color of the series. Use 'transparent' or None to hide. Returns: The instance of the class for fluent interface. """color=convert_color_to_hex(color)ifcolorisnotNoneelseNoneself.instance.send(self.id,'setColor',{'color':color})returnself
[docs]defget_color(self)->dict:"""Get color of the series. Returns: dict: Color as {'r': int, 'g': int, 'b': int, 'a': int} Notes: Call this in live mode, e.g. ``chart.open(live=True)`` Example: >>> series = chart.add_series() >>> series.set_color((255, 0, 0)) >>> color = series.get_color() >>> print(color) # {'r': 255, 'g': 0, 'b': 0, 'a': 255} """returnself.instance.get(self.id,'getColorParallelCoordinateSeries',{})