<commit_before>'use strict';

var Plotly = window.Plotly;
var ToolPanel = window.ToolPanel;
var divs = [];

function createRemoveButton () {
    var removeButton = document.createElement('button');
    removeButton.innerHTML = 'remove toolpanel';
    removeButton.id = 'removeButton';
    document.body.appendChild(removeButton);

    removeButton.onclick = function () {
        divs[0].toolPanel.remove();
    };
}

function createPlot (divId) {
    var containerDiv = document.getElementById('main');
    var graphDiv = document.createElement('div');
    var toolDiv = document.createElement('div');
    containerDiv.style.width = '100%';
    containerDiv.style.height = '100%';
    containerDiv.style.clear = 'both';

    graphDiv.id = divId;
    graphDiv.style.width = '80%';
    graphDiv.style.display = 'inline-block';
    graphDiv.style.margin = '0px';
    graphDiv.style.position = 'relative';
    graphDiv.style.verticalAlign = 'top';

    toolDiv.className = 'toolDiv';

    containerDiv.appendChild(toolDiv);
    containerDiv.appendChild(graphDiv);

    var trace1 = {
        x: [1, 2, 3, 4],
        y: [10, 15, 13, 17],
        type: 'scatter'
    };

    var trace2 = {
        x: [1, 2, 3, 4],
        y: [16, 5, 11, 9],
        type: 'scatter'
    };

    var data = [trace1, trace2];
    var toolPanel;

    Plotly.newPlot(divId, data);

    graphDiv.toolPanel = toolPanel = new ToolPanel(Plotly, graphDiv, {
        standalone: true,
        popoverContainer: containerDiv
    });

    window.toolPanel = graphDiv.toolPanel;

    graphDiv.toolPanel.makeMenu({
        toolMenuContainer: toolDiv<commit_msg>Added toolPanel.restyleMenu, setMenuDirection only sets local toolPanel state<commit_after>'use strict';

var Plotly = window.Plotly;
var ToolPanel = window.ToolPanel;
var divs = [];

function createRemoveButton () {
    var removeButton = document.createElement('button');
    removeButton.innerHTML = 'remove toolpanel';
    removeButton.id = 'removeButton';
    document.body.appendChild(removeButton);

    removeButton.onclick = function () {
        divs[0].toolPanel.remove();
    };
}

function createPlot (divId) {
    var containerDiv = document.getElementById('main');
    var graphDiv = document.createElement('div');
    var toolDiv = document.createElement('div');
    containerDiv.style.width = '100%';
    containerDiv.style.height = '100%';
    containerDiv.style.clear = 'both';

    graphDiv.id = divId;
    graphDiv.style.width = '80%';
    graphDiv.style.display = 'inline-block';
    graphDiv.style.margin = '0px';
    graphDiv.style.position = 'relative';
    graphDiv.style.verticalAlign = 'top';

    toolDiv.className = 'toolDiv';

    containerDiv.appendChild(toolDiv);
    containerDiv.appendChild(graphDiv);

    var trace1 = {
        x: [1, 2, 3, 4],
        y: [10, 15, 13, 17],
        type: 'scatter'
    };

    var trace2 = {
        x: [1, 2, 3, 4],
        y: [16, 5, 11, 9],
        type: 'scatter'
    };

    var data = [trace1, trace2];
    var toolPanel;

    Plotly.newPlot(divId, data);

    graphDiv.toolPanel = toolPanel = new ToolPanel(Plotly, graphDiv, {
        standalone: true,
        popoverContainer: containerDiv
    });

    window.toolPanel = graphDiv.toolPanel;

    graphDiv.toolPanel.makeMenu({
        toolMenuContainer: toolDiv,
        menuDirection: 'classic-narrow'
{'fraction_non_alphanumeric': 0.13494191242180517, 'fraction_numerical': 0.021447721179624665, 'mean_word_length': 3.007159904534606, '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': '5988576', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1031, 'n_words': 224}