Skip to content

Commit 76f951a

Browse files
authored
Fix/various (#162)
* Fix #156 entity default offset * Fix "cannot parse undefined" error in the UI when the last visible datapoint is unavailable/unknown/null/undefined * Downgrade plotly.js to 2.14.0 due to trace ghosting. Fixes #158. * Bump version
1 parent 51d61cf commit 76f951a

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

package-lock.json

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "plotly-graph-card",
3-
"version": "1.8.3",
3+
"version": "1.8.4",
44
"description": "",
55
"main": "index.js",
66
"scripts": {
@@ -25,6 +25,6 @@
2525
"date-fns": "^2.28.0",
2626
"deepmerge": "^4.2.2",
2727
"lodash": "^4.17.21",
28-
"plotly.js": "^2.16.5"
28+
"plotly.js": "^2.14.0"
2929
}
3030
}

src/plotly-graph-card.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function extendLastDatapointToPresent(
5757
offset: number
5858
) {
5959
if (xs.length === 0) return;
60-
const last = JSON.parse(JSON.stringify(ys[ys.length - 1]));
60+
const last = ys[ys.length - 1];
6161
xs.push(new Date(Date.now() + offset));
6262
ys.push(last);
6363
}
@@ -407,7 +407,7 @@ export class PlotlyGraph extends HTMLElement {
407407
config.defaults?.entity,
408408
entityIn
409409
);
410-
entity.offset = parseTimeDuration(entityIn.offset ?? "0s");
410+
entity.offset = parseTimeDuration(entity.offset ?? "0s");
411411
if (entity.lambda) {
412412
entity.lambda = window.eval(entity.lambda);
413413
}

0 commit comments

Comments
 (0)