Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"A mapper graph should have more than 0 nodes. This might be because your clustering algorithm might be too sensitive and be classifying all points as noise."
)
color_function = init_color_function(simplicial_complex, color_function)
json_graph = scomplex_to_graph(
simplicial_complex,
color_function,
X,
X_names,
lens,
lens_names,
custom_tooltips,
colorscale=colorscale,
)
colorf_distribution = graph_data_distribution(
simplicial_complex, color_function, colorscale
)
mapper_summary = format_meta(
simplicial_complex,
color_function_name=color_function_name,
custom_meta=custom_meta,
)
return json_graph, mapper_summary, colorf_distribution
mapper_data = format_mapper_data(
graph,
color_function,
X,
X_names,
lens,
lens_names,
custom_tooltips,
env,
nbins,
)
colorscale = colorscale_default
histogram = graph_data_distribution(graph, color_function, colorscale)
mapper_summary = format_meta(graph, custom_meta)
# Find the absolute module path and the static files
js_path = os.path.join(os.path.dirname(__file__), "static", "kmapper.js")
with open(js_path, "r") as f:
js_text = f.read()
css_path = os.path.join(os.path.dirname(__file__), "static", "style.css")
with open(css_path, "r") as f:
css_text = f.read()
# Render the Jinja template, filling fields as appropriate
template = env.get_template("base.html").render(
title=title,
mapper_summary=mapper_summary,