vis

decitala.vis.create_tree_diagram(FragmentTree, path=None, webshot=False, verbose=False)[source]

This function creates a visualization of a given FragmentTree using the Treant.js library. If a path is provided, all the files will be stored there. Otherwise, they will be stored in a tempfile for the display.

Parameters
  • FragmentTree (FragmentTree) – A Fragment tree

  • path (str) – Path to the folder where the visualization will be optionally stored. Default is None.

Returns

A folder at the provided path containing an index.html file which has a visualization of the provided FragmentTree.

decitala.vis.fragment_roll(data, flip=False, title=None, save_path=None)[source]

Creates a piano-roll type visualization of the fragments given in data.

Parameters
  • data (list) – a list of decitala.search.Extraction objects. Probably from decitala.search.path_finder.

  • flip (bool) – whether to flip the x-axis of the plot. Default is False.

  • title (str) – title for the plot. Default is None.

  • save_path (str) – optional path to save the plot (DPI=350). Default is None.

decitala.vis.annotate_score(data, filepath, part_num, transcription_mode=False)[source]

Function for annotating a score with data.

Parameters
  • data (list) – a list of decitala.search.Extraction objects.

  • filepath (str) – Filepath to the score to be annotated. Should correspond to the filepath used in the creation of the data.

  • part_num (int) – Part number in the filepath which is to be annotated.Should correspond to the filepath used in the creation of the data.

decitala.vis.result_bar_plot(data, title=None, save_filepath=None)[source]

Returns a bar plot of input data.

Parameters
  • data (list) – a list of decitala.search.Extraction objects.

  • title (str) – Title for the plot. Default is None.

  • save_filepath (str) – Optional path to save the plot (DPI=350). Default is None.

decitala.vis.plot_2D_search_results(data=None, path=None, title=None, legend=True, save_path=None)[source]

Function for plotting the results of (usually) the full extracted data from a composition, as well as a path extracted from it. The data parameter will plot the fragments as a scatter plot of their start and end; the path parameter will plot the connected line between the path fragments.

Parameters
  • data (list) – a list of decitala.search.Extraction objects.

  • path (list) – Intended for data from decitala.search.path_finder. Default is `None.

  • title (str) – Title for the plot. Default is None.

  • legend (bool) – Whether to include a legend in the final plot. Default is True.

  • save_path (str) – Optional path to save the plot (DPI=350). Default is None.

../_images/Prosodic_Tree.png

The Fragment Tree of Greek Prosodic Feet

../_images/Fragment_Roll.png

Fragment Roll diagram of Sept Haïkaï (Bois)

../_images/2D_plot.png

2D Plot of Search and Path Results for Fake Composition.