@@ -625,7 +625,7 @@ def _parse_get_trace_props(
625625
626626 """
627627 hf_x : np .ndarray = (
628- trace ["x" ]
628+ ( np . asarray ( trace ["x" ]) if trace [ "x" ] is not None else None )
629629 if hasattr (trace , "x" ) and hf_x is None
630630 else hf_x .values
631631 if isinstance (hf_x , pd .Series )
@@ -641,7 +641,7 @@ def _parse_get_trace_props(
641641 if isinstance (hf_y , (pd .Series , pd .Index ))
642642 else hf_y
643643 )
644- hf_y : np .ndarray = np .asarray (hf_y )
644+ hf_y : np .ndarray = np .asarray (hf_y )
645645
646646 hf_text = (
647647 hf_text
@@ -696,9 +696,7 @@ def _parse_get_trace_props(
696696 hf_hovertext = hf_hovertext [not_nan_mask ]
697697
698698 # Try to parse the hf_x data if it is of object type or
699- if len (hf_x ) and (
700- hf_x .dtype .type is np .str_ or hf_x .dtype == "object"
701- ):
699+ if len (hf_x ) and (hf_x .dtype .type is np .str_ or hf_x .dtype == "object" ):
702700 try :
703701 # Try to parse to numeric
704702 hf_x = pd .to_numeric (hf_x , errors = "raise" )
@@ -901,7 +899,7 @@ def add_trace(
901899 As this is a costly operation, it is recommended to set this parameter to
902900 False if you are sure that your data does not contain NaNs (or when the
903901 downsampler can handle NaNs, e.g., EveryNthPoint). This should considerably
904- speed up the graph construction time.
902+ speed up the graph construction time.
905903 **trace_kwargs: dict
906904 Additional trace related keyword arguments.
907905 e.g.: row=.., col=..., secondary_y=...
@@ -973,7 +971,9 @@ def add_trace(
973971
974972 # construct the hf_data_container
975973 # TODO in future version -> maybe regex on kwargs which start with `hf_`
976- dc = self ._parse_get_trace_props (trace , hf_x , hf_y , hf_text , hf_hovertext , check_nans )
974+ dc = self ._parse_get_trace_props (
975+ trace , hf_x , hf_y , hf_text , hf_hovertext , check_nans
976+ )
977977
978978 # These traces will determine the autoscale its RANGE!
979979 # -> so also store when `limit_to_view` is set.
@@ -1069,7 +1069,7 @@ def add_traces(
10691069 limit_to_views : None | List[bool] | bool, optional
10701070 List of limit_to_view booleans for the added traces. If set to True the
10711071 trace's datapoints will be cut to the corresponding front-end view, even if
1072- the total number of samples is lower than ``max_n_samples``.
1072+ the total number of samples is lower than ``max_n_samples``.
10731073 If a single boolean is passed, all to be added traces will use this value,
10741074 by default False.\n
10751075 Remark that setting this parameter to True ensures that low frequency traces
0 commit comments