PageSourceSearch

https://www.uaem.mx/app/assets/js/chartactive.js

js uaem.mx collected 2026-09-24 08:40:06 UTC 6,760 bytes, 228 lines download raw bytes

1window.chartColors = {
2    red: 'rgb(255, 99, 132)',
3    orange: 'rgb(255, 159, 64)',
4    yellow: 'rgb(255, 205, 86)',
5    green: 'rgb(75, 192, 192)',
6    blue: 'rgb(54, 162, 235)',
7    purple: 'rgb(153, 102, 255)',
8    grey: 'rgb(201, 203, 207)'
9};
10
11(function (global) {
12    var Months = [
13        'January',
14        'February',
15        'March',
16        'April',
17        'May',
18        'June',
19        'July',
20        'August',
21        'September',
22        'October',
23        'November',
24        'December'
25    ];
26
27    var COLORS = [
28        '#4dc9f6',
29        '#f67019',
30        '#f53794',
31        '#537bc4',
32        '#acc236',
33        '#166a8f',
34        '#00a950',
35        '#58595b',
36        '#8549ba'
37    ];
38
39    var Samples = global.Samples || (global.Samples = {});
40    var Color = global.Color;
41
42    Samples.utils = {
43        // Adapted from http://indiegamr.com/generate-repeatable-random-numbers-in-js/
44        srand: function (seed) {
45            this._seed = seed;
46        },
47
48        rand: function (min, max) {
49            var seed = this._seed;
50            min = min === undefined ? 0 : min;
51            max = max === undefined ? 1 : max;
52            this._seed = (seed * 9301 + 49297) % 233280;
53            return min + (this._seed / 233280) * (max - min);
54        },
55
56        numbers: function (config) {
57            var cfg = config || {};
58            var min = cfg.min || 0;
59            var max = cfg.max || 1;
60            var from = cfg.from || [];
61            var count = cfg.count || 8;
62            var decimals = cfg.decimals || 8;
63            var continuity = cfg.continuity || 1;
64            var dfactor = Math.pow(10, decimals) || 0;
65            var data = [];
66            var i, value;
67
68            for (i = 0; i < count; ++i) {
69                value = (from[i] || 0) + this.rand(min, max);
70                if (this.rand() <= continuity) {
71                    data.push(Math.round(dfactor * value) / dfactor);
72                } else {
73                    data.push(null);
74                }
75            }
76
77            return data;
78        },
79
80        labels: function (config) {
81            var cfg = config || {};
82            var min = cfg.min || 0;
83            var max = cfg.max || 100;
84            var count = cfg.count || 8;
85            var step = (max - min) / count;
86            var decimals = cfg.decimals || 8;
87            var dfactor = Math.pow(10, decimals) || 0;
88            var prefix = cfg.prefix || '';
89            var values = [];
90            var i;
91
92            for (i = min; i < max; i += step) {
93                values.push(prefix + Math.round(dfactor * i) / dfactor);
94            }
95
96            return values;
97        },
98
99        months: function (config) {
100            var cfg = config || {};
101            var count = cfg.count || 12;
102            var section = cfg.section;
103            var values = [];
104            var i, value;
105
106            for (i = 0; i < count; ++i) {
107                value = Months[Math.ceil(i) % 12];
108                values.push(value.substring(0, section));
109            }
110
111            return values;
112        },
113
114        color: function (index) {
115            return COLORS[index % COLORS.length];
116        },
117
118        transparentize: function (color, opacity) {
119            var alpha = opacity === undefined ? 0.5 : 1 - opacity;
120            return Color(color).alpha(alpha).rgbString();
121        }
122    };
123
124    // DEPRECATED
125    window.randomScalingFactor = function () {
126        return Math.round(Samples.utils.rand(-100, 100));
127    };
128
129    // INITIALIZATION
130
131    Samples.utils.srand(Date.now());
132
133    // Google Analytics
134    /* eslint-disable */
135    if (document.location.hostname.match(/^(www\.)?chartjs\.org$/)) {
vendor: 525 bytes, lines 135-147
135
136        (function (i, s, o, g, r, a, m) {
137            i['GoogleAnalyticsObject'] = r;
138            i[r] = i[r] || function () {
139                (i[r].q = i[r].q || []).push(arguments)
140            }, i[r].l = 1 * new Date();
141            a = s.createElement(o),
142                m = s.getElementsByTagName(o)[0];
143            a.async = 1;
144            a.src = g;
145            m.parentNode.insertBefore(a, m)
146        })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
147        ga('create', '
147UA-28909194-3
vendor: 50 bytes, lines 147-149
147', 'auto');
148        ga('send', 'pageview');
149    
149}
150    /* eslint-enable */
151
152}(this));
153
154
155
156(function ($) {
157    "use strict";
158
159    var color = Chart.helpers.color;
160    var barChartData = {
161        labels: ['Sep', 'Oct', 'Nov', 'Dec', 'Jan'],
162        datasets: [{
163            label: 'Downloads',
164            barPercentage: 0.1,
165            backgroundColor: ['rgba(255,255,255,0.3)', 'rgba(255,255,255,0.4)', 'rgba(255,255,255,0.5)', 'rgba(255,255,255,0.6)', 'rgba(255,255,255,0.7)'],
166            borderWidth: 0,
167            barThickness: 0.9,
168            categoryPercentage: 0.1,
169            data: [
170                834,
171                1300,
172                2256,
173                3689,
174                5200
175            ]
176        }]
177    };
178
179    window.onload = function () {
180        var ctx = document.getElementById('downloadgraph').getContext('2d');
181        window.myBar = new Chart(ctx, {
182            type: 'bar',
183            data: barChartData,
184            options: {
185                responsive: true,
186                steppedLine: false,
187                fontColor: '#fff',
188                legend: {
189                    display: false,
190                },
191                title: {
192                    display: false,
193                },
194                scales: {
195                    xAxes: [{
196                        fontColor: '#fff',
197                        barPercentage: 0.8,
198                        gridLines: {
199                            display: false
200                        },
201                        ticks: {
202                            fontColor: '#fff',
203                            fontSize: 14,
204                            fontStyle: 'bold'
205                        }
206                    }],
207                    yAxes: [{
208                        display: true,
209                        gridLines: {
210                            color: 'rgba(255,255,255,0.12)',
211                            zeroLineColor: 'rgba(255,255,255,0.2)'
212                        },
213                        ticks: {
214                            fontColor: '#fff',
215                            beginAtZero: true,
216                            steps: 2000,
217                            stepValue: 5,
218                            max: 6000,
219                        },
220                    }]
221                },
222            }
223        });
224
225    };
226
227
228})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.