+
{{sensor.label}}
{{sensor.valueFormatted}} {{sensor.valueUnit}}
diff --git a/dist/module.js.map b/dist/module.js.map
index 52decf4..98dc7a7 100644
--- a/dist/module.js.map
+++ b/dist/module.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../src/module.js"],"names":["PictureItCtrl"],"mappings":";;;;;;;;AAAQA,mB,mBAAAA,a;;;2BAGNA,a","file":"module.js","sourcesContent":["import {PictureItCtrl} from './pictureit_ctrl';\n\nexport {\n PictureItCtrl as PanelCtrl\n};\n"]}
\ No newline at end of file
+{"version":3,"sources":["../src/module.js"],"names":["PictureItCtrl"],"mappings":";;;;;;;;AAAQA,mB,mBAAAA,a;;;2BAGNA,a","file":"module.js","sourcesContent":["import {PictureItCtrl} from './pictureit_ctrl';\r\n\r\nexport {\r\n PictureItCtrl as PanelCtrl\r\n};\r\n"]}
\ No newline at end of file
diff --git a/dist/pictureit_ctrl.js.map b/dist/pictureit_ctrl.js.map
index f496f0b..62b550c 100644
--- a/dist/pictureit_ctrl.js.map
+++ b/dist/pictureit_ctrl.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../src/pictureit_ctrl.js"],"names":["_","MetricsPanelCtrl","kbn","panelDefaults","valueMaps","seriesList","series","bgimage","sensors","height","width","PictureItCtrl","$scope","$injector","defaults","panel","unitFormats","getUnitFormats","events","on","onInitEditMode","bind","render","onDataReceived","dataList","dataListLength","length","push","name","target","value","datapoints","index","splice","xlocation","ylocation","format","decimals","bgcolor","color","size","bordercolor","visible","lastSensor","subItem","addEditorTab","scope","elem","attrs","ctrl","$panelContainer","find","pixelStrToNum","str","parseInt","substr","css","sensorsLength","valueMapsLength","sensor","ylocationStr","toString","xlocationStr","sizeStr","valueMap","valueFormatted","valueFormats","renderingCompleted","templateUrl"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAOA,O;;AACCC,sB,kBAAAA,gB;;AAGDC,S;;;;;;;;;;;;;;;;;;;;;AAEDC,mB,GAAgB;AACrB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AACrD,sBAAIxD,QAAQmD,MAAR,EAAgB/B,IAAhB,IAAsBxB,UAAU4D,QAAV,EAAoBpC,IAA9C,EAAoD;AAChDpB,4BAAQmD,MAAR,EAAgBM,cAAhB,GAAiC/D,IAAIgE,YAAJ,CAAiB1D,QAAQmD,MAAR,EAAgBvB,MAAjC,EAAyChC,UAAU4D,QAAV,EAAoBlC,KAA7D,EAAmEtB,QAAQmD,MAAR,EAAgBtB,QAAnF,EAA6F,IAA7F,CAAjC;AAClB;AACC;AACU;AACX;AACG;;AAED,iBAAKnB,MAAL,CAAYC,EAAZ,CAAe,QAAf,EAAyB,YAAW;AAClCG;AACA2B,mBAAKkB,kBAAL;AACD,aAHD;AAID;;;;QAvFgClE,gB;;;;AA0FnCU,oBAAcyD,WAAd,GAA4B,aAA5B","file":"pictureit_ctrl.js","sourcesContent":["import _ from 'lodash';\nimport {MetricsPanelCtrl} from 'app/plugins/sdk';\nimport './sprintf.js';\nimport './angular-sprintf.js';\nimport kbn from 'app/core/utils/kbn';\n\nconst panelDefaults = {\n\tvalueMaps: [],\n\tseriesList: [],\n\tseries: [],\n\tbgimage: '',\n\tsensors: [],\n\theight: '400px',\n\twidth: '100px'\n};\n\nexport class PictureItCtrl extends MetricsPanelCtrl {\n \n \n constructor($scope, $injector) {\n super($scope, $injector);\n _.defaults(this.panel, panelDefaults);\n\n this.unitFormats = kbn.getUnitFormats();\n\n this.events.on('init-edit-mode', this.onInitEditMode.bind(this));\n this.events.on('panel-initialized', this.render.bind(this));\n this.events.on('data-received', this.onDataReceived.bind(this));\n this.events.on('data-snapshot-load', this.onDataReceived.bind(this));\n }\n\n onDataReceived(dataList) {\t\n\tvar dataListLength = dataList.length;\n\tthis.panel.valueMaps=[];\n\tfor (var series=0;series
= 0\n }\n\n switch (match[8]) {\n case 'b':\n arg = parseInt(arg, 10).toString(2)\n break\n case 'c':\n arg = String.fromCharCode(parseInt(arg, 10))\n break\n case 'd':\n case 'i':\n arg = parseInt(arg, 10)\n break\n case 'j':\n arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0)\n break\n case 'e':\n arg = match[7] ? parseFloat(arg).toExponential(match[7]) : parseFloat(arg).toExponential()\n break\n case 'f':\n arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg)\n break\n case 'g':\n arg = match[7] ? parseFloat(arg).toPrecision(match[7]) : parseFloat(arg)\n break\n case 'o':\n arg = arg.toString(8)\n break\n case 's':\n arg = String(arg)\n arg = (match[7] ? arg.substring(0, match[7]) : arg)\n break\n case 't':\n arg = String(!!arg)\n arg = (match[7] ? arg.substring(0, match[7]) : arg)\n break\n case 'T':\n arg = get_type(arg)\n arg = (match[7] ? arg.substring(0, match[7]) : arg)\n break\n case 'u':\n arg = parseInt(arg, 10) >>> 0\n break\n case 'v':\n arg = arg.valueOf()\n arg = (match[7] ? arg.substring(0, match[7]) : arg)\n break\n case 'x':\n arg = parseInt(arg, 10).toString(16)\n break\n case 'X':\n arg = parseInt(arg, 10).toString(16).toUpperCase()\n break\n }\n if (re.json.test(match[8])) {\n output[output.length] = arg\n }\n else {\n if (re.number.test(match[8]) && (!is_positive || match[3])) {\n sign = is_positive ? '+' : '-'\n arg = arg.toString().replace(re.sign, '')\n }\n else {\n sign = ''\n }\n pad_character = match[4] ? match[4] === '0' ? '0' : match[4].charAt(1) : ' '\n pad_length = match[6] - (sign + arg).length\n pad = match[6] ? (pad_length > 0 ? str_repeat(pad_character, pad_length) : '') : ''\n output[output.length] = match[5] ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)\n }\n }\n }\n return output.join('')\n }\n\n sprintf.cache = {}\n\n sprintf.parse = function(fmt) {\n var _fmt = fmt, match = [], parse_tree = [], arg_names = 0\n while (_fmt) {\n if ((match = re.text.exec(_fmt)) !== null) {\n parse_tree[parse_tree.length] = match[0]\n }\n else if ((match = re.modulo.exec(_fmt)) !== null) {\n parse_tree[parse_tree.length] = '%'\n }\n else if ((match = re.placeholder.exec(_fmt)) !== null) {\n if (match[2]) {\n arg_names |= 1\n var field_list = [], replacement_field = match[2], field_match = []\n if ((field_match = re.key.exec(replacement_field)) !== null) {\n field_list[field_list.length] = field_match[1]\n while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {\n if ((field_match = re.key_access.exec(replacement_field)) !== null) {\n field_list[field_list.length] = field_match[1]\n }\n else if ((field_match = re.index_access.exec(replacement_field)) !== null) {\n field_list[field_list.length] = field_match[1]\n }\n else {\n throw new SyntaxError(\"[sprintf] failed to parse named argument key\")\n }\n }\n }\n else {\n throw new SyntaxError(\"[sprintf] failed to parse named argument key\")\n }\n match[2] = field_list\n }\n else {\n arg_names |= 2\n }\n if (arg_names === 3) {\n throw new Error(\"[sprintf] mixing positional and named placeholders is not (yet) supported\")\n }\n parse_tree[parse_tree.length] = match\n }\n else {\n throw new SyntaxError(\"[sprintf] unexpected placeholder\")\n }\n _fmt = _fmt.substring(match[0].length)\n }\n return parse_tree\n }\n\n var vsprintf = function(fmt, argv, _argv) {\n _argv = (argv || []).slice(0)\n _argv.splice(0, 0, fmt)\n return sprintf.apply(null, _argv)\n }\n\n /**\n * helpers\n */\n function get_type(variable) {\n if (typeof variable === 'number') {\n return 'number'\n }\n else if (typeof variable === 'string') {\n return 'string'\n }\n else {\n return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase()\n }\n }\n\n var preformattedPadding = {\n '0': ['', '0', '00', '000', '0000', '00000', '000000', '0000000'],\n ' ': ['', ' ', ' ', ' ', ' ', ' ', ' ', ' '],\n '_': ['', '_', '__', '___', '____', '_____', '______', '_______'],\n }\n function str_repeat(input, multiplier) {\n if (multiplier >= 0 && multiplier <= 7 && preformattedPadding[input]) {\n return preformattedPadding[input][multiplier]\n }\n return Array(multiplier + 1).join(input)\n }\n\n /**\n * export to either browser or node.js\n */\n if (typeof exports !== 'undefined') {\n exports.sprintf = sprintf\n exports.vsprintf = vsprintf\n }\n if (typeof window !== 'undefined') {\n window.sprintf = sprintf\n window.vsprintf = vsprintf\n\n if (typeof define === 'function' && define.amd) {\n define(function() {\n return {\n sprintf: sprintf,\n vsprintf: vsprintf\n }\n })\n }\n }\n})(typeof window === 'undefined' ? this : window);\n"]}
\ No newline at end of file
+{"version":3,"sources":["../src/sprintf.js"],"names":["window","re","not_string","not_bool","not_type","not_primitive","number","numeric_arg","json","not_json","text","modulo","placeholder","key","key_access","index_access","sign","sprintf","arguments","cache","hasOwnProperty","parse","format","call","parse_tree","argv","cursor","tree_length","length","node_type","arg","output","i","k","match","pad","pad_character","pad_length","is_positive","get_type","Error","test","isNaN","TypeError","parseInt","toString","String","fromCharCode","JSON","stringify","parseFloat","toExponential","toFixed","toPrecision","substring","valueOf","toUpperCase","replace","charAt","str_repeat","join","fmt","_fmt","arg_names","exec","field_list","replacement_field","field_match","SyntaxError","vsprintf","_argv","slice","splice","apply","variable","Object","prototype","toLowerCase","preformattedPadding","input","multiplier","Array","exports","define","amd"],"mappings":";;;;;;;;AAAA;;AAEA,aAAC,UAASA,MAAT,EAAiB;AACd;;AAEA,oBAAIC,KAAK;AACLC,gCAAY,MADP;AAELC,8BAAU,MAFL;AAGLC,8BAAU,MAHL;AAILC,mCAAe,MAJV;AAKLC,4BAAQ,SALH;AAMLC,iCAAa,YANR;AAOLC,0BAAM,KAPD;AAQLC,8BAAU,MARL;AASLC,0BAAM,WATD;AAULC,4BAAQ,UAVH;AAWLC,iCAAa,2FAXR;AAYLC,yBAAK,qBAZA;AAaLC,gCAAY,uBAbP;AAcLC,kCAAc,YAdT;AAeLC,0BAAM;AAfD,iBAAT;;AAkBA,yBAASC,OAAT,GAAmB;AACf,wBAAIJ,MAAMK,UAAU,CAAV,CAAV;AAAA,wBAAwBC,QAAQF,QAAQE,KAAxC;AACA,wBAAI,EAAEA,MAAMN,GAAN,KAAcM,MAAMC,cAAN,CAAqBP,GAArB,CAAhB,CAAJ,EAAgD;AAC5CM,8BAAMN,GAAN,IAAaI,QAAQI,KAAR,CAAcR,GAAd,CAAb;AACH;AACD,2BAA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BA,QAAlB;;AAEA,wBAAI,OAAOc,MAAP,KAAkB,UAAlB,IAAgCA,OAAOC,GAA3C,EAAgD;AAC5CD,+BAAO,YAAW;AACd,mCAAO;AACHlE,yCAASA,OADN;AAEHoD,0CAAUA;AAFP,6BAAP;AAIH,yBALD;AAMH;AACJ;AACJ,aAlPD,EAkPG,OAAOrE,MAAP,KAAkB,WAAlB,eAAuCA,MAlP1C","file":"sprintf.js","sourcesContent":["/* globals window, exports, define */\r\n\r\n(function(window) {\r\n 'use strict'\r\n\r\n var re = {\r\n not_string: /[^s]/,\r\n not_bool: /[^t]/,\r\n not_type: /[^T]/,\r\n not_primitive: /[^v]/,\r\n number: /[diefg]/,\r\n numeric_arg: /bcdiefguxX/,\r\n json: /[j]/,\r\n not_json: /[^j]/,\r\n text: /^[^\\x25]+/,\r\n modulo: /^\\x25{2}/,\r\n placeholder: /^\\x25(?:([1-9]\\d*)\\$|\\(([^\\)]+)\\))?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-gijostTuvxX])/,\r\n key: /^([a-z_][a-z_\\d]*)/i,\r\n key_access: /^\\.([a-z_][a-z_\\d]*)/i,\r\n index_access: /^\\[(\\d+)\\]/,\r\n sign: /^[\\+\\-]/\r\n }\r\n\r\n function sprintf() {\r\n var key = arguments[0], cache = sprintf.cache\r\n if (!(cache[key] && cache.hasOwnProperty(key))) {\r\n cache[key] = sprintf.parse(key)\r\n }\r\n return sprintf.format.call(null, cache[key], arguments)\r\n }\r\n\r\n sprintf.format = function(parse_tree, argv) {\r\n var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length, is_positive = true, sign = ''\r\n for (i = 0; i < tree_length; i++) {\r\n node_type = get_type(parse_tree[i])\r\n if (node_type === 'string') {\r\n output[output.length] = parse_tree[i]\r\n }\r\n else if (node_type === 'array') {\r\n match = parse_tree[i] // convenience purposes only\r\n if (match[2]) { // keyword argument\r\n arg = argv[cursor]\r\n for (k = 0; k < match[2].length; k++) {\r\n if (!arg.hasOwnProperty(match[2][k])) {\r\n throw new Error(sprintf('[sprintf] property \"%s\" does not exist', match[2][k]))\r\n }\r\n arg = arg[match[2][k]]\r\n }\r\n }\r\n else if (match[1]) { // positional argument (explicit)\r\n arg = argv[match[1]]\r\n }\r\n else { // positional argument (implicit)\r\n arg = argv[cursor++]\r\n }\r\n\r\n if (re.not_type.test(match[8]) && re.not_primitive.test(match[8]) && get_type(arg) == 'function') {\r\n arg = arg()\r\n }\r\n\r\n if (re.numeric_arg.test(match[8]) && (get_type(arg) != 'number' && isNaN(arg))) {\r\n throw new TypeError(sprintf(\"[sprintf] expecting number but found %s\", get_type(arg)))\r\n }\r\n\r\n if (re.number.test(match[8])) {\r\n is_positive = arg >= 0\r\n }\r\n\r\n switch (match[8]) {\r\n case 'b':\r\n arg = parseInt(arg, 10).toString(2)\r\n break\r\n case 'c':\r\n arg = String.fromCharCode(parseInt(arg, 10))\r\n break\r\n case 'd':\r\n case 'i':\r\n arg = parseInt(arg, 10)\r\n break\r\n case 'j':\r\n arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0)\r\n break\r\n case 'e':\r\n arg = match[7] ? parseFloat(arg).toExponential(match[7]) : parseFloat(arg).toExponential()\r\n break\r\n case 'f':\r\n arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg)\r\n break\r\n case 'g':\r\n arg = match[7] ? parseFloat(arg).toPrecision(match[7]) : parseFloat(arg)\r\n break\r\n case 'o':\r\n arg = arg.toString(8)\r\n break\r\n case 's':\r\n arg = String(arg)\r\n arg = (match[7] ? arg.substring(0, match[7]) : arg)\r\n break\r\n case 't':\r\n arg = String(!!arg)\r\n arg = (match[7] ? arg.substring(0, match[7]) : arg)\r\n break\r\n case 'T':\r\n arg = get_type(arg)\r\n arg = (match[7] ? arg.substring(0, match[7]) : arg)\r\n break\r\n case 'u':\r\n arg = parseInt(arg, 10) >>> 0\r\n break\r\n case 'v':\r\n arg = arg.valueOf()\r\n arg = (match[7] ? arg.substring(0, match[7]) : arg)\r\n break\r\n case 'x':\r\n arg = parseInt(arg, 10).toString(16)\r\n break\r\n case 'X':\r\n arg = parseInt(arg, 10).toString(16).toUpperCase()\r\n break\r\n }\r\n if (re.json.test(match[8])) {\r\n output[output.length] = arg\r\n }\r\n else {\r\n if (re.number.test(match[8]) && (!is_positive || match[3])) {\r\n sign = is_positive ? '+' : '-'\r\n arg = arg.toString().replace(re.sign, '')\r\n }\r\n else {\r\n sign = ''\r\n }\r\n pad_character = match[4] ? match[4] === '0' ? '0' : match[4].charAt(1) : ' '\r\n pad_length = match[6] - (sign + arg).length\r\n pad = match[6] ? (pad_length > 0 ? str_repeat(pad_character, pad_length) : '') : ''\r\n output[output.length] = match[5] ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)\r\n }\r\n }\r\n }\r\n return output.join('')\r\n }\r\n\r\n sprintf.cache = {}\r\n\r\n sprintf.parse = function(fmt) {\r\n var _fmt = fmt, match = [], parse_tree = [], arg_names = 0\r\n while (_fmt) {\r\n if ((match = re.text.exec(_fmt)) !== null) {\r\n parse_tree[parse_tree.length] = match[0]\r\n }\r\n else if ((match = re.modulo.exec(_fmt)) !== null) {\r\n parse_tree[parse_tree.length] = '%'\r\n }\r\n else if ((match = re.placeholder.exec(_fmt)) !== null) {\r\n if (match[2]) {\r\n arg_names |= 1\r\n var field_list = [], replacement_field = match[2], field_match = []\r\n if ((field_match = re.key.exec(replacement_field)) !== null) {\r\n field_list[field_list.length] = field_match[1]\r\n while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {\r\n if ((field_match = re.key_access.exec(replacement_field)) !== null) {\r\n field_list[field_list.length] = field_match[1]\r\n }\r\n else if ((field_match = re.index_access.exec(replacement_field)) !== null) {\r\n field_list[field_list.length] = field_match[1]\r\n }\r\n else {\r\n throw new SyntaxError(\"[sprintf] failed to parse named argument key\")\r\n }\r\n }\r\n }\r\n else {\r\n throw new SyntaxError(\"[sprintf] failed to parse named argument key\")\r\n }\r\n match[2] = field_list\r\n }\r\n else {\r\n arg_names |= 2\r\n }\r\n if (arg_names === 3) {\r\n throw new Error(\"[sprintf] mixing positional and named placeholders is not (yet) supported\")\r\n }\r\n parse_tree[parse_tree.length] = match\r\n }\r\n else {\r\n throw new SyntaxError(\"[sprintf] unexpected placeholder\")\r\n }\r\n _fmt = _fmt.substring(match[0].length)\r\n }\r\n return parse_tree\r\n }\r\n\r\n var vsprintf = function(fmt, argv, _argv) {\r\n _argv = (argv || []).slice(0)\r\n _argv.splice(0, 0, fmt)\r\n return sprintf.apply(null, _argv)\r\n }\r\n\r\n /**\r\n * helpers\r\n */\r\n function get_type(variable) {\r\n if (typeof variable === 'number') {\r\n return 'number'\r\n }\r\n else if (typeof variable === 'string') {\r\n return 'string'\r\n }\r\n else {\r\n return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase()\r\n }\r\n }\r\n\r\n var preformattedPadding = {\r\n '0': ['', '0', '00', '000', '0000', '00000', '000000', '0000000'],\r\n ' ': ['', ' ', ' ', ' ', ' ', ' ', ' ', ' '],\r\n '_': ['', '_', '__', '___', '____', '_____', '______', '_______'],\r\n }\r\n function str_repeat(input, multiplier) {\r\n if (multiplier >= 0 && multiplier <= 7 && preformattedPadding[input]) {\r\n return preformattedPadding[input][multiplier]\r\n }\r\n return Array(multiplier + 1).join(input)\r\n }\r\n\r\n /**\r\n * export to either browser or node.js\r\n */\r\n if (typeof exports !== 'undefined') {\r\n exports.sprintf = sprintf\r\n exports.vsprintf = vsprintf\r\n }\r\n if (typeof window !== 'undefined') {\r\n window.sprintf = sprintf\r\n window.vsprintf = vsprintf\r\n\r\n if (typeof define === 'function' && define.amd) {\r\n define(function() {\r\n return {\r\n sprintf: sprintf,\r\n vsprintf: vsprintf\r\n }\r\n })\r\n }\r\n }\r\n})(typeof window === 'undefined' ? this : window);\r\n"]}
\ No newline at end of file
diff --git a/package.json b/package.json
index 16fc07b..06b9975 100644
--- a/package.json
+++ b/package.json
@@ -16,25 +16,26 @@
"author": "Bessler",
"license": "MIT",
"devDependencies": {
- "babel": "~6.5.1",
- "babel-eslint": "^6.0.0",
- "babel-plugin-transform-es2015-modules-systemjs": "^6.5.0",
- "babel-preset-es2015": "^6.5.0",
- "eslint": "^2.5.1",
- "eslint-config-airbnb": "^6.2.0",
- "eslint-plugin-import": "^1.4.0",
- "grunt": "~0.4.5",
- "grunt-babel": "~6.0.0",
+ "babel": "^6.23.0",
+ "babel-eslint": "^8.0.1",
+ "babel-plugin-transform-es2015-modules-systemjs": "^6.24.1",
+ "babel-preset-es2015": "^6.24.1",
+ "eslint": "^4.10.0",
+ "eslint-config-airbnb": "^16.1.0",
+ "eslint-plugin-import": "^2.8.0",
+ "grunt": "^1.0.1",
+ "grunt-babel": "^7.0.0",
"grunt-cli": "^1.2.0",
- "grunt-contrib-clean": "~0.6.0",
- "grunt-contrib-copy": "~0.8.2",
- "grunt-contrib-uglify": "~0.11.0",
- "grunt-contrib-watch": "^0.6.1",
- "grunt-execute": "~0.2.2",
- "grunt-systemjs-builder": "^0.2.5",
- "load-grunt-tasks": "~3.2.0"
+ "grunt-contrib-clean": "^1.1.0",
+ "grunt-contrib-copy": "^1.0.0",
+ "grunt-contrib-uglify": "^3.1.0",
+ "grunt-contrib-watch": "^1.0.0",
+ "grunt-execute": "^0.2.2",
+ "grunt-systemjs-builder": "^1.0.0",
+ "load-grunt-tasks": "^3.5.2"
},
"dependencies": {
- "lodash": "~4.0.0"
+ "load-grunt-tasks": "^3.2.0",
+ "lodash": "^4.17.4"
}
}
diff --git a/src/editor.html b/src/editor.html
index 882530a..9f3160a 100644
--- a/src/editor.html
+++ b/src/editor.html
@@ -16,6 +16,11 @@