<commit_before>/**
 * NVD3.js Bindings for Sencha ExtJS
 * @copyright Copyright 2017-2018 by <NAME>, Bavaria.
 * @author https://plus.google.com/106963082057954766426
 * @see https://d3js.org & https://nvd3.org
**/

/* global d3, NVD3Charts */

Ext.define('NVD3Charts.view.panel.ForceDirectedGraph', {
    extend: 'Ext.container.Container',
    requires: ['NVD3Charts.viewcontroller.ForceDirectedGraph'],
    name: 'PanelForceDirectedGraph',
    alias: ['widget.PanelForceDirectedGraph'],
    layout: 'fit',
    items: [{
        xtype: 'ForceDirectedGraph',
        store: Ext.create('NVD3Charts.store.ForceDirectedGraph'),
        chartOptions: {
            color: d3.scale.category20(),
            nodeExtras: (function(node) {
                node.append("text")
                    .attr("dx", 12).attr("dy", ".4em")
                    .text(function(d) { return d.name; });
            })
        },
        chartFn: function(chart) {

            /* in order to center the graph upon first load one has to define it's width & height. */
            var tabPanel= NVD3Charts.getApplication().getMainController().getTabPanel();
            var size = tabPanel.getPanelSize();
            chart.width(size[0]).height(size[1]);
            d3.select('#svg')
            .attr('width', size[0])
            .attr('height', size[1])
            .transition().duration(0)
            .call(chart);
        }
    }],
    getGraph: function() {
        return this.items.items[0];
    }
});<commit_msg>the directed graph is now being centered upon first load.<commit_after>/**
 * NVD3.js Bindings for Sencha ExtJS
 * @copyright Copyright 2017-2018 by <NAME>, Bavaria.
 * @author https://plus.google.com/106963082057954766426
 * @see https://d3js.org & https://nvd3.org
**/

/* global d3, NVD3Charts */

Ext.define('NVD3Charts.view.panel.ForceDirectedGraph', {
    extend: 'Ext.container.Container',
    requires: ['NVD3Charts.viewcontroller.ForceDirectedGraph'],
    name: 'PanelForceDirectedGraph',
    alias: ['widget.PanelForceDirectedGraph'],
    layout: 'fit',
    items: [{
        xtype: 'ForceDirectedGraph',
        store: Ext.create('NVD3Charts.store.ForceDirectedGraph'),
        chartOptions: {
            color: d3.scale.category20(),
            nodeExtras: (function(node) {
                node.append("text")
                    .attr("dx", 12).attr("dy", ".4em")
                    .text(function(d) { return d.name; });
            })
        },
        chartFn: function(chart) {

            /* to center the graph upon first load one has to define it's width & height. */
            var tabPanel= NVD3Charts.getApplication().getMainController().getTabPanel();
            var size = tabPanel.getPanelSize();
            chart.width(size[0]).height(size[1]);
        }
    }],
    getGraph: function() {
        return this.items.items[0];
    }
});
{'fraction_non_alphanumeric': 0.14926931106471816, 'fraction_numerical': 0.03409881697981907, 'mean_word_length': 2.3352668213457077, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, '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': '3729428', 'n_tokens_mistral': 923, 'n_tokens_neox': 868, 'n_words': 168}