<commit_before>define([
           'dojo/_base/declare',
           'JBrowse/View/FeatureGlyph/Box'
       ],
       function(
           declare,
           BoxGlyph
       ) {

return declare( BoxGlyph, {

_defaultConfig: function() {
    return this._mergeConfigs(
        this.inherited(arguments),
        {
            style: {
                connector_color: '#333',
                border_color: '#333'
            }
        });
},

renderBox: function( context, block, fRect ) {
    var rectWidth = fRect.rect.w;
    var rectHeight = fRect.rect.h;

    // connector
    var connectorColor = this.getStyle( fRect.f, 'connector_color' );
    if( connectorColor ) {
        context.fillStyle = connectorColor;
        context.fillRect( fRect.rect.l, fRect.t+Math.round(fRect.rect.h/2)-1, fRect.rect.w, 2 );
    }

    var subfeatures = fRect.f.children();
    if( subfeatures ) {

        // segment backgrounds
        var color = this.getStyle( fRect.f, 'color' );
        if( color ) {
            context.fillStyle = color;
            for( var i = 0; i < subfeatures.length; ++i ) {
                var left = block.bpToX( subfeatures[i].get('start') );
                var width = block.bpToX( subfeatures[i].get('end') ) - left;
                context.fillRect( left, fRect.t, width, rectHeight );
            }
        }

        // segment foregrounds
        // foreground border
        var border_color;
        if( rectHeight > 3 ) {
            border_color = this.getStyle( fRect.f, 'border_color' );
            if( border_color ) {
                context.lineWidth = 1;
                context.strokeStyle = border_color;
                for( var i = 0; i < subfeatures.length; ++i ) {
                    var left = block.bpToX( subfeatures[i].get('start') );
                    var width = block.bpToX( subfeatures[i].get('end') ) - left;

                    // need to stroke a smaller rectangle to remain within
                    // the bounds of the feature's overall height and
                    // width, because of the way stroking is done in
                    // canvas.  thus the +0.5 and -1 business.
                    context.strokeRect( left+0.5, fRect.t+0.5, width-1, rectHeight-1 );
                }
            }
        }
        else if( rectHeight > 1 ) {
            border_color = this.getStyle( fRect.f, 'border_color' );
            if( border_color ) {
                context.fillStyle = border_color;
                for( var i = 0; i < subfeatures.length; ++i ) {
                    var left = block.bpToX( subfeatures[i].get('start') );
                    var width = block.bpToX( subfeatures[i].get('end') ) - left;

                    context.fillRect( left, fRect.t+fRect.h-1, width, 1 );
                }
            }
        }

    }
}

});
});<commit_msg>tweak look of segments glyph borders<commit_after>define([
           'dojo/_base/declare',
           'JBrowse/View/FeatureGlyph/Box'
       ],
       function(
           declare,
           BoxGlyph
       ) {

return declare( BoxGlyph, {

_defaultConfig: function() {
    return this._mergeConfigs(
        this.inherited(arguments),
        {
            style: {
                connector_color: '#333',
                border_color: '#383838'
            }
        });
},

renderBox: function( context, block, fRect ) {
    var rectWidth = fRect.rect.w;
    var rectHeight = fRect.rect.h;

    // connector
    var connectorColor = this.getStyle( fRect.f, 'connector_color' );
    if( connectorColor ) {
        context.fillStyle = connectorColor;
        context.fillRect( fRect.rect.l, fRect.t+Math.round(fRect.rect.h/2)-1, fRect.rect.w, 2 );
    }

    var subfeatures = fRect.f.children();
    if( subfeatures ) {

        // segment backgrounds
        var color = this.getStyle( fRect.f, 'color' );
        if( color ) {
            context.fillStyle = color;
            for( var i = 0; i < subfeatures.length; ++i ) {
                var left = block.bpToX( subfeatures[i].get('start') );
                var width = block.bpToX( subfeatures[i].get('end') ) - left;
                context.fillRect( left, fRect.t, width, rectHeight );
            }
        }

        // segment foregrounds
        // foreground border
        var border_color;
        if( rectHeight > 3 ) {
            border_color = this.getStyle( fRect.f, 'border_color' );
            context.lineWidth = 0.3;

            if( border_color ) {
                context.strokeStyle = border_color;
                context.fillStyle = border_color;
                for( var i = 0; i < subfeatures.length; ++i ) {
                    var left = block.bpToX( subfeatures[i].get('start') );
                    var width = block.bpToX( subfeatures[i].get('end') ) - left;

                    if( width > 3 ) {
                        // need to stroke a smaller rectangle to remain within
                        // the bounds of the feature's overall height and
                        // width, because of the way stroking is done in
                        // canvas.  thus the +0.5 and -1 business.
                        context.strokeRect( left+0.5, fRect.t+0.5, width-1, rectHeight-1 );
                    }
                    else {
                        context.fillRect( left, fRect.t, Math.max(0.7,width), rectHeight );
                    }
                }
            }
        }
        else if( rectHeight > 1 ) {
            border_color = this.getStyle( fRect.f, 'border_color' );
            if( border_color ) {
                context.fillStyle = border_color;
                for( var i = 0; i < subfeatures.length; ++i ) {
                    var left = block.bpToX( subfeatures[i].get('start') );
                    var width = block.bpToX( subfeatures[i].get('end') ) - left;

                    context.fillRect( left, fRect.t+fRect.h-1, width, 1 );
                }
            }
        }

    }
}

});
});
{'fraction_non_alphanumeric': 0.11983887210473314, 'fraction_numerical': 0.009902651896609601, 'mean_word_length': 1.436222403924775, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 8, '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': '3857941', 'n_tokens_mistral': 1799, 'n_tokens_neox': 1685, 'n_words': 392}