Skip to content

Commit

Permalink
- (@GermanBluefox) Correcting locale for x-axis
Browse files Browse the repository at this point in the history
- (@GermanBluefox) Correcting widget
  • Loading branch information
GermanBluefox committed Jan 13, 2025
1 parent e356c83 commit 7e09c8d
Show file tree
Hide file tree
Showing 32 changed files with 1,430 additions and 1,353 deletions.
40 changes: 20 additions & 20 deletions admin/assets/index-VBHizqvZ.js → admin/assets/index-DIG665pI.js

Large diffs are not rendered by default.

609 changes: 0 additions & 609 deletions admin/chart/assets/index-DCgeF7hH.js

This file was deleted.

637 changes: 637 additions & 0 deletions admin/chart/assets/index-ZF2lF8gx.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin/chart/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/>
<script type="text/javascript" src="./../../lib/js/socket.io.js"></script>
<title>Echarts [ioBroker]</title>
<script type="module" crossorigin src="./assets/index-DCgeF7hH.js"></script>
<script type="module" crossorigin src="./assets/index-ZF2lF8gx.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-VI9R7d-i.css">
</head>
<body>
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin/preview/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
document.head.appendChild(script);
</script>
<title>Echarts preview [ioBroker]</title>
<script type="module" crossorigin src="./assets/index-CgqD6xas.js"></script>
<script type="module" crossorigin src="./assets/index-pOd0B7Ce.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-VI9R7d-i.css">
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion admin/tab.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
document.head.appendChild(script);
</script>
<title>Echarts [ioBroker]</title>
<script type="module" crossorigin src="./assets/index-VBHizqvZ.js"></script>
<script type="module" crossorigin src="./assets/index-DIG665pI.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-D5BB0j0i.css">
</head>
<body>
Expand Down
12 changes: 10 additions & 2 deletions build-backend/lib/ChartModel.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build-backend/lib/ChartModel.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion build-backend/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build-backend/main.js.map

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"url": "https://github.com/ioBroker/ioBroker.echarts"
},
"optionalDependencies": {
"canvas": "^2.11.2",
"canvas": "^3.0.1",
"echarts": "^5.6.0",
"jsdom": "^25.0.1"
"jsdom": "^26.0.0"
},
"dependencies": {
"moment": "^2.30.1",
Expand All @@ -33,22 +33,22 @@
"@alcalzone/release-script": "^3.8.0",
"@alcalzone/release-script-plugin-iobroker": "^3.7.2",
"@alcalzone/release-script-plugin-license": "^3.7.0",
"@iobroker/adapter-react-v5": "^7.4.10",
"@iobroker/adapter-react-v5": "^7.4.12",
"@iobroker/build-tools": "^2.0.14",
"@iobroker/eslint-config": "^1.0.0",
"@iobroker/legacy-testing": "^2.0.1",
"@iobroker/testing": "^5.0.0",
"@iobroker/vis-2-widgets-react-dev": "^4.0.4",
"@mui/icons-material": "^6.3.0",
"@mui/material": "^6.3.0",
"@mui/icons-material": "^6.3.1",
"@mui/material": "^6.3.1",
"@types/jsdom": "^21.1.7",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"axios": "^1.7.9",
"chai": "^4.5.0",
"colorette": "^2.0.20",
"mocha": "^11.0.1",
"puppeteer": "^23.11.1",
"puppeteer": "^24.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand Down
2 changes: 1 addition & 1 deletion src-chart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"moment": "^2.30.1",
"react-i18next": "^15.4.0",
"react-icons": "^5.4.0",
"typescript": "^5.7.2"
"typescript": "^5.7.3"
},
"homepage": ".",
"_proxy": "http://localhost:8081",
Expand Down
2 changes: 1 addition & 1 deletion src-preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@vitejs/plugin-react": "^4.3.4",
"react-icons": "^5.4.0",
"typescript": "^5.7.2"
"typescript": "^5.7.3"
},
"homepage": ".",
"proxy": "http://localhost:8081",
Expand Down
16 changes: 8 additions & 8 deletions src-widgets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"dependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@craco/craco": "^7.1.0",
"@iobroker/adapter-react-v5": "^7.1.4",
"@iobroker/adapter-react-v5": "^7.4.12",
"@iobroker/vis-2-widgets-react-dev": "^4.0.4",
"@mui/icons-material": "^6.1.8",
"@mui/material": "^6.1.8",
"@sentry/browser": "^8.40.0",
"@mui/icons-material": "^6.3.1",
"@mui/material": "^6.3.1",
"@sentry/browser": "^8.48.0",
"craco-esbuild": "^0.6.1",
"craco-module-federation": "^1.1.0",
"node-sass": "^9.0.0",
Expand All @@ -19,10 +19,10 @@
"react-scripts": "^5.0.1",
"eslint": "^8.57.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-react": "^7.36.1",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-react": "^7.37.4",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-eqeqeq-fix": "^1.0.3",
"eslint-plugin-only-warn": "^1.1.0",
"sass": "^1.83.1"
Expand Down
18 changes: 15 additions & 3 deletions src/lib/ChartModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,9 @@ class ChartModel {
convert = `return ${convert}`;
}
try {
this.convertFunctions[line.convert.trim()] = new Function('val', convert) as (val: number) => number;
this.convertFunctions[line.convert.trim()] = new Function('val', convert) as (
val: number,
) => number;
} catch (e) {
console.error(`[ChartModel] Cannot parse convert function: ${e}`);
}
Expand Down Expand Up @@ -1253,8 +1255,18 @@ class ChartModel {

// add start and end
if (line.chartType !== 'bar' && line.chartType !== 'polar') {
let end: number = typeof option.end === 'number' ? option.end : (option.end as Date).getTime();
const start: number = typeof option.start === 'number' ? option.start : (option.start as Date).getTime();
let end: number =
typeof option.end === 'number'
? option.end
: typeof option.end === 'string'
? new Date(option.end).getTime()
: (option.end as Date).getTime();
const start: number =
typeof option.start === 'number'
? option.start
: typeof option.start === 'string'
? new Date(option.start).getTime()
: (option.start as Date).getTime();
// End cannot be in the future
if (end > this.now) {
end = this.now;
Expand Down
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* ioBroker echarts Adapter
*
* (c) 2020-2024 bluefox <[email protected]>
* (c) 2020-2025 bluefox <[email protected]>
*
* MIT License
*
Expand All @@ -25,7 +25,7 @@ import 'moment/locale/de';
import type { EchartsOptions, Connection, ChartConfigMore } from './types';
import { getSocket } from './lib/socketSimulator';
import { type EChartsType, init as echartsInit } from 'echarts';
import type { Canvas, JpegConfig, PdfConfig, PngConfig } from 'canvas';
import { Canvas, type JpegConfig, type PdfConfig, type PngConfig } from 'canvas';
import { type JSDOM } from 'jsdom';

// let echartsInit:
Expand Down Expand Up @@ -132,7 +132,7 @@ class EchartsAdapter extends Adapter {
data = `data:image/png;base64,${canvas
.toBuffer('image/png', {
compressionLevel: options.compressionLevel || 3,
filters: options.filters || canvas.PNG_FILTER_NONE,
filters: options.filters || Canvas.PNG_FILTER_NONE,
} as PngConfig)
.toString('base64')}`;
break;
Expand Down
2 changes: 1 addition & 1 deletion tasksChart.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2018-2024 bluefox <[email protected]>
* Copyright 2018-2025 bluefox <[email protected]>
*
* MIT License
*
Expand Down
2 changes: 1 addition & 1 deletion tasksEdit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2018-2024 bluefox <[email protected]>
* Copyright 2018-2025 bluefox <[email protected]>
*
* MIT License
*
Expand Down
2 changes: 1 addition & 1 deletion tasksPreview.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2018-2024 bluefox <[email protected]>
* Copyright 2018-2025 bluefox <[email protected]>
*
* MIT License
*
Expand Down
2 changes: 1 addition & 1 deletion tasksWidgets.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2023-2024 bluefox <[email protected]>
* Copyright 2023-2025 bluefox <[email protected]>
*
* MIT License
*
Expand Down
4 changes: 2 additions & 2 deletions widgets/echarts.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!--
ioBroker.echarts high quality Widget-Set
version: "1.9.0"
version: "2.0.4"
Copyright 2019-2024 bluefox <[email protected]>
Copyright 2019-2025 bluefox <[email protected]>
-->
<script type="text/javascript" >
Expand Down
Loading

0 comments on commit 7e09c8d

Please sign in to comment.