<commit_before>"""
Plot a collection of test cases

It is assumed that all leafs are of the same structure,
but not necessary same amount of test cases inside
a leaf
"""

from .common import PlotAxis, plot_header
from . import collectionutil
from . import treeutil


def is_custom_xtics(x_axis):
    return x_axis != PlotAxis.CATEGORY


def get_tmargin_base(tree):
    _, _, n_depth, _ = collectionutil.get_tree_details(tree)
    tmargin_base = 1 * n_depth + 2
    if 'subtitle' in tree and tree['subtitle']:
        tmargin_base += .8
    return tmargin_base


def line_at_x_offset(xoffset, value_at_x, testmeta, x_axis):
    xpos = get_x_coordinate(testmeta, value_at_x, x_axis)

    return """
        set style line 100 lt 1 lc rgb 'red' lw .5 dt 7
        set arrow from first """ + str(xpos+xoffset) + """, graph 0 to first """ + str(xpos+xoffset) + """, graph 1 nohead ls 100 back<commit_msg>plot: Disable custom xtics temporarily<commit_after>"""
Plot a collection of test cases

It is assumed that all leafs are of the same structure,
but not necessary same amount of test cases inside
a leaf
"""

from .common import PlotAxis, plot_header
from . import collectionutil
from . import treeutil


def is_custom_xtics(x_axis):
    return x_axis != PlotAxis.CATEGORY and False


def get_tmargin_base(tree):
    _, _, n_depth, _ = collectionutil.get_tree_details(tree)
    tmargin_base = 1 * n_depth + 2
    if 'subtitle' in tree and tree['subtitle']:
        tmargin_base += .8
    return tmargin_base


def line_at_x_offset(xoffset, value_at_x, testmeta, x_axis):
    xpos = get_x_coordinate(testmeta, value_at_x, x_axis)

    return """
        set style line 100 lt 1 lc rgb 'red' lw .5 dt 7
        set arrow from first """ + str(xpos+xoffset) + """, graph 0 to first """ + str(xpos+xoffset) + """, graph 1 nohead ls 100 back
{'fraction_non_alphanumeric': 0.09219858156028368, 'fraction_numerical': 0.015275504637206765, 'mean_word_length': 3.7146529562982007, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1064326', 'n_tokens_mistral': 643, 'n_tokens_neox': 600, 'n_words': 209}