<commit_before># lodchart: reuseable LOD score chart

lodchart = () ->
    width = 800
    height = 500
    margin = {left:60, top:40, right:40, bottom: 40, inner:5}
    axispos = {xtitle:25, ytitle:30, xlabel:5, ylabel:5}
    titlepos = 20
    ylim = null
    nyticks = 5
    yticks = null
    chrGap = 8
    darkrect = "#c8c8c8"
    lightrect = "#e6e6e6"
    linecolor = "darkslateblue"
    linewidth = 2
    pointcolor = "#E9CFEC" # pink
    pointsize = 0 # default = no visible points at markers
    pointstroke = "black"
    title = ""
    xlab = "Chromosome"
    ylab = "LOD score"
    rotate_ylab = null
    yscale = d3.scale.linear()
    xscale = null
    pad4heatmap = false
    lodcurve = null
    lodvarname = null
    markerSelect = null
    chrSelect = null
    pointsAtMarkers = true

    ## the main function
    chart = (selection) ->
        selection.each (data) ->
            lodvarname = lodvarname ? data.lodnames[0]
            data[lodvarname] = (abs(x) for x in data[lodvarname]) # take absolute values
            ylim = ylim ? [0, d3.max(data[lodvarname])]
            lodvarnum = data.lodnames.indexOf(lodvarname)

            if data.chr.length != data.pos.length
                displayError("chr.length (#{data.chr.length}) != pos.length (#{data.pos.length})")
            if data.chr.length != data.markernames.length
                displayError("chr.length (#{data.chr.length}) != markernames.length (#{data.markernames.length})")

            # Select the svg element, if it exists.
            svg = d3.select(this).selectAll("svg").data([data])

            # Otherwise, create the skeletal chart.
            gEnter = svg.enter().append("svg").append("g")
<commit_msg>lodchart: force chrnames and lodnames to be treated as vectors<commit_after># lodchart: reuseable LOD score chart

lodchart = () ->
    width = 800
    height = 500
    margin = {left:60, top:40, right:40, bottom: 40, inner:5}
    axispos = {xtitle:25, ytitle:30, xlabel:5, ylabel:5}
    titlepos = 20
    ylim = null
    nyticks = 5
    yticks = null
    chrGap = 8
    darkrect = "#c8c8c8"
    lightrect = "#e6e6e6"
    linecolor = "darkslateblue"
    linewidth = 2
    pointcolor = "#E9CFEC" # pink
    pointsize = 0 # default = no visible points at markers
    pointstroke = "black"
    title = ""
    xlab = "Chromosome"
    ylab = "LOD score"
    rotate_ylab = null
    yscale = d3.scale.linear()
    xscale = null
    pad4heatmap = false
    lodcurve = null
    lodvarname = null
    markerSelect = null
    chrSelect = null
    pointsAtMarkers = true

    ## the main function
    chart = (selection) ->
        selection.each (data) ->
            data.chrnames = forceAsArray(data.chrnames)
            data.lodnames = forceAsArray(data.lodnames)
            lodvarname = lodvarname ? data.lodnames[0]
            data[lodvarname] = (abs(x) for x in data[lodvarname]) # take absolute values
            ylim = ylim ? [0, d3.max(data[lodvarname])]
            lodvarnum = data.lodnames.indexOf(lodvarname)

            if data.chr.length != data.pos.length
                displayError("chr.length (#{data.chr.length}) != pos.length (#{data.pos.length})")
            if data.chr.length != data.markernames.length
                displayError("chr.length (#{data.chr.length}) != markernames.length (#{data.markernames.length})")

            # Select the svg element, if it exists.
            svg = d3.select(this).selectAll("svg").data([data])

            # Otherwise, create the skeletal chart.
            gEnter = svg.enter().append("svg").append("g")

{'fraction_non_alphanumeric': 0.12398544640358243, 'fraction_numerical': 0.02239014833473272, 'mean_word_length': 2.3590225563909772, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4526552', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1141, 'n_words': 279}