<commit_before>/**
* Copyright 2012-2019, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

var d3 = require('d3');
var lineGroupStyle = require('../../components/drawing').lineGroupStyle;
var barStyle = require('../bar/style').style;
var barStyleOnSelect = require('../bar/style').styleOnSelect;

function style(gd, cd) {
    barStyle(gd, cd);

    var s = cd ? cd[0].node3 : d3.select(gd).selectAll('g.trace.bars');

    s.selectAll('g.lines').each(function(d) {
        var sel = d3.select(this);
        var connector = d[0].trace.connector;
        lineGroupStyle(sel.selectAll('path'),
            connector.line.width,
            connector.line.color,
            connector.line.dash
        );
    });
}

function styleOnSelect(gd, cd) {
    barStyleOnSelect(gd, cd);
}

module.exports = {
    style: style,
    styleOnSelect: styleOnSelect
};<commit_msg>make restyle connector visible (true|false) work<commit_after>/**
* Copyright 2012-2019, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

var d3 = require('d3');
var lineGroupStyle = require('../../components/drawing').lineGroupStyle;
var barStyle = require('../bar/style').style;
var barStyleOnSelect = require('../bar/style').styleOnSelect;

function style(gd, cd) {
    barStyle(gd, cd);

    var s = cd ? cd[0].node3 : d3.select(gd).selectAll('g.trace.bars');

    s.selectAll('g.lines').each(function(d) {
        var sel = d3.select(this);
        var connectorLine = (d[0].trace.connector.line || {});

        lineGroupStyle(sel.selectAll('path'),
            connectorLine.width,
            connectorLine.color,
            connectorLine.dash
        );
    });
}

function styleOnSelect(gd, cd) {
    barStyleOnSelect(gd, cd);
}

module.exports = {
    style: style,
    styleOnSelect: styleOnSelect
};
{'fraction_non_alphanumeric': 0.14950980392156862, 'fraction_numerical': 0.014705882352941176, 'mean_word_length': 3.106639839034205, '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': '6934199', 'n_tokens_mistral': 662, 'n_tokens_neox': 633, 'n_words': 155}