Awesome work around for not having access to window.open feature.
I have been trying to get a HighChart Zoom Enabled time series line plot to be opened in another web browser tab, when the data points retrieve from a local database exceeds 10,000 points. On my meager laptop, it takes quite a while to plot on the node red dashboard UI chart and effectively make everything move in slow motion in Node-Red. Hence resorting to HighChart.
Since I am unable to trigger a window.open() from within a function block when the data retrieved is greater than 10,000 points... I found a workaround by making use of the ui-toast (notification node) and some html/css.
So, in this workaround, when the array length is greater than 10,000 data points, I used the switch node to trigger the notification node, which pops up an OK/Cancel dialogue box in Node Red Dashboard. And within this pop up box, I displayed a clickable link to open a new tab which display my timeseries data plot out in the zoom enabled HighChart.
Please Import the flow below to see a simple setup for this clickable link within a pop up notification dialogue box!
[
{
"id": "37870965.eb4176",
"type": "ui_toast",
"z": "8b707301.89767",
"position": "dialog",
"displayTime": "6",
"highlight": "red",
"sendall": true,
"outputs": 1,
"ok": "OK",
"cancel": "",
"raw": true,
"topic": "",
"name": "",
"x": 450,
"y": 180,
"wires": [
[]
]
},
{
"id": "33f17afc.984c36",
"type": "inject",
"z": "8b707301.89767",
"name": "",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 140,
"y": 180,
"wires": [
[
"6bf3e226.642b9c"
]
]
},
{
"id": "6bf3e226.642b9c",
"type": "template",
"z": "8b707301.89767",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "html",
"syntax": "mustache",
"template": "<p style=\"text-align: center\">Unfortunately Node Red cannot solve this for you. Click on link below to find the one who does</p>\n<p style=\"text-align:center\"><a href=\"https://www.google.com/\" target=\"_blank\" style=\"color:red;font-size:300%\">The ALL Knowing</a></p>",
"output": "str",
"x": 280,
"y": 180,
"wires": [
[
"37870965.eb4176"
]
]
}
]