config_file_path = dest_directory / (output_name + ".config.json")
if isinstance(lines, np.ndarray):
lines = lines.tolist()
// Make line_color canonical.
// It always passed to the js as an array of strings
// of the same length as lines.
if not hasattr(line_color, "__len__"):
line_color = [line_color]
line_color_list = []
for c in line_color:
if isinstance(c, int):
c = hex(c)
line_color_list.append(c)
if len(line_color_list) == 1:
line_color_list = line_color_list * len(lines)
if len(line_color_list) != len(lines):
raise ValueError("lines and line_colors must be the same length")