<commit_before><?php
//humanizing Column Heads
use Cake\Utility\Inflector;
use Search\Helper\ChartHelper;

//getting column heads
$listingFields = explode(',',$widgetData['info']['columns']);
?>
<div class='dashboard-widget-display_report'>
        <div class="row">
            <div class="col-xs-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><strong> <?= $widgetData['info']['name'] ?></strong></h3>
                    </div> <!-- panel-heading -->

                    <div class="panel-body">
                        <?php if($widgetData['info']['renderAs'] == 'table') : ?>
                        <div class="table-responsive">
                            <table class="table table-hover table-datatable">
                                <thead>
                                    <tr>
                                    <?php foreach($listingFields as $field) : ?>
                                        <th><?= Inflector::humanize($field) ?></th>
                                    <?php endforeach; ?>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php //pr($renderData); ?>
                                    <?php foreach($renderData as $k => $row): ?>
                                    <tr>
                                        <?php foreach($row as $field): ?>
                                            <td><?= $field ?></td>
                                        <?php endforeach; ?>
                                    </tr>
                                    <?php endforeach; ?>
                                </tbody>
                            </table>
                        </div> <!-- table-responsive -->
                        <?php endif; ?>

                        <?php if ($widgetData['info']['renderAs'] == 'barChart') : ?>
                            <?php
                                echo $this->Html->script('https://d3js.org/d3.v4.min.js');
                                echo $this->Html->script('https://d3js.org/d3-axis.v1.min.js');
                                echo $this->Html->script('https://d3js.org/d3-scale.v1.min.js');
                            ?>
                            <style>
                            .bar {
                              fill: steelblue;
                            }

                            .bar:hover {
                              fill: brown;
                            }

                            .axis--x path {
                              display: none;
                            }
                            </style>
                            <div id="viz_<?php echo $widgetData['slug'];?>"></div>

                            <script type="text/javascript">
                                var data = <?= $this->Chart->getChartData($renderData, ['data' => $widgetData]) ?>;

                                var margin = {top: 20, right: 20, bottom: 70, left: 40},
                                    width = 550 - margin.left - margin.right,
                                    height = 300 - margin.top - margin.bottom;

                                var x = d3.scaleBand().rangeRound([0, width]).padding(0.1),
                                    y = d3.scaleLinear().rangeRound([height, 0]);

                                var svg = d3.select("#viz_<?php echo $widgetData['slug'];?>").append("svg")
                                    .attr("width", width + margin.left + margin.right)
                                    .attr("height", height + margin.top + margin.bottom);

                                var g = svg.append("g")
                                    .attr("transform", "translate(" + margin.left + "," + margin.top + ")");

                                x.domain( data.map( function(d) { return d.x_axis; }) );
                                y.domain( [0, d3.max(data, function(d) { return d.y_axis;}) ] );

                                g.append("g")
                                  .attr("class", "axis axis--x")
                                  .attr("transform", "translate(0," + height + ")")<commit_msg>Resized report graph from 550x300 to 400x200<commit_after><?php
//humanizing Column Heads
use Cake\Utility\Inflector;
use Search\Helper\ChartHelper;

//getting column heads
$listingFields = explode(',',$widgetData['info']['columns']);
?>
<div class='dashboard-widget-display_report'>
        <div class="row">
            <div class="col-xs-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><strong> <?= $widgetData['info']['name'] ?></strong></h3>
                    </div> <!-- panel-heading -->

                    <div class="panel-body">
                        <?php if($widgetData['info']['renderAs'] == 'table') : ?>
                        <div class="table-responsive">
                            <table class="table table-hover table-datatable">
                                <thead>
                                    <tr>
                                    <?php foreach($listingFields as $field) : ?>
                                        <th><?= Inflector::humanize($field) ?></th>
                                    <?php endforeach; ?>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php //pr($renderData); ?>
                                    <?php foreach($renderData as $k => $row): ?>
                                    <tr>
                                        <?php foreach($row as $field): ?>
                                            <td><?= $field ?></td>
                                        <?php endforeach; ?>
                                    </tr>
                                    <?php endforeach; ?>
                                </tbody>
                            </table>
                        </div> <!-- table-responsive -->
                        <?php endif; ?>

                        <?php if ($widgetData['info']['renderAs'] == 'barChart') : ?>
                            <?php
                                echo $this->Html->script('https://d3js.org/d3.v4.min.js');
                                echo $this->Html->script('https://d3js.org/d3-axis.v1.min.js');
                                echo $this->Html->script('https://d3js.org/d3-scale.v1.min.js');
                            ?>
                            <style>
                            .bar {
                              fill: steelblue;
                            }

                            .bar:hover {
                              fill: brown;
                            }

                            .axis--x path {
                              display: none;
                            }
                            </style>
                            <div id="viz_<?php echo $widgetData['slug'];?>"></div>

                            <script type="text/javascript">
                                var data = <?= $this->Chart->getChartData($renderData, ['data' => $widgetData]) ?>;

                                var margin = {top: 20, right: 20, bottom: 70, left: 40},
                                    width = 400 - margin.left - margin.right,
                                    height = 200 - margin.top - margin.bottom;

                                var x = d3.scaleBand().rangeRound([0, width]).padding(0.1),
                                    y = d3.scaleLinear().rangeRound([height, 0]);

                                var svg = d3.select("#viz_<?php echo $widgetData['slug'];?>").append("svg")
                                    .attr("width", width + margin.left + margin.right)
                                    .attr("height", height + margin.top + margin.bottom);

                                var g = svg.append("g")
                                    .attr("transform", "translate(" + margin.left + "," + margin.top + ")");

                                x.domain( data.map( function(d) { return d.x_axis; }) );
                                y.domain( [0, d3.max(data, function(d) { return d.y_axis;}) ] );

                                g.append("g")
                                  .attr("class", "axis axis--x")
                                  .attr("transform", "translate(0," + height + ")")
{'fraction_non_alphanumeric': 0.13796307049123213, 'fraction_numerical': 0.009987225641621182, 'mean_word_length': 0.8335107515435384, 'pattern_counts': {'":': 0, '<': 107, '<?xml version=': 0, '>': 127, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 56, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3822408', 'n_tokens_mistral': 2050, 'n_tokens_neox': 1907, 'n_words': 362}