/
home
/
techb158
/
workloadmatch.com
/
bower_components
/
jvectormap
/
src
/
/home/techb158/workloadmatch.com/bower_components/jvectormap/src
mkdir
upload
Name
Size
Mode
Actions
abstract-canvas-element.js
2908
0777
edit
dl
rm
abstract-element.js
1652
0777
edit
dl
rm
abstract-shape-element.js
1833
0777
edit
dl
rm
color-scale.js
1028
0777
edit
dl
rm
data-series.js
5255
0777
edit
dl
rm
jvectormap.js
4233
0777
edit
dl
rm
legend.js
2670
0777
edit
dl
rm
map-object.js
1999
0777
edit
dl
rm
map.js
40591
0777
edit
dl
rm
marker.js
2066
0777
edit
dl
rm
multimap.js
4435
0777
edit
dl
rm
numeric-scale.js
4258
0777
edit
dl
rm
ordinal-scale.js
352
0777
edit
dl
rm
proj.js
6568
0777
edit
dl
rm
region.js
1248
0777
edit
dl
rm
simple-scale.js
133
0777
edit
dl
rm
svg-canvas-element.js
877
0777
edit
dl
rm
svg-circle-element.js
180
0777
edit
dl
rm
svg-element.js
1226
0777
edit
dl
rm
svg-group-element.js
238
0777
edit
dl
rm
svg-image-element.js
1100
0777
edit
dl
rm
svg-path-element.js
221
0777
edit
dl
rm
svg-shape-element.js
1877
0777
edit
dl
rm
svg-text-element.js
393
0777
edit
dl
rm
vector-canvas.js
504
0777
edit
dl
rm
vml-canvas-element.js
1540
0777
edit
dl
rm
vml-circle-element.js
820
0777
edit
dl
rm
vml-element.js
2912
0777
edit
dl
rm
vml-group-element.js
340
0777
edit
dl
rm
vml-image-element.js
1449
0777
edit
dl
rm
vml-path-element.js
2947
0777
edit
dl
rm
vml-shape-element.js
1449
0777
edit
dl
rm
Edit:
/home/techb158/workloadmatch.com/bower_components/jvectormap/src/data-series.js
(5255B)
/** * Creates data series. * @constructor * @param {Object} params Parameters to initialize series with. * @param {Array} params.values The data set to visualize. * @param {String} params.attribute Numberic or color attribute to use for data visualization. This could be: <code>fill</code>, <code>stroke</code>, <code>fill-opacity</code>, <code>stroke-opacity</code> for markers and regions and <code>r</code> (radius) for markers only. * @param {Array} params.scale Values used to map a dimension of data to a visual representation. The first value sets visualization for minimum value from the data set and the last value sets visualization for the maximum value. There also could be intermidiate values. Default value is <code>['#C8EEFF', '#0071A4']</code> * @param {Function|String} params.normalizeFunction The function used to map input values to the provided scale. This parameter could be provided as function or one of the strings: <code>'linear'</code> or <code>'polynomial'</code>, while <code>'linear'</code> is used by default. The function provided takes value from the data set as an input and returns corresponding value from the scale. * @param {Number} params.min Minimum value of the data set. Could be calculated automatically if not provided. * @param {Number} params.min Maximum value of the data set. Could be calculated automatically if not provided. */ jvm.DataSeries = function(params, elements, map) { var scaleConstructor; params = params || {}; params.attribute = params.attribute || 'fill'; this.elements = elements; this.params = params; this.map = map; if (params.attributes) { this.setAttributes(params.attributes); } if (jvm.$.isArray(params.scale)) { scaleConstructor = (params.attribute === 'fill' || params.attribute === 'stroke') ? jvm.ColorScale : jvm.NumericScale; this.scale = new scaleConstructor(params.scale, params.normalizeFunction, params.min, params.max); } else if (params.scale) { this.scale = new jvm.OrdinalScale(params.scale); } else { this.scale = new jvm.SimpleScale(params.scale); } this.values = params.values || {}; this.setValues(this.values); if (this.params.legend) { this.legend = new jvm.Legend($.extend({ map: this.map, series: this }, this.params.legend)) } }; jvm.DataSeries.prototype = { setAttributes: function(key, attr){ var attrs = key, code; if (typeof key == 'string') { if (this.elements[key]) { this.elements[key].setStyle(this.params.attribute, attr); } } else { for (code in attrs) { if (this.elements[code]) { this.elements[code].element.setStyle(this.params.attribute, attrs[code]); } } } }, /** * Set values for the data set. * @param {Object} values Object which maps codes of regions or markers to values. */ setValues: function(values) { var max = -Number.MAX_VALUE, min = Number.MAX_VALUE, val, cc, attrs = {}; if (!(this.scale instanceof jvm.OrdinalScale) && !(this.scale instanceof jvm.SimpleScale)) { // we have a color scale as an array if (typeof this.params.min === 'undefined' || typeof this.params.max === 'undefined') { // min and/or max are not defined, so calculate them for (cc in values) { val = parseFloat(values[cc]); if (val > max) max = val; if (val < min) min = val; } } if (typeof this.params.min === 'undefined') { this.scale.setMin(min); this.params.min = min; } else { this.scale.setMin(this.params.min); } if (typeof this.params.max === 'undefined') { this.scale.setMax(max); this.params.max = max; } else { this.scale.setMax(this.params.max); } for (cc in values) { if (cc != 'indexOf') { val = parseFloat(values[cc]); if (!isNaN(val)) { attrs[cc] = this.scale.getValue(val); } else { attrs[cc] = this.elements[cc].element.style.initial[this.params.attribute]; } } } } else { for (cc in values) { if (values[cc]) { attrs[cc] = this.scale.getValue(values[cc]); } else { attrs[cc] = this.elements[cc].element.style.initial[this.params.attribute]; } } } this.setAttributes(attrs); jvm.$.extend(this.values, values); }, clear: function(){ var key, attrs = {}; for (key in this.values) { if (this.elements[key]) { attrs[key] = this.elements[key].element.shape.style.initial[this.params.attribute]; } } this.setAttributes(attrs); this.values = {}; }, /** * Set scale of the data series. * @param {Array} scale Values representing scale. */ setScale: function(scale) { this.scale.setScale(scale); if (this.values) { this.setValues(this.values); } }, /** * Set normalize function of the data series. * @param {Function|String} normilizeFunction. */ setNormalizeFunction: function(f) { this.scale.setNormalizeFunction(f); if (this.values) { this.setValues(this.values); } } };
Save
cmd:
run