@eox/chart 2.0.0-alpha1 → 2.0.0-alpha10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/assets/main-ec32ac01.js +25 -0
- package/dist/index.html +25 -5
- package/dist/interface.mjs +84 -22
- package/dist/interface.umd.js +1 -1
- package/package.json +9 -2
- package/src/chartControls.ts +165 -19
- package/src/interface.ts +20 -1
- package/src/main.ts +37 -3
- package/src/signalsDataManager.ts +355 -31
- package/.eslintignore +0 -2
- package/.eslintrc.js +0 -9
- package/.prettierignore +0 -2
- package/cypress/e2e/general.cy.ts +0 -34
- package/cypress/e2e/sh.json +0 -417
- package/cypress/e2e/shDisplay.cy.ts +0 -26
- package/cypress/e2e/signalsEndpoint.cy.ts +0 -100
- package/cypress.config.ts +0 -11
- package/dist/assets/main-800e32b1.js +0 -23
- package/index.html +0 -62
- package/public/interface.mjs +0 -46
- package/public/interface.umd.js +0 -1
- package/public/test.html +0 -23
- package/test.html +0 -23
- package/tsconfig.json +0 -21
- package/vite.config.interface.ts +0 -19
- package/vite.config.map.ts +0 -15
package/index.html
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<title>Simple Chart</title>
|
|
6
|
-
<style>
|
|
7
|
-
html,
|
|
8
|
-
body {
|
|
9
|
-
margin: 0;
|
|
10
|
-
padding: 0;
|
|
11
|
-
}
|
|
12
|
-
html,
|
|
13
|
-
body,
|
|
14
|
-
.chart {
|
|
15
|
-
width: 100%;
|
|
16
|
-
height: 100%;
|
|
17
|
-
}
|
|
18
|
-
.hidden {
|
|
19
|
-
visibility: hidden;
|
|
20
|
-
}
|
|
21
|
-
.loader {
|
|
22
|
-
position: absolute;
|
|
23
|
-
top: 5px;
|
|
24
|
-
right: 30px;
|
|
25
|
-
width: 24px;
|
|
26
|
-
height: 24px;
|
|
27
|
-
border-radius: 50%;
|
|
28
|
-
display: inline-block;
|
|
29
|
-
border-top: 4px solid #000;
|
|
30
|
-
border-right: 4px solid transparent;
|
|
31
|
-
box-sizing: border-box;
|
|
32
|
-
animation: rotation 1s linear infinite;
|
|
33
|
-
}
|
|
34
|
-
.loader::after {
|
|
35
|
-
content: '';
|
|
36
|
-
box-sizing: border-box;
|
|
37
|
-
position: absolute;
|
|
38
|
-
left: 0;
|
|
39
|
-
top: 0;
|
|
40
|
-
width: 24px;
|
|
41
|
-
height: 24px;
|
|
42
|
-
border-radius: 50%;
|
|
43
|
-
border-left: 4px solid #004170;
|
|
44
|
-
border-bottom: 4px solid transparent;
|
|
45
|
-
animation: rotation 0.5s linear infinite reverse;
|
|
46
|
-
}
|
|
47
|
-
@keyframes rotation {
|
|
48
|
-
0% {
|
|
49
|
-
transform: rotate(0deg);
|
|
50
|
-
}
|
|
51
|
-
100% {
|
|
52
|
-
transform: rotate(360deg);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
</style>
|
|
56
|
-
</head>
|
|
57
|
-
<body>
|
|
58
|
-
<div id="controls" class="controls" data-cy="controls"></div>
|
|
59
|
-
<canvas id="chart" class="chart" data-cy="chart"></canvas>
|
|
60
|
-
<script type="module" src="./src/main.ts"></script>
|
|
61
|
-
</body>
|
|
62
|
-
</html>
|
package/public/interface.mjs
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
var c = Object.defineProperty;
|
|
2
|
-
var d = (s, t, e) => t in s ? c(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
-
var l = (s, t, e) => (d(s, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
-
const p = new MessageChannel(), o = p.port1;
|
|
5
|
-
class h {
|
|
6
|
-
constructor(t) {
|
|
7
|
-
l(this, "iframe");
|
|
8
|
-
this.iframe = t;
|
|
9
|
-
}
|
|
10
|
-
setData(t) {
|
|
11
|
-
o.postMessage({ type: "setData", body: { data: t } });
|
|
12
|
-
}
|
|
13
|
-
setSignalsData(t) {
|
|
14
|
-
o.postMessage({ type: "setSignalsData", body: { data: t } });
|
|
15
|
-
}
|
|
16
|
-
setSignalsEndpoint(t) {
|
|
17
|
-
o.postMessage({ type: "setSignalsEndpoint", body: { options: t } });
|
|
18
|
-
}
|
|
19
|
-
setOptions(t) {
|
|
20
|
-
o.postMessage({ type: "setOptions", body: { options: t } });
|
|
21
|
-
}
|
|
22
|
-
getFoo() {
|
|
23
|
-
return new Promise((t) => {
|
|
24
|
-
const e = Date.now();
|
|
25
|
-
o.onmessage = (a) => {
|
|
26
|
-
a.data.ts === e && t(a.data.body);
|
|
27
|
-
}, o.postMessage({ ts: e, type: "getFoo", body: "hello world" });
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
const m = (s) => s ? new Promise((t) => {
|
|
32
|
-
var n, r;
|
|
33
|
-
const e = document.createElement("iframe");
|
|
34
|
-
e.style.cssText = "width: 100%; height: 100%; display: block; margin: 0; border: none;", e.setAttribute(
|
|
35
|
-
"src",
|
|
36
|
-
(r = (n = import.meta) == null ? void 0 : n.url) != null && r.includes("localhost") ? "http://localhost:5173/index.html" : "https://www.unpkg.com/@eox/chart/dist/index.html"
|
|
37
|
-
), e.setAttribute("id", "EOxChart"), s == null || s.appendChild(e);
|
|
38
|
-
let a = !1;
|
|
39
|
-
e.onload = () => {
|
|
40
|
-
var i;
|
|
41
|
-
a || ((i = e.contentWindow) == null || i.postMessage("init", "*", [p.port2]), a = !0, t(new h(e)));
|
|
42
|
-
};
|
|
43
|
-
}) : (console.error("no div selected"), null);
|
|
44
|
-
export {
|
|
45
|
-
m as createChart
|
|
46
|
-
};
|
package/public/interface.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports):typeof define=="function"&&define.amd?define(["exports"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.Interface={}))})(this,function(n){"use strict";var u=Object.defineProperty;var f=(n,e,o)=>e in n?u(n,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[e]=o;var c=(n,e,o)=>(f(n,typeof e!="symbol"?e+"":e,o),o);const e=new MessageChannel,o=e.port1;class l{constructor(t){c(this,"iframe");this.iframe=t}setData(t){o.postMessage({type:"setData",body:{data:t}})}setSignalsData(t){o.postMessage({type:"setSignalsData",body:{data:t}})}setSignalsEndpoint(t){o.postMessage({type:"setSignalsEndpoint",body:{options:t}})}setOptions(t){o.postMessage({type:"setOptions",body:{options:t}})}getFoo(){return new Promise(t=>{const s=Date.now();o.onmessage=a=>{a.data.ts===s&&t(a.data.body)},o.postMessage({ts:s,type:"getFoo",body:"hello world"})})}}const p=r=>r?new Promise(t=>{var i;const s=document.createElement("iframe");s.style.cssText="width: 100%; height: 100%; display: block; margin: 0; border: none;",s.setAttribute("src",(i=typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||new URL("interface.umd.js",document.baseURI).href)!=null&&i.includes("localhost")?"http://localhost:5173/index.html":"https://www.unpkg.com/@eox/chart/dist/index.html"),s.setAttribute("id","EOxChart"),r==null||r.appendChild(s);let a=!1;s.onload=()=>{var d;a||((d=s.contentWindow)==null||d.postMessage("init","*",[e.port2]),a=!0,t(new l(s)))}}):(console.error("no div selected"),null);n.createChart=p,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|
package/public/test.html
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<title>Simple Chart</title>
|
|
6
|
-
<style>
|
|
7
|
-
html,
|
|
8
|
-
body {
|
|
9
|
-
margin: 0;
|
|
10
|
-
padding: 0;
|
|
11
|
-
}
|
|
12
|
-
html,
|
|
13
|
-
body,
|
|
14
|
-
.chart {
|
|
15
|
-
width: 100%;
|
|
16
|
-
height: 100%;
|
|
17
|
-
}
|
|
18
|
-
</style>
|
|
19
|
-
</head>
|
|
20
|
-
<body>
|
|
21
|
-
<div id="chart" class="chart" data-cy="chart"></div>
|
|
22
|
-
</body>
|
|
23
|
-
</html>
|
package/test.html
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<title>Simple Chart</title>
|
|
6
|
-
<style>
|
|
7
|
-
html,
|
|
8
|
-
body {
|
|
9
|
-
margin: 0;
|
|
10
|
-
padding: 0;
|
|
11
|
-
}
|
|
12
|
-
html,
|
|
13
|
-
body,
|
|
14
|
-
.chart {
|
|
15
|
-
width: 100%;
|
|
16
|
-
height: 100%;
|
|
17
|
-
}
|
|
18
|
-
</style>
|
|
19
|
-
</head>
|
|
20
|
-
<body>
|
|
21
|
-
<canvas id="chart" class="chart" data-cy="chart"></canvas>
|
|
22
|
-
</body>
|
|
23
|
-
</html>
|
package/tsconfig.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"strictNullChecks": false,
|
|
4
|
-
"target": "ESNext",
|
|
5
|
-
"useDefineForClassFields": true,
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"lib": ["ESNext", "DOM"],
|
|
8
|
-
"moduleResolution": "Node",
|
|
9
|
-
"strict": true,
|
|
10
|
-
"resolveJsonModule": true,
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"noEmit": true,
|
|
13
|
-
"noUnusedLocals": true,
|
|
14
|
-
"noUnusedParameters": true,
|
|
15
|
-
"noImplicitReturns": true,
|
|
16
|
-
"skipLibCheck": true,
|
|
17
|
-
"typeRoots": ["./typings"],
|
|
18
|
-
"types": ["cypress"]
|
|
19
|
-
},
|
|
20
|
-
"include": ["**/*.ts"]
|
|
21
|
-
}
|
package/vite.config.interface.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "vite";
|
|
2
|
-
import { resolve } from "path";
|
|
3
|
-
|
|
4
|
-
// https://vitejs.dev/config/
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
build: {
|
|
7
|
-
emptyOutDir: false,
|
|
8
|
-
lib: {
|
|
9
|
-
entry: resolve(__dirname, "src/interface.ts"),
|
|
10
|
-
name: "Interface",
|
|
11
|
-
fileName: "interface",
|
|
12
|
-
},
|
|
13
|
-
rollupOptions: {
|
|
14
|
-
output: {
|
|
15
|
-
dir: "public",
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
});
|
package/vite.config.map.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "vite";
|
|
2
|
-
import { resolve } from "path";
|
|
3
|
-
|
|
4
|
-
// https://vitejs.dev/config/
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
base: "./",
|
|
7
|
-
build: {
|
|
8
|
-
// emptyOutDir: false,
|
|
9
|
-
rollupOptions: {
|
|
10
|
-
input: {
|
|
11
|
-
main: resolve(__dirname, "index.html"),
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
});
|