66import numba # type: ignore
77import numpy as np
88from numpydoc_decorator import doc # type: ignore
9- import anjl .params # type: ignore
109
1110# Internal imports.
1211from .snp_data import AnophelesSnpData
@@ -410,10 +409,10 @@ def plot_njt(
410409 metric : distance_params .distance_metric = distance_params .default_distance_metric ,
411410 distance_sort : Optional [tree_params .distance_sort ] = None ,
412411 count_sort : Optional [tree_params .count_sort ] = None ,
413- center_x : anjl . params .center_x = 0 ,
414- center_y : anjl . params .center_y = 0 ,
415- arc_start : anjl . params .arc_start = 0 ,
416- arc_stop : anjl . params .arc_stop = 2 * math .pi ,
412+ center_x : distance_params .center_x = 0 ,
413+ center_y : distance_params .center_y = 0 ,
414+ arc_start : distance_params .arc_start = 0 ,
415+ arc_stop : distance_params .arc_stop = 2 * math .pi ,
417416 width : plotly_params .fig_width = 800 ,
418417 height : plotly_params .fig_height = 600 ,
419418 show : plotly_params .show = True ,
@@ -426,8 +425,8 @@ def plot_njt(
426425 color_discrete_sequence : plotly_params .color_discrete_sequence = None ,
427426 color_discrete_map : plotly_params .color_discrete_map = None ,
428427 category_orders : plotly_params .category_order = None ,
429- edge_legend : anjl . params .edge_legend = False ,
430- leaf_legend : anjl . params .leaf_legend = True ,
428+ edge_legend : distance_params .edge_legend = False ,
429+ leaf_legend : distance_params .leaf_legend = True ,
431430 legend_sizing : plotly_params .legend_sizing = "constant" ,
432431 thin_offset : base_params .thin_offset = 0 ,
433432 sample_sets : Optional [base_params .sample_sets ] = None ,
@@ -449,6 +448,10 @@ def plot_njt(
449448 inline_array : base_params .inline_array = base_params .inline_array_default ,
450449 chunks : base_params .chunks = base_params .native_chunks ,
451450 ) -> plotly_params .figure :
451+ # Only import anjl if needed, as it requires a couple of seconds to compile
452+ # functions.
453+ import anjl # type: ignore
454+
452455 # Normalise params.
453456 if count_sort is None and distance_sort is None :
454457 count_sort = True
0 commit comments