@lavolp3 updateDom() returns a promise, but then IMMEDIATELY calls getDom()…
so the wait is ineffective
all you can do is check the dom to see if your minimum content some anchoring div) is present, and retry that until it is.
then call updateDom() to force a refresh
this is what I do in getDom(). i have an array of different charts to present
// if we are not suspended/hidden due to sleep or whatever
if (wself.suspended == false) {
// make sure we don't start before the data gets here
if (!this.loaded) { < - just a flag for first time
this.loaded = true;
return wself.wrapper;
} else {
// loop thru the data from the blynk server, one chart per data point/pin
for (var pin_index = 0; pin_index < wself.config.Pins.length; pin_index++) {
// get the pin text name. used for index into the data hash
var this_pin = wself.config.Pins[pin_index];
// clear the work variable
var canvas = null;
// try to locate the existing chart
if ((canvas = document.getElementById("myChart" + this_pin)) == null) {
var c = document.createElement("div");
c.style.width = wself.config.width + "px";
c.style.height = wself.config.height + "px";
if (!wself.config.stacked)
{c.style.display = "inline-block";}
wself.wrapper.appendChild(c);
canvas = document.createElement("canvas");
canvas.id = "myChart" + this_pin;
c.appendChild(canvas);
}
// if the chart has been created
if (wself.charts[pin_index] != null) {
// destroy it, update doesn't work reliably
wself.charts[pin_index].destroy();
// make it unreferenced
wself.charts[pin_index] = 0;
}
// create it now, into the special div object for this chart
wself.charts[pin_index] = new Chart(canvas, {
my ‘schedule update’ asks for more data from my node_helper…
it informs me when its back. and I call updateDom() after saving the data where getDom() will look
u can see my code at https://github.com/sdetweil/WaterLevels