-
Notifications
You must be signed in to change notification settings - Fork 1
/
imageviewerfrombase64.json
16 lines (16 loc) · 2.75 KB
/
imageviewerfrombase64.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"alias": "imageviewerfrombase64",
"name": "ImageViewerFromBase64",
"descriptor": {
"type": "latest",
"sizeX": 7.5,
"sizeY": 4.5,
"resources": [],
"templateHtml": "<img src=\"\" id=\"image\" style=\"overflow: hidden;height: {{ height }}px;width:{{width}}px\">\n",
"templateCss": "#container {\n overflow: auto;\n}\n\n.tbDatasource-container {\n margin: 5px;\n padding: 8px;\n}\n\n.tbDatasource-title {\n font-size: 1.200rem;\n font-weight: 500;\n padding-bottom: 10px;\n}\n\n.tbDatasource-table {\n width: 100%;\n box-shadow: 0 0 10px #ccc;\n border-collapse: collapse;\n white-space: nowrap;\n font-size: 1.000rem;\n color: #757575;\n}\n\n.tbDatasource-table td {\n position: relative;\n border-top: 1px solid rgba(0, 0, 0, 0.12);\n border-bottom: 1px solid rgba(0, 0, 0, 0.12);\n padding: 0px 18px;\n box-sizing: border-box;\n}",
"controllerScript": "self.onInit = function() {\n console.log(self.ctx)\n self.ctx.$scope.width=self.ctx.width-(parseInt(self.ctx.widgetConfig.padding, 10));\n self.ctx.$scope.height=self.ctx.height-(parseInt(self.ctx.widgetConfig.padding, 10))\n}\n\nself.onDataUpdated = function() {\n if(self.ctx.data[0]!=undefined && self.ctx.data[0].data[0]!=undefined){\n $('#image').attr('src', self.ctx.data[0].data[0][1]);\n \n }\n\n}\n\nself.typeParameters=function(){\n return {\n maxDatasources: 1, // Maximum allowed datasources for this widget, -1 - unlimited\n maxDataKeys: 1, //Maximum allowed data keys for this widget, -1 - unlimited\n dataKeysOptional: false //Whether this widget can be configured with datasources without data keys\n }\n}\nself.onDestroy = function() {\n}\n",
"settingsSchema": "{}",
"dataKeySettingsSchema": "{}\n",
"defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Random\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"var value = prevValue + Math.random() * 100 - 50;\\nvar multiplier = Math.pow(10, 2 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -1000) {\\n\\tvalue = -1000;\\n} else if (value > 1000) {\\n\\tvalue = 1000;\\n}\\nreturn value;\"}]}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{},\"title\":\"ImageViewerFromBase64\",\"showTitleIcon\":false,\"iconColor\":\"rgba(0, 0, 0, 0.87)\",\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"dropShadow\":true,\"enableFullscreen\":true,\"enableDataExport\":true,\"widgetStyle\":{},\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"showLegend\":false}"
}
}