@brandonlukas/luminar 0.2.1 → 0.2.2
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/bin/luminar.mjs +24 -1
- package/package.json +2 -2
package/bin/luminar.mjs
CHANGED
|
@@ -3,7 +3,30 @@ import { readFileSync, writeFileSync, existsSync } from 'node:fs'
|
|
|
3
3
|
import { resolve, dirname } from 'node:path'
|
|
4
4
|
import { fileURLToPath } from 'node:url'
|
|
5
5
|
import { spawn } from 'node:child_process'
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
// Inline CSV parser to avoid module resolution issues
|
|
8
|
+
function parseCsv(text) {
|
|
9
|
+
const lines = text.split(/\r?\n/).filter(Boolean)
|
|
10
|
+
const rows = []
|
|
11
|
+
let skippedHeader = false
|
|
12
|
+
|
|
13
|
+
for (const line of lines) {
|
|
14
|
+
const parts = line.split(/[,\s]+/).filter(Boolean)
|
|
15
|
+
if (parts.length < 4) continue
|
|
16
|
+
|
|
17
|
+
const [x, y, dx, dy] = parts.map(Number)
|
|
18
|
+
if ([x, y, dx, dy].some((n) => Number.isNaN(n))) {
|
|
19
|
+
if (!skippedHeader && rows.length === 0) {
|
|
20
|
+
skippedHeader = true
|
|
21
|
+
console.log('skipping header line:', line.substring(0, 60))
|
|
22
|
+
}
|
|
23
|
+
continue
|
|
24
|
+
}
|
|
25
|
+
rows.push({ x, y, dx, dy })
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return rows
|
|
29
|
+
}
|
|
7
30
|
|
|
8
31
|
const __filename = fileURLToPath(import.meta.url)
|
|
9
32
|
const __dirname = dirname(__filename)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brandonlukas/luminar",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Visualize 2D vector fields as looping particle flows with bloom and glow effects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Brandon Lukas",
|
|
@@ -47,4 +47,4 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"three": "^0.182.0"
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}
|