-
-
- You can't perform that action at this time.
-
-
-
-
-
-
-
-
-
-
-
-
- You signed in with another tab or window. Reload to refresh your session.
- You signed out in another tab or window. Reload to refresh your session.
-
A simple, responsive template for building web mapping applications with Bootstrap 3, Leaflet, and typeahead.js. Open
- source, MIT licensed, and available on GitHub.
-
-
-
Features
-
-
Fullscreen mobile-friendly map template with responsive
- navbar and modal placeholders
-
The data provided on this site is for informational and planning purposes only.
-
-
Absolutely no accuracy or completeness guarantee is implied or intended. All information on
- this map is subject to such variations and corrections as might result from a complete title
- search and/or accurate field survey.
{s} means one of the available subdomains (used
- sequentially to help with browser parallel requests per domain limitation; subdomain
- values are specified in options; a, b or c by default, can
- be omitted), {z} — zoom level, {x}
- and {y} — tile coordinates.
-
-
You can use custom keys in the template, which will be evaluated from TileLayer options, like this:
- The OpenGIS® Web Map Service Interface Standard (WMS) provides a simple HTTP interface for
- requesting geo-registered map images from one or more distributed geospatial databases.
- A WMS request defines the geographic layer(s) and area of interest to be processed.
- The response to the request is one or more geo-registered map images (returned as JPEG, PNG,
- etc) that can be displayed in a browser application.
- The interface also supports the ability to specify whether the returned images should be
- transparent so that layers from multiple servers can be combined or not.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- V.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Edit GeoJson object of the selected area
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
ID
-
-
-
Information
-
-
-
Speed km/h
-
Heading
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
ID
-
-
-
Information
-
-
-
-
-
-
-
-
ID
-
-
Severity
-
-
-
-
-
Information
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ]]>
-
-
diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/app.js b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/app.js
deleted file mode 100644
index 5b3e76834..000000000
--- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/app.js
+++ /dev/null
@@ -1,495 +0,0 @@
-/*
- * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * WSO2 Inc. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-$(".modal").draggable({
- handle: ".modal-header"
-});
-
-//Clear modal content for reuse the wrapper by other functions
-$('body').on('hidden.bs.modal', '.modal', function () {
- $(this).removeData('bs.modal');
-});
-
-/*Map layer configurations*/
-var map;
-
-function initialLoad() {
- if (document.getElementById('map') == null) {
- setTimeout(initialLoad, 500); // give everything some time to render
- } else {
- initializeMap();
- getTileServers();
- loadWms();
- processAfterInitializationMap();
- //Access gps and make zoom to server location as map center
- //navigator.geolocation.getCurrentPosition(success, error);
- setPageTitle();
- $("#loading").hide();
- }
-}
-
-function setPageTitle() {
- var hash = window.parent.location.hash;
- if(hash) {
- var startIdx = hash.indexOf("/") + 1;
- var lastIdx = hash.length;
- var deviceInfoString = hash.substring(startIdx,lastIdx);
- var deviceInfo = JSON.parse(deviceInfoString);
- if(deviceInfo) {
- var newTitle = "[ " + deviceInfo.device.id + "]" + " - Geo Dashboard [" + deviceInfo.device.type + "]";
- window.parent.document.title = newTitle;
- $("#title").val(newTitle)
- }
- }
-}
-
-//function success(position) {
-// var browserLatitude = position.coords.latitude;
-// var browserLongitude = position.coords.longitude;
-// map.setView([browserLatitude, browserLongitude]);
-// map.setZoom(14);
-// $.UIkit.notify({
-// message: "Map view set to browser's location",
-// status: 'info',
-// timeout: ApplicationOptions.constance.NOTIFY_INFO_TIMEOUT,
-// pos: 'top-center'
-// });
-//}
-//
-//function error() {
-// $.UIkit.notify({
-// message: "Unable to find browser location!",
-// status: 'warning',
-// timeout: ApplicationOptions.constance.NOTIFY_WARNING_TIMEOUT,
-// pos: 'top-center'
-// });
-//}
-
-
-function initializeMap() {
- if (typeof(map) !== 'undefined') {
- map.remove();
- }
-
-
- if (document.getElementById('map') == null) {
- console.log("no map");
- } else {
- }
-
- map = L.map("map", {
- zoom: 14,
- center: [6.927078, 79.861243],
- layers: [defaultOSM, defaultTFL],
- zoomControl: true,
- attributionControl: false,
- maxZoom: 20,
- maxNativeZoom: 18
- });
- map.zoomControl.setPosition('bottomleft');
- map.on('click', function (e) {
- $.UIkit.offcanvas.hide();//[force = false] no animation
- });
-
- map.on('zoomend', function () {
- if (map.getZoom() < 14) {
- // remove busStops
- var layer;
- for (var key in currentSpatialObjects) {
- if (currentSpatialObjects.hasOwnProperty(key)) {
- object = currentSpatialObjects[key];
- if (object.type == "STOP")
- map.removeLayer(object.geoJson);
- }
- }
- console.log("removed busStops from map");
- } else {
-
- var layer;
- for (var key in currentSpatialObjects) {
- if (currentSpatialObjects.hasOwnProperty(key)) {
- object = currentSpatialObjects[key];
- if (object.type == "STOP")
- map.addLayer(object.geoJson);
- }
- }
- console.log("added busStops to map");
- }
-
- });
- //setting the sidebar to be opened when page loads
- $("a[href='#left_side_pannel']").trigger('click');
-}
-
-/* Attribution control */
-function updateAttribution(e) {
- $.each(map._layers, function (index, layer) {
- if (layer.getAttribution) {
- $("#attribution").html((layer.getAttribution()));
- }
- });
-}
-
-var attributionControl;
-var groupedOverlays;
-var layerControl;
-
-function processAfterInitializationMap() {
- attributionControl = L.control({
- position: "bottomright"
- });
- attributionControl.onAdd = function (map) {
- var div = L.DomUtil.create("div", "leaflet-control-attribution");
- div.innerHTML = "Attribution";
- return div;
- };
- //map.addControl(attributionControl);
-
- //L.control.fullscreen({
- // position: 'bottomright'
- //}).addTo(map);
- L.control.zoom({
- position: "bottomright"
- }).addTo(map);
-
- groupedOverlays = {
- "Web Map Service layers": {}
- };
-
- layerControl = L.control.groupedLayers(baseLayers, groupedOverlays, {
- collapsed: true
- }).addTo(map);
-
- //L.control.layers(baseLayers).addTo(map);
- //map.addLayer(defaultTFL);
-}
-
-/* Highlight search box text on click */
-$("#searchbox").click(function () {
- $(this).select();
-});
-
-/* TypeAhead search functionality */
-
-var substringMatcher = function () {
- return function findMatches(q, cb) {
- var matches, substrRegex;
- matches = [];
- substrRegex = new RegExp(q, 'i');
- $.each(currentSpatialObjects, function (i, str) {
- if (substrRegex.test(i)) {
- matches.push({value: i});
- }
- });
-
- cb(matches);
- };
-};
-
-var chart;
-function createChart() {
- chart = c3.generate({
- bindto: '#chart_div',
- data: {
- columns: [
- ['speed']
- ]
- },
- subchart: {
- show: true
- },
- axis: {
- y: {
- label: {
- text: 'Speed',
- position: 'outer-middle'
- }
- }
- },
- legend: {
- show: false
- }
- });
-}
-
-var predictionChart;
-function createPredictionChart() {
- predictionChart = c3.generate({
- bindto: '#prediction_chart_div',
- data: {
- x: 'x',
- columns: [
- ['traffic']
- ]
- },
- subchart: {
- show: true
- },
- axis: {
- y: {
- label: {
- text: 'Traffic',
- position: 'outer-middle'
- }
- },
- x: {
- label: {
- text: 'UTC hour for today',
- position: 'outer-middle'
- }
- }
-
- },
- legend: {
- show: false
- }
- });
-}
-
-$('#searchbox').typeahead({
- hint: true,
- highlight: true,
- minLength: 1
- },
- {
- name: 'speed',
- displayKey: 'value',
- source: substringMatcher()
- }).on('typeahead:selected', function ($e, datum) {
- objectId = datum['value'];
- focusOnSpatialObject(objectId)
-});
-
-var toggled = false;
-
-function focusOnSpatialObject(objectId) {
- console.log("Selecting" + objectId);
- var spatialObject = currentSpatialObjects[objectId];// (local)
- if (!spatialObject) {
- $.UIkit.notify({
- message: "Spatial Object " + objectId + " not in the Map!!",
- status: 'warning',
- timeout: ApplicationOptions.constance.NOTIFY_WARNING_TIMEOUT,
- pos: 'top-center'
- });
- return false;
- }
- clearFocus(); // Clear current focus if any
- selectedSpatialObject = objectId; // (global) Why not use 'var' other than implicit declaration http://stackoverflow.com/questions/1470488/what-is-the-function-of-the-var-keyword-and-when-to-use-it-or-omit-it#answer-1471738
-
- console.log("Selected " + objectId + " type " + spatialObject.type);
- if (spatialObject.type == "area") {
- spatialObject.focusOn(map);
- return true;
- }
-
- map.setView(spatialObject.marker.getLatLng(), 15, {animate: true}); // TODO: check the map._layersMaxZoom and set the zoom level accordingly
-
- $('#objectInfo').find('#objectInfoId').html(selectedSpatialObject);
- spatialObject.marker.openPopup();
- if (!toggled) {
- $('#objectInfo').animate({width: 'toggle'}, 100);
- toggled = true;
- }
- getAlertsHistory(objectId);
- spatialObject.drawPath();
- setTimeout(function () {
- createChart();
- chart.load({columns: [spatialObject.speedHistory.getArray()]});
- }, 100);
-}
-
-
-var getProviderData = function (timeFrom, timeTo) {
- var tableData;
- $.ajax({
- url: '/portal/store/carbon.super/fs/gadget/geo-dashboard/controllers/gadget-controller.jag?action=getData&id=' + deviceId + '&type=' + deviceType + '&timeFrom=' + timeFrom + '&timeTo=' + timeTo,
- method: "GET",
- contentType: "application/json",
- async: false,
- success: function (data) {
- tableData = data;
- }
- });
- return tableData;
-};
-
-function notifyError(message) {
- $.UIkit.notify({
- message: message,
- status: 'warning',
- timeout: ApplicationOptions.constance.NOTIFY_WARNING_TIMEOUT,
- pos: 'bottom-left'
- });
-}
-
-function enableRealTime() {
- document.getElementById('realTimeShow').style.display = 'none';
- spatialObject = currentSpatialObjects[selectedSpatialObject];
- if (spatialObject) {
- spatialObject.removePath();
- spatialObject.marker.closePopup();
- }
- selectedSpatialObject = null;
- clearFocus();
- clearMap();
- document.getElementById('objectInfo').style.display = 'none';
- isBatchModeOn = false;
-}
-
-function InitSpatialObject() {
- var fromDate = new Date();
- fromDate.setHours(fromDate.getHours() - 2);
- var toDate = new Date();
- console.log(fromDate + " " + toDate);
- var tableData = getProviderData(fromDate.valueOf(), toDate.valueOf());
- for (var i = 0; i < tableData.length; i++) {
- var data = tableData[i];
- var geoMessage = {
- "messageType": "Point",
- "type": "Feature",
- "id": data.id,
- "deviceId": data.id,
- "deviceType": data.type,
- "properties": {
- "speed": data.speed,
- "heading": data.heading,
- "state": data.state,
- "information": data.information,
- "notify": data.notify,
- "type": data.type
- },
- "geometry": {
- "type": "Point",
- "coordinates": [data.longitude, data.latitude]
- }
- };
- processPointMessage(geoMessage);
- }
- var spatialObject = currentSpatialObjects[deviceId];// (local)
- if (!spatialObject) {
- $.UIkit.notify({
- message: "Spatial Object " + deviceId + " not in the Map!!",
- status: 'warning',
- timeout: ApplicationOptions.constance.NOTIFY_WARNING_TIMEOUT,
- pos: 'top-center'
- });
- return false;
- }
- selectedSpatialObject = deviceId;
- if (spatialObject.type == "area") {
- spatialObject.focusOn(map);
- return true;
- }
-
- map.setView(spatialObject.marker.getLatLng(), 15, {animate: true}); // TODO: check the map._layersMaxZoom and set the zoom level accordingly
-
- $('#objectInfo').find('#objectInfoId').html(selectedSpatialObject);
- spatialObject.marker.openPopup();
- if (!toggled) {
- $('#objectInfo').animate({width: 'toggle'}, 100);
- toggled = true;
- }
- spatialObject.drawPath();
- setTimeout(function () {
- createChart();
- chart.load({columns: [spatialObject.speedHistory.getArray()]});
- }, 100);
-}
-
-function focusOnHistorySpatialObject(objectId, timeFrom, timeTo) {
- if (!timeFrom) {
- notifyError('No start time provided to show history. Please provide a suitable value' + timeFrom);
- } else if (!timeTo) {
- notifyError('No end time provided to show history. Please provide a suitable value' + timeTo);
- } else {
- $('#dateRangePopup').dialog('close');
- document.getElementById('realTimeShow').style.display = 'block';
- isBatchModeOn = true;
- clearFocus(); // Clear current focus if any
- clearMap();
- var fromDate = new Date(timeFrom);
- var toDate = new Date(timeTo);
- var tableData = getProviderData(fromDate.valueOf() / 1000, toDate.valueOf() / 1000);
- for (var i = 0; i < tableData.length; i++) {
- var data = tableData[i];
- var geoMessage = {
- "messageType": "Point",
- "type": "Feature",
- "id": data.id,
- "deviceId": data.id,
- "deviceType": data.type,
- "properties": {
- "speed": data.speed,
- "heading": data.heading,
- "state": data.state,
- "information": data.information,
- "notify": data.notify,
- "type": data.type
- },
- "geometry": {
- "type": "Point",
- "coordinates": [data.longitude, data.latitude]
- }
- };
- processPointMessage(geoMessage);
- }
- var spatialObject = currentSpatialObjects[objectId];// (local)
- if (!spatialObject) {
- $.UIkit.notify({
- message: "Spatial Object " + objectId + " not in the Map!!",
- status: 'warning',
- timeout: ApplicationOptions.constance.NOTIFY_WARNING_TIMEOUT,
- pos: 'top-center'
- });
- return false;
- }
- selectedSpatialObject = objectId; // (global) Why not use 'var' other than implicit declaration http://stackoverflow.com/questions/1470488/what-is-the-function-of-the-var-keyword-and-when-to-use-it-or-omit-it#answer-1471738
-
- console.log("Selected " + objectId + " type " + spatialObject.type);
- if (spatialObject.type == "area") {
- spatialObject.focusOn(map);
- return true;
- }
-
- map.setView(spatialObject.marker.getLatLng(), 15, {animate: true}); // TODO: check the map._layersMaxZoom and set the zoom level accordingly
-
- $('#objectInfo').find('#objectInfoId').html(selectedSpatialObject);
- spatialObject.marker.openPopup();
- if (!toggled) {
- $('#objectInfo').animate({width: 'toggle'}, 100);
- toggled = true;
- }
- getAlertsHistory(objectId);
- spatialObject.drawPath();
- setTimeout(function () {
- createChart();
- chart.load({columns: [spatialObject.speedHistory.getArray()]});
- }, 100);
- }
-}
-
-// Unfocused on current searched spatial object
-function clearFocus() {
- if (selectedSpatialObject) {
- spatialObject = currentSpatialObjects[selectedSpatialObject];
- spatialObject.removeFromMap();
- selectedSpatialObject = null;
- }
-}
diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/application_options.js b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/application_options.js
deleted file mode 100644
index 9ce922b5a..000000000
--- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/application_options.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * WSO2 Inc. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-var ApplicationOptions = {
- colors: {
- states: {
- NORMAL: 'blue',
- WARNING: 'blue',
- OFFLINE: 'grey',
- ALERTED: 'red',
- UNKNOWN: 'black' // TODO: previous color #19FFFF , change this if black is not user friendly ;)
- },
- application: {
- header: 'grey'
- }
- },
- constance:{
- CEP_WEB_SOCKET_OUTPUT_ADAPTOR_NAME: 'org.wso2.geo.FusedSpatialEvent',
- CEP_ON_ALERT_WEB_SOCKET_OUTPUT_ADAPTOR_NAME: 'org.wso2.geo.AlertsNotifications',
- CEP_Traffic_STREAM_WEB_SOCKET_OUTPUT_ADAPTOR_NAME: 'DefaultWebsocketOutputAdaptorOnTrafficStream',
- CEP_WEB_SOCKET_OUTPUT_ADAPTOR_WEBAPP_NAME: 'secured-websocket',
- TENANT_INDEX: 't',
- COLON : ':',
- PATH_SEPARATOR : '/',
- VERSION: '1.0.0',
-
- SPEED_HISTORY_COUNT: 20,
- NOTIFY_INFO_TIMEOUT: 1000,
- NOTIFY_SUCCESS_TIMEOUT: 1000,
- NOTIFY_WARNING_TIMEOUT: 3000,
- NOTIFY_DANGER_TIMEOUT: 5000
- },
- messages:{
- app:{
-
- }
- },
- leaflet: {
- iconUrls: {
- normalMovingIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/object-types/default/moving/alerted.png',
- alertedMovingIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/moving/arrow_alerted.png',
- offlineMovingIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/moving/arrow_offline.png',
- warningMovingIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/moving/arrow_warning.png',
- defaultMovingIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/moving/arrow_normal.png',
-
- normalNonMovingIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/non_moving/dot_normal.png',
- alertedNonMovingIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/non_moving/dot_alerted.png',
- offlineNonMovingIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/non_moving/dot_offline.png',
- warningNonMovingIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/non_moving/dot_warning.png',
- defaultNonMovingIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/non_moving/dot_normal.png',
-
- normalPlaceIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/places/marker-icon.png',
- alertedPlaceIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/places/redMarker.png',
- offlinePlaceIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/places/ashMarker.png',
- warningPlaceIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/places/pinkMarker.png',
- defaultPlaceIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/places/marker-icon.png',
-
- defaultIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/moving/default_icons/marker-icon.png',
- resizeIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/resize.png',
- stopIcon: '/portal/store/carbon.super/fs/gadget/geo-dashboard/img/markers/stopIcon.png'
-
- }
- }
-};
diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/bootstrap-wizard-lib/LICENSE b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/bootstrap-wizard-lib/LICENSE
deleted file mode 100644
index 6aee4f8c2..000000000
--- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/bootstrap-wizard-lib/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (C) 2013 Panopta, Andrew Moffat
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/bootstrap-wizard-lib/bootstrap-wizard.js b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/bootstrap-wizard-lib/bootstrap-wizard.js
deleted file mode 100644
index b0bc7f7f2..000000000
--- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/bootstrap-wizard-lib/bootstrap-wizard.js
+++ /dev/null
@@ -1,1171 +0,0 @@
-/*
- * Copyright (C) 2013 Panopta, Andrew Moffat
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-(function ($) {
- $.fn.wizard = function(args) {
- return new Wizard(this, args);
- };
-
- $.fn.wizard.logging = false;
-
- var WizardCard = function(wizard, card, index, prev, next) {
- this.wizard = wizard;
- this.index = index;
- this.prev = prev;
- this.next = next;
- this.el = card;
- this.title = card.find("h3").first().text();
- this.name = card.data("cardname") || this.title;
-
- this.nav = this._createNavElement(this.title, index);
-
- this._disabled = false;
- this._loaded = false;
- this._events = {};
- };
-
- WizardCard.prototype = {
- select: function() {
- this.log("selecting");
- if (!this.isSelected()) {
- this.nav.addClass("active");
- this.el.show();
-
- if (!this._loaded) {
- this.trigger("loaded");
- this.reload();
- }
-
- this.trigger("selected");
- }
-
-
- /*
- * this is ugly, but we're handling the changing of the wizard's
- * buttons here, in the WizardCard select. so when a card is
- * selected, we're figuring out if we're the first card or the
- * last card and changing the wizard's buttons via the guts of
- * the wizard
- *
- * ideally this logic should be encapsulated by some wizard methods
- * that we can call from here, instead of messing with the guts
- */
- var w = this.wizard;
-
- // The back button is only disabled on this first card...
- w.backButton.toggleClass("disabled", this.index == 0);
-
- if (this.index >= w._cards.length-1) {
- this.log("on last card, changing next button to submit");
-
- w.changeNextButton(w.args.buttons.submitText, "btn-success");
- w._readyToSubmit = true;
- w.trigger("readySubmit");
- }
- else {
- w._readyToSubmit = false;
- w.changeNextButton(w.args.buttons.nextText, "btn-primary");
- }
-
- return this;
- },
-
- _createNavElement: function(name, i) {
- var li = $('');
- var a = $('');
- a.data("navindex", i);
- li.append(a);
- a.append(' ');
- a.append(name);
- return li;
- },
-
- markVisited: function() {
- this.log("marking as visited");
- this.nav.addClass("already-visited");
- this.trigger("markVisited");
- return this;
- },
-
- unmarkVisited: function() {
- this.log("unmarking as visited");
- this.nav.removeClass("already-visited");
- this.trigger("unmarkVisited");
- return this;
- },
-
- deselect: function() {
- this.nav.removeClass("active");
- this.el.hide();
- this.trigger("deselect");
- return this;
- },
-
- enable: function() {
- this.log("enabling");
-
- // Issue #38 Hiding navigation link when hide card
- // Awaiting approval
- //
- // this.nav.removeClass('hide');
-
- this.nav.addClass("active");
- this._disabled = false;
- this.trigger("enabled");
- return this;
- },
-
- disable: function(hideCard) {
- this.log("disabling");
- this._disabled = true;
- this.nav.removeClass("active already-visited");
- if (hideCard) {
- this.el.hide();
- // Issue #38 Hiding navigation link when hide card
- // Awaiting approval
- //
- // this.nav.addClass('hide');
- }
- this.trigger("disabled");
- return this;
- },
-
- isDisabled: function() {
- return this._disabled;
- },
-
- alreadyVisited: function() {
- return this.nav.hasClass("already-visited");
- },
-
- isSelected: function() {
- return this.nav.hasClass("active");
- },
-
- reload: function() {
- this._loaded = true;
- this.trigger("reload");
- return this;
- },
-
- on: function() {
- return this.wizard.on.apply(this, arguments);
- },
-
- trigger: function() {
- this.callListener("on"+arguments[0]);
- return this.wizard.trigger.apply(this, arguments);
- },
-
- /*
- * displays an alert box on the current card
- */
- toggleAlert: function(msg, toggle) {
- this.log("toggling alert to: " + toggle);
-
- toggle = typeof(toggle) == "undefined" ? true : toggle;
-
- if (toggle) {this.trigger("showAlert");}
- else {this.trigger("hideAlert");}
-
- var div;
- var alert = this.el.children("h3").first().next("div.alert");
-
- if (alert.length == 0) {
- /*
- * we're hiding anyways, so no need to create anything.
- * we'll do that if we ever are actually showing the alert
- */
- if (!toggle) {return this;}
-
- this.log("couldn't find existing alert div, creating one");
- div = $("");
- div.addClass("alert");
- div.addClass("hide");
- div.insertAfter(this.el.find("h3").first());
- }
- else {
- this.log("found existing alert div");
- div = alert.first();
- }
-
- if (toggle) {
- if (msg != null) {
- this.log("setting alert msg to", msg);
- div.html(msg);
- }
- div.show();
- }
- else {
- div.hide();
- }
- return this;
- },
-
- /*
- * this looks for event handlers embedded into the html of the
- * wizard card itself, in the form of a data- attribute
- */
- callListener: function(name) {
- // a bug(?) in jquery..can't access data- if name is camelCase
- name = name.toLowerCase();
-
- this.log("looking for listener " + name);
- var listener = window[this.el.data(name)];
- if (listener) {
- this.log("calling listener " + name);
- var wizard = this.wizard;
-
- try {
- var vret = listener(this);
- }
- catch (e) {
- this.log("exception calling listener " + name + ": ", e);
- }
- }
- else {
- this.log("didn't find listener " + name);
- }
- },
-
- problem: function(toggle) {
- this.nav.find("a").toggleClass("wizard-step-error", toggle);
- },
-
- validate: function() {
- var failures = false;
- var self = this;
-
- /*
- * run all the validators embedded on the inputs themselves
- */
- this.el.find("[data-validate]").each(function(i, el) {
- self.log("validating individiual inputs");
- el = $(el);
-
- var v = el.data("validate");
- if (!v) {return;}
-
- var ret = {
- status: true,
- title: "Error",
- msg: ""
- };
-
- var vret = window[v](el);
- $.extend(ret, vret);
-
- // Add-On
- // This allows the use of a INPUT+BTN used as one according to boostrap layout
- // for the wizard it is required to add an id with btn-(ID of Input)
- // this will make sure the popover is drawn on the correct element
- if ( $('#btn-' + el.attr('id')).length === 1 ) {
- el = $('#btn-' + el.attr('id'));
- }
-
- if (!ret.status) {
- failures = true;
-
- // Updated to show error on correct form-group
- el.parents("div.form-group").toggleClass("has-error", true);
-
- // This allows the use of a INPUT+BTN used as one according to boostrap layout
- // for the wizard it is required to add an id with btn-(ID of Input)
- // this will make sure the popover is drawn on the correct element
- if ( $('#btn-' + el.attr('id')).length === 1 ) {
- el = $('#btn-' + el.attr('id'));
- }
-
- self.wizard.errorPopover(el, ret.msg);
- } else {
- el.parents("div.form-group").toggleClass("has-error", false);
-
- // This allows the use of a INPUT+BTN used as one according to boostrap layout
- // for the wizard it is required to add an id with btn-(ID of Input)
- // this will make sure the popover is drawn on the correct element
- if ( $('#btn-' + el.attr('id')).length === 1 ) {
- el = $('#btn-' + el.attr('id'));
- }
-
- try {
- el.popover("destroy");
- }
- /*
- * older versions of bootstrap don't have a destroy call
- * for popovers
- */
- catch (e) {
- el.popover("hide");
- }
- }
- });
- this.log("after validating inputs, failures is", failures);
-
- /*
- * run the validator embedded in the card
- */
- var cardValidator = window[this.el.data("validate")];
- if (cardValidator) {
- this.log("running html-embedded card validator");
- var cardValidated = cardValidator(this);
- if (typeof(cardValidated) == "undefined" || cardValidated == null) {
- cardValidated = true;
- }
- if (!cardValidated) failures = true;
- this.log("after running html-embedded card validator, failures is", failures);
- }
-
- /*
- * run the validate listener
- */
- this.log("running listener validator");
- var listenerValidated = this.trigger("validate");
- if (typeof(listenerValidated) == "undefined" || listenerValidated == null) {
- listenerValidated = true;
- }
- if (!listenerValidated) failures = true;
- this.log("after running listener validator, failures is", failures);
-
- var validated = !failures;
- if (validated) {
- this.log("validated, calling listeners");
- this.trigger("validated");
- }
- else {
- this.log("invalid");
- this.trigger("invalid");
- }
- return validated;
- },
-
- log: function() {
- if (!window.console || !$.fn.wizard.logging) {return;}
- var prepend = "card '"+this.name+"': ";
- var args = [prepend];
- args.push.apply(args, arguments);
-
- console.log.apply(console, args);
- },
-
- isActive: function() {
- return this.nav.hasClass("active");
- }
- };
-
- Wizard = function(markup, args) {
-
- /* TEMPLATE */
- this.wizard_template = [
- '
',
- '
',
- '
',
- '
',
- '',
- '',
- '',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '
',
- '',
- '
',
- '
',
- '
',
- '',
- '
',
-
- '
',
- '
',
- '
'
- ];
-
- this.args = {
- keyboard: true,
- backdrop: true,
- show: false,
- submitUrl: "",
- showCancel: false,
- showClose: true,
- progressBarCurrent: false,
- increaseHeight: 0,
- contentHeight: 400,
- contentWidth: '50%',
- buttons: {
- cancelText: "Cancel",
- nextText: "Next",
- backText: "Back",
- submitText: "Submit",
- submittingText: "Submitting...",
- },
- formClass: "form-horizontal"
- };
-
- $.extend(this.args, args || {});
-
- this._create(markup);
- };
-
- Wizard.prototype = {
- log: function() {
- if (!window.console || !$.fn.wizard.logging) {return;}
- var prepend = "wizard "+this.el.id+": ";
- var args = [prepend];
- args.push.apply(args, arguments);
- console.log.apply(console, args);
- },
-
- _create: function(markup) {
- this.markup = $(markup);
- this.title = this.markup.data('title');
- this.submitCards = this.markup.find(".wizard-error,.wizard-failure,.wizard-success,.wizard-loading");
- this.el = $(this.wizard_template.join('\n'));
- $('body').append(this.el);
-
- this.modal = this.el.modal({
- keyboard: this.args.keyboard,
- show: this.args.show,
- backdrop: this.args.backdrop
- });
-
- this.dimensions = {
- contentHeight: this.args.contentHeight,
- contentWidth: this.args.contentWidth
- };
- this.dialog = this.modal.find('.wizard-dialog');
- this.content = this.modal.find('.wizard-content');
- this.header = this.modal.find('.wizard-header');
- this.body = this.modal.find('.wizard-body');
- this.wizardSteps = this.modal.find('.wizard-steps');
- this.wizardCards = this.modal.find('.wizard-cards');
- this.wizardCardContainer = this.modal.find('.wizard-card-container');
- this.wizardCardContainer
- .append(this.markup.find('.wizard-card'))
- .append(this.submitCards);
- this.navContainer = this.modal.find('.wizard-nav-container');
- this.navList = this.modal.find('.wizard-nav-list');
- this.progressContainer = this.modal.find('.wizard-progress-container');
- this.progress = this.progressContainer.find('.progress-bar');
- this.closeButton = this.modal.find('button.wizard-close.close');
- this.cardsContainer = this.modal.find('wizard-cards-container');
- this.form = this.modal.find('form');
- this.footer = this.modal.find(".wizard-footer");
- this.cancelButton = this.footer.find(".wizard-cancel");
- this.backButton = this.footer.find(".wizard-back");
- this.nextButton = this.footer.find(".wizard-next");
-
- this._cards = [];
- this.cards = {};
- this._readyToSubmit = false;
- this.percentComplete = 0;
- this._submitting = false;
- this._events = {};
- this._firstShow = true;
-
- this._createCards();
-
- this.nextButton.click(this, this._handleNextClick);
- this.backButton.click(this, this._handleBackClick);
-
- this.cancelButton.text(this.args.buttons.cancelText);
- this.backButton.text(this.args.buttons.backText);
- this.nextButton.text(this.args.buttons.nextText);
-
- // Apply Form Class(es)
- this.form.addClass(this.args.formClass);
-
- // Register Array Holder for popovers
- this.popovers = [];
-
- var self = this;
- var _close = function() {
- self.reset();
- self.close();
- self.trigger("closed");
- };
-
- // Register Close Button
- this.closeButton.click(_close);
- this.cancelButton.click(_close);
-
- this.wizardSteps.on("click", "li.already-visited a.wizard-nav-link", this,
- function(event) {
- var index = parseInt($(event.target).data("navindex"));
- event.data.setCard(index);
- });
-
- if ( this.title.length != 0 ) {
- this.setTitle(this.title);
- }
-
- this.on("submit", this._defaultSubmit);
-
- // Set Modal Dimensions
- this.autoDimensions();
- },
-
- autoDimensions: function() {
- // DO NOT REMOVE DISPLAY ; Temporary display is required for calculation
- this.modal.css('display', 'block');
-
- this.dimensions.header = this.header.outerHeight(true);
-
- // Navigation Pane is dyanmic build on card content
- // Navigation Pane === BASE Inner Content Height
- this.dimensions.navigation = this.wizardSteps.outerHeight(true);
- if ( this.dimensions.navigation < this.dimensions.contentHeight ) {
- this.dimensions.navigation = this.dimensions.contentHeight;
- this.navContainer.height( (this.dimensions.contentHeight-30) - this.progressContainer.outerHeight(true));
- }
-
- // Dimension Alias ( Body Height === (Navigation Height) )
- this.dimensions.body = this.dimensions.navigation;
-
- // Apply OuterHeight of navigation to it's parent wizardSteps
- this.wizardSteps.height(this.dimensions.body);
-
- // Modal Height === (Header + Content)
- this.dimensions.modal = (this.dimensions.header + this.dimensions.navigation);
- this.content.height(this.dimensions.modal + 'px');
- this.dialog.width(this.dimensions.contentWidth);
-
- this.body.height(this.dimensions.body + 'px');
- this.wizardCards.height(this.dimensions.body + 'px');
-
- // Footer Height
- this.dimensions.footer = this.footer.outerHeight(true);
-
- // Card Container === (Body - Footer)
- this.dimensions.cardContainer = (this.dimensions.body - this.dimensions.footer);
- this.wizardCardContainer.height(this.dimensions.cardContainer);
-
- // Reposition
- this.dimensions.offset = ($(window).height() - this.dialog.height()) / 2;
- this.dialog.css({
- 'margin-top': this.dimensions.offset + 'px',
- 'padding-top': 0
- });
-
- // DO NOT REMOVE NEXT LINE
- this.modal.css('display', '');
- },
-
- setTitle: function(title) {
- this.log("setting title to", title);
- this.modal.find(".wizard-title").first().text(title);
- return this;
- },
-
- setSubtitle: function(title) {
- this.log("setting subtitle to", title);
- this.modal.find(".wizard-subtitle").first().text(title);
- return this;
- },
-
- errorPopover: function(el, msg, allowHtml) {
- this.log("launching popover on", el);
- allowHtml = typeof allowHtml !== "undefined" ? allowHtml : false;
- var popover = el.popover({
- content: msg,
- trigger: "manual",
- html: allowHtml,
- container: el.parents('.form-group')
- }).addClass("error-popover").popover("show").next(".popover");
-
- el.parents('.form-group').find('.popover').addClass("error-popover");
-
- this.popovers.push(el);
-
- return popover;
- },
-
- destroyPopover: function(pop) {
- pop = $(pop);
-
- /*
- * this is the element that the popover was created for
- */
- try {
- pop.popover("destroy");
- }
- /*
- * older versions of bootstrap don't have a destroy call
- * for popovers
- */
- catch (e) {
- pop.popover("hide");
- }
- },
-
- hidePopovers: function(el) {
- this.log("hiding all popovers");
- var self = this;
-
- $.each(this.popovers, function(i, p) {
- self.destroyPopover(p);
- });
-
- this.modal.find('.has-error').removeClass('has-error');
- this.popovers = [];
- },
-
- eachCard: function(fn) {
- $.each(this._cards, fn);
- return this;
- },
-
- getActiveCard: function() {
- this.log("getting active card");
- var currentCard = null;
-
- $.each(this._cards, function(i, card) {
- if (card.isActive()) {
- currentCard = card;
- return false;
- }
- });
- if (currentCard) {this.log("found active card", currentCard);}
- else {this.log("couldn't find an active card");}
- return currentCard;
- },
-
- changeNextButton: function(text, cls) {
- this.log("changing next button, text: " + text, "class: " + cls);
- if (typeof(cls) != "undefined") {
- this.nextButton.removeClass("btn-success btn-primary");
- }
-
- if (cls) {
- this.nextButton.addClass(cls);
- }
- this.nextButton.text(text);
- return this;
- },
-
- hide: function() {
- this.log("hiding");
- this.modal.modal("hide");
- return this;
- },
-
- close: function() {
- this.log("closing");
- this.modal.modal("hide");
- return this;
- },
-
-
- show: function(modalOptions) {
- this.log("showing");
- if (this._firstShow) {
- this.setCard(0);
- this._firstShow = false;
- }
- if (this.args.showCancel) {
- this.cancelButton.show();
- } else {
- this.cancelButton.hide();
- }
- if (this.args.showClose) { this.closeButton.show(); }
- this.modal.modal('show');
-
- return this;
- },
-
- on: function(name, fn) {
- this.log("adding listener to event " + name);
- this._events[name] = fn;
- return this;
- },
-
- trigger: function() {
- var name = arguments[0];
- var args = Array.prototype.slice.call(arguments);
- args.shift();
- args.unshift(this);
-
- this.log("firing event " + name);
- var handler = this._events[name];
- if (handler === undefined && this.wizard !== undefined) {
- handler = this.wizard._events[name];
- }
- var ret = null;
-
- if (typeof(handler) == "function") {
- this.log("found event handler, calling " + name);
- try {
- ret = handler.apply(this, args);
- }
- catch (e) {
- this.log("event handler " + name + " had an exception");
- }
- }
- else {
- this.log("couldn't find an event handler for " + name);
- }
- return ret;
- },
-
-
- reset: function() {
- this.log("resetting");
-
- this.updateProgressBar(0);
- this.hideSubmitCards();
-
- this.setCard(0);
- this.lockCards();
-
- this.enableNextButton();
- this.showButtons();
-
- this.hidePopovers();
-
- this.trigger("reset");
- return this;
- },
-
- /*
- * this handles switching to the next card or previous card, taking
- * care to skip over disabled cards
- */
- _abstractIncrementStep: function(direction, getNext) {
- var current = this.getActiveCard();
- var next;
-
- if (current) {
- /*
- * loop until we find a card that isn't disabled
- */
- this.log("searching for valid next card");
- while (true) {
- next = getNext(current);
- if (next) {
- this.log("looking at card", next.index);
- if (next.isDisabled()) {
- this.log("card " + next.index + " is disabled/locked, continuing");
- current = next;
- continue;
- }
- else {
- return this.setCard(current.index+direction);
- }
- }
- else {
- this.log("next card is not defined, breaking");
- break;
- }
- }
- }
- else {
- this.log("current card is undefined");
- }
- },
-
-
- incrementCard: function() {
- this.log("incrementing card");
- var card = this._abstractIncrementStep(1, function(current){return current.next;});
- this.trigger("incrementCard");
- return card;
- },
-
- decrementCard: function() {
- this.log("decrementing card");
- var card = this._abstractIncrementStep(-1, function(current){return current.prev;});
- this.trigger("decrementCard");
- return card;
- },
-
- setCard: function(i) {
- this.log("setting card to " + i);
- this.hideSubmitCards();
- var currentCard = this.getActiveCard();
-
- if (this._submitting) {
- this.log("we're submitting the wizard already, can't change cards");
- return currentCard;
- }
-
- var newCard = this._cards[i];
- if (newCard) {
- if (newCard.isDisabled()) {
- this.log("new card is currently disabled, returning");
- return currentCard;
- }
-
- if (currentCard) {
-
- /*
- * here, we're only validating if we're going forward,
- * not if we're going backwards in a step
- */
- if (i > currentCard.index) {
- var cardToValidate = currentCard;
- var ok = false;
-
- /*
- * we need to loop over every card between our current
- * card and the card that we clicked, and re-validate
- * them. if there's an error, we need to select the
- * first card to have an error
- */
- while (cardToValidate.index != newCard.index) {
- /*
- * unless we're validating the card that we're
- * leaving, we need to select the card, so that
- * any validators that trigger errorPopovers can
- * display correctly
- */
- if (cardToValidate.index != currentCard.index) {
- cardToValidate.prev.deselect();
- cardToValidate.prev.markVisited();
- cardToValidate.select();
- }
- ok = cardToValidate.validate();
- if (!ok) {
- return cardToValidate;
- }
- cardToValidate = cardToValidate.next;
- }
-
- cardToValidate.prev.deselect();
- cardToValidate.prev.markVisited();
- }
-
- currentCard.deselect();
- currentCard.markVisited();
- }
-
- newCard.select();
-
- if (this.args.progressBarCurrent) {
- this.percentComplete = i * 100.0 / this._cards.length;
- this.updateProgressBar(this.percentComplete);
- }
- else {
- var lastPercent = this.percentComplete;
- this.percentComplete = i * 100.0 / this._cards.length;
- this.percentComplete = Math.max(lastPercent, this.percentComplete);
- this.updateProgressBar(this.percentComplete);
- }
-
- return newCard;
- }
- else {
- this.log("couldn't find card " + i);
- }
- },
-
- updateProgressBar: function(percent) {
- this.log("updating progress to " + percent + "%");
- this.progress.css({width: percent + "%"});
- this.percentComplete = percent;
-
- this.trigger("progressBar", percent);
-
- if (percent == 100) {
- this.log("progress is 100, animating progress bar");
- this.progressContainer.find('.progress').addClass("active");
- }
- else if (percent == 0) {
- this.log("progress is 0, disabling animation");
- this.progressContainer.find('.progress').removeClass("active");
- }
- },
-
- getNextCard: function() {
- var currentCard = this.getActiveCard();
- if (currentCard) return currentCard.next;
- },
-
- lockCards: function() {
- this.log("locking nav cards");
- this.eachCard(function(i,card){card.unmarkVisited();});
- return this;
- },
-
- disableCards: function() {
- this.log("disabling all nav cards");
- this.eachCard(function(i,card){card.disable();});
- return this;
- },
-
- enableCards: function() {
- this.log("enabling all nav cards");
- this.eachCard(function(i,card){card.enable();});
- return this;
- },
-
- hideCards: function() {
- this.log("hiding cards");
- this.eachCard(function(i,card){card.deselect();});
- this.hideSubmitCards();
- return this;
- },
-
- hideButtons: function() {
- this.log("hiding buttons");
- this.cancelButton.hide();
- this.closeButton.hide();
- this.nextButton.hide();
- this.backButton.hide();
- return this;
- },
-
- showButtons: function() {
- this.log("showing buttons");
- if (this.args.showCancel) {
- this.cancelButton.show();
- } else {
- this.cancelButton.hide();
- }
- if (this.args.showClose) { this.closeButton.show(); };
- this.nextButton.show();
- this.backButton.show();
- return this;
- },
-
- getCard: function(el) {
- var cardDOMEl = $(el).parents(".wizard-card").first()[0];
- if (cardDOMEl) {
- var foundCard = null;
- this.eachCard(function(i, card) {
- if (cardDOMEl == card.el[0]) {
- foundCard = card;
- return false;
- }
- return true;
- });
- return foundCard;
- }
- else {
- return null;
- }
- },
-
- _createCards: function() {
- var prev = null;
- var next = null;
- var currentCard = null;
- var wizard = this;
- var self = this;
-
- self.log("Creating Cards");
-
- var cards = this.modal.find(".wizard-cards .wizard-card");
- $.each(cards, function(i, card) {
- card = $(card);
-
- prev = currentCard;
- currentCard = new WizardCard(wizard, card, i, prev, next);
- self._cards.push(currentCard);
- if (currentCard.name) {
- self.cards[currentCard.name] = currentCard;
- }
- if (prev) {prev.next = currentCard;}
-
- self.modal.find(".wizard-steps .wizard-nav-list").append(currentCard.nav);
- });
- },
-
- showSubmitCard: function(name) {
- this.log("showing "+name+" submit card");
-
- var card = this.el.find(".wizard-"+name);
- if (card.length) {
- this.hideCards();
- this.el.find(".wizard-"+name).show();
- }
- else {
- this.log("couldn't find submit card "+name);
- }
- },
-
- hideSubmitCard: function(name) {
- this.log("hiding "+name+" submit card");
- this.el.find(".wizard-"+name).hide();
- },
-
- hideSubmitCards: function() {
- var wizard = this;
- $.each(["success", "error", "failure", "loading"], function(i, name) {
- wizard.hideSubmitCard(name);
- });
- },
-
- enableNextButton: function() {
- this.log("enabling next button");
- this.nextButton.removeAttr("disabled");
- return this;
- },
-
- disableNextButton: function() {
- this.log("disabling next button");
- this.nextButton.attr("disabled", "disabled");
- return this;
- },
-
- serializeArray: function() {
- var form = this.form.serializeArray();
- this.form.find('input[disabled][data-serialize="1"]').each(function() {
- formObj = {
- name: $(this).attr('name'),
- value: $(this).val()
- };
-
- form.push(formObj);
- });
-
- return form;
- },
-
- serialize: function() {
- var form = this.form.serialize();
- this.form.find('input[disabled][data-serialize="1"]').each(function() {
- form = form + '&' + $(this).attr('name') + '=' + $(this).val();
- });
-
- return form;
- },
-
- find: function(selector) {
- return this.modal.find(selector);
- },
-
-
- /*
- * the next 3 functions are to be called by the custom submit event
- * handler. the idea is that after you make an ajax call to submit
- * your wizard data (or whatever it is you want to do at the end of
- * the wizard), you call one of these 3 handlers to display a specific
- * card for either success, failure, or error
- */
- submitSuccess: function() {
- this.log("submit success");
- this._submitting = false;
- this.showSubmitCard("success");
- this.trigger("submitSuccess");
- },
-
- submitFailure: function() {
- this.log("submit failure");
- this._submitting = false;
- this.showSubmitCard("failure");
- this.trigger("submitFailure");
- },
-
- submitError: function() {
- this.log("submit error");
- this._submitting = false;
- this.showSubmitCard("error");
- this.trigger("submitError");
- },
-
-
- _submit: function() {
- this.log("submitting wizard");
- this._submitting = true;
-
- this.lockCards();
- this.cancelButton.hide();
- this.closeButton.hide();
- this.backButton.hide();
-
- this.showSubmitCard("loading");
- this.updateProgressBar(100);
-
- this.changeNextButton(this.args.buttons.submittingText, false);
- this.disableNextButton();
-
- var ret = this.trigger("submit");
- this.trigger("loading");
- },
-
- _onNextClick: function() {
- this.log("handling 'next' button click");
- var currentCard = this.getActiveCard();
- if (this._readyToSubmit && currentCard.validate()) {
- this._submit();
- }
- else {
- currentCard = this.incrementCard();
- }
- },
-
- _onBackClick: function() {
- this.log("handling 'back' button click");
- var currentCard = this.decrementCard();
- },
-
- _handleNextClick: function(event) {
- var wizard = event.data;
- wizard._onNextClick.call(wizard);
- },
-
- _handleBackClick: function(event) {
- var wizard = event.data;
- wizard._onBackClick.call(wizard);
- },
-
-
- /*
- * this function is attached by default to the wizard's "submit" event.
- * if you choose to implement your own custom submit logic, you should
- * copy how this function works
- */
- _defaultSubmit: function(wizard) {
- $.ajax({
- type: "POST",
- url: wizard.args.submitUrl,
- data: wizard.serialize(),
- dataType: "json"
- }).done(function(response) {
- wizard.submitSuccess();
- wizard.hideButtons();
- wizard.updateProgressBar(0);
- }).fail(function() {
- wizard.submitFailure();
- wizard.hideButtons();
- });
- }
- };
-
-
-}(window.jQuery));
diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/bootstrap-wizard-lib/bootstrap-wizard.min.js b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/bootstrap-wizard-lib/bootstrap-wizard.min.js
deleted file mode 100644
index 898bb73da..000000000
--- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/bootstrap-wizard-lib/bootstrap-wizard.min.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(e){e.fn.wizard=function(e){return new Wizard(this,e)};e.fn.wizard.logging=false;var t=function(e,t,n,r,i){this.wizard=e;this.index=n;this.prev=r;this.next=i;this.el=t;this.title=t.find("h3").first().text();this.name=t.data("cardname")||this.title;this.nav=this._createNavElement(this.title,n);this._disabled=false;this._loaded=false;this._events={}};t.prototype={select:function(){this.log("selecting");if(!this.isSelected()){this.nav.addClass("active");this.el.show();if(!this._loaded){this.trigger("loaded");this.reload()}this.trigger("selected")}var e=this.wizard;e.backButton.toggleClass("disabled",this.index==0);if(this.index>=e._cards.length-1){this.log("on last card, changing next button to submit");e.changeNextButton(e.args.buttons.submitText,"btn-success");e._readyToSubmit=true;e.trigger("readySubmit")}else{e._readyToSubmit=false;e.changeNextButton(e.args.buttons.nextText,"btn-primary")}return this},_createNavElement:function(t,n){var r=e('');var i=e('');i.data("navindex",n);r.append(i);i.append(' ');i.append(t);return r},markVisited:function(){this.log("marking as visited");this.nav.addClass("already-visited");this.trigger("markVisited");return this},unmarkVisited:function(){this.log("unmarking as visited");this.nav.removeClass("already-visited");this.trigger("unmarkVisited");return this},deselect:function(){this.nav.removeClass("active");this.el.hide();this.trigger("deselect");return this},enable:function(){this.log("enabling");this.nav.addClass("active");this._disabled=false;this.trigger("enabled");return this},disable:function(e){this.log("disabling");this._disabled=true;this.nav.removeClass("active already-visited");if(e){this.el.hide()}this.trigger("disabled");return this},isDisabled:function(){return this._disabled},alreadyVisited:function(){return this.nav.hasClass("already-visited")},isSelected:function(){return this.nav.hasClass("active")},reload:function(){this._loaded=true;this.trigger("reload");return this},on:function(){return this.wizard.on.apply(this,arguments)},trigger:function(){this.callListener("on"+arguments[0]);return this.wizard.trigger.apply(this,arguments)},toggleAlert:function(t,n){this.log("toggling alert to: "+n);n=typeof n=="undefined"?true:n;if(n){this.trigger("showAlert")}else{this.trigger("hideAlert")}var r;var i=this.el.children("h3").first().next("div.alert");if(i.length==0){if(!n){return this}this.log("couldn't find existing alert div, creating one");r=e("");r.addClass("alert");r.addClass("hide");r.insertAfter(this.el.find("h3").first())}else{this.log("found existing alert div");r=i.first()}if(n){if(t!=null){this.log("setting alert msg to",t);r.html(t)}r.show()}else{r.hide()}return this},callListener:function(e){e=e.toLowerCase();this.log("looking for listener "+e);var t=window[this.el.data(e)];if(t){this.log("calling listener "+e);var n=this.wizard;try{var r=t(this)}catch(i){this.log("exception calling listener "+e+": ",i)}}else{this.log("didn't find listener "+e)}},problem:function(e){this.nav.find("a").toggleClass("wizard-step-error",e)},validate:function(){var t=false;var n=this;this.el.find("[data-validate]").each(function(r,i){n.log("validating individiual inputs");i=e(i);var s=i.data("validate");if(!s){return}var o={status:true,title:"Error",msg:""};var u=window[s](i);e.extend(o,u);if(e("#btn-"+i.attr("id")).length===1){i=e("#btn-"+i.attr("id"))}if(!o.status){t=true;i.parents("div.form-group").toggleClass("has-error",true);if(e("#btn-"+i.attr("id")).length===1){i=e("#btn-"+i.attr("id"))}n.wizard.errorPopover(i,o.msg)}else{i.parents("div.form-group").toggleClass("has-error",false);if(e("#btn-"+i.attr("id")).length===1){i=e("#btn-"+i.attr("id"))}try{i.popover("destroy")}catch(a){i.popover("hide")}}});this.log("after validating inputs, failures is",t);var r=window[this.el.data("validate")];if(r){this.log("running html-embedded card validator");var i=r(this);if(typeof i=="undefined"||i==null){i=true}if(!i)t=true;this.log("after running html-embedded card validator, failures is",t)}this.log("running listener validator");var s=this.trigger("validate");if(typeof s=="undefined"||s==null){s=true}if(!s)t=true;this.log("after running listener validator, failures is",t);var o=!t;if(o){this.log("validated, calling listeners");this.trigger("validated")}else{this.log("invalid");this.trigger("invalid")}return o},log:function(){if(!window.console||!e.fn.wizard.logging){return}var t="card '"+this.name+"': ";var n=[t];n.push.apply(n,arguments);console.log.apply(console,n)},isActive:function(){return this.nav.hasClass("active")}};Wizard=function(t,n){this.wizard_template=['
','
','
','
','','','',"
",'
','
','
','
',"
","
",'
','
','',"
","
","
","","
","
","
","
"];this.args={keyboard:true,backdrop:true,show:false,submitUrl:"",showCancel:false,showClose:true,progressBarCurrent:false,increaseHeight:0,contentHeight:300,contentWidth:'50%',buttons:{cancelText:"Cancel",nextText:"Next",backText:"Back",submitText:"Submit",submittingText:"Submitting..."},formClass:"form-horizontal"};e.extend(this.args,n||{});this._create(t)};Wizard.prototype={log:function(){if(!window.console||!e.fn.wizard.logging){return}var t="wizard "+this.el.id+": ";var n=[t];n.push.apply(n,arguments);console.log.apply(console,n)},_create:function(t){this.markup=e(t);this.title=this.markup.data("title");this.submitCards=this.markup.find(".wizard-error,.wizard-failure,.wizard-success,.wizard-loading");this.el=e(this.wizard_template.join("\n"));e("body").append(this.el);this.modal=this.el.modal({keyboard:this.args.keyboard,show:this.args.show,backdrop:this.args.backdrop});this.dimensions={contentHeight:this.args.contentHeight,contentWidth:this.args.contentWidth};this.dialog=this.modal.find(".wizard-dialog");this.content=this.modal.find(".wizard-content");this.header=this.modal.find(".wizard-header");this.body=this.modal.find(".wizard-body");this.wizardSteps=this.modal.find(".wizard-steps");this.wizardCards=this.modal.find(".wizard-cards");this.wizardCardContainer=this.modal.find(".wizard-card-container");this.wizardCardContainer.append(this.markup.find(".wizard-card")).append(this.submitCards);this.navContainer=this.modal.find(".wizard-nav-container");this.navList=this.modal.find(".wizard-nav-list");this.progressContainer=this.modal.find(".wizard-progress-container");this.progress=this.progressContainer.find(".progress-bar");this.closeButton=this.modal.find("button.wizard-close.close");this.cardsContainer=this.modal.find("wizard-cards-container");this.form=this.modal.find("form");this.footer=this.modal.find(".wizard-footer");this.cancelButton=this.footer.find(".wizard-cancel");this.backButton=this.footer.find(".wizard-back");this.nextButton=this.footer.find(".wizard-next");this._cards=[];this.cards={};this._readyToSubmit=false;this.percentComplete=0;this._submitting=false;this._events={};this._firstShow=true;this._createCards();this.nextButton.click(this,this._handleNextClick);this.backButton.click(this,this._handleBackClick);this.cancelButton.text(this.args.buttons.cancelText);this.backButton.text(this.args.buttons.backText);this.nextButton.text(this.args.buttons.nextText);this.form.addClass(this.args.formClass);this.popovers=[];var n=this;var r=function(){n.reset();n.close();n.trigger("closed")};this.closeButton.click(r);this.cancelButton.click(r);this.wizardSteps.on("click","li.already-visited a.wizard-nav-link",this,function(t){var n=parseInt(e(t.target).data("navindex"));t.data.setCard(n)});if(this.title.length!=0){this.setTitle(this.title)}this.on("submit",this._defaultSubmit);this.autoDimensions()},autoDimensions:function(){this.modal.css("display","block");this.dimensions.header=this.header.outerHeight(true);this.dimensions.navigation=this.wizardSteps.outerHeight(true);if(this.dimensions.navigationt.index){var r=t;var i=false;while(r.index!=n.index){if(r.index!=t.index){r.prev.deselect();r.prev.markVisited();r.select()}i=r.validate();if(!i){return r}r=r.next}r.prev.deselect();r.prev.markVisited()}t.deselect();t.markVisited()}n.select();if(this.args.progressBarCurrent){this.percentComplete=e*100/this._cards.length;this.updateProgressBar(this.percentComplete)}else{var s=this.percentComplete;this.percentComplete=e*100/this._cards.length;this.percentComplete=Math.max(s,this.percentComplete);this.updateProgressBar(this.percentComplete)}return n}else{this.log("couldn't find card "+e)}},updateProgressBar:function(e){this.log("updating progress to "+e+"%");this.progress.css({width:e+"%"});this.percentComplete=e;this.trigger("progressBar",e);if(e==100){this.log("progress is 100, animating progress bar");this.progressContainer.find(".progress").addClass("active")}else if(e==0){this.log("progress is 0, disabling animation");this.progressContainer.find(".progress").removeClass("active")}},getNextCard:function(){var e=this.getActiveCard();if(e)return e.next},lockCards:function(){this.log("locking nav cards");this.eachCard(function(e,t){t.unmarkVisited()});return this},disableCards:function(){this.log("disabling all nav cards");this.eachCard(function(e,t){t.disable()});return this},enableCards:function(){this.log("enabling all nav cards");this.eachCard(function(e,t){t.enable()});return this},hideCards:function(){this.log("hiding cards");this.eachCard(function(e,t){t.deselect()});this.hideSubmitCards();return this},hideButtons:function(){this.log("hiding buttons");this.cancelButton.hide();this.closeButton.hide();this.nextButton.hide();this.backButton.hide();return this},showButtons:function(){this.log("showing buttons");if(this.args.showCancel){this.cancelButton.show()}else{this.cancelButton.hide()}if(this.args.showClose){this.closeButton.show()}this.nextButton.show();this.backButton.show();return this},getCard:function(t){var n=e(t).parents(".wizard-card").first()[0];if(n){var r=null;this.eachCard(function(e,t){if(n==t.el[0]){r=t;return false}return true});return r}else{return null}},_createCards:function(){var n=null;var r=null;var i=null;var s=this;var o=this;o.log("Creating Cards");var u=this.modal.find(".wizard-cards .wizard-card");e.each(u,function(u,a){a=e(a);n=i;i=new t(s,a,u,n,r);o._cards.push(i);if(i.name){o.cards[i.name]=i}if(n){n.next=i}o.modal.find(".wizard-steps .wizard-nav-list").append(i.nav)})},showSubmitCard:function(e){this.log("showing "+e+" submit card");var t=this.el.find(".wizard-"+e);if(t.length){this.hideCards();this.el.find(".wizard-"+e).show()}else{this.log("couldn't find submit card "+e)}},hideSubmitCard:function(e){this.log("hiding "+e+" submit card");this.el.find(".wizard-"+e).hide()},hideSubmitCards:function(){var t=this;e.each(["success","error","failure","loading"],function(e,n){t.hideSubmitCard(n)})},enableNextButton:function(){this.log("enabling next button");this.nextButton.removeAttr("disabled");return this},disableNextButton:function(){this.log("disabling next button");this.nextButton.attr("disabled","disabled");return this},serializeArray:function(){var t=this.form.serializeArray();this.form.find('input[disabled][data-serialize="1"]').each(function(){formObj={name:e(this).attr("name"),value:e(this).val()};t.push(formObj)});return t},serialize:function(){var t=this.form.serialize();this.form.find('input[disabled][data-serialize="1"]').each(function(){t=t+"&"+e(this).attr("name")+"="+e(this).val()});return t},find:function(e){return this.modal.find(e)},submitSuccess:function(){this.log("submit success");this._submitting=false;this.showSubmitCard("success");this.trigger("submitSuccess")},submitFailure:function(){this.log("submit failure");this._submitting=false;this.showSubmitCard("failure");this.trigger("submitFailure")},submitError:function(){this.log("submit error");this._submitting=false;this.showSubmitCard("error");this.trigger("submitError")},_submit:function(){this.log("submitting wizard");this._submitting=true;this.lockCards();this.cancelButton.hide();this.closeButton.hide();this.backButton.hide();this.showSubmitCard("loading");this.updateProgressBar(100);this.changeNextButton(this.args.buttons.submittingText,false);this.disableNextButton();var e=this.trigger("submit");this.trigger("loading")},_onNextClick:function(){this.log("handling 'next' button click");var e=this.getActiveCard();if(this._readyToSubmit&&e.validate()){this._submit()}else{e=this.incrementCard()}},_onBackClick:function(){this.log("handling 'back' button click");var e=this.decrementCard()},_handleNextClick:function(e){var t=e.data;t._onNextClick.call(t)},_handleBackClick:function(e){var t=e.data;t._onBackClick.call(t)},_defaultSubmit:function(t){e.ajax({type:"POST",url:t.args.submitUrl,data:t.serialize(),dataType:"json"}).done(function(e){t.submitSuccess();t.hideButtons();t.updateProgressBar(0)}).fail(function(){t.submitFailure();t.hideButtons()})}}})(window.jQuery)
diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/bootstrap/BOOTSTRAP_LICENSE b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/bootstrap/BOOTSTRAP_LICENSE
deleted file mode 100644
index 8d94aa9ac..000000000
--- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/bootstrap/BOOTSTRAP_LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2011-2014 Twitter, Inc
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/bootstrap/bootstrap.min.js b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/bootstrap/bootstrap.min.js
deleted file mode 100644
index 4723aabe8..000000000
--- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/bootstrap/bootstrap.min.js
+++ /dev/null
@@ -1,655 +0,0 @@
-/*!
- * Bootstrap v3.2.0 (http://getbootstrap.com)
- * Copyright 2011-2014 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- */
-if ("undefined" == typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");
-+function (a) {
- "use strict";
- function b() {
- var a = document.createElement("bootstrap"), b = {WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd otransitionend", transition: "transitionend"};
- for (var c in b)if (void 0 !== a.style[c])return{end: b[c]};
- return!1
- }
-
- a.fn.emulateTransitionEnd = function (b) {
- var c = !1, d = this;
- a(this).one("bsTransitionEnd", function () {
- c = !0
- });
- var e = function () {
- c || a(d).trigger(a.support.transition.end)
- };
- return setTimeout(e, b), this
- }, a(function () {
- a.support.transition = b(), a.support.transition && (a.event.special.bsTransitionEnd = {bindType: a.support.transition.end, delegateType: a.support.transition.end, handle: function (b) {
- return a(b.target).is(this) ? b.handleObj.handler.apply(this, arguments) : void 0
- }})
- })
-}(jQuery), +function (a) {
- "use strict";
- function b(b) {
- return this.each(function () {
- var c = a(this), e = c.data("bs.alert");
- e || c.data("bs.alert", e = new d(this)), "string" == typeof b && e[b].call(c)
- })
- }
-
- var c = '[data-dismiss="alert"]', d = function (b) {
- a(b).on("click", c, this.close)
- };
- d.VERSION = "3.2.0", d.prototype.close = function (b) {
- function c() {
- f.detach().trigger("closed.bs.alert").remove()
- }
-
- var d = a(this), e = d.attr("data-target");
- e || (e = d.attr("href"), e = e && e.replace(/.*(?=#[^\s]*$)/, ""));
- var f = a(e);
- b && b.preventDefault(), f.length || (f = d.hasClass("alert") ? d : d.parent()), f.trigger(b = a.Event("close.bs.alert")), b.isDefaultPrevented() || (f.removeClass("in"), a.support.transition && f.hasClass("fade") ? f.one("bsTransitionEnd", c).emulateTransitionEnd(150) : c())
- };
- var e = a.fn.alert;
- a.fn.alert = b, a.fn.alert.Constructor = d, a.fn.alert.noConflict = function () {
- return a.fn.alert = e, this
- }, a(document).on("click.bs.alert.data-api", c, d.prototype.close)
-}(jQuery), +function (a) {
- "use strict";
- function b(b) {
- return this.each(function () {
- var d = a(this), e = d.data("bs.button"), f = "object" == typeof b && b;
- e || d.data("bs.button", e = new c(this, f)), "toggle" == b ? e.toggle() : b && e.setState(b)
- })
- }
-
- var c = function (b, d) {
- this.$element = a(b), this.options = a.extend({}, c.DEFAULTS, d), this.isLoading = !1
- };
- c.VERSION = "3.2.0", c.DEFAULTS = {loadingText: "loading..."}, c.prototype.setState = function (b) {
- var c = "disabled", d = this.$element, e = d.is("input") ? "val" : "html", f = d.data();
- b += "Text", null == f.resetText && d.data("resetText", d[e]()), d[e](null == f[b] ? this.options[b] : f[b]), setTimeout(a.proxy(function () {
- "loadingText" == b ? (this.isLoading = !0, d.addClass(c).attr(c, c)) : this.isLoading && (this.isLoading = !1, d.removeClass(c).removeAttr(c))
- }, this), 0)
- }, c.prototype.toggle = function () {
- var a = !0, b = this.$element.closest('[data-toggle="buttons"]');
- if (b.length) {
- var c = this.$element.find("input");
- "radio" == c.prop("type") && (c.prop("checked") && this.$element.hasClass("active") ? a = !1 : b.find(".active").removeClass("active")), a && c.prop("checked", !this.$element.hasClass("active")).trigger("change")
- }
- a && this.$element.toggleClass("active")
- };
- var d = a.fn.button;
- a.fn.button = b, a.fn.button.Constructor = c, a.fn.button.noConflict = function () {
- return a.fn.button = d, this
- }, a(document).on("click.bs.button.data-api", '[data-toggle^="button"]', function (c) {
- var d = a(c.target);
- d.hasClass("btn") || (d = d.closest(".btn")), b.call(d, "toggle"), c.preventDefault()
- })
-}(jQuery), +function (a) {
- "use strict";
- function b(b) {
- return this.each(function () {
- var d = a(this), e = d.data("bs.carousel"), f = a.extend({}, c.DEFAULTS, d.data(), "object" == typeof b && b), g = "string" == typeof b ? b : f.slide;
- e || d.data("bs.carousel", e = new c(this, f)), "number" == typeof b ? e.to(b) : g ? e[g]() : f.interval && e.pause().cycle()
- })
- }
-
- var c = function (b, c) {
- this.$element = a(b).on("keydown.bs.carousel", a.proxy(this.keydown, this)), this.$indicators = this.$element.find(".carousel-indicators"), this.options = c, this.paused = this.sliding = this.interval = this.$active = this.$items = null, "hover" == this.options.pause && this.$element.on("mouseenter.bs.carousel", a.proxy(this.pause, this)).on("mouseleave.bs.carousel", a.proxy(this.cycle, this))
- };
- c.VERSION = "3.2.0", c.DEFAULTS = {interval: 5e3, pause: "hover", wrap: !0}, c.prototype.keydown = function (a) {
- switch (a.which) {
- case 37:
- this.prev();
- break;
- case 39:
- this.next();
- break;
- default:
- return
- }
- a.preventDefault()
- }, c.prototype.cycle = function (b) {
- return b || (this.paused = !1), this.interval && clearInterval(this.interval), this.options.interval && !this.paused && (this.interval = setInterval(a.proxy(this.next, this), this.options.interval)), this
- }, c.prototype.getItemIndex = function (a) {
- return this.$items = a.parent().children(".item"), this.$items.index(a || this.$active)
- }, c.prototype.to = function (b) {
- var c = this, d = this.getItemIndex(this.$active = this.$element.find(".item.active"));
- return b > this.$items.length - 1 || 0 > b ? void 0 : this.sliding ? this.$element.one("slid.bs.carousel", function () {
- c.to(b)
- }) : d == b ? this.pause().cycle() : this.slide(b > d ? "next" : "prev", a(this.$items[b]))
- }, c.prototype.pause = function (b) {
- return b || (this.paused = !0), this.$element.find(".next, .prev").length && a.support.transition && (this.$element.trigger(a.support.transition.end), this.cycle(!0)), this.interval = clearInterval(this.interval), this
- }, c.prototype.next = function () {
- return this.sliding ? void 0 : this.slide("next")
- }, c.prototype.prev = function () {
- return this.sliding ? void 0 : this.slide("prev")
- }, c.prototype.slide = function (b, c) {
- var d = this.$element.find(".item.active"), e = c || d[b](), f = this.interval, g = "next" == b ? "left" : "right", h = "next" == b ? "first" : "last", i = this;
- if (!e.length) {
- if (!this.options.wrap)return;
- e = this.$element.find(".item")[h]()
- }
- if (e.hasClass("active"))return this.sliding = !1;
- var j = e[0], k = a.Event("slide.bs.carousel", {relatedTarget: j, direction: g});
- if (this.$element.trigger(k), !k.isDefaultPrevented()) {
- if (this.sliding = !0, f && this.pause(), this.$indicators.length) {
- this.$indicators.find(".active").removeClass("active");
- var l = a(this.$indicators.children()[this.getItemIndex(e)]);
- l && l.addClass("active")
- }
- var m = a.Event("slid.bs.carousel", {relatedTarget: j, direction: g});
- return a.support.transition && this.$element.hasClass("slide") ? (e.addClass(b), e[0].offsetWidth, d.addClass(g), e.addClass(g), d.one("bsTransitionEnd", function () {
- e.removeClass([b, g].join(" ")).addClass("active"), d.removeClass(["active", g].join(" ")), i.sliding = !1, setTimeout(function () {
- i.$element.trigger(m)
- }, 0)
- }).emulateTransitionEnd(1e3 * d.css("transition-duration").slice(0, -1))) : (d.removeClass("active"), e.addClass("active"), this.sliding = !1, this.$element.trigger(m)), f && this.cycle(), this
- }
- };
- var d = a.fn.carousel;
- a.fn.carousel = b, a.fn.carousel.Constructor = c, a.fn.carousel.noConflict = function () {
- return a.fn.carousel = d, this
- }, a(document).on("click.bs.carousel.data-api", "[data-slide], [data-slide-to]", function (c) {
- var d, e = a(this), f = a(e.attr("data-target") || (d = e.attr("href")) && d.replace(/.*(?=#[^\s]+$)/, ""));
- if (f.hasClass("carousel")) {
- var g = a.extend({}, f.data(), e.data()), h = e.attr("data-slide-to");
- h && (g.interval = !1), b.call(f, g), h && f.data("bs.carousel").to(h), c.preventDefault()
- }
- }), a(window).on("load", function () {
- a('[data-ride="carousel"]').each(function () {
- var c = a(this);
- b.call(c, c.data())
- })
- })
-}(jQuery), +function (a) {
- "use strict";
- function b(b) {
- return this.each(function () {
- var d = a(this), e = d.data("bs.collapse"), f = a.extend({}, c.DEFAULTS, d.data(), "object" == typeof b && b);
- !e && f.toggle && "show" == b && (b = !b), e || d.data("bs.collapse", e = new c(this, f)), "string" == typeof b && e[b]()
- })
- }
-
- var c = function (b, d) {
- this.$element = a(b), this.options = a.extend({}, c.DEFAULTS, d), this.transitioning = null, this.options.parent && (this.$parent = a(this.options.parent)), this.options.toggle && this.toggle()
- };
- c.VERSION = "3.2.0", c.DEFAULTS = {toggle: !0}, c.prototype.dimension = function () {
- var a = this.$element.hasClass("width");
- return a ? "width" : "height"
- }, c.prototype.show = function () {
- if (!this.transitioning && !this.$element.hasClass("in")) {
- var c = a.Event("show.bs.collapse");
- if (this.$element.trigger(c), !c.isDefaultPrevented()) {
- var d = this.$parent && this.$parent.find("> .panel > .in");
- if (d && d.length) {
- var e = d.data("bs.collapse");
- if (e && e.transitioning)return;
- b.call(d, "hide"), e || d.data("bs.collapse", null)
- }
- var f = this.dimension();
- this.$element.removeClass("collapse").addClass("collapsing")[f](0), this.transitioning = 1;
- var g = function () {
- this.$element.removeClass("collapsing").addClass("collapse in")[f](""), this.transitioning = 0, this.$element.trigger("shown.bs.collapse")
- };
- if (!a.support.transition)return g.call(this);
- var h = a.camelCase(["scroll", f].join("-"));
- this.$element.one("bsTransitionEnd", a.proxy(g, this)).emulateTransitionEnd(350)[f](this.$element[0][h])
- }
- }
- }, c.prototype.hide = function () {
- if (!this.transitioning && this.$element.hasClass("in")) {
- var b = a.Event("hide.bs.collapse");
- if (this.$element.trigger(b), !b.isDefaultPrevented()) {
- var c = this.dimension();
- this.$element[c](this.$element[c]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"), this.transitioning = 1;
- var d = function () {
- this.transitioning = 0, this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")
- };
- return a.support.transition ? void this.$element[c](0).one("bsTransitionEnd", a.proxy(d, this)).emulateTransitionEnd(350) : d.call(this)
- }
- }
- }, c.prototype.toggle = function () {
- this[this.$element.hasClass("in") ? "hide" : "show"]()
- };
- var d = a.fn.collapse;
- a.fn.collapse = b, a.fn.collapse.Constructor = c, a.fn.collapse.noConflict = function () {
- return a.fn.collapse = d, this
- }, a(document).on("click.bs.collapse.data-api", '[data-toggle="collapse"]', function (c) {
- var d, e = a(this), f = e.attr("data-target") || c.preventDefault() || (d = e.attr("href")) && d.replace(/.*(?=#[^\s]+$)/, ""), g = a(f), h = g.data("bs.collapse"), i = h ? "toggle" : e.data(), j = e.attr("data-parent"), k = j && a(j);
- h && h.transitioning || (k && k.find('[data-toggle="collapse"][data-parent="' + j + '"]').not(e).addClass("collapsed"), e[g.hasClass("in") ? "addClass" : "removeClass"]("collapsed")), b.call(g, i)
- })
-}(jQuery), +function (a) {
- "use strict";
- function b(b) {
- b && 3 === b.which || (a(e).remove(), a(f).each(function () {
- var d = c(a(this)), e = {relatedTarget: this};
- d.hasClass("open") && (d.trigger(b = a.Event("hide.bs.dropdown", e)), b.isDefaultPrevented() || d.removeClass("open").trigger("hidden.bs.dropdown", e))
- }))
- }
-
- function c(b) {
- var c = b.attr("data-target");
- c || (c = b.attr("href"), c = c && /#[A-Za-z]/.test(c) && c.replace(/.*(?=#[^\s]*$)/, ""));
- var d = c && a(c);
- return d && d.length ? d : b.parent()
- }
-
- function d(b) {
- return this.each(function () {
- var c = a(this), d = c.data("bs.dropdown");
- d || c.data("bs.dropdown", d = new g(this)), "string" == typeof b && d[b].call(c)
- })
- }
-
- var e = ".dropdown-backdrop", f = '[data-toggle="dropdown"]', g = function (b) {
- a(b).on("click.bs.dropdown", this.toggle)
- };
- g.VERSION = "3.2.0", g.prototype.toggle = function (d) {
- var e = a(this);
- if (!e.is(".disabled, :disabled")) {
- var f = c(e), g = f.hasClass("open");
- if (b(), !g) {
- "ontouchstart"in document.documentElement && !f.closest(".navbar-nav").length && a('').insertAfter(a(this)).on("click", b);
- var h = {relatedTarget: this};
- if (f.trigger(d = a.Event("show.bs.dropdown", h)), d.isDefaultPrevented())return;
- e.trigger("focus"), f.toggleClass("open").trigger("shown.bs.dropdown", h)
- }
- return!1
- }
- }, g.prototype.keydown = function (b) {
- if (/(38|40|27)/.test(b.keyCode)) {
- var d = a(this);
- if (b.preventDefault(), b.stopPropagation(), !d.is(".disabled, :disabled")) {
- var e = c(d), g = e.hasClass("open");
- if (!g || g && 27 == b.keyCode)return 27 == b.which && e.find(f).trigger("focus"), d.trigger("click");
- var h = " li:not(.divider):visible a", i = e.find('[role="menu"]' + h + ', [role="listbox"]' + h);
- if (i.length) {
- var j = i.index(i.filter(":focus"));
- 38 == b.keyCode && j > 0 && j--, 40 == b.keyCode && j < i.length - 1 && j++, ~j || (j = 0), i.eq(j).trigger("focus")
- }
- }
- }
- };
- var h = a.fn.dropdown;
- a.fn.dropdown = d, a.fn.dropdown.Constructor = g, a.fn.dropdown.noConflict = function () {
- return a.fn.dropdown = h, this
- }, a(document).on("click.bs.dropdown.data-api", b).on("click.bs.dropdown.data-api", ".dropdown form", function (a) {
- a.stopPropagation()
- }).on("click.bs.dropdown.data-api", f, g.prototype.toggle).on("keydown.bs.dropdown.data-api", f + ', [role="menu"], [role="listbox"]', g.prototype.keydown)
-}(jQuery), +function (a) {
- "use strict";
- function b(b, d) {
- return this.each(function () {
- var e = a(this), f = e.data("bs.modal"), g = a.extend({}, c.DEFAULTS, e.data(), "object" == typeof b && b);
- f || e.data("bs.modal", f = new c(this, g)), "string" == typeof b ? f[b](d) : g.show && f.show(d)
- })
- }
-
- var c = function (b, c) {
- this.options = c, this.$body = a(document.body), this.$element = a(b), this.$backdrop = this.isShown = null, this.scrollbarWidth = 0, this.options.remote && this.$element.find(".modal-content").load(this.options.remote, a.proxy(function () {
- this.$element.trigger("loaded.bs.modal")
- }, this))
- };
- c.VERSION = "3.2.0", c.DEFAULTS = {backdrop: !0, keyboard: !0, show: !0}, c.prototype.toggle = function (a) {
- return this.isShown ? this.hide() : this.show(a)
- }, c.prototype.show = function (b) {
- var c = this, d = a.Event("show.bs.modal", {relatedTarget: b});
- this.$element.trigger(d), this.isShown || d.isDefaultPrevented() || (this.isShown = !0, this.checkScrollbar(), this.$body.addClass("modal-open"), this.setScrollbar(), this.escape(), this.$element.on("click.dismiss.bs.modal", '[data-dismiss="modal"]', a.proxy(this.hide, this)), this.backdrop(function () {
- var d = a.support.transition && c.$element.hasClass("fade");
- c.$element.parent().length || c.$element.appendTo(c.$body), c.$element.show().scrollTop(0), d && c.$element[0].offsetWidth, c.$element.addClass("in").attr("aria-hidden", !1), c.enforceFocus();
- var e = a.Event("shown.bs.modal", {relatedTarget: b});
- d ? c.$element.find(".modal-dialog").one("bsTransitionEnd", function () {
- c.$element.trigger("focus").trigger(e)
- }).emulateTransitionEnd(300) : c.$element.trigger("focus").trigger(e)
- }))
- }, c.prototype.hide = function (b) {
- b && b.preventDefault(), b = a.Event("hide.bs.modal"), this.$element.trigger(b), this.isShown && !b.isDefaultPrevented() && (this.isShown = !1, this.$body.removeClass("modal-open"), this.resetScrollbar(), this.escape(), a(document).off("focusin.bs.modal"), this.$element.removeClass("in").attr("aria-hidden", !0).off("click.dismiss.bs.modal"), a.support.transition && this.$element.hasClass("fade") ? this.$element.one("bsTransitionEnd", a.proxy(this.hideModal, this)).emulateTransitionEnd(300) : this.hideModal())
- }, c.prototype.enforceFocus = function () {
- a(document).off("focusin.bs.modal").on("focusin.bs.modal", a.proxy(function (a) {
- this.$element[0] === a.target || this.$element.has(a.target).length || this.$element.trigger("focus")
- }, this))
- }, c.prototype.escape = function () {
- this.isShown && this.options.keyboard ? this.$element.on("keyup.dismiss.bs.modal", a.proxy(function (a) {
- 27 == a.which && this.hide()
- }, this)) : this.isShown || this.$element.off("keyup.dismiss.bs.modal")
- }, c.prototype.hideModal = function () {
- var a = this;
- this.$element.hide(), this.backdrop(function () {
- a.$element.trigger("hidden.bs.modal")
- })
- }, c.prototype.removeBackdrop = function () {
- this.$backdrop && this.$backdrop.remove(), this.$backdrop = null
- }, c.prototype.backdrop = function (b) {
- var c = this, d = this.$element.hasClass("fade") ? "fade" : "";
- if (this.isShown && this.options.backdrop) {
- var e = a.support.transition && d;
- if (this.$backdrop = a('').appendTo(this.$body), this.$element.on("click.dismiss.bs.modal", a.proxy(function (a) {
- a.target === a.currentTarget && ("static" == this.options.backdrop ? this.$element[0].focus.call(this.$element[0]) : this.hide.call(this))
- }, this)), e && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"), !b)return;
- e ? this.$backdrop.one("bsTransitionEnd", b).emulateTransitionEnd(150) : b()
- } else if (!this.isShown && this.$backdrop) {
- this.$backdrop.removeClass("in");
- var f = function () {
- c.removeBackdrop(), b && b()
- };
- a.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one("bsTransitionEnd", f).emulateTransitionEnd(150) : f()
- } else b && b()
- }, c.prototype.checkScrollbar = function () {
- document.body.clientWidth >= window.innerWidth || (this.scrollbarWidth = this.scrollbarWidth || this.measureScrollbar())
- }, c.prototype.setScrollbar = function () {
- var a = parseInt(this.$body.css("padding-right") || 0, 10);
- this.scrollbarWidth && this.$body.css("padding-right", a + this.scrollbarWidth)
- }, c.prototype.resetScrollbar = function () {
- this.$body.css("padding-right", "")
- }, c.prototype.measureScrollbar = function () {
- var a = document.createElement("div");
- a.className = "modal-scrollbar-measure", this.$body.append(a);
- var b = a.offsetWidth - a.clientWidth;
- return this.$body[0].removeChild(a), b
- };
- var d = a.fn.modal;
- a.fn.modal = b, a.fn.modal.Constructor = c, a.fn.modal.noConflict = function () {
- return a.fn.modal = d, this
- }, a(document).on("click.bs.modal.data-api", '[data-toggle="modal"]', function (c) {
- var d = a(this), e = d.attr("href"), f = a(d.attr("data-target") || e && e.replace(/.*(?=#[^\s]+$)/, "")), g = f.data("bs.modal") ? "toggle" : a.extend({remote: !/#/.test(e) && e}, f.data(), d.data());
- d.is("a") && c.preventDefault(), f.one("show.bs.modal", function (a) {
- a.isDefaultPrevented() || f.one("hidden.bs.modal", function () {
- d.is(":visible") && d.trigger("focus")
- })
- }), b.call(f, g, this)
- })
-}(jQuery), +function (a) {
- "use strict";
- function b(b) {
- return this.each(function () {
- var d = a(this), e = d.data("bs.tooltip"), f = "object" == typeof b && b;
- (e || "destroy" != b) && (e || d.data("bs.tooltip", e = new c(this, f)), "string" == typeof b && e[b]())
- })
- }
-
- var c = function (a, b) {
- this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null, this.init("tooltip", a, b)
- };
- c.VERSION = "3.2.0", c.DEFAULTS = {animation: !0, placement: "top", selector: !1, template: '
', trigger: "hover focus", title: "", delay: 0, html: !1, container: !1, viewport: {selector: "body", padding: 0}}, c.prototype.init = function (b, c, d) {
- this.enabled = !0, this.type = b, this.$element = a(c), this.options = this.getOptions(d), this.$viewport = this.options.viewport && a(this.options.viewport.selector || this.options.viewport);
- for (var e = this.options.trigger.split(" "), f = e.length; f--;) {
- var g = e[f];
- if ("click" == g)this.$element.on("click." + this.type, this.options.selector, a.proxy(this.toggle, this)); else if ("manual" != g) {
- var h = "hover" == g ? "mouseenter" : "focusin", i = "hover" == g ? "mouseleave" : "focusout";
- this.$element.on(h + "." + this.type, this.options.selector, a.proxy(this.enter, this)), this.$element.on(i + "." + this.type, this.options.selector, a.proxy(this.leave, this))
- }
- }
- this.options.selector ? this._options = a.extend({}, this.options, {trigger: "manual", selector: ""}) : this.fixTitle()
- }, c.prototype.getDefaults = function () {
- return c.DEFAULTS
- }, c.prototype.getOptions = function (b) {
- return b = a.extend({}, this.getDefaults(), this.$element.data(), b), b.delay && "number" == typeof b.delay && (b.delay = {show: b.delay, hide: b.delay}), b
- }, c.prototype.getDelegateOptions = function () {
- var b = {}, c = this.getDefaults();
- return this._options && a.each(this._options, function (a, d) {
- c[a] != d && (b[a] = d)
- }), b
- }, c.prototype.enter = function (b) {
- var c = b instanceof this.constructor ? b : a(b.currentTarget).data("bs." + this.type);
- return c || (c = new this.constructor(b.currentTarget, this.getDelegateOptions()), a(b.currentTarget).data("bs." + this.type, c)), clearTimeout(c.timeout), c.hoverState = "in", c.options.delay && c.options.delay.show ? void(c.timeout = setTimeout(function () {
- "in" == c.hoverState && c.show()
- }, c.options.delay.show)) : c.show()
- }, c.prototype.leave = function (b) {
- var c = b instanceof this.constructor ? b : a(b.currentTarget).data("bs." + this.type);
- return c || (c = new this.constructor(b.currentTarget, this.getDelegateOptions()), a(b.currentTarget).data("bs." + this.type, c)), clearTimeout(c.timeout), c.hoverState = "out", c.options.delay && c.options.delay.hide ? void(c.timeout = setTimeout(function () {
- "out" == c.hoverState && c.hide()
- }, c.options.delay.hide)) : c.hide()
- }, c.prototype.show = function () {
- var b = a.Event("show.bs." + this.type);
- if (this.hasContent() && this.enabled) {
- this.$element.trigger(b);
- var c = a.contains(document.documentElement, this.$element[0]);
- if (b.isDefaultPrevented() || !c)return;
- var d = this, e = this.tip(), f = this.getUID(this.type);
- this.setContent(), e.attr("id", f), this.$element.attr("aria-describedby", f), this.options.animation && e.addClass("fade");
- var g = "function" == typeof this.options.placement ? this.options.placement.call(this, e[0], this.$element[0]) : this.options.placement, h = /\s?auto?\s?/i, i = h.test(g);
- i && (g = g.replace(h, "") || "top"), e.detach().css({top: 0, left: 0, display: "block"}).addClass(g).data("bs." + this.type, this), this.options.container ? e.appendTo(this.options.container) : e.insertAfter(this.$element);
- var j = this.getPosition(), k = e[0].offsetWidth, l = e[0].offsetHeight;
- if (i) {
- var m = g, n = this.$element.parent(), o = this.getPosition(n);
- g = "bottom" == g && j.top + j.height + l - o.scroll > o.height ? "top" : "top" == g && j.top - o.scroll - l < 0 ? "bottom" : "right" == g && j.right + k > o.width ? "left" : "left" == g && j.left - k < o.left ? "right" : g, e.removeClass(m).addClass(g)
- }
- var p = this.getCalculatedOffset(g, j, k, l);
- this.applyPlacement(p, g);
- var q = function () {
- d.$element.trigger("shown.bs." + d.type), d.hoverState = null
- };
- a.support.transition && this.$tip.hasClass("fade") ? e.one("bsTransitionEnd", q).emulateTransitionEnd(150) : q()
- }
- }, c.prototype.applyPlacement = function (b, c) {
- var d = this.tip(), e = d[0].offsetWidth, f = d[0].offsetHeight, g = parseInt(d.css("margin-top"), 10), h = parseInt(d.css("margin-left"), 10);
- isNaN(g) && (g = 0), isNaN(h) && (h = 0), b.top = b.top + g, b.left = b.left + h, a.offset.setOffset(d[0], a.extend({using: function (a) {
- d.css({top: Math.round(a.top), left: Math.round(a.left)})
- }}, b), 0), d.addClass("in");
- var i = d[0].offsetWidth, j = d[0].offsetHeight;
- "top" == c && j != f && (b.top = b.top + f - j);
- var k = this.getViewportAdjustedDelta(c, b, i, j);
- k.left ? b.left += k.left : b.top += k.top;
- var l = k.left ? 2 * k.left - e + i : 2 * k.top - f + j, m = k.left ? "left" : "top", n = k.left ? "offsetWidth" : "offsetHeight";
- d.offset(b), this.replaceArrow(l, d[0][n], m)
- }, c.prototype.replaceArrow = function (a, b, c) {
- this.arrow().css(c, a ? 50 * (1 - a / b) + "%" : "")
- }, c.prototype.setContent = function () {
- var a = this.tip(), b = this.getTitle();
- a.find(".tooltip-inner")[this.options.html ? "html" : "text"](b), a.removeClass("fade in top bottom left right")
- }, c.prototype.hide = function () {
- function b() {
- "in" != c.hoverState && d.detach(), c.$element.trigger("hidden.bs." + c.type)
- }
-
- var c = this, d = this.tip(), e = a.Event("hide.bs." + this.type);
- return this.$element.removeAttr("aria-describedby"), this.$element.trigger(e), e.isDefaultPrevented() ? void 0 : (d.removeClass("in"), a.support.transition && this.$tip.hasClass("fade") ? d.one("bsTransitionEnd", b).emulateTransitionEnd(150) : b(), this.hoverState = null, this)
- }, c.prototype.fixTitle = function () {
- var a = this.$element;
- (a.attr("title") || "string" != typeof a.attr("data-original-title")) && a.attr("data-original-title", a.attr("title") || "").attr("title", "")
- }, c.prototype.hasContent = function () {
- return this.getTitle()
- }, c.prototype.getPosition = function (b) {
- b = b || this.$element;
- var c = b[0], d = "BODY" == c.tagName;
- return a.extend({}, "function" == typeof c.getBoundingClientRect ? c.getBoundingClientRect() : null, {scroll: d ? document.documentElement.scrollTop || document.body.scrollTop : b.scrollTop(), width: d ? a(window).width() : b.outerWidth(), height: d ? a(window).height() : b.outerHeight()}, d ? {top: 0, left: 0} : b.offset())
- }, c.prototype.getCalculatedOffset = function (a, b, c, d) {
- return"bottom" == a ? {top: b.top + b.height, left: b.left + b.width / 2 - c / 2} : "top" == a ? {top: b.top - d, left: b.left + b.width / 2 - c / 2} : "left" == a ? {top: b.top + b.height / 2 - d / 2, left: b.left - c} : {top: b.top + b.height / 2 - d / 2, left: b.left + b.width}
- }, c.prototype.getViewportAdjustedDelta = function (a, b, c, d) {
- var e = {top: 0, left: 0};
- if (!this.$viewport)return e;
- var f = this.options.viewport && this.options.viewport.padding || 0, g = this.getPosition(this.$viewport);
- if (/right|left/.test(a)) {
- var h = b.top - f - g.scroll, i = b.top + f - g.scroll + d;
- h < g.top ? e.top = g.top - h : i > g.top + g.height && (e.top = g.top + g.height - i)
- } else {
- var j = b.left - f, k = b.left + f + c;
- j < g.left ? e.left = g.left - j : k > g.width && (e.left = g.left + g.width - k)
- }
- return e
- }, c.prototype.getTitle = function () {
- var a, b = this.$element, c = this.options;
- return a = b.attr("data-original-title") || ("function" == typeof c.title ? c.title.call(b[0]) : c.title)
- }, c.prototype.getUID = function (a) {
- do a += ~~(1e6 * Math.random()); while (document.getElementById(a));
- return a
- }, c.prototype.tip = function () {
- return this.$tip = this.$tip || a(this.options.template)
- }, c.prototype.arrow = function () {
- return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
- }, c.prototype.validate = function () {
- this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null)
- }, c.prototype.enable = function () {
- this.enabled = !0
- }, c.prototype.disable = function () {
- this.enabled = !1
- }, c.prototype.toggleEnabled = function () {
- this.enabled = !this.enabled
- }, c.prototype.toggle = function (b) {
- var c = this;
- b && (c = a(b.currentTarget).data("bs." + this.type), c || (c = new this.constructor(b.currentTarget, this.getDelegateOptions()), a(b.currentTarget).data("bs." + this.type, c))), c.tip().hasClass("in") ? c.leave(c) : c.enter(c)
- }, c.prototype.destroy = function () {
- clearTimeout(this.timeout), this.hide().$element.off("." + this.type).removeData("bs." + this.type)
- };
- var d = a.fn.tooltip;
- a.fn.tooltip = b, a.fn.tooltip.Constructor = c, a.fn.tooltip.noConflict = function () {
- return a.fn.tooltip = d, this
- }
-}(jQuery), +function (a) {
- "use strict";
- function b(b) {
- return this.each(function () {
- var d = a(this), e = d.data("bs.popover"), f = "object" == typeof b && b;
- (e || "destroy" != b) && (e || d.data("bs.popover", e = new c(this, f)), "string" == typeof b && e[b]())
- })
- }
-
- var c = function (a, b) {
- this.init("popover", a, b)
- };
- if (!a.fn.tooltip)throw new Error("Popover requires tooltip.js");
- c.VERSION = "3.2.0", c.DEFAULTS = a.extend({}, a.fn.tooltip.Constructor.DEFAULTS, {placement: "right", trigger: "click", content: "", template: '
'}), c.prototype = a.extend({}, a.fn.tooltip.Constructor.prototype), c.prototype.constructor = c, c.prototype.getDefaults = function () {
- return c.DEFAULTS
- }, c.prototype.setContent = function () {
- var a = this.tip(), b = this.getTitle(), c = this.getContent();
- a.find(".popover-title")[this.options.html ? "html" : "text"](b), a.find(".popover-content").empty()[this.options.html ? "string" == typeof c ? "html" : "append" : "text"](c), a.removeClass("fade top bottom left right in"), a.find(".popover-title").html() || a.find(".popover-title").hide()
- }, c.prototype.hasContent = function () {
- return this.getTitle() || this.getContent()
- }, c.prototype.getContent = function () {
- var a = this.$element, b = this.options;
- return a.attr("data-content") || ("function" == typeof b.content ? b.content.call(a[0]) : b.content)
- }, c.prototype.arrow = function () {
- return this.$arrow = this.$arrow || this.tip().find(".arrow")
- }, c.prototype.tip = function () {
- return this.$tip || (this.$tip = a(this.options.template)), this.$tip
- };
- var d = a.fn.popover;
- a.fn.popover = b, a.fn.popover.Constructor = c, a.fn.popover.noConflict = function () {
- return a.fn.popover = d, this
- }
-}(jQuery), +function (a) {
- "use strict";
- function b(c, d) {
- var e = a.proxy(this.process, this);
- this.$body = a("body"), this.$scrollElement = a(a(c).is("body") ? window : c), this.options = a.extend({}, b.DEFAULTS, d), this.selector = (this.options.target || "") + " .nav li > a", this.offsets = [], this.targets = [], this.activeTarget = null, this.scrollHeight = 0, this.$scrollElement.on("scroll.bs.scrollspy", e), this.refresh(), this.process()
- }
-
- function c(c) {
- return this.each(function () {
- var d = a(this), e = d.data("bs.scrollspy"), f = "object" == typeof c && c;
- e || d.data("bs.scrollspy", e = new b(this, f)), "string" == typeof c && e[c]()
- })
- }
-
- b.VERSION = "3.2.0", b.DEFAULTS = {offset: 10}, b.prototype.getScrollHeight = function () {
- return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
- }, b.prototype.refresh = function () {
- var b = "offset", c = 0;
- a.isWindow(this.$scrollElement[0]) || (b = "position", c = this.$scrollElement.scrollTop()), this.offsets = [], this.targets = [], this.scrollHeight = this.getScrollHeight();
- var d = this;
- this.$body.find(this.selector).map(function () {
- var d = a(this), e = d.data("target") || d.attr("href"), f = /^#./.test(e) && a(e);
- return f && f.length && f.is(":visible") && [
- [f[b]().top + c, e]
- ] || null
- }).sort(function (a, b) {
- return a[0] - b[0]
- }).each(function () {
- d.offsets.push(this[0]), d.targets.push(this[1])
- })
- }, b.prototype.process = function () {
- var a, b = this.$scrollElement.scrollTop() + this.options.offset, c = this.getScrollHeight(), d = this.options.offset + c - this.$scrollElement.height(), e = this.offsets, f = this.targets, g = this.activeTarget;
- if (this.scrollHeight != c && this.refresh(), b >= d)return g != (a = f[f.length - 1]) && this.activate(a);
- if (g && b <= e[0])return g != (a = f[0]) && this.activate(a);
- for (a = e.length; a--;)g != f[a] && b >= e[a] && (!e[a + 1] || b <= e[a + 1]) && this.activate(f[a])
- }, b.prototype.activate = function (b) {
- this.activeTarget = b, a(this.selector).parentsUntil(this.options.target, ".active").removeClass("active");
- var c = this.selector + '[data-target="' + b + '"],' + this.selector + '[href="' + b + '"]', d = a(c).parents("li").addClass("active");
- d.parent(".dropdown-menu").length && (d = d.closest("li.dropdown").addClass("active")), d.trigger("activate.bs.scrollspy")
- };
- var d = a.fn.scrollspy;
- a.fn.scrollspy = c, a.fn.scrollspy.Constructor = b, a.fn.scrollspy.noConflict = function () {
- return a.fn.scrollspy = d, this
- }, a(window).on("load.bs.scrollspy.data-api", function () {
- a('[data-spy="scroll"]').each(function () {
- var b = a(this);
- c.call(b, b.data())
- })
- })
-}(jQuery), +function (a) {
- "use strict";
- function b(b) {
- return this.each(function () {
- var d = a(this), e = d.data("bs.tab");
- e || d.data("bs.tab", e = new c(this)), "string" == typeof b && e[b]()
- })
- }
-
- var c = function (b) {
- this.element = a(b)
- };
- c.VERSION = "3.2.0", c.prototype.show = function () {
- var b = this.element, c = b.closest("ul:not(.dropdown-menu)"), d = b.data("target");
- if (d || (d = b.attr("href"), d = d && d.replace(/.*(?=#[^\s]*$)/, "")), !b.parent("li").hasClass("active")) {
- var e = c.find(".active:last a")[0], f = a.Event("show.bs.tab", {relatedTarget: e});
- if (b.trigger(f), !f.isDefaultPrevented()) {
- var g = a(d);
- this.activate(b.closest("li"), c), this.activate(g, g.parent(), function () {
- b.trigger({type: "shown.bs.tab", relatedTarget: e})
- })
- }
- }
- }, c.prototype.activate = function (b, c, d) {
- function e() {
- f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"), b.addClass("active"), g ? (b[0].offsetWidth, b.addClass("in")) : b.removeClass("fade"), b.parent(".dropdown-menu") && b.closest("li.dropdown").addClass("active"), d && d()
- }
-
- var f = c.find("> .active"), g = d && a.support.transition && f.hasClass("fade");
- g ? f.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(), f.removeClass("in")
- };
- var d = a.fn.tab;
- a.fn.tab = b, a.fn.tab.Constructor = c, a.fn.tab.noConflict = function () {
- return a.fn.tab = d, this
- }, a(document).on("click.bs.tab.data-api", '[data-toggle="tab"], [data-toggle="pill"]', function (c) {
- c.preventDefault(), b.call(a(this), "show")
- })
-}(jQuery), +function (a) {
- "use strict";
- function b(b) {
- return this.each(function () {
- var d = a(this), e = d.data("bs.affix"), f = "object" == typeof b && b;
- e || d.data("bs.affix", e = new c(this, f)), "string" == typeof b && e[b]()
- })
- }
-
- var c = function (b, d) {
- this.options = a.extend({}, c.DEFAULTS, d), this.$target = a(this.options.target).on("scroll.bs.affix.data-api", a.proxy(this.checkPosition, this)).on("click.bs.affix.data-api", a.proxy(this.checkPositionWithEventLoop, this)), this.$element = a(b), this.affixed = this.unpin = this.pinnedOffset = null, this.checkPosition()
- };
- c.VERSION = "3.2.0", c.RESET = "affix affix-top affix-bottom", c.DEFAULTS = {offset: 0, target: window}, c.prototype.getPinnedOffset = function () {
- if (this.pinnedOffset)return this.pinnedOffset;
- this.$element.removeClass(c.RESET).addClass("affix");
- var a = this.$target.scrollTop(), b = this.$element.offset();
- return this.pinnedOffset = b.top - a
- }, c.prototype.checkPositionWithEventLoop = function () {
- setTimeout(a.proxy(this.checkPosition, this), 1)
- }, c.prototype.checkPosition = function () {
- if (this.$element.is(":visible")) {
- var b = a(document).height(), d = this.$target.scrollTop(), e = this.$element.offset(), f = this.options.offset, g = f.top, h = f.bottom;
- "object" != typeof f && (h = g = f), "function" == typeof g && (g = f.top(this.$element)), "function" == typeof h && (h = f.bottom(this.$element));
- var i = null != this.unpin && d + this.unpin <= e.top ? !1 : null != h && e.top + this.$element.height() >= b - h ? "bottom" : null != g && g >= d ? "top" : !1;
- if (this.affixed !== i) {
- null != this.unpin && this.$element.css("top", "");
- var j = "affix" + (i ? "-" + i : ""), k = a.Event(j + ".bs.affix");
- this.$element.trigger(k), k.isDefaultPrevented() || (this.affixed = i, this.unpin = "bottom" == i ? this.getPinnedOffset() : null, this.$element.removeClass(c.RESET).addClass(j).trigger(a.Event(j.replace("affix", "affixed"))), "bottom" == i && this.$element.offset({top: b - this.$element.height() - h}))
- }
- }
- };
- var d = a.fn.affix;
- a.fn.affix = b, a.fn.affix.Constructor = c, a.fn.affix.noConflict = function () {
- return a.fn.affix = d, this
- }, a(window).on("load", function () {
- a('[data-spy="affix"]').each(function () {
- var c = a(this), d = c.data();
- d.offset = d.offset || {}, d.offsetBottom && (d.offset.bottom = d.offsetBottom), d.offsetTop && (d.offset.top = d.offsetTop), b.call(c, d)
- })
- })
-}(jQuery);
\ No newline at end of file
diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/d3/C3_LICENSE b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/d3/C3_LICENSE
deleted file mode 100644
index 29ce9cb0a..000000000
--- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/d3/C3_LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2013 Masayuki Tanaka
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/d3/D3_LICENSE b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/d3/D3_LICENSE
deleted file mode 100644
index 83013469b..000000000
--- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/d3/D3_LICENSE
+++ /dev/null
@@ -1,26 +0,0 @@
-Copyright (c) 2010-2014, Michael Bostock
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-* The name Michael Bostock may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/d3/c3.min.js b/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/d3/c3.min.js
deleted file mode 100644
index cdbf2d5a5..000000000
--- a/components/analytics/iot-analytics/org.wso2.carbon.iot.geo.dashboard/src/main/resources/carbonapps/GadgetGeoDashboard_1.0.0/geo-dashboard/js/d3/c3.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-!function(a){"use strict";function b(a){var b=this.internal=new c(this);b.loadConfig(a),b.init(),function d(a,b,c){for(var e in a)b[e]=a[e].bind(c),Object.keys(a[e]).length>0&&d(a[e],b[e],c)}(e,this,this)}function c(b){var c=this;c.d3=a.d3?a.d3:"undefined"!=typeof require?require("d3"):void 0,c.api=b,c.config=c.getDefaultConfig(),c.data={},c.cache={},c.axes={}}function d(a,b){function c(a,b){a.attr("transform",function(a){return"translate("+Math.ceil(b(a)+s)+", 0)"})}function d(a,b){a.attr("transform",function(a){return"translate(0,"+Math.ceil(b(a))+")"})}function e(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function f(a){var b,c,d=[];if(a.ticks)return a.ticks.apply(a,k);for(c=a.domain(),b=Math.ceil(c[0]);b0&&d[0]>0&&d.unshift(d[0]-(d[1]-d[0])),d}function g(){var a,c=m.copy();return b&&(a=m.domain(),c.domain([a[0],a[1]-1])),c}function h(a){return j?j(a):a}function i(i){i.each(function(){function i(a){var b=m(a)+s;return B[0]=0&&C.select(this).style("display",b%z?"none":"block")})}else A.svg.selectAll("."+h.axisX+" .tick text").style("display","block");!D.axis_rotated&&D.axis_x_tick_rotate&&A.rotateTickText(A.axes.x,b.axisX,D.axis_x_tick_rotate),m=A.generateDrawArea?A.generateDrawArea(E,!1):void 0,n=A.generateDrawBar?A.generateDrawBar(F):void 0,o=A.generateDrawLine?A.generateDrawLine(G,!1):void 0,p=A.generateXYForText(F,!0),q=A.generateXYForText(F,!1),A.subY.domain(A.y.domain()),A.subY2.domain(A.y2.domain()),A.tooltip.style("display","none"),A.updateXgridFocus(),B.select("text."+h.text+"."+h.empty).attr("x",A.width/2).attr("y",A.height/2).text(D.data_empty_label_text).transition().style("opacity",I.length?0:1),A.redrawGrid(r,c),A.redrawRegion(r),A.redrawBar(t),A.redrawLine(t),A.redrawArea(t),D.point_show&&A.redrawCircle(),A.hasDataLabel()&&A.redrawText(t),A.redrawArc&&A.redrawArc(r,t,i),A.redrawSubchart&&A.redrawSubchart(d,b,r,t,E,F,G),B.selectAll("."+h.selectedCircles).filter(A.isBarType.bind(A)).selectAll("circle").remove(),D.interaction_enabled&&A.redrawEventRect(),C.transition().duration(r).each(function(){var b=[];A.addTransitionForBar(b,n),A.addTransitionForLine(b,o),A.addTransitionForArea(b,m),D.point_show&&A.addTransitionForCircle(b,K,L),A.addTransitionForText(b,p,q,a.flow),A.addTransitionForRegion(b),A.addTransitionForGrid(b),a.flow&&(v=A.generateWait(),b.forEach(function(a){v.add(a)}),w=A.generateFlow({targets:I,flow:a.flow,duration:r,drawBar:n,drawLine:o,drawArea:m,cx:K,cy:L,xv:J,xForText:p,yForText:q}))}).call(v||function(){},w||function(){}),A.mapToIds(A.data.targets).forEach(function(a){A.withoutFadeIn[a]=!0}),A.updateZoom&&A.updateZoom()},f.updateAndRedraw=function(a){var b,c=this,d=c.config;a=a||{},a.withTransition=s(a,"withTransition",!0),a.withTransform=s(a,"withTransform",!1),a.withLegend=s(a,"withLegend",!1),a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.withTransitionForExit=!1,a.withTransitionForTransform=s(a,"withTransitionForTransform",a.withTransition),c.updateSizes(),a.withLegend&&d.legend_show||(b=c.generateAxisTransitions(a.withTransitionForAxis?d.transition_duration:0),c.updateScales(),c.updateSvgSize(),c.transformAll(a.withTransitionForTransform,b)),c.redraw(a,b)},f.isTimeSeries=function(){return"timeseries"===this.config.axis_x_type},f.isCategorized=function(){return this.config.axis_x_type.indexOf("categor")>=0},f.isCustomX=function(){var a=this,b=a.config;return!a.isTimeSeries()&&(b.data_x||r(b.data_xs))},f.getTranslate=function(a){var b,c,d=this,e=d.config;return"main"===a?(b=o(d.margin.left),c=o(d.margin.top)):"context"===a?(b=o(d.margin2.left),c=o(d.margin2.top)):"legend"===a?(b=d.margin3.left,c=d.margin3.top):"x"===a?(b=0,c=e.axis_rotated?0:d.height):"y"===a?(b=0,c=e.axis_rotated?d.height:0):"y2"===a?(b=e.axis_rotated?0:d.width,c=e.axis_rotated?1:0):"subx"===a?(b=0,c=e.axis_rotated?0:d.height2):"arc"===a&&(b=d.arcWidth/2,c=d.arcHeight/2),"translate("+b+","+c+")"},f.initialOpacity=function(a){return null!==a.value&&this.withoutFadeIn[a.id]?1:0},f.opacityForCircle=function(a){var b=this;return i(a.value)?b.isScatterType(a)?.5:1:0},f.opacityForText=function(){return this.hasDataLabel()?1:0},f.xx=function(a){return a?this.x(a.x):null},f.xv=function(a){var b=this;return Math.ceil(b.x(b.isTimeSeries()?b.parseDate(a.value):a.value))},f.yv=function(a){var b=this,c=a.axis&&"y2"===a.axis?b.y2:b.y;return Math.ceil(c(a.value))},f.subxx=function(a){return a?this.subX(a.x):null},f.transformMain=function(a,b){var c,d,e,f=this;b&&b.axisX?c=b.axisX:(c=f.main.select("."+h.axisX),a&&(c=c.transition())),b&&b.axisY?d=b.axisY:(d=f.main.select("."+h.axisY),a&&(d=d.transition())),b&&b.axisY2?e=b.axisY2:(e=f.main.select("."+h.axisY2),a&&(e=e.transition())),(a?f.main.transition():f.main).attr("transform",f.getTranslate("main")),c.attr("transform",f.getTranslate("x")),d.attr("transform",f.getTranslate("y")),e.attr("transform",f.getTranslate("y2")),f.main.select("."+h.chartArcs).attr("transform",f.getTranslate("arc"))},f.transformAll=function(a,b){var c=this;c.transformMain(a,b),c.config.subchart_show&&c.transformContext(a,b),c.legend&&c.transformLegend(a)},f.updateSvgSize=function(){var a=this;a.svg.attr("width",a.currentWidth).attr("height",a.currentHeight),a.svg.select("#"+a.clipId).select("rect").attr("width",a.width).attr("height",a.height),a.svg.select("#"+a.clipIdForXAxis).select("rect").attr("x",a.getXAxisClipX.bind(a)).attr("y",a.getXAxisClipY.bind(a)).attr("width",a.getXAxisClipWidth.bind(a)).attr("height",a.getXAxisClipHeight.bind(a)),a.svg.select("#"+a.clipIdForYAxis).select("rect").attr("x",a.getYAxisClipX.bind(a)).attr("y",a.getYAxisClipY.bind(a)).attr("width",a.getYAxisClipWidth.bind(a)).attr("height",a.getYAxisClipHeight.bind(a)),a.svg.select("."+h.zoomRect).attr("width",a.width).attr("height",a.height),a.selectChart.style("max-height",a.currentHeight+"px")},f.updateDimension=function(){var a=this;a.config.axis_rotated?(a.axes.x.call(a.xAxis),a.axes.subx.call(a.subXAxis)):(a.axes.y.call(a.yAxis),a.axes.y2.call(a.y2Axis)),a.updateSizes(),a.updateScales(),a.updateSvgSize(),a.transformAll(!1)},f.observeInserted=function(b){var c=this,d=new MutationObserver(function(e){e.forEach(function(e){if("childList"===e.type&&e.previousSibling){d.disconnect();var f=a.setInterval(function(){b.node().parentNode&&(a.clearInterval(f),c.updateDimension(),c.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),b.transition().style("opacity",1))},10)}})});d.observe(b.node(),{attributes:!0,childList:!0,characterData:!0})},f.generateResize=function(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a},f.endall=function(a,b){var c=0;a.each(function(){++c}).each("end",function(){--c||b.apply(this,arguments)})},f.generateWait=function(){var a=[],b=function(b,c){var d=setInterval(function(){var b=0;a.forEach(function(a){if(a.empty())return void(b+=1);try{a.transition()}catch(c){b+=1}}),b===a.length&&(clearInterval(d),c&&c())},10)};return b.add=function(b){a.push(b)},b},f.parseDate=function(b){var c,d=this;return c=b instanceof Date?b:"number"==typeof b?new Date(b):d.dataTimeFormat(d.config.data_xFormat).parse(b),(!c||isNaN(+c))&&a.console.error("Failed to parse x '"+b+"' to Date object"),c},f.getDefaultConfig=function(){var a={bindto:"#chart",size_width:void 0,size_height:void 0,padding_left:void 0,padding_right:void 0,padding_top:void 0,padding_bottom:void 0,zoom_enabled:!1,zoom_extent:void 0,zoom_privileged:!1,zoom_onzoom:function(){},interaction_enabled:!0,onmouseover:function(){},onmouseout:function(){},onresize:function(){},onresized:function(){},transition_duration:350,data_x:void 0,data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_idConverter:function(a){return a},data_names:{},data_classes:{},data_groups:[],data_axes:{},data_type:void 0,data_types:{},data_labels:{},data_order:"desc",data_regions:{},data_color:void 0,data_colors:{},data_hide:!1,data_filter:void 0,data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function(){return!0},data_selection_multiple:!0,data_onclick:function(){},data_onmouseover:function(){},data_onmouseout:function(){},data_onselected:function(){},data_onunselected:function(){},data_ondragstart:function(){},data_ondragend:function(){},data_url:void 0,data_json:void 0,data_rows:void 0,data_columns:void 0,data_mimeType:void 0,data_keys:void 0,data_empty_label_text:"",subchart_show:!1,subchart_size_height:60,subchart_onbrush:function(){},color_pattern:[],color_threshold:{},legend_show:!0,legend_position:"bottom",legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:void 0,legend_item_onclick:void 0,legend_item_onmouseover:void 0,legend_item_onmouseout:void 0,legend_equally:!1,axis_rotated:!1,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:void 0,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_count:void 0,axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_rotate:void 0,axis_x_tick_outer:!0,axis_x_max:null,axis_x_min:null,axis_x_padding:{},axis_x_height:void 0,axis_x_default:void 0,axis_x_label:{},axis_y_show:!0,axis_y_max:void 0,axis_y_min:void 0,axis_y_center:void 0,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_outer:!0,axis_y_padding:void 0,axis_y_ticks:10,axis_y2_show:!1,axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_center:void 0,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_outer:!0,axis_y2_padding:void 0,axis_y2_ticks:10,grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:10,grid_focus_show:!0,point_show:!0,point_r:2.5,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_select_r:void 0,line_connect_null:!1,bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0,area_zerobased:!0,pie_label_show:!0,pie_label_format:void 0,pie_label_threshold:.05,pie_sort:!0,pie_expand:!0,gauge_label_show:!0,gauge_label_format:void 0,gauge_expand:!0,gauge_min:0,gauge_max:100,gauge_units:void 0,gauge_width:void 0,donut_label_show:!0,donut_label_format:void 0,donut_label_threshold:.05,donut_width:void 0,donut_sort:!0,donut_expand:!0,donut_title:"",regions:[],tooltip_show:!0,tooltip_grouped:!0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_contents:function(a,b,c,d){return this.getTooltipContent?this.getTooltipContent(a,b,c,d):""},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"}};return Object.keys(this.additionalConfig).forEach(function(b){a[b]=this.additionalConfig[b]},this),a},f.additionalConfig={},f.loadConfig=function(a){function b(){var a=d.shift();return a&&c&&"object"==typeof c&&a in c?(c=c[a],b()):a?void 0:c}var c,d,e,f=this.config;Object.keys(f).forEach(function(g){c=a,d=g.split("_"),e=b(),m(e)&&(f[g]=e)})},f.getScale=function(a,b,c){return(c?this.d3.time.scale():this.d3.scale.linear()).range([a,b])},f.getX=function(a,b,c,d){var e,f=this,g=f.getScale(a,b,f.isTimeSeries()),h=c?g.domain(c):g;f.isCategorized()?(d=d||function(){return 0},g=function(a,b){var c=h(a)+d(a);return b?c:Math.ceil(c)}):g=function(a,b){var c=h(a);return b?c:Math.ceil(c)};for(e in h)g[e]=h[e];return g.orgDomain=function(){return h.domain()},f.isCategorized()&&(g.domain=function(a){return arguments.length?(h.domain(a),g):(a=this.orgDomain(),[a[0],a[1]+1])}),g},f.getY=function(a,b,c){var d=this.getScale(a,b);return c&&d.domain(c),d},f.getYScale=function(a){return"y2"===this.getAxisId(a)?this.y2:this.y},f.getSubYScale=function(a){return"y2"===this.getAxisId(a)?this.subY2:this.subY},f.updateScales=function(){var a=this,b=a.config,c=!a.x;a.xMin=b.axis_rotated?1:0,a.xMax=b.axis_rotated?a.height:a.width,a.yMin=b.axis_rotated?0:a.height,a.yMax=b.axis_rotated?a.width:1,a.subXMin=a.xMin,a.subXMax=a.xMax,a.subYMin=b.axis_rotated?0:a.height2,a.subYMax=b.axis_rotated?a.width2:1,a.x=a.getX(a.xMin,a.xMax,c?void 0:a.x.orgDomain(),function(){return a.xAxis.tickOffset()}),a.y=a.getY(a.yMin,a.yMax,c?void 0:a.y.domain()),a.y2=a.getY(a.yMin,a.yMax,c?void 0:a.y2.domain()),a.subX=a.getX(a.xMin,a.xMax,a.orgXDomain,function(b){return b%1?0:a.subXAxis.tickOffset()}),a.subY=a.getY(a.subYMin,a.subYMax,c?void 0:a.subY.domain()),a.subY2=a.getY(a.subYMin,a.subYMax,c?void 0:a.subY2.domain()),a.xAxisTickFormat=a.getXAxisTickFormat(),a.xAxisTickValues=b.axis_x_tick_values?b.axis_x_tick_values:c?void 0:a.xAxis.tickValues(),a.xAxis=a.getXAxis(a.x,a.xOrient,a.xAxisTickFormat,a.xAxisTickValues),a.subXAxis=a.getXAxis(a.subX,a.subXOrient,a.xAxisTickFormat,a.xAxisTickValues),a.yAxis=a.getYAxis(a.y,a.yOrient,b.axis_y_tick_format,b.axis_y_ticks),a.y2Axis=a.getYAxis(a.y2,a.y2Orient,b.axis_y2_tick_format,b.axis_y2_ticks),c||(a.brush&&a.brush.scale(a.subX),b.zoom_enabled&&a.zoom.scale(a.x)),a.updateArc&&a.updateArc()},f.getYDomainMin=function(a){var b,c,d,e,f,g,h=this,i=h.config,j=h.mapToIds(a),k=h.getValuesAsIdKeyed(a);if(i.data_groups.length>0)for(g=h.hasNegativeValueInTargets(a),b=0;b=0}),0!==e.length)for(d=e[0],g&&k[d]&&k[d].forEach(function(a,b){k[d][b]=0>a?a:0}),c=1;c0||(k[d][b]+=+a)});return h.d3.min(Object.keys(k).map(function(a){return h.d3.min(k[a])}))},f.getYDomainMax=function(a){var b,c,d,e,f,g,h=this,i=h.config,j=h.mapToIds(a),k=h.getValuesAsIdKeyed(a);if(i.data_groups.length>0)for(g=h.hasPositiveValueInTargets(a),b=0;b=0}),0!==e.length)for(d=e[0],g&&k[d]&&k[d].forEach(function(a,b){k[d][b]=a>0?a:0}),c=1;c+a||(k[d][b]+=+a)});return h.d3.max(Object.keys(k).map(function(a){return h.d3.max(k[a])}))},f.getYDomain=function(a,b){var c,d,e,f,g,h,j,k,l,m,n=this,o=n.config,q=a.filter(function(a){return n.getAxisId(a.id)===b}),r="y2"===b?o.axis_y2_min:o.axis_y_min,s="y2"===b?o.axis_y2_max:o.axis_y_max,t=i(r)?r:n.getYDomainMin(q),u=i(s)?s:n.getYDomainMax(q),v="y2"===b?o.axis_y2_center:o.axis_y_center,w=n.hasType("bar",q)&&o.bar_zerobased||n.hasType("area",q)&&o.area_zerobased,x=n.hasDataLabel()&&o.axis_rotated,y=n.hasDataLabel()&&!o.axis_rotated;return 0===q.length?"y2"===b?n.y2.domain():n.y.domain():(t===u&&(0>t?u=0:t=0),l=t>=0&&u>=0,m=0>=t&&0>=u,w&&(l&&(t=0),m&&(u=0)),c=Math.abs(u-t),d=e=f=.1*c,v&&(g=Math.max(Math.abs(t),Math.abs(u)),u=g-v,t=v-g),x?(h=n.getDataLabelLength(t,u,b,"width"),j=p(n.y.range()),k=[h[0]/j,h[1]/j],e+=c*(k[1]/(1-k[0]-k[1])),f+=c*(k[0]/(1-k[0]-k[1]))):y&&(h=n.getDataLabelLength(t,u,b,"height"),e+=h[1],f+=h[0]),"y"===b&&o.axis_y_padding&&(e=n.getAxisPadding(o.axis_y_padding,"top",d,c),f=n.getAxisPadding(o.axis_y_padding,"bottom",d,c)),"y2"===b&&o.axis_y2_padding&&(e=n.getAxisPadding(o.axis_y2_padding,"top",d,c),f=n.getAxisPadding(o.axis_y2_padding,"bottom",d,c)),w&&(l&&(f=t),m&&(e=-u)),[t-f,u+e])},f.getXDomainMin=function(a){var b=this,c=b.config;return c.axis_x_min?b.isTimeSeries()?this.parseDate(c.axis_x_min):c.axis_x_min:b.d3.min(a,function(a){return b.d3.min(a.values,function(a){return a.x})})},f.getXDomainMax=function(a){var b=this,c=b.config;return c.axis_x_max?b.isTimeSeries()?this.parseDate(c.axis_x_max):c.axis_x_max:b.d3.max(a,function(a){return b.d3.max(a.values,function(a){return a.x})})},f.getXDomainPadding=function(a){var b,c,d,e,f=this,g=f.config,h=this.getEdgeX(a),j=h[1]-h[0];return f.isCategorized()?c=0:f.hasType("bar",a)?(b=f.getMaxDataCount(),c=b>1?j/(b-1)/2:.5):c=.01*j,"object"==typeof g.axis_x_padding&&r(g.axis_x_padding)?(d=i(g.axis_x_padding.left)?g.axis_x_padding.left:c,e=i(g.axis_x_padding.right)?g.axis_x_padding.right:c):d=e="number"==typeof g.axis_x_padding?g.axis_x_padding:c,{left:d,right:e}},f.getXDomain=function(a){var b=this,c=[b.getXDomainMin(a),b.getXDomainMax(a)],d=c[0],e=c[1],f=b.getXDomainPadding(a),g=0,h=0;return d-e!==0||b.isCategorized()||(d=b.isTimeSeries()?new Date(.5*d.getTime()):-.5,e=b.isTimeSeries()?new Date(1.5*e.getTime()):.5),(d||0===d)&&(g=b.isTimeSeries()?new Date(d.getTime()-f.left):d-f.left),(e||0===e)&&(h=b.isTimeSeries()?new Date(e.getTime()+f.right):e+f.right),[g,h]},f.updateXDomain=function(a,b,c,d){var e=this,f=e.config;return c&&(e.x.domain(d?d:e.d3.extent(e.getXDomain(a))),e.orgXDomain=e.x.domain(),f.zoom_enabled&&e.zoom.scale(e.x).updateScaleExtent(),e.subX.domain(e.x.domain()),e.brush&&e.brush.scale(e.subX)),b&&(e.x.domain(d?d:!e.brush||e.brush.empty()?e.orgXDomain:e.brush.extent()),f.zoom_enabled&&e.zoom.scale(e.x).updateScaleExtent()),e.x.domain()},f.isX=function(a){var b=this,c=b.config;return c.data_x&&a===c.data_x||r(c.data_xs)&&t(c.data_xs,a)},f.isNotX=function(a){return!this.isX(a)},f.getXKey=function(a){var b=this,c=b.config;return c.data_x?c.data_x:r(c.data_xs)?c.data_xs[a]:null},f.getXValuesOfXKey=function(a,b){var c,d=this,e=b&&r(b)?d.mapToIds(b):[];return e.forEach(function(b){d.getXKey(b)===a&&(c=d.data.xs[b])}),c},f.getXValue=function(a,b){var c=this;return a in c.data.xs&&c.data.xs[a]&&i(c.data.xs[a][b])?c.data.xs[a][b]:b},f.getOtherTargetXs=function(){var a=this,b=Object.keys(a.data.xs);return b.length?a.data.xs[b[0]]:null},f.getOtherTargetX=function(a){var b=this.getOtherTargetXs();return b&&a1},f.isMultipleX=function(){var a=this,b=a.config;return r(b.data_xs)&&a.hasMultipleX(b.data_xs)},f.addName=function(a){var b,c=this;return a&&(b=c.config.data_names[a.id],a.name=b?b:a.id),a},f.getValueOnIndex=function(a,b){var c=a.filter(function(a){return a.index===b});return c.length?c[0]:null},f.updateTargetX=function(a,b){var c=this;a.forEach(function(a){a.values.forEach(function(d,e){d.x=c.generateTargetX(b[e],a.id,e)}),c.data.xs[a.id]=b})},f.updateTargetXs=function(a,b){var c=this;a.forEach(function(a){b[a.id]&&c.updateTargetX([a],b[a.id])})},f.generateTargetX=function(a,b,c){var d,e=this;return d=e.isTimeSeries()?e.parseDate(a?a:e.getXValue(b,c)):e.isCustomX()&&!e.isCategorized()?i(a)?+a:e.getXValue(b,c):c},f.cloneTarget=function(a){return{id:a.id,id_org:a.id_org,values:a.values.map(function(a){return{x:a.x,value:a.value,id:a.id}})}},f.getPrevX=function(a){var b=this,c=b.getValueOnIndex(b.data.targets[0].values,a-1);return c?c.x:null},f.getNextX=function(a){var b=this,c=b.getValueOnIndex(b.data.targets[0].values,a+1);return c?c.x:null},f.getMaxDataCount=function(){var a=this;return a.d3.max(a.data.targets,function(a){return a.values.length})},f.getMaxDataCountTarget=function(a){var b,c=a.length,d=0;return c>1?a.forEach(function(a){a.values.length>d&&(b=a,d=a.values.length)}):b=c?a[0]:null,b},f.getEdgeX=function(a){var b,c,d=this.getMaxDataCountTarget(a);return d?(b=d.values[0],c=d.values[d.values.length-1],[b.x,c.x]):[0,0]},f.mapToIds=function(a){return a.map(function(a){return a.id})},f.mapToTargetIds=function(a){var b=this;return a?k(a)?[a]:a:b.mapToIds(b.data.targets)},f.hasTarget=function(a,b){var c,d=this.mapToIds(a);for(c=0;ca})},f.hasPositiveValueInTargets=function(a){return this.checkValueInTargets(a,function(a){return a>0})},f.isOrderDesc=function(){var a=this.config;return a.data_order&&"desc"===a.data_order.toLowerCase()},f.isOrderAsc=function(){var a=this.config;return a.data_order&&"asc"===a.data_order.toLowerCase()},f.orderTargets=function(a){var b=this,c=b.config,d=b.isOrderAsc(),e=b.isOrderDesc();return d||e?a.sort(function(a,b){var c=function(a,b){return a+Math.abs(b.value)},e=a.values.reduce(c,0),f=b.values.reduce(c,0);return d?f-e:e-f}):j(c.data_order)&&a.sort(c.data_order),a
-},f.filterSameX=function(a,b){return this.d3.merge(a.map(function(a){return a.values})).filter(function(a){return a.x-b===0})},f.filterRemoveNull=function(a){return a.filter(function(a){return i(a.value)})},f.hasDataLabel=function(){var a=this.config;return"boolean"==typeof a.data_labels&&a.data_labels?!0:"object"==typeof a.data_labels&&r(a.data_labels)?!0:!1},f.getDataLabelLength=function(a,b,c,d){var e=this,f=[0,0],g=1.3;return e.selectChart.select("svg").selectAll(".dummy").data([a,b]).enter().append("text").text(function(a){return e.formatByAxisId(c)(a)}).each(function(a,b){f[b]=this.getBoundingClientRect()[d]*g}).remove(),f},f.isNoneArc=function(a){return this.hasTarget(this.data.targets,a.id)},f.isArc=function(a){return"data"in a&&this.hasTarget(this.data.targets,a.data.id)},f.findSameXOfValues=function(a,b){var c,d=a[b].x,e=[];for(c=b-1;c>=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;c0?h=i:g=i,h-g===1||0===g&&0===h?(e=[],(a[g].x||0===a[g].x)&&(e=e.concat(f.findSameXOfValues(a,g))),(a[h].x||0===a[h].x)&&(e=e.concat(f.findSameXOfValues(a,h))),f.findClosest(e,b)):f.findClosestOfValues(a,b,g,h)},f.findClosestFromTargets=function(a,b){var c,d=this;return c=a.map(function(a){return d.findClosestOfValues(a.values,b)}),d.findClosest(c,b)},f.findClosest=function(a,b){var c,d,e=this;return a.forEach(function(a){var f=e.dist(a,b);(c>f||!c)&&(c=f,d=a)}),d},f.dist=function(a,b){var c=this,d=c.config,e="y"===c.getAxisId(a.id)?c.y:c.y2,f=d.axis_rotated?1:0,g=d.axis_rotated?0:1;return Math.pow(c.x(a.x)-b[f],2)+Math.pow(e(a.value)-b[g],2)},f.convertUrlToData=function(a,b,c,d){var e=this,f=b?b:"csv";e.d3.xhr(a,function(a,b){var g;g="json"===f?e.convertJsonToData(JSON.parse(b.response),c):e.convertCsvToData(b.response),d.call(e,g)})},f.convertCsvToData=function(a){var b,c=this.d3,d=c.csv.parseRows(a);return 1===d.length?(b=[{}],d[0].forEach(function(a){b[0][a]=null})):b=c.csv.parse(a),b},f.convertJsonToData=function(a,b){var c,d,e=this,f=[];return b?(c=b.value,b.x&&(c.push(b.x),e.config.data_x=b.x),f.push(c),a.forEach(function(a){var b=[];c.forEach(function(c){var d=l(a[c])?null:a[c];b.push(d)}),f.push(b)}),d=e.convertRowsToData(f)):(Object.keys(a).forEach(function(b){f.push([b].concat(a[b]))}),d=e.convertColumnsToData(f)),d},f.convertRowsToData=function(a){var b,c,d=a[0],e={},f=[];for(b=1;b=0?d.data.xs[c]=(b&&d.data.xs[c]?d.data.xs[c]:[]).concat(a.map(function(a){return a[f]}).filter(i).map(function(a,b){return d.generateTargetX(a,c,b)})):e.data_x?d.data.xs[c]=d.getOtherTargetXs():r(e.data_xs)&&(d.data.xs[c]=d.getXValuesOfXKey(f,d.data.targets)):d.data.xs[c]=a.map(function(a,b){return b})}),f.forEach(function(a){if(!d.data.xs[a])throw new Error('x is not defined for id = "'+a+'".')}),c=f.map(function(b,c){var f=e.data_idConverter(b);return{id:f,id_org:b,values:a.map(function(a,g){var h=d.getXKey(b),i=a[h],j=d.generateTargetX(i,b,g);return d.isCustomX()&&d.isCategorized()&&0===c&&i&&(0===g&&(e.axis_x_categories=[]),e.axis_x_categories.push(i)),(l(a[b])||d.data.xs[b].length<=g)&&(j=void 0),{x:j,value:null===a[b]||isNaN(a[b])?null:+a[b],id:f}}).filter(function(a){return m(a.x)})}}),c.forEach(function(a){var b;a.values=a.values.sort(function(a,b){var c=a.x||0===a.x?a.x:1/0,d=b.x||0===b.x?b.x:1/0;return c-d}),b=0,a.values.forEach(function(a){a.index=b++}),d.data.xs[a.id].sort(function(a,b){return a-b})}),e.data_type&&d.setTargetType(d.mapToIds(c).filter(function(a){return!(a in e.data_types)}),e.data_type),c.forEach(function(a){d.addCache(a.id_org,a)}),c},f.load=function(a,b){var c=this;a&&(b.filter&&(a=a.filter(b.filter)),(b.type||b.types)&&a.forEach(function(a){c.setTargetType(a.id,b.types?b.types[a.id]:b.type)}),c.data.targets.forEach(function(b){for(var c=0;ce?0:e},g=function(a){var b=h.getPrevX(a.index),c=h.data.xs[a.id][a.index];return(h.x(c)+h.x(b?b:c))/2}),b=i.axis_rotated?0:g,c=i.axis_rotated?g:0,d=i.axis_rotated?h.width:f,e=i.axis_rotated?f:h.height),a.attr("class",h.classEvent.bind(h)).attr("x",b).attr("y",c).attr("width",d).attr("height",e)},f.generateEventRectsForSingleX=function(a){var b=this,c=b.d3,d=b.config;a.append("rect").attr("class",b.classEvent.bind(b)).style("cursor",d.data_selection_enabled&&d.data_selection_grouped?"pointer":null).on("mouseover",function(a){var c,e,f=a.index;b.dragging||b.hasArcType()||(c=b.data.targets.map(function(a){return b.addName(b.getValueOnIndex(a.values,f))}),e=[],Object.keys(d.data_names).forEach(function(a){for(var b=0;b0?c:320},f.getCurrentPaddingTop=function(){var a=this.config;return i(a.padding_top)?a.padding_top:0},f.getCurrentPaddingBottom=function(){var a=this.config;return i(a.padding_bottom)?a.padding_bottom:0},f.getCurrentPaddingLeft=function(){var a=this,b=a.config;return i(b.padding_left)?b.padding_left:b.axis_rotated?b.axis_x_show?Math.max(n(a.getAxisWidthByAxisId("x")),40):1:b.axis_y_show?n(a.getAxisWidthByAxisId("y")):1},f.getCurrentPaddingRight=function(){var a=this,b=a.config,c=10,d=a.isLegendRight?a.getLegendWidth()+20:0;return i(b.padding_right)?b.padding_right+1:b.axis_rotated?c+d:(b.axis_y2_show?n(a.getAxisWidthByAxisId("y2")):c)+d},f.getParentRectValue=function(a){for(var b,c=this.selectChart.node();c&&"BODY"!==c.tagName&&!(b=c.getBoundingClientRect()[a]);)c=c.parentNode;return b},f.getParentWidth=function(){return this.getParentRectValue("width")},f.getParentHeight=function(){var a=this.selectChart.style("height");return a.indexOf("px")>0?+a.replace("px",""):0},f.getSvgLeft=function(){var a=this,b=a.config,c=b.axis_rotated?h.axisX:h.axisY,d=a.main.select("."+c).node(),e=d?d.getBoundingClientRect():{right:0},f=a.selectChart.node().getBoundingClientRect(),g=a.hasArcType(),i=e.right-f.left-(g?0:a.getCurrentPaddingLeft());return i>0?i:0},f.getAxisWidthByAxisId=function(a){var b=this,c=b.getAxisLabelPositionById(a);return c.isInner?20+b.getMaxTickWidth(a):40+b.getMaxTickWidth(a)},f.getHorizontalAxisHeight=function(a){var b=this,c=b.config;return"x"!==a||c.axis_x_show?"x"===a&&c.axis_x_height?c.axis_x_height:"y"!==a||c.axis_y_show?"y2"!==a||c.axis_y2_show?(b.getAxisLabelPositionById(a).isInner?30:40)+("y2"===a?-10:0):b.rotated_padding_top:!c.legend_show||b.isLegendRight||b.isLegendInset?1:10:0},f.getEventRectWidth=function(){var a,b,c,d,e,f,g=this,h=g.getMaxDataCountTarget(g.data.targets);return h?(a=h.values[0],b=h.values[h.values.length-1],c=g.x(b.x)-g.x(a.x),0===c?g.config.axis_rotated?g.height:g.width:(d=g.getMaxDataCount(),e=g.hasType("bar")?(d-(g.isCategorized()?.25:1))/d:1,f=d>1?c*e/(d-1):c,1>f?1:f)):0},f.getShapeIndices=function(a){var b,c,d=this,e=d.config,f={},g=0;return d.filterTargetsToShow(d.data.targets.filter(a,d)).forEach(function(a){for(b=0;b=0&&(j+=h(c.values[g].value)-i)}),j}},f.getInterpolate=function(a){var b=this;return b.isSplineType(a)?"cardinal":b.isStepType(a)?"step-after":"linear"},f.initLine=function(){var a=this;a.main.select("."+h.chart).append("g").attr("class",h.chartLines)},f.updateTargetsForLine=function(a){var b,c,d=this,e=d.config,f=d.classChartLine.bind(d),g=d.classLines.bind(d),i=d.classAreas.bind(d),j=d.classCircles.bind(d);b=d.main.select("."+h.chartLines).selectAll("."+h.chartLine).data(a).attr("class",f),c=b.enter().append("g").attr("class",f).style("opacity",0).style("pointer-events","none"),c.append("g").attr("class",g),c.append("g").attr("class",i),c.append("g").attr("class",function(a){return d.generateClass(h.selectedCircles,a.id)}),c.append("g").attr("class",j).style("cursor",function(a){return e.data_selection_isselectable(a)?"pointer":null}),a.forEach(function(a){d.main.selectAll("."+h.selectedCircles+d.getTargetSelectorSuffix(a.id)).selectAll("."+h.selectedCircle).each(function(b){b.value=a.values[b.index].value})})},f.redrawLine=function(a){var b=this;b.mainLine=b.main.selectAll("."+h.lines).selectAll("."+h.line).data(b.lineData.bind(b)),b.mainLine.enter().append("path").attr("class",b.classLine.bind(b)).style("stroke",b.color),b.mainLine.style("opacity",b.initialOpacity.bind(b)).attr("transform",null),b.mainLine.exit().transition().duration(a).style("opacity",0).remove()},f.addTransitionForLine=function(a,b){var c=this;a.push(c.mainLine.transition().attr("d",b).style("stroke",c.color).style("opacity",1))},f.generateDrawLine=function(a,b){var c=this,d=c.config,e=c.d3.svg.line(),f=c.generateGetLinePoint(a,b),g=b?c.getSubYScale:c.getYScale,h=function(a){return(b?c.subxx:c.xx).call(c,a)},i=function(a,b){return d.data_groups.length>0?f(a,b)[0][1]:g.call(c,a.id)(a.value)};return e=d.axis_rotated?e.x(i).y(h):e.x(h).y(i),d.line_connect_null||(e=e.defined(function(a){return null!=a.value})),function(a){var f,h=d.line_connect_null?c.filterRemoveNull(a.values):a.values,i=b?c.x:c.subX,j=g.call(c,a.id),k=0,l=0;return c.isLineType(a)?f=d.data_regions[a.id]?c.lineWithRegions(h,i,j,d.data_regions[a.id]):e.interpolate(c.getInterpolate(a))(h):(h[0]&&(k=i(h[0].x),l=j(h[0].value)),f=d.axis_rotated?"M "+l+" "+k:"M "+k+" "+l),f?f:"M 0 0"}},f.generateGetLinePoint=function(a,b){var c=this,d=c.config,e=a.__max__+1,f=c.getShapeX(0,e,a,!!b),g=c.getShapeY(!!b),h=c.getShapeOffset(c.isLineType,a,!!b),i=b?c.getSubYScale:c.getYScale;return function(a,b){var e=i.call(c,a.id)(0),j=h(a,b)||e,k=f(a),l=g(a);return d.axis_rotated&&(0l||a.value<0&&l>e)&&(l=e),[[k,l-(e-j)]]}},f.lineWithRegions=function(a,b,c,d){function e(a,b){var c;for(c=0;c=g;g+=q)w+=h(a[f-1],a[f],g,p);v=a[f].x}return w},f.redrawArea=function(a){var b=this,c=b.d3;b.mainArea=b.main.selectAll("."+h.areas).selectAll("."+h.area).data(b.lineData.bind(b)),b.mainArea.enter().append("path").attr("class",b.classArea.bind(b)).style("fill",b.color).style("opacity",function(){return b.orgAreaOpacity=+c.select(this).style("opacity"),0}),b.mainArea.style("opacity",b.orgAreaOpacity),b.mainArea.exit().transition().duration(a).style("opacity",0).remove()},f.addTransitionForArea=function(a,b){var c=this;a.push(c.mainArea.transition().attr("d",b).style("fill",c.color).style("opacity",c.orgAreaOpacity))},f.generateDrawArea=function(a,b){var c=this,d=c.config,e=c.d3.svg.area(),f=c.generateGetAreaPoint(a,b),g=b?c.getSubYScale:c.getYScale,h=function(a){return(b?c.subxx:c.xx).call(c,a)},i=function(a,b){return d.data_groups.length>0?f(a,b)[0][1]:g.call(c,a.id)(0)},j=function(a,b){return d.data_groups.length>0?f(a,b)[1][1]:g.call(c,a.id)(a.value)};return e=d.axis_rotated?e.x0(i).x1(j).y(h):e.x(h).y0(i).y1(j),d.line_connect_null||(e=e.defined(function(a){return null!==a.value})),function(a){var b,f=d.line_connect_null?c.filterRemoveNull(a.values):a.values,g=0,h=0;return c.isAreaType(a)?b=e.interpolate(c.getInterpolate(a))(f):(f[0]&&(g=c.x(f[0].x),h=c.getYScale(a.id)(f[0].value)),b=d.axis_rotated?"M "+h+" "+g:"M "+g+" "+h),b?b:"M 0 0"}},f.generateGetAreaPoint=function(a,b){var c=this,d=c.config,e=a.__max__+1,f=c.getShapeX(0,e,a,!!b),g=c.getShapeY(!!b),h=c.getShapeOffset(c.isAreaType,a,!!b),i=b?c.getSubYScale:c.getYScale;return function(a,b){var e=i.call(c,a.id)(0),j=h(a,b)||e,k=f(a),l=g(a);return d.axis_rotated&&(0l||a.value<0&&l>e)&&(l=e),[[k,j],[k,l-(e-j)]]}},f.redrawCircle=function(){var a=this;a.mainCircle=a.main.selectAll("."+h.circles).selectAll("."+h.circle).data(a.lineOrScatterData.bind(a)),a.mainCircle.enter().append("circle").attr("class",a.classCircle.bind(a)).attr("r",a.pointR.bind(a)).style("fill",a.color),a.mainCircle.style("opacity",a.initialOpacity.bind(a)),a.mainCircle.exit().remove()},f.addTransitionForCircle=function(a,b,c){var d=this;a.push(d.mainCircle.transition().style("opacity",d.opacityForCircle.bind(d)).style("fill",d.color).attr("cx",b).attr("cy",c)),a.push(d.main.selectAll("."+h.selectedCircle).transition().attr("cx",b).attr("cy",c))},f.circleX=function(a){return a.x||0===a.x?this.x(a.x):null},f.circleY=function(a,b){var c=this,d=c.getShapeIndices(c.isLineType),e=c.generateGetLinePoint(d);return c.config.data_groups.length>0?e(a,b)[0][1]:c.getYScale(a.id)(a.value)},f.getCircles=function(a,b){var c=this;return(b?c.main.selectAll("."+h.circles+c.getTargetSelectorSuffix(b)):c.main).selectAll("."+h.circle+(i(a)?"-"+a:""))},f.expandCircles=function(a,b){var c=this,d=c.pointExpandedR.bind(c);c.getCircles(a,b).classed(h.EXPANDED,!0).attr("r",d)},f.unexpandCircles=function(a){var b=this,c=b.pointR.bind(b);b.getCircles(a).filter(function(){return b.d3.select(this).classed(h.EXPANDED)}).classed(h.EXPANDED,!1).attr("r",c)},f.pointR=function(a){var b=this,c=b.config;return c.point_show&&!b.isStepType(a)?j(c.point_r)?c.point_r(a):c.point_r:0},f.pointExpandedR=function(a){var b=this,c=b.config;return c.point_focus_expand_enabled?c.point_focus_expand_r?c.point_focus_expand_r:1.75*b.pointR(a):b.pointR(a)},f.pointSelectR=function(a){var b=this,c=b.config;return c.point_select_r?c.point_select_r:4*b.pointR(a)},f.isWithinCircle=function(a,b){var c=this.d3,d=c.mouse(a),e=c.select(a),f=1*e.attr("cx"),g=1*e.attr("cy");return Math.sqrt(Math.pow(f-d[0],2)+Math.pow(g-d[1],2))d.bar_width_max?d.bar_width_max:e},f.getBars=function(a){var b=this;return b.main.selectAll("."+h.bar+(i(a)?"-"+a:""))},f.expandBars=function(a){var b=this;b.getBars(a).classed(h.EXPANDED,!0)},f.unexpandBars=function(a){var b=this;b.getBars(a).classed(h.EXPANDED,!1)},f.generateDrawBar=function(a,b){var c=this,d=c.config,e=c.generateGetBarPoints(a,b);return function(a,b){var c=e(a,b),f=d.axis_rotated?1:0,g=d.axis_rotated?0:1,h="M "+c[0][f]+","+c[0][g]+" L"+c[1][f]+","+c[1][g]+" L"+c[2][f]+","+c[2][g]+" L"+c[3][f]+","+c[3][g]+" z";return h}},f.generateGetBarPoints=function(a,b){var c=this,d=a.__max__+1,e=c.getBarW(c.xAxis,d),f=c.getShapeX(e,d,a,!!b),g=c.getShapeY(!!b),h=c.getShapeOffset(c.isBarType,a,!!b),i=b?c.getSubYScale:c.getYScale;return function(a,b){var d=i.call(c,a.id)(0),j=h(a,b)||d,k=f(a),l=g(a);return c.config.axis_rotated&&(0l||a.value<0&&l>d)&&(l=d),[[k,j],[k,l-(d-j)],[k+e,l-(d-j)],[k+e,j]]}},f.isWithinBar=function(a){var b=this.d3,c=b.mouse(a),d=a.getBoundingClientRect(),e=a.pathSegList.getItem(0),f=a.pathSegList.getItem(1),g=e.x,h=Math.min(e.y,f.y),i=d.width,j=d.height,k=2,l=g-k,m=g+i+k,n=h+j+k,o=h-k;return lf.width?f.width-g.width:d},f.getYForText=function(a,b,c){var d,e=this,f=c.getBoundingClientRect();return d=e.config.axis_rotated?(a[0][0]+a[2][0]+.6*f.height)/2:a[2][1]+(b.value<0?f.height:e.isBarType(b)?-3:-6),d=0||!(b.id in d)&&"line"===a)&&(e=!0)}),e},f.hasArcType=function(a){return this.hasType("pie",a)||this.hasType("donut",a)||this.hasType("gauge",a)},f.isLineType=function(a){var b=this.config,c=k(a)?a:a.id;return!b.data_types[c]||["line","spline","area","area-spline","step","area-step"].indexOf(b.data_types[c])>=0},f.isStepType=function(a){var b=k(a)?a:a.id;return["step","area-step"].indexOf(this.config.data_types[b])>=0},f.isSplineType=function(a){var b=k(a)?a:a.id;return["spline","area-spline"].indexOf(this.config.data_types[b])>=0},f.isAreaType=function(a){var b=k(a)?a:a.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[b])>=0},f.isBarType=function(a){var b=k(a)?a:a.id;return"bar"===this.config.data_types[b]},f.isScatterType=function(a){var b=k(a)?a:a.id;return"scatter"===this.config.data_types[b]},f.isPieType=function(a){var b=k(a)?a:a.id;return"pie"===this.config.data_types[b]},f.isGaugeType=function(a){var b=k(a)?a:a.id;return"gauge"===this.config.data_types[b]},f.isDonutType=function(a){var b=k(a)?a:a.id;return"donut"===this.config.data_types[b]},f.isArcType=function(a){return this.isPieType(a)||this.isDonutType(a)||this.isGaugeType(a)},f.lineData=function(a){return this.isLineType(a)?[a]:[]},f.arcData=function(a){return this.isArcType(a.data)?[a]:[]},f.barData=function(a){return this.isBarType(a)?a.values:[]},f.lineOrScatterData=function(a){return this.isLineType(a)||this.isScatterType(a)?a.values:[]},f.barOrLineData=function(a){return this.isBarType(a)||this.isLineType(a)?a.values:[]},f.initGrid=function(){var a=this,b=a.config,c=a.d3;a.grid=a.main.append("g").attr("clip-path",a.clipPath).attr("class",h.grid),b.grid_x_show&&a.grid.append("g").attr("class",h.xgrids),b.grid_y_show&&a.grid.append("g").attr("class",h.ygrids),a.grid.append("g").attr("class",h.xgridLines),a.grid.append("g").attr("class",h.ygridLines),b.grid_focus_show&&a.grid.append("g").attr("class",h.xgridFocus).append("line").attr("class",h.xgridFocus),a.xgrid=c.selectAll([]),a.xgridLines=c.selectAll([])},f.updateXGrid=function(a){var b=this,c=b.config,d=b.d3,e=b.generateGridData(c.grid_x_type,b.x),f=b.isCategorized()?b.xAxis.tickOffset():0;b.xgridAttr=c.axis_rotated?{x1:0,x2:b.width,y1:function(a){return b.x(a)-f},y2:function(a){return b.x(a)-f}}:{x1:function(a){return b.x(a)+f},x2:function(a){return b.x(a)+f},y1:0,y2:b.height},b.xgrid=b.main.select("."+h.xgrids).selectAll("."+h.xgrid).data(e),b.xgrid.enter().append("line").attr("class",h.xgrid),a||b.xgrid.attr(b.xgridAttr).style("opacity",function(){return+d.select(this).attr(c.axis_rotated?"y1":"x1")===(c.axis_rotated?b.height:0)?0:1}),b.xgrid.exit().remove()},f.updateYGrid=function(){var a=this,b=a.config;a.ygrid=a.main.select("."+h.ygrids).selectAll("."+h.ygrid).data(a.y.ticks(b.grid_y_ticks)),a.ygrid.enter().append("line").attr("class",h.ygrid),a.ygrid.attr("x1",b.axis_rotated?a.y:0).attr("x2",b.axis_rotated?a.y:a.width).attr("y1",b.axis_rotated?0:a.y).attr("y2",b.axis_rotated?a.height:a.y),a.ygrid.exit().remove(),a.smoothLines(a.ygrid,"grid")},f.redrawGrid=function(a,b){var c,d,e,f=this,g=f.main,i=f.config;g.select("line."+h.xgridFocus).style("visibility","hidden"),i.grid_x_show&&f.updateXGrid(),f.xgridLines=g.select("."+h.xgridLines).selectAll("."+h.xgridLine).data(i.grid_x_lines),c=f.xgridLines.enter().append("g").attr("class",function(a){return h.xgridLine+(a.class?" "+a.class:"")}),c.append("line").style("opacity",0),c.append("text").attr("text-anchor","end").attr("transform",i.axis_rotated?"":"rotate(-90)").attr("dx",i.axis_rotated?0:-f.margin.top).attr("dy",-5).style("opacity",0),f.xgridLines.exit().transition().duration(a).style("opacity",0).remove(),b&&i.grid_y_show&&f.updateYGrid(),b&&(f.ygridLines=g.select("."+h.ygridLines).selectAll("."+h.ygridLine).data(i.grid_y_lines),d=f.ygridLines.enter().append("g").attr("class",function(a){return h.ygridLine+(a.class?" "+a.class:"")}),d.append("line").style("opacity",0),d.append("text").attr("text-anchor","end").attr("transform",i.axis_rotated?"rotate(-90)":"").attr("dx",i.axis_rotated?0:-f.margin.top).attr("dy",-5).style("opacity",0),e=f.yv.bind(f),f.ygridLines.select("line").transition().duration(a).attr("x1",i.axis_rotated?e:0).attr("x2",i.axis_rotated?e:f.width).attr("y1",i.axis_rotated?0:e).attr("y2",i.axis_rotated?f.height:e).style("opacity",1),f.ygridLines.select("text").transition().duration(a).attr("x",i.axis_rotated?0:f.width).attr("y",e).text(function(a){return a.text}).style("opacity",1),f.ygridLines.exit().transition().duration(a).style("opacity",0).remove())},f.addTransitionForGrid=function(a){var b=this,c=b.config,d=b.xv.bind(b);a.push(b.xgridLines.select("line").transition().attr("x1",c.axis_rotated?0:d).attr("x2",c.axis_rotated?b.width:d).attr("y1",c.axis_rotated?d:b.margin.top).attr("y2",c.axis_rotated?d:b.height).style("opacity",1)),a.push(b.xgridLines.select("text").transition().attr("x",c.axis_rotated?b.width:0).attr("y",d).text(function(a){return a.text}).style("opacity",1))},f.showXGridFocus=function(a){var b=this,c=b.config,d=a.filter(function(a){return a&&i(a.value)}),e=b.main.selectAll("line."+h.xgridFocus),f=b.xx.bind(b);c.tooltip_show&&(b.hasType("scatter")||b.hasArcType()||(e.style("visibility","visible").data([d[0]]).attr(c.axis_rotated?"y1":"x1",f).attr(c.axis_rotated?"y2":"x2",f),b.smoothLines(e,"grid")))},f.hideXGridFocus=function(){this.main.select("line."+h.xgridFocus).style("visibility","hidden")},f.updateXgridFocus=function(){var a=this,b=a.config;a.main.select("line."+h.xgridFocus).attr("x1",b.axis_rotated?0:-10).attr("x2",b.axis_rotated?a.width:-10).attr("y1",b.axis_rotated?-10:0).attr("y2",b.axis_rotated?-10:a.height)},f.generateGridData=function(a,b){var c,d,e,f,g=this,i=[],j=g.main.select("."+h.axisX).selectAll(".tick").size();if("year"===a)for(c=g.getXDomain(),d=c[0].getFullYear(),e=c[1].getFullYear(),f=d;e>=f;f++)i.push(new Date(f+"-01-01 00:00:00"));
-else i=b.ticks(10),i.length>j&&(i=i.filter(function(a){return(""+a).indexOf(".")<0}));return i},f.getGridFilterToRemove=function(a){return a?function(b){var c=!1;return[].concat(a).forEach(function(d){("value"in d&&b.value===a.value||"class"in d&&b.class===a.class)&&(c=!0)}),c}:function(){return!0}},f.removeGridLines=function(a,b){var c=this,d=c.config,e=c.getGridFilterToRemove(a),f=function(a){return!e(a)},g=b?h.xgridLines:h.ygridLines,i=b?h.xgridLine:h.ygridLine;c.main.select("."+g).selectAll("."+i).filter(e).transition().duration(d.transition_duration).style("opacity",0).remove(),b?d.grid_x_lines=d.grid_x_lines.filter(f):d.grid_y_lines=d.grid_y_lines.filter(f)},f.initTooltip=function(){var a,b=this,c=b.config;if(b.tooltip=b.selectChart.style("position","relative").append("div").style("position","absolute").style("pointer-events","none").style("z-index","10").style("display","none"),c.tooltip_init_show){if(b.isTimeSeries()&&k(c.tooltip_init_x)){for(c.tooltip_init_x=b.parseDate(c.tooltip_init_x),a=0;a"+(g||0===g?"
";document.getElementById(a).innerHTML=d,this.view=b},number.prototype.insert=function(a){document.getElementById(this.view).innerHTML=a[a.length-1][this.metadata.names[this.config.x]]};var scatter=function(a,b){this.metadata=a[0].metadata;var c=[];this.spec={},b=checkConfig(b,this.metadata),this.config=b,a[0].name=b.title;var d={name:"size",type:"linear",range:[0,576],domain:{data:b.title,field:this.metadata.names[b.size]}},e={name:"color",type:this.metadata.types[b.color],range:b.colorScale,domain:{data:b.title,field:this.metadata.names[b.color]}},f=getXYScales(b,this.metadata);f.push(d),f.push(e);var g=getXYAxes(b,"x","x","y","y");c.push(getScatterMark(b,this.metadata)),this.config.legend&&"linear"!=this.metadata.types[b.color]&&(this.spec.legends=getLegend(this.config)),this.spec.width=b.width,this.spec.height=b.height,this.spec.axes=g,this.spec.data=a,this.spec.scales=f,this.spec.padding=b.padding,this.spec.marks=c};scatter.prototype.draw=function(a,b){var c=function(c){if(this.config.tooltip.enabled?(createTooltip(a),this.view=c({el:a}).renderer(this.config.renderer).update(),bindTooltip(a,this.view,this.config,this.metadata)):this.view=c({el:a}).renderer(this.config.renderer).update(),null!=b)for(var d=0;d=this.config.maxLength){for(var f=[],g=d.length-e,h=g;h-1&&(j=!0,g.splice(k,1)),j||g.splice(g.length-1,1)}else this.view.data(this.config.title).insert([a[i]]),this.view.update()}var l,m=function(a){return a[b]==l};for(i=0;ib.maxLength){var k=d3.select("tbody").selectAll("tr").data().slice(d3.select("tbody").selectAll("tr").data().length-b.maxLength,b.maxLength);d3.select("tbody").selectAll("tr").data(k,function(a){return a}).remove()}};var extend=function(a,b){var c,d={};for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&(d[c]=a[c]);for(c in b)Object.prototype.hasOwnProperty.call(b,c)&&(d[c]=b[c]);return d},stack=function(a,b){this.barChart=new bar(a,b),this.metadata=this.barChart.metadata;var c=this.barChart.getSpec();c.axes=[c.axes[0]],c.axes[0].grid=!1,c.data.push({name:"selectedPoints",modify:[{type:"clear",test:"!multi"},{type:"toggle",signal:"clickedPoint",field:"id"}]}),c.signals.push({name:"clickedPoint",init:0,verbose:!0,streams:[{type:"click",expr:"datum._id"}]},{name:"multi",init:!1,verbose:!0,streams:[{type:"click",expr:"datum._id"}]});var d=JSON.parse(JSON.stringify(c.marks[0]));d.type="text",d.properties.update.text={field:c.marks[0].properties.update.fill.field},d.properties.update.x.offset=10,d.properties.update.y.offset=-5,d.properties.update.fill={value:b.legendTitleColor},delete d.properties.update.y2,delete d.properties.hover,c.marks.push(d),delete c.marks[0].properties.hover,c.marks[0].properties.update.fill=[{test:"indata('selectedPoints', datum._id, 'id')",value:b.selectionColor},c.marks[0].properties.update.fill],this.barChart.setSpec(c)};stack.prototype.draw=function(a,b){this.barChart.draw(a,b)},stack.prototype.insert=function(a){this.barChart.insert(a)},stack.prototype.getSpec=function(){return this.barChart.getSpec()};
\ No newline at end of file
diff --git a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_commons_gadget/commons/js/VizGrammar2.min.js b/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_commons_gadget/commons/js/VizGrammar2.min.js
deleted file mode 100644
index 222168b48..000000000
--- a/components/device-types/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.analytics/src/main/resources/carbonapps/androidsense/android_commons_gadget/commons/js/VizGrammar2.min.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License./
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-function getPieMark(a,b){var c;if("donut"==a.mode)var c=a.width/5*(1+a.innerRadius);else if("pie"==a.mode)var c=0;else{a.innerRadius+=.5;var c=a.width/5*(1+a.innerRadius)}var d={type:"arc",from:{data:a.title},properties:{update:{x:{field:{group:"width"},mult:.5},y:{field:{group:"height"},mult:.5},startAngle:{field:"layout_start"},endAngle:{field:"layout_end"},innerRadius:{value:c},outerRadius:{value:.4*a.width},fill:{scale:"color",field:b.names[a.color]},fillOpacity:{value:1}},hover:{fillOpacity:{value:.8}}}};return d}function getPieMidText(a,b){var c={type:"text",from:{data:a.title},properties:{update:{x:{field:{group:"width"},mult:.5},y:{field:{group:"height"},mult:.5},radius:{value:0},theta:{field:"layout_mid"},fill:[{test:"indata('arc', datum.EngineType, 'type')",scale:"color",field:b.names[a.color]},{}],align:{value:"center"},baseline:{value:"middle"},fontSize:{value:a.width/8},text:{template:"{{datum.percentage | number:'.2f'}}%"}}}};return c}function getPieText(a,b){var c={type:"text",from:{data:a.title},properties:{update:{x:{field:{group:"width"},mult:.5},y:{field:{group:"height"},mult:.5},radius:{value:.5*a.width},theta:{field:"layout_mid"},fill:{value:"#000"},align:{value:"center"},baseline:{value:"middle"},text:{template:"{{datum.percentage | number:'.2f'}}%"}}}};return c}function getAreaMark(a,b){var c;return c=-1!=a.color?{type:"group",from:{data:a.title,transform:[{type:"facet",groupby:[b.names[a.color]]}]},marks:[{type:"area",properties:{update:{x:{scale:"x",field:b.names[a.x]},y:{scale:"y",field:b.names[a.y]},y2:{scale:"y",value:0},fill:{scale:"color",field:b.names[a.color]},strokeWidth:{value:2},strokeOpacity:{value:1}},hover:{strokeOpacity:{value:.5}}}}]}:{type:"area",from:{data:a.title},properties:{update:{x:{scale:"x",field:b.names[a.x]},y:{scale:"y",field:b.names[a.y]},y2:{scale:"y",value:0},fill:{value:a.markColor},strokeWidth:{value:2},fillOpacity:{value:1}},hover:{fillOpacity:{value:.5}}}}}function getBarMark(a,b){var c;c="left"==a.orientation?{y:{scale:"x",field:b.names[a.x]},height:{scale:"x",band:!0,offset:-10},x:{scale:"y",field:b.names[a.y]},x2:{scale:"y",value:0},fill:{value:a.markColor},fillOpacity:{value:1}}:{x:{scale:"x",field:b.names[a.x]},width:{scale:"x",band:!0,offset:-10},y:{scale:"y",field:b.names[a.y]},y2:{scale:"y",value:0},fill:{value:a.markColor},fillOpacity:{value:1}};var d={type:"rect",from:{data:a.title},properties:{update:c,hover:{fillOpacity:{value:.5}}}};return d}function getStackBarMark(a,b){return"left"==a.orientation?mark={type:"rect",from:{data:a.title,transform:[{type:"stack",groupby:[b.names[a.x]],sortby:[b.names[a.color]],field:b.names[a.y]}]},properties:{update:{y:{scale:"x",field:b.names[a.x]},height:{scale:"x",band:!0,offset:-10},x:{scale:"y",field:"layout_start"},x2:{scale:"y",field:"layout_end"},fill:{scale:"color",field:b.names[a.color]},fillOpacity:{value:1}},hover:{fillOpacity:{value:.5}}}}:mark={type:"rect",from:{data:a.title,transform:[{type:"stack",groupby:[b.names[a.x]],sortby:[b.names[a.color]],field:b.names[a.y]}]},properties:{update:{x:{scale:"x",field:b.names[a.x]},width:{scale:"x",band:!0,offset:-10},y:{scale:"y",field:"layout_start"},y2:{scale:"y",field:"layout_end"},fill:{scale:"color",field:b.names[a.color]},fillOpacity:{value:1}},hover:{fillOpacity:{value:.5}}}},mark}function getGroupBarMark(a,b){var c;return c="left"==a.orientation?{type:"group",from:{data:a.title,transform:[{type:"facet",groupby:[b.names[a.x]]}]},properties:{update:{y:{scale:"x",field:"key"},height:{scale:"x",band:!0}}},scales:[{name:"pos",type:"ordinal",range:"height",domain:{field:b.names[a.color]}}],marks:[{name:"bars",type:"rect",properties:{update:{y:{scale:"pos",field:b.names[a.color]},height:{scale:"pos",band:!0},x:{scale:"y",field:b.names[a.y]},x2:{scale:"y",value:0},fill:{scale:"color",field:b.names[a.color]},fillOpacity:{value:1}},hover:{fillOpacity:{value:.5}}}}]}:{type:"group",from:{data:a.title,transform:[{type:"facet",groupby:[b.names[a.x]]}]},properties:{update:{x:{scale:"x",field:"key"},width:{scale:"x",band:!0}}},scales:[{name:"pos",type:"ordinal",range:"width",domain:{field:b.names[a.color]}}],marks:[{name:"bars",type:"rect",properties:{update:{x:{scale:"pos",field:b.names[a.color]},width:{scale:"pos",band:!0},y:{scale:"y",field:b.names[a.y]},y2:{scale:"y",value:0},fill:{scale:"color",field:b.names[a.color]},fillOpacity:{value:1}},hover:{fillOpacity:{value:.5}}}}]}}function getLineMark(a,b){var c;return c=-1!=a.color?{type:"group",from:{data:a.title,transform:[{type:"facet",groupby:[b.names[a.color]]}]},marks:[{type:"line",properties:{update:{x:{scale:"x",field:b.names[a.x]},y:{scale:"y",field:b.names[a.y]},stroke:{scale:"color",field:b.names[a.color]},strokeWidth:{value:2},strokeOpacity:{value:1}},hover:{strokeOpacity:{value:.5}}}}]}:{type:"line",from:{data:a.title},properties:{update:{x:{scale:"x",field:b.names[a.x]},y:{scale:"y",field:b.names[a.y]},stroke:{value:a.markColor},strokeWidth:{value:2},strokeOpacity:{value:1}},hover:{strokeOpacity:{value:.5}}}}}function getTopoJson(a,b){var c,d=a.width,e=a.height,f=a.charts[0].mapType,g="mercator";"usa"==f?(d=a.width-160,e=a.height-130,c=a.height+270,g="albersUsa"):"europe"==f?(d=(a.width/2+100)/2,e=a.height+150,c=a.height+50):(c=a.width/640*120,d=a.width/2+10,e=a.height/2+40);var h=a.geoCodesUrl,i={name:"geoData",url:h,format:{type:"topojson",feature:"units"},transform:[{type:"geopath",value:"data",scale:c,translate:[d,e],projection:g},{type:"lookup",keys:["id"],on:a.title,onKey:b.names[a.x],as:["zipped"],"default":{v:null,country:"No data"}}]};return i}function getMapMark(a,b){var c=[{name:"map",type:"path",from:{data:"geoData"},properties:{enter:{path:{field:"layout_path"}},update:{fill:{rule:[{predicate:{name:"isNotNull",id:{field:"zipped.v"}},scale:"color",field:"zipped.v"},{value:a.mapColor}]}},hover:{fill:{value:"#989898"}}}},{type:"group",from:{data:a.title,transform:[{type:"filter",test:"datum."+b.names[a.x]+" == tooltipSignal.datum."+b.names[a.x]}]},properties:{update:{x:{signal:"tooltipSignal.x",offset:-5},y:{signal:"tooltipSignal.y",offset:20},width:{value:100},height:{value:20},fill:{value:a.tooltip.color}}},marks:[{type:"text",properties:{update:{x:{value:6},y:{value:14},text:{template:"{{tooltipSignal.datum.unitName}} {{tooltipSignal.datum.v}}"},fill:{value:"black"}}}}]}];return c}function getMapSignals(){var a=[{name:"tooltipSignal",init:{expr:"{x: 0, y: 0, datum: {} }"},streams:[{type:"@map:mouseover",expr:"{x: eventX(), y: eventY(), datum: eventItem().datum.zipped}"},{type:"@map:mouseout",expr:"{x: 0, y: 0, datum: {} }"}]}];return a}function getMapPredicates(){var a={name:"isNotNull",type:"!=",operands:[{value:null},{arg:"id"}]};return a}function getMapLegends(a,b){var c={fill:"color",title:b.names[a.y],properties:{gradient:{stroke:{value:"transparent"}},title:{fontSize:{value:14}},legend:{x:{value:0},y:{value:a.height-40}}}};return c}function loadGeoMapCodes(a){var b,c=new XMLHttpRequest;return c.overrideMimeType("application/json"),c.open("GET",a,!1),c.onreadystatechange=function(){4==c.readyState&&"200"==c.status&&(b=JSON.parse(c.responseText))},c.send(null),b}function getMapCode(a,b,c){if("world"==b||"europe"==b)for(d=0;d"),$("#wrapper").append(""),$tip=$("#tip"),$tip.empty();var i=g.datum,j="";for(var k in i)if(i.hasOwnProperty(k))if(void 0!=f){for(var l=0;l"+f[l]+" ("+k+"):"+i[k]+"";break}}else e.names[d.x]==k&&(j+="