corrade-nucleus-nucleons

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 1  →  ?path2? @ 19
/base/000_base/bower_components/highcharts/js/modules/map.src.js
@@ -1,5 +1,5 @@
/**
* @license Highmaps JS v5.0.10 (2017-03-31)
* @license Highmaps JS v5.0.12 (2017-05-24)
* Highmaps as a plugin for Highcharts 4.1.x or Highstock 2.1.x (x being the patch version of this file)
*
* (c) 2011-2017 Torstein Honsi
@@ -222,7 +222,7 @@
if (userOptions.dataClasses) {
this.initDataClasses(userOptions);
}
this.initStops(userOptions);
this.initStops();
 
// Override original axis properties
this.horiz = horiz;
@@ -232,39 +232,8 @@
this.defaultLegendLength = 200;
},
 
/*
* Return an intermediate color between two colors, according to pos where 0
* is the from color and 1 is the to color.
* NOTE: Changes here should be copied
* to the same function in drilldown.src.js and solid-gauge-src.js.
*/
tweenColors: function(from, to, pos) {
// Check for has alpha, because rgba colors perform worse due to lack of
// support in WebKit.
var hasAlpha,
ret;
 
// Unsupported color, return to-color (#3920)
if (!to.rgba.length || !from.rgba.length) {
ret = to.input || 'none';
 
// Interpolate
} else {
from = from.rgba;
to = to.rgba;
hasAlpha = (to[3] !== 1 || from[3] !== 1);
ret = (hasAlpha ? 'rgba(' : 'rgb(') +
Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' +
Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' +
Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) +
(hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')';
}
return ret;
},
 
initDataClasses: function(userOptions) {
var axis = this,
chart = this.chart,
var chart = this.chart,
dataClasses,
colorCounter = 0,
colorCount = chart.options.chart.colorCount,
@@ -289,8 +258,7 @@
colorCounter = 0;
}
} else {
dataClass.color = axis.tweenColors(
color(options.minColor),
dataClass.color = color(options.minColor).tweenTo(
color(options.maxColor),
len < 2 ? 0.5 : i / (len - 1) // #3219
);
@@ -299,8 +267,8 @@
});
},
 
initStops: function(userOptions) {
this.stops = userOptions.stops || [
initStops: function() {
this.stops = this.options.stops || [
[0, this.options.minColor],
[1, this.options.maxColor]
];
@@ -344,6 +312,13 @@
}
},
 
normalizedValue: function(value) {
if (this.isLog) {
value = this.val2lin(value);
}
return 1 - ((this.max - value) / ((this.max - this.min) || 1));
},
 
/**
* Translate from a value to a color
*/
@@ -375,10 +350,7 @@
 
} else {
 
if (this.isLog) {
value = this.val2lin(value);
}
pos = 1 - ((this.max - value) / ((this.max - this.min) || 1));
pos = this.normalizedValue(value);
i = stops.length;
while (i--) {
if (pos > stops[i][0]) {
@@ -391,8 +363,7 @@
// The position within the gradient
pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1);
 
color = this.tweenColors(
from.color,
color = from.color.tweenTo(
to.color,
pos
);
@@ -434,7 +405,6 @@
setLegendColor: function() {
var grad,
horiz = this.horiz,
options = this.options,
reversed = this.reversed,
one = reversed ? 1 : 0,
zero = reversed ? 0 : 1;
@@ -447,10 +417,7 @@
x2: grad[2],
y2: grad[3]
},
stops: options.stops || [
[0, options.minColor],
[1, options.maxColor]
]
stops: this.stops
};
},
 
@@ -548,7 +515,7 @@
// When updating data classes, destroy old items and make sure new ones are created (#3207)
if (newOptions.dataClasses && legend.allItems) {
each(legend.allItems, function(item) {
if (item.isDataClass) {
if (item.isDataClass && item.legendGroup) {
item.legendGroup.destroy();
}
});
@@ -567,6 +534,16 @@
},
 
/**
* Extend basic axis remove by also removing the legend item.
*/
remove: function() {
if (this.legendItem) {
this.chart.legend.destroyItem(this);
}
Axis.prototype.remove.call(this);
},
 
/**
* Get the legend item symbols for data classes
*/
getDataClassLegendSymbols: function() {
@@ -636,8 +613,7 @@
H.Fx.prototype[prop + 'Setter'] = function() {
this.elem.attr(
prop,
ColorAxis.prototype.tweenColors(
color(this.start),
color(this.start).tweenTo(
color(this.end),
this.pos
),
@@ -826,7 +802,6 @@
* The MapNavigation handles buttons for navigation in addition to mousewheel
* and doubleclick handlers for chart zooming.
* @param {Chart} chart The Chart instance.
* @class
*/
function MapNavigation(chart) {
this.init(chart);
@@ -849,9 +824,6 @@
MapNavigation.prototype.update = function(options) {
var chart = this.chart,
o = chart.options.mapNavigation,
buttons,
n,
button,
buttonOptions,
attr,
states,
@@ -877,49 +849,46 @@
 
if (pick(o.enableButtons, o.enabled) && !chart.renderer.forExport) {
 
buttons = o.buttons;
for (n in buttons) {
H.objectEach(o.buttons, function(button, n) {
buttonOptions = merge(o.buttonOptions, button);
 
if (buttons.hasOwnProperty(n)) {
buttonOptions = merge(o.buttonOptions, buttons[n]);
 
 
button = chart.renderer.button(
buttonOptions.text,
0,
0,
outerHandler,
attr,
hoverStates,
selectStates,
0,
n === 'zoomIn' ? 'topbutton' : 'bottombutton'
)
.addClass('highcharts-map-navigation')
.attr({
width: buttonOptions.width,
height: buttonOptions.height,
title: chart.options.lang[n],
padding: buttonOptions.padding,
zIndex: 5
})
.add();
button.handler = buttonOptions.onclick;
button.align(
extend(buttonOptions, {
width: button.width,
height: 2 * button.height
}),
null,
buttonOptions.alignTo
);
// Stop double click event (#4444)
addEvent(button.element, 'dblclick', stopEvent);
 
button = chart.renderer.button(
buttonOptions.text,
0,
0,
outerHandler,
attr,
hoverStates,
selectStates,
0,
n === 'zoomIn' ? 'topbutton' : 'bottombutton'
)
.addClass('highcharts-map-navigation')
.attr({
width: buttonOptions.width,
height: buttonOptions.height,
title: chart.options.lang[n],
padding: buttonOptions.padding,
zIndex: 5
})
.add();
button.handler = buttonOptions.onclick;
button.align(
extend(buttonOptions, {
width: button.width,
height: 2 * button.height
}),
null,
buttonOptions.alignTo
);
// Stop double click event (#4444)
addEvent(button.element, 'dblclick', stopEvent);
mapNavButtons.push(button);
 
mapNavButtons.push(button);
}
}
});
}
 
this.updateEvents(o);
@@ -971,7 +940,7 @@
};
 
// Add events to the Chart object itself
extend(Chart.prototype, {
extend(Chart.prototype, /** @lends Chart.prototype */ {
 
/**
* Fit an inner box to an outer. If the inner box overflows left or right, align it to the sides of the
@@ -1007,7 +976,24 @@
},
 
/**
* Zoom the map in or out by a certain amount. Less than 1 zooms in, greater than 1 zooms out.
* Highmaps only. Zoom in or out of the map. See also {@link Point#zoomTo}.
* See {@link Chart#fromLatLonToPoint} for how to get the `centerX` and
* `centerY` parameters for a geographic location.
*
* @param {Number} [howMuch]
* How much to zoom the map. Values less than 1 zooms in. 0.5 zooms
* in to half the current view. 2 zooms to twice the current view.
* If omitted, the zoom is reset.
* @param {Number} [centerX]
* The X axis position to center around if available space.
* @param {Number} [centerY]
* The Y axis position to center around if available space.
* @param {Number} [mouseX]
* Fix the zoom to this position if possible. This is used for
* example in mousewheel events, where the area under the mouse
* should be fixed as we zoom in.
* @param {Number} [mouseY]
* Fix the zoom to this position if possible.
*/
mapZoom: function(howMuch, centerXArg, centerYArg, mouseX, mouseY) {
/*if (this.isMapZooming) {
@@ -1199,7 +1185,6 @@
* License: www.highcharts.com/license
*/
var color = H.color,
ColorAxis = H.ColorAxis,
colorPointMixin = H.colorPointMixin,
colorSeriesMixin = H.colorSeriesMixin,
doc = H.doc,
@@ -1433,7 +1418,6 @@
dataUsed = [],
mapMap = {},
mapPoint,
transform,
mapTransforms = this.chart.mapTransforms,
props,
i;
@@ -1487,12 +1471,12 @@
 
// Cache cos/sin of transform rotation angle
if (mapTransforms) {
for (transform in mapTransforms) {
if (mapTransforms.hasOwnProperty(transform) && transform.rotation) {
H.objectEach(mapTransforms, function(transform) {
if (transform.rotation) {
transform.cosAngle = Math.cos(transform.rotation);
transform.sinAngle = Math.sin(transform.rotation);
}
}
});
}
 
if (mapData) {
@@ -1965,7 +1949,7 @@
*/
onMouseOver: function(e) {
clearTimeout(this.colorInterval);
if (this.value !== null) {
if (this.value !== null || this.series.options.nullInteraction) {
Point.prototype.onMouseOver.call(this, e);
} else { //#3401 Tooltip doesn't hide when hovering over null points
this.series.onMouseOut(e);
@@ -1974,7 +1958,12 @@
 
 
/**
* Zoom the chart to view a specific area point
* Highmaps only. Zoom in on the point using the global animation.
*
* @function #zoomTo
* @memberOf Point
* @sample maps/members/point-zoomto/
* Zoom to points from butons
*/
zoomTo: function() {
var point = this,
@@ -2121,7 +2110,8 @@
}, {
pointArrayMap: ['y', 'z'],
parallelArrays: ['x', 'y', 'z'],
trackerGroups: ['markerGroup', 'dataLabelsGroup'],
trackerGroups: ['group', 'dataLabelsGroup'],
specialGroup: 'group', // To allow clipping (#6296)
bubblePadding: true,
zoneAxis: 'z',
directTouch: true,
@@ -2596,7 +2586,27 @@
}
 
/**
* Get point from latLon using specified transform definition
* Highmaps only. Get point from latitude and longitude using specified
* transform definition.
*
* @function transformFromLatLon
* @memberOf Chart.prototype
*
* @param {Object} latLon
* A latitude/longitude object.
* @param {Number} latLon.lat
* The latitude.
* @param {Number} latLon.lon
* The longitude.
* @param {Object} transform
* The transform definition to use as explained in the {@link
* https://www.highcharts.com/docs/maps/latlon|documentation}.
*
* @return {Object}
* An object with `x` and `y` properties.
*
* @sample maps/series/latlon-transform/
* Use specific transformation for lat/lon
*/
Chart.prototype.transformFromLatLon = function(latLon, transform) {
if (win.proj4 === undefined) {
@@ -2619,7 +2629,25 @@
};
 
/**
* Get latLon from point using specified transform definition
* Highmaps only. Get latLon from point using specified transform definition.
* The method returns an object with the numeric properties `lat` and `lon`.
*
* @function transformToLatLon
* @memberOf Chart.prototype
*
* @param {Point|Object} point
* A `Point` instance, or or any object containing the properties `x`
* and `y` with numeric values.
* @param {Object} transform
* The transform definition to use as explained in the {@link
* https://www.highcharts.com/docs/maps/latlon|documentation}.
*
* @return {Object}
* An object with `lat` and `lon` properties.
*
* @sample maps/series/latlon-transform/
* Use specific transformation for lat/lon
*
*/
Chart.prototype.transformToLatLon = function(point, transform) {
if (win.proj4 === undefined) {
@@ -2645,6 +2673,22 @@
};
};
 
/**
* Highmaps only. Calculate latitude/longitude values for a point. Returns an
* object with the numeric properties `lat` and `lon`.
*
* @function fromPointToLatLon
* @memberOf Chart.prototype
*
* @param {Point|Object} point
* A `Point` instance or anything containing `x` and `y` properties
* with numeric values
* @return {Object}
* An object with `lat` and `lon` properties.
*
* @sample maps/demo/latlon-advanced/
* Advanced lat/lon demo
*/
Chart.prototype.fromPointToLatLon = function(point) {
var transforms = this.mapTransforms,
transform;
@@ -2667,6 +2711,26 @@
return this.transformToLatLon(point, transforms['default']); // eslint-disable-line dot-notation
};
 
/**
* Highmaps only. Get chart coordinates from latitude/longitude. Returns an
* object with x and y values corresponding to the `xAxis` and `yAxis`.
*
* @function fromLatLonToPoint
* @memberOf Chart.prototype
*
* @param {Object} latLon
* Coordinates.
* @param {Number} latLon.lat
* The latitude.
* @param {Number} latLon.lon
* The longitude.
*
* @sample maps/series/latlon-to-point/
* Find a point from lat/lon
*
* @return {Object}
* X and Y coordinates in terms of chart axis values.
*/
Chart.prototype.fromLatLonToPoint = function(latLon) {
var transforms = this.mapTransforms,
transform,
@@ -2696,7 +2760,34 @@
};
 
/**
* Convert a geojson object to map data of a given Highcharts type (map, mappoint or mapline).
* Highmaps only. Restructure a GeoJSON object in preparation to be read
* directly by the {@link
* https://api.highcharts.com/highmaps/plotOptions.series.mapData|
* series.mapData} option. The GeoJSON will be broken down to fit a specific
* Highcharts type, either `map`, `mapline` or `mappoint`. Meta data in
* GeoJSON's properties object will be copied directly over to
* {@link Point.properties} in Highmaps.
*
* @function #geojson
* @memberOf Highcharts
*
* @param {Object} geojson
* The GeoJSON structure to parse, represented as a JavaScript object
* rather than a JSON string.
* @param {String} [hType=map]
* The Highmaps series type to prepare for. Setting "map" will return
* GeoJSON polygons and multipolygons. Setting "mapline" will return
* GeoJSON linestrings and multilinestrings. Setting "mappoint" will
* return GeoJSON points and multipoints.
*
* @return {Object}
* An object ready for the `mapData` option.
*
* @sample samples/maps/demo/geojson/
* Simple areas
* @sample maps/demo/geojson-multiple-types/
* Multiple types
*
*/
H.geojson = function(geojson, hType, series) {
var mapData = [],
@@ -2767,6 +2858,15 @@
if (point) {
mapData.push(extend(point, {
name: properties.name || properties.NAME,
 
/**
* In Highmaps, when data is loaded from GeoJSON, the GeoJSON
* item's properies are copied over here.
*
* @name #properties
* @memberOf Point
* @type {Object}
*/
properties: properties
}));
}
@@ -2948,7 +3048,29 @@
 
 
/**
* A wrapper for Chart with all the default values for a Map
* The factory function for creating new map charts. Creates a new {@link
* Chart|Chart} object with different default options than the basic Chart.
*
* @function #mapChart
* @memberOf Highcharts
*
* @param {String|HTMLDOMElement} renderTo
* The DOM element to render to, or its id.
* @param {Options} options
* The chart options structure as described in the {@link
* https://api.highcharts.com/highstock|options reference}.
* @param {Function} callback
* A function to execute when the chart object is finished loading and
* rendering. In most cases the chart is built in one thread, but in
* Internet Explorer version 8 or less the chart is sometimes initiated
* before the document is ready, and in these cases the chart object
* will not be finished synchronously. As a consequence, code that
* relies on the newly built Chart object should always run in the
* callback. Defining a {@link https://api.highcharts.com/highstock/chart.events.load|
* chart.event.load} handler is equivalent.
*
* @return {Chart}
* The chart object.
*/
H.Map = H.mapChart = function(a, b, c) {