uplot-webgpu 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.
Files changed (50) hide show
  1. package/CANVAS_PROXY.md +602 -0
  2. package/README.md +854 -0
  3. package/favicon.ico +0 -0
  4. package/index.html +14 -0
  5. package/index.js +21 -0
  6. package/original/paths.canvas2d/bars.js +252 -0
  7. package/original/paths.canvas2d/catmullRomCentrip.js +125 -0
  8. package/original/paths.canvas2d/linear.js +170 -0
  9. package/original/paths.canvas2d/monotoneCubic.js +68 -0
  10. package/original/paths.canvas2d/points.js +66 -0
  11. package/original/paths.canvas2d/spline.js +103 -0
  12. package/original/paths.canvas2d/stepped.js +124 -0
  13. package/original/paths.canvas2d/utils.js +301 -0
  14. package/original/uPlot.canvas2d.js +3548 -0
  15. package/package.json +110 -0
  16. package/paths/bars.js +253 -0
  17. package/paths/catmullRomCentrip.js +126 -0
  18. package/paths/linear.js +171 -0
  19. package/paths/monotoneCubic.js +69 -0
  20. package/paths/points.js +67 -0
  21. package/paths/spline.js +104 -0
  22. package/paths/stepped.js +125 -0
  23. package/paths/utils.js +301 -0
  24. package/scripts/uPlot.css +168 -0
  25. package/scripts/uPlot.d.ts +26 -0
  26. package/scripts/uPlot.js +3687 -0
  27. package/scripts/utils/dom.js +124 -0
  28. package/scripts/utils/domClasses.js +22 -0
  29. package/scripts/utils/feats.js +13 -0
  30. package/scripts/utils/fmtDate.js +398 -0
  31. package/scripts/utils/opts.js +844 -0
  32. package/scripts/utils/strings.js +22 -0
  33. package/scripts/utils/sync.js +27 -0
  34. package/scripts/utils/utils.js +692 -0
  35. package/scripts/webgpu/GPUPath.d.ts +46 -0
  36. package/scripts/webgpu/GPUPath.js +633 -0
  37. package/scripts/webgpu/GPUPath.ts +634 -0
  38. package/scripts/webgpu/WebGPURenderer.d.ts +176 -0
  39. package/scripts/webgpu/WebGPURenderer.js +4256 -0
  40. package/scripts/webgpu/WebGPURenderer.ts +4257 -0
  41. package/scripts/webgpu/browserSmokeHarness.js +105 -0
  42. package/scripts/webgpu/exporters.d.ts +8 -0
  43. package/scripts/webgpu/exporters.js +212 -0
  44. package/scripts/webgpu/shaders.d.ts +2 -0
  45. package/scripts/webgpu/shaders.js +76 -0
  46. package/scripts/webgpu/shaders.ts +77 -0
  47. package/scripts/webgpu/smokeTest.d.ts +2 -0
  48. package/scripts/webgpu/smokeTest.js +144 -0
  49. package/scripts/webgpu/webgpu-ambient.d.ts +41 -0
  50. package/tinybuild.config.js +109 -0
@@ -0,0 +1,109 @@
1
+ const config = {
2
+ //build:true, //enable this to skip serve step (same as cli)
3
+ //serve:true //or enable this to skip build step (same as cli)
4
+ bundler: { //esbuild settings, set false to skip build step or add bundle:true to config object to only bundle (alt methods)
5
+ entryPoints: [ //entry point file(s). These can include .js, .mjs, .ts, .jsx, .tsx, or other javascript files. Make sure your entry point is a ts file if you want to generate types
6
+ // "./scripts/build/bench_demo.js"
7
+ "./index.js"
8
+ ],
9
+ outfile: "dist/uPlot", //"dist/demo.js" //exit point file, will append .js as well as indicators like .esm.js, .node.js for other build flags
10
+ //outdir:'dist', //exit point folder, define for multiple entryPoints
11
+
12
+ //we can run multiple esbuild configs separately, set to true to target different outputs, we'll put it all in the dist in a way that keeps the files separate (e.g. index.js for the browser, index.esm.js for esm, index.node.js for node, or if only 1 bundler specified just index.js for any, it's the most general) when using multiple bundlers, additionally when specifying an outdir instead of outfile.
13
+ bundleBrowser: true, //create plain js build? Can include globals and init scripts
14
+ bundleESM: true, //create esm module js files
15
+ bundleTypes: false, //create .d.ts files, //you need a .tsconfig for this to work
16
+ bundleNode: false, //create node platform plain js build, specify platform:'node' to do the rest of the files
17
+ bundleHTML: false, //wrap the first entry point file as a plain js script in a boilerplate html file, frontend scripts can be run standalone like a .exe! Server serves this as start page if set to true.
18
+ //bundleIIFE:false, //create an iife build, this is compiled temporarily to create the types files and only saved with bundleIIFE:true
19
+ //bundleCommonJS:false, //cjs format outputted as .cjs
20
+ minify: true,
21
+ sourcemap: false,
22
+ //plugins:[] //custom esbuild plugins? e.g. esbuild-sass-plugin for scss support
23
+ //includeDefaultPlugins:true //true by default, includes the presets for the streaming imports, worker bundling, and auto npm install
24
+ //blobWorkers:true, //package workers as blobs or files? blobs are faster but inflate the main package size
25
+ //workerBundler:{minifyWhitespace:true} //bundler settings specific to the worker. e.g. apply platform:'node' when bundling node workers,
26
+ globalThis:'uPlot' //'mymodule'
27
+ //globals:{'index.js':['Graph']}
28
+ //init:{'index.js':function(bundle) { console.log('prepackaged bundle script!', bundle); }.toString(); }
29
+ // outputs:{ //overwrites main config settings for specific use cases, you can also just use objects instead of booleans on the above toggles for bundler modes
30
+ // node:{ //e.g. for bundleNode
31
+ // // external:[] //externals for node environment builds
32
+ // },
33
+ // //commonjs:{} //bundleCommonJS
34
+ // //browser:{}
35
+ // //esm:{}
36
+ // iife:{
37
+ // // external:[] //we only use the iife for types so it doesn't really matter if it bundles node, just note otherwise if you need iife for some obscure reason
38
+ // }
39
+ // },
40
+
41
+ //refer to esbuild docs for more settings
42
+ //platform:'node'//etc
43
+ //loader:{ '.xml':'file', '.html':'text' } //etc etc, we supply a bunch of these for you you can copy typical files by default or import html text etc.
44
+ },
45
+ server: { //node server settings, set false to skip server step or add serve:true to config object to only serve (alt methods)
46
+ debug: false,
47
+ protocol: "http", //'http' or 'https'. HTTPS required for Nodejs <---> Python sockets. If using http, set production to False in python/server.py as well
48
+ host: "localhost", //'localhost' or '127.0.0.1' etc.
49
+ port: 8080, //e.g. port 80, 443, 8000
50
+ //redirect: 'http://localhost:8082', //instead of serving the default content, redirect to another url
51
+ //headers: { 'Content-Security-Policy': '*' }, //global header overrides
52
+ startpage: 'index.html', //default home page/app entry point
53
+ hotreload: 5000, //hotreload websocket server port
54
+ socket_protocol: "ws", //frontend socket protocol, wss for served, ws for localhost
55
+ /*
56
+ routes:{ //set additional page routes (for sites instead of single page applications)
57
+ '/page2': 'mypage.html',
58
+ '/custom':{ //e.g. custom page template
59
+ headers: { 'Content-Security-Policy': '*' }, //page specific headers
60
+ template:'<html><head></head><body><div>Hello World!</div></body></html>'
61
+ //path: 'mypage.html' //or a file path (e.g. plus specific headers)
62
+ //onrequest: (request,response) => {}, //custom request/response handling, return true to prevent any default response handling afterward
63
+ },
64
+ '/redirect':{ //e.g. custom redirect
65
+ redirect:'https://google.com'
66
+ },
67
+ '/other':(request,response) => {}, //custom request/response handling, return true to prevent any default response handling afterward
68
+ '/': 'index.html', //alt start page declaration
69
+ '/404':'packager/node_server/other/404.html', //e.g. custom error page
70
+ // ─── Example parameterized routes ─────────────────────────────────
71
+ '/user/:userId/:action':{ // e.g. GET /user/42/edit
72
+ onrequest: (req,res) => {
73
+ const { userId, action } = req.params;
74
+ res.end(`User ${userId} wants to ${action}`);
75
+ return true; // signal “handled”
76
+ }
77
+ },
78
+ '/product/:productId': 'product.html',// serve same template for any product
79
+ '/posts/:year/:month/:slug':{ // e.g. /posts/2025/05/awesome-post
80
+ template:'<h1>Blog post here…</h1>'
81
+ }
82
+ },
83
+ */
84
+ //reloadscripts: false, //hot swap scripts, can break things if script handles initializations, otherwise css, link, srcs all hot swap without page reloading fairly intelligently
85
+ //delay: 50, //millisecond delay on the watch command for hot reloading
86
+ //pwa: "service-worker.js", //pwa mode? Injects service worker webpage code to live site, will create a service worker and webmanifest for you if not existent
87
+ //watch: ['../'], //watch additional directories other than the current working directory
88
+ //ignore:['./assets'], //ignore these paths
89
+ //extensions:['pdf'], //custom file extensions to watch
90
+ errpage: 'node_modules/tinybuild/tinybuild/node_server/other/404.html', //default error page, etc.
91
+ certpath: 'node_modules/tinybuild/tinybuild/node_server/ssl/server.crt',//if using https, this is required. See cert.pfx.md for instructions
92
+ keypath: 'node_modules/tinybuild/tinybuild/node_server/ssl/server.key'//if using https, this is required. See cert.pfx.md for instructions
93
+ //python: false,//7000, //quart server port (configured via the python server script file still)
94
+ //python_node:7001, //websocket relay port (relays messages to client from nodejs that were sent to it by python)
95
+ },
96
+ /*
97
+ mobile:{ //this will copy the dist and index.html to capacitor builds that can create small interoperable javascript webview + native functionality (e.g. bluetooth) mobile apps (~2Mb at minimum).
98
+ android:'open', //'open'//true //Requires Android Studio, it will be launched
99
+ ios:false //'open'//true //Requires XCode
100
+ },
101
+ electron:true, //desktop apps as a full chromium bundle, not small and needs some customization for things like bluetooth menus. Better for full featured applications. Can trigger backend runtimes on local machines.
102
+ tauri:true, //alternative tauri build options for very minimal native engine desktop apps that generally lack the latest web APIs. Good for simple apps, you can bundle it with backend runtimes on local machines.
103
+ assets:[ //for the mobile/desktop bundlers to copy into their respective folders
104
+ './assets',
105
+ './favicon.ico'
106
+ ]
107
+ */
108
+ }
109
+ export default config; //module.exports = config; //es5