PageSourceSearch

https://fxboss.firstcitizens.com/app/assets/moris-angular/angular-morris-chart.js?v=9.0.2

js firstcitizens.com collected 2026-09-24 21:51:02 UTC 14,635 bytes, 303 lines download raw bytes

1/**
2 * angular morris chart provides morris.js wrappers directives for angular
3 * check out documentation in http://angular-morris-chart.stpa.co
4 *
5 * Copyright © 2014 Stewan Pacheco <[email protected]>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the “Software”), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 */
25"use strict";
26(function() {
27    angular.module('angular.morris-chart', []);
28})();
29/**
30 * angular morris chart provides morris.js wrappers directives for angular
31 * check out documentation in http://angular-morris-chart.stpa.co
32 *
33 * Copyright © 2014 Stewan Pacheco <[email protected]>
34 *
35 * Permission is hereby granted, free of charge, to any person obtaining a copy
36 * of this software and associated documentation files (the “Software”), to deal
37 * in the Software without restriction, including without limitation the rights
38 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
39 * copies of the Software, and to permit persons to whom the Software is
40 * furnished to do so, subject to the following conditions:
41 *
42 * The above copyright notice and this permission notice shall be included in all
43 * copies or substantial portions of the Software.
44 *
45 * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
48 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
49 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
50 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
51 * SOFTWARE.
52 */
53"use strict";
54/* global Morris */
55(function() {
56    angular.module("angular.morris-chart").directive('areaChart',
57        function() {
58            return {
59                restrict: 'A',
60                scope: {
61                    areaData: '=',
62                    areaXkey: '@',
63                    areaYkeys: '=',
64                    areaLabels: '=',
65                    lineColors: '='
66                },
67                link: function(scope, elem) {
68                    scope.$watch('areaData', function() {
69                        if (scope.areaData) {
70                            if (typeof scope.areaData === 'string')
71                                scope.areaData = JSON.parse(scope.areaData);
72                            if (typeof scope.areaYkeys === 'string')
73                                scope.areaYkeys = JSON.parse(scope.areaYkeys);
74                            if (typeof scope.areaLabels === 'string')
75                                scope.areaLabels = JSON.parse(scope.areaLabels);
76                            if (typeof scope.lineColors === 'string')
77                                scope.lineColors = JSON.parse(scope.lineColors);
78
79                            if (!scope.areaInstance) {
80                                scope.areaInstance = new Morris.Area({
81                                    element: elem,
82                                    data: scope.areaData,
83                                    xkey: scope.areaXkey,
84                                    ykeys: scope.areaYkeys,
85                                    labels: scope.areaLabels,
86                                    lineColors: scope.lineColors || ['#0b62a4', '#7a92a3', '#4da74d', '#afd8f8', '#edc240', '#cb4b4b', '#9440ed']
87                                });
88                            } else {
89                                scope.areaInstance.setData(scope.areaData);
90                            }
91                        }
92                    });
93                }
94            }
95        });
96})();
97/**
98 * angular morris chart provides morris.js wrappers directives for angular
99 * check out documentation in http://angular-morris-chart.stpa.co
100 *
101 * Copyright © 2014 Stewan Pacheco <[email protected]>
102 *
103 * Permission is hereby granted, free of charge, to any person obtaining a copy
104 * of this software and associated documentation files (the “Software”), to deal
105 * in the Software without restriction, including without limitation the rights
106 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
107 * copies of the Software, and to permit persons to whom the Software is
108 * furnished to do so, subject to the following conditions:
109 *
110 * The above copyright notice and this permission notice shall be included in all
111 * copies or substantial portions of the Software.
112 *
113 * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
114 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
115 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
116 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
117 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
118 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
119 * SOFTWARE.
120 */
121"use strict";
122/* global Morris */
123(function() {
124    angular.module("angular.morris-chart").directive('barChart', function() {
125        return {
126            restrict: 'A',
127            scope: {
128                barX: '@',
129                barY: '=',
130                barLabels: '=',
131                barData: '=',
132                barColors: '='
133            },
134            link: function(scope, elem) {
135                scope.$watch('barData', function() {
136                    if (scope.barData) {
137                        if (typeof scope.barY === 'string')
138                            scope.barY = JSON.parse(scope.barY);
139                        if (typeof scope.barLabels === 'string')
140                            scope.barLabels = JSON.parse(scope.barLabels);
141                        if (typeof scope.barData === 'string')
142                            scope.barData = JSON.parse(scope.barData);
143                        if (typeof scope.barColors === 'string')
144                            scope.barColors = JSON.parse(scope.barColors);
145                        if (!scope.barInstance) {
146                            scope.barInstance = new Morris.Bar({
147                                element: elem,
148                                data: scope.barData,
149                                xkey: scope.barX,
150                                ykeys: scope.barY,
151                                labels: scope.barLabels,
152                                barColors: scope.barColors || ['#0b62a4', '#7a92a3', '#4da74d', '#afd8f8', '#edc240', '#cb4b4b', '#9440ed'],
153                                xLabelMargin: 2
154                            });
155                        } else {
156                            scope.barInstance.setData(scope.barData);
157                        }
158                    }
159                })
160            }
161        }
162    })
163})();
164/**
165 * angular morris chart provides morris.js wrappers directives for angular
166 * check out documentation in http://angular-morris-chart.stpa.co
167 *
168 * Copyright © 2014 Stewan Pacheco <[email protected]>
169 *
170 * Permission is hereby granted, free of charge, to any person obtaining a copy
171 * of this software and associated documentation files (the “Software”), to deal
172 * in the Software without restriction, including without limitation the rights
173 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
174 * copies of the Software, and to permit persons to whom the Software is
175 * furnished to do so, subject to the following conditions:
176 *
177 * The above copyright notice and this permission notice shall be included in all
178 * copies or substantial portions of the Software.
179 *
180 * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
181 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
182 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
183 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
184 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
185 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
186 * SOFTWARE.
187 */
188"use strict";
189/* global Morris */
190(function() {
191    angular.module("angular.morris-chart").directive('donutChart', ['$injector', function($injector) {
192        return {
193            restrict: 'A',
194            scope: {
195                donutData: '=',
196                donutColors: '=',
197                donutFormatter: '='
198            },
199            link: function(scope, elem) {
200                scope.$watch('donutData', function() {
201                    if (scope.donutData) {
202                        if (typeof scope.donutData === 'string')
203                            scope.donutData = JSON.parse(scope.donutData);
204
205                        if (typeof scope.donutColors === 'string')
206                            scope.donutColors = JSON.parse(scope.donutColors);
207
208                        if (!scope.donutInstance) {
209                            var options = {
210                                element: elem,
211                                data: scope.donutData,
212                                colors: scope.donutColors || ['#0b62a4', '#7a92a3', '#4da74d', '#afd8f8', '#edc240', '#cb4b4b', '#9440ed']
213                            }
214                            // Check if a formatter function has been set
215                            if (typeof scope.donutFormatter === 'function') {
216                              options.formatter = scope.donutFormatter;
217                            } else if (typeof scope.donutFormatter === 'string' && $injector.has(scope.donutFormatter + 'Filter')) {
218                              // If the formatter is a string, check for a matching filter
219                              var filter = $injector.get(scope.donutFormatter + 'Filter')
220                              options.formatter = function (input) {
221                                return filter.call(this, input);
222                              };
223                            }
224                            scope.donutInstance = new Morris.Donut(options);
225                        } else {
226                            scope.donutInstance.setData(scope.donutData);
227                        }
228                    }
229                })
230            }
231        }
232    }])
233})();
234/**
235 * angular morris chart provides morris.js wrappers directives for angular
236 * check out documentation in http://angular-morris-chart.stpa.co
237 *
238 * Copyright © 2014 Stewan Pacheco <[email protected]>
239 *
240 * Permission is hereby granted, free of charge, to any person obtaining a copy
241 * of this software and associated documentation files (the “Software”), to deal
242 * in the Software without restriction, including without limitation the rights
243 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
244 * copies of the Software, and to permit persons to whom the Software is
245 * furnished to do so, subject to the following conditions:
246 *
247 * The above copyright notice and this permission notice shall be included in all
248 * copies or substantial portions of the Software.
249 *
250 * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
251 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
252 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
253 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
254 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
255 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
256 * SOFTWARE.
257 */
258"use strict";
259/* global Morris */
260(function() {
261    angular.module("angular.morris-chart").directive('lineChart',
262        function() {
263            return {
264                restrict: 'A',
265                scope: {
266                    lineData: '=',
267                    lineXkey: '@',
268                    lineYkeys: '=',
269                    lineLabels: '=',
270                    lineColors: '='
271                },
272                link: function(scope, elem) {
273                    scope.$watch('lineData', function() {
274                        if (scope.lineData) {
275                            if (typeof scope.lineData === 'string')
276                                scope.lineData = JSON.parse(scope.lineData);
277                            if (typeof scope.lineYkeys === 'string')
278                                scope.lineYkeys = JSON.parse(scope.lineYkeys);
279                            if (typeof scope.lineYkeys === 'string')
280                                scope.lineYkeys = JSON.parse(scope.lineYkeys);
281                            if (typeof scope.lineLabels === 'string')
282                                scope.lineLabels = JSON.parse(scope.lineLabels);
283                            if (typeof scope.lineColors === 'string')
284                                scope.lineColors = JSON.parse(scope.lineColors);
285                            if (!scope.lineInstance) {
286                                scope.lineInstance = new Morris.Line({
287                                    element: elem,
288                                    data: scope.lineData,
289                                    xkey: scope.lineXkey,
290                                    ykeys: scope.lineYkeys,
291                                    labels: scope.lineLabels,
292                                    lineColors: scope.lineColors || ['#0b62a4', '#7a92a3', '#4da74d', '#afd8f8', '#edc240', '#cb4b4b', '#9440ed']
293                                });
294                            } else {
295                                scope.lineInstance.setData(scope.lineData);
296                            }
297                        }
298                    });
299                }
300            }
301        }
302    )
303})();

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.