@@ -625,7 +625,7 @@ def _parse_get_trace_props(
625
625
626
626
"""
627
627
hf_x : np .ndarray = (
628
- trace ["x" ]
628
+ ( np . asarray ( trace ["x" ]) if trace [ "x" ] is not None else None )
629
629
if hasattr (trace , "x" ) and hf_x is None
630
630
else hf_x .values
631
631
if isinstance (hf_x , pd .Series )
@@ -641,7 +641,7 @@ def _parse_get_trace_props(
641
641
if isinstance (hf_y , (pd .Series , pd .Index ))
642
642
else hf_y
643
643
)
644
- hf_y : np .ndarray = np .asarray (hf_y )
644
+ hf_y : np .ndarray = np .asarray (hf_y )
645
645
646
646
hf_text = (
647
647
hf_text
@@ -696,9 +696,7 @@ def _parse_get_trace_props(
696
696
hf_hovertext = hf_hovertext [not_nan_mask ]
697
697
698
698
# 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" ):
702
700
try :
703
701
# Try to parse to numeric
704
702
hf_x = pd .to_numeric (hf_x , errors = "raise" )
@@ -901,7 +899,7 @@ def add_trace(
901
899
As this is a costly operation, it is recommended to set this parameter to
902
900
False if you are sure that your data does not contain NaNs (or when the
903
901
downsampler can handle NaNs, e.g., EveryNthPoint). This should considerably
904
- speed up the graph construction time.
902
+ speed up the graph construction time.
905
903
**trace_kwargs: dict
906
904
Additional trace related keyword arguments.
907
905
e.g.: row=.., col=..., secondary_y=...
@@ -973,7 +971,9 @@ def add_trace(
973
971
974
972
# construct the hf_data_container
975
973
# 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
+ )
977
977
978
978
# These traces will determine the autoscale its RANGE!
979
979
# -> so also store when `limit_to_view` is set.
@@ -1069,7 +1069,7 @@ def add_traces(
1069
1069
limit_to_views : None | List[bool] | bool, optional
1070
1070
List of limit_to_view booleans for the added traces. If set to True the
1071
1071
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``.
1073
1073
If a single boolean is passed, all to be added traces will use this value,
1074
1074
by default False.\n
1075
1075
Remark that setting this parameter to True ensures that low frequency traces
0 commit comments