Arc Diagram
Arc Diagram
An arc diagram.
Usage
from dataviz_mojo import arc_diagram
from dataviz_mojo.plot import save
def main() raises:
var from_characters: List[String] = ["Alice", "Bob", "Alice", "Carol", "Dave"]
var to_characters: List[String] = ["Bob", "Carol", "Carol", "Dave", "Eve"]
var scenes_together: List[Float64] = [8.0, 5.0, 3.0, 6.0, 4.0]
var c = arc_diagram(from_characters, to_characters, scenes_together)
save(c, "docs/src/examples/out_arc_diagram.svg")Args:
from_categories: Each edge’s source node, one entry per row.to_categories: Each edge’s destination node, one entry per row (paired withfrom_categories[i]).values: Each edge’s magnitude, sizing its arc; must be non-negative.theme: Full styling knobs beyond this function’s own parameters (colors, margins, fonts, gridlines, …) – seeTheme’s docstring.width: Pixel width of the returnedPlot(.size()).height: Pixel height of the returnedPlot(.size()).title: The chart’s title, shown above the plot.subtitle: A secondary line shown under the title.x_title: The x-axis caption.y_title: The y-axis caption.