@dschz/solid-uplot 0.1.0
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/LICENSE +21 -0
- package/README.md +771 -0
- package/dist/chunk/3TJS44N7.js +15 -0
- package/dist/chunk/A3AZKFSW.jsx +27 -0
- package/dist/chunk/ZISGD6FJ.js +25 -0
- package/dist/createPluginBus-B_Gp5BCB.d.ts +21 -0
- package/dist/getCursorData-2qxURGuZ.d.ts +44 -0
- package/dist/getSeriesData-D1zBqQ9Y.d.ts +37 -0
- package/dist/index/index.d.ts +44 -0
- package/dist/index/index.js +117 -0
- package/dist/index/index.jsx +135 -0
- package/dist/plugins/index.d.ts +443 -0
- package/dist/plugins/index.js +342 -0
- package/dist/plugins/index.jsx +347 -0
- package/dist/utils/index.d.ts +24 -0
- package/dist/utils/index.js +26 -0
- package/package.json +116 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { C as CursorData, g as getCursorData } from '../getCursorData-2qxURGuZ.js';
|
|
2
|
+
import uPlot from 'uplot';
|
|
3
|
+
export { S as SeriesDatum, g as getSeriesData } from '../getSeriesData-D1zBqQ9Y.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Utility to get a color string from uPlot stroke or fill values
|
|
7
|
+
*
|
|
8
|
+
* @param fillOrStroke - The uPlot series fill or stroke value
|
|
9
|
+
* @param fallback - The fallback color string
|
|
10
|
+
* @returns The color string
|
|
11
|
+
*/
|
|
12
|
+
declare const getColorString: (fillOrStroke?: string | CanvasGradient | CanvasPattern, fallback?: string) => string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Returns the indices where a new calendar day (in UTC) begins within the given x-values series.
|
|
16
|
+
*
|
|
17
|
+
* This uses `toISOString().split("T")[0]` to derive a "YYYY-MM-DD" key.
|
|
18
|
+
*
|
|
19
|
+
* @param u - The uPlot instance.
|
|
20
|
+
* @returns The indices where a new calendar day begins.
|
|
21
|
+
*/
|
|
22
|
+
declare function getNewCalendarDayIndices(u: uPlot): number[];
|
|
23
|
+
|
|
24
|
+
export { getColorString, getNewCalendarDayIndices };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export { getCursorData } from '../chunk/3TJS44N7.js';
|
|
2
|
+
export { getSeriesData } from '../chunk/ZISGD6FJ.js';
|
|
3
|
+
import 'uplot';
|
|
4
|
+
|
|
5
|
+
// src/utils/getColorString.ts
|
|
6
|
+
var getColorString = (fillOrStroke, fallback = "#888") => {
|
|
7
|
+
return typeof fillOrStroke === "string" ? fillOrStroke : fallback;
|
|
8
|
+
};
|
|
9
|
+
function getNewCalendarDayIndices(u) {
|
|
10
|
+
const xValues = u.data[0];
|
|
11
|
+
if (!xValues || !xValues.length) return [];
|
|
12
|
+
const seen = /* @__PURE__ */ new Set();
|
|
13
|
+
const indices = [];
|
|
14
|
+
for (let i = 0; i < xValues.length; i++) {
|
|
15
|
+
const ts = xValues[i];
|
|
16
|
+
const date = new Date(ts);
|
|
17
|
+
const dayString = date.toISOString().split("T")[0];
|
|
18
|
+
if (!seen.has(dayString)) {
|
|
19
|
+
seen.add(dayString);
|
|
20
|
+
indices.push(i);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return indices;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { getColorString, getNewCalendarDayIndices };
|
package/package.json
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dschz/solid-uplot",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "SolidJS wrapper for uPlot — ultra-fast, tiny time-series & charting library",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"author": "Daniel Sanchez <dsanc89@pm.me>",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://github.com/dsnchz/solid-uplot#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/dsnchz/solid-uplot.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/dsnchz/solid-uplot/issues"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"main": "./dist/index/index.js",
|
|
23
|
+
"module": "./dist/index/index.js",
|
|
24
|
+
"types": "./dist/index/index.d.ts",
|
|
25
|
+
"browser": {},
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"solid": "./dist/index/index.jsx",
|
|
29
|
+
"import": {
|
|
30
|
+
"types": "./dist/index/index.d.ts",
|
|
31
|
+
"default": "./dist/index/index.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"./plugins": {
|
|
35
|
+
"solid": "./dist/plugins/index.jsx",
|
|
36
|
+
"import": {
|
|
37
|
+
"types": "./dist/plugins/index.d.ts",
|
|
38
|
+
"default": "./dist/plugins/index.js"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"./utils": {
|
|
42
|
+
"import": {
|
|
43
|
+
"types": "./dist/utils/index.d.ts",
|
|
44
|
+
"default": "./dist/utils/index.js"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"typesVersions": {
|
|
49
|
+
"*": {
|
|
50
|
+
"plugins": [
|
|
51
|
+
"./dist/plugins/index.d.ts"
|
|
52
|
+
],
|
|
53
|
+
"utils": [
|
|
54
|
+
"./dist/utils/index.d.ts"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "tsup",
|
|
60
|
+
"build:watch": "tsup --watch",
|
|
61
|
+
"dev": "vite",
|
|
62
|
+
"format": "prettier . --check",
|
|
63
|
+
"format:fix": "prettier . --write",
|
|
64
|
+
"lint": "eslint .",
|
|
65
|
+
"lint:fix": "eslint . --fix",
|
|
66
|
+
"pkg:changeset": "changeset",
|
|
67
|
+
"pkg:version": "changeset version",
|
|
68
|
+
"pkg:publish": "bun run build && changeset publish",
|
|
69
|
+
"serve": "vite preview",
|
|
70
|
+
"start": "vite",
|
|
71
|
+
"test": "vitest run",
|
|
72
|
+
"test:cov": "vitest run --coverage",
|
|
73
|
+
"typecheck": "tsc --noEmit"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@changesets/cli": "^2.29.3",
|
|
77
|
+
"@dschz/solid-auto-sizer": "^0.1.0",
|
|
78
|
+
"@solidjs/router": "^0.15.3",
|
|
79
|
+
"@solidjs/testing-library": "^0.8.10",
|
|
80
|
+
"@tailwindcss/vite": "^4.1.5",
|
|
81
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
82
|
+
"@testing-library/user-event": "^14.6.1",
|
|
83
|
+
"@types/bun": "^1.2.12",
|
|
84
|
+
"@types/prismjs": "^1.26.3",
|
|
85
|
+
"@typescript-eslint/eslint-plugin": "^8.32.0",
|
|
86
|
+
"@typescript-eslint/parser": "^8.32.0",
|
|
87
|
+
"@vitest/coverage-istanbul": "^3.1.3",
|
|
88
|
+
"@wessberg/pointer-events": "^1.0.9",
|
|
89
|
+
"canvas": "^3.1.0",
|
|
90
|
+
"eslint": "^9.26.0",
|
|
91
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
92
|
+
"eslint-plugin-solid": "^0.14.5",
|
|
93
|
+
"globals": "^16.1.0",
|
|
94
|
+
"jiti": "^2.4.2",
|
|
95
|
+
"jsdom": "^26.1.0",
|
|
96
|
+
"path2d": "^0.2.2",
|
|
97
|
+
"prettier": "^3.5.3",
|
|
98
|
+
"prismjs": "^1.29.0",
|
|
99
|
+
"solid-js": "^1.9.6",
|
|
100
|
+
"solid-prism-editor": "^2.0.0",
|
|
101
|
+
"tailwindcss": "^4.1.5",
|
|
102
|
+
"tsup": "^8.4.0",
|
|
103
|
+
"tsup-preset-solid": "^2.2.0",
|
|
104
|
+
"typescript": "^5.8.3",
|
|
105
|
+
"typescript-eslint": "^8.32.0",
|
|
106
|
+
"uplot": "^1.6.32",
|
|
107
|
+
"vite": "^6.3.5",
|
|
108
|
+
"vite-plugin-solid": "^2.11.6",
|
|
109
|
+
"vitest": "^3.1.3"
|
|
110
|
+
},
|
|
111
|
+
"peerDependencies": {
|
|
112
|
+
"solid-js": ">=1.6.0",
|
|
113
|
+
"uplot": ">=1.6.32"
|
|
114
|
+
},
|
|
115
|
+
"dependencies": {}
|
|
116
|
+
}
|