Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93e986b2cb | ||
|
|
6e2d5ff80c | ||
|
|
c4f8a51359 | ||
|
|
50ca46fee6 | ||
|
|
3f8f67823b | ||
|
|
2543673bd8 | ||
|
|
d664026ee5 | ||
|
|
38162d4b89 | ||
|
|
d4118072f6 | ||
|
|
f85021d40d | ||
|
|
9989dd3062 | ||
|
|
06953028ab | ||
|
|
2f0c26e9b8 | ||
|
|
4372ba4105 | ||
|
|
f47237696e | ||
|
|
190c8bc982 | ||
|
|
b6aa0635ae | ||
|
|
a560a1a72b | ||
|
|
24d3c1149d | ||
|
|
16a3d3aa26 | ||
|
|
011883a6a8 | ||
|
|
b2cd242390 | ||
|
|
bfeeb958df | ||
|
|
04b56c6ef2 | ||
|
|
19fea0b0a1 | ||
|
|
e7f238aebc | ||
|
|
57182188ba | ||
|
|
4b42391a46 | ||
|
|
9d628aa3c8 | ||
|
|
32c0ecfa76 | ||
|
|
1c222771a5 | ||
|
|
71bd320661 | ||
|
|
6c16998691 | ||
|
|
8d78af1246 | ||
|
|
899d4f2418 | ||
|
|
f7ac4ab290 | ||
|
|
d332d447aa | ||
|
|
a94d6a7de5 | ||
|
|
7336c7fb22 | ||
|
|
3a7723c586 | ||
|
|
a5a7fc575f | ||
|
|
827eb97203 | ||
|
|
3cca0cffc5 | ||
|
|
d36828bde2 | ||
|
|
ed0048c795 | ||
|
|
b316edbaf9 | ||
|
|
c1b0c41ef2 | ||
|
|
3bb75d49de | ||
|
|
3d77cb448a | ||
|
|
49383c0003 | ||
|
|
7d821b9c1c | ||
|
|
9b7e387ea6 | ||
|
|
b4f0d1891e | ||
|
|
0da30b6d6b | ||
|
|
6cbb728d9a | ||
|
|
ff92451a76 | ||
|
|
60485bc06a | ||
|
|
f6f299c3e5 | ||
|
|
66485f5c59 | ||
|
|
5f9ff9bcc9 | ||
|
|
35730b36f0 | ||
|
|
d516833cc3 | ||
|
|
220be64dec | ||
|
|
b433477c64 | ||
|
|
43b7047c57 | ||
|
|
167417d1ec | ||
|
|
fb8141b320 | ||
|
|
96712dda88 | ||
|
|
f5a7b42e7c | ||
|
|
1b1e9d727e | ||
|
|
668d29b786 | ||
|
|
e5f42e099e | ||
|
|
a9edda38ef | ||
|
|
edec5ff460 | ||
|
|
264eb7296f | ||
|
|
fbd4295302 | ||
|
|
7bdb324ebc | ||
|
|
28b19b5219 | ||
|
|
75ddd559c9 | ||
|
|
5a1067263a | ||
|
|
e67de6215a | ||
|
|
7179b6531e | ||
|
|
fd618d7714 | ||
|
|
d1ffb857c8 | ||
|
|
f8eba0ee7e | ||
|
|
e6b5bf2cf1 | ||
|
|
fbae75b957 | ||
|
|
93476655fc | ||
|
|
09a87b79d2 | ||
|
|
ec39df00fc | ||
|
|
43d494bcb9 | ||
|
|
fed312a397 | ||
|
|
63235c7822 | ||
|
|
5badf17719 | ||
|
|
4597573ac5 | ||
|
|
1550122ced | ||
|
|
b7c45fd72c | ||
|
|
9479d0d292 | ||
|
|
3698385af4 | ||
|
|
ef968ebe39 | ||
|
|
a5432db99a | ||
|
|
764d918d5b | ||
|
|
edadb40cb6 | ||
|
|
9323719a85 | ||
|
|
91de705647 | ||
|
|
3ee7b74152 | ||
|
|
98bbdcbb3d | ||
|
|
a2abd3e833 | ||
|
|
550217c443 | ||
|
|
2d2032e8b9 | ||
|
|
81bf4dded5 | ||
|
|
a75e27e3d2 | ||
|
|
13538c39a6 | ||
|
|
7b724e9ce1 | ||
|
|
aaca5435e9 | ||
|
|
b64dacc1c3 | ||
|
|
8689bdb6ef | ||
|
|
c178e87966 | ||
|
|
dfe7ae50d2 | ||
|
|
8e87559af6 | ||
|
|
aa3546e9ac | ||
|
|
b56af23cbf | ||
|
|
ac9fca8d4b | ||
|
|
0fdc11c0b0 | ||
|
|
91bd78ab31 | ||
|
|
2be0640622 | ||
|
|
0e96223bf6 | ||
|
|
d8b33923d5 | ||
|
|
4ce515be1c | ||
|
|
f88bf03939 | ||
|
|
7cd4a91350 | ||
|
|
d907ca37ad | ||
|
|
6c6ed22dbe | ||
|
|
00514f0525 | ||
|
|
cf1d831b5a | ||
|
|
fd37183400 | ||
|
|
5fdeb57b74 | ||
|
|
1576383d09 | ||
|
|
8503315bef | ||
|
|
928263fbd8 | ||
|
|
7e33f7db6a | ||
|
|
e74ef6d64f | ||
|
|
3ed435824c | ||
|
|
d7fabf58a4 | ||
|
|
a7e921805a | ||
|
|
c56739c5fa | ||
|
|
fd52e40d17 | ||
|
|
f48c8789c7 | ||
|
|
80ff216e54 | ||
|
|
1fb3dee942 | ||
|
|
a4502055fb | ||
|
|
6e61ec8de6 | ||
|
|
48d02f0e70 | ||
|
|
cacaa3505e | ||
|
|
97ffc69b12 | ||
|
|
9f37dbbff0 | ||
|
|
df37f15f73 | ||
|
|
9c43a0a22b | ||
|
|
d41faddfca | ||
|
|
9e2409430c | ||
|
|
5f6e45af09 | ||
|
|
cccda24448 | ||
|
|
5cca60d830 | ||
|
|
ac750a36e7 | ||
|
|
01f373f0bd | ||
|
|
d00d21e2b6 | ||
|
|
deca1b6c37 | ||
|
|
5c35e68ab2 | ||
|
|
8b6bbdeb56 | ||
|
|
09bc09cca3 | ||
|
|
e57feda131 | ||
|
|
3242aa464b | ||
|
|
72b7ba39ef | ||
|
|
c2a0cfaef4 | ||
|
|
4c3337a232 | ||
|
|
825ae1f637 | ||
|
|
14a70cb024 | ||
|
|
425511d41f | ||
|
|
3e5239f3c6 |
No files matched your search
@@ -0,0 +1,3 @@
|
||||
# graphify
|
||||
- **graphify** (`.claude/skills/graphify/SKILL.md`) - any input to knowledge graph. Trigger: `/graphify`
|
||||
When the user types `/graphify`, use the installed graphify skill or instructions before doing anything else.
|
||||
@@ -0,0 +1 @@
|
||||
0.9.101
|
||||
@@ -0,0 +1,797 @@
|
||||
---
|
||||
name: graphify
|
||||
description: "Use for any question about a codebase, its architecture, file relationships, or project content — especially when graphify-out/ exists, where the question should be treated as a graphify query first. Turns any input (code, docs, papers, images, videos) into a persistent knowledge graph with god nodes, community detection, and query/path/explain tools."
|
||||
---
|
||||
|
||||
# /graphify
|
||||
|
||||
Turn any folder of files into a navigable knowledge graph with community detection, an honest audit trail, and three outputs: interactive HTML, GraphRAG-ready JSON, and a plain-language GRAPH_REPORT.md.
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
/graphify # full pipeline on current directory (HTML viz; add --obsidian for a vault)
|
||||
/graphify <path> # full pipeline on specific path
|
||||
/graphify https://github.com/<owner>/<repo> # clone repo then run full pipeline on it
|
||||
/graphify https://github.com/<owner>/<repo> --branch <branch> # clone a specific branch
|
||||
/graphify <url1> <url2> ... # clone multiple repos, build each, merge into one cross-repo graph
|
||||
/graphify <path> --mode deep # thorough extraction, richer INFERRED edges
|
||||
/graphify <path> --update # incremental - re-extract only new/changed files
|
||||
/graphify <path> --directed # build directed graph (preserves edge direction: source→target)
|
||||
/graphify <path> --whisper-model medium # use a larger Whisper model for better transcription accuracy
|
||||
/graphify <path> --cluster-only # rerun clustering on existing graph
|
||||
/graphify <path> --no-viz # skip visualization, just report + JSON
|
||||
/graphify <path> --html # (HTML is generated by default - this flag is a no-op)
|
||||
/graphify <path> --svg # also export graph.svg (embeds in Notion, GitHub)
|
||||
/graphify <path> --graphml # export graph.graphml (Gephi, yEd)
|
||||
/graphify <path> --neo4j # generate graphify-out/cypher.txt for Neo4j
|
||||
/graphify <path> --neo4j-push bolt://localhost:7687 # push directly to Neo4j
|
||||
/graphify <path> --falkordb # generate graphify-out/cypher.txt for FalkorDB
|
||||
/graphify <path> --falkordb-push falkordb://localhost:6379 # push directly to FalkorDB
|
||||
/graphify <path> --mcp # start MCP stdio server for agent access
|
||||
/graphify <path> --watch # watch folder, auto-rebuild on code changes (no LLM needed)
|
||||
/graphify <path> --wiki # build agent-crawlable wiki (index.md + one article per community)
|
||||
/graphify <path> --obsidian --obsidian-dir ~/vaults/my-project # write vault to custom path (e.g. existing vault)
|
||||
/graphify add <url> # fetch URL, save to ./raw, update graph
|
||||
/graphify add <url> --author "Name" # tag who wrote it
|
||||
/graphify add <url> --contributor "Name" # tag who added it to the corpus
|
||||
/graphify query "<question>" # BFS traversal - broad context
|
||||
/graphify query "<question>" --dfs # DFS - trace a specific path
|
||||
/graphify query "<question>" --budget 1500 # cap answer at N tokens
|
||||
/graphify path "AuthModule" "Database" # shortest path between two concepts
|
||||
/graphify explain "SwinTransformer" # plain-language explanation of a node
|
||||
```
|
||||
|
||||
## What graphify is for
|
||||
|
||||
Drop any folder of code, docs, papers, images, or video into graphify and get a queryable knowledge graph. Persistent across sessions, honest audit trail (EXTRACTED/INFERRED/AMBIGUOUS), community detection surfaces cross-document connections you wouldn't think to ask about.
|
||||
|
||||
**When a graph is worth building:** this applies when you are choosing a tool yourself; if the user invoked `/graphify`, follow that request as asked. AST extraction of code is fast and free, but semantic extraction of docs, papers and images runs the model over every file, which can cost minutes and tens of thousands of tokens.
|
||||
|
||||
If a graph already exists, query it. With no graph, one targeted lookup ("where is X defined", "what calls Y" in an ordinary-sized codebase) is faster and free with a plain text search such as `grep` and `Read`: search directly instead of running the steps below, and mention that a graph can be built if the user wants one. Build one when you expect many questions against this corpus, the corpus is large or unfamiliar, the question needs links text search cannot see (doc to code, across documents), or it is structural (communities, bridges, import cycles).
|
||||
|
||||
## What You Must Do When Invoked
|
||||
|
||||
If the user invoked `/graphify --help` or `/graphify -h` (with no other arguments), print the contents of the `## Usage` section above verbatim and stop. Do not run any commands, do not detect files, do not default the path to `.`. Just print the Usage block and return.
|
||||
|
||||
**Fast path — existing graph:** Before doing anything else, check whether `graphify-out/graph.json` exists. The expected location is `graphify-out/graph.json` relative to the **current working directory** (i.e. the project root where you are running commands). If it exists AND the user's request is a natural-language question about the codebase (e.g. "How does X work?", "What calls Y?", "Trace the data flow through Z") and NOT an explicit rebuild command (`--update`, `--cluster-only`, or a bare path/URL that implies fresh extraction): **skip Steps 1–5 entirely and jump straight to `## For /graphify query`.** Run `graphify query "<question>"` immediately. Do not run detect. Do not check corpus size. Do not ask the user to narrow. The graph is already built — use it.
|
||||
|
||||
If no path was given, use `.` (current directory). Do not ask the user for a path.
|
||||
|
||||
If the path argument starts with `https://github.com/` or `http://github.com/`, treat it as a GitHub URL - run Step 0 before anything else, then continue with the resolved local path.
|
||||
|
||||
Follow these steps in order unless the fast path above applies.
|
||||
|
||||
### Step 0 - GitHub repos and multi-path merge (only if a URL or several paths)
|
||||
|
||||
Only when the path is one or more `https://github.com/...` URLs, or several local subfolders to merge. See `references/github-and-merge.md` for the clone, cross-repo merge, and monorepo flow, then continue with the resolved local path. A plain local path skips this step.
|
||||
|
||||
### Step 1 - Ensure graphify is installed
|
||||
|
||||
```bash
|
||||
# Detect the correct Python interpreter (handles uv tool, pipx, venv, system installs)
|
||||
PYTHON=""
|
||||
GRAPHIFY_BIN=$(which graphify 2>/dev/null)
|
||||
# 1. uv tool installs — most reliable on modern Mac/Linux
|
||||
if [ -z "$PYTHON" ] && command -v uv >/dev/null 2>&1; then
|
||||
_UV_PY=$(uv tool run --from graphifyy python -c "import sys; print(sys.executable)" 2>/dev/null)
|
||||
if [ -n "$_UV_PY" ]; then PYTHON="$_UV_PY"; fi
|
||||
fi
|
||||
# 2. Read shebang from graphify binary (pipx and direct pip installs)
|
||||
if [ -z "$PYTHON" ] && [ -n "$GRAPHIFY_BIN" ]; then
|
||||
_SHEBANG=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
|
||||
case "$_SHEBANG" in
|
||||
*[!a-zA-Z0-9/_.@-]*) ;;
|
||||
*) "$_SHEBANG" -c "import graphify" 2>/dev/null && PYTHON="$_SHEBANG" ;;
|
||||
esac
|
||||
fi
|
||||
# 3. Fall back to python3
|
||||
if [ -z "$PYTHON" ]; then PYTHON="python3"; fi
|
||||
if ! "$PYTHON" -c "import graphify" 2>/dev/null; then
|
||||
if command -v uv >/dev/null 2>&1; then
|
||||
uv tool install --upgrade graphifyy -q 2>&1 | tail -3
|
||||
_UV_PY=$(uv tool run --from graphifyy python -c "import sys; print(sys.executable)" 2>/dev/null)
|
||||
if [ -n "$_UV_PY" ]; then PYTHON="$_UV_PY"; fi
|
||||
else
|
||||
"$PYTHON" -m pip install graphifyy -q 2>/dev/null \
|
||||
|| "$PYTHON" -m pip install graphifyy -q --break-system-packages 2>&1 | tail -3
|
||||
fi
|
||||
fi
|
||||
# Write interpreter path for all subsequent steps (persists across invocations)
|
||||
mkdir -p graphify-out
|
||||
"$PYTHON" -c "import sys; open('graphify-out/.graphify_python', 'w', encoding='utf-8').write(sys.executable)"
|
||||
# Save scan root so `graphify update` (no args) knows where to look next time.
|
||||
# The scan path is passed through a quoted heredoc, never substituted into the
|
||||
# command line itself: a bare `cd <path>` (or an unquoted heredoc, which
|
||||
# still expands $()/backticks in its body) would let a malicious path execute
|
||||
# as shell code the moment this line runs.
|
||||
"$PYTHON" -c "import os, sys; out_path = os.path.abspath('graphify-out/.graphify_root'); os.chdir(sys.stdin.readline().rstrip('\n')); open(out_path, 'w', encoding='utf-8').write(os.getcwd())" <<'GRAPHIFY_ROOT_EOF'
|
||||
INPUT_PATH
|
||||
GRAPHIFY_ROOT_EOF
|
||||
```
|
||||
|
||||
If the import succeeds, print nothing and move straight to Step 2.
|
||||
|
||||
**In every subsequent bash block, replace `python3` with `$(cat graphify-out/.graphify_python)` to use the correct interpreter.**
|
||||
|
||||
### Step 2 - Detect files
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json
|
||||
from graphify.detect import detect
|
||||
from pathlib import Path
|
||||
from graphify.paths import out_path
|
||||
from graphify.watch import _read_build_excludes, _read_build_gitignore
|
||||
result = detect(Path('INPUT_PATH'), extra_excludes=_read_build_excludes(out_path()), gitignore=_read_build_gitignore(out_path()))
|
||||
# Write the sidecar from Python, not a shell redirect, so the same block renders
|
||||
# on PowerShell hosts without console-encoding drift (#2528).
|
||||
Path('graphify-out/.graphify_detect.json').write_text(json.dumps(result, ensure_ascii=False), encoding=\"utf-8\")
|
||||
print(f'Detected {result[\"total_files\"]} files')
|
||||
"
|
||||
```
|
||||
|
||||
Replace INPUT_PATH with the actual path the user provided. Do NOT cat or print the JSON - read it silently and present a clean summary instead:
|
||||
|
||||
```
|
||||
Corpus: X files · ~Y words
|
||||
code: N files (.py .ts .go ...)
|
||||
docs: N files (.md .txt ...)
|
||||
papers: N files (.pdf ...)
|
||||
images: N files
|
||||
video: N files (.mp4 .mp3 ...)
|
||||
```
|
||||
|
||||
Omit any category with 0 files from the summary.
|
||||
|
||||
Then act on it:
|
||||
- If `total_files` is 0: stop with "No supported files found in [path]."
|
||||
- If `skipped_sensitive` is non-empty: report the count and list the skipped file names, so a wrongly-flagged source or doc is visible and can be renamed or moved (#2106).
|
||||
- If `total_words` > 2,000,000 OR `total_files` > 500: show the warning. Then compute the top 5 first-level subdirectories by file count:
|
||||
- Read `scan_root` from the detect JSON (always an absolute path to the resolved INPUT_PATH).
|
||||
- Concatenate all file lists across all types (`code`, `document`, `paper`, `image`, `video`).
|
||||
- Filter out any path that starts with `scan_root + "/graphify-out/"` to exclude converted sidecars.
|
||||
- For each file, strip the `scan_root` prefix and take the first path component. Files directly in `scan_root` with no subdirectory count as `(root)`.
|
||||
- If all files are in `(root)` with no subdirectories, do not ask to narrow — no subfolders exist. Instead suggest `--no-cluster` to skip the expensive clustering step and proceed.
|
||||
- Otherwise rank by count, show the top 5 with file counts, then ask which subfolder to run on. Wait for the user's answer before proceeding.
|
||||
- Otherwise: proceed directly to Step 2.5 if video files were detected, or Step 3 if not.
|
||||
|
||||
### Step 2.5 - Video and audio (only if video files detected)
|
||||
|
||||
Skip this step entirely if `detect` returned zero `video` files. When the corpus has video or audio, see `references/transcribe.md` to transcribe them to text first, then treat the transcripts as doc files in Step 3.
|
||||
|
||||
### Step 3 - Extract entities and relationships
|
||||
|
||||
**Before starting:** note whether `--mode deep` was given. You must pass `DEEP_MODE=true` to every subagent in Step B2 if it was. Track this from the original invocation - do not lose it.
|
||||
|
||||
This step has two parts: **structural extraction** (deterministic, free) and **semantic extraction** (LLM, costs tokens).
|
||||
|
||||
> **graphify needs no API key. Never ask the user for one, and never block on one.** Code is extracted structurally (AST) with no LLM and no key at all — a code-only corpus (the common `/graphify .` on a repo) skips semantic extraction entirely, so it needs nothing here: go straight to Part A and skip Part B. Semantic extraction (only for docs, papers, and images) uses Gemini **only if** `GEMINI_API_KEY`/`GOOGLE_API_KEY` is already set; otherwise the host agent itself is the LLM. graphify does **not** read `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or any other provider key. If you catch yourself about to prompt for, wait on, or stop because of a missing API key, that is a misread of this skill — proceed without one.
|
||||
|
||||
**Before semantic extraction:** check whether `GEMINI_API_KEY` or `GOOGLE_API_KEY` is set. If neither is set, print this one-liner to the user:
|
||||
> Tip: set `GEMINI_API_KEY` or `GOOGLE_API_KEY` to use Gemini for semantic extraction (`pip install 'graphifyy[gemini]'`).
|
||||
|
||||
Print it once, then continue — do not wait for the user to supply a key. If `GEMINI_API_KEY` or `GOOGLE_API_KEY` IS set, use `graphify.llm.extract_corpus_parallel(files, backend="gemini")` for semantic extraction instead of dispatching subagents. The default Gemini model is `gemini-3-flash-preview`; set `GRAPHIFY_GEMINI_MODEL` or pass `--model` in headless CLI flows to override it.
|
||||
|
||||
> **No other API keys are read.** When `GEMINI_API_KEY`/`GOOGLE_API_KEY` are unset, semantic extraction falls to the host agent itself — the running session is the LLM. On a host that dispatches subagents (e.g. Claude Code), dispatch them as written in Part B. On a host that runs the CLI directly in a terminal and cannot dispatch subagents, do not stall: a code-only corpus has no semantic work, so write the empty semantic file (Part B "Fast path") and continue to Part C; for a corpus with docs/papers/images, either set a Gemini key or extract those inline yourself, but in no case prompt for `ANTHROPIC_API_KEY` — that prompt is a misread of this skill.
|
||||
|
||||
**Run Part A (AST) and Part B (semantic) in parallel. Dispatch all semantic subagents AND start AST extraction in the same message. Both can run simultaneously since they operate on different file types. Merge results in Part C as before.**
|
||||
|
||||
Note: Parallelizing AST + semantic saves 5-15s on large corpora. AST is deterministic and fast; start it while subagents are processing docs/papers.
|
||||
|
||||
#### Part A - Structural extraction for code files
|
||||
|
||||
For any code files detected, run AST extraction in parallel with Part B subagents:
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import sys, json
|
||||
from graphify.extract import collect_files, extract
|
||||
from pathlib import Path
|
||||
import json
|
||||
|
||||
code_files = []
|
||||
detect = json.loads(Path('graphify-out/.graphify_detect.json').read_text(encoding=\"utf-8\"))
|
||||
for f in detect.get('files', {}).get('code', []):
|
||||
code_files.extend(collect_files(Path(f)) if Path(f).is_dir() else [Path(f)])
|
||||
|
||||
if code_files:
|
||||
# root= anchors node ids and source_file on the scan root; cache_root only says
|
||||
# where graphify-out/cache lives. Pass both: without root= the anchor falls back
|
||||
# to cache_root, so pointing the cache elsewhere would rename every node (#3727).
|
||||
result = extract(code_files, cache_root=Path('INPUT_PATH'), root=Path('INPUT_PATH'))
|
||||
Path('graphify-out/.graphify_ast.json').write_text(json.dumps(result, indent=2, ensure_ascii=False), encoding=\"utf-8\")
|
||||
print(f'AST: {len(result[\"nodes\"])} nodes, {len(result[\"edges\"])} edges')
|
||||
else:
|
||||
Path('graphify-out/.graphify_ast.json').write_text(json.dumps({'nodes':[],'edges':[],'input_tokens':0,'output_tokens':0}, ensure_ascii=False), encoding=\"utf-8\")
|
||||
print('No code files - skipping AST extraction')
|
||||
"
|
||||
```
|
||||
|
||||
#### Part B - Semantic extraction (parallel subagents)
|
||||
|
||||
**Fast path:** If detection found zero docs, papers, and images (code-only corpus), skip Part B entirely and go straight to Part C. AST handles code - there is nothing for semantic subagents to do. **First write an empty semantic file** so Part C's merge has its input (it reads `.graphify_semantic.json` unconditionally; without this a code-only run hits `FileNotFoundError`):
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json
|
||||
from pathlib import Path
|
||||
Path('graphify-out/.graphify_semantic.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8')
|
||||
"
|
||||
```
|
||||
|
||||
**MANDATORY: You MUST use the Agent tool here. Reading files yourself one-by-one is forbidden - it is 5-10x slower. If you do not use the Agent tool you are doing this wrong.**
|
||||
|
||||
Before dispatching subagents, print a timing estimate:
|
||||
- Load `total_words` and file counts from `graphify-out/.graphify_detect.json`
|
||||
- Estimate agents needed: `ceil(uncached_non_code_files / 22)` (chunk size is 20-25 files, capped at ~6000 total lines)
|
||||
- Estimate time: ~45s per agent batch (they run in parallel, so total ≈ 45s × ceil(agents/parallel_limit))
|
||||
- Print: "Semantic extraction: ~N files → X agents, estimated ~Ys"
|
||||
|
||||
**Step B0 - Check extraction cache first**
|
||||
|
||||
Before dispatching any subagents, check which files already have cached extraction results:
|
||||
|
||||
SPEC_PATH below is the **absolute** path of the `references/extraction-spec.md` that ships beside this SKILL.md — the same file Step B2 loads and hands to every subagent. It is the extraction prompt, so cache entries are attributed to it: when a graphify upgrade changes the prompt, entries produced by the old one are re-extracted instead of replayed, and unchanged prompts keep their entries (#1939). Substitute the real path in both Step B0 and Step B3 — pass the same one to each, and do not drop the argument.
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json
|
||||
from graphify.cache import check_semantic_cache
|
||||
from pathlib import Path
|
||||
|
||||
detect = json.loads(Path('graphify-out/.graphify_detect.json').read_text(encoding=\"utf-8\"))
|
||||
# Only content files go to semantic extraction. Code is already covered structurally
|
||||
# by the AST pass (Part A); flattening every category here makes subagents re-read
|
||||
# every source file (#1392). Video is transcribed to a document in Step 2.5 first.
|
||||
all_files = [f for cat in ('document', 'paper', 'image') for f in detect['files'].get(cat, [])]
|
||||
|
||||
cached_nodes, cached_edges, cached_hyperedges, uncached = check_semantic_cache(all_files, root='INPUT_PATH', prompt_file='SPEC_PATH')
|
||||
|
||||
# Always (re)write the cache file: write hits, else DELETE any leftover from a prior
|
||||
# run so Part C never merges a stale .graphify_cached.json (#1392).
|
||||
if cached_nodes or cached_edges or cached_hyperedges:
|
||||
Path('graphify-out/.graphify_cached.json').write_text(json.dumps({'nodes': cached_nodes, 'edges': cached_edges, 'hyperedges': cached_hyperedges}, ensure_ascii=False), encoding=\"utf-8\")
|
||||
else:
|
||||
Path('graphify-out/.graphify_cached.json').unlink(missing_ok=True)
|
||||
Path('graphify-out/.graphify_uncached.txt').write_text('\n'.join(uncached), encoding=\"utf-8\")
|
||||
# Nothing has been dispatched yet, so any chunk file on disk is a leftover from an
|
||||
# interrupted run, and Step B3 merges every .graphify_chunk_*.json it finds.
|
||||
for stale in Path('graphify-out').glob('.graphify_chunk_*.json'):
|
||||
stale.unlink()
|
||||
print(f'Cache: {len(all_files)-len(uncached)} files hit, {len(uncached)} files need extraction')
|
||||
"
|
||||
```
|
||||
|
||||
Only dispatch subagents for files listed in `graphify-out/.graphify_uncached.txt`. If all files are cached, skip Steps B1 and B2 but still run Step B3's commands: its merge is the only Part B step that writes `graphify-out/.graphify_semantic.json`, and Part C reads that file unconditionally. Do not write an empty `.graphify_semantic.json` instead, because that drops every cached node.
|
||||
|
||||
**Step B1 - Split into chunks**
|
||||
|
||||
Load files from `graphify-out/.graphify_uncached.txt`. Split into chunks bounded by BOTH limits: at most 20-25 files AND at most ~6000 total lines per chunk. A text file longer than 2000 lines gets a chunk to itself - that is past the Read tool's single-call cap, so sharing a chunk with other files guarantees it is only partly read. Each image gets its own chunk (vision needs separate context). When splitting, group files from the same directory together so related artifacts land in the same chunk and cross-file relationships are more likely to be extracted.
|
||||
|
||||
Both bounds matter. The line bound is not only about the 2000-line Read cap: a subagent holding 25 files splits its attention across all of them and skims the dense ones, and a 590-line plan can come back with zero nodes that way. Bounding content as well as file count is what keeps a chunk's coverage honest (#2225).
|
||||
|
||||
**Step B2 - Dispatch ALL subagents in a single message**
|
||||
|
||||
Call the Agent tool multiple times IN THE SAME RESPONSE - one call per chunk. This is the only way they run in parallel. If you make one Agent call, wait, then make another, you are doing it sequentially and defeating the purpose.
|
||||
|
||||
**IMPORTANT - subagent type:** Always use `subagent_type="general-purpose"`. Do NOT use `Explore` - it is read-only and cannot write chunk files to disk, which silently drops extraction results. General-purpose has Write and Bash access which the subagent needs.
|
||||
|
||||
Concrete example for 3 chunks:
|
||||
```
|
||||
[Agent tool call 1: files 1-15, subagent_type="general-purpose"]
|
||||
[Agent tool call 2: files 16-30, subagent_type="general-purpose"]
|
||||
[Agent tool call 3: files 31-45, subagent_type="general-purpose"]
|
||||
```
|
||||
All three in one message. Not three separate messages.
|
||||
|
||||
Each subagent receives this exact prompt (substitute FILE_LIST, CHUNK_NUM, TOTAL_CHUNKS, DEEP_MODE, and CHUNK_PATH).
|
||||
|
||||
CHUNK_PATH must be an **absolute** path — derive it before dispatching:
|
||||
```bash
|
||||
PROJECT_ROOT=$(pwd) # cwd — where Part C globs graphify-out/ (NOT .graphify_root/scan dir, #1392)
|
||||
# Then for chunk N: CHUNK_PATH="${PROJECT_ROOT}/graphify-out/.graphify_chunk_0N.json"
|
||||
```
|
||||
|
||||
Subagent prompt template:
|
||||
|
||||
See `references/extraction-spec.md` for the exact subagent prompt (JSON schema, node-ID rules, confidence rubric, frontmatter, hyperedge, and vision rules). Load it only here, only when at least one chunk holds a doc, paper, or image; a pure-code corpus has skipped Part B and never reads it. Pass each subagent that prompt verbatim with FILE_LIST, CHUNK_NUM, TOTAL_CHUNKS, DEEP_MODE, and CHUNK_PATH substituted, and have it write the result to CHUNK_PATH.
|
||||
|
||||
**Step B3 - Collect, cache, and merge**
|
||||
|
||||
Wait for all subagents. For each result:
|
||||
- Check that `graphify-out/.graphify_chunk_NN.json` exists on disk — this is the success signal
|
||||
- If the file exists and contains valid JSON with `nodes` and `edges`, include it and save to cache
|
||||
- If the file is missing, the subagent was likely dispatched as read-only (Explore type) — print a warning: "chunk N missing from disk — subagent may have been read-only. Re-run with general-purpose agent." Do not silently skip.
|
||||
- If a subagent failed or returned invalid JSON, print a warning and skip that chunk - do not abort
|
||||
|
||||
If more than half the chunks failed or are missing, stop and tell the user to re-run and ensure `subagent_type="general-purpose"` is used.
|
||||
|
||||
**Step B3.5 - Verify each reported file was actually read to its end**
|
||||
|
||||
A subagent that only read the first Read call's worth of a long file still writes a well-formed chunk, so "chunk file exists and parses" is not evidence of coverage. Compare each file's self-reported `coverage` against its real length:
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json, glob
|
||||
from pathlib import Path
|
||||
|
||||
covered = {}
|
||||
for c in sorted(glob.glob('graphify-out/.graphify_chunk_*.json')):
|
||||
d = json.loads(Path(c).read_text(encoding=\"utf-8\"))
|
||||
for src, n in (d.get('coverage') or {}).items():
|
||||
covered[src] = max(covered.get(src, 0), int(n))
|
||||
|
||||
partial = []
|
||||
for src, n in sorted(covered.items()):
|
||||
p = Path(src)
|
||||
if not p.is_absolute():
|
||||
p = Path('INPUT_PATH') / src
|
||||
if not p.is_file():
|
||||
continue
|
||||
total = sum(1 for _ in p.open(encoding='utf-8', errors='replace'))
|
||||
if total and n < total:
|
||||
partial.append((src, n, total))
|
||||
|
||||
Path('graphify-out/.graphify_partial.txt').write_text('\n'.join(s for s, _, _ in partial), encoding=\"utf-8\")
|
||||
if partial:
|
||||
print(f'WARNING: {len(partial)} file(s) were only partly read. They are cached as partial and retried on the next --update:')
|
||||
for src, n, total in partial:
|
||||
print(f' {src}: read {n} of {total} lines')
|
||||
else:
|
||||
print('Coverage OK - every file a subagent reported was read to its last line')
|
||||
"
|
||||
```
|
||||
|
||||
Tell the user which files came up short and what was lost (the line counts are printed above). The nodes already extracted for those files are kept - they are still true - but the file is cached as partial and left unstamped in the manifest below, so the next `--update` re-dispatches it and replace-on-re-extract swaps the partial node set for a complete one. This is the same mechanism the library path uses for a truncated LLM response (#933, #1950), so both paths now recover instead of silently keeping a half-read file forever. A file a subagent did not report at all is not counted as partial - there is nothing to compare against - which is why the prompt rule in `references/extraction-spec.md` asks for the count in the first place.
|
||||
|
||||
Merge all chunk files into `.graphify_semantic_new.json`. **After each Agent call completes, read the real token counts from the Agent tool result's `usage` field and write them back into the chunk JSON before merging** — the chunk JSON itself always has placeholder zeros. Then run:
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json, glob
|
||||
from pathlib import Path
|
||||
|
||||
chunks = sorted(glob.glob('graphify-out/.graphify_chunk_*.json'))
|
||||
all_nodes, all_edges, all_hyperedges = [], [], []
|
||||
total_in, total_out = 0, 0
|
||||
for c in chunks:
|
||||
d = json.loads(Path(c).read_text(encoding=\"utf-8\"))
|
||||
all_nodes += d.get('nodes', [])
|
||||
all_edges += d.get('edges', [])
|
||||
all_hyperedges += d.get('hyperedges', [])
|
||||
total_in += d.get('input_tokens', 0)
|
||||
total_out += d.get('output_tokens', 0)
|
||||
Path('graphify-out/.graphify_semantic_new.json').write_text(json.dumps({
|
||||
'nodes': all_nodes, 'edges': all_edges, 'hyperedges': all_hyperedges,
|
||||
'input_tokens': total_in, 'output_tokens': total_out,
|
||||
}, indent=2, ensure_ascii=False), encoding=\"utf-8\")
|
||||
print(f'Merged {len(chunks)} chunks: {total_in:,} in / {total_out:,} out tokens')
|
||||
"
|
||||
```
|
||||
|
||||
Save new results to cache. Pass the same SPEC_PATH as Step B0 — it stamps each entry with the prompt that produced it, and a write under a different prompt than the read lands where the next run won't look (#1939):
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json
|
||||
from graphify.cache import save_semantic_cache
|
||||
from pathlib import Path
|
||||
|
||||
new = json.loads(Path('graphify-out/.graphify_semantic_new.json').read_text(encoding=\"utf-8\")) if Path('graphify-out/.graphify_semantic_new.json').exists() else {'nodes':[],'edges':[],'hyperedges':[]}
|
||||
uncached = [line for line in Path('graphify-out/.graphify_uncached.txt').read_text(encoding=\"utf-8\").splitlines() if line]
|
||||
# A partly-read file is cached with partial: True, which load_cached treats as a MISS,
|
||||
# so the next --update re-dispatches it instead of serving a truncated extraction forever
|
||||
# (#2225). Same contract the library path uses for a truncated LLM response (#933/#1950).
|
||||
partial = [line for line in Path('graphify-out/.graphify_partial.txt').read_text(encoding=\"utf-8\").splitlines() if line] if Path('graphify-out/.graphify_partial.txt').exists() else []
|
||||
saved = save_semantic_cache(new.get('nodes', []), new.get('edges', []), new.get('hyperedges', []), root='INPUT_PATH', allowed_source_files=uncached, prompt_file='SPEC_PATH', partial_source_files=partial)
|
||||
note = f' ({len(partial)} left partial for retry)' if partial else ''
|
||||
print(f'Cached {saved} files' + note)
|
||||
"
|
||||
```
|
||||
|
||||
Merge cached + new results into `graphify-out/.graphify_semantic.json`:
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
cached = json.loads(Path('graphify-out/.graphify_cached.json').read_text(encoding=\"utf-8\")) if Path('graphify-out/.graphify_cached.json').exists() else {'nodes':[],'edges':[],'hyperedges':[]}
|
||||
new = json.loads(Path('graphify-out/.graphify_semantic_new.json').read_text(encoding=\"utf-8\")) if Path('graphify-out/.graphify_semantic_new.json').exists() else {'nodes':[],'edges':[],'hyperedges':[]}
|
||||
|
||||
all_nodes = cached['nodes'] + new.get('nodes', [])
|
||||
all_edges = cached['edges'] + new.get('edges', [])
|
||||
all_hyperedges = cached.get('hyperedges', []) + new.get('hyperedges', [])
|
||||
seen = set()
|
||||
deduped = []
|
||||
for n in all_nodes:
|
||||
if n['id'] not in seen:
|
||||
seen.add(n['id'])
|
||||
deduped.append(n)
|
||||
|
||||
merged = {
|
||||
'nodes': deduped,
|
||||
'edges': all_edges,
|
||||
'hyperedges': all_hyperedges,
|
||||
'input_tokens': new.get('input_tokens', 0),
|
||||
'output_tokens': new.get('output_tokens', 0),
|
||||
}
|
||||
Path('graphify-out/.graphify_semantic.json').write_text(json.dumps(merged, indent=2, ensure_ascii=False), encoding=\"utf-8\")
|
||||
print(f'Extraction complete - {len(deduped)} nodes, {len(all_edges)} edges ({len(cached[\"nodes\"])} from cache, {len(new.get(\"nodes\",[]))} new)')
|
||||
"
|
||||
```
|
||||
Clean up temp files: `rm -f graphify-out/.graphify_cached.json graphify-out/.graphify_uncached.txt graphify-out/.graphify_semantic_new.json`
|
||||
|
||||
#### Part C - Merge AST + semantic into final extraction
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import sys, json
|
||||
from pathlib import Path
|
||||
|
||||
ast = json.loads(Path('graphify-out/.graphify_ast.json').read_text(encoding=\"utf-8\"))
|
||||
sem = json.loads(Path('graphify-out/.graphify_semantic.json').read_text(encoding=\"utf-8\"))
|
||||
|
||||
# Stamp tier provenance on the semantic side. build._is_ast_tier reads
|
||||
# _origin when present and otherwise guesses from the SHAPE of
|
||||
# source_location ('L<line>' means AST). A subagent that writes 'L12' for a
|
||||
# doc section therefore made that node read as AST, and the next
|
||||
# graphify update deleted it along with the re-extracted code file it
|
||||
# seemed to belong to (#2843). extract() stamps its own items 'ast'; the
|
||||
# semantic side must say so explicitly.
|
||||
for n in sem['nodes']:
|
||||
n.setdefault('_origin', 'semantic')
|
||||
for e in sem['edges']:
|
||||
e.setdefault('_origin', 'semantic')
|
||||
|
||||
# Merge: AST nodes first, semantic nodes deduplicated by id
|
||||
seen = {n['id'] for n in ast['nodes']}
|
||||
merged_nodes = list(ast['nodes'])
|
||||
for n in sem['nodes']:
|
||||
if n['id'] not in seen:
|
||||
merged_nodes.append(n)
|
||||
seen.add(n['id'])
|
||||
|
||||
merged_edges = ast['edges'] + sem['edges']
|
||||
merged_hyperedges = sem.get('hyperedges', [])
|
||||
merged = {
|
||||
'nodes': merged_nodes,
|
||||
'edges': merged_edges,
|
||||
'hyperedges': merged_hyperedges,
|
||||
'input_tokens': sem.get('input_tokens', 0),
|
||||
'output_tokens': sem.get('output_tokens', 0),
|
||||
}
|
||||
Path('graphify-out/.graphify_extract.json').write_text(json.dumps(merged, indent=2, ensure_ascii=False), encoding=\"utf-8\")
|
||||
total = len(merged_nodes)
|
||||
edges = len(merged_edges)
|
||||
print(f'Merged: {total} nodes, {edges} edges ({len(ast[\"nodes\"])} AST + {len(sem[\"nodes\"])} semantic)')
|
||||
"
|
||||
```
|
||||
|
||||
### Step 4 - Build graph, cluster, analyze, generate outputs
|
||||
|
||||
**Before starting:** the code blocks below pass `directed=IS_DIRECTED` to `build_from_json()`. Replace `IS_DIRECTED` with `True` if `--directed` was given (builds a `DiGraph` preserving edge direction source→target), otherwise `False` (the default undirected `Graph`). Substitute it the same way you substitute `INPUT_PATH` — do not leave the literal `IS_DIRECTED` in the code.
|
||||
|
||||
```bash
|
||||
mkdir -p graphify-out
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import sys, json
|
||||
from graphify.build import build_from_json
|
||||
from graphify.cluster import cluster, score_all
|
||||
from graphify.analyze import god_nodes, surprising_connections, suggest_questions
|
||||
from graphify.report import generate
|
||||
from graphify.export import to_json
|
||||
from pathlib import Path
|
||||
|
||||
extraction = json.loads(Path('graphify-out/.graphify_extract.json').read_text(encoding=\"utf-8\"))
|
||||
detection = json.loads(Path('graphify-out/.graphify_detect.json').read_text(encoding=\"utf-8\"))
|
||||
|
||||
# root= mirrors the --update runbook (#1361): relativize source_file to the same
|
||||
# base so the full build and incremental --update never drift apart on re-extract.
|
||||
G = build_from_json(extraction, root='INPUT_PATH', directed=IS_DIRECTED)
|
||||
# Guard BEFORE any write: an empty extraction must not clobber a good graph.json /
|
||||
# GRAPH_REPORT.md / analysis sidecar. Check immediately after build (#1392).
|
||||
if G.number_of_nodes() == 0:
|
||||
print('ERROR: Graph is empty - extraction produced no nodes.')
|
||||
print('Possible causes: all files were skipped, binary-only corpus, or extraction failed.')
|
||||
raise SystemExit(1)
|
||||
communities = cluster(G)
|
||||
cohesion = score_all(G, communities)
|
||||
tokens = {'input': extraction.get('input_tokens', 0), 'output': extraction.get('output_tokens', 0)}
|
||||
gods = god_nodes(G)
|
||||
surprises = surprising_connections(G, communities)
|
||||
labels = {cid: 'Community ' + str(cid) for cid in communities}
|
||||
# Placeholder questions - regenerated with real labels in Step 5
|
||||
questions = suggest_questions(G, communities, labels)
|
||||
|
||||
# Export FIRST and honor the #479 shrink-guard: to_json returns False (writing
|
||||
# nothing) when the new graph is smaller than the existing graph.json. Only write
|
||||
# GRAPH_REPORT.md + the analysis sidecar when the graph was actually written, so
|
||||
# they never describe a graph that graph.json doesn't contain (#1392).
|
||||
wrote = to_json(G, communities, 'graphify-out/graph.json')
|
||||
if not wrote:
|
||||
print('ERROR: refused to shrink graphify-out/graph.json (existing graph has more nodes; #479).')
|
||||
print('If this shrink is intentional (you deleted files), re-run a full build with --force.')
|
||||
raise SystemExit(1)
|
||||
report = generate(G, communities, cohesion, labels, gods, surprises, detection, tokens, 'INPUT_PATH', suggested_questions=questions)
|
||||
Path('graphify-out/GRAPH_REPORT.md').write_text(report, encoding=\"utf-8\")
|
||||
analysis = {
|
||||
'communities': {str(k): v for k, v in communities.items()},
|
||||
'cohesion': {str(k): v for k, v in cohesion.items()},
|
||||
'gods': gods,
|
||||
'surprises': surprises,
|
||||
'questions': questions,
|
||||
}
|
||||
Path('graphify-out/.graphify_analysis.json').write_text(json.dumps(analysis, indent=2, ensure_ascii=False), encoding=\"utf-8\")
|
||||
print(f'Graph: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges, {len(communities)} communities')
|
||||
"
|
||||
```
|
||||
|
||||
If this step prints `ERROR: Graph is empty`, stop and tell the user what happened - do not proceed to labeling or visualization.
|
||||
|
||||
Replace INPUT_PATH with the actual path.
|
||||
|
||||
### Step 4.5 - Graph health check (read-only integrity gate)
|
||||
|
||||
A non-destructive diagnostic on the extraction, before labeling. It surfaces edge collapse, dangling/missing endpoints, and self-loops — the silent-corruption modes of incremental updates and AST/LLM id mismatches. Read-only; never aborts.
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json
|
||||
from pathlib import Path
|
||||
from graphify.diagnostics import diagnose_extraction, format_diagnostic_report
|
||||
|
||||
extraction = json.loads(Path('graphify-out/.graphify_extract.json').read_text(encoding=\"utf-8\"))
|
||||
summary = diagnose_extraction(extraction, directed=IS_DIRECTED, root='INPUT_PATH')
|
||||
print(format_diagnostic_report(summary))
|
||||
flags = [f'{summary[k]} {label}' for k, label in (
|
||||
('dangling_endpoint_edges', 'dangling-endpoint edges'),
|
||||
('missing_endpoint_edges', 'missing-endpoint edges'),
|
||||
('self_loop_edges', 'self-loop edges'),
|
||||
('directed_same_endpoint_collapsed_edges', 'collapsed (directed) edges'),
|
||||
('undirected_same_endpoint_collapsed_edges', 'collapsed (undirected) edges'),
|
||||
) if summary.get(k, 0)]
|
||||
print('GRAPH HEALTH WARNING: ' + '; '.join(flags) + ' - graph may be incomplete/corrupt.' if flags else 'Graph health: OK (no dangling/missing/collapsed edges).')
|
||||
"
|
||||
```
|
||||
|
||||
Substitute `IS_DIRECTED` and `INPUT_PATH` as in Step 4. If a `GRAPH HEALTH WARNING` prints, surface it in the final summary (do not abort — the graph is still usable, but the integrity issue must be visible, per the Honesty Rules).
|
||||
|
||||
### Step 5 - Label communities
|
||||
|
||||
Read `graphify-out/.graphify_analysis.json`. For each community key, look at its node labels and write a 2-5 word plain-language name (e.g. "Attention Mechanism", "Training Pipeline", "Data Loading").
|
||||
|
||||
Then regenerate the report and save the labels for the visualizer:
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import sys, json
|
||||
from graphify.build import build_from_json
|
||||
from graphify.cluster import score_all
|
||||
from graphify.analyze import god_nodes, surprising_connections, suggest_questions
|
||||
from graphify.report import generate
|
||||
from graphify.export import to_json
|
||||
from pathlib import Path
|
||||
|
||||
extraction = json.loads(Path('graphify-out/.graphify_extract.json').read_text(encoding=\"utf-8\"))
|
||||
detection = json.loads(Path('graphify-out/.graphify_detect.json').read_text(encoding=\"utf-8\"))
|
||||
analysis = json.loads(Path('graphify-out/.graphify_analysis.json').read_text(encoding=\"utf-8\"))
|
||||
|
||||
# root= as in Step 4 / the --update runbook (#1361) — same base for node-key parity.
|
||||
G = build_from_json(extraction, root='INPUT_PATH', directed=IS_DIRECTED)
|
||||
communities = {int(k): v for k, v in analysis['communities'].items()}
|
||||
cohesion = {int(k): v for k, v in analysis['cohesion'].items()}
|
||||
tokens = {'input': extraction.get('input_tokens', 0), 'output': extraction.get('output_tokens', 0)}
|
||||
|
||||
# LABELS - replace these with the names you chose above
|
||||
labels = LABELS_DICT
|
||||
|
||||
# Regenerate questions with real community labels (labels affect question phrasing)
|
||||
questions = suggest_questions(G, communities, labels)
|
||||
|
||||
report = generate(G, communities, cohesion, labels, analysis['gods'], analysis['surprises'], detection, tokens, 'INPUT_PATH', suggested_questions=questions)
|
||||
Path('graphify-out/GRAPH_REPORT.md').write_text(report, encoding=\"utf-8\")
|
||||
Path('graphify-out/.graphify_labels.json').write_text(json.dumps({str(k): v for k, v in labels.items()}, ensure_ascii=False), encoding=\"utf-8\")
|
||||
# Re-export so graph.json nodes carry the curated community_name (#2490).
|
||||
# Same extraction as Step 4, so the #479 shrink-guard passes on node count;
|
||||
# if it still refuses, surface the guard message - do not force past it.
|
||||
wrote = to_json(G, communities, 'graphify-out/graph.json', community_labels=labels)
|
||||
if not wrote:
|
||||
print('ERROR: refused to shrink graphify-out/graph.json (existing graph has more nodes; #479).')
|
||||
print('If this shrink is intentional (you deleted files), re-run a full build with --force.')
|
||||
print('Report updated with community labels')
|
||||
"
|
||||
```
|
||||
|
||||
Replace `LABELS_DICT` with the actual dict you constructed (e.g. `{0: "Attention Mechanism", 1: "Training Pipeline"}`).
|
||||
Replace INPUT_PATH with the actual path.
|
||||
|
||||
### Step 6 - Generate Obsidian vault (opt-in) + HTML
|
||||
|
||||
**Generate HTML always** (unless `--no-viz`). **Obsidian vault only if `--obsidian` was explicitly given** — skip it otherwise, it generates one file per node.
|
||||
|
||||
If `--obsidian` was given:
|
||||
|
||||
- If `--obsidian-dir <path>` was also given, pass it via `--dir`. Otherwise defaults to `graphify-out/obsidian`.
|
||||
|
||||
```bash
|
||||
graphify export obsidian
|
||||
# or with custom dir: graphify export obsidian --dir ~/vaults/my-project
|
||||
```
|
||||
|
||||
Generate the HTML graph (always, unless `--no-viz`):
|
||||
|
||||
```bash
|
||||
graphify export html # auto-aggregates to community view if graph > 5000 nodes
|
||||
# or: graphify export html --no-viz
|
||||
```
|
||||
|
||||
### Steps 6b-8 - Wiki, Neo4j, FalkorDB, SVG, GraphML, MCP, benchmark (only on their flags)
|
||||
|
||||
These run only when their flag is present (`--wiki`, `--neo4j`/`--neo4j-push`, `--falkordb`/`--falkordb-push`, `--svg`, `--graphml`, `--mcp`) or, for the token-reduction benchmark, when `total_words` exceeds 5,000. A default run with no export flags skips all of them. See `references/exports.md` for each one. Run any `--wiki` export before Step 9 cleanup so `.graphify_labels.json` is still available.
|
||||
|
||||
---
|
||||
|
||||
### Step 9 - Save manifest, update cost tracker, clean up, and report
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json
|
||||
from pathlib import Path
|
||||
from datetime import datetime, timezone
|
||||
from graphify.detect import save_manifest
|
||||
|
||||
# Save manifest for --update
|
||||
detect = json.loads(Path('graphify-out/.graphify_detect.json').read_text(encoding=\"utf-8\"))
|
||||
extract = json.loads(Path('graphify-out/.graphify_extract.json').read_text(encoding=\"utf-8\"))
|
||||
# In --update mode, 'all_files' carries the full corpus; 'files' is the changed
|
||||
# subset. Full-rebuild mode populates only 'files', so the fallback handles that.
|
||||
# root= relativizes the manifest keys to the scan root (same base as the build),
|
||||
# so the on-disk manifest is portable across clones/machines and a later --update
|
||||
# matches cached files instead of missing every one (#1417).
|
||||
#
|
||||
# Only stamp semantic files (docs/papers/images) that ACTUALLY produced output:
|
||||
# a detected file whose chunk failed or was omitted must stay unstamped so the
|
||||
# next --update re-queues it, otherwise it is marked done and its content is lost
|
||||
# forever (#2015). This mirrors the library extract path exactly
|
||||
# (cli._stamped_manifest_files + clear_semantic + scan_corpus); do not stamp the
|
||||
# raw corpus. Code files are always stamped (AST is deterministic); only semantic
|
||||
# types are gated on output.
|
||||
from graphify.cli import _stamped_manifest_files
|
||||
_corpus = detect.get('all_files') or detect['files']
|
||||
# A file a subagent only partly read DID produce output, so the stamp filter alone would
|
||||
# keep it - but its node set covers just the head of the file, and stamping it means
|
||||
# detect_incremental reads it as done and never re-queues it, leaving the truncated graph
|
||||
# live forever. Name those files so they stay unstamped and are retried next run (#2225).
|
||||
_pf = Path('graphify-out/.graphify_partial.txt')
|
||||
_partial = {l.strip() for l in _pf.read_text(encoding=\"utf-8\").splitlines() if l.strip()} if _pf.exists() else set()
|
||||
_manifest_files = _stamped_manifest_files(_corpus, extract, Path('INPUT_PATH'), partial_source_files=_partial)
|
||||
# Files dispatched this run (the changed subset) but NOT stamped above still carry
|
||||
# a stale semantic_hash from a prior run; clear it so detect_incremental re-queues
|
||||
# them instead of reading them as unchanged (#1948).
|
||||
_sem_types = ('document', 'paper', 'image')
|
||||
_dispatched = {f for t, fl in detect['files'].items() if t in _sem_types for f in fl}
|
||||
_stamped = {f for fl in _manifest_files.values() for f in fl}
|
||||
_cleared = _dispatched - _stamped
|
||||
# scan_corpus = the RAW full corpus (not the stamp-filtered subset) so in-root
|
||||
# files newly excluded since last run are dropped rather than masquerading as
|
||||
# deletions; untouched files' prior rows are still preserved (#1908).
|
||||
_scan = {f for fl in _corpus.values() for f in fl}
|
||||
save_manifest(_manifest_files, root='INPUT_PATH', scan_corpus=_scan, clear_semantic=_cleared or None)
|
||||
|
||||
# Update cumulative cost tracker
|
||||
input_tok = extract.get('input_tokens', 0)
|
||||
output_tok = extract.get('output_tokens', 0)
|
||||
|
||||
cost_path = Path('graphify-out/cost.json')
|
||||
if cost_path.exists():
|
||||
cost = json.loads(cost_path.read_text(encoding=\"utf-8\"))
|
||||
else:
|
||||
cost = {'runs': [], 'total_input_tokens': 0, 'total_output_tokens': 0}
|
||||
|
||||
cost['runs'].append({
|
||||
'date': datetime.now(timezone.utc).isoformat(),
|
||||
'input_tokens': input_tok,
|
||||
'output_tokens': output_tok,
|
||||
'files': detect.get('total_files', 0),
|
||||
})
|
||||
cost['total_input_tokens'] += input_tok
|
||||
cost['total_output_tokens'] += output_tok
|
||||
cost_path.write_text(json.dumps(cost, indent=2, ensure_ascii=False), encoding=\"utf-8\")
|
||||
|
||||
print(f'This run: {input_tok:,} input tokens, {output_tok:,} output tokens')
|
||||
print(f'All time: {cost[\"total_input_tokens\"]:,} input, {cost[\"total_output_tokens\"]:,} output ({len(cost[\"runs\"])} runs)')
|
||||
"
|
||||
rm -f graphify-out/.graphify_detect.json graphify-out/.graphify_extract.json graphify-out/.graphify_ast.json graphify-out/.graphify_semantic.json graphify-out/.graphify_analysis.json graphify-out/.graphify_partial.txt
|
||||
find graphify-out -maxdepth 1 -name '.graphify_chunk_*.json' -delete 2>/dev/null
|
||||
rm -f graphify-out/.needs_update 2>/dev/null || true
|
||||
```
|
||||
|
||||
Replace INPUT_PATH with the actual path (same value used in Steps 4-5) so the manifest is relativized to the scan root.
|
||||
|
||||
Tell the user (omit the obsidian line unless --obsidian was given):
|
||||
```
|
||||
Graph complete. Outputs in PATH_TO_DIR/graphify-out/
|
||||
|
||||
graph.html - interactive graph, open in browser
|
||||
GRAPH_REPORT.md - audit report
|
||||
graph.json - raw graph data
|
||||
obsidian/ - Obsidian vault (only if --obsidian was given)
|
||||
```
|
||||
|
||||
If graphify saved you time, consider supporting it: https://github.com/sponsors/safishamsi
|
||||
|
||||
Replace PATH_TO_DIR with the actual absolute path of the directory that was processed.
|
||||
|
||||
If PATH_TO_DIR is inside a git repository, add one line to the report: `graphify-out/` was written into the working tree, so unless the repository already ignores it, it will show in `git status`; the user can add `graphify-out/` to `.gitignore`, or commit only the outputs their team should share (see https://docs.graphify.com/guides/team-workflows).
|
||||
|
||||
Then paste these sections from GRAPH_REPORT.md directly into the chat:
|
||||
- God Nodes
|
||||
- Surprising Connections
|
||||
- Suggested Questions
|
||||
|
||||
Do NOT paste the full report - just those three sections. Keep it concise.
|
||||
|
||||
Then immediately offer to explore. Pick the single most interesting suggested question from the report - the one that crosses the most community boundaries or has the most surprising bridge node - and ask:
|
||||
|
||||
> "The most interesting question this graph can answer: **[question]**. Want me to trace it?"
|
||||
|
||||
If the user says yes, run `/graphify query "[question]"` on the graph and walk them through the answer using the graph structure - which nodes connect, which community boundaries get crossed, what the path reveals. Keep going as long as they want to explore. Each answer should end with a natural follow-up ("this connects to X - want to go deeper?") so the session feels like navigation, not a one-shot report.
|
||||
|
||||
The graph is the map. Your job after the pipeline is to be the guide.
|
||||
|
||||
---
|
||||
|
||||
## Interpreter guard for subcommands
|
||||
|
||||
Before running any subcommand below (`--update`, `--cluster-only`, `query`, `path`, `explain`, `add`), check that `.graphify_python` exists. If it's missing (e.g. user deleted `graphify-out/`), re-resolve the interpreter first:
|
||||
|
||||
```bash
|
||||
if [ ! -f graphify-out/.graphify_python ]; then
|
||||
GRAPHIFY_BIN=$(which graphify 2>/dev/null)
|
||||
if [ -n "$GRAPHIFY_BIN" ]; then
|
||||
PYTHON=$(head -1 "$GRAPHIFY_BIN" | tr -d '#!')
|
||||
case "$PYTHON" in *[!a-zA-Z0-9/_.@-]*) PYTHON="python3" ;; esac
|
||||
else
|
||||
PYTHON="python3"
|
||||
fi
|
||||
mkdir -p graphify-out
|
||||
"$PYTHON" -c "import sys; open('graphify-out/.graphify_python', 'w', encoding='utf-8').write(sys.executable)"
|
||||
fi
|
||||
```
|
||||
|
||||
## For --update and --cluster-only
|
||||
|
||||
Both are non-default subcommands. `--update` re-extracts only new or changed files; `--cluster-only` reruns clustering on the existing graph. See `references/update.md` for both flows.
|
||||
|
||||
---
|
||||
|
||||
## For /graphify query
|
||||
|
||||
When `graphify-out/graph.json` already exists and the user asks a question about the corpus, answer from the graph rather than rebuilding it:
|
||||
|
||||
```bash
|
||||
graphify query "<question>"
|
||||
```
|
||||
|
||||
Before traversal, expand the question against the graph's own vocabulary so a wording mismatch does not collapse the answer to noise. If the `graphify query` CLI is unavailable, fall back to an inline NetworkX traversal of `graphify-out/graph.json`. Answer using only what the graph output contains, and quote `source_location` when citing a specific fact. For that vocab-expansion step, the BFS/DFS traversal modes, the `--budget` cap, the NetworkX fallback, `save-result` feedback, and the `/graphify path` and `/graphify explain` flows, see `references/query.md`.
|
||||
|
||||
---
|
||||
|
||||
## For /graphify add and --watch
|
||||
|
||||
Neither is part of the default build. When the user runs `/graphify add <url>` to fetch a URL into the corpus, or passes `--watch` to auto-rebuild on file changes, see `references/add-watch.md`.
|
||||
|
||||
---
|
||||
|
||||
## For the commit hook and native CLAUDE.md integration
|
||||
|
||||
When the user asks to install the post-commit auto-rebuild hook or wire graphify into a project's CLAUDE.md, see `references/hooks.md`.
|
||||
|
||||
---
|
||||
|
||||
## Honesty Rules
|
||||
|
||||
- Never invent an edge. If unsure, use AMBIGUOUS.
|
||||
- Never skip the corpus check warning.
|
||||
- Always show token cost in the report.
|
||||
- Never hide cohesion scores behind symbols - show the raw number.
|
||||
- Never run HTML viz on a graph with more than 5,000 nodes without warning the user.
|
||||
@@ -0,0 +1,56 @@
|
||||
# graphify reference: add a URL and watch a folder
|
||||
|
||||
Load this when the user ran `/graphify add <url>` or passed `--watch`. Neither is part of the default build.
|
||||
|
||||
## For /graphify add
|
||||
|
||||
Fetch a URL and add it to the corpus, then update the graph.
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import sys
|
||||
from graphify.ingest import ingest
|
||||
from pathlib import Path
|
||||
|
||||
try:
|
||||
out = ingest('URL', Path('./raw'), author='AUTHOR', contributor='CONTRIBUTOR')
|
||||
print(f'Saved to {out}')
|
||||
except ValueError as e:
|
||||
print(f'error: {e}', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
except RuntimeError as e:
|
||||
print(f'error: {e}', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
"
|
||||
```
|
||||
|
||||
Replace `URL` with the actual URL, `AUTHOR` with the user's name if provided, `CONTRIBUTOR` likewise. If the command exits with an error, tell the user what went wrong - do not silently continue. After a successful save, automatically run the `--update` pipeline on `./raw` to merge the new file into the existing graph.
|
||||
|
||||
Supported URL types (auto-detected):
|
||||
- YouTube / any video URL → audio downloaded via yt-dlp, transcribed to `.txt` on next run (requires `pip install 'graphifyy[video]'`)
|
||||
- Twitter/X → fetched via oEmbed, saved as `.md` with tweet text and author
|
||||
- arXiv → abstract + metadata saved as `.md`
|
||||
- PDF → downloaded as `.pdf`
|
||||
- Images (.png/.jpg/.webp) → downloaded, Claude vision extracts on next run
|
||||
- Any webpage → converted to markdown via html2text
|
||||
|
||||
---
|
||||
|
||||
## For --watch
|
||||
|
||||
Start a background watcher that monitors a folder and auto-updates the graph when files change.
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -m graphify.watch "$(cat graphify-out/.graphify_root)" --debounce 3
|
||||
```
|
||||
|
||||
This watches the same folder graphify extracted, read from the trusted `graphify-out/.graphify_root` that Step 1 resolved - there is no path to substitute, so a scan root containing shell metacharacters can never be re-interpreted here. Behavior depends on what changed:
|
||||
|
||||
- **Code files only (.py, .ts, .go, etc.):** re-runs AST extraction + rebuild + cluster immediately, no LLM needed. `graph.json` and `GRAPH_REPORT.md` are updated automatically.
|
||||
- **Docs, papers, or images:** writes a `graphify-out/needs_update` flag and prints a notification to run `/graphify --update` (LLM semantic re-extraction required).
|
||||
|
||||
Debounce (default 3s): waits until file activity stops before triggering, so a wave of parallel agent writes doesn't trigger a rebuild per file.
|
||||
|
||||
Press Ctrl+C to stop.
|
||||
|
||||
For agentic workflows: run `--watch` in a background terminal. Code changes from agent waves are picked up automatically between waves. If agents are also writing docs or notes, you'll need a manual `/graphify --update` after those waves.
|
||||
@@ -0,0 +1,91 @@
|
||||
# graphify reference: extra exports and benchmark
|
||||
|
||||
Load this when the user passed one of the export flags (`--wiki`, `--neo4j`, `--neo4j-push`, `--falkordb`, `--falkordb-push`, `--svg`, `--graphml`, `--mcp`), or when the corpus is large enough for the token-reduction benchmark. Each step runs only for its own flag.
|
||||
|
||||
### Step 6b - Wiki (only if --wiki flag)
|
||||
|
||||
**Only run this step if `--wiki` was explicitly given in the original command.**
|
||||
|
||||
Run this before Step 9 (cleanup) so `.graphify_labels.json` is still available.
|
||||
|
||||
```bash
|
||||
graphify export wiki
|
||||
```
|
||||
|
||||
### Step 7 - Neo4j export (only if --neo4j or --neo4j-push flag)
|
||||
|
||||
**If `--neo4j`** - generate a Cypher file for manual import:
|
||||
|
||||
```bash
|
||||
graphify export neo4j
|
||||
```
|
||||
|
||||
**If `--neo4j-push`** - push directly to Neo4j using the destination URI supplied with the original `/graphify` command. Only push when this flag was explicitly given.
|
||||
|
||||
Pass the exact URI from the original `/graphify` command as one argument. When constructing a shell command, quote the URI for the shell that will execute the command (use `shlex.quote` for POSIX shells), or use a structured argument interface. Keep the URI as data; never interpolate it unquoted or evaluate it as shell code. Never replace a supplied URI with localhost. If the user explicitly requested a push but supplied no URI, use the documented local default. Do not print the URI or credentials in status output or generated artifacts.
|
||||
|
||||
```bash
|
||||
graphify export neo4j --push 'bolt://remote-host:7687' --user neo4j
|
||||
```
|
||||
|
||||
Default URI is `bolt://localhost:7687`, default user is `neo4j`. Prefer the `NEO4J_PASSWORD` environment variable so the password is kept off argv; ask for credentials only when needed. Uses MERGE - safe to re-run without creating duplicates.
|
||||
|
||||
### Step 7a - FalkorDB export (only if --falkordb or --falkordb-push flag)
|
||||
|
||||
**If `--falkordb`** - generate a Cypher file. The statements are OpenCypher, but FalkorDB's `GRAPH.QUERY` runs one statement at a time (no bulk script import like Neo4j's `cypher-shell`), so prefer `--falkordb-push` to load a graph. Use this only when you want the portable `cypher.txt` artifact:
|
||||
|
||||
```bash
|
||||
graphify export falkordb
|
||||
```
|
||||
|
||||
**If `--falkordb-push`** - push directly to FalkorDB using the destination URI supplied with the original `/graphify` command. Only push when this flag was explicitly given.
|
||||
|
||||
Pass the exact URI from the original `/graphify` command as one argument. When constructing a shell command, quote the URI for the shell that will execute the command (use `shlex.quote` for POSIX shells), or use a structured argument interface. Keep the URI as data; never interpolate it unquoted or evaluate it as shell code. Never replace a supplied URI with localhost. If the user explicitly requested a push but supplied no URI, use the documented local default. Do not print the URI or credentials in status output or generated artifacts. Credentials are optional; ask only if the instance requires authentication, and use `FALKORDB_PASSWORD` for a password rather than printing it.
|
||||
|
||||
```bash
|
||||
graphify export falkordb --push 'falkordb://remote-host:6379'
|
||||
```
|
||||
|
||||
Default URI is `falkordb://localhost:6379` (the scheme is informational - `redis://` or a bare `host:port` work too), auth is optional, and the target graph defaults to `graphify`. Uses MERGE - safe to re-run without creating duplicates.
|
||||
|
||||
### Step 7b - SVG export (only if --svg flag)
|
||||
|
||||
```bash
|
||||
graphify export svg
|
||||
```
|
||||
|
||||
### Step 7c - GraphML export (only if --graphml flag)
|
||||
|
||||
```bash
|
||||
graphify export graphml
|
||||
```
|
||||
|
||||
### Step 7d - MCP server (only if --mcp flag)
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -m graphify.serve graphify-out/graph.json
|
||||
```
|
||||
|
||||
This starts a stdio MCP server that exposes tools: `query_graph`, `get_node`, `get_neighbors`, `get_community`, `god_nodes`, `graph_stats`, `shortest_path`. Add to Claude Desktop or any MCP-compatible agent orchestrator so other agents can query the graph live.
|
||||
|
||||
To configure in Claude Desktop, add to `claude_desktop_config.json`. Claude Desktop can't run `$(...)`, and under `uv tool install` the system `python3` can't import graphify — so set `command` to the **absolute interpreter path** printed by `cat graphify-out/.graphify_python`:
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"graphify": {
|
||||
"command": "<absolute path from: cat graphify-out/.graphify_python>",
|
||||
"args": ["-m", "graphify.serve", "/absolute/path/to/graphify-out/graph.json"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Step 8 - Token reduction benchmark (only if total_words > 5000)
|
||||
|
||||
If `total_words` from `graphify-out/.graphify_detect.json` is greater than 5,000, run:
|
||||
|
||||
```bash
|
||||
graphify benchmark
|
||||
```
|
||||
|
||||
Print the output directly in chat. If `total_words <= 5000`, skip silently - the graph value is structural clarity, not token compression, for small corpora.
|
||||
@@ -0,0 +1,86 @@
|
||||
# graphify reference: extraction subagent prompt
|
||||
|
||||
Load this in Step 3 Part B when the corpus has at least one doc, paper, or image chunk. A pure-code corpus skips Part B and never reads this file. Each semantic subagent receives the prompt below verbatim (substitute FILE_LIST, CHUNK_NUM, TOTAL_CHUNKS, DEEP_MODE, and CHUNK_PATH).
|
||||
|
||||
```
|
||||
You are a graphify extraction subagent. Read the files listed and extract a knowledge graph fragment.
|
||||
Output ONLY valid JSON matching the schema below - no explanation, no markdown fences, no preamble.
|
||||
|
||||
Files (chunk CHUNK_NUM of TOTAL_CHUNKS):
|
||||
FILE_LIST
|
||||
|
||||
Read every file in this list COMPLETELY before extracting anything from it. The Read tool
|
||||
returns at most 2000 lines per call and reports NO error and NO warning when it truncates, so a
|
||||
long file silently yields a partial extraction. When a file is longer than one call, keep paging
|
||||
with offset/limit until you have actually seen its last line - never assume the first call
|
||||
returned the whole file. Never emit nodes for a file you have only partly read. A partial
|
||||
extraction is worse than none: replace-on-re-extract first DROPS that file's existing nodes and
|
||||
then re-adds only what you saw, so the unread tail disappears from the graph, and the file is then
|
||||
recorded as successfully extracted and never retried (#2225).
|
||||
|
||||
Report the coverage you actually achieved, so a short read is caught instead of guessed at: add a
|
||||
top-level "coverage" object mapping each FILE_LIST path you extracted to the number of lines you
|
||||
read, e.g. {"coverage": {"docs/plan.md": 452}}. If you could not reach a file's last line, still
|
||||
report the count you did read. A short count is recoverable - Step B3 warns, the entry is cached
|
||||
as partial, and the next --update retries the file - whereas a missing entry is indistinguishable
|
||||
from a complete read.
|
||||
|
||||
Rules:
|
||||
- EXTRACTED: relationship explicit in source (import, call, citation, "see §3.2")
|
||||
- INFERRED: reasonable inference (shared data structure, implied dependency)
|
||||
- AMBIGUOUS: uncertain - flag for review, do not omit
|
||||
|
||||
Code files: focus on semantic edges AST cannot find (call relationships, shared data, arch patterns).
|
||||
Do not re-extract imports - AST already has those.
|
||||
Doc/paper files: extract named concepts, entities, citations. For rationale (WHY decisions were made, trade-offs, design intent): store as a `rationale` attribute on the relevant concept node — do NOT create a separate rationale node or fragment node. Only create a node for something that is itself a named entity or concept. Use `file_type:"rationale"` for concept-like nodes (ideas, principles, mechanisms, design patterns). `file_type` MUST be one of exactly these six values: `code`, `document`, `paper`, `image`, `rationale`, `concept`. Any other value is invalid and will be rejected.
|
||||
Code files: when adding `calls` edges, source MUST be the caller (the function/class doing the calling), target MUST be the callee. Never reverse this direction. `calls` edges MUST stay within one language: a Python function cannot `calls` a JS/TS/Go/Rust/Java symbol and vice versa — cross-language call edges are phantom artifacts, never emit them.
|
||||
Image files: use vision to understand what the image IS - do not just OCR.
|
||||
UI screenshot: layout patterns, design decisions, key elements, purpose.
|
||||
Chart: metric, trend/insight, data source.
|
||||
Tweet/post: claim as node, author, concepts mentioned.
|
||||
Diagram: components and connections.
|
||||
Research figure: what it demonstrates, method, result.
|
||||
Handwritten/whiteboard: ideas and arrows, mark uncertain readings AMBIGUOUS.
|
||||
|
||||
DEEP_MODE (if --mode deep was given): be aggressive with INFERRED edges - indirect deps,
|
||||
shared assumptions, latent couplings. Mark uncertain ones AMBIGUOUS instead of omitting.
|
||||
|
||||
Semantic similarity: if two concepts in this chunk solve the same problem or represent the same idea without any structural link (no import, no call, no citation), add a `semantically_similar_to` edge marked INFERRED with a confidence_score reflecting how similar they are (0.6-0.95). Examples:
|
||||
- Two functions that both validate user input but never call each other
|
||||
- A class in code and a concept in a paper that describe the same algorithm
|
||||
- Two error types that handle the same failure mode differently
|
||||
Only add these when the similarity is genuinely non-obvious and cross-cutting. Do not add them for trivially similar things.
|
||||
|
||||
Hyperedges: if 3 or more nodes clearly participate together in a shared concept, flow, or pattern that is not captured by pairwise edges alone, add a hyperedge to a top-level `hyperedges` array. Examples:
|
||||
- All classes that implement a common protocol or interface
|
||||
- All functions in an authentication flow (even if they don't all call each other)
|
||||
- All concepts from a paper section that form one coherent idea
|
||||
Use sparingly — only when the group relationship adds information beyond the pairwise edges. Maximum 3 hyperedges per chunk.
|
||||
|
||||
If a file has YAML frontmatter (--- ... ---), copy source_url, captured_at, author,
|
||||
contributor onto every node from that file.
|
||||
|
||||
confidence_score is REQUIRED on every edge - never omit it, never use 0.5 as a default:
|
||||
- EXTRACTED edges: confidence_score = 1.0 always
|
||||
- INFERRED edges: pick exactly ONE value from this set — never 0.5:
|
||||
0.95 direct structural evidence (shared data structure, named cross-file reference).
|
||||
0.85 strong inference (clear functional alignment, no direct symbol link).
|
||||
0.75 reasonable inference (shared problem domain + similar shape, requires interpretation).
|
||||
0.65 weak inference (thematically related, no shape evidence).
|
||||
0.55 speculative but plausible (surface-level co-occurrence only).
|
||||
Models follow discrete rubrics better than continuous ranges; the bimodal
|
||||
distribution observed in production (>50% at 0.5, >40% at 0.85+) shows the
|
||||
range guidance is being collapsed to a binary. If no value above fits, mark
|
||||
the edge AMBIGUOUS rather than picking 0.4 or below.
|
||||
- AMBIGUOUS edges: 0.1-0.3
|
||||
|
||||
Node ID format: lowercase, word characters only (`[^\W]` after casefolding — `[a-z0-9_]` for ASCII input, but non-ASCII letters and digits are kept as-is), no dots or slashes. Format: `{stem}_{entity}` where stem is the **full repo-relative path with the extension dropped**, every path segment kept and joined with `_` (each segment lowercased with non-alphanumeric chars replaced by `_`), and entity is the symbol name similarly normalized. Use every directory level, not just the immediate parent — this keeps same-named files in different directories distinct. Examples: `src/auth/session.py` + `ValidateToken` → `src_auth_session_validatetoken`; `lib/utils/helpers.py` + `parse_url` → `lib_utils_helpers_parse_url`; `tests/test_foo.py` + `_helper` → `tests_test_foo_helper`; `docs/v1/api/README.md` + `getUser` → `docs_v1_api_readme_getuser`. Top-level files (no parent dir, e.g. `setup.py`) use just the filename stem: `setup_my_func`. This must match the ID the AST extractor generates — using just the filename (e.g., `session_validatetoken`) or only the immediate parent (e.g., `auth_session_validatetoken`) will create orphan ghost-duplicate nodes. If you are re-extracting a project built under the old immediate-parent format, the user should run `graphify extract --force` to rebuild cleanly. CRITICAL: never append chunk numbers, sequence numbers, or any suffix to an ID (no `_c1`, `_c2`, `_chunk2`, etc.). IDs must be deterministic from the label alone — the same entity must always produce the same ID regardless of which chunk processes it.
|
||||
|
||||
Generate the extraction JSON matching this schema exactly:
|
||||
{"nodes":[{"id":"auth_session_validatetoken","label":"Human Readable Name","file_type":"code|document|paper|image|rationale|concept","source_file":"<FILE_LIST path verbatim>","source_location":null,"source_url":null,"captured_at":null,"author":null,"contributor":null}],"edges":[{"source":"node_id","target":"node_id","relation":"calls|implements|references|cites|conceptually_related_to|shares_data_with|semantically_similar_to|rationale_for","confidence":"EXTRACTED|INFERRED|AMBIGUOUS","confidence_score":1.0,"source_file":"<FILE_LIST path verbatim>","source_location":null,"weight":1.0}],"hyperedges":[{"id":"snake_case_id","label":"Human Readable Label","nodes":["node_id1","node_id2","node_id3"],"relation":"participate_in|implement|form","confidence":"EXTRACTED|INFERRED","confidence_score":0.75,"source_file":"<FILE_LIST path verbatim>"}],"input_tokens":0,"output_tokens":0,"coverage":{"<FILE_LIST path verbatim>":0}}
|
||||
|
||||
source_file RULE (every node, edge, and hyperedge): set source_file to the path of the originating file EXACTLY as it appears in FILE_LIST — verbatim and absolute. Do NOT shorten to a basename, do NOT re-relativize, do NOT strip any directory prefix, and do NOT change separators (the engine canonicalizes separators and relativizes against the build root downstream). Copy the FILE_LIST entry character-for-character. This keeps the full build and incremental --update on the same base, so build_merge's replace-on-re-extract matches the existing node instead of accumulating a duplicate.
|
||||
|
||||
Then write the JSON to disk using the Write tool at this exact absolute path (no relative paths — Write resolves relative paths against an undefined cwd and the file will be silently lost):
|
||||
CHUNK_PATH
|
||||
```
|
||||
@@ -0,0 +1,46 @@
|
||||
# graphify reference: GitHub clone and cross-repo merge
|
||||
|
||||
Load this when the user passed one or more `https://github.com/...` URLs, or named several local subfolders to merge into one graph.
|
||||
|
||||
### Step 0 - Clone GitHub repo(s) (only if a GitHub URL was given)
|
||||
|
||||
**Single repo:**
|
||||
```bash
|
||||
LOCAL_PATH=$(graphify clone <github-url> [--branch <branch>])
|
||||
# Use LOCAL_PATH as the target for all subsequent steps
|
||||
```
|
||||
|
||||
**Multiple repos (cross-repo graph):**
|
||||
```bash
|
||||
# Clone each repo, run the full pipeline on each, then merge
|
||||
graphify clone <url1> # → ~/.graphify/repos/<owner1>/<repo1>
|
||||
graphify clone <url2> # → ~/.graphify/repos/<owner2>/<repo2>
|
||||
# Run /graphify on each local path to produce their graph.json files
|
||||
# Then merge:
|
||||
graphify merge-graphs \
|
||||
~/.graphify/repos/<owner1>/<repo1>/graphify-out/graph.json \
|
||||
~/.graphify/repos/<owner2>/<repo2>/graphify-out/graph.json \
|
||||
--out graphify-out/cross-repo-graph.json
|
||||
```
|
||||
|
||||
Graphify clones into `~/.graphify/repos/<owner>/<repo>` and reuses existing clones on repeat runs. Each node in the merged graph carries a `repo` attribute so you can filter by origin.
|
||||
|
||||
**Multiple local subfolders (monorepo or multi-service layout):**
|
||||
|
||||
The skill pipeline writes all intermediate and final outputs to `graphify-out/` in the current working directory. Running the skill on each subfolder separately will clobber the same output dir. Instead, use the CLI directly for each subfolder — it places `graphify-out/` *inside* the scanned path:
|
||||
|
||||
```bash
|
||||
graphify extract ./core/ # → ./core/graphify-out/graph.json
|
||||
graphify extract ./service/ # → ./service/graphify-out/graph.json
|
||||
graphify extract ./platform/ # → ./platform/graphify-out/graph.json
|
||||
# Add --backend gemini|kimi|openai|deepseek|claude-cli depending on which API key you have set
|
||||
|
||||
# Then merge at the project root:
|
||||
graphify merge-graphs \
|
||||
./core/graphify-out/graph.json \
|
||||
./service/graphify-out/graph.json \
|
||||
./platform/graphify-out/graph.json \
|
||||
--out graphify-out/graph.json
|
||||
```
|
||||
|
||||
Once `graphify-out/graph.json` exists, the fast path above takes over: any codebase question runs `graphify query` directly on the merged graph — no re-extraction, no size gate.
|
||||
@@ -0,0 +1,33 @@
|
||||
# graphify reference: commit hook and native CLAUDE.md integration
|
||||
|
||||
Load this when the user asked to install the post-commit hook or wire graphify into a project's CLAUDE.md.
|
||||
|
||||
## For git commit hook
|
||||
|
||||
Install a post-commit hook that auto-rebuilds the graph after every commit. No background process needed - triggers once per commit, works with any editor.
|
||||
|
||||
```bash
|
||||
graphify hook install # install
|
||||
graphify hook uninstall # remove
|
||||
graphify hook status # check
|
||||
```
|
||||
|
||||
After every `git commit`, the hook detects which code files changed (via `git diff HEAD~1`), re-runs AST extraction on those files, and rebuilds `graph.json` and `GRAPH_REPORT.md`. Doc/image changes are ignored by the hook - run `/graphify --update` manually for those.
|
||||
|
||||
If a post-commit hook already exists, graphify appends to it rather than replacing it.
|
||||
|
||||
---
|
||||
|
||||
## For native CLAUDE.md integration
|
||||
|
||||
Run once per project to make graphify always-on in Claude Code sessions:
|
||||
|
||||
```bash
|
||||
graphify claude install
|
||||
```
|
||||
|
||||
This writes a `## graphify` section to the local `CLAUDE.md` that instructs Claude to check the graph before answering codebase questions and rebuild it after code changes. No manual `/graphify` needed in future sessions.
|
||||
|
||||
```bash
|
||||
graphify claude uninstall # remove the section
|
||||
```
|
||||
@@ -0,0 +1,317 @@
|
||||
# graphify reference: query, path, explain
|
||||
|
||||
Load this when the user asks a question against an existing graph, or runs `/graphify path` or `/graphify explain`. The core's query stub points here for the full traversal flow. These flows use the `graphify query` CLI when it is available and fall back to an inline NetworkX traversal otherwise.
|
||||
|
||||
Two traversal modes - choose based on the question:
|
||||
|
||||
| Mode | Flag | Best for |
|
||||
|------|------|----------|
|
||||
| BFS (default) | _(none)_ | "What is X connected to?" - broad context, nearest neighbors first |
|
||||
| DFS | `--dfs` | "How does X reach Y?" - trace a specific chain or dependency path |
|
||||
|
||||
First check the graph exists:
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
from pathlib import Path
|
||||
if not Path('graphify-out/graph.json').exists():
|
||||
print('ERROR: No graph found. Run /graphify <path> first to build the graph.')
|
||||
raise SystemExit(1)
|
||||
"
|
||||
```
|
||||
If it fails, stop and tell the user to run `/graphify <path>` first.
|
||||
|
||||
### Step 0 — Constrained query expansion (REQUIRED before traversal)
|
||||
|
||||
graphify's `query` CLI matches nodes via case-folded substring + IDF — there is **no stemming, no synonyms, no cross-language match** inside the binary, and the inline fallback below matches the same way. If the user's question uses different language or different domain vocabulary than the graph's labels (user says "обработчик" / graph says "handler"; user says "authentication" / graph says "Guardian"), the literal matcher returns 0 hits and the answer collapses to noise.
|
||||
|
||||
Fix this **without inventing tokens** by expanding the query against the actual graph vocabulary first:
|
||||
|
||||
1. Extract the token vocabulary from node labels:
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json, re
|
||||
from pathlib import Path
|
||||
data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8'))
|
||||
vocab = set()
|
||||
for n in data['nodes']:
|
||||
for c in re.findall(r'[^\W\d_]+', n.get('label','') or '', re.UNICODE):
|
||||
parts = re.findall(r'[A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+', c) or [c]
|
||||
for p in parts:
|
||||
t = p.lower()
|
||||
if 3 <= len(t) <= 30:
|
||||
vocab.add(t)
|
||||
Path('graphify-out/.vocab.txt').write_text('\n'.join(sorted(vocab)), encoding='utf-8')
|
||||
print(f'vocab: {len(vocab)} tokens')
|
||||
"
|
||||
```
|
||||
|
||||
2. Read `graphify-out/.vocab.txt`. Then for the user's question, select **up to 12 tokens from this exact list** that semantically match the query intent. Hard constraints:
|
||||
- You MUST pick only tokens present in the vocabulary file. Do NOT invent tokens.
|
||||
- If a query concept has no plausible token in the vocab, skip it — do not substitute a near-synonym from training memory.
|
||||
- If **no** vocab tokens match the query at all, output an empty list and tell the user the corpus has no relevant vocabulary for this question. Do not fabricate a search.
|
||||
- Translate cross-language: Russian "аутентификация" → look for `auth`, `credential`, `token`, `security` IFF present in vocab.
|
||||
- Morphology: "handlers" maps to `handler` IFF present; "todos" maps to `todo` IFF present.
|
||||
|
||||
3. Print the selection explicitly to the user before running the query, so the expansion is auditable:
|
||||
```
|
||||
Query expanded to (from graph vocab, N tokens): [token1, token2, ...]
|
||||
```
|
||||
If the list is empty, say so plainly and stop — do not proceed to traversal.
|
||||
|
||||
### Step 1 — Traversal
|
||||
|
||||
Build the **expanded query string** by joining the selected tokens with spaces. Use this string as `QUESTION` below — NOT the original user question. (The original question is preserved only for `save-result` at the end.)
|
||||
|
||||
Prefer the CLI when it is installed:
|
||||
```bash
|
||||
graphify query "QUESTION"
|
||||
# or: graphify query "QUESTION" --dfs --budget 3000
|
||||
```
|
||||
|
||||
If the CLI is unavailable, load `graphify-out/graph.json` and run the traversal inline:
|
||||
|
||||
1. Find the 1-3 nodes whose label best matches the expanded tokens.
|
||||
2. Run the appropriate traversal from each starting node.
|
||||
3. Read the subgraph - node labels, edge relations, confidence tags, source locations.
|
||||
4. Answer using **only** what the graph contains. Quote `source_location` when citing a specific fact.
|
||||
5. If the graph lacks enough information, say so - do not hallucinate edges.
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import sys, json
|
||||
from networkx.readwrite import json_graph
|
||||
from pathlib import Path
|
||||
|
||||
data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8'))
|
||||
G = json_graph.node_link_graph(data, edges='links')
|
||||
|
||||
question = 'QUESTION'
|
||||
mode = 'MODE' # 'bfs' or 'dfs'
|
||||
terms = [t.lower() for t in question.split() if len(t) >= 3] # match the vocab threshold; keeps api/jwt/ios (#1392)
|
||||
|
||||
# Find best-matching start nodes
|
||||
scored = []
|
||||
for nid, ndata in G.nodes(data=True):
|
||||
label = ndata.get('label', '').lower()
|
||||
score = sum(1 for t in terms if t in label)
|
||||
if score > 0:
|
||||
scored.append((score, nid))
|
||||
scored.sort(reverse=True)
|
||||
start_nodes = [nid for _, nid in scored[:3]]
|
||||
|
||||
if not start_nodes:
|
||||
print('No matching nodes found for query terms:', terms)
|
||||
sys.exit(0)
|
||||
|
||||
subgraph_nodes = set()
|
||||
|
||||
if mode == 'dfs':
|
||||
# DFS: follow one path as deep as possible before backtracking.
|
||||
# Depth-limited to 6 to avoid traversing the whole graph.
|
||||
visited = set()
|
||||
stack = [(n, 0) for n in reversed(start_nodes)]
|
||||
while stack:
|
||||
node, depth = stack.pop()
|
||||
if node in visited or depth > 6:
|
||||
continue
|
||||
visited.add(node)
|
||||
subgraph_nodes.add(node)
|
||||
for neighbor in G.neighbors(node):
|
||||
if neighbor not in visited:
|
||||
stack.append((neighbor, depth + 1))
|
||||
else:
|
||||
# BFS: explore all neighbors layer by layer up to depth 3.
|
||||
frontier = set(start_nodes)
|
||||
subgraph_nodes = set(start_nodes)
|
||||
for _ in range(3):
|
||||
next_frontier = set()
|
||||
for n in frontier:
|
||||
for neighbor in G.neighbors(n):
|
||||
if neighbor not in subgraph_nodes:
|
||||
next_frontier.add(neighbor)
|
||||
subgraph_nodes.update(next_frontier)
|
||||
frontier = next_frontier
|
||||
|
||||
# Traversal chooses the nodes; collect relationships separately so seed edges,
|
||||
# cycles, and cross-links are not lost just because both endpoints were visited.
|
||||
# Taking the induced subgraph also keeps edges to nodes beyond the depth limit
|
||||
# out of the result. data=True retains each edge's own attributes, including
|
||||
# distinct parallel relationships in a MultiGraph.
|
||||
subgraph_edges = [
|
||||
(u, v, edge_data)
|
||||
for u, v, edge_data in G.subgraph(subgraph_nodes).edges(data=True)
|
||||
if u != v
|
||||
]
|
||||
|
||||
# Token-budget aware output: rank by relevance, cut at budget (~4 chars/token)
|
||||
token_budget = BUDGET # default 2000
|
||||
char_budget = token_budget * 4
|
||||
|
||||
# Score each node by term overlap for ranked output
|
||||
def relevance(nid):
|
||||
label = G.nodes[nid].get('label', '').lower()
|
||||
return sum(1 for t in terms if t in label)
|
||||
|
||||
ranked_nodes = sorted(subgraph_nodes, key=relevance, reverse=True)
|
||||
|
||||
lines = [f'Traversal: {mode.upper()} | Start: {[G.nodes[n].get(\"label\",n) for n in start_nodes]} | {len(subgraph_nodes)} nodes']
|
||||
for nid in ranked_nodes:
|
||||
d = G.nodes[nid]
|
||||
lines.append(f' NODE {d.get(\"label\", nid)} [src={d.get(\"source_file\",\"\")} loc={d.get(\"source_location\",\"\")}]')
|
||||
for u, v, edge_data in subgraph_edges:
|
||||
if u in subgraph_nodes and v in subgraph_nodes:
|
||||
lines.append(f' EDGE {G.nodes[u].get(\"label\",u)} --{edge_data.get(\"relation\",\"\")} [{edge_data.get(\"confidence\",\"\")}]--> {G.nodes[v].get(\"label\",v)}')
|
||||
|
||||
output = '\n'.join(lines)
|
||||
if len(output) > char_budget:
|
||||
output = output[:char_budget] + f'\n... (truncated at ~{token_budget} token budget - use --budget N for more)'
|
||||
print(output)
|
||||
"
|
||||
```
|
||||
|
||||
Replace `QUESTION` with the **expanded** query string, `MODE` with `bfs` or `dfs`, and `BUDGET` with the token budget (default `2000`, or whatever `--budget N` specifies). Then answer based on the subgraph output above, using only what the graph contains.
|
||||
|
||||
After writing the answer, save it back into the graph so it improves future queries. Include the expanded tokens inside the `--answer` text (e.g. `"Expanded from original query via vocab: [tokens]. Then traversed..."`) so the next `--update` extracts the expansion history as a graph node:
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -m graphify save-result --question "ORIGINAL_QUESTION" --answer "ANSWER" --type query --nodes NODE1 NODE2
|
||||
```
|
||||
|
||||
Replace `ORIGINAL_QUESTION` with the user's verbatim question, `ANSWER` with your full answer text (containing the expanded-token trace), `NODE1 NODE2` with the list of node labels you cited. This closes the feedback loop: the next `--update` will extract this Q&A as a node in the graph.
|
||||
|
||||
**Work memory (self-improving loop).** Add an `--outcome` so future sessions learn from this one — append `--outcome useful|dead_end|corrected` to the `save-result` command (and `--correction "the right answer"` when correcting):
|
||||
|
||||
- `useful` — the cited nodes answered the question well (they become *preferred sources*).
|
||||
- `dead_end` — the question/path led nowhere; don't re-derive it next time.
|
||||
- `corrected` — the saved answer was wrong; `--correction` records what was right.
|
||||
|
||||
At the **start** of graph work, refresh and read the lessons: run `graphify reflect --if-stale` (cheap, deterministic, no LLM; `--if-stale` makes it a no-op when `LESSONS.md` is already newer than every input, e.g. when the git hook just refreshed it), then read `graphify-out/reflections/LESSONS.md`. It lists **preferred sources** (start there), **known dead ends** (skip them), and prior **corrections**. Running `reflect` yourself keeps the lessons current even without the git hook installed; if the post-commit hook *is* installed, `--if-stale` means your session-start run costs almost nothing.
|
||||
|
||||
---
|
||||
|
||||
## For /graphify path
|
||||
|
||||
Find the shortest path between two named concepts in the graph. Prefer the CLI when installed:
|
||||
|
||||
```bash
|
||||
graphify path "NODE_A" "NODE_B"
|
||||
```
|
||||
|
||||
If the CLI is unavailable, run it inline:
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json, sys
|
||||
import networkx as nx
|
||||
from networkx.readwrite import json_graph
|
||||
from pathlib import Path
|
||||
|
||||
data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8'))
|
||||
G = json_graph.node_link_graph(data, edges='links')
|
||||
|
||||
a_term = 'NODE_A'
|
||||
b_term = 'NODE_B'
|
||||
|
||||
def find_node(term):
|
||||
term = term.lower()
|
||||
scored = sorted(
|
||||
[(sum(1 for w in term.split() if w in G.nodes[n].get('label','').lower()), n)
|
||||
for n in G.nodes()],
|
||||
reverse=True
|
||||
)
|
||||
return scored[0][1] if scored and scored[0][0] > 0 else None
|
||||
|
||||
src = find_node(a_term)
|
||||
tgt = find_node(b_term)
|
||||
|
||||
if not src or not tgt:
|
||||
print(f'Could not find nodes matching: {a_term!r} or {b_term!r}')
|
||||
sys.exit(0)
|
||||
|
||||
try:
|
||||
path = nx.shortest_path(G, src, tgt)
|
||||
print(f'Shortest path ({len(path)-1} hops):')
|
||||
for i, nid in enumerate(path):
|
||||
label = G.nodes[nid].get('label', nid)
|
||||
if i < len(path) - 1:
|
||||
_raw = G[nid][path[i+1]]; edge = next(iter(_raw.values()), {}) if isinstance(G, nx.MultiGraph) else _raw
|
||||
rel = edge.get('relation', '')
|
||||
conf = edge.get('confidence', '')
|
||||
print(f' {label} --{rel}--> [{conf}]')
|
||||
else:
|
||||
print(f' {label}')
|
||||
except nx.NetworkXNoPath:
|
||||
print(f'No path found between {a_term!r} and {b_term!r}')
|
||||
except nx.NodeNotFound as e:
|
||||
print(f'Node not found: {e}')
|
||||
"
|
||||
```
|
||||
|
||||
Replace `NODE_A` and `NODE_B` with the actual concept names from the user. Then explain the path in plain language - what each hop means, why it's significant.
|
||||
|
||||
After writing the explanation, save it back:
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -m graphify save-result --question "Path from NODE_A to NODE_B" --answer "ANSWER" --type path_query --nodes NODE_A NODE_B
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## For /graphify explain
|
||||
|
||||
Give a plain-language explanation of a single node - everything connected to it. Prefer the CLI when installed:
|
||||
|
||||
```bash
|
||||
graphify explain "NODE_NAME"
|
||||
```
|
||||
|
||||
If the CLI is unavailable, run it inline:
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json, sys
|
||||
import networkx as nx
|
||||
from networkx.readwrite import json_graph
|
||||
from pathlib import Path
|
||||
|
||||
data = json.loads(Path('graphify-out/graph.json').read_text(encoding='utf-8'))
|
||||
G = json_graph.node_link_graph(data, edges='links')
|
||||
|
||||
term = 'NODE_NAME'
|
||||
term_lower = term.lower()
|
||||
|
||||
# Find best matching node
|
||||
scored = sorted(
|
||||
[(sum(1 for w in term_lower.split() if w in G.nodes[n].get('label','').lower()), n)
|
||||
for n in G.nodes()],
|
||||
reverse=True
|
||||
)
|
||||
if not scored or scored[0][0] == 0:
|
||||
print(f'No node matching {term!r}')
|
||||
sys.exit(0)
|
||||
|
||||
nid = scored[0][1]
|
||||
data_n = G.nodes[nid]
|
||||
print(f'NODE: {data_n.get(\"label\", nid)}')
|
||||
print(f' source: {data_n.get(\"source_file\",\"unknown\")}')
|
||||
print(f' type: {data_n.get(\"file_type\",\"unknown\")}')
|
||||
print(f' degree: {G.degree(nid)}')
|
||||
print()
|
||||
print('CONNECTIONS:')
|
||||
for neighbor in G.neighbors(nid):
|
||||
_raw = G[nid][neighbor]; edge = next(iter(_raw.values()), {}) if isinstance(G, nx.MultiGraph) else _raw
|
||||
nlabel = G.nodes[neighbor].get('label', neighbor)
|
||||
rel = edge.get('relation', '')
|
||||
conf = edge.get('confidence', '')
|
||||
src_file = G.nodes[neighbor].get('source_file', '')
|
||||
print(f' --{rel}--> {nlabel} [{conf}] ({src_file})')
|
||||
"
|
||||
```
|
||||
|
||||
Replace `NODE_NAME` with the concept the user asked about. Then write a 3-5 sentence explanation of what this node is, what it connects to, and why those connections are significant. Use the source locations as citations.
|
||||
|
||||
After writing the explanation, save it back:
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -m graphify save-result --question "Explain NODE_NAME" --answer "ANSWER" --type explain --nodes NODE_NAME
|
||||
```
|
||||
@@ -0,0 +1,52 @@
|
||||
# graphify reference: transcribe video and audio
|
||||
|
||||
Load this only when `detect` reported one or more `video` files. A corpus with no video never reads this.
|
||||
|
||||
### Step 2.5 - Transcribe video / audio files (only if video files detected)
|
||||
|
||||
Skip this step entirely if `detect` returned zero `video` files.
|
||||
|
||||
Video and audio files cannot be read directly. Transcribe them to text first, then treat the transcripts as doc files in Step 3.
|
||||
|
||||
**Strategy:** Read the god nodes from `graphify-out/.graphify_detect.json` (or the analysis file if it exists from a previous run). You are already a language model — write a one-sentence domain hint yourself from those labels. Then pass it to Whisper as the initial prompt. No separate API call needed.
|
||||
|
||||
**However**, if the corpus has *only* video files and no other docs/code, use the generic fallback prompt: `"Use proper punctuation and paragraph breaks."`
|
||||
|
||||
**Step 1 - Write the Whisper prompt yourself.**
|
||||
|
||||
Read the top god node labels from detect output or analysis, then compose a short domain hint sentence, for example:
|
||||
|
||||
- Labels: `transformer, attention, encoder, decoder` → `"Machine learning research on transformer architectures and attention mechanisms. Use proper punctuation and paragraph breaks."`
|
||||
- Labels: `kubernetes, deployment, pod, helm` → `"DevOps discussion about Kubernetes deployments and Helm charts. Use proper punctuation and paragraph breaks."`
|
||||
|
||||
**Export** it as `GRAPHIFY_WHISPER_PROMPT` (the exact name the transcriber reads — and it must be `export`ed so the child Python process sees it) for the next command.
|
||||
|
||||
**Step 2 - Transcribe:**
|
||||
|
||||
```bash
|
||||
export GRAPHIFY_WHISPER_MODEL=base # or whatever --whisper-model the user passed (must be exported)
|
||||
export GRAPHIFY_WHISPER_PROMPT="<the one-sentence domain hint you composed in Step 1>"
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json, os, sys
|
||||
from pathlib import Path
|
||||
from graphify.transcribe import transcribe_all
|
||||
|
||||
detect = json.loads(Path('graphify-out/.graphify_detect.json').read_text(encoding=\"utf-8\"))
|
||||
video_files = detect.get('files', {}).get('video', [])
|
||||
prompt = os.environ.get('GRAPHIFY_WHISPER_PROMPT', 'Use proper punctuation and paragraph breaks.')
|
||||
|
||||
transcript_paths = transcribe_all(video_files, initial_prompt=prompt)
|
||||
# Write the JSON from Python (NOT a shell '>' redirect): transcribe_all/Whisper
|
||||
# print progress to stdout, which would otherwise corrupt the JSON file (#1392).
|
||||
Path('graphify-out/.graphify_transcripts.json').write_text(json.dumps(transcript_paths, ensure_ascii=False), encoding=\"utf-8\")
|
||||
print(f'Transcribed {len(transcript_paths)} file(s)', file=sys.stderr)
|
||||
"
|
||||
```
|
||||
|
||||
After transcription:
|
||||
- Read the transcript paths from `graphify-out/.graphify_transcripts.json`
|
||||
- Add them to the docs list before dispatching semantic subagents in Step 3B
|
||||
- Print how many transcripts were created: `Transcribed N video file(s) -> treating as docs`
|
||||
- If transcription fails for a file, print a warning and continue with the rest
|
||||
|
||||
**Whisper model:** Default is `base`. If the user passed `--whisper-model <name>`, `export GRAPHIFY_WHISPER_MODEL=<name>` (it must be exported, not just assigned) before running the command above.
|
||||
@@ -0,0 +1,221 @@
|
||||
# graphify reference: incremental update and cluster-only
|
||||
|
||||
Load this only when the user passed `--update` or `--cluster-only`. A first-time full build never reads this file.
|
||||
|
||||
## For --update (incremental re-extraction)
|
||||
|
||||
Use when you've added or modified files since the last run. Only re-extracts changed files - saves tokens and time.
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import sys, json
|
||||
from graphify.detect import detect_incremental, save_manifest
|
||||
from pathlib import Path
|
||||
|
||||
from graphify.paths import out_path
|
||||
from graphify.watch import _read_build_excludes, _read_build_gitignore
|
||||
result = detect_incremental(Path('INPUT_PATH'), extra_excludes=_read_build_excludes(out_path()), gitignore=_read_build_gitignore(out_path()))
|
||||
new_total = result.get('new_total', 0)
|
||||
nf = result.get('new_files', {})
|
||||
print(json.dumps({
|
||||
'new_total': new_total,
|
||||
'deleted': len(result.get('deleted_files', [])),
|
||||
'new_by_type': {t: len(v) for t, v in nf.items()},
|
||||
'total_files': result.get('total_files'),
|
||||
'total_words': result.get('total_words'),
|
||||
'skipped_sensitive': result.get('skipped_sensitive', []),
|
||||
}, indent=2, ensure_ascii=False))
|
||||
print('Full result: graphify-out/.graphify_incremental.json')
|
||||
Path('graphify-out/.graphify_incremental.json').write_text(json.dumps(result, ensure_ascii=False), encoding=\"utf-8\")
|
||||
deleted = list(result.get('deleted_files', []))
|
||||
if new_total == 0 and not deleted:
|
||||
print('No files changed since last run. Nothing to update.')
|
||||
raise SystemExit(0)
|
||||
if deleted:
|
||||
print(f'{len(deleted)} deleted file(s) to prune.')
|
||||
if new_total > 0:
|
||||
print(f'{new_total} new/changed file(s) to re-extract.')
|
||||
"
|
||||
```
|
||||
|
||||
Then populate `.graphify_detect.json` so Steps 3A–6 (which read it unconditionally) see the right state for an incremental run. `files` carries the changed subset (drives Step 3A AST + Step 3B0 cache check on only what changed); `all_files` carries the full corpus for any step that needs corpus-wide context:
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json
|
||||
from pathlib import Path
|
||||
r = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\"))
|
||||
Path('graphify-out/.graphify_detect.json').write_text(json.dumps({
|
||||
'files': r.get('new_files', {}),
|
||||
'all_files': r.get('files', {}),
|
||||
'total_files': r.get('new_total', 0),
|
||||
'total_words': r.get('total_words', 0),
|
||||
'skipped_sensitive': r.get('skipped_sensitive', []),
|
||||
'needs_graph': True,
|
||||
}, ensure_ascii=False), encoding=\"utf-8\")
|
||||
"
|
||||
```
|
||||
|
||||
If new files exist, first check whether all changed files are code files:
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
result = json.loads(open('graphify-out/.graphify_incremental.json', encoding='utf-8').read()) if Path('graphify-out/.graphify_incremental.json').exists() else {}
|
||||
code_exts = {'.py','.ts','.js','.go','.rs','.java','.cpp','.c','.rb','.swift','.kt','.cs','.scala','.php','.cc','.cxx','.hpp','.h','.kts','.lua','.toc','.f','.F','.f90','.F90','.f95','.F95','.f03','.F03','.f08','.F08'}
|
||||
new_files = result.get('new_files', {})
|
||||
all_changed = [f for files in new_files.values() for f in files]
|
||||
code_only = all(Path(f).suffix.lower() in code_exts for f in all_changed)
|
||||
print('code_only:', code_only)
|
||||
"
|
||||
```
|
||||
|
||||
If `code_only` is True: print `[graphify update] Code-only changes detected - skipping semantic extraction (no LLM needed)`, run Step 3A (AST) on the changed files, then follow only Part B's **Fast path** to overwrite `.graphify_semantic.json` with an empty result and run Part C to create `.graphify_extract.json` from the fresh AST result. Skip semantic cache checks/writes and subagents (Steps B0–B3); do not reuse semantic sidecars from a prior run. Continue to the incremental merge and Steps 4–8 only after Part C has completed.
|
||||
|
||||
If `code_only` is False (any changed file is a doc/paper/image/video): **first, if any changed file is in `new_files['video']`, run `references/transcribe.md` (Step 2.5) on those files, then rewrite `.graphify_detect.json` to move the resulting transcript paths into `files['document']` and drop `files['video']`** — otherwise raw `.mp4/.mp3` paths are fed to semantic subagents as unreadable media (#1392). Then run the full Steps 3A–3C pipeline as normal.
|
||||
|
||||
|
||||
If no new files exist (only deletions), create an empty extraction so the merge step can prune:
|
||||
|
||||
```bash
|
||||
if [ ! -f graphify-out/.graphify_extract.json ]; then
|
||||
echo '[graphify update] Only deletions -- creating empty extraction for merge.'
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json
|
||||
from pathlib import Path
|
||||
Path('graphify-out/.graphify_extract.json').write_text(json.dumps({'nodes':[],'edges':[],'hyperedges':[],'input_tokens':0,'output_tokens':0}), encoding='utf-8')
|
||||
"
|
||||
fi
|
||||
```
|
||||
|
||||
|
||||
Then:
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json
|
||||
from pathlib import Path
|
||||
from graphify.build import build_merge
|
||||
from graphify.detect import save_manifest
|
||||
|
||||
# Load new extraction and incremental state
|
||||
new_extraction = json.loads(Path('graphify-out/.graphify_extract.json').read_text(encoding=\"utf-8\"))
|
||||
incremental = json.loads(Path('graphify-out/.graphify_incremental.json').read_text(encoding=\"utf-8\"))
|
||||
deleted = list(incremental.get('deleted_files', []))
|
||||
# prune_sources is ONLY for genuinely DELETED files. Changed/re-extracted files are
|
||||
# handled by build_merge's replace-on-re-extract (#1344): every source_file in
|
||||
# new_chunks is dropped from the base before merge, so old/stale nodes don't survive.
|
||||
# Do NOT add changed here: with root= passed, prune_set relativizes to the same base
|
||||
# as the freshly merged nodes and would DELETE the re-extracted content (#1178 is moot
|
||||
# now that replace — not the dedup pass — reconciles changed files).
|
||||
prune = list(deleted) or None
|
||||
|
||||
# Use build_merge() — reads graph.json directly without NetworkX round-trip
|
||||
# so edge direction (calls, implements, imports) is always preserved (#801).
|
||||
# Pass root= so prune_sources (absolute paths from detect_incremental) are
|
||||
# relativized to match the graph's relative source_file values; without it
|
||||
# nothing is pruned and stale nodes accumulate on every update (#1361).
|
||||
# directed=IS_DIRECTED: replace IS_DIRECTED with True if --directed was given, else
|
||||
# False. Without it a --directed --update silently rebuilds undirected and collapses
|
||||
# reciprocal A<->B edges (#1392).
|
||||
G = build_merge(
|
||||
[new_extraction],
|
||||
graph_path='graphify-out/graph.json',
|
||||
prune_sources=prune,
|
||||
root='INPUT_PATH',
|
||||
directed=IS_DIRECTED,
|
||||
)
|
||||
print(f'[graphify update] Merged: {G.number_of_nodes()} nodes, {G.number_of_edges()} edges')
|
||||
|
||||
# Write merged result back to .graphify_extract.json so Step 4 sees the full graph
|
||||
merged_out = {
|
||||
'nodes': [{'id': n, **d} for n, d in G.nodes(data=True)],
|
||||
'edges': [
|
||||
# Explicit source/target last so they win over any stale attrs in d.
|
||||
{**{k: val for k, val in d.items() if k not in ('_src', '_tgt', 'source', 'target')},
|
||||
'source': d.get('_src', u), 'target': d.get('_tgt', v)}
|
||||
for u, v, d in G.edges(data=True)
|
||||
],
|
||||
# G.graph["hyperedges"] holds hyperedges from both existing graph.json
|
||||
# and new_extraction (build_merge combines them). Falling back to
|
||||
# new_extraction only would silently drop prior-run hyperedges (#801).
|
||||
'hyperedges': list(G.graph.get('hyperedges', [])),
|
||||
'input_tokens': new_extraction.get('input_tokens', 0),
|
||||
'output_tokens': new_extraction.get('output_tokens', 0),
|
||||
}
|
||||
Path('graphify-out/.graphify_extract.json').write_text(json.dumps(merged_out, ensure_ascii=False), encoding=\"utf-8\")
|
||||
print(f'[graphify update] Merged extraction written ({len(merged_out[\"nodes\"])} nodes, {len(merged_out[\"edges\"])} edges)')
|
||||
|
||||
# Save manifest so next --update diffs against today's state, not the
|
||||
# prior run's baseline (prevents ghost-node reports on subsequent updates).
|
||||
# root= matches the build_merge call above so the manifest keys stay relative to
|
||||
# the scan root — portable across clones/machines, so --update keeps matching
|
||||
# cached files instead of missing every one after a move (#1417).
|
||||
#
|
||||
# Only stamp semantic files (docs/papers/images) that ACTUALLY produced output
|
||||
# THIS run (new_extraction is this run's fresh extraction, read above before the
|
||||
# merge overwrote the file): a changed doc whose chunk failed must stay unstamped
|
||||
# so the next --update re-queues it, otherwise it is marked done and its content
|
||||
# is lost forever (#2015). Mirrors the library extract path
|
||||
# (cli._stamped_manifest_files + clear_semantic + scan_corpus).
|
||||
from graphify.cli import _stamped_manifest_files
|
||||
_manifest_files = _stamped_manifest_files(incremental['files'], new_extraction, Path('INPUT_PATH'))
|
||||
# Changed semantic files dispatched this run but NOT stamped had their chunk fail
|
||||
# or be omitted; clear any stale semantic_hash so they are re-queued (#1948).
|
||||
_sem_types = ('document', 'paper', 'image')
|
||||
_dispatched = {f for t, fl in incremental.get('new_files', {}).items() if t in _sem_types for f in fl}
|
||||
_stamped = {f for fl in _manifest_files.values() for f in fl}
|
||||
_cleared = _dispatched - _stamped
|
||||
# scan_corpus = the RAW full corpus so in-root files newly excluded since last run
|
||||
# are dropped rather than masquerading as deletions; untouched rows preserved (#1908).
|
||||
_scan = {f for fl in incremental['files'].values() for f in fl}
|
||||
save_manifest(_manifest_files, root='INPUT_PATH', scan_corpus=_scan, clear_semantic=_cleared or None)
|
||||
print('[graphify update] Manifest saved.')
|
||||
"
|
||||
```
|
||||
|
||||
Then run Steps 4–8 on the merged graph as normal.
|
||||
|
||||
After Step 4, show the graph diff:
|
||||
|
||||
```bash
|
||||
$(cat graphify-out/.graphify_python) -c "
|
||||
import json
|
||||
from graphify.analyze import graph_diff
|
||||
from graphify.build import build_from_json
|
||||
from graphify.paths import load_node_link_graph
|
||||
import networkx as nx
|
||||
from pathlib import Path
|
||||
|
||||
# Load old graph (before update) from backup written before merge
|
||||
old_data = json.loads(Path('graphify-out/.graphify_old.json').read_text(encoding=\"utf-8\")) if Path('graphify-out/.graphify_old.json').exists() else None
|
||||
new_extract = json.loads(Path('graphify-out/.graphify_extract.json').read_text(encoding=\"utf-8\"))
|
||||
G_new = build_from_json(new_extract, directed=IS_DIRECTED)
|
||||
|
||||
if old_data:
|
||||
G_old = load_node_link_graph(old_data)
|
||||
diff = graph_diff(G_old, G_new)
|
||||
print(diff['summary'])
|
||||
if diff['new_nodes']:
|
||||
print('New nodes:', ', '.join(n['label'] for n in diff['new_nodes'][:5]))
|
||||
if diff['new_edges']:
|
||||
print('New edges:', len(diff['new_edges']))
|
||||
"
|
||||
```
|
||||
|
||||
Before the merge step, save the old graph: `cp graphify-out/graph.json graphify-out/.graphify_old.json`
|
||||
Clean up after: `rm -f graphify-out/.graphify_old.json`
|
||||
|
||||
---
|
||||
|
||||
## For --cluster-only
|
||||
|
||||
Skip Steps 1–3. Re-run clustering on the existing graph:
|
||||
|
||||
```bash
|
||||
graphify cluster-only .
|
||||
```
|
||||
|
||||
`graphify cluster-only .` is **self-contained**: it re-clusters, names communities, and regenerates `GRAPH_REPORT.md`, `graph.json`, and `graph.html` from the existing graph. **Do not re-run Steps 5–9** — they read intermediate files (`.graphify_extract.json`, `.graphify_detect.json`, `.graphify_analysis.json`) that a prior build's cleanup (Step 9) already deleted, so they raise `FileNotFoundError` (#1392). When it finishes, present the refreshed `GRAPH_REPORT.md` summary as usual.
|
||||
@@ -0,0 +1,116 @@
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434706543}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434706552}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434707852}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434707860}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434708466}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434708474}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/create-form-fragment","targetId":""},"timestamp":1768434709765}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/create-form-fragment","targetId":""},"timestamp":1768434709787}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs","targetId":"tabs-list"},"timestamp":1768434717888}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":201,"responseURL":"http://localhost:5000/tabs","targetId":"tabs-list"},"timestamp":1768434717903}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434717904}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434717913}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434738084}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434738093}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434739031}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434739040}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434746453}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434746496}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/create-form-fragment","targetId":""},"timestamp":1768434748859}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/create-form-fragment","targetId":""},"timestamp":1768434748866}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs","targetId":"tabs-list"},"timestamp":1768434773921}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":201,"responseURL":"http://localhost:5000/tabs","targetId":"tabs-list"},"timestamp":1768434773931}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434773931}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434773940}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/create-form-fragment","targetId":""},"timestamp":1768434810105}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/create-form-fragment","targetId":""},"timestamp":1768434810119}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs","targetId":"tabs-list"},"timestamp":1768434816383}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":201,"responseURL":"http://localhost:5000/tabs","targetId":"tabs-list"},"timestamp":1768434816399}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434816400}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434816414}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434944656}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434944756}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434945369}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434945427}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434946108}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434946162}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434946680}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434946736}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/create-form-fragment","targetId":""},"timestamp":1768434947640}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/create-form-fragment","targetId":""},"timestamp":1768434947656}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs","targetId":"tabs-list"},"timestamp":1768434953064}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":201,"responseURL":"http://localhost:5000/tabs","targetId":"tabs-list"},"timestamp":1768434953079}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434953080}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768434953093}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435103720}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435103776}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435104593}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435104647}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435105158}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435105253}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435275247}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435275315}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435276178}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435276278}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435276945}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435276998}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/create-form-fragment","targetId":""},"timestamp":1768435278150}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/create-form-fragment","targetId":""},"timestamp":1768435278162}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs","targetId":"tabs-list"},"timestamp":1768435281966}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":400,"responseURL":"http://localhost:5000/tabs","targetId":"tabs-list"},"timestamp":1768435281988}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435387623}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435387680}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435388399}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435388454}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/create-form-fragment","targetId":""},"timestamp":1768435389910}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/create-form-fragment","targetId":""},"timestamp":1768435389922}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs","targetId":"tabs-list"},"timestamp":1768435393213}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs","targetId":"tabs-list"},"timestamp":1768435393231}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435393233}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435393245}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/12/content-fragment","targetId":"tab-content"},"timestamp":1768435395729}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/12/content-fragment","targetId":"tab-content"},"timestamp":1768435395748}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/13/content-fragment","targetId":"tab-content"},"timestamp":1768435396771}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/13/content-fragment","targetId":"tab-content"},"timestamp":1768435396788}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/12/content-fragment","targetId":"tab-content"},"timestamp":1768435398656}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/12/content-fragment","targetId":"tab-content"},"timestamp":1768435398674}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/13/content-fragment","targetId":"tab-content"},"timestamp":1768435399748}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/13/content-fragment","targetId":"tab-content"},"timestamp":1768435399774}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435668310}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:DOMContentLoaded","message":"palette elements presence","data":{"hasPaletteButton":true,"hasPaletteModal":false,"hasPaletteContainer":false,"hasLightingController":false},"timestamp":1768435668311}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435668355}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435669841}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:DOMContentLoaded","message":"palette elements presence","data":{"hasPaletteButton":true,"hasPaletteModal":false,"hasPaletteContainer":false,"hasLightingController":false},"timestamp":1768435669842}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435669852}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:color-palette-btn","message":"color palette button clicked","data":{"hasPaletteModal":false,"modalActive":null},"timestamp":1768435672686}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:color-palette-btn","message":"color palette button clicked","data":{"hasPaletteModal":false,"modalActive":null},"timestamp":1768435673713}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:color-palette-btn","message":"color palette button clicked","data":{"hasPaletteModal":false,"modalActive":null},"timestamp":1768435674316}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:color-palette-btn","message":"color palette button clicked","data":{"hasPaletteModal":false,"modalActive":null},"timestamp":1768435674560}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:color-palette-btn","message":"color palette button clicked","data":{"hasPaletteModal":false,"modalActive":null},"timestamp":1768435680419}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:color-palette-btn","message":"color palette button clicked","data":{"hasPaletteModal":false,"modalActive":null},"timestamp":1768435680897}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435814285}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:DOMContentLoaded","message":"palette elements presence","data":{"hasPaletteButton":true,"hasPaletteModal":true,"hasPaletteContainer":false,"hasLightingController":false},"timestamp":1768435814287}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H3","location":"src/static/color_palette.js:DOMContentLoaded","message":"palette script loaded","data":{"hasButton":true,"hasModal":true,"hasClose":true},"timestamp":1768435814287}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435814350}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435815080}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H3","location":"src/static/color_palette.js:DOMContentLoaded","message":"palette script loaded","data":{"hasButton":true,"hasModal":true,"hasClose":true},"timestamp":1768435815081}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:DOMContentLoaded","message":"palette elements presence","data":{"hasPaletteButton":true,"hasPaletteModal":true,"hasPaletteContainer":false,"hasLightingController":false},"timestamp":1768435815082}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435815135}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435815724}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H3","location":"src/static/color_palette.js:DOMContentLoaded","message":"palette script loaded","data":{"hasButton":true,"hasModal":true,"hasClose":true},"timestamp":1768435815725}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:DOMContentLoaded","message":"palette elements presence","data":{"hasPaletteButton":true,"hasPaletteModal":true,"hasPaletteContainer":false,"hasLightingController":false},"timestamp":1768435815725}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435815778}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H4","location":"src/static/color_palette.js:openModal","message":"palette modal opened","data":{"active":true},"timestamp":1768435817104}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:color-palette-btn","message":"color palette button clicked","data":{"hasPaletteModal":true,"modalActive":true},"timestamp":1768435817105}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H4","location":"src/static/color_palette.js:closeModal","message":"palette modal closed","data":{"active":false},"timestamp":1768435820180}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435931118}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:DOMContentLoaded","message":"palette elements presence","data":{"hasPaletteButton":true,"hasPaletteModal":true,"hasPaletteContainer":true,"hasLightingController":false},"timestamp":1768435931120}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H3","location":"src/static/color_palette.js:DOMContentLoaded","message":"palette script loaded","data":{"hasButton":true,"hasModal":true,"hasClose":true,"hasContainer":true,"hasAddButton":true},"timestamp":1768435931119}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435931173}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:htmx:beforeRequest","message":"htmx request","data":{"path":"/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435931791}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H1","location":"src/templates/index.html:DOMContentLoaded","message":"palette elements presence","data":{"hasPaletteButton":true,"hasPaletteModal":true,"hasPaletteContainer":true,"hasLightingController":false},"timestamp":1768435931793}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H3","location":"src/static/color_palette.js:DOMContentLoaded","message":"palette script loaded","data":{"hasButton":true,"hasModal":true,"hasClose":true,"hasContainer":true,"hasAddButton":true},"timestamp":1768435931793}
|
||||
{"sessionId":"debug-session","runId":"tabs-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:htmx:afterRequest","message":"htmx response","data":{"status":200,"responseURL":"http://localhost:5000/tabs/list-fragment","targetId":"tabs-list"},"timestamp":1768435931895}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H2","location":"src/templates/index.html:color-palette-btn","message":"color palette button clicked","data":{"hasPaletteModal":true,"modalActive":true},"timestamp":1768435933111}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H4","location":"src/static/color_palette.js:openModal","message":"palette modal opened","data":{"active":true},"timestamp":1768435933110}
|
||||
{"sessionId":"debug-session","runId":"palette-pre-fix","hypothesisId":"H4","location":"src/static/color_palette.js:closeModal","message":"palette modal closed","data":{"active":false},"timestamp":1768435943332}
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
description: Git commit messages and how to split work into commits
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# Commits
|
||||
|
||||
When preparing commits (especially when the user asks to commit):
|
||||
|
||||
1. **Prefer multiple commits** over one large commit when changes span distinct concerns (e.g. UI vs docs vs API). One logical unit per commit.
|
||||
2. **Message format:** `type(scope): short imperative subject` (lowercase subject after the colon; no trailing period).
|
||||
- **Types:** `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`, `perf` (use what fits).
|
||||
- **Scope:** optional but encouraged — e.g. `ui`, `api`, `profiles`, `presets`, `esp32`.
|
||||
3. **Subject line:** ~50 characters or less; describe *what* changed, not the ticket number alone.
|
||||
4. **Body:** only when needed (breaking change, non-obvious rationale, or multiple bullets). Otherwise subject is enough.
|
||||
|
||||
**Examples**
|
||||
|
||||
- `feat(ui): gate profile delete to edit mode`
|
||||
- `docs: document run vs edit in API`
|
||||
- `fix(api): resolve preset delete route argument clash`
|
||||
|
||||
**Do not**
|
||||
|
||||
- Squash unrelated fixes and doc tweaks into one commit unless the user explicitly wants a single commit.
|
||||
- Use vague messages like `update`, `fixes`, or `wip`.
|
||||
@@ -0,0 +1,45 @@
|
||||
---
|
||||
description: led-driver — MicroPython ESP32: mpremote, imports, layout, I/O, no pycache in src
|
||||
globs: led-driver/**
|
||||
alwaysApply: false
|
||||
---
|
||||
|
||||
# led-driver (MicroPython / ESP32)
|
||||
|
||||
## Device and tests
|
||||
|
||||
1. Validate **MicroPython behaviour** under **`led-driver/`** with **`mpremote connect <PORT> …`** on the chip. Host **`python3`** does **not** prove the firmware build.
|
||||
|
||||
2. **Execution target is fixed:** treat **`led-driver/`** code as firmware that runs **only on MicroPython ESP32 devices**. Do **not** run `led-driver/src/main.py` (or other firmware modules) with host CPython as a normal execution path.
|
||||
|
||||
3. **Flow:** `mpremote connect <PORT> cp <local> :<on-flash>` then `run <script>.py`. Inline commands only — no **`.sh`** wrappers unless the user asks. Default serial placeholder: **`/dev/ttyACM0`**.
|
||||
|
||||
4. Checks that **import and run** code from **`led-driver/src/`** belong in **`led-driver/tests/`** and run with **`mpremote run …`**. **Do not** add **`pytest`** under **`led-controller/tests/`** that **`sys.path`**-loads **`led-driver/src`** and runs those modules on CPython.
|
||||
|
||||
## Import layout
|
||||
|
||||
4. **No** **`sys.path.insert`**, **`__file__`** path stitching, or other import-path hacks under **`led-driver/`**. Use device flash search path, or host **`PYTHONPATH`** / layout you control.
|
||||
|
||||
5. **No** “import fixer” code — fix copy order, flash paths, or env instead.
|
||||
|
||||
## Imports (fail loudly)
|
||||
|
||||
6. If a dependency does not load, **crash** and fix deployment or filesystem. **Do not** catch **`ImportError`** / **`ModuleNotFoundError`** around **`import`** / **`from … import`** for app/firmware modules (`settings`, `utils`, `network`, `machine`, …).
|
||||
|
||||
7. **Allowed — stdlib name pairs only** (MicroPython vs CPython): one **`except ImportError`**, then **one** fallback import, **no** extra logic in **`except`**:
|
||||
- `uos` → `os`
|
||||
- `ubinascii` → `binascii`
|
||||
- `utime` → `time`
|
||||
Not for “maybe the file exists on flash” — only different **stdlib** names.
|
||||
|
||||
8. **No** large inline reimplementations after **`except ImportError`** — deploy the real module.
|
||||
|
||||
## I/O
|
||||
|
||||
9. Non-blocking **recv** / **accept**: use plain **`except OSError:`** (or **break** on empty). **No** errno / EAGAIN / EWOULDBLOCK tables or **`getattr(errno, …)`** unless fixing a **documented** target bug.
|
||||
|
||||
10. Minimal **`try` / `except OSError`** around optional socket options (e.g. **`SO_REUSEADDR`**) is fine.
|
||||
|
||||
## Host Python and `src/`
|
||||
|
||||
11. **Do not** leave **`__pycache__/`** or **`.pyc`** under **`led-driver/src/`** from host runs. Remove if created; **`.gitignore`** already ignores it. Prefer **`PYTHONDONTWRITEBYTECODE=1`** or **`-B`** when host Python must touch **`led-driver/src/`**.
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
description: Require test pattern, pattern metadata, and test preset for new patterns
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# Pattern workflow requirements
|
||||
|
||||
1. When creating a new pattern under `led-driver/src/patterns/`, also add/update a corresponding test file in `led-driver/tests/patterns/`.
|
||||
|
||||
2. When adding a new pattern, ensure led-controller has `db/pattern.json`; if it does not exist, create it. Add the new pattern metadata and parameter mappings there.
|
||||
|
||||
3. When adding a new pattern, add at least one test preset entry in `db/preset.json` in led-controller that uses the new pattern.
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
description: Fix only the issue or task the user gave; no refactors unless requested
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# Scoped fixes (no overscoping)
|
||||
|
||||
1. **Change only what is needed** to satisfy the user’s *current* request (bug, error, feature, or explicit follow-up). Prefer the smallest diff that fixes it.
|
||||
|
||||
2. **Refactors:** Do **not** refactor (restructure, rename, extract functions, change abstractions, or “make it nicer”) **unless the user explicitly asked for a refactor**. A bug fix may touch nearby lines only as much as required to correct the bug.
|
||||
|
||||
3. **Do not** rename, reformat, or “clean up” unrelated code; do not add extra error handling, logging, or features you were not asked for.
|
||||
|
||||
4. **Related issues:** If you spot other problems (missing functions, wrong types elsewhere, style), you may **mention them in prose** — do **not** fix them unless the user explicitly asks.
|
||||
|
||||
5. **Tests and docs:** Add or change tests or documentation **only** when the user asked for them or they are strictly required to verify the requested fix.
|
||||
|
||||
6. **Multiple distinct fixes:** If the user reported one error (e.g. a single `TypeError`), fix **that** cause first. Offer to tackle follow-ups separately rather than bundling.
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
description: British spelling for user-facing text; technical identifiers stay as-is
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# Spelling: colour
|
||||
|
||||
- **User-facing strings** (Help modal, button labels, README prose, `docs/`, error messages shown in the UI): use **British English** — **colour**, **favour**, **behaviour**, etc., unless quoting existing product names.
|
||||
- **Do not rename** existing code for spelling: **identifiers**, file names, URL paths, JSON keys, CSS properties (`color`), HTML attributes (`type="color"`), and API field names stay as they are (`color`, `colors`, `palette`, etc.) so nothing breaks.
|
||||
- **New** UI copy and docs should follow **colour** in prose; new code symbols may still use `color` when matching surrounding APIs or conventions.
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
description: enforce strict user-scoped changes only
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# Strict User Scope
|
||||
|
||||
1. Only implement exactly what the user asked for in the current message.
|
||||
|
||||
2. Do not add extra refactors, cleanups, renames, architecture changes, or behavioural changes unless the user explicitly asked for them.
|
||||
|
||||
3. If a potential improvement is noticed, mention it briefly and ask before changing code.
|
||||
|
||||
4. For revert/undo requests, perform the narrowest possible revert and do not modify anything else.
|
||||
|
||||
5. Keep edits minimal and local to the requested area.
|
||||
@@ -0,0 +1,40 @@
|
||||
# Python
|
||||
__pycache__/
|
||||
# led-driver/src is MicroPython source — never keep host __pycache__ there (see .cursor/rules/led-driver.mdc)
|
||||
led-driver/src/__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.so
|
||||
.Python
|
||||
|
||||
# Virtual environments
|
||||
venv/
|
||||
env/
|
||||
ENV/
|
||||
.venv
|
||||
|
||||
# IDE
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Project specific
|
||||
scripts/.led-controller-venv
|
||||
docs/.help-print.html
|
||||
settings.json
|
||||
*.log
|
||||
*.db
|
||||
*.sqlite
|
||||
.pytest_cache/
|
||||
.ropeproject/
|
||||
build/
|
||||
sdkconfig
|
||||
sdkconfig.old
|
||||
managed_components/
|
||||
www_dist/
|
||||
@@ -0,0 +1,9 @@
|
||||
[submodule "led-driver"]
|
||||
path = led-driver
|
||||
url = git@git.technical.kiwi:technicalkiwi/led-driver.git
|
||||
[submodule "led-tool"]
|
||||
path = led-tool
|
||||
url = git@git.technical.kiwi:technicalkiwi/led-tool.git
|
||||
[submodule "led-simulator"]
|
||||
path = led-simulator
|
||||
url = git@git.technical.kiwi:technicalkiwi/led-simulator.git
|
||||
@@ -0,0 +1,10 @@
|
||||
## graphify
|
||||
|
||||
This project has a knowledge graph at graphify-out/ with god nodes, community structure, and cross-file relationships.
|
||||
|
||||
Rules:
|
||||
- When graphify-out/graph.json exists, run `graphify query "<question>"` before your first grep, search or source-file read for a codebase question, and put this rule in every subagent prompt that explores code. Read raw files only for lines the graph or an earlier read already located. Use `graphify path "<A>" "<B>"` for relationships and `graphify explain "<concept>"` for focused concepts. These return a scoped subgraph, usually much smaller than GRAPH_REPORT.md or raw grep output.
|
||||
- If graphify-out/wiki/index.md exists, use it for broad navigation instead of raw source browsing.
|
||||
- Read graphify-out/GRAPH_REPORT.md only for broad architecture review or when query/path/explain do not surface enough context.
|
||||
- After modifying code, run `graphify update .` to keep the graph current (AST-only, no API cost).
|
||||
- A committed graphify-out/graph.json is rewritten whole on every build, so a large diff to it in a pull request is expected. Do not flag it as churn or suggest skipping the graph rebuild or its hooks.
|
||||
@@ -0,0 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(led_controller)
|
||||
@@ -0,0 +1,142 @@
|
||||
# Build, flash and monitor the ESP32-S3 controller (ESP-IDF in Docker).
|
||||
#
|
||||
# make build, flash, then monitor (same as: make all)
|
||||
# make help list the targets
|
||||
# make build minify the web UI, then build the firmware
|
||||
# make flash flash the last build to the S3 (does not build)
|
||||
# make monitor serial console (Ctrl-] to quit)
|
||||
# make flash-monitor
|
||||
#
|
||||
# Override on the command line, e.g. make flash PORT=/dev/ttyACM1
|
||||
|
||||
PORT ?= /dev/ttyACM0
|
||||
IDF_IMAGE ?= espressif/idf:v6.1
|
||||
SECS ?= 10
|
||||
|
||||
DOCKER_RUN = docker run --rm -v "$(CURDIR)":/project -w /project
|
||||
DEVICE = --device=$(PORT)
|
||||
# Interactive terminal only when there is one (monitor needs it, CI does not have it)
|
||||
TTY := $(shell [ -t 0 ] && echo -it)
|
||||
|
||||
# Rootless Docker maps container root to you, so files must end up owned by uid 0 inside; with a
|
||||
# normal daemon they must be owned by you.
|
||||
OWNER := $(shell docker info --format '{{.SecurityOptions}}' 2>/dev/null | grep -q rootless && echo 0:0 || echo $$(id -u):$$(id -g))
|
||||
FIX_OWNER = chown -R $(OWNER) /project
|
||||
|
||||
.PHONY: all help web build flash ota monitor flash-monitor log size menuconfig clean fullclean erase test test-driver test-envelope test-api test-browser sim-build sim sim-web test-sim
|
||||
|
||||
# Default target: build, flash, then open the console (run in order, so not with make -j)
|
||||
all: build flash monitor
|
||||
|
||||
help:
|
||||
@echo "LED controller (ESP32-S3):"
|
||||
@echo " make [all] build, flash, then open the console"
|
||||
@echo " make build minify + gzip the web UI, then build the firmware"
|
||||
@echo " make flash flash the last build (firmware and web UI) to PORT ($(PORT)); does not build"
|
||||
@echo " make ota [HOST=ip] build, then upload the firmware (web UI included) over Ethernet (no USB);"
|
||||
@echo " HOST defaults to led-controller.local"
|
||||
@echo " make monitor serial console on PORT (Ctrl-] to quit)"
|
||||
@echo " make flash-monitor flash the last build, then open the console"
|
||||
@echo " make log [SECS=10] print the console for SECS seconds and exit (no terminal needed)"
|
||||
@echo " make web only rebuild the web UI (needs node/npx)"
|
||||
@echo " make size memory use of the last build"
|
||||
@echo " make menuconfig change the ESP-NOW channel, marker pin, W5500 pins, ..."
|
||||
@echo " make erase erase the whole flash (loses the stored data)"
|
||||
@echo " make clean remove the build directory (keeps sdkconfig)"
|
||||
@echo " make fullclean also remove sdkconfig and the web UI output"
|
||||
@echo " make test driver unit tests + C/Python envelope cross-check"
|
||||
@echo " make test-api HOST=ip HTTP API tests against a running controller (data restored afterwards)"
|
||||
@echo " make test-browser HOST=ip Selenium UI tests against a running controller (needs selenium + chromedriver)"
|
||||
@echo "Simulated rig (no hardware): the controller built for linux + led-simulator's 16 drivers over a UDP bridge"
|
||||
@echo " make sim-build build the controller for the host (sim-controller/build/led_controller_sim.elf)"
|
||||
@echo " make sim build, then run the headless rig and the controller (http://localhost:8080/)"
|
||||
@echo " make sim-web build, then run the browser rig (http://localhost:8765/) and the controller"
|
||||
@echo " make test-sim rig tests (groups, field patterns, sequences) + the API tests against make sim"
|
||||
@echo "variables: PORT=$(PORT) IDF_IMAGE=$(IDF_IMAGE)"
|
||||
|
||||
# --- web UI ---------------------------------------------------------------
|
||||
web:
|
||||
tools/build_web.sh
|
||||
|
||||
# --- firmware -------------------------------------------------------------
|
||||
# The build time in the image comes from esp_app_desc.c, which nothing else recompiles (a web-only
|
||||
# change just relinks), so drop its object and every build gets the current time.
|
||||
APP_DESC_OBJ = build/esp-idf/esp_app_format/CMakeFiles/__idf_esp_app_format.dir/esp_app_desc.c.obj
|
||||
|
||||
build: web
|
||||
$(DOCKER_RUN) $(IDF_IMAGE) bash -c 'rm -f $(APP_DESC_OBJ); idf.py build; rc=$$?; $(FIX_OWNER); exit $$rc'
|
||||
|
||||
flash:
|
||||
$(DOCKER_RUN) $(DEVICE) $(IDF_IMAGE) bash -c 'idf.py -p $(PORT) flash; rc=$$?; $(FIX_OWNER); exit $$rc'
|
||||
|
||||
ota: HOST ?= led-controller.local
|
||||
ota: build
|
||||
python3 tools/ota.py $(HOST)
|
||||
|
||||
monitor:
|
||||
$(DOCKER_RUN) $(TTY) $(DEVICE) $(IDF_IMAGE) idf.py -p $(PORT) monitor
|
||||
|
||||
flash-monitor: flash monitor
|
||||
|
||||
# Non-interactive: reset the board and print what it says for SECS seconds
|
||||
log:
|
||||
python3 tools/serial_log.py $(PORT) $(SECS)
|
||||
|
||||
size:
|
||||
$(DOCKER_RUN) $(IDF_IMAGE) bash -c 'idf.py size; rc=$$?; $(FIX_OWNER); exit $$rc'
|
||||
|
||||
menuconfig:
|
||||
$(DOCKER_RUN) -it $(IDF_IMAGE) bash -c 'idf.py menuconfig; rc=$$?; $(FIX_OWNER); exit $$rc'
|
||||
|
||||
erase:
|
||||
$(DOCKER_RUN) $(DEVICE) $(IDF_IMAGE) idf.py -p $(PORT) erase-flash
|
||||
|
||||
clean:
|
||||
rm -rf build
|
||||
|
||||
fullclean: clean
|
||||
rm -rf sdkconfig sdkconfig.old www_dist
|
||||
|
||||
# --- tests ----------------------------------------------------------------
|
||||
test: test-driver test-envelope
|
||||
|
||||
# Host-side unit tests for the driver's link layer and beat sync (pure Python)
|
||||
test-driver:
|
||||
python3 tools/run_driver_tests.py
|
||||
|
||||
# HTTP API tests (ported from v1) against a running controller; v1 features v2 lacks are xfail
|
||||
test-api:
|
||||
@test -n "$(HOST)" || { echo "usage: make test-api HOST=<controller ip>"; exit 1; }
|
||||
python3 -m pytest test/api -q --host $(HOST)
|
||||
|
||||
# Selenium UI tests (ported from v1); they change the controller's data and do not restore it
|
||||
test-browser:
|
||||
@test -n "$(HOST)" || { echo "usage: make test-browser HOST=<controller ip>"; exit 1; }
|
||||
LED_CONTROLLER_RUN_BROWSER_TESTS=1 LED_HOST=$(HOST) python3 -m pytest test/browser -q
|
||||
|
||||
# The C envelope packer must produce the same bytes as test/binary_envelope.py
|
||||
test-envelope:
|
||||
@tmp=$$(mktemp -d); \
|
||||
(cd test && python3 env_check.py) > $$tmp/py.txt; \
|
||||
docker run --rm -v "$(CURDIR)":/project -w /project/test $(IDF_IMAGE) bash -c \
|
||||
'gcc -Wall -I/opt/esp/idf/components/json/cJSON env_host.c ../main/envelope.c /opt/esp/idf/components/json/cJSON/cJSON.c -o /tmp/t -lm && /tmp/t' 2>&1 | tail -4 | head -3 > $$tmp/c.txt; \
|
||||
if diff -q $$tmp/py.txt $$tmp/c.txt >/dev/null; then echo "envelope: C and Python agree"; rm -rf $$tmp; \
|
||||
else echo "envelope: MISMATCH"; diff $$tmp/py.txt $$tmp/c.txt; rm -rf $$tmp; exit 1; fi
|
||||
|
||||
# --- simulated rig --------------------------------------------------------
|
||||
# The firmware built for ESP-IDF's linux target runs on this computer; its ESP-NOW frames go over UDP to
|
||||
# led-simulator (bridge_sim.py headless, or server.py in the browser), whose drivers run led-driver/src.
|
||||
SIM_DB ?= $(CURDIR)/sim-controller/data
|
||||
SIM_RUN = mkdir -p $(SIM_DB) && LED_SIM_DB=$(SIM_DB) LED_SIM_BRIDGE=127.0.0.1:8766 sim-controller/build/led_controller_sim.elf
|
||||
|
||||
sim-build: web
|
||||
$(DOCKER_RUN) $(IDF_IMAGE) bash -c 'cd sim-controller && idf.py build; rc=$$?; $(FIX_OWNER); exit $$rc'
|
||||
|
||||
sim: sim-build
|
||||
@trap 'kill 0' INT TERM EXIT; python3 led-simulator/bridge_sim.py & $(SIM_RUN)
|
||||
|
||||
sim-web: sim-build
|
||||
@trap 'kill 0' INT TERM EXIT; python3 led-simulator/server.py & $(SIM_RUN)
|
||||
|
||||
test-sim:
|
||||
python3 -m pytest test/api -q --host localhost:8080
|
||||
@@ -1,14 +0,0 @@
|
||||
[[source]]
|
||||
url = "https://pypi.org/simple"
|
||||
verify_ssl = true
|
||||
name = "pypi"
|
||||
|
||||
[packages]
|
||||
mpremote = "*"
|
||||
pyserial = "*"
|
||||
esptool = "*"
|
||||
|
||||
[dev-packages]
|
||||
|
||||
[requires]
|
||||
python_version = "3.12"
|
||||
@@ -1,2 +1,50 @@
|
||||
# led-controller
|
||||
|
||||
ESP32-S3 controller for LED drivers: W5500 Ethernet, web UI, I2S microphone beat detection and an ESP-NOW link to the drivers. The firmware is C (ESP-IDF) at the repository root; see [`docs/BENCH_TEST.md`](docs/BENCH_TEST.md) for the bench tests.
|
||||
|
||||
It keeps profiles, zones, presets, device groups, sequences, palettes, patterns and outputs in its flash, and serves the web UI and JSON API ([`docs/API.md`](docs/API.md)). Zones play to device groups. Sequences advance on the beats the microphone detects, or on a BPM clock while audio is stopped. Profiles, presets and sequences import and export as JSON bundles.
|
||||
|
||||
## Build and flash
|
||||
|
||||
```bash
|
||||
make build # minify the web UI from web/, then build the firmware (ESP-IDF in Docker)
|
||||
make flash # flash over USB
|
||||
make ota [HOST=<ip>] # update firmware (web UI included) over Ethernet, no USB (POST /ota); HOST defaults to led-controller.local
|
||||
make monitor # serial console
|
||||
make test # driver unit tests and the C/Python envelope cross-check
|
||||
make test-api HOST=<ip> # HTTP API tests against a running controller (its data is restored afterwards)
|
||||
make test-browser HOST=<ip> # Selenium UI tests (needs selenium and chromedriver)
|
||||
```
|
||||
|
||||
`make` lists every target. The web UI sources are in `web/` (`static/`, `templates/`, `audio.html`); `tools/build_web.sh` also packs the led-driver pattern files into the firmware, so the controller can send them to drivers.
|
||||
|
||||
## Other directories
|
||||
|
||||
- `led-driver/` (submodule): MicroPython firmware for the ESP32 LED drivers.
|
||||
- `led-tool/` (submodule): `led-cli`, configures drivers over serial and updates the controller over Ethernet (`led-cli --ota HOST`).
|
||||
- `led-simulator/` (submodule), `espnow-sender/`: test helpers.
|
||||
- `db/`: the records a controller starts with (the `default` profile and group the firmware seeds at first boot, plus pattern metadata), importable with `PUT /db/<name>`.
|
||||
- `test/api/`: the API tests (`test/api/README.md`); `test/browser/`: the UI tests.
|
||||
|
||||
## Docs
|
||||
|
||||
- API reference: `docs/API.md`
|
||||
- User guide: `docs/help.md` (`scripts/build_help_pdf.sh` regenerates `docs/help.pdf`)
|
||||
- Specification: `docs/SPECIFICATION.md`
|
||||
|
||||
## Network
|
||||
|
||||
The controller advertises `<hostname>.local` over mDNS (default `led-controller`, plus an `_http._tcp` service). Both settings below come from `/settings` and apply on reboot.
|
||||
|
||||
`static_ips` is a list of networks to try, in order, each time the Ethernet link comes up. The first entry whose gateway answers ARP is used; if none does (or the list is empty) the controller uses DHCP. `netmask` defaults to `255.255.255.0`, `dns` to the gateway.
|
||||
|
||||
If DHCP gets no answer within 15 seconds, the controller takes `192.168.4.1/24`. For a cable straight from a PC, give the PC a static IP on that subnet, such as `192.168.4.2/24`, and open `http://192.168.4.1/`. The controller tries DHCP again only when the link next comes up.
|
||||
|
||||
```bash
|
||||
curl -X PUT http://led-controller.local/settings/settings -H 'Content-Type: application/json' -d '{
|
||||
"hostname": "stage",
|
||||
"static_ips": [
|
||||
{"ip": "192.168.1.50", "netmask": "255.255.255.0", "gw": "192.168.1.1"},
|
||||
{"ip": "10.0.0.50", "netmask": "255.255.255.0", "gw": "10.0.0.1"}
|
||||
]}'
|
||||
```
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"enabled": true,
|
||||
"device": "simulated",
|
||||
"device_override": "",
|
||||
"device_select": "simulated"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
[
|
||||
{
|
||||
"id": "c9ab898d-740",
|
||||
"label": "bridge1",
|
||||
"transport": "ip",
|
||||
"ip": "192.168.4.1",
|
||||
"ws_port": 80
|
||||
},
|
||||
{
|
||||
"id": "18d85e86-17b",
|
||||
"label": "bridge2",
|
||||
"transport": "serial",
|
||||
"serial_port": "/dev/ttyUSB0",
|
||||
"serial_baudrate": 115200
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{"1": {"name": "default", "devices": [], "wifi_driver_display_name": null, "wifi_driver_num_leds": null, "wifi_color_order": null, "wifi_startup_mode": null, "output_brightness": 255, "bridge_id": null, "pattern": "on", "colors": ["000000", "FF0000"], "brightness": 100, "delay": 100, "step_offset": 0, "step_increment": 1, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "id": "1"}}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{"1": ["#FF0000", "#00FF00", "#0000FF", "#FFFF00", "#FF00FF", "#00FFFF", "#FFFFFF", "#000000"]}
|
||||
@@ -0,0 +1 @@
|
||||
{"on": {"min_delay": 10, "max_delay": 10000, "max_colors": 1}, "off": {"min_delay": 10, "max_delay": 10000, "max_colors": 0}, "rainbow": {"n1": "Step Rate", "min_delay": 10, "max_delay": 10000, "max_colors": 0}, "colour_cycle": {"n1": "Step Rate", "min_delay": 10, "max_delay": 10000, "max_colors": 10}, "transition": {"min_delay": 10, "max_delay": 10000, "max_colors": 10}, "chase": {"n1": "Colour 1 Length", "n2": "Colour 2 Length", "n3": "Step 1", "n4": "Step 2", "min_delay": 10, "max_delay": 10000, "max_colors": 2}, "pulse": {"n1": "Attack", "n2": "Hold", "n3": "Decay", "min_delay": 10, "max_delay": 10000, "max_colors": 10}, "circle": {"n1": "Head Rate", "n2": "Max Length", "n3": "Tail Rate", "n4": "Min Length", "min_delay": 10, "max_delay": 10000, "max_colors": 2}, "blink": {"min_delay": 10, "max_delay": 10000, "max_colors": 10}, "flicker": {"n1": "Min brightness", "min_delay": 10, "max_delay": 10000, "max_colors": 10}, "flame": {"n1": "Min brightness", "n2": "Breath period (ms)", "n3": "Spark gap min (ms, 0=default 10\u201330 s, -1=off)", "n4": "Spark gap max (ms)", "min_delay": 10, "max_delay": 10000, "max_colors": 10}, "twinkle": {"n1": "Twinkle activity (1\u2013255, higher = more changes)", "n2": "Density (0\u2013255, higher = more of the strip lit)", "n3": "Min adjacent LEDs per twinkle (same as max for fixed length)", "n4": "Max adjacent LEDs per twinkle (same as min for fixed length)", "min_delay": 84, "max_delay": 10000, "max_colors": 10}, "radiate": {"n1": "Node spacing (LEDs)", "n2": "Out time (ms)", "n3": "In time (ms)", "min_delay": 10, "max_delay": 10000, "max_colors": 2}, "meteor_rain": {"n1": "Tail length", "n2": "Speed (LEDs per frame)", "n3": "Fade amount (1-255)", "min_delay": 10, "max_delay": 10000, "max_colors": 10}, "scanner": {"n1": "Eye width", "n2": "End pause (frames)", "min_delay": 10, "max_delay": 10000, "max_colors": 10}, "gradient_scroll": {"n1": "Scroll step rate", "min_delay": 10, "max_delay": 10000, "max_colors": 10}, "comet_dual": {"n1": "Tail length", "n2": "Speed", "n3": "Gap", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "sparkle_trail": {"n1": "Spark density", "n2": "Decay", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "wave": {"n1": "Wavelength", "n2": "Amplitude", "n3": "Drift speed", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "plasma": {"n1": "Scale", "n2": "Speed", "n3": "Contrast", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "segment_chase": {"n1": "Segment size", "n2": "Phase step", "n3": "Segment phase offset", "n4": "Gap per segment", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "bar_graph": {"n1": "Level percent", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "breathing_dual": {"n1": "Phase offset", "n2": "Ease", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "strobe_burst": {"n1": "Burst count", "n2": "Burst gap", "n3": "Cooldown", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "rain_drops": {"n1": "Drop rate", "n2": "Ripple width", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "fireflies": {"n1": "Count", "n2": "Twinkle speed", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "clock_sweep": {"n1": "Hand width", "n2": "Marker interval", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "marquee": {"n1": "On length", "n2": "Off length", "n3": "Step", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "aurora": {"n1": "Band count", "n2": "Shimmer", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "snowfall": {"n1": "Flake density", "n2": "Fall speed", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "heartbeat": {"n1": "Pulse 1 ms", "n2": "Pulse 2 ms", "n3": "Pause ms", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "orbit": {"n1": "Orbit count", "n2": "Base speed", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "palette_morph": {"n1": "Morph ms", "n2": "Warp rate", "n3": "Turbulence", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "gradient_wipe": {"n1": "Start LED", "n2": "End LED", "min_delay": 10, "max_delay": 10000, "max_colors": 2}}
|
||||
@@ -0,0 +1 @@
|
||||
{"1":{"name":"on","pattern":"on","colors":["#FFFFFF"],"brightness":255,"delay":100,"n1":0,"n2":0,"n3":0,"n4":0,"n5":0,"n6":0,"n7":0,"n8":0,"profile_id":"1","auto":true,"id":"1"},"2":{"name":"off","pattern":"off","colors":[],"brightness":0,"delay":100,"n1":0,"n2":0,"n3":0,"n4":0,"n5":0,"n6":0,"n7":0,"n8":0,"profile_id":"1","auto":true,"id":"2"},"3":{"name":"rainbow","pattern":"rainbow","colors":[],"brightness":255,"delay":100,"n1":2,"n2":0,"n3":0,"n4":0,"n5":0,"n6":0,"n7":0,"n8":0,"profile_id":"1","auto":true,"id":"3"},"4":{"name":"Colour Cycle","pattern":"colour_cycle","colors":["#FF0000","#00FF00","#0000FF"],"brightness":255,"delay":100,"n1":1,"n2":0,"n3":0,"n4":0,"n5":0,"n6":0,"n7":0,"n8":0,"profile_id":"1","auto":true,"id":"4"},"5":{"name":"transition","pattern":"transition","colors":["#FF0000","#00FF00","#0000FF"],"brightness":255,"delay":500,"n1":0,"n2":0,"n3":0,"n4":0,"n5":0,"n6":0,"n7":0,"n8":0,"profile_id":"1","auto":true,"id":"5"},"6":{"name":"flicker","pattern":"flicker","colors":["#FFB84D"],"brightness":255,"delay":80,"n1":30,"n2":0,"n3":0,"n4":0,"n5":0,"n6":0,"n7":0,"n8":0,"profile_id":"1","auto":true,"id":"6"},"7":{"name":"flame","pattern":"flame","colors":[],"brightness":255,"delay":50,"n1":35,"n2":2600,"n3":0,"n4":0,"n5":0,"n6":0,"n7":0,"n8":0,"profile_id":"1","auto":true,"id":"7"},"8":{"name":"twinkle","pattern":"twinkle","colors":["#78C8FF","#508CFF","#B478FF","#64DCE8","#A0C8FF"],"brightness":255,"delay":55,"n1":72,"n2":140,"n3":2,"n4":6,"n5":0,"n6":0,"n7":0,"n8":0,"profile_id":"1","auto":true,"id":"8"}}
|
||||
@@ -0,0 +1 @@
|
||||
{"1": {"name": "default", "type": "zones", "zones": ["1"], "scenes": [], "palette_id": "1", "id": "1"}}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{"1": {"name": "default", "names": ["1"], "presets": [["1", "2", "3", "4", "5", "6", "7", "8"]], "presets_flat": ["1", "2", "3", "4", "5", "6", "7", "8"], "default_preset": "1", "id": "1", "group_ids": ["1"], "preset_group_ids": {}, "sequence_ids": [], "content_kind": "presets"}}
|
||||
@@ -0,0 +1,31 @@
|
||||
dependencies:
|
||||
espressif/mdns:
|
||||
component_hash: ef0766474b37459f6ad22461e453a8713e780e831a7c993b16919d817988dff6
|
||||
dependencies:
|
||||
- name: idf
|
||||
require: private
|
||||
version: '>=5.0'
|
||||
source:
|
||||
registry_url: https://components.espressif.com/
|
||||
type: service
|
||||
version: 1.14.1
|
||||
idf:
|
||||
source:
|
||||
type: idf
|
||||
version: 5.5.5
|
||||
joltwallet/littlefs:
|
||||
component_hash: e1a0f4a6adf821759cb34703a91107bbdce5d7ff6f4728f40ab012bb87842974
|
||||
dependencies:
|
||||
- name: idf
|
||||
require: private
|
||||
version: '>=5.0'
|
||||
source:
|
||||
registry_url: https://components.espressif.com/
|
||||
type: service
|
||||
version: 1.23.1
|
||||
direct_dependencies:
|
||||
- espressif/mdns
|
||||
- joltwallet/littlefs
|
||||
manifest_hash: a5329d49f0154685d9701ccb399916a87107b77ddfe802c911aa2bb41ed5bab0
|
||||
target: esp32s3
|
||||
version: 2.0.0
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import subprocess
|
||||
import serial
|
||||
import sys
|
||||
|
||||
print(sys.argv)
|
||||
|
||||
port = sys.argv[1]
|
||||
|
||||
cmd = sys.argv[1]
|
||||
|
||||
for cmd in sys.argv[1:]:
|
||||
print(cmd)
|
||||
match cmd:
|
||||
case "src":
|
||||
subprocess.call(["mpremote", "connect", port, "fs", "cp", "-r", ".", ":" ], cwd="src")
|
||||
case "lib":
|
||||
subprocess.call(["mpremote", "connect", port, "fs", "cp", "-r", "lib", ":" ])
|
||||
case "ls":
|
||||
subprocess.call(["mpremote", "connect", port, "fs", "ls", ":" ])
|
||||
case "reset":
|
||||
with serial.Serial(port, baudrate=115200) as ser:
|
||||
ser.write(b'\x03\x03\x04')
|
||||
case "follow":
|
||||
with serial.Serial(port, baudrate=115200) as ser:
|
||||
while True:
|
||||
if ser.in_waiting > 0: # Check if there is data in the buffer
|
||||
data = ser.readline().decode('utf-8').strip() # Read and decode the data
|
||||
print(data)
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,358 @@
|
||||
# LED Controller API
|
||||
|
||||
The controller is an ESP32-S3 on Ethernet (W5500). It serves the web UI and a JSON API on port 80, detects beats from its I2S microphone and talks to the LED drivers over ESP-NOW. This document covers:
|
||||
|
||||
1. The HTTP and WebSocket API, by resource.
|
||||
2. How the controller turns API calls into driver messages, and the message format.
|
||||
|
||||
Request and response bodies are JSON (`Content-Type: application/json`) unless noted. Errors come back as `{"error": "..."}` with a 4xx or 5xx status.
|
||||
|
||||
## Data and scoping
|
||||
|
||||
- **Storage.** Each resource is a collection (`device`, `zone`, `preset`, `profile`, `palette`, `pattern`, `sequence`, `scene`, `group`, `output`, `settings`), stored as one JSON object of id → record on the flash filesystem. New records get the next numeric id (highest + 1), as a string. Devices are keyed by MAC (12 lowercase hex digits, no colons) and patterns by name.
|
||||
- **Current profile.** `settings.current_profile_id`, set by `POST /profiles/<id>/apply`. When it is unset or names a missing profile, the first profile is current. It is global (the same for every browser).
|
||||
- **Profile scoping.** Presets and sequences belong to a profile (`profile_id`). The list routes return only the current profile's records, and the single-record routes answer 404 for another profile's. Groups with a `profile_id` are visible only while that profile is current; groups without one are shared.
|
||||
- **Current zone.** A `current_zone` cookie, set by `POST /zones/<id>/set-current`. Without it, the current profile's first zone.
|
||||
- **Migration.** At boot, groups, zones and sequences written by older versions get the fields described below.
|
||||
|
||||
---
|
||||
|
||||
## Pages and static files
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| GET | `/` | Main UI |
|
||||
| GET | `/settings/page` | Standalone settings page |
|
||||
| GET | `/audio` | Live audio and beat page (level, tempo, bar position, tap) |
|
||||
| GET | `/settings/editor` | Driver settings editor: sends a driver settings (`PUT /devices/<id>`) |
|
||||
| GET | `/static/<path>` | UI scripts and styles |
|
||||
| GET | `/favicon.ico` | 204 |
|
||||
|
||||
Pages and static files are built into the firmware (gzipped, sent with `Content-Encoding: gzip`). They carry `Cache-Control: no-cache` and an `ETag` of the firmware build, so a browser revalidates each load (304 until the next update).
|
||||
|
||||
## Controller
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| GET | `/status` | IP, `eth` (ip, mask, gw, up), `ap_ip`, `ap_clients` (`[{mac, ip}]` on the Wi-Fi access point), MAC, uptime, `free_heap`, `free_internal` (internal RAM), mic level, tempo and beat counts, ESP-NOW and link statistics |
|
||||
| POST | `/reboot` | Replies `{"message":"rebooting"}`, then restarts after 0.5 s |
|
||||
| GET | `/ota` | Running image: partition, version, build time, IDF version, sha |
|
||||
| POST | `/ota` | Body: the raw firmware `.bin` (web UI included). Written to the idle slot, made the boot image, then the board reboots. A new image confirms itself after staying up a few seconds; one that crashes on start rolls back. `make ota HOST=<ip>` |
|
||||
| GET | `/db/<collection>` | Export a whole collection |
|
||||
| PUT | `/db/<collection>` | Replace a whole collection. Body: the object of id → record. Reply: `{"records": n}` |
|
||||
|
||||
**Bench tests** (see `docs/BENCH_TEST.md`):
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| GET, POST | `/test/loss` | Simulated ESP-NOW loss. Body `{"percent": 0–100, "beats": bool}` (whether beat frames are dropped too). Reply: the current setting |
|
||||
| POST | `/test/beats` | Body `{"bpm": 30–300, "count": n}` (0 = until stopped): synthetic beats to the drivers, with delivery and latency measured from their echoes. The mic's beats are muted meanwhile |
|
||||
| GET | `/test/beats` | Results so far |
|
||||
| POST | `/test/beats/stop` | Stop the generator |
|
||||
|
||||
## Settings — `/settings`
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| GET | `/settings` | The settings object |
|
||||
| PUT | `/settings` or `/settings/settings` | Merge keys into the settings. Reply: `{"message": "Settings updated successfully"}` |
|
||||
|
||||
Keys with meaning on the controller (others are stored as they are):
|
||||
|
||||
| Key | Checked | Meaning |
|
||||
|-----|---------|---------|
|
||||
| `ap_enabled` | | Wi-Fi access point (open, SSID = hostname, `192.168.5.1`); default `true`; applies after a restart. Holding the D3 button at boot forces it on |
|
||||
| `ap_password` | | AP password, 8-63 characters (WPA2); empty (default) is an open network; applies after a restart |
|
||||
| `bridge` | string under 64 characters | `host:port` (UDP, default port 8766) of led-simulator: every ESP-NOW frame goes there as `dst_mac + packet` instead of over the radio, and frames from it (`src_mac + packet`) count as received. Empty or missing: the radio. Applies after a restart. The host build (`sim-controller/`) always uses a bridge (`LED_SIM_BRIDGE`, default `127.0.0.1:8766`) |
|
||||
| `hostname` | | mDNS name (`<hostname>.local`, default `led-controller`); applies after a restart |
|
||||
| `static_ips` | | List of `{ip, netmask?, gw, dns?}` tried in order when the Ethernet link comes up; the first whose gateway answers ARP is used, else DHCP, else `192.168.4.1/24` for a direct PC cable. Applies after a restart |
|
||||
| `global_brightness` | integer 0–255 | Global factor of each driver's brightness (see Groups). Stored only: the UI pushes each driver its combined value |
|
||||
| `wifi_channel` | integer 1–11 | Stored for reference. The controller's ESP-NOW channel is set at build time (`make menuconfig`) |
|
||||
| `audio_simulated_bpm` | clamped to 60–200 | Tempo of the beat clock (default 120) |
|
||||
| `sequence_switch_wait` | `beat` or `downbeat` | When a newly started sequence takes over from the playing one |
|
||||
| `audio_beat_phase_ms` | integer 0–500 | Stored for the UI |
|
||||
| `audio_input_volume` | integer 0–200 | Stored for the UI |
|
||||
| `current_profile_id` | | Set by profile apply and import |
|
||||
| `audio_timing` | | Set by `/api/audio/start` and `/stop` |
|
||||
|
||||
Defaults filled at boot: `wifi_channel` (the build's ESP-NOW channel) and `global_brightness` (255).
|
||||
|
||||
## Profiles — `/profiles`
|
||||
|
||||
A profile is `{name, type: "zones", zones: [zone ids], scenes, palette_id}`.
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| GET | `/profiles` | `{"profiles": {...}, "current_profile_id": "<id>"}` |
|
||||
| GET | `/profiles/current` | `{"id": "<id>", "profile": {...}}`; 404 when there are no profiles |
|
||||
| GET | `/profiles/<id>` | One profile (`current` works as an id) |
|
||||
| POST | `/profiles` | Create. Body: `name` and any other fields; optional `seed_dj_zone`. Reply `{"<id>": profile}`, 201. See below |
|
||||
| PUT | `/profiles/<id>`, `/profiles/current` | Merge fields |
|
||||
| POST | `/profiles/<id>/apply` | Make it current. Reply `{"message": "Profile applied", "id": "<id>"}` |
|
||||
| POST | `/profiles/<id>/clone` | Copy with its own palette, zones and presets (preset references in the zones point at the copies). Body: optional `name`. 201 |
|
||||
| DELETE | `/profiles/<id>` | Delete it with its presets and sequences, and its zones and palette unless another profile lists them |
|
||||
| GET | `/profiles/<id>/export` | Profile bundle (see Import and export) |
|
||||
| POST | `/profiles/import` | Body: `{"bundle": {...}, "name"?, "apply"? (default true)}` or the bundle itself. Reply `{"<id>": profile, "id": "<id>"}`, 201 |
|
||||
|
||||
A store with no profile gets one at boot, `default`, with the same seed, a starter palette and an empty `default` group that its zone plays to. A new profile gets an empty palette, eight presets (`on`, `off`, `rainbow`, `Colour Cycle`, `transition`, `flicker`, `flame`, `twinkle`) and a zone `default` that lists them and names driver `1`. With `seed_dj_zone` it also gets three `DJ …` presets in a zone `dj` naming driver `dj`.
|
||||
|
||||
## Presets — `/presets`
|
||||
|
||||
A preset has `name`, `pattern`, `colors` (`#RRGGBB`), `brightness`, `delay`, `n1`–`n8`, `profile_id`, and optionally `auto`, `palette_refs` (palette index per colour slot), `background` / `background_palette_ref`, `mode` (sent as `n6`), `manual_beat_n`, `fade` (0–10000 ms: crossfade from what the strip showed when the preset is selected) and `beat_time` (`true`: the delay and timing parameters of patterns that support it count quarter beats, so the preset follows the tempo). New presets start with every field set and belong to the current profile.
|
||||
|
||||
**Animation patterns** (driver patterns, labels in `/patterns`). Each plays once with `auto: false` and holds its end state; with `auto: true` it repeats.
|
||||
- One-shots: `hit` (flash with attack, hold and decay), `keyframes` (ramp through the colours with easing).
|
||||
- Field patterns, which span the whole rig using each driver's place from `/devices/layout`: `sweep`, `ripple`, `spin`, `grow`, `field_wave`.
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| GET | `/presets` | The current profile's presets |
|
||||
| GET | `/presets/<id>` | One preset (404 for another profile's) |
|
||||
| POST | `/presets` | Create in the current profile. Reply `{"<id>": preset}`, 201 |
|
||||
| PUT | `/presets/<id>` | Merge fields |
|
||||
| DELETE | `/presets/<id>` | Delete |
|
||||
| POST | `/presets/push` | Send driver messages. Body: `{"sequence": [message, ...]}` or `{"payload": message}`, optional `targets` (MACs: acked unicast to each). Without targets, broadcast. Reply `{"message": "Delivered"}`. See Driver messages |
|
||||
| POST | `/presets/send` | Send stored presets. Body: `preset_ids` (or `ids`), `save` (default true), `default` (startup preset id), `targets` or `destination_mac`. Reply `{"message": "Presets sent", "presets_sent": n}` |
|
||||
| GET | `/presets/<id>/export` | Preset bundle |
|
||||
| POST | `/presets/import` | Body: a preset bundle (or `{"bundle": ...}`). New id in the current profile, 201 |
|
||||
|
||||
## Zones — `/zones`
|
||||
|
||||
A zone has `name`, `names` (driver names, the older way to target drivers), `group_ids` (groups it plays to), `presets` (rows of preset ids), `presets_flat`, `default_preset`, `preset_group_ids`, `sequence_ids`, `animation_ids` (animations shown as one-shot tiles), `content_kind` (`presets` or `sequences`) and `brightness` (0–255, the zone slider).
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| GET | `/zones` | `{"zones": {...all zones}, "zone_order": [current profile's zone ids], "current_zone_id", "profile_id"}` |
|
||||
| GET | `/zones/current` | `{"zone": {...}, "zone_id": "<id>"}`, or 404 `{"error", "zone": null, "zone_id": null}` |
|
||||
| GET | `/zones/<id>` | One zone |
|
||||
| POST | `/zones` | Create (body: `name` required, `names` or `ids`, `group_ids`, `presets`, `content_kind`, ...). Added to the current profile's zone list. 201 |
|
||||
| PUT | `/zones/<id>` | Merge fields |
|
||||
| DELETE | `/zones/<id>` | Delete (`current` works as an id) and remove it from every profile. Clears the cookie if it was current |
|
||||
| POST | `/zones/<id>/set-current` | Set the `current_zone` cookie |
|
||||
| POST | `/zones/<id>/clone` | Copy into the current profile. Body: optional `name` (default `<name> Copy`). 201 |
|
||||
| GET | `/zones/<id>/content-fragment` | With `HX-Request`: the zone's tab content (HTML); otherwise the main page |
|
||||
| POST | `/zones/<id>/play` | Body `{"preset_id", "drivers"?}`: upload the preset to the zone's groups and select it (`drivers: false` skips sending). 404 for an unknown zone or preset |
|
||||
| POST | `/zones/<id>/stop` | Select `off` on the zone's groups. `{"stopped": bool}` |
|
||||
| GET | `/zones/engine/status` | Sequence playback status (as `/sequences/status`) |
|
||||
|
||||
## Groups — `/groups`
|
||||
|
||||
A group lists drivers by MAC (`devices`) and carries `output_brightness` (0–255), driver defaults (`wifi_driver_display_name`, `wifi_driver_num_leds`, `wifi_color_order`, `wifi_startup_mode`) and pattern fields. MACs are normalised to 12 lowercase hex digits. A driver's group membership is every group listing its MAC (see Driver groups), sent to it whenever groups, zones or devices change.
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| GET | `/groups` | Groups visible in the current profile |
|
||||
| GET | `/groups/<id>` | One group (404 when scoped to another profile) |
|
||||
| POST | `/groups` | Create with defaults; `profile_scoped: true` ties it to the current profile, `profile_id` may only name the current profile or be null. Reply: the group, 201 |
|
||||
| PUT | `/groups/<id>` | Merge fields |
|
||||
| DELETE | `/groups/<id>` | Delete |
|
||||
| POST | `/groups/<id>/brightness` | Each member gets its combined brightness, saved on the driver. `{"message", "sent", "errors": [{mac, error}]}` |
|
||||
| POST | `/groups/<id>/driver-config` | Each member gets `device_config` from the group's driver defaults (body fields override for this send). 400 when none is set |
|
||||
| POST | `/groups/<id>/identify` | All members blink red together for 2 s, then go off. 400 when the group has no devices |
|
||||
|
||||
**Combined brightness** for a driver: `round(255 × global/255 × g₁/255 × … × device/255 [× zone/255])`, with one factor per group listing it (`output_brightness`), the device's `output_brightness` and, when given, the zone slider.
|
||||
|
||||
## Devices — `/devices`
|
||||
|
||||
A device is `{id: MAC, name, type: "led", transport: "espnow" | "wifi", address, default_pattern, zones, output_brightness?}`. ESP-NOW drivers register themselves when they boot (announce) and when they answer a ping. For ESP-NOW devices `address` is the MAC. The controller has no Wi-Fi driver transport: Wi-Fi records are kept, but nothing is sent to them.
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| GET | `/devices` | All devices, each with `connected` (`null` for ESP-NOW, `false` for Wi-Fi) |
|
||||
| GET | `/devices/<id>` | One device (the id may be written with colons) |
|
||||
| POST | `/devices` | Create. `name` required; `mac` (or, for ESP-NOW, a MAC in `address`); `transport` `espnow` (default) or `wifi`. Reply `{"<mac>": device}`, 201; 409 for a MAC already registered |
|
||||
| PUT | `/devices/<id>` | Merge fields. `name` cannot be blank, the MAC cannot change, `output_brightness` 0–255. Changing `name`, `max_brightness`, `num_leds`, `color_order`, `startup_mode` or `reversed` also sends them to the driver as `device_config` |
|
||||
| DELETE | `/devices/<id>` | Delete |
|
||||
| GET | `/devices/status` | Per driver: `{"last_ack_ms_ago": ms or -1, "failed_messages": n}` from the acked link |
|
||||
| POST | `/devices/ping` | Body `{"timeout_s": 0.5–30, "broadcast": bool}` (timeout default 3). Sends the ping as an acked unicast to each known device and collects replies; `"broadcast": true`, or no known devices, broadcasts it instead so new drivers are found: `{"ok", "ping_id", "timeout_s", "responses": {mac: {mac, name, rtt_ms}}, "registered": n}`. Drivers that answer are added or renamed |
|
||||
| POST | `/devices/layout` | Body `{"placements": {mac: {x0, y0, x1, y1} \| null}, "center"?: {x, y}}`: where each bar sits, in any units with y up, and the rig's centre (kept in `settings.rig_center`; without one, the layout's bounding-box centre). `x0,y0` is LED 1, the data-in end; `null` removes a bar. Saved as the device's `placement`. Then every placed ESP-NOW driver gets `device_config.place`: its ends relative to the centre, scaled so the furthest end is 1 from it. Reply `{"updated", "sent", "failed"}`; 400 without `placements` |
|
||||
| POST | `/devices/groups` | Send every ESP-NOW driver its groups and wait for the acks: `{"ok", "total", "sent", "failed"}` (503 when any failed, 400 with no ESP-NOW devices) |
|
||||
| POST | `/devices/resolve-brightness` | Body `{"macs": [...], "zone_brightness"?}` → `{"values": {mac: brightness}}` |
|
||||
| POST | `/devices/<id>/brightness` | Body `{"zone_brightness"?}`: send the combined brightness, saved on the driver. `{"message", "brightness"}` |
|
||||
| POST | `/devices/<id>/driver-config` | Body: any of `name`, `num_leds` (1–2048), `color_order`, `startup_mode` (`default`, `last`, `off`) |
|
||||
| POST | `/devices/<id>/identify` | Red 10 Hz blink for 2 s, then off |
|
||||
|
||||
## Sequences — `/sequences`
|
||||
|
||||
A sequence is `{name, profile_id, kind?, targets?, lanes: [[step, ...], ...], lane_opts?, lanes_group_ids: [[group ids], ...], group_ids, loop (default true), advance_mode: "beats" | "time", steps, step_duration_ms, sequence_transition}`. Every field marked `?` is optional; a sequence without them plays as it always has.
|
||||
|
||||
- `kind`: `"sequence"` (default) or `"animation"`: a clip that is fired once over whatever runs (see Animations). Both are stored here.
|
||||
- `targets`: the drivers the sequence plays to, in order (up to 32): `[{name, group_ids: [group ids], devices: [MACs]}]`. A target reaches every driver in its groups plus each listed driver (by its own group `d<mac>`, see Driver groups). Lanes and steps name targets by index.
|
||||
- `lane_opts`: one object per lane (same index as `lanes`):
|
||||
- `mode`: `"beats"` or `"time"`, overriding `advance_mode` for this lane, so beat lanes and time lanes run side by side.
|
||||
- `offset`: beats (or seconds, time lanes) before the lane starts, on the first pass only. With a copy of a lane this gives a canon or ripple.
|
||||
- `rate`: 0.25–4, speed multiplier. A 1-beat step at rate 2 lasts half a beat.
|
||||
- `targets`: indexes into `targets` the lane plays to. Without them the lane's groups come from the older fields: `lanes_group_ids[lane]`, else `group_ids`, else (single lane) the step's `group_ids`, else the zone's groups.
|
||||
- `chase`: `{order: "forward" | "reverse" | "bounce" | "random", width (default 1), others: "off" (default) | "hold"}`. Each step moves the lit position along the lane's targets (in the order listed in the lane's `targets`). The step's preset goes to `width` targets from there, and the rest go off or keep what they show.
|
||||
- A step is `{preset_id, beats (default 1, from 0.25), seconds (default 3, 0.1–3600), targets?, others?, rest?, animation_id?, length?, group_ids?}`:
|
||||
- `beats` / `seconds`: how long it lasts, by its lane's mode.
|
||||
- `targets`: indexes of the lane's targets this step lights (default: all of the lane's, or the chase position).
|
||||
- `others: "off"`: the lane's other targets go off for this step.
|
||||
- `rest: true`: nothing lit; the lane's targets go off.
|
||||
- `animation_id`: fire that animation instead of a preset. With `length: "animation"` the step lasts as long as the animation (at the current tempo).
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| GET | `/sequences` | The current profile's sequences |
|
||||
| GET | `/sequences/<id>` | One sequence |
|
||||
| POST | `/sequences` | Create in the current profile. A non-empty `steps` without lanes becomes lane 0. Reply `{"<id>": sequence}`, 201 |
|
||||
| PUT | `/sequences/<id>` | Merge fields; stops it when it is playing |
|
||||
| DELETE | `/sequences/<id>` | Delete; stops it when it is playing |
|
||||
| POST | `/sequences/<id>/play` | Body `{"zone_id"}` (required). Reply `{"ok": true, "pending": bool, ...}`. 400 for a missing zone, a sequence without steps or one from another profile |
|
||||
| POST | `/sequences/stop` | Stop playback (and any animation) and clear the presets on the zone's groups. `{"ok": true}` |
|
||||
| POST | `/sequences/<id>/fire` | Play it once as an animation over whatever runs. Body `{"zone_id"?, "wait"?: "now" (default) \| "beat" \| "downbeat"}`; without `zone_id`, the playing sequence's zone. Reply `{"ok": true, "wait"}`. 404 for another profile's, 400 without a zone or steps |
|
||||
| POST | `/sequences/overlay/stop` | End the animation now; its drivers go back (as when it ends). `{"ok": true}` |
|
||||
| POST | `/sequences/sync-phase` | Body `{"mode": "step" | "pass"}`: `step` restarts the current step's beat count, `pass` restarts the sequence. Also makes this beat bar beat 1. 409 when nothing plays |
|
||||
| GET | `/sequences/status` | Playback status (below) |
|
||||
| GET | `/sequences/<id>/export` | Sequence bundle (the sequence and its presets) |
|
||||
| POST | `/sequences/import` | Body: a sequence bundle. The presets are copied into the current profile and the steps point at the copies. 201 |
|
||||
|
||||
**Playback.** One sequence plays at a time, in one zone.
|
||||
- **Start.** Each lane's first preset is uploaded to the lane's groups and selected, then the lane's other presets are uploaded, and every driver in the zone gets its combined brightness with the zone slider.
|
||||
- **Advancing.** A time lane moves on when its step's `seconds` are up, whatever the beat. When lane 0 is a time lane, the status has `lane0_step_elapsed_ms` and `lane0_step_duration_ms` and `beat_readout` is empty. A beat lane counts quarter beats (the controller ticks between beats from the last beat interval) towards its step's `beats` ÷ `rate`, then moves on. Each step's preset is uploaded to all of the lane's targets (unless already there), then selected on the targets the step lights.
|
||||
- **End.** Without `loop` the sequence ends after one pass. Its presets are cleared from the zone's groups, and the readout keeps `n/n`.
|
||||
- **Switching.** Starting another sequence while one plays waits for the next beat. It waits for the next downbeat only when `sequence_switch_wait` is `downbeat` and the mic is timing. The current sequence holds meanwhile.
|
||||
- **Animations.** `/sequences/<id>/fire` (or a step's `animation_id`) plays a sequence once in a second player over the running one. An animation loops only with `loop: true`.
|
||||
- While it plays, the sequence keeps time, but its sends leave out the drivers the animation's lanes reach: groups are split into those drivers' own groups.
|
||||
- When it ends (or `/sequences/overlay/stop`), those drivers get the sequence's current step again. With no sequence playing they get the zone's last played preset, else off.
|
||||
- Firing another animation replaces the one playing. Drivers the new one doesn't reach go back.
|
||||
- A sequence that ends while an animation plays clears the zone once the animation is over.
|
||||
- **Beat source.** Beats come from the mic's beat detector while audio timing is on (`/api/audio/start`) and it has a tempo lock. Otherwise they come from a clock at `audio_simulated_bpm`, whose beats also go to the drivers. Beats closer than 0.3 s (200 BPM) are dropped.
|
||||
|
||||
Status: `{"active": false, "beat_readout": "", overlay}` when idle, else `{active, advance_mode, sequence_id, zone_id, num_lanes, total_sequence_steps, lane0_current_step, lane0_lane_length, lane0_beat_in_step, lane0_beats_per_step, lane0_preset_id, lane0_preset_name, sequence_beat_at, sequence_beats_per_pass, sequence_loop_beat, beat_readout, lanes, overlay}`.
|
||||
- `lanes`: one entry per playing lane, `{step (0-based), steps, mode, started, done, pos? (chase: the target index lit first), beat_in_step and beats_in_step (beat lanes) or elapsed_ms and duration_ms (time lanes)}`.
|
||||
- `overlay`: `{active, pending, pending_id?}`, plus `{sequence_id, zone_id, drivers, progress (0–1), lanes}` while an animation plays.
|
||||
|
||||
## Audio — `/api/audio`
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| GET | `/api/audio/status` | `{"status": {...}}`, see below |
|
||||
| GET | `/api/audio/events` | Server-sent events, `data: {"type": "status" | "beat", "status": {...}}`: a status event first, one on every detected beat, and a status heartbeat every 0.5 s |
|
||||
| POST | `/api/audio/start` | Mic beats time sequences and go to the drivers. Saved. `{"ok": true, "status"}` |
|
||||
| POST | `/api/audio/stop` | The beat clock times sequences instead; the mic's beats stop going to the drivers. Saved |
|
||||
| POST | `/api/audio/reset` | Forget the tempo and bar position and track again (409 while stopped) |
|
||||
| POST | `/api/audio/anchor-bar` | Make the last beat bar beat 1 (409 while stopped) |
|
||||
| GET | `/api/audio/devices` | The single input: `{"devices": [{"id": "i2s", "name", "display_name", "is_default": true}], "diagnostics": {}}` |
|
||||
| PUT | `/api/audio/device` | Body `{"device_select"}`: stored only (there is one microphone) |
|
||||
|
||||
Status fields: `running` (audio timing on), `bpm` (locked tempo, `null` without a lock, the clock's tempo while stopped), `bpm_simulated`, `beat_seq`, `bar_beat`, `beats_per_bar`, `is_downbeat`, `bar_phase_readout`, `phase_confidence`, `input_level`, `last_beat_ts`, `sequence` (playback status), `sequence_pending`, `beat_readout`, `sequence_switch_wait` (in effect) and `sequence_switch_wait_saved`, `audio_simulated_bpm`, `simulated_beat_tick`, `audio_run`, `beat_phase_ms`, `input_volume`.
|
||||
|
||||
The `/audio` page uses its own routes:
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| GET | `/audio.wav` | Live microphone audio (16 kHz mono WAV stream; one listener at a time) |
|
||||
| GET | `/beats` | Server-sent events: `beat` (`bpm`, `n`, `bar`, `meter`, `sure`, `us`), `onset`, and `tempo` every second |
|
||||
| POST | `/tap` | The user tapped bar beat 1 now |
|
||||
| GET | `/time` | Board clock (`{"us": ...}`) for the page to line its clock up with |
|
||||
|
||||
## Patterns — `/patterns`
|
||||
|
||||
Pattern metadata is the `pattern` collection, keyed by name. Pattern sources are the led-driver `src/patterns/*.py` files built into the firmware, plus uploads (stored on the controller, and they take precedence). `on` and `off` are built into the driver and have no file.
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| GET | `/patterns`, `/patterns/definitions` | Metadata, plus `{}` for every pattern file without metadata |
|
||||
| GET | `/patterns/<name>` | Metadata record |
|
||||
| POST | `/patterns` | Body `{name, data: {...}, ...}`: `data` and the other keys become the record under `name`. Reply: the record, 201 |
|
||||
| PUT, DELETE | `/patterns/<name>` | Merge, delete (the file stays) |
|
||||
| GET | `/patterns/ota/manifest` | `{"files": [{"name": "x.py", "url": "http://<Host>/patterns/ota/file/x.py"}]}` |
|
||||
| GET | `/patterns/ota/file/<name>.py` | The source (`text/plain`); 400 for `on`/`off`, 404 when missing |
|
||||
| POST | `/patterns/upload` | Body `{name, code, overwrite?}`: store a source. 409 when it exists and `overwrite` is false. 201 |
|
||||
| POST | `/patterns/driver` | Body `{name, code, overwrite?, min_delay?, max_delay?, max_colors?, n1?..n8?}`: store the source and its metadata (`n1`–`n8` are parameter labels). The name must be an identifier. 201 |
|
||||
| POST | `/devices/<id>/patterns/push` | 400: not supported for ESP-NOW devices |
|
||||
|
||||
## Palettes — `/palettes`
|
||||
|
||||
A palette is a list of colours.
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| GET | `/palettes` | `{id: [colours]}` |
|
||||
| GET | `/palettes/<id>` | `{"colors": [...], "id": "<id>"}` |
|
||||
| POST | `/palettes` | Body `{"colors"}`. Reply `{"id", "colors"}`, 201 |
|
||||
| PUT | `/palettes/<id>` | Body `{"colors"}`: replaces the list |
|
||||
| DELETE | `/palettes/<id>` | Delete |
|
||||
|
||||
## Scenes — `/scenes`
|
||||
|
||||
Plain records: GET (list, one), POST (201), PUT (merge), DELETE. Scenes do not play.
|
||||
|
||||
## Outputs — `/outputs`
|
||||
|
||||
Network pixel fixtures. An output is `{id, name, protocol: "ddp" | "artnet" | "sacn" | "dmx_serial", host, port, universe, channel, serial_port, dmx_mode, pixel_count, pixel_offset, color_order, reverse, brightness, fps, enabled}` with defaults filled in. The checks:
|
||||
- `ddp` needs a `host`. `dmx_serial` needs a `serial_port`, and its pixels must fit one DMX universe.
|
||||
- Number ranges: `port` 1–65535, `universe` 0–32767 (sACN 1–63999), `channel` 1–512, `brightness` 0–255, `fps` 1–120.
|
||||
- `color_order` is one of `rgb rbg grb gbr brg bgr`.
|
||||
|
||||
| Method | Path | Description |
|
||||
|--------|------|-------------|
|
||||
| GET | `/outputs`, `/outputs/<id>` | List, one |
|
||||
| POST | `/outputs` | Create (400 with the failed check). Reply: the output, 201 |
|
||||
| PUT | `/outputs/<id>` | Merge and check again |
|
||||
| DELETE | `/outputs/<id>` | Delete |
|
||||
| POST | `/outputs/<id>/test` | Body `{"step_s": 0.1–5}` (default 1): solid red, green, blue and white for `step_s` each at `fps`, then black. `{"message", "status": {name, protocol, kind, pixel_count, frames, packets, bytes, errors, last_error}}`. 503 for `dmx_serial` (no USB-DMX adapter on this board) |
|
||||
|
||||
Zones do not render to outputs: only the test pattern is sent.
|
||||
|
||||
## WebSocket — `/ws`
|
||||
|
||||
On connect the controller sends `{"type": "device_tcp_snapshot", "connected_ips": []}` (there are no Wi-Fi driver sessions). Each text frame is a driver message (JSON object), sent as `/presets/push` would send it: an optional `to` (MAC) addresses one driver, otherwise it is broadcast. A frame that is not a JSON object, or a failed send, gets `{"error": ...}` back. A plain GET gets 426.
|
||||
|
||||
---
|
||||
|
||||
## Driver messages
|
||||
|
||||
The UI, `/presets/push`, `/ws` and the controller itself send drivers **v1 messages**: JSON objects with `"v": "1"`. The controller does not send them as they are:
|
||||
- **Binary envelope.** A message that only carries presets, a select, brightness, `save` and `groups` goes out as a compact binary envelope (`main/envelope.c`, mirrored by `test/binary_envelope.py`).
|
||||
- Version 2 is the usual frame.
|
||||
- A frame whose presets use `fade` or `beat_time` is version 3: each preset record is followed by `[ext_len][key, len, value]…`, with key 1 the fade ms (u16) and key 2 the beat timing (u8).
|
||||
- Drivers skip keys they don't know. Drivers without v3 support ignore v3 frames, so they miss only presets that use the new fields.
|
||||
- **JSON.** Any other message goes as JSON with short keys, split across several messages when it does not fit one ESP-NOW frame. A preset with a background colour (`bg`) is one of these: the envelope has no field for it.
|
||||
- **Delivery.** Broadcasts are never acked (envelopes go out twice, JSON once); drivers that miss a state change notice from the state digest and ask to be brought up to date. Messages with `targets` are unicast to each MAC, acked and retried.
|
||||
|
||||
### Fields
|
||||
|
||||
| Long key | Short | Meaning |
|
||||
|----------|-------|---------|
|
||||
| `presets` | `p` | Map of preset id → preset |
|
||||
| `select` | `s` | `["preset_id"]` or `["preset_id", step]` for every driver addressed; or a map of driver name → that list |
|
||||
| `groups` | `g` | Only drivers in one of these groups apply the message |
|
||||
| `set_groups` | `sg` | With `groups`: replace the driver's group list |
|
||||
| `save` | `sv` | Persist presets, brightness or config on the driver |
|
||||
| `default` | `df` | Startup preset id |
|
||||
| `device_config` | `dc` | `name`, `num_leds`, `color_order`, `startup_mode`, `max_brightness`, `reversed`, `place` ([x0, y0, x1, y1] in rig coordinates, see `/devices/layout`; `null` clears it), `usb_log` (per-beat USB log; on reboot). Drivers print nothing over USB unless their `debug` or `usb_log` setting is on: on the ESP32-C3, unread USB output blocks the driver |
|
||||
| `clear_presets` | `cp` | Drop stored presets |
|
||||
| `manifest` | `mf` | Pattern files to fetch (Wi-Fi drivers) |
|
||||
| `b` | | Driver brightness 0–255 |
|
||||
|
||||
Preset fields: `p`/`pattern`, `c`/`colors` (`#RRGGBB`), `d`/`delay` (ms, default 100), `b`/`brightness` (0–255), `a`/`auto` (`true` runs freely, `false` steps once per beat), `bg`/`background`, `n1`–`n6` (pattern parameters; `n5` is reverse, `n6` the style mode), `f`/`fade`, `tb`/`beat_time`. Other fields (`name`, `manual_beat_n`, …) are dropped on the way out.
|
||||
|
||||
Sending `select` again with the same preset is a beat for that preset. Selecting `off` resets the step, so the next select starts every driver at step 0 unless a step is given.
|
||||
|
||||
### Driver groups
|
||||
|
||||
A driver keeps a list of group ids and applies a group command (or a message with `groups`) only when it holds one of them. The controller sends each ESP-NOW driver its list whenever groups, zones or devices change, when the driver boots, and when it asks to be brought up to date. A driver that has failed three messages in a row gets these updates at most every 30 s until it answers again. The list holds:
|
||||
|
||||
- every group (`group` collection) whose `devices` lists the driver's MAC, by group id;
|
||||
- `z<zone id>` for every zone whose `names` lists the driver's name (zones from before groups);
|
||||
- its own group `d<mac>` (12 lowercase hex digits), always first, so a sequence target can name a single driver. It doesn't change any other membership.
|
||||
|
||||
A zone plays to its `group_ids` and, when it names drivers, to `z<zone id>`. A message with `groups` that fits the envelope goes out as one group command per group.
|
||||
|
||||
### Example
|
||||
|
||||
```json
|
||||
{
|
||||
"v": "1",
|
||||
"presets": {
|
||||
"12": {"pattern": "chase", "colors": ["#ff0000", "#0000ff"], "delay": 80, "brightness": 255, "auto": true, "n1": 4, "n2": 4}
|
||||
},
|
||||
"select": ["12"],
|
||||
"groups": ["3"],
|
||||
"save": true
|
||||
}
|
||||
```
|
||||
|
||||
Pattern parameters are documented in the led-driver repository.
|
||||
@@ -0,0 +1,295 @@
|
||||
# Bench test: one S3 controller and one LED driver
|
||||
|
||||
This walks one ESP32-S3 controller (W5500 Ethernet, INMP441 mic) and one `led-driver` unit through flashing, a smoke test, a lossy-link test and a beat latency measurement. Nothing here has been run on hardware yet, so treat the expected numbers as targets to check, not results.
|
||||
|
||||
## 0. What you need
|
||||
|
||||
- Controller: XIAO ESP32-S3 with a W5500 module wired as in `main/Kconfig.projbuild` (SCLK 7, MISO 8, MOSI 9, CS 2, INT 3, RST 1), Ethernet cable to a DHCP network. The mic is optional for this test; the bench generator makes its own beats.
|
||||
- Driver: one `led-driver` unit (MicroPython, the `p2p` ESP-NOW branch) with a few LEDs. It needs no Wi-Fi network.
|
||||
- A PC on the same network. Docker with `espressif/idf:v6.1` for building.
|
||||
- For the true latency measurement: a logic analyzer or scope with two channels and a common ground. Optional: the software echo numbers need nothing extra.
|
||||
|
||||
**Channel rule.** ESP-NOW only works when both radios use the same channel. The p2p driver uses its `wifi_channel` setting (default 5); the controller's default is now 5 as well (`CONFIG_ESPNOW_CHANNEL` in `sdkconfig.defaults`). If your driver uses another channel, change the controller before building:
|
||||
|
||||
```bash
|
||||
docker run --rm -v "$PWD":/project -w /project espressif/idf:v6.1 idf.py menuconfig
|
||||
```
|
||||
|
||||
then *ESP-NOW config → Wi-Fi channel*. Alternatively set `CONFIG_ESPNOW_CHANNEL=<n>` in `sdkconfig.defaults` (delete `sdkconfig` after, so it is regenerated). To use the beat marker pin, also set `CONFIG_BEAT_TEST_GPIO` (for example 44) in the same menu.
|
||||
|
||||
## 1. Build and flash the controller
|
||||
|
||||
The repository root has a Makefile that wraps all of this: `make build`, `make flash`, `make monitor` (Ctrl-] to quit), `make log` (console for 10 s, no terminal needed), `make test`, and `make help` for the rest; `PORT=/dev/ttyACM1` selects another port. The manual commands below do the same thing.
|
||||
|
||||
```bash
|
||||
|
||||
tools/build_web.sh
|
||||
docker run --rm -v "$PWD":/project -w /project espressif/idf:v6.1 idf.py build
|
||||
```
|
||||
|
||||
Expect `Project build complete`, the app well under its 2 MB slot, with the web UI embedded (`www_dist/www.pack`). Fix ownership if Docker left it root-owned: `docker run --rm -v "$PWD":/project espressif/idf:v6.1 chown -R 0:0 /project`.
|
||||
|
||||
Flash with the S3 on USB (check which port it is; `ls /dev/ttyACM*`):
|
||||
|
||||
```bash
|
||||
docker run --rm --device=/dev/ttyACM0 -v "$PWD":/project -w /project espressif/idf:v6.1 idf.py -p /dev/ttyACM0 flash
|
||||
```
|
||||
|
||||
This writes the bootloader, partition table and app (the web UI is part of the app). Watch the log:
|
||||
|
||||
```bash
|
||||
docker run --rm -it --device=/dev/ttyACM0 -v "$PWD":/project -w /project espressif/idf:v6.1 idf.py -p /dev/ttyACM0 monitor
|
||||
```
|
||||
|
||||
Look for, in order: `store: ... records` lines, `espnow_tx: ESP-NOW up on channel N`, `rel: reliable link up`, `Ethernet Link Up`, `Got IP: x.x.x.x`, `HTTP server started`.
|
||||
|
||||
## 2. First checks (replace `$S3` with the IP)
|
||||
|
||||
```bash
|
||||
export S3=192.168.1.50
|
||||
curl -s http://$S3/status
|
||||
```
|
||||
|
||||
Expect JSON with `uptime_s`, `reset_reason` (why the board last restarted, such as `panic`, `task_watchdog` or `brownout`; opening the USB serial port resets the board and replaces it with `usb`, so read it first), `bpm`, an `espnow` block and a `link` block (`ver` nonzero, `digests` increasing by one about every 1.5 s). If the mic hears music, `bpm` and `beats_sent` move too, which means beats are already being broadcast. Open `http://$S3/` in a browser: the UI should load, and the dev tools network tab should show `Content-Encoding: gzip` on `/static/*.js`.
|
||||
|
||||
```bash
|
||||
curl -s -D - -o /dev/null -H 'Accept-Encoding: gzip' http://$S3/static/presets.js | grep -i -E 'content-encoding|content-type'
|
||||
```
|
||||
|
||||
**Audio and beats.** `http://$S3/audio` is the mic page: live levels, tempo and bar position, a tap button to correct beat 1, and a Listen button for the 16 kHz mono stream. The underlying endpoints are `/audio.wav` (one listener at a time), `/beats` (server-sent events: `beat`, `onset`, `tempo`), `POST /tap` and `/time`. `/status` carries the mic levels (`mic_rms_dbfs`, `mic_spl_db`) and the beat state (`bpm`, `beat_locked`, `meter`, `bar_beat`, `bar_sure`).
|
||||
|
||||
## 3. Load data and add a test zone
|
||||
|
||||
Import the Pi database (the files hold your real zones and presets, so use a copy if you want a smaller test):
|
||||
|
||||
```bash
|
||||
for n in device zone preset profile palette pattern sequence scene; do
|
||||
curl -s -X PUT --data-binary @../db/$n.json http://$S3/db/$n; echo " $n"
|
||||
done
|
||||
```
|
||||
|
||||
The driver registers itself: it broadcasts a hello at boot, the controller adds it to the device list under its MAC and sends it its group list. Check with `curl -s http://$S3/devices/<mac>` once the driver is running (step 4). Zones are the drivers' groups: a zone's `names` must contain the driver's **name** exactly (`led-<mac>` by default, see its `settings.json`).
|
||||
|
||||
```bash
|
||||
curl -s -X POST -d '{"name":"bench","names":["led-aabbccddeeff"]}' http://$S3/zones
|
||||
curl -s -X POST -d '{"name":"bench red","pattern":"on","colors":["#ff0000"],"delay":100,"brightness":255,"auto":true}' http://$S3/presets
|
||||
```
|
||||
|
||||
Note the returned ids (`<zone>` and `<preset>` below). Creating or changing a zone re-sends group lists to every registered ESP-NOW driver.
|
||||
|
||||
## 4. Prepare the driver
|
||||
|
||||
The driver runs the `p2p` branch of `led-driver` plus these files from this work: `src/beat_sync.py`, `src/espnow_rx.py`, and changed `src/main.py` and `src/presets.py`. Back up the device's own copies first (`mpremote fs cp :main.py ./main.py.bak`), then copy the new ones (`mpremote fs cp src/main.py :main.py` and so on) and reset.
|
||||
|
||||
Optional keys in the driver's `settings.json` for the later tests:
|
||||
|
||||
| key | value | meaning |
|
||||
|---|---|---|
|
||||
| `bench` | `true` | echo every fired beat to the controller and print stats every 50 beats |
|
||||
| `beat_pin` | e.g. `5` | GPIO toggled on every fired beat, for the logic analyzer |
|
||||
| `espnow_loss` | `0` | percent of received frames the driver discards (set later) |
|
||||
|
||||
After boot, the controller's `/devices` list should contain the driver's MAC and `/status` should show `link.acked` rising (the group list was acknowledged). `mpremote` interrupts the running program, so reset the driver after using it.
|
||||
|
||||
## 5. Smoke test
|
||||
|
||||
```bash
|
||||
curl -s -X POST -d '{"preset_id":"<preset>"}' http://$S3/zones/<zone>/play
|
||||
```
|
||||
|
||||
The driver's console should log the preset and select it received (once each, although the controller sends every state frame twice), and the LEDs should go red within a fraction of a second. Then:
|
||||
|
||||
```bash
|
||||
curl -s -X POST http://$S3/zones/<zone>/stop # LEDs off
|
||||
curl -s http://$S3/devices/status # last_ack_ms_ago / failed_messages per registered driver
|
||||
```
|
||||
|
||||
Zone play is a group broadcast, so `devices/status` only changes for acked (unicast) traffic. Trigger one with a targeted push:
|
||||
|
||||
```bash
|
||||
curl -s -X POST -d '{"sequence":[{"v":"1","select":{"led-aabbccddeeff":["<preset>"]}}],"targets":["aabbccddeeff"]}' http://$S3/presets/push
|
||||
curl -s http://$S3/devices/status
|
||||
```
|
||||
|
||||
Expected: `last_ack_ms_ago` is small (tens of ms) and `failed_messages` is 0. `/status` shows `link.acked` increased.
|
||||
|
||||
## 6. Lossy-link test
|
||||
|
||||
The loss mode discards a percentage of frames before the radio on the controller (all outgoing frames, and incoming acks and echoes). The driver can discard received frames too. This makes the retry, fragment and resync layers do real work without moving antennas.
|
||||
|
||||
```bash
|
||||
# controller: 40% loss, beats included
|
||||
curl -s -X POST -d '{"percent":40,"beats":true}' http://$S3/test/loss
|
||||
curl -s http://$S3/status # sim_dropped counts dropped frames
|
||||
```
|
||||
|
||||
Run these and compare with the table:
|
||||
|
||||
| test | how | expected |
|
||||
|---|---|---|
|
||||
| Acked unicast under loss | repeat the targeted push from step 5 twenty times at 40% (give each a different select step so you can tell them apart on the driver console) | all reach the driver; `link.retransmits` rises. A message needs its data and its ack to both survive, and there are 5 sends in total, so about 1 in 10 is reported as timed out even though the driver usually has it |
|
||||
| Give up and report | set `percent` to 100, push once, wait 2 s | `link.ack_timeouts` +1 and `devices/status` shows `failed_messages: 1` |
|
||||
| Lost broadcast, digest recovery | `percent` 100, play a different preset on the zone, then set `percent` 0 | the LEDs do not change at first, then within about 1.5 to 5 s the driver sends a resync and shows the new preset; `link.resyncs` +1 |
|
||||
| Driver-side loss | set `"espnow_loss": 40` in the driver's `settings.json` (restore it afterwards), controller loss 0, push twenty times | every push is processed once on the driver (retransmissions are de-duplicated); `link.retransmits` rises. Lost acks are covered by the controller-side loss rows above, because that setting also drops incoming acks |
|
||||
| Multi-message send | `POST /presets/send` with 10+ preset ids, `save: false` and `targets` | the controller packs the presets into a few binary messages (14 presets took 2); all arrive under loss, with retransmits. `save: true` makes the driver write its `presets.json`, so restore that file afterwards. Frame-level fragmentation exists in the link but nothing in the current API produces a message over one frame, so it is only covered by the driver's unit tests |
|
||||
|
||||
Set loss back to 0 when done: `curl -s -X POST -d '{"percent":0}' http://$S3/test/loss`.
|
||||
|
||||
Reading the numbers: the controller drops a reply with the same probability as a request, so under loss an unicast message needs both the data and the ack to survive. Resync requests are also subject to loss and to the driver's 3 s minimum gap, so recovery may take a few digests.
|
||||
|
||||
### Results of the first run (S3 to one p2p driver, channel 5)
|
||||
|
||||
| test | result |
|
||||
|---|---|
|
||||
| 20 acked pushes, controller loss 40% | 20 of 20 reached the driver; 19 acked, 1 reported timed out (its ack was lost); 19 retransmits; 34 frames dropped by the test mode |
|
||||
| 1 push, loss 100% | gave up after 2.0 s with 4 retransmits; `failed_messages` 1; driver heard nothing |
|
||||
| zone play during a 100% outage, then loss back to 0 | driver was untouched during the outage; 1.5 s after the link returned it received its groups, the preset and the select, one resync, and the new state |
|
||||
| 20 acked pushes, driver-side loss 40% | 20 of 20 processed exactly once; 14 retransmits; 0 timeouts |
|
||||
| `/presets/send` of 14 presets at driver loss 40% | 2 messages (209 and 217 bytes), both acked, 1 retransmit |
|
||||
|
||||
## 7. Beat latency and delivery
|
||||
|
||||
### Software numbers (no equipment)
|
||||
|
||||
Start synthetic beats with the driver in `bench` mode:
|
||||
|
||||
```bash
|
||||
curl -s -X POST -d '{"bpm":120,"count":200}' http://$S3/test/beats
|
||||
sleep 105
|
||||
curl -s http://$S3/test/beats
|
||||
```
|
||||
|
||||
Results include:
|
||||
|
||||
- `beats_sent`, `echoes` and `hit_pct_total`: the share of beats each driver fired on and reported. With no loss expect 100%.
|
||||
- `rtt_minus_lead_min/avg/max_us`: time from the first beat copy going out to the driver's echo coming back, minus the 30 ms the driver deliberately waits (`CONFIG_BEAT_LEAD_MS`). This is out-airtime plus the driver's MicroPython work plus return airtime, so it overstates one-way delay. Expect roughly 2 to 15 ms; the maximum shows the worst case you will see on the LEDs.
|
||||
- `spread_avg_us` and `spread_max_us`: only meaningful with two or more drivers; shows how far apart they fire for the same beat.
|
||||
|
||||
On the driver's serial console every 50 beats you get the true driver-side counts, for example `beat {'fires': 100, 'dups': 100, 'late': 0, 'freerun': 0}`:
|
||||
|
||||
- `fires`: beats it acted on.
|
||||
- `dups`: second copies dropped (with the double send this should be close to `fires`).
|
||||
- `freerun`: beats it generated itself because both copies were missed. Zero without loss.
|
||||
- `late`: frames rejected as too soon or old.
|
||||
|
||||
### Delivery under loss
|
||||
|
||||
Repeat the run with loss on:
|
||||
|
||||
```bash
|
||||
curl -s -X POST -d '{"percent":30,"beats":true}' http://$S3/test/loss
|
||||
curl -s -X POST -d '{"bpm":120,"count":200}' http://$S3/test/beats
|
||||
```
|
||||
|
||||
Judge delivery from the driver's own `fires` and `freerun` counts: with two copies the chance of missing both is about 9% at 30% loss, and the free-run covers those, so `fires` should stay near `beats_sent` with `freerun` around 9% of it. The controller's `hit_pct_total` is lower because echoes are dropped by the same loss setting; it is a lower bound, roughly `(1 - loss) × delivery`.
|
||||
|
||||
### Latency over USB (no extra equipment)
|
||||
|
||||
Both boards are on USB, so the PC can timestamp one event line from each and compare them. Settings already applied for this: the driver has `"usb_log": true` in `settings.json`. The controller prints `BT <beat> <microseconds>` for every synthetic beat; the driver prints `FIRE <beat> <ticks_us>` when it fires.
|
||||
|
||||
```bash
|
||||
python3 tools/usb_latency.py --ctrl-port /dev/ttyACM0 --drv-port /dev/ttyACM1 --url http://$S3 --beats 200
|
||||
```
|
||||
|
||||
The script starts the generator, reads both ports, and maps each board's clock onto the PC's by using the fastest USB deliveries per 5 s window (this also removes crystal drift). USB serial delivers in bursts, so single lines arrive up to about 50 ms late; the fastest ones are close to on time, which is what the mapping relies on. The remaining error is the difference between the two ports' fastest delivery, roughly 1 ms, so read results to about a millisecond. The script prints the delivery jitter so you can see how noisy the ports were. The driver's `FIRE` time is when the beat triggers the pattern step; the LED data follows within the same loop pass, and a 119-LED strip takes about 3.6 ms to clock out.
|
||||
|
||||
Close any serial monitor first (only one program can hold a port). Do not run long `mpremote exec` commands on the driver during the capture (see Troubleshooting).
|
||||
|
||||
### True latency with a logic analyzer
|
||||
|
||||
For a measurement that does not depend on USB. Marker pins are set up already: the controller toggles **GPIO44 (D7)** when the first copy of each beat goes out (`CONFIG_BEAT_TEST_GPIO=44`, in `sdkconfig.defaults`) and the driver toggles **GPIO44 (D7)** when it fires (`"beat_pin": 44` in its `settings.json`). Both are XIAO ESP32S3 boards, where D7 is free.
|
||||
|
||||
Wiring (3.3 V logic, any 2 or 3 channel analyzer):
|
||||
|
||||
| analyzer | connect to |
|
||||
|---|---|
|
||||
| GND | GND on the controller **and** GND on the driver (one common ground) |
|
||||
| channel 0 | controller **D7** |
|
||||
| channel 1 | driver **D7** |
|
||||
| channel 2 (optional) | driver **D10** (GPIO9, the LED data line) to see when the LEDs really update |
|
||||
|
||||
Steps:
|
||||
|
||||
1. Make sure the driver runs a preset that changes on every beat if you use channel 2, for example a `chase` preset with `auto` off, selected on the zone. With the plain `on` preset the LED data line stays quiet.
|
||||
2. Start a capture: sample rate at least 1 MS/s, length at least 60 s (edges only; it stays small), trigger on any edge of channel 0.
|
||||
3. Start the beats: `curl -s -X POST -d '{"bpm":120,"count":100}' http://$S3/test/beats`. Both markers toggle on every beat, so you will see edges 500 ms apart.
|
||||
4. Stop the capture when the generator finishes (about 52 s) and export the digital data as CSV (time in seconds, one column per channel).
|
||||
5. Analyze: `python3 tools/analyze_edges.py capture.csv --ctrl 0 --drv 1 --time-unit s`. Use `--lead-ms` if you changed `CONFIG_BEAT_LEAD_MS`. It pairs each controller edge with the next driver edge and prints the delay beyond the 30 ms lead, with min, mean, median, p95, max and jitter, plus the count of unmatched beats. On the scope, channel 2 shows the true light delay: the first data burst after the driver edge.
|
||||
|
||||
Targets from the plan: under about 10 ms from the controller edge to the driver edge (after subtracting the lead).
|
||||
|
||||
Return to normal use by deleting `beat_pin` and `usb_log` from the driver's `settings.json` and setting `CONFIG_BEAT_TEST_GPIO=-1` (the marker pin otherwise toggles on every beat, including live mic beats).
|
||||
|
||||
### Results of the first run (software numbers, one driver, channel 5)
|
||||
|
||||
Synthetic beats at 120 BPM, 160 beats per run, mic beats muted while the generator runs, driver in `bench` mode.
|
||||
|
||||
| | no loss | 30% loss (beats included) |
|
||||
|---|---|---|
|
||||
| beats the driver acted on, per beat sent | 1.00 | 1.00 |
|
||||
| beats the driver invented itself (free-run) | 0% | 11% (theory for two independent copies: 9%) |
|
||||
| second copies dropped as duplicates | 100% | 47% (theory: 49%) |
|
||||
| echoes the controller received | 162 of 162 | 96 of 161 (echoes are lost at 30% too, and invented beats do not echo) |
|
||||
| round trip minus the 30 ms lead, min / avg / max | 9.8 / 15.0 / 25.7 ms | 3.4 / 16.2 / 26.0 ms |
|
||||
|
||||
Reading it: the double send plus free-run gave the driver a beat every time, even with 30% of frames lost. The round-trip figure includes the driver's loop and the echo's trip back, so it is an upper bound on the delay the LEDs see; it is not the controller-to-LED latency. The USB and logic analyzer measurements below give the real figure.
|
||||
|
||||
Latency over USB (200 beats at 120 BPM, one driver, 119 LEDs): delay beyond the 30 ms lead min 0.49, mean 2.07, median 1.77, p95 4.41, max 7.95 ms (std 1.3 ms; accuracy about 1 ms). 197 of 200 beats matched. Both clocks drifted by 60 to 80 ppm against the PC, and individual USB lines arrived up to 54 ms late, which is why the script uses the fastest deliveries. This is the time from the controller sending a beat to the driver firing, beyond the built-in lead. The logic analyzer run has not been done.
|
||||
|
||||
### ESP32-C3 driver compared with the S3 driver
|
||||
|
||||
Driver: XIAO ESP32-C3 (MAC 58:8c:81:a3:74:58), MicroPython v1.22.1 stock (no ws2812-dma patch), 160 MHz, about 128 KB free heap, 119 LEDs on pin 10. Same tests as above, same controller.
|
||||
|
||||
| | S3 driver, no loss | C3 driver, no loss |
|
||||
|---|---|---|
|
||||
| echoes the controller received | 162 of 162 | 160 of 160 |
|
||||
| round trip minus the 30 ms lead, min / avg / max | 9.8 / 15.0 / 25.7 ms | 2.6 / 4.5 / 17.8 ms |
|
||||
|
||||
C3 with 30% loss (160 beats): every beat produced exactly one pattern step, 15 of the 160 (9%, theory 9%) came from free-run, and 68 second copies were dropped as duplicates; the controller got 99 of 160 echoes. That matches the S3 result in the table above.
|
||||
|
||||
Reading the free-run counter: after the generator stops, the driver keeps stepping for up to 4 more beats on its last period. A stats window that runs past the end of the test therefore shows 4 extra "free-run" fires even with no loss. They are not missed beats. (My first read of the C3's no-loss run said otherwise; that was wrong.)
|
||||
|
||||
Latency over USB, same settings on both boards (`usb_log` only), 200 beats at 120 BPM, delay beyond the 30 ms lead, accuracy about 1 ms:
|
||||
|
||||
| | matched | min | mean | median | p95 | max | std |
|
||||
|---|---|---|---|---|---|---|---|
|
||||
| S3 driver (240 MHz) | 200 / 200 | -2.4 | 2.15 | 2.03 | 6.03 | 12.3 | 2.5 ms |
|
||||
| C3 driver (160 MHz) | 200 / 200 | 0.2 | 3.36 | 3.06 | 7.47 | 19.7 | 2.3 ms |
|
||||
|
||||
The C3 is about 1.2 ms slower on average and has a longer tail (maximum 19.7 ms against 12.3 ms). With the method's 1 ms accuracy, the mean difference is small and the tail difference is the more telling one. Both are well inside a 120 BPM beat. The echo round trip disagrees with this (S3 15 ms mean, C3 4.5 ms). The S3 echo runs had `usb_log` and a marker pin switched on and the C3 runs did not, and I did not rerun the S3 echo test with identical settings, so treat the echo figures as unexplained and prefer the USB ones.
|
||||
|
||||
Pattern frame rate (strip writes per second, 119 LEDs, delay 1 ms, 2 s each; only patterns that wrote anything are shown):
|
||||
|
||||
| pattern | C3 (160 MHz, 115 KB free) | S3 (240 MHz, 8 MB free) |
|
||||
|---|---|---|
|
||||
| flame | 22 | 33 |
|
||||
| palette_morph | 21 | 32 |
|
||||
| circle | 150 | 170 |
|
||||
|
||||
The CPU-heavy patterns run about 1.5 times faster on the S3, which is the clock ratio; a light pattern is limited by the strip write and differs by about 13%. `aurora` and `chase` wrote nothing with the parameters I used, so they are not measured.
|
||||
|
||||
Groups: the controller sends a driver its group list when the driver announces itself, but now only if the driver is in at least one zone. A driver in no zone keeps the groups it already has (an empty list from the controller used to wipe them). An explicit zone or device edit still re-sends every list, including empty ones.
|
||||
|
||||
**Wi-Fi start-up order on the C3.** With the extra link code loaded before Wi-Fi start-up, the C3 failed with `Wifi Unknown Error 0x0101` on about every other cold boot (2 of 4). Starting ESP-NOW before the pattern library and the LED driver claim memory fixed it (6 of 6 boots). `led-driver/src/main.py` now does this.
|
||||
|
||||
## 8. Troubleshooting
|
||||
|
||||
- **A board on a USB-serial/JTAG port (C3, and the S3 controller) resets whenever a program opens its port,** and a C3 can land in ROM download mode (`wait usb download`). The old apt `mpremote` 0.4.0 hangs on this. Use the newer one in `~/projects/micropython/micropython/tools/mpremote/mpremote.py`, or `led-tool`, and note that `fs cp -r` fails on drivers that print timestamps (copy named files instead).
|
||||
- **Only one program can use a board's serial port at a time.** A serial logger left running while `led-cli` uploads corrupts the transfer silently: `led-cli` reports the files uploaded, but the old ones stay on the driver.
|
||||
- **Running a long `mpremote exec` on the driver resets it:** the driver's watchdog (10 s) keeps running after `mpremote` interrupts `main.py`, so keep REPL experiments under about 8 s and reset the driver afterwards.
|
||||
|
||||
- **Driver never reacts, no acks:** channel mismatch. Check `CONFIG_ESPNOW_CHANNEL` against the driver's `wifi_channel`. Neighbouring channels can still work at bench range, so a working link does not prove they match.
|
||||
- **Zone play logs nothing on the driver:** the driver is not in the zone's group (silent). Check the zone's `names` against the driver's `name`.
|
||||
- **Devices show `last_ack_ms_ago: -1`:** the device record has no usable 12-character MAC in `address` or as its key.
|
||||
- **`beats_sent` rises but `echoes` stays 0:** the driver is not in `bench` mode, or it has not yet heard a controller frame (it learns the controller's MAC from the first data or digest frame; wait a few seconds).
|
||||
- **Resync never triggers:** the driver ignores a digest equal to its own version; confirm with `/status` that `link.ver` changed after the missed play.
|
||||
- **Web UI is blank:** the web UI was not packed before the build; run `tools/build_web.sh` and build again (`make build` does this).
|
||||
|
||||
## 9. Cleanup
|
||||
|
||||
```bash
|
||||
curl -s -X POST -d '{"percent":0}' http://$S3/test/loss
|
||||
curl -s -X POST http://$S3/test/beats/stop
|
||||
```
|
||||
|
||||
Set the driver's `bench` and `espnow_loss` back to off for normal use.
|
||||
@@ -0,0 +1,118 @@
|
||||
# LED controller — user guide
|
||||
|
||||
This page describes the web UI served by the controller (an ESP32-S3 on Ethernet). It covers profiles, zones, presets, device groups, sequences and audio. The controller reaches the LED drivers over ESP-NOW itself, so there is no bridge to set up.
|
||||
|
||||
For HTTP routes and the driver message format, see **[API.md](API.md)**. For building and flashing, see the project **README**.
|
||||
|
||||
Figures below are **schematic** (layout and ideas), not pixel-perfect screenshots.
|
||||
|
||||
---
|
||||
|
||||
## Run mode and Edit mode
|
||||
|
||||
**Edit mode** is in the header and **Run mode** is in the **Menu** (on narrow screens, both are in the Menu). The **label on the button is the mode you switch to**.
|
||||
|
||||

|
||||
|
||||
| Mode | Purpose |
|
||||
|------|--------|
|
||||
| **Run mode** | Day-to-day control: choose a zone, tap presets, apply profiles. The setup actions are hidden. |
|
||||
| **Edit mode** | Full setup from the **Menu**: devices, groups, outputs, sequences, zones, presets, patterns, colour palette, audio and settings, plus per-tile **Edit** on the strip. |
|
||||
|
||||
On narrow screens, **Menu** also holds the header actions, so it is there in Run mode too.
|
||||
|
||||
---
|
||||
|
||||
## Zones
|
||||
|
||||
- **Select a zone**: click its button in the top bar. The main area shows the zone's preset strip.
|
||||
- **Zones** (Edit mode): create and manage zones. A zone lists **device groups**, presets and sequences; presets and sequences can share a zone. **Right-click** a zone button for its settings.
|
||||
- A zone plays to its device groups. Zones made before groups list drivers by **name** instead, and still work.
|
||||
- **Brightness slider**: sets the brightness for the current zone. Each driver gets one value: global × its groups × the device × the zone.
|
||||
- **Search**: the Devices, Zones and Presets lists have a search box that hides rows that do not match as you type.
|
||||
|
||||

|
||||
|
||||
Click the coloured part of a preset tile to select that preset on every driver in the zone. In Edit mode, drag tiles to reorder them, and use **Edit** and **Remove** on each tile.
|
||||
|
||||
---
|
||||
|
||||
## Presets
|
||||
|
||||
The **Presets** button (Edit mode) opens the profile's presets: **Add**, **Edit**, **Send**, **Delete**, plus **Import** and **Export** (a preset as a JSON file).
|
||||
|
||||

|
||||
|
||||
The preset editor:
|
||||
- **Pattern** and its **n1–n8** parameters, colours, background, brightness and delay.
|
||||
- **Manual** presets step once per beat instead of running freely.
|
||||
- **From Palette** inserts a colour linked to the profile's palette (badge **P**). It follows the palette when the palette changes.
|
||||
- **Try** previews on the current zone without saving on the drivers.
|
||||
- **Save** stores the preset on the controller; **Send** pushes it to the drivers with save.
|
||||
- **Remove from zone** (when opened from a zone) removes it from that zone only.
|
||||
|
||||
---
|
||||
|
||||
## Profiles
|
||||
|
||||
- **Apply** makes a profile current. Zones, presets and sequences you see belong to it.
|
||||
- **Create** (Edit mode) gives a new profile a palette and a **default** zone with starter presets. Optionally tick **DJ zone** for a starter `dj` zone.
|
||||
- **Clone** copies a profile with its own zones, presets and palette. **Delete** removes it with its presets and sequences.
|
||||
- **Export** saves a profile with its zones, presets, sequences and palette as a JSON file. **Import** loads one as a new profile and applies it.
|
||||
|
||||
---
|
||||
|
||||
## Devices and groups
|
||||
|
||||
- **Devices** (Edit mode) lists the LED drivers by name; **Edit** shows a driver's MAC. Drivers appear by themselves when they boot or answer a ping; you can also add them by hand.
|
||||
- **Ping drivers** checks which drivers answer (green dot with the round-trip time) and adds new ones.
|
||||
- **Identify** blinks a driver red for two seconds.
|
||||
- **Update groups** sends every driver its group membership.
|
||||
- **Edit** a device for its name, brightness, driver settings (LED count, colour order, power-on pattern) and the groups it is in.
|
||||
- **Groups** (Edit mode): put drivers in a group, set the group's brightness and driver defaults once, then attach the group to zones and sequence lanes.
|
||||
- Groups are shared by every profile unless you tick **this profile only**.
|
||||
- **Identify** on a device, in the group or in the list to add from, blinks just that driver; **Identify devices in group** blinks all members together.
|
||||
|
||||
---
|
||||
|
||||
## Sequences
|
||||
|
||||
**Sequences** (Edit mode) are shows of presets in one or more **lanes**. Each lane plays to its own device group.
|
||||
- **Steps.** A step is a preset and a number of beats. When a step's beats have passed, the lane moves to its next step. A sequence loops unless you turn looping off.
|
||||
- **Playing.** Attach a sequence to a zone in the zone editor, then play it from the zone. One sequence plays at a time. Stopping a sequence clears its presets from the zone's drivers.
|
||||
- **Switching.** Starting another sequence waits for the next beat, or the next downbeat when the header toggle says **Downbeat** and the microphone is timing.
|
||||
- **Syncing.** Press **S** (or the BPM button) on a downbeat to line the sequence up with the music.
|
||||
|
||||
---
|
||||
|
||||
## Audio
|
||||
|
||||
- The controller listens through its microphone and detects the tempo and the bar.
|
||||
- **Audio** is in the Menu in Edit mode. While it is started, the microphone's beats time sequences and go to the drivers, so manual presets step on the music.
|
||||
- While it is stopped, a clock at the **simulated BPM** does both instead.
|
||||
- **Reset detector** forgets a stuck tempo. The **/audio** page has a full readout, a tap for beat 1 and a live listen.
|
||||
|
||||
---
|
||||
|
||||
## Patterns, outputs and palette
|
||||
|
||||
- **Patterns** (Edit mode) lists the patterns and their typical delays. **Send** pushes a pattern file to the drivers over ESP-NOW; they reset to load it. **Create pattern** uploads your own pattern file.
|
||||
- **Outputs** (Edit mode) lists network pixel fixtures (DDP, Art-Net, sACN). **Test** flashes red, green, blue and white, then black. Zones do not drive outputs on this controller.
|
||||
- **Colour Palette** (Edit mode) edits the current profile's swatches. Preset colours linked with **From Palette** update with it.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Settings
|
||||
|
||||
**Settings** (Edit mode) holds the controller's name, the ESP-NOW channel (for reference: the controller's channel is set at build time), a **Wi-Fi access point** switch (on by default; network named after the hostname, with an optional WPA2 password, controller at `192.168.5.1`; holding the button on D3 at boot forces it on), its mDNS **hostname** and the **static IPs** it tries on the Ethernet link (DHCP when none answers). With no DHCP server, as on a cable straight to a PC, the controller is at `192.168.4.1`; give the PC a static IP such as `192.168.4.2`. Network changes apply after a restart. **Driver** in Settings sends a driver its name, LED count, colour order, startup mode, maximum brightness and direction over ESP-NOW, with no cable. **Update code** there sends a driver, or all of them, the led-driver code built into the controller. `led-cli` on a computer edits a driver's whole `settings.json` over USB.
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Further reading
|
||||
|
||||
- **[API.md](API.md)**: HTTP routes, the WebSocket `/ws`, and the driver message format.
|
||||
- **README**: building, flashing and updating the controller and drivers.
|
||||
@@ -0,0 +1,14 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 140" width="480" height="140">
|
||||
<title>Colour Palette modal (concept)</title>
|
||||
<rect width="480" height="140" fill="#2a2a2a" stroke="#555" stroke-width="1" rx="6"/>
|
||||
<text x="20" y="28" fill="#fff" font-family="sans-serif" font-size="15" font-weight="600">Colour Palette</text>
|
||||
<text x="20" y="48" fill="#888" font-family="sans-serif" font-size="10">Profile: current profile name</text>
|
||||
<rect x="20" y="58" width="44" height="44" rx="4" fill="#e53935" stroke="#333"/>
|
||||
<rect x="72" y="58" width="44" height="44" rx="4" fill="#fdd835" stroke="#333"/>
|
||||
<rect x="124" y="58" width="44" height="44" rx="4" fill="#43a047" stroke="#333"/>
|
||||
<rect x="176" y="58" width="44" height="44" rx="4" fill="#1e88e5" stroke="#333"/>
|
||||
<rect x="228" y="58" width="44" height="44" rx="4" fill="#8e24aa" stroke="#333"/>
|
||||
<rect x="280" y="70" width="36" height="28" rx="3" fill="#1a1a1a" stroke="#666"/>
|
||||
<text x="288" y="88" fill="#ccc" font-family="sans-serif" font-size="10">+</text>
|
||||
<text x="20" y="122" fill="#aaa" font-family="sans-serif" font-size="10">Swatches belong to the profile; preset editor uses them via From Palette.</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,20 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 820 108" width="820" height="108">
|
||||
<title>Header: tab buttons and action bar</title>
|
||||
<rect width="820" height="108" fill="#1a1a1a"/>
|
||||
<rect x="0" y="106" width="820" height="2" fill="#4a4a4a"/>
|
||||
<text x="16" y="28" fill="#888" font-family="sans-serif" font-size="11">Tabs</text>
|
||||
<rect x="16" y="40" width="72" height="36" rx="4" fill="#333" stroke="#666" stroke-width="1"/>
|
||||
<text x="34" y="63" fill="#ccc" font-family="sans-serif" font-size="13">default</text>
|
||||
<rect x="96" y="40" width="88" height="36" rx="4" fill="#2a4a7a" stroke="#5a8fd4" stroke-width="2"/>
|
||||
<text x="108" y="63" fill="#fff" font-family="sans-serif" font-size="13">lounge</text>
|
||||
<rect x="192" y="40" width="56" height="36" rx="4" fill="#333" stroke="#666" stroke-width="1"/>
|
||||
<text x="204" y="63" fill="#ccc" font-family="sans-serif" font-size="13">dj</text>
|
||||
<text x="380" y="28" fill="#888" font-family="sans-serif" font-size="11">Actions (Edit mode)</text>
|
||||
<rect x="380" y="40" width="72" height="30" rx="3" fill="#3d3d3d" stroke="#555" stroke-width="1"/>
|
||||
<text x="396" y="59" fill="#e0e0e0" font-family="sans-serif" font-size="11">Profiles</text>
|
||||
<rect x="458" y="40" width="52" height="30" rx="3" fill="#3d3d3d" stroke="#555" stroke-width="1"/>
|
||||
<text x="470" y="59" fill="#e0e0e0" font-family="sans-serif" font-size="11">Help</text>
|
||||
<rect x="516" y="40" width="60" height="30" rx="3" fill="#3d3d3d" stroke="#555" stroke-width="1"/>
|
||||
<text x="530" y="59" fill="#e0e0e0" font-family="sans-serif" font-size="11">Menu</text>
|
||||
<text x="16" y="98" fill="#aaa" font-family="sans-serif" font-size="10">Active tab highlighted. Run mode is in the Menu.</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,26 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 340" width="300" height="340" role="img" aria-labelledby="t">
|
||||
<title id="t">Narrow screen: Menu aggregates header actions</title>
|
||||
<rect width="300" height="340" fill="#2e2e2e"/>
|
||||
<rect x="0" y="0" width="300" height="52" fill="#1a1a1a"/>
|
||||
<rect x="12" y="12" width="56" height="28" rx="4" fill="#3d3d3d" stroke="#555" stroke-width="1"/>
|
||||
<text x="22" y="30" fill="#eee" font-family="DejaVu Sans, Liberation Sans, Arial, sans-serif" font-size="12">Menu �</text>
|
||||
<rect x="76" y="14" width="52" height="24" rx="4" fill="#333" stroke="#666" stroke-width="1"/>
|
||||
<text x="86" y="30" fill="#ccc" font-family="DejaVu Sans, Liberation Sans, Arial, sans-serif" font-size="11">tab</text>
|
||||
<rect x="136" y="14" width="52" height="24" rx="4" fill="#2a4a7a" stroke="#5a8fd4" stroke-width="1"/>
|
||||
<text x="142" y="30" fill="#fff" font-family="DejaVu Sans, Liberation Sans, Arial, sans-serif" font-size="11">tab</text>
|
||||
<rect x="12" y="60" width="276" height="168" rx="4" fill="#252525" stroke="#4a4a4a" stroke-width="1"/>
|
||||
<text x="24" y="84" fill="#888" font-family="DejaVu Sans, Liberation Sans, Arial, sans-serif" font-size="10">Dropdown (same actions as desktop header)</text>
|
||||
<g font-family="DejaVu Sans, Liberation Sans, Arial, sans-serif" font-size="12" fill="#e8e8e8">
|
||||
<text x="24" y="108">Run mode</text>
|
||||
<text x="24" y="132">Profiles</text>
|
||||
<text x="24" y="156">Tabs</text>
|
||||
<text x="24" y="180">Presets</text>
|
||||
<text x="24" y="204">Help</text>
|
||||
</g>
|
||||
<rect x="12" y="240" width="276" height="80" rx="6" fill="#222" stroke="#444" stroke-width="1"/>
|
||||
<text x="24" y="268" fill="#aaa" font-family="DejaVu Sans, Liberation Sans, Arial, sans-serif" font-size="10">Content area presets as on desktop</text>
|
||||
<rect x="24" y="278" width="80" height="32" rx="4" fill="#333" stroke="#555"/>
|
||||
<text x="36" y="298" fill="#ddd" font-family="DejaVu Sans, Liberation Sans, Arial, sans-serif" font-size="11">preset</text>
|
||||
<rect x="112" y="278" width="80" height="32" rx="4" fill="#333" stroke="#555"/>
|
||||
<text x="124" y="298" fill="#ddd" font-family="DejaVu Sans, Liberation Sans, Arial, sans-serif" font-size="11">preset</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,31 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 520 400" width="520" height="400">
|
||||
<title>Preset editor modal (simplified)</title>
|
||||
<rect width="520" height="400" fill="#1e1e1e"/>
|
||||
<rect x="40" y="28" width="440" height="344" rx="8" fill="#2a2a2a" stroke="#555" stroke-width="1"/>
|
||||
<text x="60" y="58" fill="#fff" font-family="DejaVu Sans,Liberation Sans,Arial,sans-serif" font-size="17" font-weight="600">Preset</text>
|
||||
<text x="60" y="86" fill="#aaa" font-family="DejaVu Sans,Liberation Sans,Arial,sans-serif" font-size="11">Name</text>
|
||||
<rect x="60" y="92" width="200" height="28" rx="3" fill="#1a1a1a" stroke="#444" stroke-width="1"/>
|
||||
<text x="72" y="111" fill="#ddd" font-family="DejaVu Sans,Liberation Sans,Arial,sans-serif" font-size="12">evening glow</text>
|
||||
<text x="280" y="86" fill="#aaa" font-family="DejaVu Sans,Liberation Sans,Arial,sans-serif" font-size="11">Pattern</text>
|
||||
<rect x="280" y="92" width="160" height="28" rx="3" fill="#1a1a1a" stroke="#444" stroke-width="1"/>
|
||||
<text x="292" y="111" fill="#ddd" font-family="DejaVu Sans,Liberation Sans,Arial,sans-serif" font-size="12">pulse</text>
|
||||
<text x="60" y="148" fill="#aaa" font-family="DejaVu Sans,Liberation Sans,Arial,sans-serif" font-size="11">Colours</text>
|
||||
<rect x="60" y="156" width="48" height="48" rx="4" fill="#7e57c2" stroke="#333" stroke-width="1"/>
|
||||
<circle cx="66" cy="162" r="8" fill="#3f51b5" stroke="#fff" stroke-width="1"/>
|
||||
<text x="63" y="166" fill="#fff" font-family="DejaVu Sans,Liberation Sans,Arial,sans-serif" font-size="7" font-weight="700">P</text>
|
||||
<rect x="116" y="156" width="48" height="48" rx="4" fill="#26a69a" stroke="#333" stroke-width="1"/>
|
||||
<text x="176" y="184" fill="#888" font-family="DejaVu Sans,Liberation Sans,Arial,sans-serif" font-size="10">P = palette-linked</text>
|
||||
<text x="60" y="232" fill="#aaa" font-family="DejaVu Sans,Liberation Sans,Arial,sans-serif" font-size="11">Brightness, delay, n1-n8</text>
|
||||
<rect x="60" y="238" width="120" height="24" rx="3" fill="#1a1a1a" stroke="#444" stroke-width="1"/>
|
||||
<text x="68" y="254" fill="#888" font-family="DejaVu Sans,Liberation Sans,Arial,sans-serif" font-size="11">0-255</text>
|
||||
<text x="60" y="290" fill="#aaa" font-family="DejaVu Sans,Liberation Sans,Arial,sans-serif" font-size="10">Actions</text>
|
||||
<rect x="60" y="298" width="44" height="26" rx="3" fill="#444" stroke="#666" stroke-width="1"/>
|
||||
<text x="72" y="315" fill="#eee" font-family="DejaVu Sans,Liberation Sans,Arial,sans-serif" font-size="11">Try</text>
|
||||
<rect x="112" y="298" width="56" height="26" rx="3" fill="#444" stroke="#666" stroke-width="1"/>
|
||||
<text x="120" y="315" fill="#eee" font-family="DejaVu Sans,Liberation Sans,Arial,sans-serif" font-size="11">Default</text>
|
||||
<rect x="176" y="298" width="88" height="26" rx="3" fill="#3d5a80" stroke="#5a7ab8" stroke-width="1"/>
|
||||
<text x="188" y="315" fill="#fff" font-family="DejaVu Sans,Liberation Sans,Arial,sans-serif" font-size="11">Save+Send</text>
|
||||
<rect x="272" y="298" width="48" height="26" rx="3" fill="#444" stroke="#666" stroke-width="1"/>
|
||||
<text x="284" y="315" fill="#eee" font-family="DejaVu Sans,Liberation Sans,Arial,sans-serif" font-size="11">Close</text>
|
||||
<text x="60" y="352" fill="#888" font-family="DejaVu Sans,Liberation Sans,Arial,sans-serif" font-size="9">Try: preview without device save. Save+Send: store and push with save.</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
@@ -0,0 +1,35 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 220" width="800" height="220">
|
||||
<title>Main area: brightness and preset tiles</title>
|
||||
<defs>
|
||||
<linearGradient id="rg1" x1="0%" y1="0%" x2="100%" y2="0%">
|
||||
<stop offset="0%" style="stop-color:#ffd54f"/><stop offset="100%" style="stop-color:#fff8e1"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="rg2" x1="0%" y1="0%" x2="100%" y2="0%">
|
||||
<stop offset="0%" style="stop-color:#e53935"/><stop offset="33%" style="stop-color:#fdd835"/>
|
||||
<stop offset="66%" style="stop-color:#43a047"/><stop offset="100%" style="stop-color:#1e88e5"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="rg3" x1="0%" y1="0%" x2="100%" y2="0%">
|
||||
<stop offset="0%" style="stop-color:#00897b"/><stop offset="100%" style="stop-color:#4db6ac"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect width="800" height="220" fill="#2e2e2e"/>
|
||||
<text x="20" y="32" fill="#fff" font-family="sans-serif" font-size="16" font-weight="600">lounge</text>
|
||||
<text x="20" y="56" fill="#aaa" font-family="sans-serif" font-size="11">Brightness (global)</text>
|
||||
<rect x="20" y="64" width="320" height="8" rx="4" fill="#444"/>
|
||||
<rect x="20" y="64" width="200" height="8" rx="4" fill="#6a9ee2"/>
|
||||
<circle cx="220" cy="68" r="10" fill="#ccc" stroke="#333" stroke-width="1"/>
|
||||
<text x="360" y="74" fill="#888" font-family="sans-serif" font-size="11">drag to adjust</text>
|
||||
<text x="20" y="108" fill="#aaa" font-family="sans-serif" font-size="11">Click tile body to select on tab devices</text>
|
||||
<rect x="20" y="118" width="200" height="72" rx="6" fill="#252525" stroke="#555" stroke-width="1"/>
|
||||
<rect x="28" y="128" width="184" height="36" rx="4" fill="url(#rg1)"/>
|
||||
<text x="32" y="180" fill="#eee" font-family="sans-serif" font-size="13" font-weight="600">warm white</text>
|
||||
<rect x="232" y="118" width="200" height="72" rx="6" fill="#252525" stroke="#6a9ee2" stroke-width="2"/>
|
||||
<rect x="240" y="128" width="184" height="36" rx="4" fill="url(#rg2)"/>
|
||||
<text x="244" y="180" fill="#eee" font-family="sans-serif" font-size="13" font-weight="600">rainbow</text>
|
||||
<rect x="444" y="118" width="200" height="72" rx="6" fill="#252525" stroke="#555" stroke-width="1"/>
|
||||
<rect x="452" y="128" width="184" height="36" rx="4" fill="url(#rg3)"/>
|
||||
<text x="456" y="180" fill="#eee" font-family="sans-serif" font-size="13" font-weight="600">chase</text>
|
||||
<rect x="656" y="130" width="56" height="48" rx="4" fill="#3d3d3d" stroke="#555" stroke-width="1"/>
|
||||
<text x="670" y="158" fill="#ddd" font-family="sans-serif" font-size="11">Edit</text>
|
||||
<text x="656" y="198" fill="#888" font-family="sans-serif" font-size="10">Edit mode: drag tiles to reorder</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
@@ -0,0 +1,239 @@
|
||||
# Custom Colour Picker Component
|
||||
|
||||
A cross-platform, cross-browser colour picker component that provides a consistent user experience across all operating systems and browsers.
|
||||
|
||||
## Features
|
||||
|
||||
✅ **Consistent UI** - Same appearance and behavior on Windows, macOS, Linux, iOS, and Android
|
||||
✅ **Browser Support** - Works in Chrome, Firefox, Safari, Edge, Opera, and mobile browsers
|
||||
✅ **Touch Support** - Full touch/gesture support for mobile devices
|
||||
✅ **HSB Colour Model** - Uses Hue, Saturation, Brightness for intuitive colour selection
|
||||
✅ **Multiple Input Methods** - Hex input, RGB inputs, and visual picker
|
||||
✅ **Accessible** - Keyboard accessible and screen reader friendly
|
||||
✅ **Customizable** - Easy to style and integrate
|
||||
|
||||
## Files
|
||||
|
||||
- `color-picker.js` - Main JavaScript component (14KB)
|
||||
- `color-picker.css` - Stylesheet (4KB)
|
||||
- `color-picker-demo.html` - Demo page showing usage examples
|
||||
|
||||
## Quick Start
|
||||
|
||||
### 1. Include the files
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="color-picker.css">
|
||||
<script src="color-picker.js"></script>
|
||||
```
|
||||
|
||||
### 2. Create a container element
|
||||
|
||||
```html
|
||||
<div id="my-color-picker"></div>
|
||||
```
|
||||
|
||||
### 3. Initialize the colour picker
|
||||
|
||||
```javascript
|
||||
const picker = new ColorPicker('#my-color-picker', {
|
||||
initialColor: '#FF0000',
|
||||
onColorChange: (color) => {
|
||||
console.log('Color changed to:', color);
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### Constructor
|
||||
|
||||
```javascript
|
||||
new ColorPicker(container, options)
|
||||
```
|
||||
|
||||
**Parameters:**
|
||||
- `container` (string|HTMLElement) - CSS selector or DOM element
|
||||
- `options` (object) - Configuration options
|
||||
|
||||
**Options:**
|
||||
- `initialColor` (string) - Initial colour in hex format (default: '#FF0000')
|
||||
- `onColorChange` (function) - Callback when colour changes (receives hex colour string)
|
||||
- `showHexInput` (boolean) - Show hex input field (default: true)
|
||||
|
||||
### Methods
|
||||
|
||||
```javascript
|
||||
// Get current color
|
||||
const color = picker.getColor(); // Returns hex string like '#FF0000'
|
||||
|
||||
// Set color programmatically
|
||||
picker.setColor('#00FF00');
|
||||
|
||||
// Open the picker panel
|
||||
picker.open();
|
||||
|
||||
// Close the picker panel
|
||||
picker.close();
|
||||
|
||||
// Toggle the picker panel
|
||||
picker.toggle();
|
||||
```
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Usage
|
||||
|
||||
```javascript
|
||||
const picker = new ColorPicker('#picker1', {
|
||||
initialColor: '#FF0000'
|
||||
});
|
||||
```
|
||||
|
||||
### With Callback
|
||||
|
||||
```javascript
|
||||
const picker = new ColorPicker('#picker1', {
|
||||
initialColor: '#FF0000',
|
||||
onColorChange: (color) => {
|
||||
document.body.style.backgroundColor = color;
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### Multiple Colour Pickers
|
||||
|
||||
```javascript
|
||||
const colors = ['#FF0000', '#00FF00', '#0000FF'];
|
||||
const pickers = colors.map((color, index) => {
|
||||
return new ColorPicker(`#picker-${index}`, {
|
||||
initialColor: color,
|
||||
onColorChange: (newColor) => {
|
||||
colors[index] = newColor;
|
||||
updateLEDColors(colors);
|
||||
}
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
### Dynamic Colour Picker Creation
|
||||
|
||||
```javascript
|
||||
function addColorPicker(containerId, initialColor = '#000000') {
|
||||
const container = document.createElement('div');
|
||||
container.id = containerId;
|
||||
document.getElementById('color-list').appendChild(container);
|
||||
|
||||
return new ColorPicker(container, {
|
||||
initialColor: initialColor,
|
||||
onColorChange: (color) => {
|
||||
console.log(`Color ${containerId} changed to ${color}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Add multiple pickers
|
||||
addColorPicker('color-1', '#FF0000');
|
||||
addColorPicker('color-2', '#00FF00');
|
||||
```
|
||||
|
||||
## Styling
|
||||
|
||||
The colour picker uses CSS classes that can be customized:
|
||||
|
||||
- `.color-picker-container` - Main container
|
||||
- `.color-picker-preview` - Colour preview button
|
||||
- `.color-picker-panel` - Dropdown panel
|
||||
- `.color-picker-main` - Main colour area
|
||||
- `.color-picker-hue` - Hue slider
|
||||
- `.color-picker-controls` - Controls section
|
||||
|
||||
### Custom Styling Example
|
||||
|
||||
```css
|
||||
.color-picker-preview {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.color-picker-panel {
|
||||
background: #2d3748;
|
||||
border-color: #4a5568;
|
||||
}
|
||||
```
|
||||
|
||||
## Browser Compatibility
|
||||
|
||||
| Browser | Version | Status |
|
||||
|---------|---------|--------|
|
||||
| Chrome | 60+ | ✅ Full support |
|
||||
| Firefox | 55+ | ✅ Full support |
|
||||
| Safari | 12+ | ✅ Full support |
|
||||
| Edge | 79+ | ✅ Full support |
|
||||
| Opera | 47+ | ✅ Full support |
|
||||
| Mobile Safari | iOS 12+ | ✅ Full support |
|
||||
| Chrome Mobile | Android 7+ | ✅ Full support |
|
||||
|
||||
## Operating System Compatibility
|
||||
|
||||
- ✅ Windows 10/11
|
||||
- ✅ macOS 10.14+
|
||||
- ✅ Linux (all major distributions)
|
||||
- ✅ iOS 12+
|
||||
- ✅ Android 7+
|
||||
|
||||
## Colour Format
|
||||
|
||||
The colour picker uses **hex colour format** (`#RRGGBB`):
|
||||
- Always returns uppercase hex strings (e.g., `#FF0000`)
|
||||
- Accepts both uppercase and lowercase input
|
||||
- Automatically validates hex format
|
||||
|
||||
## Integration with LED Driver Mockups
|
||||
|
||||
The colour picker is integrated into:
|
||||
- `dashboard.html` - Colour selection for patterns
|
||||
- `presets.html` - Colour selection when creating/editing presets
|
||||
|
||||
### Example: Getting Colours from Multiple Pickers
|
||||
|
||||
```javascript
|
||||
const colorPickers = [];
|
||||
|
||||
function getSelectedColors() {
|
||||
return colorPickers.map(picker => picker.getColor());
|
||||
}
|
||||
|
||||
function sendColorsToDevice() {
|
||||
const colors = getSelectedColors();
|
||||
// Send to LED device via API
|
||||
fetch('/api/colors', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ colors: colors })
|
||||
});
|
||||
}
|
||||
```
|
||||
|
||||
## Performance
|
||||
|
||||
- Lightweight: ~14KB JavaScript, ~4KB CSS
|
||||
- Fast rendering: Uses Canvas API for colour gradients
|
||||
- Smooth interactions: Optimized event handling
|
||||
- Memory efficient: No external dependencies
|
||||
|
||||
## Accessibility
|
||||
|
||||
- Keyboard navigation support
|
||||
- ARIA labels on interactive elements
|
||||
- High contrast cursor indicators
|
||||
- Screen reader compatible
|
||||
|
||||
## License
|
||||
|
||||
Part of the LED Driver project. Use freely in your projects.
|
||||
|
||||
## Demo
|
||||
|
||||
See `color-picker-demo.html` for a live demonstration of the colour picker component.
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
# UI Mockups
|
||||
|
||||
This directory contains HTML mockups and generated images for the LED Driver user interface.
|
||||
|
||||
## Files
|
||||
|
||||
### HTML Mockups
|
||||
- **index.html** - Navigation page linking to all mockups
|
||||
- **dashboard.html** - Main control panel for managing LED patterns and devices
|
||||
- **pattern-selector.html** - Visual pattern selection interface
|
||||
- **device-management.html** - Device and group management interface
|
||||
- **settings.html** - Comprehensive settings configuration panel
|
||||
|
||||
### Generated Images
|
||||
Images are automatically generated in the `images/` directory:
|
||||
- `dashboard.png`
|
||||
- `pattern-selector.png`
|
||||
- `device-management.png`
|
||||
- `settings.png`
|
||||
- `index.png`
|
||||
|
||||
## Generating Images
|
||||
|
||||
To generate images from the HTML files, use the provided script:
|
||||
|
||||
```bash
|
||||
# Install dependencies (if not already installed)
|
||||
pipenv install playwright
|
||||
pipenv run playwright install chromium
|
||||
|
||||
# Generate images
|
||||
pipenv run python generate_images.py
|
||||
```
|
||||
|
||||
The script will:
|
||||
1. Check for available screenshot libraries (Playwright, Selenium, or html2image)
|
||||
2. Generate PNG images from all HTML files
|
||||
3. Save images to the `images/` directory
|
||||
|
||||
### Requirements
|
||||
|
||||
The script supports multiple screenshot libraries (in order of preference):
|
||||
1. **Playwright** (recommended) - `pip install playwright && playwright install chromium`
|
||||
2. **Selenium** - `pip install selenium` (requires ChromeDriver)
|
||||
3. **html2image** - `pip install html2image`
|
||||
|
||||
## Viewing Mockups
|
||||
|
||||
Simply open any HTML file in a web browser to view the mockup. Start with `index.html` for navigation to all mockups.
|
||||
|
||||
## Notes
|
||||
|
||||
- All mockups are responsive and work on desktop and mobile devices
|
||||
- The mockups use modern CSS with gradients and smooth animations
|
||||
- Interactive elements (buttons, sliders, etc.) are functional in the HTML but are mockups (no backend connection)
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Chromium Color Picker Demo</title>
|
||||
<link rel="stylesheet" href="color-picker-chromium.css">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&family=Roboto+Mono&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
min-height: 100vh;
|
||||
padding: 40px 20px;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 40px;
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #202124;
|
||||
margin-bottom: 8px;
|
||||
font-weight: 400;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
p {
|
||||
color: #5f6368;
|
||||
margin-bottom: 32px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.demo-section {
|
||||
margin-bottom: 40px;
|
||||
padding: 24px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e8eaed;
|
||||
}
|
||||
|
||||
.demo-section h2 {
|
||||
color: #202124;
|
||||
margin-bottom: 16px;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.color-pickers {
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.color-display {
|
||||
margin-top: 16px;
|
||||
padding: 12px;
|
||||
background: white;
|
||||
border-radius: 6px;
|
||||
font-family: 'Roboto Mono', 'Courier New', monospace;
|
||||
font-size: 13px;
|
||||
border: 1px solid #e8eaed;
|
||||
}
|
||||
|
||||
.color-display strong {
|
||||
color: #4285f4;
|
||||
}
|
||||
|
||||
.comparison {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 24px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.comparison-item {
|
||||
padding: 16px;
|
||||
background: white;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #e8eaed;
|
||||
}
|
||||
|
||||
.comparison-item h3 {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #202124;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Chromium-style Color Picker</h1>
|
||||
<p>Color picker that matches the native Chromium browser color picker design</p>
|
||||
|
||||
<div class="demo-section">
|
||||
<h2>Single Color Picker</h2>
|
||||
<div class="color-pickers">
|
||||
<div id="picker1"></div>
|
||||
</div>
|
||||
<div class="color-display">
|
||||
Selected color: <strong id="color1-display">#FF0000</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="demo-section">
|
||||
<h2>Multiple Color Pickers</h2>
|
||||
<p style="margin-bottom: 16px; color: #5f6368; font-size: 14px;">Example: Multiple colors for LED patterns</p>
|
||||
<div class="color-pickers">
|
||||
<div id="picker2"></div>
|
||||
<div id="picker3"></div>
|
||||
<div id="picker4"></div>
|
||||
</div>
|
||||
<div class="color-display">
|
||||
Colors: <strong id="colors-display">#FF0000, #00FF00, #0000FF</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="demo-section">
|
||||
<h2>Features</h2>
|
||||
<ul style="color: #5f6368; line-height: 1.8; font-size: 14px;">
|
||||
<li>✅ Matches native Chromium browser color picker design</li>
|
||||
<li>✅ Clean, minimal interface with native system fonts</li>
|
||||
<li>✅ RGB number inputs (no sliders) - Chromium style</li>
|
||||
<li>✅ Hex input with uppercase formatting</li>
|
||||
<li>✅ HSB (Hue, Saturation, Brightness) color model</li>
|
||||
<li>✅ Touch support for mobile devices</li>
|
||||
<li>✅ Keyboard accessible</li>
|
||||
<li>✅ Dark mode support</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="demo-section">
|
||||
<h2>Design Notes</h2>
|
||||
<div class="comparison">
|
||||
<div class="comparison-item">
|
||||
<h3>Chromium Style</h3>
|
||||
<ul style="color: #5f6368; line-height: 1.8; font-size: 13px; list-style: none; padding-left: 0;">
|
||||
<li>• RGB number inputs only</li>
|
||||
<li>• Compact preview button</li>
|
||||
<li>• Native system fonts</li>
|
||||
<li>• Minimal borders and shadows</li>
|
||||
<li>• Chromium color scheme</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="comparison-item">
|
||||
<h3>Standard Style</h3>
|
||||
<ul style="color: #5f6368; line-height: 1.8; font-size: 13px; list-style: none; padding-left: 0;">
|
||||
<li>• RGB sliders + inputs</li>
|
||||
<li>• Larger preview button</li>
|
||||
<li>• Custom styling</li>
|
||||
<li>• Enhanced shadows</li>
|
||||
<li>• Custom color scheme</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="color-picker-chromium.js"></script>
|
||||
<script>
|
||||
// Initialize Chromium-style color pickers
|
||||
const picker1 = new ColorPickerChromium('#picker1', {
|
||||
initialColor: '#FF0000',
|
||||
onColorChange: (color) => {
|
||||
document.getElementById('color1-display').textContent = color;
|
||||
}
|
||||
});
|
||||
|
||||
const picker2 = new ColorPickerChromium('#picker2', {
|
||||
initialColor: '#FF0000',
|
||||
onColorChange: updateColors
|
||||
});
|
||||
|
||||
const picker3 = new ColorPickerChromium('#picker3', {
|
||||
initialColor: '#00FF00',
|
||||
onColorChange: updateColors
|
||||
});
|
||||
|
||||
const picker4 = new ColorPickerChromium('#picker4', {
|
||||
initialColor: '#0000FF',
|
||||
onColorChange: updateColors
|
||||
});
|
||||
|
||||
function updateColors() {
|
||||
const colors = [
|
||||
picker2.getColor(),
|
||||
picker3.getColor(),
|
||||
picker4.getColor()
|
||||
];
|
||||
document.getElementById('colors-display').textContent = colors.join(', ');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,253 @@
|
||||
/* Chromium-style Color Picker - Matches native browser color picker dialog */
|
||||
|
||||
.color-picker-container {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* Preview button - opens the picker */
|
||||
.color-picker-preview {
|
||||
width: 40px;
|
||||
height: 32px;
|
||||
border: 1px solid #d0d0d0;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
background: none;
|
||||
transition: border-color 0.15s;
|
||||
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.color-picker-preview:hover {
|
||||
border-color: #8ab4f8;
|
||||
}
|
||||
|
||||
.color-picker-preview:active {
|
||||
border-color: #4285f4;
|
||||
}
|
||||
|
||||
/* Main picker panel - always visible when open, styled like Chromium dialog */
|
||||
.color-picker-panel {
|
||||
position: absolute;
|
||||
top: calc(100% + 4px);
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
background: #ffffff;
|
||||
border: 1px solid #dadce0;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1);
|
||||
padding: 16px;
|
||||
min-width: 260px;
|
||||
font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* Color area - main saturation/brightness square + hue slider */
|
||||
.color-picker-area {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
/* Main color square - saturation (left-right) and brightness (top-bottom) */
|
||||
.color-picker-main {
|
||||
position: relative;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
border: 1px solid #dadce0;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
cursor: crosshair;
|
||||
touch-action: none;
|
||||
background: #ffffff;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.color-picker-canvas {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
}
|
||||
|
||||
/* Cursor for main color area */
|
||||
.color-picker-cursor {
|
||||
position: absolute;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border: 2px solid #ffffff;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
pointer-events: none;
|
||||
transform: translate(-50%, -50%);
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
/* Hue slider - vertical strip on the right */
|
||||
.color-picker-hue {
|
||||
position: relative;
|
||||
width: 24px;
|
||||
height: 200px;
|
||||
border: 1px solid #dadce0;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
touch-action: none;
|
||||
background: #ffffff;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* Hue slider cursor/indicator */
|
||||
.color-picker-hue-cursor {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 6px;
|
||||
border: 2px solid #ffffff;
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);
|
||||
pointer-events: none;
|
||||
transform: translateY(-50%);
|
||||
top: 0;
|
||||
}
|
||||
|
||||
/* Controls section - hex and RGB inputs */
|
||||
.color-picker-controls {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
/* Hex input field */
|
||||
.color-picker-hex {
|
||||
width: 100%;
|
||||
padding: 7px 10px;
|
||||
border: 1px solid #dadce0;
|
||||
border-radius: 4px;
|
||||
font-family: 'Roboto Mono', 'Courier New', monospace;
|
||||
font-size: 13px;
|
||||
text-transform: uppercase;
|
||||
transition: border-color 0.15s, box-shadow 0.15s;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.color-picker-hex:focus {
|
||||
outline: none;
|
||||
border-color: #4285f4;
|
||||
box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
|
||||
}
|
||||
|
||||
/* RGB inputs container */
|
||||
.color-picker-rgb {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.color-picker-rgb-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.color-picker-rgb-item label {
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
color: #5f6368;
|
||||
text-align: left;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
/* RGB number input fields */
|
||||
.color-picker-rgb-input {
|
||||
width: 100%;
|
||||
padding: 7px 10px;
|
||||
border: 1px solid #dadce0;
|
||||
border-radius: 4px;
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
transition: border-color 0.15s, box-shadow 0.15s;
|
||||
background: #ffffff;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
|
||||
.color-picker-rgb-input::-webkit-outer-spin-button,
|
||||
.color-picker-rgb-input::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.color-picker-rgb-input:focus {
|
||||
outline: none;
|
||||
border-color: #4285f4;
|
||||
box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
|
||||
}
|
||||
|
||||
/* Hide RGB sliders - Chromium uses only number inputs */
|
||||
.color-picker-rgb-slider {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Responsive adjustments */
|
||||
@media (max-width: 480px) {
|
||||
.color-picker-panel {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.color-picker-main {
|
||||
width: 180px;
|
||||
height: 180px;
|
||||
}
|
||||
|
||||
.color-picker-hue {
|
||||
height: 180px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dark mode support */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.color-picker-panel {
|
||||
background: #202124;
|
||||
border-color: #5f6368;
|
||||
}
|
||||
|
||||
.color-picker-preview {
|
||||
border-color: #5f6368;
|
||||
}
|
||||
|
||||
.color-picker-main,
|
||||
.color-picker-hue {
|
||||
border-color: #5f6368;
|
||||
background: #202124;
|
||||
}
|
||||
|
||||
.color-picker-hex,
|
||||
.color-picker-rgb-input {
|
||||
background: #303134;
|
||||
border-color: #5f6368;
|
||||
color: #e8eaed;
|
||||
}
|
||||
|
||||
.color-picker-rgb-item label {
|
||||
color: #9aa0a6;
|
||||
}
|
||||
|
||||
.color-picker-hex:focus,
|
||||
.color-picker-rgb-input:focus {
|
||||
border-color: #8ab4f8;
|
||||
box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.2);
|
||||
}
|
||||
|
||||
.color-picker-preview:hover {
|
||||
border-color: #8ab4f8;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,452 @@
|
||||
/**
|
||||
* Chromium-style Color Picker Component
|
||||
* Matches native Chromium browser color picker design
|
||||
*/
|
||||
|
||||
class ColorPickerChromium {
|
||||
constructor(container, options = {}) {
|
||||
this.container = typeof container === 'string' ? document.querySelector(container) : container;
|
||||
this.options = {
|
||||
initialColor: options.initialColor || '#FF0000',
|
||||
onColorChange: options.onColorChange || null,
|
||||
showHexInput: options.showHexInput !== false,
|
||||
...options
|
||||
};
|
||||
this.currentColor = this.options.initialColor;
|
||||
this.isOpen = false;
|
||||
this.init();
|
||||
}
|
||||
|
||||
init() {
|
||||
this.createPicker();
|
||||
this.setupEventListeners();
|
||||
this.updateColor(this.options.initialColor);
|
||||
}
|
||||
|
||||
createPicker() {
|
||||
this.container.innerHTML = '';
|
||||
this.container.className = 'color-picker-container';
|
||||
|
||||
// Color preview button
|
||||
this.previewBtn = document.createElement('button');
|
||||
this.previewBtn.className = 'color-picker-preview';
|
||||
this.previewBtn.type = 'button';
|
||||
this.previewBtn.style.backgroundColor = this.currentColor;
|
||||
this.previewBtn.setAttribute('aria-label', 'Open color picker');
|
||||
|
||||
// Dropdown panel
|
||||
this.panel = document.createElement('div');
|
||||
this.panel.className = 'color-picker-panel';
|
||||
this.panel.style.display = 'none';
|
||||
|
||||
// Main color area (hue/saturation)
|
||||
this.mainArea = document.createElement('div');
|
||||
this.mainArea.className = 'color-picker-main';
|
||||
this.mainCanvas = document.createElement('canvas');
|
||||
this.mainCanvas.width = 200;
|
||||
this.mainCanvas.height = 200;
|
||||
this.mainCanvas.className = 'color-picker-canvas';
|
||||
this.mainArea.appendChild(this.mainCanvas);
|
||||
|
||||
// Main area cursor
|
||||
this.mainCursor = document.createElement('div');
|
||||
this.mainCursor.className = 'color-picker-cursor';
|
||||
this.mainArea.appendChild(this.mainCursor);
|
||||
|
||||
// Hue slider
|
||||
this.hueArea = document.createElement('div');
|
||||
this.hueArea.className = 'color-picker-hue';
|
||||
this.hueCanvas = document.createElement('canvas');
|
||||
this.hueCanvas.width = 24;
|
||||
this.hueCanvas.height = 200;
|
||||
this.hueCanvas.className = 'color-picker-canvas';
|
||||
this.hueArea.appendChild(this.hueCanvas);
|
||||
|
||||
// Hue slider cursor
|
||||
this.hueCursor = document.createElement('div');
|
||||
this.hueCursor.className = 'color-picker-hue-cursor';
|
||||
this.hueArea.appendChild(this.hueCursor);
|
||||
|
||||
// Controls section
|
||||
this.controls = document.createElement('div');
|
||||
this.controls.className = 'color-picker-controls';
|
||||
|
||||
// Hex input
|
||||
if (this.options.showHexInput) {
|
||||
this.hexInput = document.createElement('input');
|
||||
this.hexInput.type = 'text';
|
||||
this.hexInput.className = 'color-picker-hex';
|
||||
this.hexInput.placeholder = '#000000';
|
||||
this.hexInput.maxLength = 7;
|
||||
this.controls.appendChild(this.hexInput);
|
||||
}
|
||||
|
||||
// RGB inputs (Chromium style - no sliders, just number inputs)
|
||||
this.rgbContainer = document.createElement('div');
|
||||
this.rgbContainer.className = 'color-picker-rgb';
|
||||
|
||||
['R', 'G', 'B'].forEach((label) => {
|
||||
const wrapper = document.createElement('div');
|
||||
wrapper.className = 'color-picker-rgb-item';
|
||||
wrapper.dataset.channel = label.toLowerCase();
|
||||
|
||||
const labelEl = document.createElement('label');
|
||||
labelEl.textContent = label;
|
||||
|
||||
const input = document.createElement('input');
|
||||
input.type = 'number';
|
||||
input.className = 'color-picker-rgb-input';
|
||||
input.min = 0;
|
||||
input.max = 255;
|
||||
input.value = 0;
|
||||
input.dataset.channel = label.toLowerCase();
|
||||
|
||||
wrapper.appendChild(labelEl);
|
||||
wrapper.appendChild(input);
|
||||
this.rgbContainer.appendChild(wrapper);
|
||||
|
||||
this[`rgb${label}`] = input;
|
||||
});
|
||||
|
||||
this.controls.appendChild(this.rgbContainer);
|
||||
|
||||
// Assemble panel
|
||||
const pickerArea = document.createElement('div');
|
||||
pickerArea.className = 'color-picker-area';
|
||||
pickerArea.appendChild(this.mainArea);
|
||||
pickerArea.appendChild(this.hueArea);
|
||||
|
||||
this.panel.appendChild(pickerArea);
|
||||
this.panel.appendChild(this.controls);
|
||||
|
||||
// Assemble container
|
||||
this.container.appendChild(this.previewBtn);
|
||||
this.container.appendChild(this.panel);
|
||||
|
||||
// Draw canvases
|
||||
this.drawHueCanvas();
|
||||
this.drawMainCanvas(1.0); // Start with full saturation
|
||||
}
|
||||
|
||||
setupEventListeners() {
|
||||
// Toggle panel
|
||||
this.previewBtn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
this.toggle();
|
||||
});
|
||||
|
||||
// Close on outside click
|
||||
document.addEventListener('click', (e) => {
|
||||
if (!this.container.contains(e.target) && this.isOpen) {
|
||||
this.close();
|
||||
}
|
||||
});
|
||||
|
||||
// Main area interaction
|
||||
let isMainDragging = false;
|
||||
this.mainCanvas.addEventListener('mousedown', (e) => {
|
||||
isMainDragging = true;
|
||||
this.handleMainAreaClick(e);
|
||||
});
|
||||
this.mainCanvas.addEventListener('mousemove', (e) => {
|
||||
if (isMainDragging) {
|
||||
this.handleMainAreaClick(e);
|
||||
}
|
||||
});
|
||||
document.addEventListener('mouseup', () => {
|
||||
isMainDragging = false;
|
||||
});
|
||||
|
||||
// Touch support for main area
|
||||
this.mainCanvas.addEventListener('touchstart', (e) => {
|
||||
e.preventDefault();
|
||||
isMainDragging = true;
|
||||
this.handleMainAreaClick(e.touches[0]);
|
||||
});
|
||||
this.mainCanvas.addEventListener('touchmove', (e) => {
|
||||
e.preventDefault();
|
||||
if (isMainDragging) {
|
||||
this.handleMainAreaClick(e.touches[0]);
|
||||
}
|
||||
});
|
||||
this.mainCanvas.addEventListener('touchend', () => {
|
||||
isMainDragging = false;
|
||||
});
|
||||
|
||||
// Hue slider interaction
|
||||
let isHueDragging = false;
|
||||
this.hueCanvas.addEventListener('mousedown', (e) => {
|
||||
isHueDragging = true;
|
||||
this.handleHueClick(e);
|
||||
});
|
||||
this.hueCanvas.addEventListener('mousemove', (e) => {
|
||||
if (isHueDragging) {
|
||||
this.handleHueClick(e);
|
||||
}
|
||||
});
|
||||
document.addEventListener('mouseup', () => {
|
||||
isHueDragging = false;
|
||||
});
|
||||
|
||||
// Touch support for hue slider
|
||||
this.hueCanvas.addEventListener('touchstart', (e) => {
|
||||
e.preventDefault();
|
||||
isHueDragging = true;
|
||||
this.handleHueClick(e.touches[0]);
|
||||
});
|
||||
this.hueCanvas.addEventListener('touchmove', (e) => {
|
||||
e.preventDefault();
|
||||
if (isHueDragging) {
|
||||
this.handleHueClick(e.touches[0]);
|
||||
}
|
||||
});
|
||||
this.hueCanvas.addEventListener('touchend', () => {
|
||||
isHueDragging = false;
|
||||
});
|
||||
|
||||
// Hex input
|
||||
if (this.hexInput) {
|
||||
this.hexInput.addEventListener('input', (e) => {
|
||||
const value = e.target.value;
|
||||
if (/^#[0-9A-Fa-f]{6}$/.test(value)) {
|
||||
this.updateColor(value);
|
||||
}
|
||||
});
|
||||
this.hexInput.addEventListener('blur', (e) => {
|
||||
const value = e.target.value;
|
||||
if (!/^#[0-9A-Fa-f]{6}$/.test(value) && value.length > 0) {
|
||||
e.target.value = this.currentColor;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// RGB inputs (Chromium style - only number inputs)
|
||||
['R', 'G', 'B'].forEach(label => {
|
||||
this[`rgb${label}`].addEventListener('input', (e) => {
|
||||
let value = parseInt(e.target.value) || 0;
|
||||
value = Math.max(0, Math.min(255, value)); // Clamp to 0-255
|
||||
e.target.value = value;
|
||||
const r = parseInt(this.rgbR.value) || 0;
|
||||
const g = parseInt(this.rgbG.value) || 0;
|
||||
const b = parseInt(this.rgbB.value) || 0;
|
||||
const hex = this.rgbToHex(r, g, b);
|
||||
this.updateColor(hex, false); // Don't update RGB inputs to avoid loop
|
||||
});
|
||||
|
||||
this[`rgb${label}`].addEventListener('blur', (e) => {
|
||||
let value = parseInt(e.target.value) || 0;
|
||||
value = Math.max(0, Math.min(255, value));
|
||||
e.target.value = value;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
drawHueCanvas() {
|
||||
const ctx = this.hueCanvas.getContext('2d');
|
||||
const gradient = ctx.createLinearGradient(0, 0, 0, 200);
|
||||
|
||||
for (let i = 0; i <= 6; i++) {
|
||||
const hue = i * 60;
|
||||
gradient.addColorStop(i / 6, `hsl(${hue}, 100%, 50%)`);
|
||||
}
|
||||
|
||||
ctx.fillStyle = gradient;
|
||||
ctx.fillRect(0, 0, 24, 200);
|
||||
}
|
||||
|
||||
drawMainCanvas(hue) {
|
||||
const ctx = this.mainCanvas.getContext('2d');
|
||||
|
||||
// Saturation gradient (left to right)
|
||||
const satGradient = ctx.createLinearGradient(0, 0, 200, 0);
|
||||
satGradient.addColorStop(0, `hsl(${hue}, 0%, 50%)`);
|
||||
satGradient.addColorStop(1, `hsl(${hue}, 100%, 50%)`);
|
||||
ctx.fillStyle = satGradient;
|
||||
ctx.fillRect(0, 0, 200, 200);
|
||||
|
||||
// Brightness gradient (top to bottom)
|
||||
const brightGradient = ctx.createLinearGradient(0, 0, 0, 200);
|
||||
brightGradient.addColorStop(0, 'rgba(255, 255, 255, 0)');
|
||||
brightGradient.addColorStop(1, 'rgba(0, 0, 0, 1)');
|
||||
ctx.fillStyle = brightGradient;
|
||||
ctx.fillRect(0, 0, 200, 200);
|
||||
}
|
||||
|
||||
handleMainAreaClick(e) {
|
||||
const rect = this.mainCanvas.getBoundingClientRect();
|
||||
const x = Math.max(0, Math.min(200, e.clientX - rect.left));
|
||||
const y = Math.max(0, Math.min(200, e.clientY - rect.top));
|
||||
|
||||
const saturation = x / 200;
|
||||
const brightness = 1 - (y / 200);
|
||||
|
||||
this.updateColorFromHSB(this.hue, saturation, brightness);
|
||||
this.updateCursor(x, y);
|
||||
}
|
||||
|
||||
handleHueClick(e) {
|
||||
const rect = this.hueCanvas.getBoundingClientRect();
|
||||
const y = Math.max(0, Math.min(200, e.clientY - rect.top));
|
||||
const hue = (y / 200) * 360;
|
||||
|
||||
this.hue = hue;
|
||||
this.drawMainCanvas(hue);
|
||||
this.updateHueCursor(y);
|
||||
|
||||
// Recalculate color with new hue
|
||||
const rect2 = this.mainCanvas.getBoundingClientRect();
|
||||
const x = parseFloat(this.mainCursor.style.left) || 0;
|
||||
const y2 = parseFloat(this.mainCursor.style.top) || 0;
|
||||
const saturation = x / 200;
|
||||
const brightness = 1 - (y2 / 200);
|
||||
this.updateColorFromHSB(hue, saturation, brightness);
|
||||
}
|
||||
|
||||
updateColorFromHSB(h, s, v) {
|
||||
const rgb = this.hsbToRgb(h, s, v);
|
||||
const hex = this.rgbToHex(rgb.r, rgb.g, rgb.b);
|
||||
this.updateColor(hex);
|
||||
}
|
||||
|
||||
hsbToRgb(h, s, v) {
|
||||
h = h / 360;
|
||||
const i = Math.floor(h * 6);
|
||||
const f = h * 6 - i;
|
||||
const p = v * (1 - s);
|
||||
const q = v * (1 - f * s);
|
||||
const t = v * (1 - (1 - f) * s);
|
||||
|
||||
let r, g, b;
|
||||
switch (i % 6) {
|
||||
case 0: r = v; g = t; b = p; break;
|
||||
case 1: r = q; g = v; b = p; break;
|
||||
case 2: r = p; g = v; b = t; break;
|
||||
case 3: r = p; g = q; b = v; break;
|
||||
case 4: r = t; g = p; b = v; break;
|
||||
case 5: r = v; g = p; b = q; break;
|
||||
}
|
||||
|
||||
return {
|
||||
r: Math.round(r * 255),
|
||||
g: Math.round(g * 255),
|
||||
b: Math.round(b * 255)
|
||||
};
|
||||
}
|
||||
|
||||
rgbToHex(r, g, b) {
|
||||
return '#' + [r, g, b].map(x => {
|
||||
const hex = x.toString(16);
|
||||
return hex.length === 1 ? '0' + hex : hex;
|
||||
}).join('').toUpperCase();
|
||||
}
|
||||
|
||||
hexToRgb(hex) {
|
||||
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
||||
return result ? {
|
||||
r: parseInt(result[1], 16),
|
||||
g: parseInt(result[2], 16),
|
||||
b: parseInt(result[3], 16)
|
||||
} : null;
|
||||
}
|
||||
|
||||
rgbToHsb(r, g, b) {
|
||||
r /= 255;
|
||||
g /= 255;
|
||||
b /= 255;
|
||||
|
||||
const max = Math.max(r, g, b);
|
||||
const min = Math.min(r, g, b);
|
||||
const diff = max - min;
|
||||
|
||||
let h = 0;
|
||||
if (diff !== 0) {
|
||||
if (max === r) {
|
||||
h = ((g - b) / diff) % 6) * 60;
|
||||
} else if (max === g) {
|
||||
h = ((b - r) / diff + 2) * 60;
|
||||
} else {
|
||||
h = ((r - g) / diff + 4) * 60;
|
||||
}
|
||||
}
|
||||
if (h < 0) h += 360;
|
||||
|
||||
const s = max === 0 ? 0 : diff / max;
|
||||
const v = max;
|
||||
|
||||
return { h, s, v };
|
||||
}
|
||||
|
||||
updateColor(hex, updateInputs = true) {
|
||||
this.currentColor = hex.toUpperCase();
|
||||
this.previewBtn.style.backgroundColor = this.currentColor;
|
||||
|
||||
const rgb = this.hexToRgb(this.currentColor);
|
||||
if (!rgb) return;
|
||||
|
||||
const hsb = this.rgbToHsb(rgb.r, rgb.g, rgb.b);
|
||||
this.hue = hsb.h;
|
||||
|
||||
// Update main canvas
|
||||
this.drawMainCanvas(this.hue);
|
||||
|
||||
// Update cursors
|
||||
const x = hsb.s * 200;
|
||||
const y = (1 - hsb.v) * 200;
|
||||
this.updateCursor(x, y);
|
||||
this.updateHueCursor((this.hue / 360) * 200);
|
||||
|
||||
// Update inputs
|
||||
if (updateInputs) {
|
||||
if (this.hexInput) {
|
||||
this.hexInput.value = this.currentColor;
|
||||
}
|
||||
if (this.rgbR) {
|
||||
this.rgbR.value = rgb.r;
|
||||
this.rgbG.value = rgb.g;
|
||||
this.rgbB.value = rgb.b;
|
||||
}
|
||||
}
|
||||
|
||||
// Callback
|
||||
if (this.options.onColorChange) {
|
||||
this.options.onColorChange(this.currentColor);
|
||||
}
|
||||
}
|
||||
|
||||
updateCursor(x, y) {
|
||||
this.mainCursor.style.left = `${x}px`;
|
||||
this.mainCursor.style.top = `${y}px`;
|
||||
}
|
||||
|
||||
updateHueCursor(y) {
|
||||
this.hueCursor.style.top = `${y}px`;
|
||||
}
|
||||
|
||||
toggle() {
|
||||
this.isOpen ? this.close() : this.open();
|
||||
}
|
||||
|
||||
open() {
|
||||
this.panel.style.display = 'block';
|
||||
this.isOpen = true;
|
||||
}
|
||||
|
||||
close() {
|
||||
this.panel.style.display = 'none';
|
||||
this.isOpen = false;
|
||||
}
|
||||
|
||||
getColor() {
|
||||
return this.currentColor;
|
||||
}
|
||||
|
||||
setColor(color) {
|
||||
this.updateColor(color);
|
||||
}
|
||||
}
|
||||
|
||||
// Export for use in other scripts
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = ColorPickerChromium;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Color Picker Demo - Cross-Platform</title>
|
||||
<link rel="stylesheet" href="color-picker.css">
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
min-height: 100vh;
|
||||
padding: 40px 20px;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 40px;
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #667eea;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
p {
|
||||
color: #666;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.demo-section {
|
||||
margin-bottom: 40px;
|
||||
padding: 24px;
|
||||
background: #f7fafc;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.demo-section h2 {
|
||||
color: #333;
|
||||
margin-bottom: 16px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.color-pickers {
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.color-display {
|
||||
margin-top: 16px;
|
||||
padding: 12px;
|
||||
background: white;
|
||||
border-radius: 6px;
|
||||
font-family: 'Courier New', monospace;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.color-display strong {
|
||||
color: #667eea;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Custom Color Picker</h1>
|
||||
<p>Consistent color picker that works the same across all operating systems and browsers</p>
|
||||
|
||||
<div class="demo-section">
|
||||
<h2>Single Color Picker</h2>
|
||||
<div class="color-pickers">
|
||||
<div id="picker1"></div>
|
||||
</div>
|
||||
<div class="color-display">
|
||||
Selected color: <strong id="color1-display">#FF0000</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="demo-section">
|
||||
<h2>Multiple Color Pickers</h2>
|
||||
<p style="margin-bottom: 16px;">Example: Multiple colors for LED patterns</p>
|
||||
<div class="color-pickers">
|
||||
<div id="picker2"></div>
|
||||
<div id="picker3"></div>
|
||||
<div id="picker4"></div>
|
||||
</div>
|
||||
<div class="color-display">
|
||||
Colors: <strong id="colors-display">#FF0000, #00FF00, #0000FF</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="demo-section">
|
||||
<h2>Features</h2>
|
||||
<ul style="color: #666; line-height: 1.8;">
|
||||
<li>✅ Consistent UI across Windows, macOS, Linux, iOS, Android</li>
|
||||
<li>✅ Works in Chrome, Firefox, Safari, Edge, Opera</li>
|
||||
<li>✅ Touch support for mobile devices</li>
|
||||
<li>✅ HSB (Hue, Saturation, Brightness) color model</li>
|
||||
<li>✅ Hex and RGB input support</li>
|
||||
<li>✅ Keyboard accessible</li>
|
||||
<li>✅ Customizable styling</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="color-picker.js"></script>
|
||||
<script>
|
||||
// Initialize color pickers
|
||||
const picker1 = new ColorPicker('#picker1', {
|
||||
initialColor: '#FF0000',
|
||||
onColorChange: (color) => {
|
||||
document.getElementById('color1-display').textContent = color;
|
||||
}
|
||||
});
|
||||
|
||||
const picker2 = new ColorPicker('#picker2', {
|
||||
initialColor: '#FF0000',
|
||||
onColorChange: updateColors
|
||||
});
|
||||
|
||||
const picker3 = new ColorPicker('#picker3', {
|
||||
initialColor: '#00FF00',
|
||||
onColorChange: updateColors
|
||||
});
|
||||
|
||||
const picker4 = new ColorPicker('#picker4', {
|
||||
initialColor: '#0000FF',
|
||||
onColorChange: updateColors
|
||||
});
|
||||
|
||||
function updateColors() {
|
||||
const colors = [
|
||||
picker2.getColor(),
|
||||
picker3.getColor(),
|
||||
picker4.getColor()
|
||||
];
|
||||
document.getElementById('colors-display').textContent = colors.join(', ');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,282 @@
|
||||
/* Color Picker Styles - Consistent across all browsers and OS */
|
||||
|
||||
.color-picker-container {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.color-picker-preview {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border: 2px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
background: none;
|
||||
transition: all 0.2s;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.color-picker-preview:hover {
|
||||
border-color: #667eea;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.color-picker-preview:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.color-picker-panel {
|
||||
position: absolute;
|
||||
top: calc(100% + 8px);
|
||||
left: 0;
|
||||
z-index: 1000;
|
||||
background: white;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
|
||||
padding: 16px;
|
||||
min-width: 280px;
|
||||
}
|
||||
|
||||
.color-picker-area {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.color-picker-main {
|
||||
position: relative;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
cursor: crosshair;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
.color-picker-canvas {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
}
|
||||
|
||||
.color-picker-cursor {
|
||||
position: absolute;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border: 2px solid white;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
|
||||
pointer-events: none;
|
||||
transform: translate(-50%, -50%);
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.color-picker-hue {
|
||||
position: relative;
|
||||
width: 20px;
|
||||
height: 200px;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
.color-picker-hue-cursor {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
height: 4px;
|
||||
border: 2px solid white;
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
|
||||
pointer-events: none;
|
||||
transform: translateY(-50%);
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.color-picker-controls {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.color-picker-hex {
|
||||
width: 100%;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 6px;
|
||||
font-family: 'Courier New', monospace;
|
||||
font-size: 0.875rem;
|
||||
text-transform: uppercase;
|
||||
transition: border-color 0.2s;
|
||||
}
|
||||
|
||||
.color-picker-hex:focus {
|
||||
outline: none;
|
||||
border-color: #667eea;
|
||||
}
|
||||
|
||||
.color-picker-rgb {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.color-picker-rgb-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.color-picker-rgb-item label {
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.color-picker-rgb-slider {
|
||||
width: 100%;
|
||||
height: 6px;
|
||||
border-radius: 3px;
|
||||
background: #e0e0e0;
|
||||
outline: none;
|
||||
-webkit-appearance: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.color-picker-rgb-slider::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 50%;
|
||||
background: #667eea;
|
||||
cursor: pointer;
|
||||
border: 2px solid white;
|
||||
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.color-picker-rgb-slider::-webkit-slider-thumb:hover {
|
||||
transform: scale(1.1);
|
||||
box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
|
||||
}
|
||||
|
||||
.color-picker-rgb-slider::-moz-range-thumb {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 50%;
|
||||
background: #667eea;
|
||||
cursor: pointer;
|
||||
border: 2px solid white;
|
||||
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.color-picker-rgb-slider::-moz-range-thumb:hover {
|
||||
transform: scale(1.1);
|
||||
box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
|
||||
}
|
||||
|
||||
/* Color-specific slider backgrounds */
|
||||
.color-picker-rgb-item[data-channel="r"] .color-picker-rgb-slider {
|
||||
background: linear-gradient(to right, #000000, #ff0000);
|
||||
}
|
||||
|
||||
.color-picker-rgb-item[data-channel="g"] .color-picker-rgb-slider {
|
||||
background: linear-gradient(to right, #000000, #00ff00);
|
||||
}
|
||||
|
||||
.color-picker-rgb-item[data-channel="b"] .color-picker-rgb-slider {
|
||||
background: linear-gradient(to right, #000000, #0000ff);
|
||||
}
|
||||
|
||||
.color-picker-rgb-input {
|
||||
width: 100%;
|
||||
padding: 6px 8px;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 6px;
|
||||
font-size: 0.875rem;
|
||||
text-align: center;
|
||||
transition: border-color 0.2s;
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
|
||||
.color-picker-rgb-input::-webkit-outer-spin-button,
|
||||
.color-picker-rgb-input::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.color-picker-rgb-input:focus {
|
||||
outline: none;
|
||||
border-color: #667eea;
|
||||
}
|
||||
|
||||
/* Responsive adjustments */
|
||||
@media (max-width: 480px) {
|
||||
.color-picker-panel {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.color-picker-main {
|
||||
width: 180px;
|
||||
height: 180px;
|
||||
}
|
||||
|
||||
.color-picker-hue {
|
||||
height: 180px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dark mode support (optional) */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.color-picker-panel {
|
||||
background: #2d3748;
|
||||
border-color: #4a5568;
|
||||
}
|
||||
|
||||
.color-picker-preview {
|
||||
border-color: #4a5568;
|
||||
}
|
||||
|
||||
.color-picker-main,
|
||||
.color-picker-hue {
|
||||
border-color: #4a5568;
|
||||
}
|
||||
|
||||
.color-picker-hex,
|
||||
.color-picker-rgb-input {
|
||||
background: #1a202c;
|
||||
border-color: #4a5568;
|
||||
color: #e2e8f0;
|
||||
}
|
||||
|
||||
.color-picker-rgb-item label {
|
||||
color: #a0aec0;
|
||||
}
|
||||
|
||||
.color-picker-rgb-slider {
|
||||
background: #4a5568 !important;
|
||||
}
|
||||
|
||||
.color-picker-rgb-slider::-webkit-slider-thumb,
|
||||
.color-picker-rgb-slider::-moz-range-thumb {
|
||||
background: #667eea;
|
||||
border-color: #2d3748;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,474 @@
|
||||
/**
|
||||
* Custom Color Picker Component
|
||||
* Consistent across all operating systems and browsers
|
||||
*/
|
||||
|
||||
class ColorPicker {
|
||||
constructor(container, options = {}) {
|
||||
this.container = typeof container === 'string' ? document.querySelector(container) : container;
|
||||
this.options = {
|
||||
initialColor: options.initialColor || '#FF0000',
|
||||
onColorChange: options.onColorChange || null,
|
||||
showHexInput: options.showHexInput !== false,
|
||||
...options
|
||||
};
|
||||
this.currentColor = this.options.initialColor;
|
||||
this.isOpen = false;
|
||||
this.init();
|
||||
}
|
||||
|
||||
init() {
|
||||
this.createPicker();
|
||||
this.setupEventListeners();
|
||||
this.updateColor(this.options.initialColor);
|
||||
}
|
||||
|
||||
createPicker() {
|
||||
this.container.innerHTML = '';
|
||||
this.container.className = 'color-picker-container';
|
||||
|
||||
// Color preview button
|
||||
this.previewBtn = document.createElement('button');
|
||||
this.previewBtn.className = 'color-picker-preview';
|
||||
this.previewBtn.type = 'button';
|
||||
this.previewBtn.style.backgroundColor = this.currentColor;
|
||||
this.previewBtn.setAttribute('aria-label', 'Open color picker');
|
||||
|
||||
// Dropdown panel
|
||||
this.panel = document.createElement('div');
|
||||
this.panel.className = 'color-picker-panel';
|
||||
this.panel.style.display = 'none';
|
||||
|
||||
// Main color area (hue/saturation)
|
||||
this.mainArea = document.createElement('div');
|
||||
this.mainArea.className = 'color-picker-main';
|
||||
this.mainCanvas = document.createElement('canvas');
|
||||
this.mainCanvas.width = 200;
|
||||
this.mainCanvas.height = 200;
|
||||
this.mainCanvas.className = 'color-picker-canvas';
|
||||
this.mainArea.appendChild(this.mainCanvas);
|
||||
|
||||
// Main area cursor
|
||||
this.mainCursor = document.createElement('div');
|
||||
this.mainCursor.className = 'color-picker-cursor';
|
||||
this.mainArea.appendChild(this.mainCursor);
|
||||
|
||||
// Hue slider
|
||||
this.hueArea = document.createElement('div');
|
||||
this.hueArea.className = 'color-picker-hue';
|
||||
this.hueCanvas = document.createElement('canvas');
|
||||
this.hueCanvas.width = 20;
|
||||
this.hueCanvas.height = 200;
|
||||
this.hueCanvas.className = 'color-picker-canvas';
|
||||
this.hueArea.appendChild(this.hueCanvas);
|
||||
|
||||
// Hue slider cursor
|
||||
this.hueCursor = document.createElement('div');
|
||||
this.hueCursor.className = 'color-picker-hue-cursor';
|
||||
this.hueArea.appendChild(this.hueCursor);
|
||||
|
||||
// Controls section
|
||||
this.controls = document.createElement('div');
|
||||
this.controls.className = 'color-picker-controls';
|
||||
|
||||
// Hex input
|
||||
if (this.options.showHexInput) {
|
||||
this.hexInput = document.createElement('input');
|
||||
this.hexInput.type = 'text';
|
||||
this.hexInput.className = 'color-picker-hex';
|
||||
this.hexInput.placeholder = '#000000';
|
||||
this.hexInput.maxLength = 7;
|
||||
this.controls.appendChild(this.hexInput);
|
||||
}
|
||||
|
||||
// RGB inputs and sliders
|
||||
this.rgbContainer = document.createElement('div');
|
||||
this.rgbContainer.className = 'color-picker-rgb';
|
||||
|
||||
['R', 'G', 'B'].forEach((label, index) => {
|
||||
const wrapper = document.createElement('div');
|
||||
wrapper.className = 'color-picker-rgb-item';
|
||||
wrapper.dataset.channel = label.toLowerCase();
|
||||
|
||||
const labelEl = document.createElement('label');
|
||||
labelEl.textContent = label;
|
||||
|
||||
const slider = document.createElement('input');
|
||||
slider.type = 'range';
|
||||
slider.className = 'color-picker-rgb-slider';
|
||||
slider.min = 0;
|
||||
slider.max = 255;
|
||||
slider.value = 0;
|
||||
slider.dataset.channel = label.toLowerCase();
|
||||
|
||||
const input = document.createElement('input');
|
||||
input.type = 'number';
|
||||
input.className = 'color-picker-rgb-input';
|
||||
input.min = 0;
|
||||
input.max = 255;
|
||||
input.value = 0;
|
||||
input.dataset.channel = label.toLowerCase();
|
||||
|
||||
wrapper.appendChild(labelEl);
|
||||
wrapper.appendChild(slider);
|
||||
wrapper.appendChild(input);
|
||||
this.rgbContainer.appendChild(wrapper);
|
||||
|
||||
this[`rgb${label}Slider`] = slider;
|
||||
this[`rgb${label}`] = input;
|
||||
});
|
||||
|
||||
this.controls.appendChild(this.rgbContainer);
|
||||
|
||||
// Assemble panel
|
||||
const pickerArea = document.createElement('div');
|
||||
pickerArea.className = 'color-picker-area';
|
||||
pickerArea.appendChild(this.mainArea);
|
||||
pickerArea.appendChild(this.hueArea);
|
||||
|
||||
this.panel.appendChild(pickerArea);
|
||||
this.panel.appendChild(this.controls);
|
||||
|
||||
// Assemble container
|
||||
this.container.appendChild(this.previewBtn);
|
||||
this.container.appendChild(this.panel);
|
||||
|
||||
// Draw canvases
|
||||
this.drawHueCanvas();
|
||||
this.drawMainCanvas(1.0); // Start with full saturation
|
||||
}
|
||||
|
||||
setupEventListeners() {
|
||||
// Toggle panel
|
||||
this.previewBtn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
this.toggle();
|
||||
});
|
||||
|
||||
// Close on outside click
|
||||
document.addEventListener('click', (e) => {
|
||||
if (!this.container.contains(e.target) && this.isOpen) {
|
||||
this.close();
|
||||
}
|
||||
});
|
||||
|
||||
// Main area interaction
|
||||
let isMainDragging = false;
|
||||
this.mainCanvas.addEventListener('mousedown', (e) => {
|
||||
isMainDragging = true;
|
||||
this.handleMainAreaClick(e);
|
||||
});
|
||||
this.mainCanvas.addEventListener('mousemove', (e) => {
|
||||
if (isMainDragging) {
|
||||
this.handleMainAreaClick(e);
|
||||
}
|
||||
});
|
||||
document.addEventListener('mouseup', () => {
|
||||
isMainDragging = false;
|
||||
});
|
||||
|
||||
// Touch support for main area
|
||||
this.mainCanvas.addEventListener('touchstart', (e) => {
|
||||
e.preventDefault();
|
||||
isMainDragging = true;
|
||||
this.handleMainAreaClick(e.touches[0]);
|
||||
});
|
||||
this.mainCanvas.addEventListener('touchmove', (e) => {
|
||||
e.preventDefault();
|
||||
if (isMainDragging) {
|
||||
this.handleMainAreaClick(e.touches[0]);
|
||||
}
|
||||
});
|
||||
this.mainCanvas.addEventListener('touchend', () => {
|
||||
isMainDragging = false;
|
||||
});
|
||||
|
||||
// Hue slider interaction
|
||||
let isHueDragging = false;
|
||||
this.hueCanvas.addEventListener('mousedown', (e) => {
|
||||
isHueDragging = true;
|
||||
this.handleHueClick(e);
|
||||
});
|
||||
this.hueCanvas.addEventListener('mousemove', (e) => {
|
||||
if (isHueDragging) {
|
||||
this.handleHueClick(e);
|
||||
}
|
||||
});
|
||||
document.addEventListener('mouseup', () => {
|
||||
isHueDragging = false;
|
||||
});
|
||||
|
||||
// Touch support for hue slider
|
||||
this.hueCanvas.addEventListener('touchstart', (e) => {
|
||||
e.preventDefault();
|
||||
isHueDragging = true;
|
||||
this.handleHueClick(e.touches[0]);
|
||||
});
|
||||
this.hueCanvas.addEventListener('touchmove', (e) => {
|
||||
e.preventDefault();
|
||||
if (isHueDragging) {
|
||||
this.handleHueClick(e.touches[0]);
|
||||
}
|
||||
});
|
||||
this.hueCanvas.addEventListener('touchend', () => {
|
||||
isHueDragging = false;
|
||||
});
|
||||
|
||||
// Hex input
|
||||
if (this.hexInput) {
|
||||
this.hexInput.addEventListener('input', (e) => {
|
||||
const value = e.target.value;
|
||||
if (/^#[0-9A-Fa-f]{6}$/.test(value)) {
|
||||
this.updateColor(value);
|
||||
}
|
||||
});
|
||||
this.hexInput.addEventListener('blur', (e) => {
|
||||
const value = e.target.value;
|
||||
if (!/^#[0-9A-Fa-f]{6}$/.test(value) && value.length > 0) {
|
||||
e.target.value = this.currentColor;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// RGB inputs and sliders
|
||||
['R', 'G', 'B'].forEach(label => {
|
||||
// Slider change
|
||||
this[`rgb${label}Slider`].addEventListener('input', (e) => {
|
||||
const value = parseInt(e.target.value) || 0;
|
||||
this[`rgb${label}`].value = value;
|
||||
const r = parseInt(this.rgbR.value) || 0;
|
||||
const g = parseInt(this.rgbG.value) || 0;
|
||||
const b = parseInt(this.rgbB.value) || 0;
|
||||
const hex = this.rgbToHex(r, g, b);
|
||||
this.updateColor(hex, false); // Don't update RGB inputs/sliders to avoid loop
|
||||
});
|
||||
|
||||
// Input change
|
||||
this[`rgb${label}`].addEventListener('input', (e) => {
|
||||
let value = parseInt(e.target.value) || 0;
|
||||
value = Math.max(0, Math.min(255, value)); // Clamp to 0-255
|
||||
e.target.value = value;
|
||||
this[`rgb${label}Slider`].value = value;
|
||||
const r = parseInt(this.rgbR.value) || 0;
|
||||
const g = parseInt(this.rgbG.value) || 0;
|
||||
const b = parseInt(this.rgbB.value) || 0;
|
||||
const hex = this.rgbToHex(r, g, b);
|
||||
this.updateColor(hex, false); // Don't update RGB inputs/sliders to avoid loop
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
drawHueCanvas() {
|
||||
const ctx = this.hueCanvas.getContext('2d');
|
||||
const gradient = ctx.createLinearGradient(0, 0, 0, 200);
|
||||
|
||||
for (let i = 0; i <= 6; i++) {
|
||||
const hue = i * 60;
|
||||
gradient.addColorStop(i / 6, `hsl(${hue}, 100%, 50%)`);
|
||||
}
|
||||
|
||||
ctx.fillStyle = gradient;
|
||||
ctx.fillRect(0, 0, 20, 200);
|
||||
}
|
||||
|
||||
drawMainCanvas(hue) {
|
||||
const ctx = this.mainCanvas.getContext('2d');
|
||||
|
||||
// Saturation gradient (left to right)
|
||||
const satGradient = ctx.createLinearGradient(0, 0, 200, 0);
|
||||
satGradient.addColorStop(0, `hsl(${hue}, 0%, 50%)`);
|
||||
satGradient.addColorStop(1, `hsl(${hue}, 100%, 50%)`);
|
||||
ctx.fillStyle = satGradient;
|
||||
ctx.fillRect(0, 0, 200, 200);
|
||||
|
||||
// Brightness gradient (top to bottom)
|
||||
const brightGradient = ctx.createLinearGradient(0, 0, 0, 200);
|
||||
brightGradient.addColorStop(0, 'rgba(255, 255, 255, 0)');
|
||||
brightGradient.addColorStop(1, 'rgba(0, 0, 0, 1)');
|
||||
ctx.fillStyle = brightGradient;
|
||||
ctx.fillRect(0, 0, 200, 200);
|
||||
}
|
||||
|
||||
handleMainAreaClick(e) {
|
||||
const rect = this.mainCanvas.getBoundingClientRect();
|
||||
const x = Math.max(0, Math.min(200, e.clientX - rect.left));
|
||||
const y = Math.max(0, Math.min(200, e.clientY - rect.top));
|
||||
|
||||
const saturation = x / 200;
|
||||
const brightness = 1 - (y / 200);
|
||||
|
||||
this.updateColorFromHSB(this.hue, saturation, brightness);
|
||||
this.updateCursor(x, y);
|
||||
}
|
||||
|
||||
handleHueClick(e) {
|
||||
const rect = this.hueCanvas.getBoundingClientRect();
|
||||
const y = Math.max(0, Math.min(200, e.clientY - rect.top));
|
||||
const hue = (y / 200) * 360;
|
||||
|
||||
this.hue = hue;
|
||||
this.drawMainCanvas(hue);
|
||||
this.updateHueCursor(y);
|
||||
|
||||
// Recalculate color with new hue
|
||||
const rect2 = this.mainCanvas.getBoundingClientRect();
|
||||
const x = parseFloat(this.mainCursor.style.left) || 0;
|
||||
const y2 = parseFloat(this.mainCursor.style.top) || 0;
|
||||
const saturation = x / 200;
|
||||
const brightness = 1 - (y2 / 200);
|
||||
this.updateColorFromHSB(hue, saturation, brightness);
|
||||
}
|
||||
|
||||
updateColorFromHSB(h, s, v) {
|
||||
const rgb = this.hsbToRgb(h, s, v);
|
||||
const hex = this.rgbToHex(rgb.r, rgb.g, rgb.b);
|
||||
this.updateColor(hex);
|
||||
}
|
||||
|
||||
hsbToRgb(h, s, v) {
|
||||
h = h / 360;
|
||||
const i = Math.floor(h * 6);
|
||||
const f = h * 6 - i;
|
||||
const p = v * (1 - s);
|
||||
const q = v * (1 - f * s);
|
||||
const t = v * (1 - (1 - f) * s);
|
||||
|
||||
let r, g, b;
|
||||
switch (i % 6) {
|
||||
case 0: r = v; g = t; b = p; break;
|
||||
case 1: r = q; g = v; b = p; break;
|
||||
case 2: r = p; g = v; b = t; break;
|
||||
case 3: r = p; g = q; b = v; break;
|
||||
case 4: r = t; g = p; b = v; break;
|
||||
case 5: r = v; g = p; b = q; break;
|
||||
}
|
||||
|
||||
return {
|
||||
r: Math.round(r * 255),
|
||||
g: Math.round(g * 255),
|
||||
b: Math.round(b * 255)
|
||||
};
|
||||
}
|
||||
|
||||
rgbToHex(r, g, b) {
|
||||
return '#' + [r, g, b].map(x => {
|
||||
const hex = x.toString(16);
|
||||
return hex.length === 1 ? '0' + hex : hex;
|
||||
}).join('').toUpperCase();
|
||||
}
|
||||
|
||||
hexToRgb(hex) {
|
||||
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
||||
return result ? {
|
||||
r: parseInt(result[1], 16),
|
||||
g: parseInt(result[2], 16),
|
||||
b: parseInt(result[3], 16)
|
||||
} : null;
|
||||
}
|
||||
|
||||
rgbToHsb(r, g, b) {
|
||||
r /= 255;
|
||||
g /= 255;
|
||||
b /= 255;
|
||||
|
||||
const max = Math.max(r, g, b);
|
||||
const min = Math.min(r, g, b);
|
||||
const diff = max - min;
|
||||
|
||||
let h = 0;
|
||||
if (diff !== 0) {
|
||||
if (max === r) {
|
||||
h = ((g - b) / diff) % 6) * 60;
|
||||
} else if (max === g) {
|
||||
h = ((b - r) / diff + 2) * 60;
|
||||
} else {
|
||||
h = ((r - g) / diff + 4) * 60;
|
||||
}
|
||||
}
|
||||
if (h < 0) h += 360;
|
||||
|
||||
const s = max === 0 ? 0 : diff / max;
|
||||
const v = max;
|
||||
|
||||
return { h, s, v };
|
||||
}
|
||||
|
||||
updateColor(hex, updateInputs = true) {
|
||||
this.currentColor = hex.toUpperCase();
|
||||
this.previewBtn.style.backgroundColor = this.currentColor;
|
||||
|
||||
const rgb = this.hexToRgb(this.currentColor);
|
||||
if (!rgb) return;
|
||||
|
||||
const hsb = this.rgbToHsb(rgb.r, rgb.g, rgb.b);
|
||||
this.hue = hsb.h;
|
||||
|
||||
// Update main canvas
|
||||
this.drawMainCanvas(this.hue);
|
||||
|
||||
// Update cursors
|
||||
const x = hsb.s * 200;
|
||||
const y = (1 - hsb.v) * 200;
|
||||
this.updateCursor(x, y);
|
||||
this.updateHueCursor((this.hue / 360) * 200);
|
||||
|
||||
// Update inputs
|
||||
if (updateInputs) {
|
||||
if (this.hexInput) {
|
||||
this.hexInput.value = this.currentColor;
|
||||
}
|
||||
if (this.rgbR) {
|
||||
this.rgbR.value = rgb.r;
|
||||
this.rgbG.value = rgb.g;
|
||||
this.rgbB.value = rgb.b;
|
||||
}
|
||||
if (this.rgbRSlider) {
|
||||
this.rgbRSlider.value = rgb.r;
|
||||
this.rgbGSlider.value = rgb.g;
|
||||
this.rgbBSlider.value = rgb.b;
|
||||
}
|
||||
}
|
||||
|
||||
// Callback
|
||||
if (this.options.onColorChange) {
|
||||
this.options.onColorChange(this.currentColor);
|
||||
}
|
||||
}
|
||||
|
||||
updateCursor(x, y) {
|
||||
this.mainCursor.style.left = `${x}px`;
|
||||
this.mainCursor.style.top = `${y}px`;
|
||||
}
|
||||
|
||||
updateHueCursor(y) {
|
||||
this.hueCursor.style.top = `${y}px`;
|
||||
}
|
||||
|
||||
toggle() {
|
||||
this.isOpen ? this.close() : this.open();
|
||||
}
|
||||
|
||||
open() {
|
||||
this.panel.style.display = 'block';
|
||||
this.isOpen = true;
|
||||
}
|
||||
|
||||
close() {
|
||||
this.panel.style.display = 'none';
|
||||
this.isOpen = false;
|
||||
}
|
||||
|
||||
getColor() {
|
||||
return this.currentColor;
|
||||
}
|
||||
|
||||
setColor(color) {
|
||||
this.updateColor(color);
|
||||
}
|
||||
}
|
||||
|
||||
// Export for use in other scripts
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
module.exports = ColorPicker;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,359 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>LED Driver - Dashboard</title>
|
||||
<link rel="stylesheet" href="color-picker.css">
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
min-height: 100vh;
|
||||
padding: 20px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.header {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 24px;
|
||||
margin-bottom: 24px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
color: #667eea;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.header p {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 24px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 24px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
transition: transform 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.card h2 {
|
||||
color: #667eea;
|
||||
margin-bottom: 16px;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.pattern-selector {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.pattern-btn {
|
||||
padding: 16px;
|
||||
border: 2px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
background: white;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.pattern-btn:hover {
|
||||
border-color: #667eea;
|
||||
background: #f0f0ff;
|
||||
}
|
||||
|
||||
.pattern-btn.active {
|
||||
border-color: #667eea;
|
||||
background: #667eea;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.slider-group {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.slider-group label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.slider {
|
||||
width: 100%;
|
||||
height: 8px;
|
||||
border-radius: 4px;
|
||||
background: #e0e0e0;
|
||||
outline: none;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
.slider::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background: #667eea;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.slider::-moz-range-thumb {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background: #667eea;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.value-display {
|
||||
display: inline-block;
|
||||
margin-left: 12px;
|
||||
font-weight: 600;
|
||||
color: #667eea;
|
||||
}
|
||||
|
||||
.color-picker-group {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.color-picker-wrapper {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 12px 24px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: #667eea;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: #5568d3;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: #e0e0e0;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background: #d0d0d0;
|
||||
}
|
||||
|
||||
.device-list {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.device-item {
|
||||
padding: 12px;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.device-status {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
background: #4caf50;
|
||||
}
|
||||
|
||||
.device-status.offline {
|
||||
background: #f44336;
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.btn-full {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>LED Driver Control Panel</h1>
|
||||
<p>Manage your LED devices and patterns</p>
|
||||
</div>
|
||||
|
||||
<div class="grid">
|
||||
<!-- Pattern Selection -->
|
||||
<div class="card">
|
||||
<h2>Pattern Selection</h2>
|
||||
<div class="pattern-selector">
|
||||
<div class="pattern-btn active">On</div>
|
||||
<div class="pattern-btn">Off</div>
|
||||
<div class="pattern-btn">Blink</div>
|
||||
<div class="pattern-btn">Chase</div>
|
||||
<div class="pattern-btn">Circle</div>
|
||||
<div class="pattern-btn">Pulse</div>
|
||||
<div class="pattern-btn">Rainbow</div>
|
||||
<div class="pattern-btn">Transition</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Brightness & Speed -->
|
||||
<div class="card">
|
||||
<h2>Brightness & Speed</h2>
|
||||
<div class="slider-group">
|
||||
<label>
|
||||
Brightness
|
||||
<span class="value-display" id="brightness-value">100</span>%
|
||||
</label>
|
||||
<input type="range" class="slider" id="brightness" min="0" max="100" value="100">
|
||||
</div>
|
||||
<div class="slider-group">
|
||||
<label>
|
||||
Delay
|
||||
<span class="value-display" id="delay-value">100</span>ms
|
||||
</label>
|
||||
<input type="range" class="slider" id="delay" min="10" max="1000" value="100" step="10">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Color Selection -->
|
||||
<div class="card">
|
||||
<h2>Colors</h2>
|
||||
<div class="color-picker-group">
|
||||
<input type="color" class="color-input" value="#000000">
|
||||
<input type="color" class="color-input" value="#FF0000">
|
||||
<input type="color" class="color-input" value="#00FF00">
|
||||
<input type="color" class="color-input" value="#0000FF">
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button class="btn btn-secondary btn-full">Add Color</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Device Status -->
|
||||
<div class="card">
|
||||
<h2>Connected Devices</h2>
|
||||
<ul class="device-list">
|
||||
<li class="device-item">
|
||||
<div>
|
||||
<strong>led-device1</strong>
|
||||
<div style="font-size: 0.875rem; color: #666;">Group: group1</div>
|
||||
</div>
|
||||
<div class="device-status"></div>
|
||||
</li>
|
||||
<li class="device-item">
|
||||
<div>
|
||||
<strong>led-device2</strong>
|
||||
<div style="font-size: 0.875rem; color: #666;">Group: group2</div>
|
||||
</div>
|
||||
<div class="device-status"></div>
|
||||
</li>
|
||||
<li class="device-item">
|
||||
<div>
|
||||
<strong>led-device3</strong>
|
||||
<div style="font-size: 0.875rem; color: #666;">No group</div>
|
||||
</div>
|
||||
<div class="device-status offline"></div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Action Buttons -->
|
||||
<div class="card">
|
||||
<div class="actions">
|
||||
<button class="btn btn-primary btn-full">Apply Settings</button>
|
||||
<button class="btn btn-secondary btn-full">Save to Device</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Brightness slider
|
||||
document.getElementById('brightness').addEventListener('input', function(e) {
|
||||
document.getElementById('brightness-value').textContent = e.target.value;
|
||||
});
|
||||
|
||||
// Delay slider
|
||||
document.getElementById('delay').addEventListener('input', function(e) {
|
||||
document.getElementById('delay-value').textContent = e.target.value;
|
||||
});
|
||||
|
||||
// Pattern selection
|
||||
document.querySelectorAll('.pattern-btn').forEach(btn => {
|
||||
btn.addEventListener('click', function() {
|
||||
document.querySelectorAll('.pattern-btn').forEach(b => b.classList.remove('active'));
|
||||
this.classList.add('active');
|
||||
});
|
||||
});
|
||||
|
||||
// Initialize color pickers
|
||||
const colorPickers = [];
|
||||
const initialColors = ['#000000', '#FF0000'];
|
||||
|
||||
function addColorPicker(color = '#000000') {
|
||||
const container = document.createElement('div');
|
||||
container.className = 'color-picker-wrapper';
|
||||
document.getElementById('color-pickers').appendChild(container);
|
||||
|
||||
const picker = new ColorPicker(container, {
|
||||
initialColor: color,
|
||||
onColorChange: (newColor) => {
|
||||
console.log('Color changed:', newColor);
|
||||
// Update device colors
|
||||
}
|
||||
});
|
||||
|
||||
colorPickers.push(picker);
|
||||
return picker;
|
||||
}
|
||||
|
||||
// Add initial color pickers
|
||||
initialColors.forEach(color => addColorPicker(color));
|
||||
</script>
|
||||
<script src="color-picker.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,418 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>LED Driver - Device Management</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
min-height: 100vh;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.header {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 24px;
|
||||
margin-bottom: 24px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
color: #667eea;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 12px 24px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: #667eea;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: #5568d3;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin-bottom: 24px;
|
||||
background: white;
|
||||
padding: 8px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.zone {
|
||||
flex: 1;
|
||||
padding: 12px 24px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.zone.active {
|
||||
background: #667eea;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.zone-content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.zone-content.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 24px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.card h2 {
|
||||
color: #667eea;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.device-item, .group-item {
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
margin-bottom: 12px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.device-item:hover, .group-item:hover {
|
||||
border-color: #667eea;
|
||||
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
|
||||
}
|
||||
|
||||
.device-info, .group-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.device-name, .group-name {
|
||||
font-weight: 600;
|
||||
font-size: 1.125rem;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.device-details, .group-details {
|
||||
font-size: 0.875rem;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.status-badge {
|
||||
display: inline-block;
|
||||
padding: 4px 12px;
|
||||
border-radius: 12px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
.status-online {
|
||||
background: #d4edda;
|
||||
color: #155724;
|
||||
}
|
||||
|
||||
.status-offline {
|
||||
background: #f8d7da;
|
||||
color: #721c24;
|
||||
}
|
||||
|
||||
.status-indicator {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
background: #4caf50;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.status-indicator.offline {
|
||||
background: #f44336;
|
||||
}
|
||||
|
||||
.device-actions, .group-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #e0e0e0;
|
||||
background: white;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.btn-icon:hover {
|
||||
border-color: #667eea;
|
||||
color: #667eea;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.form-group input, .form-group select {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.form-group input:focus, .form-group select:focus {
|
||||
outline: none;
|
||||
border-color: #667eea;
|
||||
}
|
||||
|
||||
.form-actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: #e0e0e0;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background: #d0d0d0;
|
||||
}
|
||||
|
||||
.group-devices {
|
||||
margin-top: 12px;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.group-device-tag {
|
||||
display: inline-block;
|
||||
padding: 4px 8px;
|
||||
background: #f0f0f0;
|
||||
border-radius: 4px;
|
||||
font-size: 0.75rem;
|
||||
margin-right: 8px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>Device & Group Management</h1>
|
||||
<button class="btn btn-primary" onclick="showAddDeviceModal()">+ Add Device</button>
|
||||
</div>
|
||||
|
||||
<div class="tabs">
|
||||
<button class="zone active" onclick="switchTab('devices')">Devices</button>
|
||||
<button class="zone" onclick="switchTab('groups')">Groups</button>
|
||||
</div>
|
||||
|
||||
<!-- Devices Zone -->
|
||||
<div id="devices-zone" class="zone-content active">
|
||||
<div class="card">
|
||||
<h2>Connected Devices</h2>
|
||||
<div class="device-item">
|
||||
<div class="device-info">
|
||||
<div class="device-name">
|
||||
<span class="status-indicator"></span>
|
||||
led-device1
|
||||
</div>
|
||||
<div class="device-details">
|
||||
<span class="status-badge status-online">Online</span>
|
||||
MAC: AA:BB:CC:DD:EE:01 | Group: group1 | Pattern: Rainbow
|
||||
</div>
|
||||
</div>
|
||||
<div class="device-actions">
|
||||
<button class="btn-icon" title="Edit">✏️</button>
|
||||
<button class="btn-icon" title="Settings">⚙️</button>
|
||||
<button class="btn-icon" title="Remove">🗑️</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="device-item">
|
||||
<div class="device-info">
|
||||
<div class="device-name">
|
||||
<span class="status-indicator"></span>
|
||||
led-device2
|
||||
</div>
|
||||
<div class="device-details">
|
||||
<span class="status-badge status-online">Online</span>
|
||||
MAC: AA:BB:CC:DD:EE:02 | Group: group2 | Pattern: Chase
|
||||
</div>
|
||||
</div>
|
||||
<div class="device-actions">
|
||||
<button class="btn-icon" title="Edit">✏️</button>
|
||||
<button class="btn-icon" title="Settings">⚙️</button>
|
||||
<button class="btn-icon" title="Remove">🗑️</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="device-item">
|
||||
<div class="device-info">
|
||||
<div class="device-name">
|
||||
<span class="status-indicator offline"></span>
|
||||
led-device3
|
||||
</div>
|
||||
<div class="device-details">
|
||||
<span class="status-badge status-offline">Offline</span>
|
||||
MAC: AA:BB:CC:DD:EE:03 | No group | Pattern: On
|
||||
</div>
|
||||
</div>
|
||||
<div class="device-actions">
|
||||
<button class="btn-icon" title="Edit">✏️</button>
|
||||
<button class="btn-icon" title="Settings">⚙️</button>
|
||||
<button class="btn-icon" title="Remove">🗑️</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Groups Zone -->
|
||||
<div id="groups-zone" class="zone-content">
|
||||
<div class="card">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;">
|
||||
<h2>Groups</h2>
|
||||
<button class="btn btn-primary" onclick="showAddGroupModal()">+ Create Group</button>
|
||||
</div>
|
||||
|
||||
<div class="group-item">
|
||||
<div class="group-info">
|
||||
<div class="group-name">group1</div>
|
||||
<div class="group-details">
|
||||
Pattern: On | Brightness: 100% | Delay: 100ms
|
||||
</div>
|
||||
<div class="group-devices">
|
||||
<span class="group-device-tag">led-device1</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="group-actions">
|
||||
<button class="btn-icon" title="Edit">✏️</button>
|
||||
<button class="btn-icon" title="Apply">▶️</button>
|
||||
<button class="btn-icon" title="Delete">🗑️</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="group-item">
|
||||
<div class="group-info">
|
||||
<div class="group-name">group2</div>
|
||||
<div class="group-details">
|
||||
Pattern: Chase | Brightness: 75% | Delay: 200ms
|
||||
</div>
|
||||
<div class="group-devices">
|
||||
<span class="group-device-tag">led-device2</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="group-actions">
|
||||
<button class="btn-icon" title="Edit">✏️</button>
|
||||
<button class="btn-icon" title="Apply">▶️</button>
|
||||
<button class="btn-icon" title="Delete">🗑️</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal (simplified) -->
|
||||
<div id="modal" style="display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center;">
|
||||
<div class="card" style="max-width: 500px; margin: 20px;">
|
||||
<h2 id="modal-title">Add Device</h2>
|
||||
<div class="form-group">
|
||||
<label>Device Name</label>
|
||||
<input type="text" id="device-name" placeholder="led-device4">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>MAC Address</label>
|
||||
<input type="text" id="device-mac" placeholder="AA:BB:CC:DD:EE:04">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Group</label>
|
||||
<select id="device-group">
|
||||
<option value="">No group</option>
|
||||
<option value="group1">group1</option>
|
||||
<option value="group2">group2</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button class="btn btn-secondary" onclick="closeModal()">Cancel</button>
|
||||
<button class="btn btn-primary" onclick="saveDevice()">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function switchTab(zone) {
|
||||
document.querySelectorAll('.zone').forEach(t => t.classList.remove('active'));
|
||||
document.querySelectorAll('.zone-content').forEach(c => c.classList.remove('active'));
|
||||
|
||||
event.target.classList.add('active');
|
||||
document.getElementById(zone + '-zone').classList.add('active');
|
||||
}
|
||||
|
||||
function showAddDeviceModal() {
|
||||
document.getElementById('modal').style.display = 'flex';
|
||||
document.getElementById('modal-title').textContent = 'Add Device';
|
||||
}
|
||||
|
||||
function showAddGroupModal() {
|
||||
document.getElementById('modal').style.display = 'flex';
|
||||
document.getElementById('modal-title').textContent = 'Create Group';
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
document.getElementById('modal').style.display = 'none';
|
||||
}
|
||||
|
||||
function saveDevice() {
|
||||
alert('Device saved! (This is a mockup)');
|
||||
closeModal();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Generate images from HTML mockup files
|
||||
Uses Playwright to render HTML and take screenshots
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
try:
|
||||
from playwright.sync_api import sync_playwright
|
||||
PLAYWRIGHT_AVAILABLE = True
|
||||
except ImportError:
|
||||
PLAYWRIGHT_AVAILABLE = False
|
||||
|
||||
try:
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.chrome.options import Options
|
||||
from selenium.webdriver.chrome.service import Service
|
||||
SELENIUM_AVAILABLE = True
|
||||
except ImportError:
|
||||
SELENIUM_AVAILABLE = False
|
||||
|
||||
try:
|
||||
from html2image import Html2Image
|
||||
HTML2IMAGE_AVAILABLE = True
|
||||
except ImportError:
|
||||
HTML2IMAGE_AVAILABLE = False
|
||||
|
||||
|
||||
def generate_with_playwright(html_file, output_file, width=1920, height=1080):
|
||||
"""Generate image using Playwright"""
|
||||
with sync_playwright() as p:
|
||||
browser = p.chromium.launch(headless=True)
|
||||
page = browser.new_page(viewport={'width': width, 'height': height})
|
||||
page.goto(f'file://{html_file.absolute()}')
|
||||
# Wait for page to load
|
||||
page.wait_for_timeout(1000)
|
||||
page.screenshot(path=str(output_file), full_page=True)
|
||||
browser.close()
|
||||
print(f"✓ Generated {output_file.name} using Playwright")
|
||||
|
||||
|
||||
def generate_with_selenium(html_file, output_file, width=1920, height=1080):
|
||||
"""Generate image using Selenium"""
|
||||
chrome_options = Options()
|
||||
chrome_options.add_argument('--headless')
|
||||
chrome_options.add_argument('--no-sandbox')
|
||||
chrome_options.add_argument('--disable-dev-shm-usage')
|
||||
chrome_options.add_argument(f'--window-size={width},{height}')
|
||||
|
||||
driver = webdriver.Chrome(options=chrome_options)
|
||||
try:
|
||||
driver.get(f'file://{html_file.absolute()}')
|
||||
# Wait for page to load
|
||||
import time
|
||||
time.sleep(2)
|
||||
driver.save_screenshot(str(output_file))
|
||||
print(f"✓ Generated {output_file.name} using Selenium")
|
||||
finally:
|
||||
driver.quit()
|
||||
|
||||
|
||||
def generate_with_html2image(html_file, output_file, width=1920, height=1080):
|
||||
"""Generate image using html2image"""
|
||||
hti = Html2Image(size=(width, height))
|
||||
hti.screenshot(
|
||||
html_file=str(html_file),
|
||||
save_as=output_file.name,
|
||||
size=(width, height)
|
||||
)
|
||||
print(f"✓ Generated {output_file.name} using html2image")
|
||||
|
||||
|
||||
def generate_image(html_file, output_dir, width=1920, height=1080):
|
||||
"""Generate image from HTML file using available method"""
|
||||
html_path = Path(html_file)
|
||||
output_path = output_dir / f"{html_path.stem}.png"
|
||||
|
||||
if PLAYWRIGHT_AVAILABLE:
|
||||
try:
|
||||
generate_with_playwright(html_path, output_path, width, height)
|
||||
return True
|
||||
except Exception as e:
|
||||
print(f"Playwright failed: {e}, trying alternatives...")
|
||||
|
||||
if SELENIUM_AVAILABLE:
|
||||
try:
|
||||
generate_with_selenium(html_path, output_path, width, height)
|
||||
return True
|
||||
except Exception as e:
|
||||
print(f"Selenium failed: {e}, trying alternatives...")
|
||||
|
||||
if HTML2IMAGE_AVAILABLE:
|
||||
try:
|
||||
generate_with_html2image(html_path, output_path, width, height)
|
||||
return True
|
||||
except Exception as e:
|
||||
print(f"html2image failed: {e}")
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def main():
|
||||
"""Main function to generate images from all HTML files"""
|
||||
script_dir = Path(__file__).parent
|
||||
output_dir = script_dir / "images"
|
||||
output_dir.mkdir(exist_ok=True)
|
||||
|
||||
html_files = list(script_dir.glob("*.html"))
|
||||
|
||||
if not html_files:
|
||||
print("No HTML files found in mockups directory")
|
||||
return
|
||||
|
||||
print(f"Found {len(html_files)} HTML file(s)")
|
||||
print(f"Output directory: {output_dir}")
|
||||
print()
|
||||
|
||||
# Check available libraries
|
||||
if not any([PLAYWRIGHT_AVAILABLE, SELENIUM_AVAILABLE, HTML2IMAGE_AVAILABLE]):
|
||||
print("ERROR: No screenshot library available!")
|
||||
print("\nPlease install one of the following:")
|
||||
print(" pip install playwright && playwright install chromium")
|
||||
print(" pip install selenium")
|
||||
print(" pip install html2image")
|
||||
sys.exit(1)
|
||||
|
||||
print("Available screenshot libraries:")
|
||||
if PLAYWRIGHT_AVAILABLE:
|
||||
print(" ✓ Playwright")
|
||||
if SELENIUM_AVAILABLE:
|
||||
print(" ✓ Selenium")
|
||||
if HTML2IMAGE_AVAILABLE:
|
||||
print(" ✓ html2image")
|
||||
print()
|
||||
|
||||
# Generate images
|
||||
success_count = 0
|
||||
for html_file in html_files:
|
||||
print(f"Generating image from {html_file.name}...")
|
||||
if generate_image(html_file, output_dir):
|
||||
success_count += 1
|
||||
else:
|
||||
print(f"✗ Failed to generate image from {html_file.name}")
|
||||
print()
|
||||
|
||||
print(f"Successfully generated {success_count}/{len(html_files)} images")
|
||||
print(f"Images saved to: {output_dir}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
After Width: | Height: | Size: 625 KiB |
|
After Width: | Height: | Size: 600 KiB |
|
After Width: | Height: | Size: 585 KiB |
|
After Width: | Height: | Size: 714 KiB |
|
After Width: | Height: | Size: 508 KiB |
|
After Width: | Height: | Size: 562 KiB |
|
After Width: | Height: | Size: 904 KiB |
@@ -0,0 +1,136 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>LED Driver - UI Mockups</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
min-height: 100vh;
|
||||
padding: 40px 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 800px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
color: white;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
font-size: 3rem;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.header p {
|
||||
font-size: 1.25rem;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.mockups-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.mockup-card {
|
||||
background: white;
|
||||
border-radius: 16px;
|
||||
padding: 32px;
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
|
||||
transition: all 0.3s;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.mockup-card:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.mockup-icon {
|
||||
font-size: 3rem;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.mockup-title {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
color: #667eea;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.mockup-description {
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>LED Driver UI Mockups</h1>
|
||||
<p>Example user interfaces for the LED driver system</p>
|
||||
</div>
|
||||
|
||||
<div class="mockups-grid">
|
||||
<a href="dashboard.html" class="mockup-card">
|
||||
<div class="mockup-icon">📊</div>
|
||||
<div class="mockup-title">Dashboard</div>
|
||||
<div class="mockup-description">
|
||||
Main control panel for managing LED patterns, brightness, colors, and device status.
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="pattern-selector.html" class="mockup-card">
|
||||
<div class="mockup-icon">🎨</div>
|
||||
<div class="mockup-title">Pattern Selector</div>
|
||||
<div class="mockup-description">
|
||||
Visual interface for selecting from available LED patterns: On, Off, Blink, Chase, Circle, Pulse, Rainbow, and Transition.
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="device-management.html" class="mockup-card">
|
||||
<div class="mockup-icon">🔧</div>
|
||||
<div class="mockup-title">Device Management</div>
|
||||
<div class="mockup-description">
|
||||
Manage connected LED devices and groups. View device status, assign groups, and configure device settings.
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="settings.html" class="mockup-card">
|
||||
<div class="mockup-icon">⚙️</div>
|
||||
<div class="mockup-title">Settings</div>
|
||||
<div class="mockup-description">
|
||||
Comprehensive settings panel for configuring LED pin, color order, pattern parameters, and network settings.
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<a href="presets.html" class="mockup-card">
|
||||
<div class="mockup-icon">💾</div>
|
||||
<div class="mockup-title">Presets</div>
|
||||
<div class="mockup-description">
|
||||
Save, load, and manage preset configurations with pattern, colors, delay, and all N1-N8 parameters for quick pattern switching.
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,310 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>LED Driver - Pattern Selector</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
||||
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
||||
min-height: 100vh;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1400px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
margin-bottom: 40px;
|
||||
color: #2d3748;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
font-size: 2.5rem;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.header p {
|
||||
font-size: 1.125rem;
|
||||
color: #718096;
|
||||
}
|
||||
|
||||
.patterns-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.pattern-card {
|
||||
background: white;
|
||||
border-radius: 16px;
|
||||
padding: 24px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
border: 3px solid transparent;
|
||||
}
|
||||
|
||||
.pattern-card:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
|
||||
border-color: #667eea;
|
||||
}
|
||||
|
||||
.pattern-card.selected {
|
||||
border-color: #667eea;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.pattern-icon {
|
||||
width: 100%;
|
||||
height: 180px;
|
||||
border-radius: 12px;
|
||||
margin-bottom: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 3rem;
|
||||
background: #f7fafc;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.pattern-card.selected .pattern-icon {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.pattern-name {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.pattern-description {
|
||||
font-size: 0.875rem;
|
||||
color: #718096;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.pattern-card.selected .pattern-description {
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
.pattern-preview {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.preview-dot {
|
||||
flex: 1;
|
||||
height: 8px;
|
||||
border-radius: 4px;
|
||||
background: #e2e8f0;
|
||||
}
|
||||
|
||||
.pattern-card.selected .preview-dot {
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.actions {
|
||||
margin-top: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 16px 48px;
|
||||
border: none;
|
||||
border-radius: 12px;
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
margin: 0 12px;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: #667eea;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: #5568d3;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: white;
|
||||
color: #667eea;
|
||||
border: 2px solid #667eea;
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background: #f0f0ff;
|
||||
}
|
||||
|
||||
/* Pattern-specific icons */
|
||||
.icon-on { background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%); }
|
||||
.icon-off { background: #2d3748; }
|
||||
.icon-blink { background: linear-gradient(90deg, #ffd700 25%, #2d3748 25%, #2d3748 50%, #ffd700 50%); }
|
||||
.icon-chase { background: linear-gradient(90deg, #ff0000 0%, #ff6666 50%, #ff0000 100%); }
|
||||
.icon-circle { background: radial-gradient(circle, #00ff00 0%, #66ff66 50%, #00ff00 100%); }
|
||||
.icon-pulse { background: radial-gradient(circle, #0000ff 0%, #6666ff 50%, #0000ff 100%); }
|
||||
.icon-rainbow { background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3); }
|
||||
.icon-transition { background: linear-gradient(135deg, #ff0000 0%, #0000ff 100%); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>Select LED Pattern</h1>
|
||||
<p>Choose a pattern to display on your LED devices</p>
|
||||
</div>
|
||||
|
||||
<div class="patterns-grid">
|
||||
<div class="pattern-card" data-pattern="on">
|
||||
<div class="pattern-icon icon-on">💡</div>
|
||||
<div class="pattern-name">On</div>
|
||||
<div class="pattern-description">Solid color display - LEDs stay on with selected color</div>
|
||||
<div class="pattern-preview">
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pattern-card" data-pattern="off">
|
||||
<div class="pattern-icon icon-off">⚫</div>
|
||||
<div class="pattern-name">Off</div>
|
||||
<div class="pattern-description">Turn all LEDs off</div>
|
||||
<div class="pattern-preview">
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pattern-card" data-pattern="blink">
|
||||
<div class="pattern-icon icon-blink">✨</div>
|
||||
<div class="pattern-name">Blink</div>
|
||||
<div class="pattern-description">All LEDs blink on and off together</div>
|
||||
<div class="pattern-preview">
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pattern-card" data-pattern="chase">
|
||||
<div class="pattern-icon icon-chase">🏃</div>
|
||||
<div class="pattern-name">Chase</div>
|
||||
<div class="pattern-description">Light chases along the LED strip</div>
|
||||
<div class="pattern-preview">
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pattern-card" data-pattern="circle">
|
||||
<div class="pattern-icon icon-circle">⭕</div>
|
||||
<div class="pattern-name">Circle</div>
|
||||
<div class="pattern-description">Circular pattern that rotates around the strip</div>
|
||||
<div class="pattern-preview">
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pattern-card" data-pattern="pulse">
|
||||
<div class="pattern-icon icon-pulse">💓</div>
|
||||
<div class="pattern-name">Pulse</div>
|
||||
<div class="pattern-description">Pulsing effect that fades in and out</div>
|
||||
<div class="pattern-preview">
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pattern-card" data-pattern="rainbow">
|
||||
<div class="pattern-icon icon-rainbow">🌈</div>
|
||||
<div class="pattern-name">Rainbow</div>
|
||||
<div class="pattern-description">Smooth rainbow color transition across LEDs</div>
|
||||
<div class="pattern-preview">
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pattern-card" data-pattern="transition">
|
||||
<div class="pattern-icon icon-transition">🔄</div>
|
||||
<div class="pattern-name">Transition</div>
|
||||
<div class="pattern-description">Smooth color transition between selected colors</div>
|
||||
<div class="pattern-preview">
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
<div class="preview-dot"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<button class="btn btn-secondary" onclick="window.history.back()">Cancel</button>
|
||||
<button class="btn btn-primary" id="apply-btn">Apply Pattern</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let selectedPattern = null;
|
||||
|
||||
document.querySelectorAll('.pattern-card').forEach(card => {
|
||||
card.addEventListener('click', function() {
|
||||
document.querySelectorAll('.pattern-card').forEach(c => c.classList.remove('selected'));
|
||||
this.classList.add('selected');
|
||||
selectedPattern = this.dataset.pattern;
|
||||
});
|
||||
});
|
||||
|
||||
document.getElementById('apply-btn').addEventListener('click', function() {
|
||||
if (selectedPattern) {
|
||||
alert(`Applying pattern: ${selectedPattern}`);
|
||||
// In real implementation, this would send the pattern to the device
|
||||
} else {
|
||||
alert('Please select a pattern first');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,968 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>LED Driver - Presets</title>
|
||||
<link rel="stylesheet" href="color-picker.css">
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
min-height: 100vh;
|
||||
padding: 20px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1400px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.header {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 24px;
|
||||
margin-bottom: 24px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
color: #667eea;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.header p {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.controls {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 20px;
|
||||
margin-bottom: 24px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
flex: 1;
|
||||
min-width: 200px;
|
||||
padding: 12px;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.search-box:focus {
|
||||
outline: none;
|
||||
border-color: #667eea;
|
||||
}
|
||||
|
||||
.filter-group {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.filter-select {
|
||||
padding: 12px;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
font-size: 1rem;
|
||||
background: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.filter-select:focus {
|
||||
outline: none;
|
||||
border-color: #667eea;
|
||||
}
|
||||
|
||||
.view-toggle {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.view-btn {
|
||||
padding: 8px 16px;
|
||||
border: none;
|
||||
background: white;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.view-btn.active {
|
||||
background: #667eea;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.presets-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||
gap: 24px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.preset-card {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 24px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
transition: all 0.3s;
|
||||
cursor: pointer;
|
||||
border: 3px solid transparent;
|
||||
}
|
||||
|
||||
.preset-card:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
|
||||
border-color: #667eea;
|
||||
}
|
||||
|
||||
.preset-card.selected {
|
||||
border-color: #667eea;
|
||||
background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
|
||||
}
|
||||
|
||||
.preset-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: start;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.preset-name {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.pattern-badge {
|
||||
display: inline-block;
|
||||
padding: 4px 12px;
|
||||
border-radius: 12px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
background: #667eea;
|
||||
color: white;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.pattern-badge.on { background: #4caf50; }
|
||||
.pattern-badge.off { background: #757575; }
|
||||
.pattern-badge.blink { background: #ff9800; }
|
||||
.pattern-badge.chase { background: #f44336; }
|
||||
.pattern-badge.circle { background: #00bcd4; }
|
||||
.pattern-badge.pulse { background: #e91e63; }
|
||||
.pattern-badge.rainbow { background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3); }
|
||||
.pattern-badge.transition { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
|
||||
|
||||
.color-preview {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin-bottom: 16px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.color-swatch {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 8px;
|
||||
border: 2px solid #e0e0e0;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.preset-info {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 12px;
|
||||
margin-bottom: 16px;
|
||||
font-size: 0.875rem;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
color: #667eea;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.preset-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin-top: 16px;
|
||||
padding-top: 16px;
|
||||
border-top: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 10px 20px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: #667eea;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: #5568d3;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: #e0e0e0;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background: #d0d0d0;
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background: #f44336;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-danger:hover {
|
||||
background: #d32f2f;
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
padding: 8px;
|
||||
min-width: 40px;
|
||||
}
|
||||
|
||||
.btn-large {
|
||||
padding: 16px 32px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
/* Modal Styles */
|
||||
.modal {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
z-index: 1000;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.modal.active {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 32px;
|
||||
max-width: 600px;
|
||||
width: 100%;
|
||||
max-height: 90vh;
|
||||
overflow-y: auto;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.modal-header h2 {
|
||||
color: #667eea;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.form-group input,
|
||||
.form-group select {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.form-group input:focus,
|
||||
.form-group select:focus {
|
||||
outline: none;
|
||||
border-color: #667eea;
|
||||
}
|
||||
|
||||
.form-group small {
|
||||
display: block;
|
||||
margin-top: 4px;
|
||||
color: #666;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.color-inputs {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.color-input-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.color-input-wrapper {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.params-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.n-value-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.n-value-input:focus {
|
||||
border-color: #667eea;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.param-input {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.param-input label {
|
||||
font-size: 0.75rem;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.param-input input {
|
||||
padding: 8px;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.modal-actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin-top: 24px;
|
||||
padding-top: 24px;
|
||||
border-top: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 60px 40px;
|
||||
text-align: center;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.empty-state-icon {
|
||||
font-size: 4rem;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.empty-state h2 {
|
||||
color: #667eea;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.empty-state p {
|
||||
color: #666;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<div>
|
||||
<h1>Preset Management</h1>
|
||||
<p>Save and manage your favorite LED pattern configurations</p>
|
||||
</div>
|
||||
<div style="display: flex; gap: 12px; align-items: center;">
|
||||
<button class="btn btn-secondary btn-large" onclick="syncPresets()" title="Sync all presets to all devices">🔄 Sync Presets to All Devices</button>
|
||||
<button class="btn btn-primary btn-large" onclick="showCreateModal()">+ Create Preset</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="controls">
|
||||
<input type="text" class="search-box" placeholder="Search presets..." id="search-input">
|
||||
<div class="filter-group">
|
||||
<select class="filter-select" id="pattern-filter">
|
||||
<option value="">All Patterns</option>
|
||||
<option value="on">On</option>
|
||||
<option value="off">Off</option>
|
||||
<option value="blink">Blink</option>
|
||||
<option value="chase">Chase</option>
|
||||
<option value="circle">Circle</option>
|
||||
<option value="pulse">Pulse</option>
|
||||
<option value="rainbow">Rainbow</option>
|
||||
<option value="transition">Transition</option>
|
||||
</select>
|
||||
<select class="filter-select" id="sort-select">
|
||||
<option value="name">Sort by Name</option>
|
||||
<option value="recent">Recently Used</option>
|
||||
<option value="created">Recently Created</option>
|
||||
</select>
|
||||
<div class="view-toggle">
|
||||
<button class="view-btn active" onclick="setView('grid')" id="view-grid">Grid</button>
|
||||
<button class="view-btn" onclick="setView('list')" id="view-list">List</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="presets-grid" id="presets-container">
|
||||
<!-- Preset Card 1 -->
|
||||
<div class="preset-card" data-pattern="rainbow" data-name="Fast Rainbow">
|
||||
<div class="preset-header">
|
||||
<div>
|
||||
<div class="preset-name">Fast Rainbow</div>
|
||||
<span class="pattern-badge rainbow">Rainbow</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="color-preview">
|
||||
<div class="color-swatch" style="background: #FF0000;"></div>
|
||||
<div class="color-swatch" style="background: #00FF00;"></div>
|
||||
<div class="color-swatch" style="background: #0000FF;"></div>
|
||||
</div>
|
||||
<div class="preset-info">
|
||||
<div class="info-item">
|
||||
<span class="info-label">Delay:</span>
|
||||
<span class="info-value">30ms</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">N1:</span>
|
||||
<span class="info-value">10</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="preset-actions">
|
||||
<button class="btn btn-primary" onclick="applyPreset('Fast Rainbow')">Apply</button>
|
||||
<button class="btn btn-secondary btn-icon" onclick="editPreset('Fast Rainbow')" title="Edit">✏️</button>
|
||||
<button class="btn btn-danger btn-icon" onclick="deletePreset('Fast Rainbow')" title="Delete">🗑️</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Preset Card 2 -->
|
||||
<div class="preset-card" data-pattern="pulse" data-name="Slow Pulse">
|
||||
<div class="preset-header">
|
||||
<div>
|
||||
<div class="preset-name">Slow Pulse</div>
|
||||
<span class="pattern-badge pulse">Pulse</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="color-preview">
|
||||
<div class="color-swatch" style="background: #FF0000;"></div>
|
||||
<div class="color-swatch" style="background: #0000FF;"></div>
|
||||
</div>
|
||||
<div class="preset-info">
|
||||
<div class="info-item">
|
||||
<span class="info-label">Delay:</span>
|
||||
<span class="info-value">200ms</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">N1:</span>
|
||||
<span class="info-value">500</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="preset-actions">
|
||||
<button class="btn btn-primary" onclick="applyPreset('Slow Pulse')">Apply</button>
|
||||
<button class="btn btn-secondary btn-icon" onclick="editPreset('Slow Pulse')" title="Edit">✏️</button>
|
||||
<button class="btn btn-danger btn-icon" onclick="deletePreset('Slow Pulse')" title="Delete">🗑️</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Preset Card 3 -->
|
||||
<div class="preset-card" data-pattern="chase" data-name="Red Blue Chase">
|
||||
<div class="preset-header">
|
||||
<div>
|
||||
<div class="preset-name">Red Blue Chase</div>
|
||||
<span class="pattern-badge chase">Chase</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="color-preview">
|
||||
<div class="color-swatch" style="background: #FF0000;"></div>
|
||||
<div class="color-swatch" style="background: #0000FF;"></div>
|
||||
</div>
|
||||
<div class="preset-info">
|
||||
<div class="info-item">
|
||||
<span class="info-label">Delay:</span>
|
||||
<span class="info-value">100ms</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">N1:</span>
|
||||
<span class="info-value">5</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="preset-actions">
|
||||
<button class="btn btn-primary" onclick="applyPreset('Red Blue Chase')">Apply</button>
|
||||
<button class="btn btn-secondary btn-icon" onclick="editPreset('Red Blue Chase')" title="Edit">✏️</button>
|
||||
<button class="btn btn-danger btn-icon" onclick="deletePreset('Red Blue Chase')" title="Delete">🗑️</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Preset Card 4 -->
|
||||
<div class="preset-card" data-pattern="circle" data-name="Loading Circle">
|
||||
<div class="preset-header">
|
||||
<div>
|
||||
<div class="preset-name">Loading Circle</div>
|
||||
<span class="pattern-badge circle">Circle</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="color-preview">
|
||||
<div class="color-swatch" style="background: #00FF00;"></div>
|
||||
</div>
|
||||
<div class="preset-info">
|
||||
<div class="info-item">
|
||||
<span class="info-label">Delay:</span>
|
||||
<span class="info-value">50ms</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">N1:</span>
|
||||
<span class="info-value">50</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="preset-actions">
|
||||
<button class="btn btn-primary" onclick="applyPreset('Loading Circle')">Apply</button>
|
||||
<button class="btn btn-secondary btn-icon" onclick="editPreset('Loading Circle')" title="Edit">✏️</button>
|
||||
<button class="btn btn-danger btn-icon" onclick="deletePreset('Loading Circle')" title="Delete">🗑️</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Preset Card 5 -->
|
||||
<div class="preset-card" data-pattern="blink" data-name="Party Blink">
|
||||
<div class="preset-header">
|
||||
<div>
|
||||
<div class="preset-name">Party Blink</div>
|
||||
<span class="pattern-badge blink">Blink</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="color-preview">
|
||||
<div class="color-swatch" style="background: #FF00FF;"></div>
|
||||
<div class="color-swatch" style="background: #00FFFF;"></div>
|
||||
<div class="color-swatch" style="background: #FFFF00;"></div>
|
||||
</div>
|
||||
<div class="preset-info">
|
||||
<div class="info-item">
|
||||
<span class="info-label">Delay:</span>
|
||||
<span class="info-value">150ms</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">N1:</span>
|
||||
<span class="info-value">0</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="preset-actions">
|
||||
<button class="btn btn-primary" onclick="applyPreset('Party Blink')">Apply</button>
|
||||
<button class="btn btn-secondary btn-icon" onclick="editPreset('Party Blink')" title="Edit">✏️</button>
|
||||
<button class="btn btn-danger btn-icon" onclick="deletePreset('Party Blink')" title="Delete">🗑️</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Preset Card 6 -->
|
||||
<div class="preset-card" data-pattern="transition" data-name="Smooth Transition">
|
||||
<div class="preset-header">
|
||||
<div>
|
||||
<div class="preset-name">Smooth Transition</div>
|
||||
<span class="pattern-badge transition">Transition</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="color-preview">
|
||||
<div class="color-swatch" style="background: #FF0000;"></div>
|
||||
<div class="color-swatch" style="background: #00FF00;"></div>
|
||||
<div class="color-swatch" style="background: #0000FF;"></div>
|
||||
<div class="color-swatch" style="background: #FFFF00;"></div>
|
||||
</div>
|
||||
<div class="preset-info">
|
||||
<div class="info-item">
|
||||
<span class="info-label">Delay:</span>
|
||||
<span class="info-value">100ms</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">N1:</span>
|
||||
<span class="info-value">0</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="preset-actions">
|
||||
<button class="btn btn-primary" onclick="applyPreset('Smooth Transition')">Apply</button>
|
||||
<button class="btn btn-secondary btn-icon" onclick="editPreset('Smooth Transition')" title="Edit">✏️</button>
|
||||
<button class="btn btn-danger btn-icon" onclick="deletePreset('Smooth Transition')" title="Delete">🗑️</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Create/Edit Preset Modal -->
|
||||
<div class="modal" id="preset-modal">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h2 id="modal-title">Create Preset</h2>
|
||||
<p>Configure your preset settings</p>
|
||||
</div>
|
||||
<form id="preset-form">
|
||||
<div class="form-group">
|
||||
<label for="preset-name">Preset Name *</label>
|
||||
<input type="text" id="preset-name" required placeholder="Enter preset name">
|
||||
<small>Unique identifier for this preset</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="preset-pattern">Pattern *</label>
|
||||
<select id="preset-pattern" required>
|
||||
<option value="on">On</option>
|
||||
<option value="off">Off</option>
|
||||
<option value="blink">Blink</option>
|
||||
<option value="chase">Chase</option>
|
||||
<option value="circle">Circle</option>
|
||||
<option value="pulse">Pulse</option>
|
||||
<option value="rainbow">Rainbow</option>
|
||||
<option value="transition">Transition</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Colors *</label>
|
||||
<div class="color-inputs" id="color-inputs">
|
||||
<!-- Color pickers will be added here -->
|
||||
</div>
|
||||
<button type="button" class="btn btn-secondary" onclick="addColorPicker()" style="margin-top: 8px;">+ Add Color</button>
|
||||
<small>Minimum 2 colors required</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="preset-delay">
|
||||
Delay (ms) *
|
||||
<span id="delay-value-display" style="margin-left: 12px; color: #667eea; font-weight: 600;">100</span>
|
||||
</label>
|
||||
<input type="range" id="preset-delay" min="10" max="1000" value="100" step="10" required>
|
||||
<small>Animation speed (10-1000 milliseconds)</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="step-offset">Step Offset</label>
|
||||
<input type="number" id="step-offset" value="0" min="-1000" max="1000">
|
||||
<small>Step offset for group synchronization. Applied per device when preset is used in a group.</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="step-increment">Step Increment</label>
|
||||
<input type="number" id="step-increment" value="1" min="1" max="255">
|
||||
<small>Amount step counter increments per cycle. Controls pattern advancement speed.</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Pattern Parameters (N1-N8)</label>
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;">
|
||||
<small style="margin: 0;">Pattern-specific parameters (0-255, varies by pattern)</small>
|
||||
<button type="button" class="btn btn-secondary" onclick="setAllNValues(0)" style="padding: 6px 12px; font-size: 0.75rem;">Reset All to 0</button>
|
||||
</div>
|
||||
<div class="params-grid">
|
||||
<div class="param-input">
|
||||
<label>N1</label>
|
||||
<input type="number" id="n1" min="0" max="255" value="0" class="n-value-input">
|
||||
</div>
|
||||
<div class="param-input">
|
||||
<label>N2</label>
|
||||
<input type="number" id="n2" min="0" max="255" value="0" class="n-value-input">
|
||||
</div>
|
||||
<div class="param-input">
|
||||
<label>N3</label>
|
||||
<input type="number" id="n3" min="0" max="255" value="0" class="n-value-input">
|
||||
</div>
|
||||
<div class="param-input">
|
||||
<label>N4</label>
|
||||
<input type="number" id="n4" min="0" max="255" value="0" class="n-value-input">
|
||||
</div>
|
||||
<div class="param-input">
|
||||
<label>N5</label>
|
||||
<input type="number" id="n5" min="0" max="255" value="0" class="n-value-input">
|
||||
</div>
|
||||
<div class="param-input">
|
||||
<label>N6</label>
|
||||
<input type="number" id="n6" min="0" max="255" value="0" class="n-value-input">
|
||||
</div>
|
||||
<div class="param-input">
|
||||
<label>N7</label>
|
||||
<input type="number" id="n7" min="0" max="255" value="0" class="n-value-input">
|
||||
</div>
|
||||
<div class="param-input">
|
||||
<label>N8</label>
|
||||
<input type="number" id="n8" min="0" max="255" value="0" class="n-value-input">
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap;">
|
||||
<button type="button" class="btn btn-secondary" onclick="setAllNValues(0)" style="padding: 8px 16px; font-size: 0.875rem;">Set All to 0</button>
|
||||
<button type="button" class="btn btn-secondary" onclick="copyNValuesFromCurrent()" style="padding: 8px 16px; font-size: 0.875rem;">Copy from Current Settings</button>
|
||||
<button type="button" class="btn btn-secondary" onclick="showNValueHelp()" style="padding: 8px 16px; font-size: 0.875rem;">ℹ️ Parameter Help</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-actions">
|
||||
<button type="button" class="btn btn-secondary" onclick="closeModal()">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Save Preset</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let currentView = 'grid';
|
||||
let editingPreset = null;
|
||||
|
||||
// Delay slider update
|
||||
document.getElementById('preset-delay').addEventListener('input', function(e) {
|
||||
document.getElementById('delay-value-display').textContent = e.target.value;
|
||||
});
|
||||
|
||||
// Search functionality
|
||||
document.getElementById('search-input').addEventListener('input', function(e) {
|
||||
filterPresets();
|
||||
});
|
||||
|
||||
// Filter functionality
|
||||
document.getElementById('pattern-filter').addEventListener('change', function(e) {
|
||||
filterPresets();
|
||||
});
|
||||
|
||||
// Sort functionality
|
||||
document.getElementById('sort-select').addEventListener('change', function(e) {
|
||||
sortPresets(e.target.value);
|
||||
});
|
||||
|
||||
function filterPresets() {
|
||||
const search = document.getElementById('search-input').value.toLowerCase();
|
||||
const patternFilter = document.getElementById('pattern-filter').value;
|
||||
const cards = document.querySelectorAll('.preset-card');
|
||||
|
||||
cards.forEach(card => {
|
||||
const name = card.dataset.name.toLowerCase();
|
||||
const pattern = card.dataset.pattern;
|
||||
const matchesSearch = name.includes(search);
|
||||
const matchesPattern = !patternFilter || pattern === patternFilter;
|
||||
|
||||
if (matchesSearch && matchesPattern) {
|
||||
card.style.display = '';
|
||||
} else {
|
||||
card.style.display = 'none';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function sortPresets(sortBy) {
|
||||
const container = document.getElementById('presets-container');
|
||||
const cards = Array.from(container.querySelectorAll('.preset-card'));
|
||||
|
||||
cards.sort((a, b) => {
|
||||
if (sortBy === 'name') {
|
||||
return a.dataset.name.localeCompare(b.dataset.name);
|
||||
} else if (sortBy === 'recent') {
|
||||
// In real implementation, would use actual usage data
|
||||
return 0;
|
||||
} else if (sortBy === 'created') {
|
||||
// In real implementation, would use creation timestamps
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
cards.forEach(card => container.appendChild(card));
|
||||
}
|
||||
|
||||
function setView(view) {
|
||||
currentView = view;
|
||||
const container = document.getElementById('presets-container');
|
||||
const gridBtn = document.getElementById('view-grid');
|
||||
const listBtn = document.getElementById('view-list');
|
||||
|
||||
if (view === 'grid') {
|
||||
container.style.gridTemplateColumns = 'repeat(auto-fill, minmax(300px, 1fr))';
|
||||
gridBtn.classList.add('active');
|
||||
listBtn.classList.remove('active');
|
||||
} else {
|
||||
container.style.gridTemplateColumns = '1fr';
|
||||
gridBtn.classList.remove('active');
|
||||
listBtn.classList.add('active');
|
||||
}
|
||||
}
|
||||
|
||||
function showCreateModal() {
|
||||
editingPreset = null;
|
||||
document.getElementById('modal-title').textContent = 'Create Preset';
|
||||
document.getElementById('preset-form').reset();
|
||||
document.getElementById('preset-delay').value = 100;
|
||||
document.getElementById('delay-value-display').textContent = '100';
|
||||
// Reset to 2 colors
|
||||
initializeColorPickers();
|
||||
document.getElementById('preset-modal').classList.add('active');
|
||||
}
|
||||
|
||||
// Initialize color pickers function (defined before showCreateModal)
|
||||
const presetColorPickers = [];
|
||||
|
||||
function initializeColorPickers() {
|
||||
const colorInputs = document.getElementById('color-inputs');
|
||||
colorInputs.innerHTML = '';
|
||||
presetColorPickers.length = 0;
|
||||
addColorPicker('#FF0000');
|
||||
addColorPicker('#0000FF');
|
||||
}
|
||||
|
||||
function addColorPicker(color = '#00FF00') {
|
||||
const colorInputs = document.getElementById('color-inputs');
|
||||
const wrapper = document.createElement('div');
|
||||
wrapper.className = 'color-input-wrapper';
|
||||
colorInputs.appendChild(wrapper);
|
||||
|
||||
const picker = new ColorPicker(wrapper, {
|
||||
initialColor: color,
|
||||
onColorChange: (newColor) => {
|
||||
console.log('Preset color changed:', newColor);
|
||||
}
|
||||
});
|
||||
|
||||
presetColorPickers.push(picker);
|
||||
return picker;
|
||||
}
|
||||
|
||||
function editPreset(name) {
|
||||
editingPreset = name;
|
||||
document.getElementById('modal-title').textContent = 'Edit Preset';
|
||||
// In real implementation, would load preset data
|
||||
document.getElementById('preset-name').value = name;
|
||||
document.getElementById('preset-modal').classList.add('active');
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
document.getElementById('preset-modal').classList.remove('active');
|
||||
editingPreset = null;
|
||||
}
|
||||
|
||||
|
||||
function applyPreset(name) {
|
||||
alert(`Applying preset: ${name}\n(In real implementation, this would send preset configuration to device(s))`);
|
||||
}
|
||||
|
||||
function deletePreset(name) {
|
||||
if (confirm(`Delete preset "${name}"?`)) {
|
||||
alert(`Preset "${name}" deleted\n(In real implementation, this would remove the preset from storage)`);
|
||||
}
|
||||
}
|
||||
|
||||
function syncPresets() {
|
||||
if (confirm('Sync all presets to all devices?\nThis will send all presets from master to all devices via ESPNow.')) {
|
||||
alert('Syncing presets to all devices...\n(In real implementation, this would send all presets via ESPNow to all devices)');
|
||||
}
|
||||
}
|
||||
|
||||
function setAllNValues(value) {
|
||||
for (let i = 1; i <= 8; i++) {
|
||||
document.getElementById(`n${i}`).value = value;
|
||||
}
|
||||
}
|
||||
|
||||
function copyNValuesFromCurrent() {
|
||||
// In real implementation, this would copy from current device settings
|
||||
alert('Copying N values from current device settings...\n(In real implementation, this would load current N1-N8 values from the active device)');
|
||||
// Example: would set values like this:
|
||||
// document.getElementById('n1').value = currentSettings.n1;
|
||||
// ... etc
|
||||
}
|
||||
|
||||
function showNValueHelp() {
|
||||
const helpText = `
|
||||
Pattern Parameter Guide:
|
||||
|
||||
Rainbow:
|
||||
N1: Step increment (1-255, default: 1)
|
||||
|
||||
Pulse:
|
||||
N1: Attack time in ms (0-255)
|
||||
N2: Hold time in ms (0-255)
|
||||
N3: Decay time in ms (0-255)
|
||||
|
||||
Chase:
|
||||
N1: LEDs of color 0 (1-255)
|
||||
N2: LEDs of color 1 (1-255)
|
||||
N3: Step movement on odd steps (can be negative)
|
||||
N4: Step movement on even steps (can be negative)
|
||||
|
||||
Circle:
|
||||
N1: Head moves per second (1-255)
|
||||
N2: Max length in LEDs (1-255)
|
||||
N3: Tail moves per second (1-255)
|
||||
N4: Min length in LEDs (0-255)
|
||||
|
||||
Other patterns:
|
||||
N1-N8: Reserved for future pattern enhancements
|
||||
|
||||
All values range from 0-255 unless otherwise specified.
|
||||
`;
|
||||
alert(helpText);
|
||||
}
|
||||
|
||||
// Form submission
|
||||
document.getElementById('preset-form').addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
const name = document.getElementById('preset-name').value;
|
||||
const action = editingPreset ? 'updated' : 'created';
|
||||
alert(`Preset "${name}" ${action}!\n(In real implementation, this would save the preset to storage)`);
|
||||
closeModal();
|
||||
});
|
||||
|
||||
// Close modal on outside click
|
||||
document.getElementById('preset-modal').addEventListener('click', function(e) {
|
||||
if (e.target === this) {
|
||||
closeModal();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script src="color-picker.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,491 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>LED Driver - Settings</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
||||
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
||||
min-height: 100vh;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.header {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 24px;
|
||||
margin-bottom: 24px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
color: #667eea;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.header p {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 24px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.card h2 {
|
||||
color: #667eea;
|
||||
margin-bottom: 20px;
|
||||
font-size: 1.5rem;
|
||||
border-bottom: 2px solid #e0e0e0;
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.form-group input[type="text"],
|
||||
.form-group input[type="number"],
|
||||
.form-group input[type="password"],
|
||||
.form-group select {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
font-size: 1rem;
|
||||
transition: border-color 0.2s;
|
||||
}
|
||||
|
||||
.form-group input:focus,
|
||||
.form-group select:focus {
|
||||
outline: none;
|
||||
border-color: #667eea;
|
||||
}
|
||||
|
||||
.form-group input[type="range"] {
|
||||
width: 100%;
|
||||
height: 8px;
|
||||
border-radius: 4px;
|
||||
background: #e0e0e0;
|
||||
outline: none;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
.form-group input[type="range"]::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background: #667eea;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.form-group input[type="range"]::-moz-range-thumb {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background: #667eea;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.value-display {
|
||||
display: inline-block;
|
||||
margin-left: 12px;
|
||||
font-weight: 600;
|
||||
color: #667eea;
|
||||
min-width: 60px;
|
||||
}
|
||||
|
||||
.form-group small {
|
||||
display: block;
|
||||
margin-top: 4px;
|
||||
color: #666;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.checkbox-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.checkbox-group input[type="checkbox"] {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.color-order {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.color-order-option {
|
||||
flex: 1;
|
||||
min-width: 120px;
|
||||
padding: 12px;
|
||||
border: 2px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.color-order-option:hover {
|
||||
border-color: #667eea;
|
||||
}
|
||||
|
||||
.color-order-option.selected {
|
||||
border-color: #667eea;
|
||||
background: #667eea;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.color-order-option .color-boxes {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.color-box {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.color-box.r { background: #ff0000; }
|
||||
.color-box.g { background: #00ff00; }
|
||||
.color-box.b { background: #0000ff; }
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin-top: 32px;
|
||||
padding-top: 24px;
|
||||
border-top: 2px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 12px 24px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: #667eea;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: #5568d3;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: #e0e0e0;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background: #d0d0d0;
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background: #f44336;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-danger:hover {
|
||||
background: #d32f2f;
|
||||
}
|
||||
|
||||
.btn-full {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.section-divider {
|
||||
height: 1px;
|
||||
background: #e0e0e0;
|
||||
margin: 24px 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1>Device Settings</h1>
|
||||
<p>Configure your LED driver device settings</p>
|
||||
</div>
|
||||
|
||||
<!-- Basic Settings -->
|
||||
<div class="card">
|
||||
<h2>Basic Settings</h2>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Device Name</label>
|
||||
<input type="text" id="device-name" value="led-device1" placeholder="led-device1">
|
||||
<small>Unique identifier for this device</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>LED Pin</label>
|
||||
<input type="number" id="led-pin" value="10" min="0" max="40">
|
||||
<small>GPIO pin number connected to LED data line</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Number of LEDs</label>
|
||||
<input type="number" id="num-leds" value="50" min="1" max="1000">
|
||||
<small>Total number of LEDs in your strip</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Color Order</label>
|
||||
<div class="color-order">
|
||||
<div class="color-order-option selected" data-order="rgb">
|
||||
RGB
|
||||
<div class="color-boxes">
|
||||
<div class="color-box r"></div>
|
||||
<div class="color-box g"></div>
|
||||
<div class="color-box b"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="color-order-option" data-order="rbg">
|
||||
RBG
|
||||
<div class="color-boxes">
|
||||
<div class="color-box r"></div>
|
||||
<div class="color-box b"></div>
|
||||
<div class="color-box g"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="color-order-option" data-order="grb">
|
||||
GRB
|
||||
<div class="color-boxes">
|
||||
<div class="color-box g"></div>
|
||||
<div class="color-box r"></div>
|
||||
<div class="color-box b"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="color-order-option" data-order="gbr">
|
||||
GBR
|
||||
<div class="color-boxes">
|
||||
<div class="color-box g"></div>
|
||||
<div class="color-box b"></div>
|
||||
<div class="color-box r"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="color-order-option" data-order="brg">
|
||||
BRG
|
||||
<div class="color-boxes">
|
||||
<div class="color-box b"></div>
|
||||
<div class="color-box r"></div>
|
||||
<div class="color-box g"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="color-order-option" data-order="bgr">
|
||||
BGR
|
||||
<div class="color-boxes">
|
||||
<div class="color-box b"></div>
|
||||
<div class="color-box g"></div>
|
||||
<div class="color-box r"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Pattern Settings -->
|
||||
<div class="card">
|
||||
<h2>Pattern Settings</h2>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Pattern</label>
|
||||
<select id="pattern">
|
||||
<option value="on">On</option>
|
||||
<option value="off">Off</option>
|
||||
<option value="blink">Blink</option>
|
||||
<option value="chase">Chase</option>
|
||||
<option value="circle">Circle</option>
|
||||
<option value="pulse">Pulse</option>
|
||||
<option value="rainbow">Rainbow</option>
|
||||
<option value="transition">Transition</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>
|
||||
Brightness
|
||||
<span class="value-display" id="brightness-value">100</span>%
|
||||
</label>
|
||||
<input type="range" id="brightness" min="0" max="100" value="100">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>
|
||||
Delay
|
||||
<span class="value-display" id="delay-value">100</span>ms
|
||||
</label>
|
||||
<input type="range" id="delay" min="10" max="1000" value="100" step="10">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Advanced Settings -->
|
||||
<div class="card">
|
||||
<h2>Advanced Settings</h2>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Step Counter</label>
|
||||
<input type="text" id="step-counter" value="0" readonly style="background: #f5f5f5; cursor: not-allowed;">
|
||||
<small>Current step position in pattern (read-only)</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="step-increment">
|
||||
Step Increment
|
||||
</label>
|
||||
<input type="number" id="step-increment" value="1" min="1" max="255">
|
||||
<small>Amount step counter increments per cycle. Controls pattern advancement speed.</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Pattern Parameters</label>
|
||||
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;">
|
||||
<div>
|
||||
<label style="font-size: 0.875rem;">N1</label>
|
||||
<input type="number" id="n1" value="0" min="0" max="255">
|
||||
</div>
|
||||
<div>
|
||||
<label style="font-size: 0.875rem;">N2</label>
|
||||
<input type="number" id="n2" value="0" min="0" max="255">
|
||||
</div>
|
||||
<div>
|
||||
<label style="font-size: 0.875rem;">N3</label>
|
||||
<input type="number" id="n3" value="0" min="0" max="255">
|
||||
</div>
|
||||
<div>
|
||||
<label style="font-size: 0.875rem;">N4</label>
|
||||
<input type="number" id="n4" value="0" min="0" max="255">
|
||||
</div>
|
||||
<div>
|
||||
<label style="font-size: 0.875rem;">N5</label>
|
||||
<input type="number" id="n5" value="0" min="0" max="255">
|
||||
</div>
|
||||
<div>
|
||||
<label style="font-size: 0.875rem;">N6</label>
|
||||
<input type="number" id="n6" value="0" min="0" max="255">
|
||||
</div>
|
||||
</div>
|
||||
<small>Pattern-specific parameters (varies by pattern)</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Device ID</label>
|
||||
<input type="number" id="device-id" value="1" min="0">
|
||||
<small>Unique numeric identifier</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox-group">
|
||||
<input type="checkbox" id="debug" checked>
|
||||
<label for="debug" style="margin: 0;">Debug Mode</label>
|
||||
</div>
|
||||
<small>Enable debug logging</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Network Settings -->
|
||||
<div class="card">
|
||||
<h2>Network Settings</h2>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Access Point Name</label>
|
||||
<input type="text" id="ap-name" value="led-AA:BB:CC:DD:EE:01" placeholder="led-device">
|
||||
<small>WiFi access point name for device configuration</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Access Point Password</label>
|
||||
<input type="password" id="ap-password" placeholder="Leave empty for open network">
|
||||
<small>Password for the access point (optional)</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="checkbox-group">
|
||||
<input type="checkbox" id="ap-enabled" checked>
|
||||
<label for="ap-enabled" style="margin: 0;">Enable Access Point</label>
|
||||
</div>
|
||||
<small>Allow device to create its own WiFi network</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Actions -->
|
||||
<div class="card">
|
||||
<div class="actions">
|
||||
<button class="btn btn-secondary btn-full" onclick="resetSettings()">Reset to Defaults</button>
|
||||
<button class="btn btn-primary btn-full" onclick="saveSettings()">Save Settings</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Brightness slider
|
||||
document.getElementById('brightness').addEventListener('input', function(e) {
|
||||
document.getElementById('brightness-value').textContent = e.target.value;
|
||||
});
|
||||
|
||||
// Delay slider
|
||||
document.getElementById('delay').addEventListener('input', function(e) {
|
||||
document.getElementById('delay-value').textContent = e.target.value;
|
||||
});
|
||||
|
||||
// Color order selection
|
||||
document.querySelectorAll('.color-order-option').forEach(option => {
|
||||
option.addEventListener('click', function() {
|
||||
document.querySelectorAll('.color-order-option').forEach(o => o.classList.remove('selected'));
|
||||
this.classList.add('selected');
|
||||
});
|
||||
});
|
||||
|
||||
function saveSettings() {
|
||||
alert('Settings saved! (This is a mockup)');
|
||||
}
|
||||
|
||||
function resetSettings() {
|
||||
if (confirm('Reset all settings to defaults?')) {
|
||||
alert('Settings reset! (This is a mockup)');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"g":{
|
||||
"df": {
|
||||
"pt": "on",
|
||||
"cl": ["#ff0000"],
|
||||
"br": 200,
|
||||
"n1": 10,
|
||||
"n2": 10,
|
||||
"n3": 10,
|
||||
"n4": 10,
|
||||
"n5": 10,
|
||||
"n6": 10,
|
||||
"dl": 100
|
||||
},
|
||||
"dj": {
|
||||
"pt": "blink",
|
||||
"cl": ["#00ff00"],
|
||||
"dl": 500
|
||||
}
|
||||
},
|
||||
"sv": true,
|
||||
"st": 0
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# espnow-sender
|
||||
|
||||
Minimal MicroPython project for receiving JSON over Microdot WebSocket.
|
||||
|
||||
- WebSocket endpoint: `/ws`
|
||||
- Entry point: `main.py`
|
||||
- Message template: `msg.json`
|
||||
@@ -0,0 +1,120 @@
|
||||
import asyncio
|
||||
import json
|
||||
|
||||
from microdot import Microdot
|
||||
from microdot.websocket import WebSocketError, with_websocket
|
||||
|
||||
import espnow
|
||||
import network
|
||||
from util import format_mac, parse_mac
|
||||
|
||||
|
||||
app = Microdot()
|
||||
_esp = None
|
||||
_known_peers = set()
|
||||
_ws_clients = set()
|
||||
|
||||
|
||||
def _init_espnow():
|
||||
global _esp
|
||||
sta = network.WLAN(network.STA_IF)
|
||||
sta.active(True)
|
||||
_esp = espnow.ESPNow()
|
||||
_esp.active(True)
|
||||
|
||||
|
||||
def _validate_envelope(obj):
|
||||
if obj.get("v") != "1":
|
||||
raise ValueError("message.v must be '1'")
|
||||
devices = obj["devices"]
|
||||
for address in devices.keys():
|
||||
parse_mac(address)
|
||||
return obj
|
||||
|
||||
|
||||
def _send_espnow(address, payload):
|
||||
if _esp is None:
|
||||
raise ValueError("espnow is not initialized")
|
||||
mac = parse_mac(address)
|
||||
msg = json.dumps(payload, separators=(",", ":")).encode("utf-8")
|
||||
if mac not in _known_peers:
|
||||
_esp.add_peer(mac)
|
||||
_known_peers.add(mac)
|
||||
_esp.send(mac, msg)
|
||||
return mac, len(msg)
|
||||
|
||||
|
||||
async def _broadcast_ws(obj):
|
||||
text = json.dumps(obj)
|
||||
dead = []
|
||||
for client in list(_ws_clients):
|
||||
try:
|
||||
await client.send(text)
|
||||
except Exception:
|
||||
dead.append(client)
|
||||
for client in dead:
|
||||
_ws_clients.discard(client)
|
||||
|
||||
|
||||
async def _espnow_receive_loop():
|
||||
while True:
|
||||
host, msg = _esp.recv(0)
|
||||
if not host:
|
||||
await asyncio.sleep(0.01)
|
||||
continue
|
||||
await _broadcast_ws(
|
||||
{
|
||||
"from": format_mac(host),
|
||||
"payload": msg.decode("utf-8"),
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@app.route("/ws")
|
||||
@with_websocket
|
||||
async def ws(request, ws):
|
||||
_ws_clients.add(ws)
|
||||
while True:
|
||||
try:
|
||||
raw = await ws.receive()
|
||||
except WebSocketError:
|
||||
break
|
||||
|
||||
if not raw:
|
||||
break
|
||||
|
||||
try:
|
||||
parsed = json.loads(raw)
|
||||
env = _validate_envelope(parsed)
|
||||
sent = []
|
||||
for address, payload in env["devices"].items():
|
||||
mac, payload_size = _send_espnow(address, payload)
|
||||
sent.append(
|
||||
{
|
||||
"address": format_mac(mac),
|
||||
"bytes": payload_size,
|
||||
}
|
||||
)
|
||||
except (ValueError, TypeError) as e:
|
||||
await ws.send(json.dumps({"ok": False, "error": str(e)}))
|
||||
continue
|
||||
|
||||
await ws.send(
|
||||
json.dumps(
|
||||
{
|
||||
"ok": True,
|
||||
"sent": sent,
|
||||
}
|
||||
)
|
||||
)
|
||||
_ws_clients.discard(ws)
|
||||
|
||||
|
||||
async def main(port=80):
|
||||
_init_espnow()
|
||||
asyncio.create_task(_espnow_receive_loop())
|
||||
await app.start_server(host="0.0.0.0", port=port)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main(port=80))
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"v": "1",
|
||||
"devices": {
|
||||
"ff:ff:ff:ff:ff:ff": {
|
||||
"presets": {
|
||||
"preset_id": {
|
||||
"pattern": "on",
|
||||
"colors": ["#FF0000"],
|
||||
"delay": 100,
|
||||
"brightness": 255,
|
||||
"auto": true
|
||||
}
|
||||
},
|
||||
"select": {
|
||||
"preset": "preset_id",
|
||||
"step": 0
|
||||
},
|
||||
"save": true,
|
||||
"default": "preset_id",
|
||||
"b": 255
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
def parse_mac(value):
|
||||
raw = value.strip().lower().replace(":", "").replace("-", "")
|
||||
if len(raw) != 12:
|
||||
raise ValueError("address must be 12 hex chars or aa:bb:cc:dd:ee:ff")
|
||||
try:
|
||||
return bytes.fromhex(raw)
|
||||
except ValueError:
|
||||
raise ValueError("address contains non-hex characters")
|
||||
|
||||
|
||||
def format_mac(mac_bytes):
|
||||
return ":".join("{:02x}".format(b) for b in mac_bytes)
|
||||
@@ -0,0 +1 @@
|
||||
{"ambiguous_scale": "", "code_only": false, "epoch": "v0.9.101-s36-g1339418af9f9", "excludes": [], "follow_symlinks": false, "full_clean": true, "gitignore": true, "graph_mtime_ns": 1794396558448981640, "graph_size": 3355638, "html_present": true, "no_cluster": false, "rcfile": "", "scan_digest": "9eaa77f8bb2f8dbadf43cb5d942b4c65", "scan_root": "/home/jimmy/projects/led-controller", "viz_node_limit": ""}
|
||||
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"1": "htmx Library",
|
||||
"3": "Browser Tests & Mockup Images",
|
||||
"4": "Audio UI (JS)",
|
||||
"5": "ESP-NOW TX & DMX Pulse",
|
||||
"7": "led-tool Device CLI",
|
||||
"10": "Spec: Pi Animation Engine",
|
||||
"12": "Presets UI (JS)",
|
||||
"13": "Zones UI (JS)",
|
||||
"16": "Sequences UI (JS)",
|
||||
"19": "led_strip Component Docs",
|
||||
"20": "Art-Net Output",
|
||||
"28": "Devices UI (JS)",
|
||||
"30": "Colour Picker Mockups",
|
||||
"36": "API Docs: Outputs & Audio",
|
||||
"39": "Beat Detection DSP (C)",
|
||||
"47": "USB Latency Tools",
|
||||
"48": "Colour Picker JS",
|
||||
"49": "Chromium Colour Picker JS",
|
||||
"51": "API Tests: Devices",
|
||||
"53": "mpremote Transport",
|
||||
"54": "Outputs Config (C)",
|
||||
"60": "mpremote Serial Transport",
|
||||
"61": "API Test Fixtures & Audio",
|
||||
"62": "Microdot Request (dmx)",
|
||||
"63": "Help: Zones & Palette",
|
||||
"70": "Index Page Modals",
|
||||
"73": "Microdot WebSocket (dmx)",
|
||||
"76": "Controller Overview & OTA Docs",
|
||||
"79": "Audio Monitor Page",
|
||||
"80": "Art-Net DMX Tests",
|
||||
"81": "DMX Output Manager",
|
||||
"85": "ESP-NOW Sender Bridge",
|
||||
"87": "Microdot Async IO (dmx)",
|
||||
"88": "DMX Settings",
|
||||
"91": "Microdot Routing (dmx)",
|
||||
"92": "Bench Test Plan",
|
||||
"95": "Microdot Auth (dmx)",
|
||||
"96": "Serial DMX & WiFi",
|
||||
"97": "DMX Pattern Player",
|
||||
"98": "DMX Preset Model",
|
||||
"101": "Groups UI (JS)",
|
||||
"103": "Help: Mobile Menu Image",
|
||||
"104": "Pattern Selector Mockup Image",
|
||||
"105": "Driver Pattern Docs",
|
||||
"109": "Driver Message API Docs",
|
||||
"111": "led_strip Manifest",
|
||||
"113": "Outputs UI (JS)",
|
||||
"114": "DMX Driver Docs",
|
||||
"115": "Help PDF: Overview",
|
||||
"116": "Mockups Index Image",
|
||||
"118": "Help: Header Toolbar Image",
|
||||
"119": "Help: Preset Editor Image",
|
||||
"120": "Dashboard Mockup Image",
|
||||
"121": "Device Management Mockup Image",
|
||||
"122": "Presets Mockup Image",
|
||||
"123": "Pattern Contract",
|
||||
"127": "Numpad Shortcuts (JS)",
|
||||
"129": "Colour Picker Demo Image",
|
||||
"130": "Settings Mockup Image",
|
||||
"134": "API Tests: Settings",
|
||||
"138": "Help: Colour Palette Image",
|
||||
"140": "LED Driver README",
|
||||
"142": "SPI Example Manifest",
|
||||
"145": "Help PDF: Modes",
|
||||
"146": "Help: Tab Preset Strip Image",
|
||||
"156": "RMT Example Manifest",
|
||||
"157": "Help Tab JS",
|
||||
"158": "Settings Page Template",
|
||||
"171": "List Search (JS)",
|
||||
"172": "DMX Solid Pattern",
|
||||
"173": "led-test Manifest",
|
||||
"174": "VPN Autoconnect Script",
|
||||
"175": "Zone Devices Panel",
|
||||
"176": "graphify Instructions",
|
||||
"180": "Device Mockup Modals",
|
||||
"181": "bulk.sh Script",
|
||||
"182": "deploy.sh Script",
|
||||
"183": "Driver install.sh",
|
||||
"185": "led-tool install.sh",
|
||||
"186": "Help PDF Build Script",
|
||||
"187": "Web Build Script",
|
||||
"188": "Patterns UI (JS)",
|
||||
"189": "DMX Patterns Init",
|
||||
"190": "Mockup Tab Switch",
|
||||
"191": "Spec: Pattern Selector UI",
|
||||
"192": "mpremote Package",
|
||||
"193": "Bundle Import/Export (JS)",
|
||||
"194": "Colour Palette (JS)",
|
||||
"195": "Profiles UI (JS)",
|
||||
"196": "Zone Palette (JS)"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"0": "5a6fe369b1e9eab9", "1": "2d791c43bb8436ec", "2": "b549e617825efc45", "3": "658093cbc50e95df", "4": "7221607390cbf8f4", "5": "b441bdea17ad6297", "6": "f3e3f8fa8f323411", "7": "f1cd30037a4aa8fa", "8": "c7753eeed86c8002", "9": "5e6bedc1d8578bcb", "10": "ba809033c2ac79db", "11": "1cdb300036b95f18", "12": "cd9a1302e31a16be", "13": "38e3459e42de82ae", "14": "907a7a5a980e7ee9", "15": "55f791413a3c65b8", "16": "7dd1b08d3601a3f4", "17": "b4be1705befe2c85", "18": "be98f7b72ea43b2c", "19": "36e64b70bd3252ce", "20": "8fef51c59e728cbb", "21": "f3f303832b603793", "22": "b25a5c67c6b80682", "23": "afa2c3d7d54293f1", "24": "90c916e427b5ebfd", "25": "9521502a76e3926d", "26": "08c17760b6a78441", "27": "27e4c3eb54733fed", "28": "f55b318ce2ea37bf", "29": "a5cce0735423723c", "30": "8c465f3df9b2ddbd", "31": "b63da06d6ca05666", "32": "0a565e66eafdd7eb", "33": "944011bf47895ae9", "34": "3f0d61a8871fc63a", "35": "4f79d9f75a50cf01", "36": "503896ae7591c77b", "37": "2edd892aa6e5eaa8", "38": "312ff5e741d2a39f", "39": "d0ff09e1589219cc", "40": "0cbacf6eb12d6315", "41": "64b6c5772748a82d", "42": "01dfdff7dbabb88c", "43": "56a6f4b36b77038f", "44": "bf21d11ea6c4fadf", "45": "5be380e898e13324", "46": "471f838c9f9faeb9", "47": "d5845e875703cccd", "48": "46b84e04c8a769a1", "49": "01bb51d3946bc98b", "50": "dbf9e50467c11779", "51": "fc3745c70cad6065", "52": "7e5187509e0145be", "53": "141393a45638779c", "54": "b761f45a82eacec9", "55": "5e6521bb93696132", "56": "8a68d6ebf88e07ea", "57": "b17e4e22dfe31a3d", "58": "973ac14a32bd0435", "59": "8ae951b21941381b", "60": "4899a61ba741a2f8", "61": "3a757a4e17e2cc29", "62": "88ecf3d949c8bbdc", "63": "3f32204f50610f42", "64": "6852de7c708dba55", "65": "81c20c6e0d0187d4", "66": "dc8e43fa499882ac", "67": "bd20a78a99f60228", "68": "e1fe5116ee8ce485", "69": "aef962d800518446", "70": "9affb95b7a8926f7", "71": "551d7508ae9dc04a", "72": "375c9adb2b24179c", "73": "298efcf42a95f405", "74": "9dd9fa4b945a0f59", "75": "6f7f2eba3df89704", "76": "6e5f52cb9e7a3080", "77": "689536a1995dc379", "78": "f2f70696e107cc5c", "79": "0aadcaffca2fec2f", "80": "b44b759b294e7fb1", "81": "2a44adbbdb7b2cc2", "82": "d48cec59dd722fd4", "83": "dd61dba571aab679", "84": "238401c059f27744", "85": "67e8988d64ef02c3", "86": "c7a4d2e3858a9eeb", "87": "186dd13162172b05", "88": "281e8bde953022f8", "89": "b2ccf867707890e2", "90": "6f2dd301866c484e", "91": "8726692dfc1a3d69", "92": "fe3f7fa17b6e9140", "93": "1c9c389e7ea7dd32", "94": "a9147a14f38d1bad", "95": "84c30b82ce45e85f", "96": "f71d81296b66decd", "97": "1ff181597dc9980c", "98": "7f4284e17bf23520", "99": "3d6b7edec8e513d8", "100": "50b0e31410e284e6", "101": "e8c3d507c7523478", "102": "729a2de1ab6b12b5", "103": "89850ee47c9ca738", "104": "6b44fd779534127a", "105": "98b16b4bcf978a30", "106": "aeb73082ae7eab1a", "107": "f4f2630b6fbd48ca", "108": "50ea206ca32f8368", "109": "62dfdb23b2c54d82", "110": "7d5b56eb98869909", "111": "66b50b0357357d62", "112": "f07f0a842de7350e", "113": "66e63867ee9ac604", "114": "b87bf40ea7db9bd2", "115": "f3b1e77b5ff745de", "116": "2d5d657b0cb526af", "117": "9a63ee4db57902d7", "118": "4b507a629ac7f04f", "119": "c394c3d1e26256c8", "120": "8059a64174d9729b", "121": "b77edb57c9058871", "122": "9b758d47bd1a6c69", "123": "3757904e987193d1", "127": "682784ef7eb6ab79", "129": "93fc8b4ad7c9ca62", "130": "8363eed2536a6846", "131": "fe6e422923b8d6ef", "134": "692d38c636992a64", "135": "a7796e8a95a7935c", "138": "513f0c5816361dda", "140": "7f4e0effc09d9671", "141": "ab64084e0052dd1b", "142": "01c470ad572a2a84", "143": "9767524947f5d239", "144": "a7a26633381cc935", "145": "8fc084b6564c04cd", "146": "cb4b693c8a2db3d0", "149": "79da6ef18a0fc9bb", "150": "e7d4ba7c2a13b959", "155": "59ee4fee36503aee", "156": "f7b8f6a932f020e1", "157": "2baed17a20d35d4e", "158": "1496a7273bd8cbf0", "159": "70c38a287cac17ff", "166": "884b25ce5534ca30", "167": "8c903324815075bf", "170": "ca0193e69e1cf4c6", "171": "c8052f332c3d2369", "172": "ffa84e66ab7f2c83", "173": "9bcf4d1a57c0ba2a", "174": "6ca582b7df7276a1", "175": "de377ed03b71265f", "176": "1fb6d892ae8678c7", "180": "5ae949a86bd02dd3", "181": "040c831fbc62df23", "182": "09fe188418c42b7a", "183": "90b339bb352b5f47", "185": "ced44d681e2ec183", "186": "ff963270b8878129", "187": "bb41b7312f4e3083", "188": "a08753a73e0ca7d5", "189": "0cadf82de76cac0c", "190": "f40e0095eef0a2a1", "191": "2427a73600db473c", "192": "ae89d1eb8e024c9a", "193": "25a3de734ba30abf", "194": "6d34a1978e2935a7", "195": "8ae29623c3cfc6a6", "196": "32051c55a4723b9c", "197": "227d5082400af4ff", "199": "37b8871950bf5c3b", "201": "d2369c4cd0208ca6", "204": "54defa1f3d2a9a86", "209": "5fd8f1c618642991", "210": "363020d929127998", "211": "24c2db367e0711da", "214": "d651aa39cd803275", "227": "cc359b28b621fe98", "229": "83c733c01acff1c0", "231": "92b69d5dfa1439e0", "235": "dbe9ebef6953c86b", "236": "2b8491e23b3448a8", "237": "97756402288d8dbd"}
|
||||
@@ -0,0 +1,96 @@
|
||||
{
|
||||
"0": "IdfDevice",
|
||||
"2": "machine.py",
|
||||
"6": "audio.c",
|
||||
"8": "ab",
|
||||
"9": "Compiler",
|
||||
"11": "led-driver/main/ota.c",
|
||||
"14": "patterns.c",
|
||||
"15": "new_id",
|
||||
"17": "server.py",
|
||||
"18": "main/main.c",
|
||||
"21": "main/main.c",
|
||||
"22": "esp_log",
|
||||
"23": "engine.c",
|
||||
"24": "ws.c",
|
||||
"25": "Microdot",
|
||||
"26": "led_strip_rmt_dev.c",
|
||||
"27": "seqplay.c",
|
||||
"29": "binary_envelope.py",
|
||||
"31": "PyboardCommand",
|
||||
"32": "beat.c",
|
||||
"33": "web.cpp",
|
||||
"34": "test_sequences.py",
|
||||
"35": "microdot.py",
|
||||
"37": "led_strip_spi_dev.c",
|
||||
"38": "store_save",
|
||||
"40": "audio_api.c",
|
||||
"41": "sim_stubs.c",
|
||||
"42": "run_all",
|
||||
"43": "ws_client.cpp",
|
||||
"44": "time",
|
||||
"45": "test_presets.py",
|
||||
"46": "BridgeSim",
|
||||
"50": "WS2812",
|
||||
"52": "Transport",
|
||||
"55": "patterns.cpp",
|
||||
"56": "test_routes.py",
|
||||
"57": "ESPNow",
|
||||
"58": "test_outputs.py",
|
||||
"59": "microdot.py",
|
||||
"64": "ddp_test.py",
|
||||
"65": "test_audio.py",
|
||||
"66": "esp_timer_get_time",
|
||||
"67": "os",
|
||||
"68": "build_app",
|
||||
"69": "main/ota.c",
|
||||
"71": "NeoPixel",
|
||||
"72": "_simlink.py",
|
||||
"74": "store_lock",
|
||||
"75": "json",
|
||||
"77": "usb_cfg.cpp",
|
||||
"78": "urandom.py",
|
||||
"82": "bridge_sim.py",
|
||||
"83": "LedSimulatorApp",
|
||||
"84": "unique",
|
||||
"86": "net.cpp",
|
||||
"89": "Rig",
|
||||
"90": "packet",
|
||||
"93": "envelope.c",
|
||||
"94": "api_call_t",
|
||||
"99": "status_get_handler",
|
||||
"100": "ddp.cpp",
|
||||
"102": "rig_seed.py",
|
||||
"106": "._loop_main",
|
||||
"107": "find_devices",
|
||||
"108": "esp_timer_get_time",
|
||||
"110": "engine_init",
|
||||
"112": "ws_slot_t",
|
||||
"117": "read_serial",
|
||||
"131": "sim_demo.py",
|
||||
"135": "store_coll",
|
||||
"141": "machine.py",
|
||||
"143": "test_rig_sim.py",
|
||||
"144": "settings_editor.js",
|
||||
"149": "res_device.c",
|
||||
"150": "api_error",
|
||||
"155": "app.js",
|
||||
"159": "led-driver/web/app.js",
|
||||
"166": "sequences_route",
|
||||
"167": "api_id",
|
||||
"170": "dependencies",
|
||||
"197": "presets.cpp",
|
||||
"199": "res_group.c",
|
||||
"201": "_simlink_web.py",
|
||||
"204": "_simlink_proc.py",
|
||||
"209": "WLAN",
|
||||
"210": "fetch_cache.js",
|
||||
"211": "NoCaseDict",
|
||||
"214": "SimRing",
|
||||
"227": "dependencies",
|
||||
"229": "examples/blink.py",
|
||||
"231": "led_driver_sim_hook.py",
|
||||
"235": "driver-worker.js",
|
||||
"236": "layout.js",
|
||||
"237": "README.md"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
/home/jimmy/.local/share/pipx/venvs/graphifyy/bin/python
|
||||
@@ -0,0 +1 @@
|
||||
.
|
||||
@@ -0,0 +1,162 @@
|
||||
{
|
||||
"1": "htmx Library",
|
||||
"3": "Browser Tests & Mockup Images",
|
||||
"4": "Audio UI (JS)",
|
||||
"5": "ESP-NOW TX & DMX Pulse",
|
||||
"6": "Driver OTA over ESP-NOW",
|
||||
"7": "led-tool Device CLI",
|
||||
"10": "Spec: Pi Animation Engine",
|
||||
"11": "Beat Sync on Driver",
|
||||
"12": "Presets UI (JS)",
|
||||
"13": "Zones UI (JS)",
|
||||
"14": "Pattern Store & Web (C)",
|
||||
"15": "ESP-NOW Receive Tests",
|
||||
"16": "Sequences UI (JS)",
|
||||
"17": "Driver Controller Messages",
|
||||
"18": "ESP-IDF System Deps",
|
||||
"19": "led_strip Component Docs",
|
||||
"20": "Art-Net Output",
|
||||
"21": "Reliable ESP-NOW Link (C)",
|
||||
"22": "led-test RMT Example",
|
||||
"23": "Driver Presets Store",
|
||||
"25": "Microdot App (dmx)",
|
||||
"26": "Microdot App (led)",
|
||||
"28": "Devices UI (JS)",
|
||||
"29": "DMX Driver HTTP App",
|
||||
"30": "Colour Picker Mockups",
|
||||
"31": "ESP-NOW Wire & Transport",
|
||||
"32": "Audio Capture (C)",
|
||||
"33": "Driver OTA Broadcast (C)",
|
||||
"34": "API Tests: Sequences & Bundles",
|
||||
"35": "Binary Envelope (test)",
|
||||
"36": "API Docs: Outputs & Audio",
|
||||
"37": "mpremote Commands",
|
||||
"38": "Driver WiFi & Background Tasks",
|
||||
"39": "Beat Detection DSP (C)",
|
||||
"43": "Driver Test Runner",
|
||||
"44": "Microdot Helpers",
|
||||
"45": "Bridge WebSocket Blink Test",
|
||||
"47": "USB Latency Tools",
|
||||
"48": "Colour Picker JS",
|
||||
"49": "Chromium Colour Picker JS",
|
||||
"51": "API Tests: Devices",
|
||||
"52": "Presets & Settings Mockups",
|
||||
"53": "mpremote Transport",
|
||||
"54": "Outputs Config (C)",
|
||||
"55": "Microdot Handlers (dmx)",
|
||||
"56": "MultiDict (dmx)",
|
||||
"58": "Microdot Handlers (led)",
|
||||
"59": "MultiDict (led)",
|
||||
"60": "mpremote Serial Transport",
|
||||
"61": "API Test Fixtures & Audio",
|
||||
"62": "Microdot Request (dmx)",
|
||||
"63": "Help: Zones & Palette",
|
||||
"64": "Network & WebSocket (C)",
|
||||
"65": "Driver OTA Tool",
|
||||
"68": "API Tests: Zones",
|
||||
"69": "API Tests: Outputs & Routes",
|
||||
"70": "Index Page Modals",
|
||||
"71": "Microdot Templates (led)",
|
||||
"72": "Microdot Templates (dmx)",
|
||||
"73": "Microdot WebSocket (dmx)",
|
||||
"74": "Microdot WebSocket (led)",
|
||||
"76": "Controller Overview & OTA Docs",
|
||||
"78": "Driver Hello Discovery",
|
||||
"79": "Audio Monitor Page",
|
||||
"80": "Art-Net DMX Tests",
|
||||
"81": "DMX Output Manager",
|
||||
"83": "Microdot Sessions (led)",
|
||||
"84": "API Tests: Groups",
|
||||
"85": "ESP-NOW Sender Bridge",
|
||||
"86": "Firmware OTA (C)",
|
||||
"87": "Microdot Async IO (dmx)",
|
||||
"88": "DMX Settings",
|
||||
"89": "Microdot Async IO (led)",
|
||||
"90": "API Tests: Presets",
|
||||
"91": "Microdot Routing (dmx)",
|
||||
"92": "Bench Test Plan",
|
||||
"93": "Microdot Routing (led)",
|
||||
"94": "Flame Pattern",
|
||||
"95": "Microdot Auth (dmx)",
|
||||
"96": "Serial DMX & WiFi",
|
||||
"97": "DMX Pattern Player",
|
||||
"98": "DMX Preset Model",
|
||||
"99": "Twinkle Pattern",
|
||||
"100": "Driver Settings",
|
||||
"101": "Groups UI (JS)",
|
||||
"102": "Microdot Auth (led)",
|
||||
"103": "Help: Mobile Menu Image",
|
||||
"104": "Pattern Selector Mockup Image",
|
||||
"105": "Driver Pattern Docs",
|
||||
"106": "Driver Preset Model",
|
||||
"108": "Microdot JWT Session",
|
||||
"109": "Driver Message API Docs",
|
||||
"110": "Driver Binary Envelope",
|
||||
"111": "led_strip Manifest",
|
||||
"112": "API Tests: Patterns",
|
||||
"113": "Outputs UI (JS)",
|
||||
"114": "DMX Driver Docs",
|
||||
"115": "Help PDF: Overview",
|
||||
"116": "Mockups Index Image",
|
||||
"118": "Help: Header Toolbar Image",
|
||||
"119": "Help: Preset Editor Image",
|
||||
"120": "Dashboard Mockup Image",
|
||||
"121": "Device Management Mockup Image",
|
||||
"122": "Presets Mockup Image",
|
||||
"123": "Pattern Contract",
|
||||
"124": "Microdot SessionDict",
|
||||
"125": "Meteor Pattern",
|
||||
"127": "Numpad Shortcuts (JS)",
|
||||
"128": "Blink Pattern Test",
|
||||
"129": "Colour Picker Demo Image",
|
||||
"130": "Settings Mockup Image",
|
||||
"131": "Aurora Pattern",
|
||||
"132": "Colour Cycle Pattern",
|
||||
"133": "Sparkle Pattern",
|
||||
"134": "API Tests: Settings",
|
||||
"137": "HTTPException (dmx)",
|
||||
"138": "Help: Colour Palette Image",
|
||||
"139": "HTTPException (led)",
|
||||
"140": "LED Driver README",
|
||||
"141": "Palette Morph Pattern",
|
||||
"142": "SPI Example Manifest",
|
||||
"145": "Help PDF: Modes",
|
||||
"146": "Help: Tab Preset Strip Image",
|
||||
"147": "Blink Pattern",
|
||||
"148": "Circle Pattern",
|
||||
"151": "Plasma Pattern",
|
||||
"152": "Radiate Pattern",
|
||||
"153": "Transition Pattern",
|
||||
"154": "Driver Runtime State",
|
||||
"156": "RMT Example Manifest",
|
||||
"157": "Help Tab JS",
|
||||
"158": "Settings Page Template",
|
||||
"168": "Rime Pattern",
|
||||
"170": "Controller Component Deps",
|
||||
"171": "List Search (JS)",
|
||||
"172": "DMX Solid Pattern",
|
||||
"173": "led-test Manifest",
|
||||
"174": "VPN Autoconnect Script",
|
||||
"175": "Zone Devices Panel",
|
||||
"176": "graphify Instructions",
|
||||
"177": "Microdot Package (dmx)",
|
||||
"178": "Microdot Package (led)",
|
||||
"179": "Env Check",
|
||||
"180": "Device Mockup Modals",
|
||||
"181": "bulk.sh Script",
|
||||
"182": "deploy.sh Script",
|
||||
"183": "Driver install.sh",
|
||||
"184": "Pattern Package Init",
|
||||
"185": "led-tool install.sh",
|
||||
"186": "Help PDF Build Script",
|
||||
"187": "Web Build Script",
|
||||
"188": "Patterns UI (JS)",
|
||||
"189": "DMX Patterns Init",
|
||||
"190": "Mockup Tab Switch",
|
||||
"191": "Spec: Pattern Selector UI",
|
||||
"192": "mpremote Package",
|
||||
"193": "Bundle Import/Export (JS)",
|
||||
"194": "Colour Palette (JS)",
|
||||
"195": "Profiles UI (JS)",
|
||||
"196": "Zone Palette (JS)"
|
||||
}
|
||||
@@ -0,0 +1,736 @@
|
||||
# Graph Report - led-controller (2026-11-04)
|
||||
|
||||
## Corpus Check
|
||||
- 299 files · ~205,335 words
|
||||
- Verdict: corpus is large enough that graph structure adds value.
|
||||
- Unclassified: 43 file(s) not represented in the graph (top: (none) 23, .mdc 6, .lock 4)
|
||||
|
||||
## Summary
|
||||
- 3436 nodes · 7652 edges · 203 communities (113 shown, 90 thin omitted)
|
||||
- Extraction: 88% EXTRACTED · 12% INFERRED · 0% AMBIGUOUS · INFERRED: 923 edges (avg confidence: 0.86)
|
||||
- Token cost: 0 input · 0 output
|
||||
|
||||
## Graph Freshness
|
||||
- Built from commit: `24d3c114`
|
||||
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
|
||||
- Run `graphify update .` after code changes (no API cost).
|
||||
|
||||
## Community Hubs (Navigation)
|
||||
- store_coll
|
||||
- htmx Library
|
||||
- run_tick
|
||||
- Browser Tests & Mockup Images
|
||||
- Audio UI (JS)
|
||||
- ESP-NOW TX & DMX Pulse
|
||||
- Driver OTA over ESP-NOW
|
||||
- led-tool Device CLI
|
||||
- style_mode
|
||||
- Compiler
|
||||
- Spec: Pi Animation Engine
|
||||
- Beat Sync on Driver
|
||||
- Presets UI (JS)
|
||||
- Zones UI (JS)
|
||||
- Pattern Store & Web (C)
|
||||
- ESP-NOW Receive Tests
|
||||
- Sequences UI (JS)
|
||||
- Driver Controller Messages
|
||||
- ESP-IDF System Deps
|
||||
- led_strip Component Docs
|
||||
- Art-Net Output
|
||||
- Reliable ESP-NOW Link (C)
|
||||
- led-test RMT Example
|
||||
- Driver Presets Store
|
||||
- serial
|
||||
- Microdot App (dmx)
|
||||
- Microdot App (led)
|
||||
- engine.c
|
||||
- Devices UI (JS)
|
||||
- DMX Driver HTTP App
|
||||
- Colour Picker Mockups
|
||||
- ESP-NOW Wire & Transport
|
||||
- Audio Capture (C)
|
||||
- Driver OTA Broadcast (C)
|
||||
- API Tests: Sequences & Bundles
|
||||
- Binary Envelope (test)
|
||||
- API Docs: Outputs & Audio
|
||||
- mpremote Commands
|
||||
- Driver WiFi & Background Tasks
|
||||
- Beat Detection DSP (C)
|
||||
- tests/patterns/bar_graph.py
|
||||
- Compiler
|
||||
- presets.py
|
||||
- Driver Test Runner
|
||||
- Microdot Helpers
|
||||
- Bridge WebSocket Blink Test
|
||||
- find_id_by_field
|
||||
- USB Latency Tools
|
||||
- Colour Picker JS
|
||||
- Chromium Colour Picker JS
|
||||
- led_strip_rmt_encoder.c
|
||||
- API Tests: Devices
|
||||
- Presets & Settings Mockups
|
||||
- mpremote Transport
|
||||
- Outputs Config (C)
|
||||
- Microdot Handlers (dmx)
|
||||
- MultiDict (dmx)
|
||||
- led_strip_spi_dev.c
|
||||
- Microdot Handlers (led)
|
||||
- MultiDict (led)
|
||||
- mpremote Serial Transport
|
||||
- API Test Fixtures & Audio
|
||||
- Microdot Request (dmx)
|
||||
- Help: Zones & Palette
|
||||
- Network & WebSocket (C)
|
||||
- Driver OTA Tool
|
||||
- api_error
|
||||
- SerialIntercept
|
||||
- API Tests: Zones
|
||||
- API Tests: Outputs & Routes
|
||||
- Index Page Modals
|
||||
- Microdot Templates (led)
|
||||
- Microdot Templates (dmx)
|
||||
- Microdot WebSocket (dmx)
|
||||
- Microdot WebSocket (led)
|
||||
- board.py
|
||||
- Controller Overview & OTA Docs
|
||||
- DMX
|
||||
- Driver Hello Discovery
|
||||
- Audio Monitor Page
|
||||
- Art-Net DMX Tests
|
||||
- DMX Output Manager
|
||||
- machine
|
||||
- Microdot Sessions (led)
|
||||
- API Tests: Groups
|
||||
- ESP-NOW Sender Bridge
|
||||
- Firmware OTA (C)
|
||||
- Microdot Async IO (dmx)
|
||||
- DMX Settings
|
||||
- Microdot Async IO (led)
|
||||
- API Tests: Presets
|
||||
- Microdot Routing (dmx)
|
||||
- Bench Test Plan
|
||||
- Microdot Routing (led)
|
||||
- Flame Pattern
|
||||
- Microdot Auth (dmx)
|
||||
- Serial DMX & WiFi
|
||||
- DMX Pattern Player
|
||||
- DMX Preset Model
|
||||
- Twinkle Pattern
|
||||
- Driver Settings
|
||||
- Groups UI (JS)
|
||||
- Microdot Auth (led)
|
||||
- Help: Mobile Menu Image
|
||||
- Pattern Selector Mockup Image
|
||||
- Driver Pattern Docs
|
||||
- Driver Preset Model
|
||||
- Blizzard
|
||||
- Microdot JWT Session
|
||||
- Driver Message API Docs
|
||||
- Driver Binary Envelope
|
||||
- led_strip Manifest
|
||||
- API Tests: Patterns
|
||||
- Outputs UI (JS)
|
||||
- DMX Driver Docs
|
||||
- Help PDF: Overview
|
||||
- Mockups Index Image
|
||||
- api_json
|
||||
- Help: Header Toolbar Image
|
||||
- Help: Preset Editor Image
|
||||
- Dashboard Mockup Image
|
||||
- Device Management Mockup Image
|
||||
- Presets Mockup Image
|
||||
- Pattern Contract
|
||||
- Microdot SessionDict
|
||||
- Meteor Pattern
|
||||
- ._feed_wdt
|
||||
- Numpad Shortcuts (JS)
|
||||
- Blink Pattern Test
|
||||
- Colour Picker Demo Image
|
||||
- Settings Mockup Image
|
||||
- Aurora Pattern
|
||||
- Colour Cycle Pattern
|
||||
- Sparkle Pattern
|
||||
- api_set
|
||||
- tests/patterns/clock_sweep.py
|
||||
- HTTPException (dmx)
|
||||
- Help: Colour Palette Image
|
||||
- HTTPException (led)
|
||||
- LED Driver README
|
||||
- Palette Morph Pattern
|
||||
- SPI Example Manifest
|
||||
- tests/patterns/aurora.py
|
||||
- marquee.py
|
||||
- Help PDF: Modes
|
||||
- Help: Tab Preset Strip Image
|
||||
- Blink Pattern
|
||||
- Circle Pattern
|
||||
- utime
|
||||
- heartbeat.py
|
||||
- Plasma Pattern
|
||||
- Radiate Pattern
|
||||
- Transition Pattern
|
||||
- Driver Runtime State
|
||||
- tests/patterns/plasma.py
|
||||
- RMT Example Manifest
|
||||
- Help Tab JS
|
||||
- Settings Page Template
|
||||
- groups_route
|
||||
- web.c
|
||||
- sequences_route
|
||||
- tests/patterns/pulse.py
|
||||
- store_save
|
||||
- breathing_dual.py
|
||||
- Flicker
|
||||
- tests/patterns/strobe_burst.py
|
||||
- tests/patterns/palette_morph.py
|
||||
- Rime Pattern
|
||||
- Particles
|
||||
- Controller Component Deps
|
||||
- List Search (JS)
|
||||
- DMX Solid Pattern
|
||||
- led-test Manifest
|
||||
- VPN Autoconnect Script
|
||||
- graphify Instructions
|
||||
- bulk.sh Script
|
||||
- deploy.sh Script
|
||||
- Driver install.sh
|
||||
- led-tool install.sh
|
||||
- Help PDF Build Script
|
||||
- Web Build Script
|
||||
- Spec: Pattern Selector UI
|
||||
- tests/patterns/circle.py
|
||||
- BarGraph
|
||||
- candle_glow.py
|
||||
- Orbit
|
||||
- src/patterns/rain_drops.py
|
||||
- Pulse
|
||||
|
||||
## God Nodes (most connected - your core abstractions)
|
||||
1. `Presets` - 67 edges
|
||||
2. `store_coll()` - 64 edges
|
||||
3. `api_error()` - 50 edges
|
||||
4. `api_json()` - 43 edges
|
||||
5. `unique()` - 37 edges
|
||||
6. `api_set()` - 35 edges
|
||||
7. `store_save()` - 35 edges
|
||||
8. `new_id()` - 35 edges
|
||||
9. `run_tick()` - 33 edges
|
||||
10. `api_id()` - 28 edges
|
||||
|
||||
## Surprising Connections (you probably didn't know these)
|
||||
- `Preset editor modal` --semantically_similar_to--> `Preset fields (pattern, colors, delay, brightness, auto, n1-n6)` [INFERRED] [semantically similar]
|
||||
web/templates/index.html → led-driver/docs/API.md
|
||||
- `led-driver-style pattern engine (Preset object)` --semantically_similar_to--> `led-driver MicroPython firmware (submodule)` [INFERRED] [semantically similar]
|
||||
dmx-driver/README.md → README.md
|
||||
- `espnow-sender Microdot WebSocket receiver` --semantically_similar_to--> `WebSocket /ws driver message relay` [INFERRED] [semantically similar]
|
||||
espnow-sender/README.md → docs/API.md
|
||||
- `Art-Net output (UDP 6454)` --semantically_similar_to--> `Outputs (DDP, Art-Net, sACN, DMX serial pixel fixtures)` [INFERRED] [semantically similar]
|
||||
dmx-driver/README.md → docs/API.md
|
||||
- `POST /patterns/upload (led-driver parity)` --semantically_similar_to--> `Patterns resource /patterns` [INFERRED] [semantically similar]
|
||||
dmx-driver/README.md → docs/API.md
|
||||
|
||||
## Import Cycles
|
||||
- None detected.
|
||||
|
||||
## Hyperedges (group relationships)
|
||||
- **Audio page live endpoints** — web_audio_status, web_audio_beats, web_audio_audio_wav, web_audio_time, web_audio_tap_ep [EXTRACTED 1.00]
|
||||
- **Beat latency measurement methods** — docs_api_bench_endpoints, docs_bench_test_usb_latency, docs_bench_test_logic_analyzer, docs_bench_test_beat_lead [EXTRACTED 1.00]
|
||||
- **Combined brightness factors** — docs_api_combined_brightness, docs_api_settings, docs_api_groups, docs_api_devices, docs_api_zones [EXTRACTED 1.00]
|
||||
- **Color picker feature set** — docs_mockups_images_color_picker_demo_hsb_color_model, docs_mockups_images_color_picker_demo_hex_rgb_input, docs_mockups_images_color_picker_demo_keyboard_accessibility, docs_mockups_images_color_picker_demo_cross_platform_consistency [EXTRACTED 1.00]
|
||||
- **Edit-mode-only management features** — docs_help_edit_mode, docs_help_zones_modal, docs_help_send_presets, docs_help_patterns_dialog, docs_help_colour_palette, docs_help_presets_list [EXTRACTED 1.00]
|
||||
- **Preset editor actions (Try, Default, Save & Send, Remove from zone)** — docs_help_try_action, docs_help_default_preset, docs_help_save_and_send, docs_help_remove_from_zone [EXTRACTED 1.00]
|
||||
- **Header actions aggregated in mobile Menu** — docs_images_help_mobile_menu_run_mode, docs_images_help_mobile_menu_profiles, docs_images_help_mobile_menu_tabs, docs_images_help_mobile_menu_presets, docs_images_help_mobile_menu_help [EXTRACTED 1.00]
|
||||
- **Device/Group Modal Flow** — docs_mockups_device_management_showadddevicemodal, docs_mockups_device_management_showaddgroupmodal, docs_mockups_device_management_closemodal, docs_mockups_device_management_savedevice [EXTRACTED 1.00]
|
||||
- **LED Driver UI Mockup Set** — docs_mockups_images_index_dashboard_mockup, docs_mockups_images_index_pattern_selector_mockup, docs_mockups_images_index_device_management_mockup, docs_mockups_images_index_settings_mockup, docs_mockups_images_index_presets_mockup [EXTRACTED 1.00]
|
||||
- **Selectable LED Patterns** — docs_mockups_images_pattern_selector_on, docs_mockups_images_pattern_selector_off, docs_mockups_images_pattern_selector_blink, docs_mockups_images_pattern_selector_chase, docs_mockups_images_pattern_selector_circle, docs_mockups_images_pattern_selector_pulse, docs_mockups_images_pattern_selector_rainbow, docs_mockups_images_pattern_selector_transition [EXTRACTED 1.00]
|
||||
- **Preset/pattern configuration schema (pattern, colors, delay, step increment, N1-N8)** — docs_mockups_presets_led_patterns, docs_mockups_presets_delay, docs_mockups_presets_step_increment, docs_mockups_presets_n_parameters, docs_mockups_presets_step_offset [EXTRACTED 1.00]
|
||||
- **Device settings sections** — docs_mockups_settings_basic_settings, docs_mockups_settings_pattern_settings, docs_mockups_settings_advanced_settings, docs_mockups_settings_network_settings [EXTRACTED 1.00]
|
||||
- **LED Driver UI Mockup Suite** — docs_mockups_index, docs_mockups_dashboard, docs_mockups_pattern_selector, docs_mockups_device_management, docs_mockups_readme_settings_mockup, docs_mockups_color_picker_readme_presets_mockup [EXTRACTED 1.00]
|
||||
- **Pi-to-ESP32 Command Paths** — docs_specification_serial_espnow_bridge, docs_specification_wifi_driver_tcp, docs_specification_espnow, docs_specification_pi_controller [EXTRACTED 1.00]
|
||||
- **led_strip backend choice (RMT vs SPI, DMA)** — scripts_led_test_managed_components_espressif__led_strip_readme_rmt_backend, scripts_led_test_managed_components_espressif__led_strip_readme_spi_backend, scripts_led_test_managed_components_espressif__led_strip_readme_dma_support, scripts_led_test_managed_components_espressif__led_strip_readme_backend_selection_flowchart [EXTRACTED 1.00]
|
||||
- **led_strip pixel write and flush flow** — scripts_led_test_managed_components_espressif__led_strip_api_led_strip_set_pixel, scripts_led_test_managed_components_espressif__led_strip_api_led_strip_set_pixel_hsv, scripts_led_test_managed_components_espressif__led_strip_api_led_strip_set_pixel_rgbw, scripts_led_test_managed_components_espressif__led_strip_api_led_strip_refresh, scripts_led_test_managed_components_espressif__led_strip_api_led_strip_clear [EXTRACTED 1.00]
|
||||
- **Dynamic pattern contract** — led_driver_docs_pattern_contract_class_shape, led_driver_docs_pattern_contract_run_generator_rules, led_driver_docs_pattern_contract_drawing_brightness, led_driver_docs_pattern_contract_step_semantics, led_driver_docs_pattern_contract_error_handling [EXTRACTED 1.00]
|
||||
- **Pi Animation Engine Output Pipeline** — docs_specification_pixel_generator, docs_specification_output_drivers, docs_specification_output_record, docs_specification_zone_playback, docs_specification_sequencer [EXTRACTED 1.00]
|
||||
- **Beat-Driven Scene Activation** — docs_specification_beat_detection_device, docs_specification_bpm_sync, docs_specification_beat_counter_phases, docs_specification_scene_queue [INFERRED 0.85]
|
||||
- **Fields defining an LED preset (name, pattern, colours, parameters)** — docs_images_help_preset_editor_preset_name_field, docs_images_help_preset_editor_pattern_selector, docs_images_help_preset_editor_palette_linked_colour, docs_images_help_preset_editor_preset_parameters [INFERRED 0.85]
|
||||
- **Pattern settings composed and applied to devices** — docs_mockups_images_dashboard_pattern_selection, docs_mockups_images_dashboard_brightness_speed, docs_mockups_images_dashboard_colors, docs_mockups_images_dashboard_apply_settings [INFERRED 0.85]
|
||||
- **Preset lifecycle actions (create, apply, sync)** — docs_mockups_images_presets_create_preset, docs_mockups_images_presets_apply_preset, docs_mockups_images_presets_sync_presets_to_all_devices [INFERRED 0.85]
|
||||
- **ESP-NOW driver delivery layers** — docs_api_binary_envelope, docs_api_delivery_digest, docs_bench_test_reliable_link, docs_bench_test_beat_double_send [INFERRED 0.85]
|
||||
- **v1 message handling on driver** — led_driver_docs_api_v1_message, led_driver_docs_patterns_process_data_flow, led_driver_docs_patterns_pattern_registry, led_driver_docs_patterns_preset_short_keys, led_driver_docs_api_select_message [INFERRED 0.85]
|
||||
|
||||
## Communities (203 total, 90 thin omitted)
|
||||
|
||||
### Community 0 - "store_coll"
|
||||
Cohesion: 0.19
|
||||
Nodes (33): api_register(), api_settings_defaults(), engine_groups_changed(), api_migrate_zones(), api_preset_defaults(), api_seed_defaults(), clone_profile(), clone_zone() (+25 more)
|
||||
|
||||
### Community 1 - "htmx Library"
|
||||
Cohesion: 0.08
|
||||
Nodes (101): a(), Ae(), an(), at(), B(), be(), bn(), bt() (+93 more)
|
||||
|
||||
### Community 2 - "run_tick"
|
||||
Cohesion: 0.06
|
||||
Nodes (22): run_tick(), main(), run_for(), main(), run_for(), main(), run_for(), main() (+14 more)
|
||||
|
||||
### Community 3 - "Browser Tests & Mockup Images"
|
||||
Cohesion: 0.06
|
||||
Nodes (17): generate_image(), generate_with_html2image(), generate_with_playwright(), generate_with_selenium(), main(), browser(), _browser_sleep(), BrowserTest (+9 more)
|
||||
|
||||
### Community 4 - "Audio UI (JS)"
|
||||
Cohesion: 0.11
|
||||
Nodes (58): applyAudioStatus(), applyServerAudioUiFields(), audioRunPreferredDeviceId(), beatSyncButtonTitle(), bind(), clampLiveBpm(), clampSimulatedBpm(), clearBeatPhaseTimers() (+50 more)
|
||||
|
||||
### Community 5 - "ESP-NOW TX & DMX Pulse"
|
||||
Cohesion: 0.07
|
||||
Nodes (19): beat_set_callback(), bench_on_beat_tx(), bench_on_echo(), bench_running(), bench_start(), bench_stop(), gen_cb(), gpio_mark() (+11 more)
|
||||
|
||||
### Community 6 - "Driver OTA over ESP-NOW"
|
||||
Cohesion: 0.10
|
||||
Nodes (30): handle(), _makedirs(), Ota, _remove(), safe_path(), _hash_file(), load(), _normalize_path() (+22 more)
|
||||
|
||||
### Community 7 - "led-tool Device CLI"
|
||||
Cohesion: 0.08
|
||||
Nodes (15): download_presets(), download_settings(), _get_ordered_actions(), main(), resolve_flash_binary(), upload_presets(), upload_settings(), copy_file() (+7 more)
|
||||
|
||||
### Community 9 - "Compiler"
|
||||
Cohesion: 0.13
|
||||
Nodes (4): Loader, Loader, Compiler, Loader
|
||||
|
||||
### Community 10 - "Spec: Pi Animation Engine"
|
||||
Cohesion: 0.07
|
||||
Nodes (46): Pi Animation Engine (src/engine), docs/API.md, Beat Counter and Phases, Beat Detection Device, Binary Message Protocol, BPM Sync, Dashboard UI (dashboard.html), usqlite Database Schema (presets, profiles, scenes, scene_groups) (+38 more)
|
||||
|
||||
### Community 11 - "Beat Sync on Driver"
|
||||
Cohesion: 0.07
|
||||
Nodes (37): BeatSync, _diff(), _due(), LinkRx, send(), frame(), run(), test_bad_frames() (+29 more)
|
||||
|
||||
### Community 12 - "Presets UI (JS)"
|
||||
Cohesion: 0.09
|
||||
Nodes (42): arrayToGrid(), coerceManualBeatN(), coercePresetAuto(), coercePresetBackground(), coercePresetInt(), createPresetButton(), deviceNamesForPresetOnCurrentZone(), editPresetFromTab() (+34 more)
|
||||
|
||||
### Community 13 - "Zones UI (JS)"
|
||||
Cohesion: 0.10
|
||||
Nodes (42): applyBrightnessSliders(), applyZoneContentKindEditModal(), clamp255(), computeZoneNamesTargets(), computeZonePresetUnionTargets(), computeZoneTargets(), createZone(), effectiveGroupIdsForZonePreset() (+34 more)
|
||||
|
||||
### Community 14 - "Pattern Store & Web (C)"
|
||||
Cohesion: 0.25
|
||||
Nodes (17): add_name(), base_name(), builtin(), create_driver_pattern(), create_pattern(), exists(), file_names(), file_path() (+9 more)
|
||||
|
||||
### Community 15 - "ESP-NOW Receive Tests"
|
||||
Cohesion: 0.12
|
||||
Nodes (14): get_wdt(), main(), MockESPNow, run_main_loop_iterations(), test_beat_functionality(), test_color_conversion(), test_full_message(), test_preset_creation() (+6 more)
|
||||
|
||||
### Community 16 - "Sequences UI (JS)"
|
||||
Cohesion: 0.11
|
||||
Nodes (33): addSequenceToTab(), appendZoneSequenceTiles(), applySequenceSwitchWaitFromServer(), buildLaneGroupIdsForEditor(), collectLanesFromEditor(), createSequenceTileRow(), deleteCurrentSequence(), fetchGroupsMapSeq() (+25 more)
|
||||
|
||||
### Community 17 - "Driver Controller Messages"
|
||||
Cohesion: 0.09
|
||||
Nodes (26): apply_brightness(), apply_clear_presets(), apply_default(), apply_device_config(), apply_patterns_ota(), apply_presets(), apply_select(), _config_flag() (+18 more)
|
||||
|
||||
### Community 18 - "ESP-IDF System Deps"
|
||||
Cohesion: 0.07
|
||||
Nodes (15): audio_api_register(), app_main(), eth_event_handler(), gateway_answers(), got_ip_event_handler(), have_static_ips(), parse_static(), settings_str() (+7 more)
|
||||
|
||||
### Community 19 - "led_strip Component Docs"
|
||||
Cohesion: 0.10
|
||||
Nodes (36): led_test ESP-IDF project, led_test main component (main.c), led_strip API Reference, led_model_t (WS2812/SK6812), led_pixel_format_t (GRB/GRBW), led_strip_clear(), led_strip_config_t, led_strip_del() (+28 more)
|
||||
|
||||
### Community 20 - "Art-Net Output"
|
||||
Cohesion: 0.10
|
||||
Nodes (9): ArtNet, as_channels(), build_artdmx(), _ip_bytes(), _pad(), port_lo(), ticks_diff(), ticks_ms() (+1 more)
|
||||
|
||||
### Community 21 - "Reliable ESP-NOW Link (C)"
|
||||
Cohesion: 0.09
|
||||
Nodes (21): skip_unresponsive(), espnow_tx_stats(), status_get_handler(), mic_get_level(), full_mask(), handle_rx(), peer_get(), record_done() (+13 more)
|
||||
|
||||
### Community 22 - "led-test RMT Example"
|
||||
Cohesion: 0.13
|
||||
Nodes (19): app_main(), app_main(), configure_led(), app_main(), configure_led(), led_strip_rmt_config_t, led_model_t, led_pixel_format_t (+11 more)
|
||||
|
||||
### Community 25 - "Microdot App (dmx)"
|
||||
Cohesion: 0.07
|
||||
Nodes (4): Microdot, mro(), _mro(), print_exception()
|
||||
|
||||
### Community 26 - "Microdot App (led)"
|
||||
Cohesion: 0.07
|
||||
Nodes (4): Microdot, mro(), _mro(), print_exception()
|
||||
|
||||
### Community 27 - "engine.c"
|
||||
Cohesion: 0.05
|
||||
Nodes (103): audio_handler(), audio_run(), events(), events_task(), ok_with_status(), send_all(), send_event(), send_json() (+95 more)
|
||||
|
||||
### Community 28 - "Devices UI (JS)"
|
||||
Cohesion: 0.11
|
||||
Nodes (30): applyEspnowPingAggregateToDots(), applyEspnowPingToDeviceRows(), applyTcpSnapshot(), applyTransportVisibility(), collectDeviceEditPayload(), createDeviceFromModal(), createDeviceIdentifyButton(), DEVICE_DOT_CLASSES (+22 more)
|
||||
|
||||
### Community 29 - "DMX Driver HTTP App"
|
||||
Cohesion: 0.09
|
||||
Nodes (9): _expand(), _preset_from_map(), process_data(), _select_entries(), _targets_for_key(), create_app(), serial_ports(), ws_handler() (+1 more)
|
||||
|
||||
### Community 30 - "Colour Picker Mockups"
|
||||
Cohesion: 0.11
|
||||
Nodes (25): Chromium-style Color Picker Demo, ColorPickerChromium Component, updateColors() (Chromium demo), Custom Color Picker Demo, updateColors() (standard demo), Custom Colour Picker README, POST /api/colors (example), ColorPicker Component (+17 more)
|
||||
|
||||
### Community 31 - "ESP-NOW Wire & Transport"
|
||||
Cohesion: 0.14
|
||||
Nodes (21): make_sender(), _dlog(), espnow_receive_loop(), _handle_packet(), init_espnow(), _schedule_ping_rsp(), send_boot_announce(), _send_ping_rsp() (+13 more)
|
||||
|
||||
### Community 32 - "Audio Capture (C)"
|
||||
Cohesion: 0.07
|
||||
Nodes (26): Pulse, audio_get_handler(), audio_register(), audio_stream_task(), beats_get_handler(), beats_stream_task(), send_all(), tap_post_handler() (+18 more)
|
||||
|
||||
### Community 33 - "Driver OTA Broadcast (C)"
|
||||
Cohesion: 0.19
|
||||
Nodes (18): broadcast_chunks(), chunk_done(), command(), data_pkt(), drain_status(), drv_ota_register(), drv_ota_send(), finish() (+10 more)
|
||||
|
||||
### Community 34 - "API Tests: Sequences & Bundles"
|
||||
Cohesion: 0.13
|
||||
Nodes (15): unique(), test_clone(), test_delete(), test_put(), test_put_current(), clock(), presets(), test_editing_stops_playback() (+7 more)
|
||||
|
||||
### Community 35 - "Binary Envelope (test)"
|
||||
Cohesion: 0.15
|
||||
Nodes (17): brightness_0_255_from_wire(), brightness_wire_from_0_255(), _clamp_i16(), _colors_to_rgb_list(), _decode_default_blob(), _decode_preset_record(), _decode_presets_blob(), _decode_select_blob() (+9 more)
|
||||
|
||||
### Community 36 - "API Docs: Outputs & Audio"
|
||||
Cohesion: 0.14
|
||||
Nodes (23): Art-Net output (UDP 6454), Audio API /api/audio and /audio page routes, Profile/preset/sequence JSON bundles (import/export), Combined brightness (global x groups x device x zone), /db collection export and replace, Devices resource /devices, Driver group membership lists (group ids, z<zone id>), Device groups resource /groups (+15 more)
|
||||
|
||||
### Community 38 - "Driver WiFi & Background Tasks"
|
||||
Cohesion: 0.12
|
||||
Nodes (10): presets_loop(), apply_startup_pattern(), print_mem(), snapshot(), initialize_runtime(), boot_sta(), connect_until_up(), _one_association_campaign() (+2 more)
|
||||
|
||||
### Community 39 - "Beat Detection DSP (C)"
|
||||
Cohesion: 0.27
|
||||
Nodes (16): beat_feed(), analyse_beat(), bar_cue(), bar_decide(), beat_dsp_feed(), beat_dsp_init(), beat_dsp_tap(), best_phase() (+8 more)
|
||||
|
||||
### Community 40 - "tests/patterns/bar_graph.py"
|
||||
Cohesion: 0.29
|
||||
Nodes (4): main(), run_for(), main(), run_for()
|
||||
|
||||
### Community 41 - "Compiler"
|
||||
Cohesion: 0.13
|
||||
Nodes (4): Loader, Loader, Compiler, Loader
|
||||
|
||||
### Community 42 - "presets.py"
|
||||
Cohesion: 0.24
|
||||
Nodes (4): is_reversed(), led_i(), signed(), convert_and_reorder_colors()
|
||||
|
||||
### Community 43 - "Driver Test Runner"
|
||||
Cohesion: 0.18
|
||||
Nodes (17): _bootstrap_import_path(), _pattern_loaded(), _process_message(), run_all(), _smoke_preset(), test_colour_conversion_and_transition(), test_default_requires_existing_preset(), test_default_targets_gate_by_device_name() (+9 more)
|
||||
|
||||
### Community 44 - "Microdot Helpers"
|
||||
Cohesion: 0.11
|
||||
Nodes (4): Request, G, urldecode_bytes(), urldecode_str()
|
||||
|
||||
### Community 45 - "Bridge WebSocket Blink Test"
|
||||
Cohesion: 0.11
|
||||
Nodes (10): build_blink_envelope(), _format_mac(), _load_bridge_url(), main(), _send(), print_settings(), _default_image(), _info() (+2 more)
|
||||
|
||||
### Community 46 - "find_id_by_field"
|
||||
Cohesion: 0.33
|
||||
Nodes (4): find_id_by_field(), test_scenes(), test_crud(), test_crud()
|
||||
|
||||
### Community 47 - "USB Latency Tools"
|
||||
Cohesion: 0.15
|
||||
Nodes (10): analyze(), edges(), main(), pct(), read(), fit_clock(), main(), pct() (+2 more)
|
||||
|
||||
### Community 50 - "led_strip_rmt_encoder.c"
|
||||
Cohesion: 0.15
|
||||
Nodes (10): led_strip_rmt_clear(), led_strip_rmt_del(), led_strip_rmt_refresh(), led_strip_rmt_set_pixel(), led_strip_rmt_set_pixel_rgbw(), led_strip_encoder_config_t, rmt_del_led_strip_encoder(), rmt_encode_led_strip() (+2 more)
|
||||
|
||||
### Community 52 - "Presets & Settings Mockups"
|
||||
Cohesion: 0.14
|
||||
Nodes (3): _convert_filesystem_error(), stdout_write_bytes(), Transport
|
||||
|
||||
### Community 53 - "mpremote Transport"
|
||||
Cohesion: 0.12
|
||||
Nodes (20): Presets Mockup Page, addColorPicker() / initializeColorPickers(), ColorPicker component (color-picker.js / color-picker.css), Preset Delay (animation speed, 10-1000 ms), ESPNow preset distribution, filterPresets() / sortPresets() search, filter and sort, LED Patterns (on, off, blink, chase, circle, pulse, rainbow, transition), Pattern Parameters N1-N8 (+12 more)
|
||||
|
||||
### Community 54 - "Outputs Config (C)"
|
||||
Cohesion: 0.23
|
||||
Nodes (16): defaults(), fail(), fill(), int_field(), num(), one_of(), put16(), resolve() (+8 more)
|
||||
|
||||
### Community 55 - "Microdot Handlers (dmx)"
|
||||
Cohesion: 0.11
|
||||
Nodes (5): invoke_handler(), iscoroutine(), Response, aclose(), __anext__()
|
||||
|
||||
### Community 57 - "led_strip_spi_dev.c"
|
||||
Cohesion: 0.15
|
||||
Nodes (13): led_strip_spi_config_t, led_strip_rmt_clear(), led_strip_rmt_del(), led_strip_rmt_refresh(), led_strip_rmt_set_pixel(), ws2812_rmt_adapter(), led_strip_new_spi_device(), __led_strip_spi_bit() (+5 more)
|
||||
|
||||
### Community 58 - "Microdot Handlers (led)"
|
||||
Cohesion: 0.11
|
||||
Nodes (5): invoke_handler(), iscoroutine(), Response, aclose(), __anext__()
|
||||
|
||||
### Community 60 - "mpremote Serial Transport"
|
||||
Cohesion: 0.18
|
||||
Nodes (3): SerialTransport, TransportError, TransportExecError
|
||||
|
||||
### Community 61 - "API Test Fixtures & Audio"
|
||||
Cohesion: 0.17
|
||||
Nodes (5): base_url(), c(), Client, profile(), restore_db()
|
||||
|
||||
### Community 62 - "Microdot Request (dmx)"
|
||||
Cohesion: 0.13
|
||||
Nodes (4): Request, G, urldecode_bytes(), urldecode_str()
|
||||
|
||||
### Community 63 - "Help: Zones & Palette"
|
||||
Cohesion: 0.13
|
||||
Nodes (18): Colour Palette (per profile), Zone default preset (default hint), DJ zone starter option, From Palette linked colours, LED driver JSON (presets, select, save, default, manifest), Patterns dialog, POST /presets/send, Preset editor (Try, Save, Send, Manual) (+10 more)
|
||||
|
||||
### Community 64 - "Network & WebSocket (C)"
|
||||
Cohesion: 0.44
|
||||
Nodes (5): forward(), on_open(), send_text(), ws_handler(), ws_register()
|
||||
|
||||
### Community 65 - "Driver OTA Tool"
|
||||
Cohesion: 0.09
|
||||
Nodes (9): Controller, file_set(), walk(), main(), norm_mac(), push(), wait_back(), info() (+1 more)
|
||||
|
||||
### Community 66 - "api_error"
|
||||
Cohesion: 0.19
|
||||
Nodes (22): api_body(), api_error(), api_json(), api_merge(), api_message(), api_preset_in_profile(), api_result(), api_split() (+14 more)
|
||||
|
||||
### Community 68 - "API Tests: Zones"
|
||||
Cohesion: 0.10
|
||||
Nodes (10): new_id(), test_preset_round_trip(), test_profile_round_trip(), test_sequence_round_trip(), test_clone(), test_clone_default_name(), test_delete_removes_from_profile(), test_play_and_stop() (+2 more)
|
||||
|
||||
### Community 70 - "Index Page Modals"
|
||||
Cohesion: 0.11
|
||||
Nodes (19): Audio Beat Detection modal, Header BPM / beat sync indicator, Colour Palette modal, Devices modal, Edit device modal, Edit Zone modal, Device groups modal, Header global brightness slider (+11 more)
|
||||
|
||||
### Community 75 - "board.py"
|
||||
Cohesion: 0.20
|
||||
Nodes (5): apply_cpu_freq(), default_led_pin(), mcu(), upload_pattern(), _safe_pattern_filename()
|
||||
|
||||
### Community 76 - "Controller Overview & OTA Docs"
|
||||
Cohesion: 0.17
|
||||
Nodes (16): led_controller ESP-IDF project, POST /patterns/upload (led-driver parity), Driver app update /drivers/ota (staged files, sha, commit/abort), Firmware OTA /ota (idle slot, rollback), Patterns resource /patterns, Driver app update over ESP-NOW test (tools/driver_ota.py), led-simulator, led-tool / led-cli serial device CLI (+8 more)
|
||||
|
||||
### Community 78 - "Driver Hello Discovery"
|
||||
Cohesion: 0.17
|
||||
Nodes (8): broadcast_hello_udp(), discover_controller_udp(), ipv4_broadcast(), pack_hello_bytes(), pack_hello_dict(), pack_hello_line(), udp_discovery_targets(), _udp_discovery_targets_single()
|
||||
|
||||
### Community 79 - "Audio Monitor Page"
|
||||
Cohesion: 0.16
|
||||
Nodes (16): /audio.wav live PCM stream, bar() bar-position renderer, /beats SSE event stream, draw() timeline canvas, Listen button (WAV stream playback via AudioContext), median(), Audio and beats page (/audio), stats() tap vs computer agreement (+8 more)
|
||||
|
||||
### Community 80 - "Art-Net DMX Tests"
|
||||
Cohesion: 0.23
|
||||
Nodes (9): parse(), _assert_eq(), main(), test_artnet_send_loopback(), test_build_artdmx(), test_fixture_patch(), test_pattern_blink_and_select(), test_pattern_upload() (+1 more)
|
||||
|
||||
### Community 81 - "DMX Output Manager"
|
||||
Cohesion: 0.18
|
||||
Nodes (3): main(), output_tick(), OutputManager
|
||||
|
||||
### Community 82 - "machine"
|
||||
Cohesion: 0.12
|
||||
Nodes (14): Blink, _mac_hex(), run_diag(), recv_loop(), _set_channel(), _add_peer(), send_once(), _set_channel() (+6 more)
|
||||
|
||||
### Community 84 - "API Tests: Groups"
|
||||
Cohesion: 0.14
|
||||
Nodes (4): device(), group(), test_group_identify_needs_devices(), test_profile_scoped_group()
|
||||
|
||||
### Community 85 - "ESP-NOW Sender Bridge"
|
||||
Cohesion: 0.24
|
||||
Nodes (9): _broadcast_ws(), _espnow_receive_loop(), _init_espnow(), main(), _send_espnow(), _validate_envelope(), ws(), format_mac() (+1 more)
|
||||
|
||||
### Community 86 - "Firmware OTA (C)"
|
||||
Cohesion: 0.19
|
||||
Nodes (5): fail(), ota_get_handler(), ota_post_handler(), ota_register(), reboot_post_handler()
|
||||
|
||||
### Community 90 - "API Tests: Presets"
|
||||
Cohesion: 0.15
|
||||
Nodes (4): preset(), test_create_belongs_to_current_profile(), test_create_fills_defaults(), test_presets_scoped_to_profile()
|
||||
|
||||
### Community 92 - "Bench Test Plan"
|
||||
Cohesion: 0.23
|
||||
Nodes (9): Bench endpoints /test/loss and /test/beats, 30 ms beat lead (CONFIG_BEAT_LEAD_MS), Bench test: S3 controller and one LED driver, ESP32-C3 vs S3 driver comparison, Logic analyzer latency (marker GPIO, tools/analyze_edges.py), Lossy-link test (simulated loss, retries, resync), Reliable link (rel: acked unicast, retransmits, ack timeouts), Bench troubleshooting (serial ports, channel mismatch, blank UI) (+1 more)
|
||||
|
||||
### Community 94 - "Flame Pattern"
|
||||
Cohesion: 0.26
|
||||
Nodes (6): _clamp(), Flame, _lerp_chan(), _lerp_rgb(), _palette_sample(), _triangle_255()
|
||||
|
||||
### Community 95 - "Microdot Auth (dmx)"
|
||||
Cohesion: 0.20
|
||||
Nodes (3): websocket_upgrade(), websocket_wrapper(), with_websocket()
|
||||
|
||||
### Community 96 - "Serial DMX & WiFi"
|
||||
Cohesion: 0.19
|
||||
Nodes (4): sleep_ms(), SerialDMX, sleep(), ap()
|
||||
|
||||
### Community 99 - "Twinkle Pattern"
|
||||
Cohesion: 0.23
|
||||
Nodes (6): Twinkle, cluster_base_index(), cluster_len_bounds(), dark_adjacent(), light_adjacent(), random_cluster_len()
|
||||
|
||||
### Community 101 - "Groups UI (JS)"
|
||||
Cohesion: 0.29
|
||||
Nodes (9): fetchDevicesMapForGroups(), fetchGroupsMap(), identifyGroupById(), loadGroupsModal(), loadWifiFieldsFromGroup(), openEditGroupModal(), renderGroupDevicesEditor(), renderGroupsList() (+1 more)
|
||||
|
||||
### Community 102 - "Microdot Auth (led)"
|
||||
Cohesion: 0.22
|
||||
Nodes (3): websocket_upgrade(), websocket_wrapper(), with_websocket()
|
||||
|
||||
### Community 103 - "Help: Mobile Menu Image"
|
||||
Cohesion: 0.24
|
||||
Nodes (10): Mobile Menu Help Illustration (narrow screen), Content Area (preset buttons), Menu Dropdown (Run mode, Profiles, Tabs, Presets, Help), Header Tab Buttons, Help, Menu Button (header dropdown trigger), Presets, Profiles (+2 more)
|
||||
|
||||
### Community 104 - "Pattern Selector Mockup Image"
|
||||
Cohesion: 0.20
|
||||
Nodes (11): Pattern Selector Mockup (Select LED Pattern), Apply Pattern / Cancel Actions, Blink Pattern, Chase Pattern, Circle Pattern, Off Pattern, On Pattern (solid color), Pattern Card Grid Layout (+3 more)
|
||||
|
||||
### Community 105 - "Driver Pattern Docs"
|
||||
Cohesion: 0.24
|
||||
Nodes (11): Message processing order (version, presets upsert, colour, selection), Auto vs manual (a) and manual chase flush, Built-in off / on patterns, Patterns and presets on the LED driver, MAX_PRESETS = 32, Pattern OTA via manifest / POST /patterns/upload, Pattern registry (Presets.reload_patterns), Preset short keys (p, c, d, b, a, bg, n1-n6) (+3 more)
|
||||
|
||||
### Community 109 - "Driver Message API Docs"
|
||||
Cohesion: 0.38
|
||||
Nodes (10): Auto vs manual mode, Beat (re-select same preset restarts generator), Hex colour conversion and colour-order reordering, LED Driver API (message format), Pattern-specific parameters (rainbow, pulse, transition, chase, circle), Preset fields (pattern, colors, delay, brightness, auto, n1-n6), Select message (device -> [preset, step]), Step synchronization (+2 more)
|
||||
|
||||
### Community 110 - "Driver Binary Envelope"
|
||||
Cohesion: 0.38
|
||||
Nodes (8): _brightness_0_255_from_wire(), _decode_default_blob(), _decode_preset_record(), _decode_presets_blob(), _decode_select_blob(), parse_binary_envelope(), parse_binary_envelope_v1(), parse_binary_envelope_v2()
|
||||
|
||||
### Community 111 - "led_strip Manifest"
|
||||
Cohesion: 0.20
|
||||
Nodes (9): dependencies, idf, description, repository, repository_info, commit_sha, path, url (+1 more)
|
||||
|
||||
### Community 113 - "Outputs UI (JS)"
|
||||
Cohesion: 0.33
|
||||
Nodes (8): fetchOutputs(), loadOutputsModal(), openOutputEditor(), OUTPUT_PROTOCOL_LABELS, outputSummary(), renderOutputsList(), setOutputField(), syncOutputProtocolFields()
|
||||
|
||||
### Community 114 - "DMX Driver Docs"
|
||||
Cohesion: 0.25
|
||||
Nodes (9): Controller WebSocket /ws (v1 presets/select), DMX Driver Art-Net and serial gateway, DMX fixture (output, start channel, role map; parcan/mover profiles), led-driver-style pattern engine (Preset object), Serial DMX512 output (250000 8N2), Binary envelope (main/envelope.c, test/binary_envelope.py), v1 driver messages (long/short keys), WebSocket /ws driver message relay (+1 more)
|
||||
|
||||
### Community 115 - "Help PDF: Overview"
|
||||
Cohesion: 0.25
|
||||
Nodes (9): API.md, LED controller user guide, Main web UI (Raspberry Pi app), Pattern OTA install over HTTP (/patterns/ota, upload, driver, send), Pattern parameters n1-n8, README, Serial to ESP-NOW bridge transport, WebSocket /ws (+1 more)
|
||||
|
||||
### Community 116 - "Mockups Index Image"
|
||||
Cohesion: 0.31
|
||||
Nodes (9): LED Driver UI Mockups Index (screenshot), Dashboard Mockup, Device Groups, Device Management Mockup, LED Patterns (On, Off, Blink, Chase, Circle, Pulse, Rainbow, Transition), N1-N8 Pattern Parameters, Pattern Selector Mockup, Presets Mockup (+1 more)
|
||||
|
||||
### Community 117 - "api_json"
|
||||
Cohesion: 0.19
|
||||
Nodes (27): api_body_opt(), api_effective_brightness(), api_identify_group(), clamp255(), create_device(), device_brightness(), device_config_from(), device_driver_config() (+19 more)
|
||||
|
||||
### Community 118 - "Help: Header Toolbar Image"
|
||||
Cohesion: 0.29
|
||||
Nodes (8): Header Toolbar Help Image, Edit Mode Action Bar, Run/Edit Mode Toggle Button, Patterns Action, Presets Action, Profiles Action, Header Tab Buttons, Tabs Action
|
||||
|
||||
### Community 119 - "Help: Preset Editor Image"
|
||||
Cohesion: 0.29
|
||||
Nodes (5): Default Action, Preset Pattern Selector, Preset Editor Modal (help illustration), Preset Name Field, Brightness, Delay and n1-n8 Parameters (0-255)
|
||||
|
||||
### Community 120 - "Dashboard Mockup Image"
|
||||
Cohesion: 0.32
|
||||
Nodes (8): LED Driver Control Panel Dashboard Mockup, Apply Settings Action, Brightness & Speed Card (Brightness % and Delay ms sliders), Colors Card (color swatches palette, Add Color), Connected Devices Card (devices with group and online status), Device Groups, Pattern Selection Card (On, Off, Blink, Chase, Circle, Pulse, Rainbow, Transition), Save to Device Action
|
||||
|
||||
### Community 121 - "Device Management Mockup Image"
|
||||
Cohesion: 0.32
|
||||
Nodes (8): + Add Device Button, Connected Devices List, Device Group, Device & Group Management Screen (mockup), Device Row Actions (edit, settings, stop), Online/Offline Status Badge, Devices / Groups Tab Switcher, LED Device (MAC, group, pattern)
|
||||
|
||||
### Community 122 - "Presets Mockup Image"
|
||||
Cohesion: 0.32
|
||||
Nodes (8): Preset Management UI Mockup, Apply Preset Action, Create Preset Action, LED Pattern Types (Rainbow, Pulse, Chase, Circle, Blink, Transition), Preset Card (name, pattern badge, color swatches, delay, n1, apply/edit/delete), Preset Search/Filter/Sort Toolbar (pattern filter, sort by name, grid/list toggle), Preset Parameters (colors, delay ms, n1), Sync Presets to All Devices
|
||||
|
||||
### Community 123 - "Pattern Contract"
|
||||
Cohesion: 0.29
|
||||
Nodes (6): Pattern Contract, Drawing via driver.n and apply_brightness, Pattern error handling (Presets.tick catches), Presets._load_dynamic_patterns(), Shared driver.step semantics, Global vs per-preset brightness
|
||||
|
||||
### Community 128 - "Blink Pattern Test"
|
||||
Cohesion: 0.33
|
||||
Nodes (3): _bootstrap_import_path(), main(), _run_ms()
|
||||
|
||||
### Community 129 - "Colour Picker Demo Image"
|
||||
Cohesion: 0.33
|
||||
Nodes (6): Custom Color Picker Demo (screenshot), Hex and RGB input support, HSB (Hue, Saturation, Brightness) color model, Keyboard accessible, customizable styling, Multiple Color Pickers for LED Patterns, Single Color Picker
|
||||
|
||||
### Community 130 - "Settings Mockup Image"
|
||||
Cohesion: 0.33
|
||||
Nodes (7): Advanced Settings (Step Counter, Step Increment, Device ID, Debug Mode), Basic Settings (Device Name, LED Pin, Number of LEDs), Color Order Selector (RGB/RBG/GRB/GBR/BRG/BGR), Device Settings Page Mockup, Network Settings (Access Point Name, Password, Enable AP), Pattern Parameters N1-N6, Pattern Settings (Pattern, Brightness, Delay)
|
||||
|
||||
### Community 135 - "api_set"
|
||||
Cohesion: 0.27
|
||||
Nodes (21): api_add(), api_id(), api_set(), add_ref(), bundle(), bundle_of(), bundles_route(), export_profile() (+13 more)
|
||||
|
||||
### Community 138 - "Help: Colour Palette Image"
|
||||
Cohesion: 0.40
|
||||
Nodes (6): Colour Palette modal mockup (help image), Add Swatch (+) Button, Colour Palette Modal, Palette Colour Swatches, Preset Editor 'From Palette', Profile (palette owner)
|
||||
|
||||
### Community 140 - "LED Driver README"
|
||||
Cohesion: 0.47
|
||||
Nodes (6): dev.py deploy/sync script, LED Driver README (MicroPython ESP32), Optional HTTP polling (http_poll.py), Wi-Fi TCP transport to Pi (port 8765), transport_type setting (wifi / espnow), UDP discovery (port 8766)
|
||||
|
||||
### Community 142 - "SPI Example Manifest"
|
||||
Cohesion: 0.33
|
||||
Nodes (5): dependencies, espressif/led_strip, idf, override_path, version
|
||||
|
||||
### Community 145 - "Help PDF: Modes"
|
||||
Cohesion: 0.40
|
||||
Nodes (4): Edit mode, Mobile layout Menu, Run mode, Zones modal
|
||||
|
||||
### Community 146 - "Help: Tab Preset Strip Image"
|
||||
Cohesion: 0.60
|
||||
Nodes (5): Help image: Main area brightness and preset tiles, Edit Mode: drag tiles to reorder, Global Brightness Slider, Preset Tile (gradient swatch, click to select on tab devices), Tab (e.g. lounge)
|
||||
|
||||
### Community 149 - "utime"
|
||||
Cohesion: 0.06
|
||||
Nodes (16): ClockSweep, Icicles, StrobeBurst, _timestamped_print(), main(), run_for(), main(), main() (+8 more)
|
||||
|
||||
### Community 156 - "RMT Example Manifest"
|
||||
Cohesion: 0.40
|
||||
Nodes (4): dependencies, espressif/led_strip, override_path, version
|
||||
|
||||
### Community 158 - "Settings Page Template"
|
||||
Cohesion: 0.50
|
||||
Nodes (4): Settings modal (device, network), loadEspnowChannel(), Device Settings page (ESP-NOW channel), wifi_channel setting (1-11)
|
||||
|
||||
### Community 159 - "groups_route"
|
||||
Cohesion: 0.31
|
||||
Nodes (15): add_error(), api_driver_config(), api_mac(), api_migrate_groups(), brightness(), driver_config(), find(), groups_route() (+7 more)
|
||||
|
||||
### Community 160 - "web.c"
|
||||
Cohesion: 0.26
|
||||
Nodes (12): audio_page_handler(), etag(), favicon_handler(), find_file(), index_handler(), mime_for(), send_gz(), static_handler() (+4 more)
|
||||
|
||||
### Community 161 - "sequences_route"
|
||||
Cohesion: 0.26
|
||||
Nodes (13): api_current_profile(), api_migrate_sequences(), api_sequence_defaults(), apply_update(), colors_from(), has_steps(), in_profile(), migrate_seq() (+5 more)
|
||||
|
||||
### Community 163 - "store_save"
|
||||
Cohesion: 0.22
|
||||
Nodes (7): index_of(), load_file(), mount(), store_init(), store_known(), store_next_id(), store_replace()
|
||||
|
||||
### Community 170 - "Controller Component Deps"
|
||||
Cohesion: 0.50
|
||||
Nodes (3): dependencies, espressif/mdns, joltwallet/littlefs
|
||||
|
||||
### Community 171 - "List Search (JS)"
|
||||
Cohesion: 0.83
|
||||
Nodes (3): applyListSearch(), initListSearch(), rowSearchText()
|
||||
|
||||
## Knowledge Gaps
|
||||
- **97 isolated node(s):** `Design Guidelines`, `Device Management UI`, `Engine CLI`, `Output Drivers (DDP, Art-Net, sACN, USB-DMX)`, `Pixel Generator` (+92 more)
|
||||
These have ≤1 connection - possible missing edges or undocumented components. (Counts symbols only; 1030 node(s) total have ≤1 connection when file, concept and rationale nodes are included.)
|
||||
- **90 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
|
||||
|
||||
## Suggested Questions
|
||||
_Questions this graph is uniquely positioned to answer:_
|
||||
|
||||
- **Why does `unique()` connect `API Tests: Sequences & Bundles` to `API Tests: Zones`, `find_id_by_field`, `API Tests: Patterns`, `API Tests: Groups`, `API Tests: Presets`, `API Test Fixtures & Audio`?**
|
||||
_High betweenness centrality (0.022) - this node is a cross-community bridge._
|
||||
- **Are the 41 inferred relationships involving `Presets` (e.g. with `test_save_and_load_roundtrip()` and `_TestContext`) actually correct?**
|
||||
_`Presets` has 41 INFERRED edges - model-reasoned connections that need verification._
|
||||
- **What connects `Design Guidelines`, `Device Management UI`, `Engine CLI` to the rest of the system?**
|
||||
_97 weakly-connected nodes found - possible documentation gaps or missing edges._
|
||||
- **Should `htmx Library` be split into smaller, more focused modules?**
|
||||
_Cohesion score 0.07897684839432412 - nodes in this community are weakly interconnected._
|
||||
- **Why does `Microdot` connect `Microdot App (dmx)` to `HTTPException (dmx)`, `Microdot Routing (dmx)`, `Microdot Request (dmx)`?**
|
||||
_High betweenness centrality (0.017) - this node is a cross-community bridge._
|
||||
- **Are the 59 inferred relationships involving `store_coll()` (e.g. with `api_add()` and `api_current_profile()`) actually correct?**
|
||||
_`store_coll()` has 59 INFERRED edges - model-reasoned connections that need verification._
|
||||
- **Should `run_tick` be split into smaller, more focused modules?**
|
||||
_Cohesion score 0.05782312925170068 - nodes in this community are weakly interconnected._
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"runs": [
|
||||
{
|
||||
"date": "2026-11-03T12:13:15.159050+00:00",
|
||||
"input_tokens": 1267015,
|
||||
"output_tokens": 0,
|
||||
"files": 332
|
||||
}
|
||||
],
|
||||
"total_input_tokens": 1267015,
|
||||
"total_output_tokens": 0
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"directed":false,"multigraph":false,"graph":{"hyperedges":[{"id":"audio_page_endpoints","label":"Audio page live endpoints","nodes":["web_audio_status","web_audio_beats","web_audio_audio_wav","web_audio_time","web_audio_tap_ep"],"relation":"participate_in","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"web/audio.html"},{"id":"beat_latency_measurement","label":"Beat latency measurement methods","nodes":["docs_api_bench_endpoints","docs_bench_test_usb_latency","docs_bench_test_logic_analyzer","docs_bench_test_beat_lead"],"relation":"participate_in","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/BENCH_TEST.md"},{"id":"brightness_combination","label":"Combined brightness factors","nodes":["docs_api_combined_brightness","docs_api_settings","docs_api_groups","docs_api_devices","docs_api_zones"],"relation":"participate_in","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/API.md"},{"id":"color_picker_feature_set","label":"Color picker feature set","nodes":["docs_mockups_images_color_picker_demo_hsb_color_model","docs_mockups_images_color_picker_demo_hex_rgb_input","docs_mockups_images_color_picker_demo_keyboard_accessibility","docs_mockups_images_color_picker_demo_cross_platform_consistency"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/images/color-picker-demo.png"},{"id":"docs_help_edit_mode_management","label":"Edit-mode-only management features","nodes":["docs_help_edit_mode","docs_help_zones_modal","docs_help_send_presets","docs_help_patterns_dialog","docs_help_colour_palette","docs_help_presets_list"],"relation":"participate_in","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/help.pdf"},{"id":"docs_help_preset_editor_actions","label":"Preset editor actions (Try, Default, Save & Send, Remove from zone)","nodes":["docs_help_try_action","docs_help_default_preset","docs_help_save_and_send","docs_help_remove_from_zone"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/help.pdf"},{"id":"docs_images_help_mobile_menu_header_actions","label":"Header actions aggregated in mobile Menu","nodes":["docs_images_help_mobile_menu_run_mode","docs_images_help_mobile_menu_profiles","docs_images_help_mobile_menu_tabs","docs_images_help_mobile_menu_presets","docs_images_help_mobile_menu_help"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/images/help/mobile-menu.svg"},{"id":"docs_mockups_device_modal_flow","label":"Device/Group Modal Flow","nodes":["docs_mockups_device_management_showadddevicemodal","docs_mockups_device_management_showaddgroupmodal","docs_mockups_device_management_closemodal","docs_mockups_device_management_savedevice"],"relation":"participate_in","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/device-management.html"},{"id":"docs_mockups_images_index_ui_mockup_set","label":"LED Driver UI Mockup Set","nodes":["docs_mockups_images_index_dashboard_mockup","docs_mockups_images_index_pattern_selector_mockup","docs_mockups_images_index_device_management_mockup","docs_mockups_images_index_settings_mockup","docs_mockups_images_index_presets_mockup"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/images/index.png"},{"id":"docs_mockups_images_pattern_selector_led_patterns","label":"Selectable LED Patterns","nodes":["docs_mockups_images_pattern_selector_on","docs_mockups_images_pattern_selector_off","docs_mockups_images_pattern_selector_blink","docs_mockups_images_pattern_selector_chase","docs_mockups_images_pattern_selector_circle","docs_mockups_images_pattern_selector_pulse","docs_mockups_images_pattern_selector_rainbow","docs_mockups_images_pattern_selector_transition"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/images/pattern-selector.png"},{"id":"docs_mockups_preset_schema","label":"Preset/pattern configuration schema (pattern, colors, delay, step increment, N1-N8)","nodes":["docs_mockups_presets_led_patterns","docs_mockups_presets_delay","docs_mockups_presets_step_increment","docs_mockups_presets_n_parameters","docs_mockups_presets_step_offset"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/presets.html"},{"id":"docs_mockups_settings_sections","label":"Device settings sections","nodes":["docs_mockups_settings_basic_settings","docs_mockups_settings_pattern_settings","docs_mockups_settings_advanced_settings","docs_mockups_settings_network_settings"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/settings.html"},{"id":"docs_mockups_ui_mockup_suite","label":"LED Driver UI Mockup Suite","nodes":["docs_mockups_index","docs_mockups_dashboard","docs_mockups_pattern_selector","docs_mockups_device_management","docs_mockups_readme_settings_mockup","docs_mockups_color_picker_readme_presets_mockup"],"relation":"foLine truncated
|
||||
@@ -0,0 +1,160 @@
|
||||
{
|
||||
"1": "htmx Library",
|
||||
"3": "Browser Tests & Mockup Images",
|
||||
"4": "Audio UI (JS)",
|
||||
"5": "ESP-NOW TX & DMX Pulse",
|
||||
"6": "Driver OTA over ESP-NOW",
|
||||
"7": "led-tool Device CLI",
|
||||
"10": "Spec: Pi Animation Engine",
|
||||
"11": "Beat Sync on Driver",
|
||||
"12": "Presets UI (JS)",
|
||||
"13": "Zones UI (JS)",
|
||||
"14": "Pattern Store & Web (C)",
|
||||
"15": "ESP-NOW Receive Tests",
|
||||
"16": "Sequences UI (JS)",
|
||||
"17": "Driver Controller Messages",
|
||||
"19": "led_strip Component Docs",
|
||||
"20": "Art-Net Output",
|
||||
"21": "Reliable ESP-NOW Link (C)",
|
||||
"22": "led-test RMT Example",
|
||||
"23": "Driver Presets Store",
|
||||
"25": "Microdot App (dmx)",
|
||||
"26": "Microdot App (led)",
|
||||
"28": "Devices UI (JS)",
|
||||
"29": "DMX Driver HTTP App",
|
||||
"30": "Colour Picker Mockups",
|
||||
"31": "ESP-NOW Wire & Transport",
|
||||
"32": "Audio Capture (C)",
|
||||
"33": "Driver OTA Broadcast (C)",
|
||||
"34": "API Tests: Sequences & Bundles",
|
||||
"35": "Binary Envelope (test)",
|
||||
"36": "API Docs: Outputs & Audio",
|
||||
"37": "mpremote Commands",
|
||||
"38": "Driver WiFi & Background Tasks",
|
||||
"39": "Beat Detection DSP (C)",
|
||||
"43": "Driver Test Runner",
|
||||
"44": "Microdot Helpers",
|
||||
"45": "Bridge WebSocket Blink Test",
|
||||
"47": "USB Latency Tools",
|
||||
"48": "Colour Picker JS",
|
||||
"49": "Chromium Colour Picker JS",
|
||||
"51": "API Tests: Devices",
|
||||
"52": "Presets & Settings Mockups",
|
||||
"53": "mpremote Transport",
|
||||
"54": "Outputs Config (C)",
|
||||
"55": "Microdot Handlers (dmx)",
|
||||
"56": "MultiDict (dmx)",
|
||||
"58": "Microdot Handlers (led)",
|
||||
"59": "MultiDict (led)",
|
||||
"60": "mpremote Serial Transport",
|
||||
"61": "API Test Fixtures & Audio",
|
||||
"62": "Microdot Request (dmx)",
|
||||
"63": "Help: Zones & Palette",
|
||||
"65": "Driver OTA Tool",
|
||||
"68": "API Tests: Zones",
|
||||
"69": "API Tests: Outputs & Routes",
|
||||
"70": "Index Page Modals",
|
||||
"71": "Microdot Templates (led)",
|
||||
"72": "Microdot Templates (dmx)",
|
||||
"73": "Microdot WebSocket (dmx)",
|
||||
"74": "Microdot WebSocket (led)",
|
||||
"76": "Controller Overview & OTA Docs",
|
||||
"78": "Driver Hello Discovery",
|
||||
"79": "Audio Monitor Page",
|
||||
"80": "Art-Net DMX Tests",
|
||||
"81": "DMX Output Manager",
|
||||
"83": "Microdot Sessions (led)",
|
||||
"84": "API Tests: Groups",
|
||||
"85": "ESP-NOW Sender Bridge",
|
||||
"86": "Firmware OTA (C)",
|
||||
"87": "Microdot Async IO (dmx)",
|
||||
"88": "DMX Settings",
|
||||
"89": "Microdot Async IO (led)",
|
||||
"90": "API Tests: Presets",
|
||||
"91": "Microdot Routing (dmx)",
|
||||
"92": "Bench Test Plan",
|
||||
"93": "Microdot Routing (led)",
|
||||
"94": "Flame Pattern",
|
||||
"95": "Microdot Auth (dmx)",
|
||||
"96": "Serial DMX & WiFi",
|
||||
"97": "DMX Pattern Player",
|
||||
"98": "DMX Preset Model",
|
||||
"99": "Twinkle Pattern",
|
||||
"100": "Driver Settings",
|
||||
"101": "Groups UI (JS)",
|
||||
"102": "Microdot Auth (led)",
|
||||
"103": "Help: Mobile Menu Image",
|
||||
"104": "Pattern Selector Mockup Image",
|
||||
"105": "Driver Pattern Docs",
|
||||
"106": "Driver Preset Model",
|
||||
"108": "Microdot JWT Session",
|
||||
"109": "Driver Message API Docs",
|
||||
"110": "Driver Binary Envelope",
|
||||
"111": "led_strip Manifest",
|
||||
"112": "API Tests: Patterns",
|
||||
"113": "Outputs UI (JS)",
|
||||
"114": "DMX Driver Docs",
|
||||
"115": "Help PDF: Overview",
|
||||
"116": "Mockups Index Image",
|
||||
"118": "Help: Header Toolbar Image",
|
||||
"119": "Help: Preset Editor Image",
|
||||
"120": "Dashboard Mockup Image",
|
||||
"121": "Device Management Mockup Image",
|
||||
"122": "Presets Mockup Image",
|
||||
"123": "Pattern Contract",
|
||||
"124": "Microdot SessionDict",
|
||||
"125": "Meteor Pattern",
|
||||
"127": "Numpad Shortcuts (JS)",
|
||||
"128": "Blink Pattern Test",
|
||||
"129": "Colour Picker Demo Image",
|
||||
"130": "Settings Mockup Image",
|
||||
"131": "Aurora Pattern",
|
||||
"132": "Colour Cycle Pattern",
|
||||
"133": "Sparkle Pattern",
|
||||
"134": "API Tests: Settings",
|
||||
"137": "HTTPException (dmx)",
|
||||
"138": "Help: Colour Palette Image",
|
||||
"139": "HTTPException (led)",
|
||||
"140": "LED Driver README",
|
||||
"141": "Palette Morph Pattern",
|
||||
"142": "SPI Example Manifest",
|
||||
"145": "Help PDF: Modes",
|
||||
"146": "Help: Tab Preset Strip Image",
|
||||
"147": "Blink Pattern",
|
||||
"148": "Circle Pattern",
|
||||
"151": "Plasma Pattern",
|
||||
"152": "Radiate Pattern",
|
||||
"153": "Transition Pattern",
|
||||
"154": "Driver Runtime State",
|
||||
"156": "RMT Example Manifest",
|
||||
"157": "Help Tab JS",
|
||||
"158": "Settings Page Template",
|
||||
"168": "Rime Pattern",
|
||||
"170": "Controller Component Deps",
|
||||
"171": "List Search (JS)",
|
||||
"172": "DMX Solid Pattern",
|
||||
"173": "led-test Manifest",
|
||||
"174": "VPN Autoconnect Script",
|
||||
"175": "Zone Devices Panel",
|
||||
"176": "graphify Instructions",
|
||||
"177": "Microdot Package (dmx)",
|
||||
"178": "Microdot Package (led)",
|
||||
"179": "Env Check",
|
||||
"180": "Device Mockup Modals",
|
||||
"181": "bulk.sh Script",
|
||||
"182": "deploy.sh Script",
|
||||
"183": "Driver install.sh",
|
||||
"184": "Pattern Package Init",
|
||||
"185": "led-tool install.sh",
|
||||
"186": "Help PDF Build Script",
|
||||
"187": "Web Build Script",
|
||||
"188": "Patterns UI (JS)",
|
||||
"189": "DMX Patterns Init",
|
||||
"190": "Mockup Tab Switch",
|
||||
"191": "Spec: Pattern Selector UI",
|
||||
"192": "mpremote Package",
|
||||
"193": "Bundle Import/Export (JS)",
|
||||
"194": "Colour Palette (JS)",
|
||||
"195": "Profiles UI (JS)",
|
||||
"196": "Zone Palette (JS)"
|
||||
}
|
||||
@@ -0,0 +1,763 @@
|
||||
# Graph Report - led-controller (2026-11-09)
|
||||
|
||||
## Corpus Check
|
||||
- 300 files · ~208,091 words
|
||||
- Verdict: corpus is large enough that graph structure adds value.
|
||||
- Unclassified: 43 file(s) not represented in the graph (top: (none) 23, .mdc 6, .lock 4)
|
||||
|
||||
## Summary
|
||||
- 3458 nodes · 7695 edges · 203 communities (120 shown, 83 thin omitted)
|
||||
- Extraction: 88% EXTRACTED · 12% INFERRED · 0% AMBIGUOUS · INFERRED: 931 edges (avg confidence: 0.86)
|
||||
- Token cost: 0 input · 0 output
|
||||
|
||||
## Graph Freshness
|
||||
- Built from commit: `06953028`
|
||||
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
|
||||
- Run `graphify update .` after code changes (no API cost).
|
||||
|
||||
## Community Hubs (Navigation)
|
||||
- store_coll
|
||||
- htmx Library
|
||||
- machine
|
||||
- Browser Tests & Mockup Images
|
||||
- Audio UI (JS)
|
||||
- ESP-NOW TX & DMX Pulse
|
||||
- Driver OTA over ESP-NOW
|
||||
- led-tool Device CLI
|
||||
- utime
|
||||
- Compiler
|
||||
- Spec: Pi Animation Engine
|
||||
- Beat Sync on Driver
|
||||
- Presets UI (JS)
|
||||
- Zones UI (JS)
|
||||
- Pattern Store & Web (C)
|
||||
- ESP-NOW Receive Tests
|
||||
- Sequences UI (JS)
|
||||
- Driver Controller Messages
|
||||
- led_strip Component Docs
|
||||
- Art-Net Output
|
||||
- Reliable ESP-NOW Link (C)
|
||||
- led-test RMT Example
|
||||
- Driver Presets Store
|
||||
- serial
|
||||
- Microdot App (dmx)
|
||||
- Microdot App (led)
|
||||
- engine.c
|
||||
- Devices UI (JS)
|
||||
- DMX Driver HTTP App
|
||||
- Colour Picker Mockups
|
||||
- ESP-NOW Wire & Transport
|
||||
- Audio Capture (C)
|
||||
- Driver OTA Broadcast (C)
|
||||
- API Tests: Sequences & Bundles
|
||||
- Binary Envelope (test)
|
||||
- API Docs: Outputs & Audio
|
||||
- mpremote Commands
|
||||
- Driver WiFi & Background Tasks
|
||||
- Beat Detection DSP (C)
|
||||
- main/main.c
|
||||
- test_espnow_ota.py
|
||||
- presets.py
|
||||
- Driver Test Runner
|
||||
- Microdot Helpers
|
||||
- Bridge WebSocket Blink Test
|
||||
- find_id_by_field
|
||||
- USB Latency Tools
|
||||
- Colour Picker JS
|
||||
- Chromium Colour Picker JS
|
||||
- led_strip_spi_dev.c
|
||||
- API Tests: Devices
|
||||
- Presets & Settings Mockups
|
||||
- mpremote Transport
|
||||
- Outputs Config (C)
|
||||
- Microdot Handlers (dmx)
|
||||
- MultiDict (dmx)
|
||||
- led_strip_rmt_dev.c
|
||||
- Microdot Handlers (led)
|
||||
- MultiDict (led)
|
||||
- mpremote Serial Transport
|
||||
- API Test Fixtures & Audio
|
||||
- Microdot Request (dmx)
|
||||
- Help: Zones & Palette
|
||||
- test_espnow_rx.py
|
||||
- Driver OTA Tool
|
||||
- api_error
|
||||
- SerialIntercept
|
||||
- API Tests: Zones
|
||||
- API Tests: Outputs & Routes
|
||||
- Index Page Modals
|
||||
- Microdot Templates (led)
|
||||
- Microdot Templates (dmx)
|
||||
- Microdot WebSocket (dmx)
|
||||
- Microdot WebSocket (led)
|
||||
- board.py
|
||||
- Controller Overview & OTA Docs
|
||||
- DMX
|
||||
- Driver Hello Discovery
|
||||
- Audio Monitor Page
|
||||
- Art-Net DMX Tests
|
||||
- DMX Output Manager
|
||||
- network
|
||||
- Microdot Sessions (led)
|
||||
- API Tests: Groups
|
||||
- ESP-NOW Sender Bridge
|
||||
- Firmware OTA (C)
|
||||
- Microdot Async IO (dmx)
|
||||
- DMX Settings
|
||||
- Microdot Async IO (led)
|
||||
- API Tests: Presets
|
||||
- Microdot Routing (dmx)
|
||||
- Bench Test Plan
|
||||
- Microdot Routing (led)
|
||||
- Flame Pattern
|
||||
- Microdot Auth (dmx)
|
||||
- Serial DMX & WiFi
|
||||
- DMX Pattern Player
|
||||
- DMX Preset Model
|
||||
- Twinkle Pattern
|
||||
- Driver Settings
|
||||
- Groups UI (JS)
|
||||
- Microdot Auth (led)
|
||||
- Help: Mobile Menu Image
|
||||
- Pattern Selector Mockup Image
|
||||
- Driver Pattern Docs
|
||||
- Driver Preset Model
|
||||
- Blizzard
|
||||
- Microdot JWT Session
|
||||
- Driver Message API Docs
|
||||
- Driver Binary Envelope
|
||||
- led_strip Manifest
|
||||
- API Tests: Patterns
|
||||
- Outputs UI (JS)
|
||||
- DMX Driver Docs
|
||||
- Help PDF: Overview
|
||||
- Mockups Index Image
|
||||
- api_json
|
||||
- Help: Header Toolbar Image
|
||||
- Help: Preset Editor Image
|
||||
- Dashboard Mockup Image
|
||||
- Device Management Mockup Image
|
||||
- Presets Mockup Image
|
||||
- Pattern Contract
|
||||
- Microdot SessionDict
|
||||
- Meteor Pattern
|
||||
- store_save
|
||||
- Numpad Shortcuts (JS)
|
||||
- Blink Pattern Test
|
||||
- Colour Picker Demo Image
|
||||
- Settings Mockup Image
|
||||
- Aurora Pattern
|
||||
- Colour Cycle Pattern
|
||||
- Sparkle Pattern
|
||||
- api_set
|
||||
- LinkRx
|
||||
- HTTPException (dmx)
|
||||
- Help: Colour Palette Image
|
||||
- HTTPException (led)
|
||||
- LED Driver README
|
||||
- Palette Morph Pattern
|
||||
- SPI Example Manifest
|
||||
- unique
|
||||
- settings_editor.js
|
||||
- Help PDF: Modes
|
||||
- Help: Tab Preset Strip Image
|
||||
- Blink Pattern
|
||||
- Circle Pattern
|
||||
- test_mdns.py
|
||||
- wave.py
|
||||
- Plasma Pattern
|
||||
- Radiate Pattern
|
||||
- Transition Pattern
|
||||
- Driver Runtime State
|
||||
- tests/patterns/orbit.py
|
||||
- RMT Example Manifest
|
||||
- Help Tab JS
|
||||
- Settings Page Template
|
||||
- groups_route
|
||||
- web.c
|
||||
- sequences_route
|
||||
- tests/patterns/circle.py
|
||||
- web.py
|
||||
- test_wifi.py
|
||||
- Flicker
|
||||
- tests/patterns/aurora.py
|
||||
- snowfall.py
|
||||
- Rime Pattern
|
||||
- Orbit
|
||||
- Controller Component Deps
|
||||
- List Search (JS)
|
||||
- DMX Solid Pattern
|
||||
- led-test Manifest
|
||||
- VPN Autoconnect Script
|
||||
- graphify Instructions
|
||||
- bulk.sh Script
|
||||
- deploy.sh Script
|
||||
- Driver install.sh
|
||||
- led-tool install.sh
|
||||
- Help PDF Build Script
|
||||
- Web Build Script
|
||||
- Spec: Pattern Selector UI
|
||||
- StrobeBurst
|
||||
- BarGraph
|
||||
- asyncio
|
||||
- udp_client.py
|
||||
- Icicles
|
||||
- gradient_scroll.py
|
||||
|
||||
## God Nodes (most connected - your core abstractions)
|
||||
1. `Presets` - 67 edges
|
||||
2. `store_coll()` - 64 edges
|
||||
3. `api_error()` - 50 edges
|
||||
4. `api_json()` - 43 edges
|
||||
5. `api_set()` - 37 edges
|
||||
6. `store_save()` - 37 edges
|
||||
7. `unique()` - 37 edges
|
||||
8. `new_id()` - 35 edges
|
||||
9. `run_tick()` - 33 edges
|
||||
10. `api_id()` - 28 edges
|
||||
|
||||
## Surprising Connections (you probably didn't know these)
|
||||
- `Preset editor modal` --semantically_similar_to--> `Preset fields (pattern, colors, delay, brightness, auto, n1-n6)` [INFERRED] [semantically similar]
|
||||
web/templates/index.html → led-driver/docs/API.md
|
||||
- `led-driver-style pattern engine (Preset object)` --semantically_similar_to--> `led-driver MicroPython firmware (submodule)` [INFERRED] [semantically similar]
|
||||
dmx-driver/README.md → README.md
|
||||
- `espnow-sender Microdot WebSocket receiver` --semantically_similar_to--> `WebSocket /ws driver message relay` [INFERRED] [semantically similar]
|
||||
espnow-sender/README.md → docs/API.md
|
||||
- `Art-Net output (UDP 6454)` --semantically_similar_to--> `Outputs (DDP, Art-Net, sACN, DMX serial pixel fixtures)` [INFERRED] [semantically similar]
|
||||
dmx-driver/README.md → docs/API.md
|
||||
- `POST /patterns/upload (led-driver parity)` --semantically_similar_to--> `Patterns resource /patterns` [INFERRED] [semantically similar]
|
||||
dmx-driver/README.md → docs/API.md
|
||||
|
||||
## Import Cycles
|
||||
- None detected.
|
||||
|
||||
## Hyperedges (group relationships)
|
||||
- **Audio page live endpoints** — web_audio_status, web_audio_beats, web_audio_audio_wav, web_audio_time, web_audio_tap_ep [EXTRACTED 1.00]
|
||||
- **Beat latency measurement methods** — docs_api_bench_endpoints, docs_bench_test_usb_latency, docs_bench_test_logic_analyzer, docs_bench_test_beat_lead [EXTRACTED 1.00]
|
||||
- **Combined brightness factors** — docs_api_combined_brightness, docs_api_settings, docs_api_groups, docs_api_devices, docs_api_zones [EXTRACTED 1.00]
|
||||
- **Color picker feature set** — docs_mockups_images_color_picker_demo_hsb_color_model, docs_mockups_images_color_picker_demo_hex_rgb_input, docs_mockups_images_color_picker_demo_keyboard_accessibility, docs_mockups_images_color_picker_demo_cross_platform_consistency [EXTRACTED 1.00]
|
||||
- **Edit-mode-only management features** — docs_help_edit_mode, docs_help_zones_modal, docs_help_send_presets, docs_help_patterns_dialog, docs_help_colour_palette, docs_help_presets_list [EXTRACTED 1.00]
|
||||
- **Preset editor actions (Try, Default, Save & Send, Remove from zone)** — docs_help_try_action, docs_help_default_preset, docs_help_save_and_send, docs_help_remove_from_zone [EXTRACTED 1.00]
|
||||
- **Header actions aggregated in mobile Menu** — docs_images_help_mobile_menu_run_mode, docs_images_help_mobile_menu_profiles, docs_images_help_mobile_menu_tabs, docs_images_help_mobile_menu_presets, docs_images_help_mobile_menu_help [EXTRACTED 1.00]
|
||||
- **Device/Group Modal Flow** — docs_mockups_device_management_showadddevicemodal, docs_mockups_device_management_showaddgroupmodal, docs_mockups_device_management_closemodal, docs_mockups_device_management_savedevice [EXTRACTED 1.00]
|
||||
- **LED Driver UI Mockup Set** — docs_mockups_images_index_dashboard_mockup, docs_mockups_images_index_pattern_selector_mockup, docs_mockups_images_index_device_management_mockup, docs_mockups_images_index_settings_mockup, docs_mockups_images_index_presets_mockup [EXTRACTED 1.00]
|
||||
- **Selectable LED Patterns** — docs_mockups_images_pattern_selector_on, docs_mockups_images_pattern_selector_off, docs_mockups_images_pattern_selector_blink, docs_mockups_images_pattern_selector_chase, docs_mockups_images_pattern_selector_circle, docs_mockups_images_pattern_selector_pulse, docs_mockups_images_pattern_selector_rainbow, docs_mockups_images_pattern_selector_transition [EXTRACTED 1.00]
|
||||
- **Preset/pattern configuration schema (pattern, colors, delay, step increment, N1-N8)** — docs_mockups_presets_led_patterns, docs_mockups_presets_delay, docs_mockups_presets_step_increment, docs_mockups_presets_n_parameters, docs_mockups_presets_step_offset [EXTRACTED 1.00]
|
||||
- **Device settings sections** — docs_mockups_settings_basic_settings, docs_mockups_settings_pattern_settings, docs_mockups_settings_advanced_settings, docs_mockups_settings_network_settings [EXTRACTED 1.00]
|
||||
- **LED Driver UI Mockup Suite** — docs_mockups_index, docs_mockups_dashboard, docs_mockups_pattern_selector, docs_mockups_device_management, docs_mockups_readme_settings_mockup, docs_mockups_color_picker_readme_presets_mockup [EXTRACTED 1.00]
|
||||
- **Pi-to-ESP32 Command Paths** — docs_specification_serial_espnow_bridge, docs_specification_wifi_driver_tcp, docs_specification_espnow, docs_specification_pi_controller [EXTRACTED 1.00]
|
||||
- **led_strip backend choice (RMT vs SPI, DMA)** — scripts_led_test_managed_components_espressif__led_strip_readme_rmt_backend, scripts_led_test_managed_components_espressif__led_strip_readme_spi_backend, scripts_led_test_managed_components_espressif__led_strip_readme_dma_support, scripts_led_test_managed_components_espressif__led_strip_readme_backend_selection_flowchart [EXTRACTED 1.00]
|
||||
- **led_strip pixel write and flush flow** — scripts_led_test_managed_components_espressif__led_strip_api_led_strip_set_pixel, scripts_led_test_managed_components_espressif__led_strip_api_led_strip_set_pixel_hsv, scripts_led_test_managed_components_espressif__led_strip_api_led_strip_set_pixel_rgbw, scripts_led_test_managed_components_espressif__led_strip_api_led_strip_refresh, scripts_led_test_managed_components_espressif__led_strip_api_led_strip_clear [EXTRACTED 1.00]
|
||||
- **Dynamic pattern contract** — led_driver_docs_pattern_contract_class_shape, led_driver_docs_pattern_contract_run_generator_rules, led_driver_docs_pattern_contract_drawing_brightness, led_driver_docs_pattern_contract_step_semantics, led_driver_docs_pattern_contract_error_handling [EXTRACTED 1.00]
|
||||
- **Pi Animation Engine Output Pipeline** — docs_specification_pixel_generator, docs_specification_output_drivers, docs_specification_output_record, docs_specification_zone_playback, docs_specification_sequencer [EXTRACTED 1.00]
|
||||
- **Beat-Driven Scene Activation** — docs_specification_beat_detection_device, docs_specification_bpm_sync, docs_specification_beat_counter_phases, docs_specification_scene_queue [INFERRED 0.85]
|
||||
- **Fields defining an LED preset (name, pattern, colours, parameters)** — docs_images_help_preset_editor_preset_name_field, docs_images_help_preset_editor_pattern_selector, docs_images_help_preset_editor_palette_linked_colour, docs_images_help_preset_editor_preset_parameters [INFERRED 0.85]
|
||||
- **Pattern settings composed and applied to devices** — docs_mockups_images_dashboard_pattern_selection, docs_mockups_images_dashboard_brightness_speed, docs_mockups_images_dashboard_colors, docs_mockups_images_dashboard_apply_settings [INFERRED 0.85]
|
||||
- **Preset lifecycle actions (create, apply, sync)** — docs_mockups_images_presets_create_preset, docs_mockups_images_presets_apply_preset, docs_mockups_images_presets_sync_presets_to_all_devices [INFERRED 0.85]
|
||||
- **ESP-NOW driver delivery layers** — docs_api_binary_envelope, docs_api_delivery_digest, docs_bench_test_reliable_link, docs_bench_test_beat_double_send [INFERRED 0.85]
|
||||
- **v1 message handling on driver** — led_driver_docs_api_v1_message, led_driver_docs_patterns_process_data_flow, led_driver_docs_patterns_pattern_registry, led_driver_docs_patterns_preset_short_keys, led_driver_docs_api_select_message [INFERRED 0.85]
|
||||
|
||||
## Communities (203 total, 83 thin omitted)
|
||||
|
||||
### Community 0 - "store_coll"
|
||||
Cohesion: 0.26
|
||||
Nodes (25): engine_groups_changed(), api_migrate_zones(), api_preset_defaults(), clone_profile(), clone_zone(), content_fragment(), create_profile(), create_zone() (+17 more)
|
||||
|
||||
### Community 1 - "htmx Library"
|
||||
Cohesion: 0.08
|
||||
Nodes (101): a(), Ae(), an(), at(), B(), be(), bn(), bt() (+93 more)
|
||||
|
||||
### Community 2 - "machine"
|
||||
Cohesion: 0.05
|
||||
Nodes (33): run_tick(), recv_loop(), _set_channel(), main(), run_for(), main(), run_for(), main() (+25 more)
|
||||
|
||||
### Community 3 - "Browser Tests & Mockup Images"
|
||||
Cohesion: 0.06
|
||||
Nodes (17): generate_image(), generate_with_html2image(), generate_with_playwright(), generate_with_selenium(), main(), browser(), _browser_sleep(), BrowserTest (+9 more)
|
||||
|
||||
### Community 4 - "Audio UI (JS)"
|
||||
Cohesion: 0.11
|
||||
Nodes (58): applyAudioStatus(), applyServerAudioUiFields(), audioRunPreferredDeviceId(), beatSyncButtonTitle(), bind(), clampLiveBpm(), clampSimulatedBpm(), clearBeatPhaseTimers() (+50 more)
|
||||
|
||||
### Community 5 - "ESP-NOW TX & DMX Pulse"
|
||||
Cohesion: 0.07
|
||||
Nodes (19): bench_on_beat_tx(), bench_on_echo(), bench_results(), bench_running(), bench_start(), bench_stop(), gen_cb(), gpio_mark() (+11 more)
|
||||
|
||||
### Community 6 - "Driver OTA over ESP-NOW"
|
||||
Cohesion: 0.14
|
||||
Nodes (11): handle(), _makedirs(), Ota, _remove(), safe_path(), _hash_file(), load(), _normalize_path() (+3 more)
|
||||
|
||||
### Community 7 - "led-tool Device CLI"
|
||||
Cohesion: 0.08
|
||||
Nodes (13): download_presets(), download_settings(), _get_ordered_actions(), main(), print_settings(), resolve_flash_binary(), upload_presets(), upload_settings() (+5 more)
|
||||
|
||||
### Community 8 - "utime"
|
||||
Cohesion: 0.06
|
||||
Nodes (12): _drain(), CandleGlow, Chase, ClockSweep, Particles, style_mode(), Pulse, RainDrops (+4 more)
|
||||
|
||||
### Community 9 - "Compiler"
|
||||
Cohesion: 0.06
|
||||
Nodes (8): Loader, Loader, Compiler, Loader, Loader, Loader, Compiler, Loader
|
||||
|
||||
### Community 10 - "Spec: Pi Animation Engine"
|
||||
Cohesion: 0.07
|
||||
Nodes (46): Pi Animation Engine (src/engine), docs/API.md, Beat Counter and Phases, Beat Detection Device, Binary Message Protocol, BPM Sync, Dashboard UI (dashboard.html), usqlite Database Schema (presets, profiles, scenes, scene_groups) (+38 more)
|
||||
|
||||
### Community 11 - "Beat Sync on Driver"
|
||||
Cohesion: 0.15
|
||||
Nodes (16): BeatSync, _diff(), frame(), run(), test_bad_frames(), test_both_copies(), test_controller_restart_is_followed(), test_free_run_covers_missed_beat() (+8 more)
|
||||
|
||||
### Community 12 - "Presets UI (JS)"
|
||||
Cohesion: 0.09
|
||||
Nodes (42): arrayToGrid(), coerceManualBeatN(), coercePresetAuto(), coercePresetBackground(), coercePresetInt(), createPresetButton(), deviceNamesForPresetOnCurrentZone(), editPresetFromTab() (+34 more)
|
||||
|
||||
### Community 13 - "Zones UI (JS)"
|
||||
Cohesion: 0.10
|
||||
Nodes (42): applyBrightnessSliders(), applyZoneContentKindEditModal(), clamp255(), computeZoneNamesTargets(), computeZonePresetUnionTargets(), computeZoneTargets(), createZone(), effectiveGroupIdsForZonePreset() (+34 more)
|
||||
|
||||
### Community 14 - "Pattern Store & Web (C)"
|
||||
Cohesion: 0.22
|
||||
Nodes (18): add_name(), base_name(), builtin(), create_driver_pattern(), create_pattern(), exists(), file_names(), file_path() (+10 more)
|
||||
|
||||
### Community 15 - "ESP-NOW Receive Tests"
|
||||
Cohesion: 0.12
|
||||
Nodes (14): get_wdt(), main(), MockESPNow, run_main_loop_iterations(), test_beat_functionality(), test_color_conversion(), test_full_message(), test_preset_creation() (+6 more)
|
||||
|
||||
### Community 16 - "Sequences UI (JS)"
|
||||
Cohesion: 0.11
|
||||
Nodes (33): addSequenceToTab(), appendZoneSequenceTiles(), applySequenceSwitchWaitFromServer(), buildLaneGroupIdsForEditor(), collectLanesFromEditor(), createSequenceTileRow(), deleteCurrentSequence(), fetchGroupsMapSeq() (+25 more)
|
||||
|
||||
### Community 17 - "Driver Controller Messages"
|
||||
Cohesion: 0.08
|
||||
Nodes (28): apply_brightness(), apply_clear_presets(), apply_default(), apply_device_config(), apply_patterns_ota(), apply_presets(), apply_select(), _config_flag() (+20 more)
|
||||
|
||||
### Community 19 - "led_strip Component Docs"
|
||||
Cohesion: 0.10
|
||||
Nodes (36): led_test ESP-IDF project, led_test main component (main.c), led_strip API Reference, led_model_t (WS2812/SK6812), led_pixel_format_t (GRB/GRBW), led_strip_clear(), led_strip_config_t, led_strip_del() (+28 more)
|
||||
|
||||
### Community 20 - "Art-Net Output"
|
||||
Cohesion: 0.10
|
||||
Nodes (9): ArtNet, as_channels(), build_artdmx(), _ip_bytes(), _pad(), port_lo(), ticks_diff(), ticks_ms() (+1 more)
|
||||
|
||||
### Community 21 - "Reliable ESP-NOW Link (C)"
|
||||
Cohesion: 0.16
|
||||
Nodes (16): skip_unresponsive(), espnow_tx_send(), full_mask(), handle_rx(), peer_get(), record_done(), rel_peer_status(), rel_send() (+8 more)
|
||||
|
||||
### Community 22 - "led-test RMT Example"
|
||||
Cohesion: 0.33
|
||||
Nodes (12): app_main(), app_main(), configure_led(), app_main(), configure_led(), led_strip_handle_t, led_strip_clear(), led_strip_del() (+4 more)
|
||||
|
||||
### Community 23 - "Driver Presets Store"
|
||||
Cohesion: 0.08
|
||||
Nodes (3): Presets, main(), run_for()
|
||||
|
||||
### Community 25 - "Microdot App (dmx)"
|
||||
Cohesion: 0.07
|
||||
Nodes (4): Microdot, mro(), _mro(), print_exception()
|
||||
|
||||
### Community 26 - "Microdot App (led)"
|
||||
Cohesion: 0.07
|
||||
Nodes (4): Microdot, mro(), _mro(), print_exception()
|
||||
|
||||
### Community 27 - "engine.c"
|
||||
Cohesion: 0.05
|
||||
Nodes (101): audio_handler(), audio_run(), events(), ok_with_status(), send_json(), setting_int(), status_payload(), beat_get_info() (+93 more)
|
||||
|
||||
### Community 28 - "Devices UI (JS)"
|
||||
Cohesion: 0.11
|
||||
Nodes (30): applyEspnowPingAggregateToDots(), applyEspnowPingToDeviceRows(), applyTcpSnapshot(), applyTransportVisibility(), collectDeviceEditPayload(), createDeviceFromModal(), createDeviceIdentifyButton(), DEVICE_DOT_CLASSES (+22 more)
|
||||
|
||||
### Community 29 - "DMX Driver HTTP App"
|
||||
Cohesion: 0.09
|
||||
Nodes (9): _expand(), _preset_from_map(), process_data(), _select_entries(), _targets_for_key(), create_app(), serial_ports(), ws_handler() (+1 more)
|
||||
|
||||
### Community 30 - "Colour Picker Mockups"
|
||||
Cohesion: 0.11
|
||||
Nodes (25): Chromium-style Color Picker Demo, ColorPickerChromium Component, updateColors() (Chromium demo), Custom Color Picker Demo, updateColors() (standard demo), Custom Colour Picker README, POST /api/colors (example), ColorPicker Component (+17 more)
|
||||
|
||||
### Community 31 - "ESP-NOW Wire & Transport"
|
||||
Cohesion: 0.15
|
||||
Nodes (20): make_sender(), _dlog(), espnow_receive_loop(), _handle_packet(), init_espnow(), _schedule_ping_rsp(), send_boot_announce(), _send_ping_rsp() (+12 more)
|
||||
|
||||
### Community 32 - "Audio Capture (C)"
|
||||
Cohesion: 0.07
|
||||
Nodes (28): events_task(), send_all(), send_event(), audio_get_handler(), audio_register(), audio_stream_task(), beats_get_handler(), beats_stream_task() (+20 more)
|
||||
|
||||
### Community 33 - "Driver OTA Broadcast (C)"
|
||||
Cohesion: 0.20
|
||||
Nodes (18): broadcast_chunks(), chunk_done(), command(), data_pkt(), drain_status(), drv_ota_register(), drv_ota_send(), finish() (+10 more)
|
||||
|
||||
### Community 34 - "API Tests: Sequences & Bundles"
|
||||
Cohesion: 0.14
|
||||
Nodes (15): new_id(), test_preset_round_trip(), test_profile_round_trip(), test_sequence_round_trip(), clock(), presets(), test_crud(), test_editing_stops_playback() (+7 more)
|
||||
|
||||
### Community 35 - "Binary Envelope (test)"
|
||||
Cohesion: 0.15
|
||||
Nodes (17): brightness_0_255_from_wire(), brightness_wire_from_0_255(), _clamp_i16(), _colors_to_rgb_list(), _decode_default_blob(), _decode_preset_record(), _decode_presets_blob(), _decode_select_blob() (+9 more)
|
||||
|
||||
### Community 36 - "API Docs: Outputs & Audio"
|
||||
Cohesion: 0.14
|
||||
Nodes (23): Art-Net output (UDP 6454), Audio API /api/audio and /audio page routes, Profile/preset/sequence JSON bundles (import/export), Combined brightness (global x groups x device x zone), /db collection export and replace, Devices resource /devices, Driver group membership lists (group ids, z<zone id>), Device groups resource /groups (+15 more)
|
||||
|
||||
### Community 38 - "Driver WiFi & Background Tasks"
|
||||
Cohesion: 0.12
|
||||
Nodes (10): presets_loop(), apply_startup_pattern(), print_mem(), snapshot(), initialize_runtime(), boot_sta(), connect_until_up(), _one_association_campaign() (+2 more)
|
||||
|
||||
### Community 39 - "Beat Detection DSP (C)"
|
||||
Cohesion: 0.27
|
||||
Nodes (16): beat_feed(), analyse_beat(), bar_cue(), bar_decide(), beat_dsp_feed(), beat_dsp_init(), beat_dsp_tap(), best_phase() (+8 more)
|
||||
|
||||
### Community 40 - "main/main.c"
|
||||
Cohesion: 0.06
|
||||
Nodes (24): audio_api_register(), espnow_tx_stats(), ap_button_held(), app_main(), dhcp_settled(), eth_event_handler(), gateway_answers(), got_ip_event_handler() (+16 more)
|
||||
|
||||
### Community 41 - "test_espnow_ota.py"
|
||||
Cohesion: 0.14
|
||||
Nodes (21): begin(), chunk(), cmd(), in_tmp(), nchunks(), Rig, test_abort_removes_staged(), test_bad_hash_is_not_staged() (+13 more)
|
||||
|
||||
### Community 42 - "presets.py"
|
||||
Cohesion: 0.24
|
||||
Nodes (4): is_reversed(), led_i(), signed(), convert_and_reorder_colors()
|
||||
|
||||
### Community 43 - "Driver Test Runner"
|
||||
Cohesion: 0.17
|
||||
Nodes (17): _bootstrap_import_path(), _pattern_loaded(), _process_message(), run_all(), _smoke_preset(), test_colour_conversion_and_transition(), test_default_requires_existing_preset(), test_default_targets_gate_by_device_name() (+9 more)
|
||||
|
||||
### Community 44 - "Microdot Helpers"
|
||||
Cohesion: 0.11
|
||||
Nodes (4): Request, G, urldecode_bytes(), urldecode_str()
|
||||
|
||||
### Community 45 - "Bridge WebSocket Blink Test"
|
||||
Cohesion: 0.12
|
||||
Nodes (9): build_blink_envelope(), _format_mac(), _load_bridge_url(), main(), _send(), _default_image(), _info(), ota_update() (+1 more)
|
||||
|
||||
### Community 46 - "find_id_by_field"
|
||||
Cohesion: 0.24
|
||||
Nodes (4): find_id_by_field(), missing(), test_scenes(), test_crud()
|
||||
|
||||
### Community 47 - "USB Latency Tools"
|
||||
Cohesion: 0.15
|
||||
Nodes (10): analyze(), edges(), main(), pct(), read(), fit_clock(), main(), pct() (+2 more)
|
||||
|
||||
### Community 50 - "led_strip_spi_dev.c"
|
||||
Cohesion: 0.32
|
||||
Nodes (7): led_strip_new_spi_device(), __led_strip_spi_bit(), led_strip_spi_clear(), led_strip_spi_del(), led_strip_spi_refresh(), led_strip_spi_set_pixel(), led_strip_spi_set_pixel_rgbw()
|
||||
|
||||
### Community 52 - "Presets & Settings Mockups"
|
||||
Cohesion: 0.13
|
||||
Nodes (4): _convert_filesystem_error(), stdout_write_bytes(), Transport, TransportExecError
|
||||
|
||||
### Community 53 - "mpremote Transport"
|
||||
Cohesion: 0.12
|
||||
Nodes (20): Presets Mockup Page, addColorPicker() / initializeColorPickers(), ColorPicker component (color-picker.js / color-picker.css), Preset Delay (animation speed, 10-1000 ms), ESPNow preset distribution, filterPresets() / sortPresets() search, filter and sort, LED Patterns (on, off, blink, chase, circle, pulse, rainbow, transition), Pattern Parameters N1-N8 (+12 more)
|
||||
|
||||
### Community 54 - "Outputs Config (C)"
|
||||
Cohesion: 0.20
|
||||
Nodes (17): defaults(), fail(), fill(), int_field(), num(), one_of(), put16(), resolve() (+9 more)
|
||||
|
||||
### Community 55 - "Microdot Handlers (dmx)"
|
||||
Cohesion: 0.11
|
||||
Nodes (5): invoke_handler(), iscoroutine(), Response, aclose(), __anext__()
|
||||
|
||||
### Community 57 - "led_strip_rmt_dev.c"
|
||||
Cohesion: 0.07
|
||||
Nodes (24): led_strip_rmt_config_t, led_strip_spi_config_t, led_model_t, led_pixel_format_t, led_strip_config_t, led_strip_t, led_strip_t, led_strip_new_rmt_device() (+16 more)
|
||||
|
||||
### Community 58 - "Microdot Handlers (led)"
|
||||
Cohesion: 0.11
|
||||
Nodes (5): invoke_handler(), iscoroutine(), Response, aclose(), __anext__()
|
||||
|
||||
### Community 61 - "API Test Fixtures & Audio"
|
||||
Cohesion: 0.16
|
||||
Nodes (5): base_url(), c(), Client, profile(), restore_db()
|
||||
|
||||
### Community 62 - "Microdot Request (dmx)"
|
||||
Cohesion: 0.13
|
||||
Nodes (4): Request, G, urldecode_bytes(), urldecode_str()
|
||||
|
||||
### Community 63 - "Help: Zones & Palette"
|
||||
Cohesion: 0.13
|
||||
Nodes (18): Colour Palette (per profile), Zone default preset (default hint), DJ zone starter option, From Palette linked colours, LED driver JSON (presets, select, save, default, manifest), Patterns dialog, POST /presets/send, Preset editor (Try, Save, Send, Manual) (+10 more)
|
||||
|
||||
### Community 64 - "test_espnow_rx.py"
|
||||
Cohesion: 0.32
|
||||
Nodes (18): data(), digest(), feed(), make(), test_commit_sets_version_only_when_complete(), test_digest_match_no_resync(), test_digest_mismatch_requests_resync_after_jitter_and_rate_limits(), test_digest_zero_ignored() (+10 more)
|
||||
|
||||
### Community 65 - "Driver OTA Tool"
|
||||
Cohesion: 0.08
|
||||
Nodes (11): Blink, Pulse, Controller, file_set(), walk(), main(), norm_mac(), push() (+3 more)
|
||||
|
||||
### Community 66 - "api_error"
|
||||
Cohesion: 0.24
|
||||
Nodes (21): api_body(), api_error(), api_json(), api_merge(), api_message(), api_preset_in_profile(), api_result(), api_split() (+13 more)
|
||||
|
||||
### Community 68 - "API Tests: Zones"
|
||||
Cohesion: 0.11
|
||||
Nodes (6): test_clone(), test_clone_default_name(), test_delete_removes_from_profile(), test_play_and_stop(), test_zone_with_groups(), zone()
|
||||
|
||||
### Community 70 - "Index Page Modals"
|
||||
Cohesion: 0.11
|
||||
Nodes (19): Audio Beat Detection modal, Header BPM / beat sync indicator, Colour Palette modal, Devices modal, Edit device modal, Edit Zone modal, Device groups modal, Header global brightness slider (+11 more)
|
||||
|
||||
### Community 75 - "board.py"
|
||||
Cohesion: 0.38
|
||||
Nodes (3): apply_cpu_freq(), default_led_pin(), mcu()
|
||||
|
||||
### Community 76 - "Controller Overview & OTA Docs"
|
||||
Cohesion: 0.17
|
||||
Nodes (16): led_controller ESP-IDF project, POST /patterns/upload (led-driver parity), Driver app update /drivers/ota (staged files, sha, commit/abort), Firmware OTA /ota (idle slot, rollback), Patterns resource /patterns, Driver app update over ESP-NOW test (tools/driver_ota.py), led-simulator, led-tool / led-cli serial device CLI (+8 more)
|
||||
|
||||
### Community 77 - "DMX"
|
||||
Cohesion: 0.22
|
||||
Nodes (3): DMX, main(), run_for()
|
||||
|
||||
### Community 78 - "Driver Hello Discovery"
|
||||
Cohesion: 0.18
|
||||
Nodes (8): broadcast_hello_udp(), discover_controller_udp(), ipv4_broadcast(), pack_hello_bytes(), pack_hello_dict(), pack_hello_line(), udp_discovery_targets(), _udp_discovery_targets_single()
|
||||
|
||||
### Community 79 - "Audio Monitor Page"
|
||||
Cohesion: 0.16
|
||||
Nodes (16): /audio.wav live PCM stream, bar() bar-position renderer, /beats SSE event stream, draw() timeline canvas, Listen button (WAV stream playback via AudioContext), median(), Audio and beats page (/audio), stats() tap vs computer agreement (+8 more)
|
||||
|
||||
### Community 80 - "Art-Net DMX Tests"
|
||||
Cohesion: 0.23
|
||||
Nodes (9): parse(), _assert_eq(), main(), test_artnet_send_loopback(), test_build_artdmx(), test_fixture_patch(), test_pattern_blink_and_select(), test_pattern_upload() (+1 more)
|
||||
|
||||
### Community 82 - "network"
|
||||
Cohesion: 0.23
|
||||
Nodes (6): _mac_hex(), run_diag(), _add_peer(), send_once(), _set_channel(), main()
|
||||
|
||||
### Community 84 - "API Tests: Groups"
|
||||
Cohesion: 0.14
|
||||
Nodes (4): device(), group(), test_group_identify_needs_devices(), test_profile_scoped_group()
|
||||
|
||||
### Community 85 - "ESP-NOW Sender Bridge"
|
||||
Cohesion: 0.24
|
||||
Nodes (9): _broadcast_ws(), _espnow_receive_loop(), _init_espnow(), main(), _send_espnow(), _validate_envelope(), ws(), format_mac() (+1 more)
|
||||
|
||||
### Community 86 - "Firmware OTA (C)"
|
||||
Cohesion: 0.14
|
||||
Nodes (10): fail(), ota_get_handler(), ota_post_handler(), ota_register(), reboot_post_handler(), forward(), on_open(), send_text() (+2 more)
|
||||
|
||||
### Community 90 - "API Tests: Presets"
|
||||
Cohesion: 0.15
|
||||
Nodes (4): preset(), test_create_belongs_to_current_profile(), test_create_fills_defaults(), test_presets_scoped_to_profile()
|
||||
|
||||
### Community 92 - "Bench Test Plan"
|
||||
Cohesion: 0.23
|
||||
Nodes (9): Bench endpoints /test/loss and /test/beats, 30 ms beat lead (CONFIG_BEAT_LEAD_MS), Bench test: S3 controller and one LED driver, ESP32-C3 vs S3 driver comparison, Logic analyzer latency (marker GPIO, tools/analyze_edges.py), Lossy-link test (simulated loss, retries, resync), Reliable link (rel: acked unicast, retransmits, ack timeouts), Bench troubleshooting (serial ports, channel mismatch, blank UI) (+1 more)
|
||||
|
||||
### Community 94 - "Flame Pattern"
|
||||
Cohesion: 0.26
|
||||
Nodes (6): _clamp(), Flame, _lerp_chan(), _lerp_rgb(), _palette_sample(), _triangle_255()
|
||||
|
||||
### Community 95 - "Microdot Auth (dmx)"
|
||||
Cohesion: 0.20
|
||||
Nodes (3): websocket_upgrade(), websocket_wrapper(), with_websocket()
|
||||
|
||||
### Community 96 - "Serial DMX & WiFi"
|
||||
Cohesion: 0.20
|
||||
Nodes (4): sleep_ms(), SerialDMX, sleep(), ap()
|
||||
|
||||
### Community 99 - "Twinkle Pattern"
|
||||
Cohesion: 0.26
|
||||
Nodes (6): Twinkle, cluster_base_index(), cluster_len_bounds(), dark_adjacent(), light_adjacent(), random_cluster_len()
|
||||
|
||||
### Community 101 - "Groups UI (JS)"
|
||||
Cohesion: 0.29
|
||||
Nodes (9): fetchDevicesMapForGroups(), fetchGroupsMap(), identifyGroupById(), loadGroupsModal(), loadWifiFieldsFromGroup(), openEditGroupModal(), renderGroupDevicesEditor(), renderGroupsList() (+1 more)
|
||||
|
||||
### Community 102 - "Microdot Auth (led)"
|
||||
Cohesion: 0.22
|
||||
Nodes (3): websocket_upgrade(), websocket_wrapper(), with_websocket()
|
||||
|
||||
### Community 103 - "Help: Mobile Menu Image"
|
||||
Cohesion: 0.24
|
||||
Nodes (10): Mobile Menu Help Illustration (narrow screen), Content Area (preset buttons), Menu Dropdown (Run mode, Profiles, Tabs, Presets, Help), Header Tab Buttons, Help, Menu Button (header dropdown trigger), Presets, Profiles (+2 more)
|
||||
|
||||
### Community 104 - "Pattern Selector Mockup Image"
|
||||
Cohesion: 0.20
|
||||
Nodes (11): Pattern Selector Mockup (Select LED Pattern), Apply Pattern / Cancel Actions, Blink Pattern, Chase Pattern, Circle Pattern, Off Pattern, On Pattern (solid color), Pattern Card Grid Layout (+3 more)
|
||||
|
||||
### Community 105 - "Driver Pattern Docs"
|
||||
Cohesion: 0.24
|
||||
Nodes (11): Message processing order (version, presets upsert, colour, selection), Auto vs manual (a) and manual chase flush, Built-in off / on patterns, Patterns and presets on the LED driver, MAX_PRESETS = 32, Pattern OTA via manifest / POST /patterns/upload, Pattern registry (Presets.reload_patterns), Preset short keys (p, c, d, b, a, bg, n1-n6) (+3 more)
|
||||
|
||||
### Community 109 - "Driver Message API Docs"
|
||||
Cohesion: 0.38
|
||||
Nodes (10): Auto vs manual mode, Beat (re-select same preset restarts generator), Hex colour conversion and colour-order reordering, LED Driver API (message format), Pattern-specific parameters (rainbow, pulse, transition, chase, circle), Preset fields (pattern, colors, delay, brightness, auto, n1-n6), Select message (device -> [preset, step]), Step synchronization (+2 more)
|
||||
|
||||
### Community 110 - "Driver Binary Envelope"
|
||||
Cohesion: 0.38
|
||||
Nodes (8): _brightness_0_255_from_wire(), _decode_default_blob(), _decode_preset_record(), _decode_presets_blob(), _decode_select_blob(), parse_binary_envelope(), parse_binary_envelope_v1(), parse_binary_envelope_v2()
|
||||
|
||||
### Community 111 - "led_strip Manifest"
|
||||
Cohesion: 0.20
|
||||
Nodes (9): dependencies, idf, description, repository, repository_info, commit_sha, path, url (+1 more)
|
||||
|
||||
### Community 113 - "Outputs UI (JS)"
|
||||
Cohesion: 0.33
|
||||
Nodes (8): fetchOutputs(), loadOutputsModal(), openOutputEditor(), OUTPUT_PROTOCOL_LABELS, outputSummary(), renderOutputsList(), setOutputField(), syncOutputProtocolFields()
|
||||
|
||||
### Community 114 - "DMX Driver Docs"
|
||||
Cohesion: 0.25
|
||||
Nodes (9): Controller WebSocket /ws (v1 presets/select), DMX Driver Art-Net and serial gateway, DMX fixture (output, start channel, role map; parcan/mover profiles), led-driver-style pattern engine (Preset object), Serial DMX512 output (250000 8N2), Binary envelope (main/envelope.c, test/binary_envelope.py), v1 driver messages (long/short keys), WebSocket /ws driver message relay (+1 more)
|
||||
|
||||
### Community 115 - "Help PDF: Overview"
|
||||
Cohesion: 0.25
|
||||
Nodes (9): API.md, LED controller user guide, Main web UI (Raspberry Pi app), Pattern OTA install over HTTP (/patterns/ota, upload, driver, send), Pattern parameters n1-n8, README, Serial to ESP-NOW bridge transport, WebSocket /ws (+1 more)
|
||||
|
||||
### Community 116 - "Mockups Index Image"
|
||||
Cohesion: 0.31
|
||||
Nodes (9): LED Driver UI Mockups Index (screenshot), Dashboard Mockup, Device Groups, Device Management Mockup, LED Patterns (On, Off, Blink, Chase, Circle, Pulse, Rainbow, Transition), N1-N8 Pattern Parameters, Pattern Selector Mockup, Presets Mockup (+1 more)
|
||||
|
||||
### Community 117 - "api_json"
|
||||
Cohesion: 0.19
|
||||
Nodes (27): api_body_opt(), api_effective_brightness(), api_identify_group(), clamp255(), create_device(), device_brightness(), device_config_from(), device_driver_config() (+19 more)
|
||||
|
||||
### Community 118 - "Help: Header Toolbar Image"
|
||||
Cohesion: 0.29
|
||||
Nodes (8): Header Toolbar Help Image, Edit Mode Action Bar, Run/Edit Mode Toggle Button, Patterns Action, Presets Action, Profiles Action, Header Tab Buttons, Tabs Action
|
||||
|
||||
### Community 119 - "Help: Preset Editor Image"
|
||||
Cohesion: 0.29
|
||||
Nodes (5): Default Action, Preset Pattern Selector, Preset Editor Modal (help illustration), Preset Name Field, Brightness, Delay and n1-n8 Parameters (0-255)
|
||||
|
||||
### Community 120 - "Dashboard Mockup Image"
|
||||
Cohesion: 0.32
|
||||
Nodes (8): LED Driver Control Panel Dashboard Mockup, Apply Settings Action, Brightness & Speed Card (Brightness % and Delay ms sliders), Colors Card (color swatches palette, Add Color), Connected Devices Card (devices with group and online status), Device Groups, Pattern Selection Card (On, Off, Blink, Chase, Circle, Pulse, Rainbow, Transition), Save to Device Action
|
||||
|
||||
### Community 121 - "Device Management Mockup Image"
|
||||
Cohesion: 0.32
|
||||
Nodes (8): + Add Device Button, Connected Devices List, Device Group, Device & Group Management Screen (mockup), Device Row Actions (edit, settings, stop), Online/Offline Status Badge, Devices / Groups Tab Switcher, LED Device (MAC, group, pattern)
|
||||
|
||||
### Community 122 - "Presets Mockup Image"
|
||||
Cohesion: 0.32
|
||||
Nodes (8): Preset Management UI Mockup, Apply Preset Action, Create Preset Action, LED Pattern Types (Rainbow, Pulse, Chase, Circle, Blink, Transition), Preset Card (name, pattern badge, color swatches, delay, n1, apply/edit/delete), Preset Search/Filter/Sort Toolbar (pattern filter, sort by name, grid/list toggle), Preset Parameters (colors, delay ms, n1), Sync Presets to All Devices
|
||||
|
||||
### Community 123 - "Pattern Contract"
|
||||
Cohesion: 0.29
|
||||
Nodes (6): Pattern Contract, Drawing via driver.n and apply_brightness, Pattern error handling (Presets.tick catches), Presets._load_dynamic_patterns(), Shared driver.step semantics, Global vs per-preset brightness
|
||||
|
||||
### Community 126 - "store_save"
|
||||
Cohesion: 0.23
|
||||
Nodes (10): api_register(), api_settings_defaults(), index_of(), load_file(), mount(), store_init(), store_known(), store_replace() (+2 more)
|
||||
|
||||
### Community 128 - "Blink Pattern Test"
|
||||
Cohesion: 0.33
|
||||
Nodes (3): _bootstrap_import_path(), main(), _run_ms()
|
||||
|
||||
### Community 129 - "Colour Picker Demo Image"
|
||||
Cohesion: 0.33
|
||||
Nodes (6): Custom Color Picker Demo (screenshot), Hex and RGB input support, HSB (Hue, Saturation, Brightness) color model, Keyboard accessible, customizable styling, Multiple Color Pickers for LED Patterns, Single Color Picker
|
||||
|
||||
### Community 130 - "Settings Mockup Image"
|
||||
Cohesion: 0.33
|
||||
Nodes (7): Advanced Settings (Step Counter, Step Increment, Device ID, Debug Mode), Basic Settings (Device Name, LED Pin, Number of LEDs), Color Order Selector (RGB/RBG/GRB/GBR/BRG/BGR), Device Settings Page Mockup, Network Settings (Access Point Name, Password, Enable AP), Pattern Parameters N1-N6, Pattern Settings (Pattern, Brightness, Delay)
|
||||
|
||||
### Community 135 - "api_set"
|
||||
Cohesion: 0.20
|
||||
Nodes (25): api_add(), api_id(), api_set(), add_ref(), bundle(), bundle_of(), bundles_route(), export_profile() (+17 more)
|
||||
|
||||
### Community 136 - "LinkRx"
|
||||
Cohesion: 0.18
|
||||
Nodes (3): _due(), LinkRx, send()
|
||||
|
||||
### Community 138 - "Help: Colour Palette Image"
|
||||
Cohesion: 0.40
|
||||
Nodes (6): Colour Palette modal mockup (help image), Add Swatch (+) Button, Colour Palette Modal, Palette Colour Swatches, Preset Editor 'From Palette', Profile (palette owner)
|
||||
|
||||
### Community 140 - "LED Driver README"
|
||||
Cohesion: 0.47
|
||||
Nodes (6): dev.py deploy/sync script, LED Driver README (MicroPython ESP32), Optional HTTP polling (http_poll.py), Wi-Fi TCP transport to Pi (port 8765), transport_type setting (wifi / espnow), UDP discovery (port 8766)
|
||||
|
||||
### Community 142 - "SPI Example Manifest"
|
||||
Cohesion: 0.33
|
||||
Nodes (5): dependencies, espressif/led_strip, idf, override_path, version
|
||||
|
||||
### Community 143 - "unique"
|
||||
Cohesion: 0.25
|
||||
Nodes (5): unique(), test_clone(), test_delete(), test_put(), test_put_current()
|
||||
|
||||
### Community 144 - "settings_editor.js"
|
||||
Cohesion: 0.27
|
||||
Nodes (7): loadEspnowDevices(), otaDriver(), otaFile(), otaRequest(), otaWaitBack(), showEspnowDevice(), showOtaTargets()
|
||||
|
||||
### Community 145 - "Help PDF: Modes"
|
||||
Cohesion: 0.40
|
||||
Nodes (4): Edit mode, Mobile layout Menu, Run mode, Zones modal
|
||||
|
||||
### Community 146 - "Help: Tab Preset Strip Image"
|
||||
Cohesion: 0.60
|
||||
Nodes (5): Help image: Main area brightness and preset tiles, Edit Mode: drag tiles to reorder, Global Brightness Slider, Preset Tile (gradient swatch, click to select on tab devices), Tab (e.g. lounge)
|
||||
|
||||
### Community 149 - "test_mdns.py"
|
||||
Cohesion: 0.27
|
||||
Nodes (6): _dbg(), main(), _set_hostname(), _sta_ip(), _try_resolve_local(), _wait_wifi()
|
||||
|
||||
### Community 156 - "RMT Example Manifest"
|
||||
Cohesion: 0.40
|
||||
Nodes (4): dependencies, espressif/led_strip, override_path, version
|
||||
|
||||
### Community 157 - "Help Tab JS"
|
||||
Cohesion: 0.38
|
||||
Nodes (3): addStaticIpRow(), loadDeviceSettings(), setApToggle()
|
||||
|
||||
### Community 158 - "Settings Page Template"
|
||||
Cohesion: 0.50
|
||||
Nodes (4): Settings modal (device, network), loadEspnowChannel(), Device Settings page (ESP-NOW channel), wifi_channel setting (1-11)
|
||||
|
||||
### Community 159 - "groups_route"
|
||||
Cohesion: 0.31
|
||||
Nodes (15): add_error(), api_driver_config(), api_mac(), api_migrate_groups(), brightness(), driver_config(), find(), groups_route() (+7 more)
|
||||
|
||||
### Community 160 - "web.c"
|
||||
Cohesion: 0.26
|
||||
Nodes (12): audio_page_handler(), etag(), favicon_handler(), find_file(), index_handler(), mime_for(), send_gz(), static_handler() (+4 more)
|
||||
|
||||
### Community 161 - "sequences_route"
|
||||
Cohesion: 0.26
|
||||
Nodes (13): api_current_profile(), api_migrate_sequences(), api_sequence_defaults(), apply_update(), colors_from(), has_steps(), in_profile(), migrate_seq() (+5 more)
|
||||
|
||||
### Community 162 - "tests/patterns/circle.py"
|
||||
Cohesion: 0.22
|
||||
Nodes (4): main(), run_for(), main(), run_for()
|
||||
|
||||
### Community 163 - "web.py"
|
||||
Cohesion: 0.27
|
||||
Nodes (4): download_settings(), handle_action(), index(), parse_settings_from_form()
|
||||
|
||||
### Community 164 - "test_wifi.py"
|
||||
Cohesion: 0.47
|
||||
Nodes (3): connect_wifi_with_wdt(), main(), _wifi_status_label()
|
||||
|
||||
### Community 170 - "Controller Component Deps"
|
||||
Cohesion: 0.50
|
||||
Nodes (3): dependencies, espressif/mdns, joltwallet/littlefs
|
||||
|
||||
### Community 171 - "List Search (JS)"
|
||||
Cohesion: 0.83
|
||||
Nodes (3): applyListSearch(), initListSearch(), rowSearchText()
|
||||
|
||||
## Knowledge Gaps
|
||||
- **97 isolated node(s):** `Design Guidelines`, `Device Management UI`, `Engine CLI`, `Output Drivers (DDP, Art-Net, sACN, USB-DMX)`, `Pixel Generator` (+92 more)
|
||||
These have ≤1 connection - possible missing edges or undocumented components. (Counts symbols only; 1036 node(s) total have ≤1 connection when file, concept and rationale nodes are included.)
|
||||
- **83 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
|
||||
|
||||
## Suggested Questions
|
||||
_Questions this graph is uniquely positioned to answer:_
|
||||
|
||||
- **Why does `Microdot` connect `Microdot App (dmx)` to `HTTPException (dmx)`, `Microdot Routing (dmx)`, `Microdot Request (dmx)`?**
|
||||
_High betweenness centrality (0.017) - this node is a cross-community bridge._
|
||||
- **Are the 41 inferred relationships involving `Presets` (e.g. with `test_save_and_load_roundtrip()` and `_TestContext`) actually correct?**
|
||||
_`Presets` has 41 INFERRED edges - model-reasoned connections that need verification._
|
||||
- **What connects `Design Guidelines`, `Device Management UI`, `Engine CLI` to the rest of the system?**
|
||||
_97 weakly-connected nodes found - possible documentation gaps or missing edges._
|
||||
- **Should `htmx Library` be split into smaller, more focused modules?**
|
||||
_Cohesion score 0.07897684839432412 - nodes in this community are weakly interconnected._
|
||||
- **Why does `unique()` connect `unique` to `API Tests: Sequences & Bundles`, `API Tests: Zones`, `find_id_by_field`, `API Tests: Patterns`, `API Tests: Groups`, `API Tests: Presets`, `API Test Fixtures & Audio`?**
|
||||
_High betweenness centrality (0.017) - this node is a cross-community bridge._
|
||||
- **Are the 59 inferred relationships involving `store_coll()` (e.g. with `api_add()` and `api_current_profile()`) actually correct?**
|
||||
_`store_coll()` has 59 INFERRED edges - model-reasoned connections that need verification._
|
||||
- **Should `machine` be split into smaller, more focused modules?**
|
||||
_Cohesion score 0.047619047619047616 - nodes in this community are weakly interconnected._
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"runs": [
|
||||
{
|
||||
"date": "2026-11-03T12:13:15.159050+00:00",
|
||||
"input_tokens": 1267015,
|
||||
"output_tokens": 0,
|
||||
"files": 332
|
||||
}
|
||||
],
|
||||
"total_input_tokens": 1267015,
|
||||
"total_output_tokens": 0
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"directed":false,"multigraph":false,"graph":{"hyperedges":[{"id":"audio_page_endpoints","label":"Audio page live endpoints","nodes":["web_audio_status","web_audio_beats","web_audio_audio_wav","web_audio_time","web_audio_tap_ep"],"relation":"participate_in","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"web/audio.html"},{"id":"beat_latency_measurement","label":"Beat latency measurement methods","nodes":["docs_api_bench_endpoints","docs_bench_test_usb_latency","docs_bench_test_logic_analyzer","docs_bench_test_beat_lead"],"relation":"participate_in","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/BENCH_TEST.md"},{"id":"brightness_combination","label":"Combined brightness factors","nodes":["docs_api_combined_brightness","docs_api_settings","docs_api_groups","docs_api_devices","docs_api_zones"],"relation":"participate_in","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/API.md"},{"id":"color_picker_feature_set","label":"Color picker feature set","nodes":["docs_mockups_images_color_picker_demo_hsb_color_model","docs_mockups_images_color_picker_demo_hex_rgb_input","docs_mockups_images_color_picker_demo_keyboard_accessibility","docs_mockups_images_color_picker_demo_cross_platform_consistency"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/images/color-picker-demo.png"},{"id":"docs_help_edit_mode_management","label":"Edit-mode-only management features","nodes":["docs_help_edit_mode","docs_help_zones_modal","docs_help_send_presets","docs_help_patterns_dialog","docs_help_colour_palette","docs_help_presets_list"],"relation":"participate_in","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/help.pdf"},{"id":"docs_help_preset_editor_actions","label":"Preset editor actions (Try, Default, Save & Send, Remove from zone)","nodes":["docs_help_try_action","docs_help_default_preset","docs_help_save_and_send","docs_help_remove_from_zone"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/help.pdf"},{"id":"docs_images_help_mobile_menu_header_actions","label":"Header actions aggregated in mobile Menu","nodes":["docs_images_help_mobile_menu_run_mode","docs_images_help_mobile_menu_profiles","docs_images_help_mobile_menu_tabs","docs_images_help_mobile_menu_presets","docs_images_help_mobile_menu_help"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/images/help/mobile-menu.svg"},{"id":"docs_mockups_device_modal_flow","label":"Device/Group Modal Flow","nodes":["docs_mockups_device_management_showadddevicemodal","docs_mockups_device_management_showaddgroupmodal","docs_mockups_device_management_closemodal","docs_mockups_device_management_savedevice"],"relation":"participate_in","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/device-management.html"},{"id":"docs_mockups_images_index_ui_mockup_set","label":"LED Driver UI Mockup Set","nodes":["docs_mockups_images_index_dashboard_mockup","docs_mockups_images_index_pattern_selector_mockup","docs_mockups_images_index_device_management_mockup","docs_mockups_images_index_settings_mockup","docs_mockups_images_index_presets_mockup"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/images/index.png"},{"id":"docs_mockups_images_pattern_selector_led_patterns","label":"Selectable LED Patterns","nodes":["docs_mockups_images_pattern_selector_on","docs_mockups_images_pattern_selector_off","docs_mockups_images_pattern_selector_blink","docs_mockups_images_pattern_selector_chase","docs_mockups_images_pattern_selector_circle","docs_mockups_images_pattern_selector_pulse","docs_mockups_images_pattern_selector_rainbow","docs_mockups_images_pattern_selector_transition"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/images/pattern-selector.png"},{"id":"docs_mockups_preset_schema","label":"Preset/pattern configuration schema (pattern, colors, delay, step increment, N1-N8)","nodes":["docs_mockups_presets_led_patterns","docs_mockups_presets_delay","docs_mockups_presets_step_increment","docs_mockups_presets_n_parameters","docs_mockups_presets_step_offset"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/presets.html"},{"id":"docs_mockups_settings_sections","label":"Device settings sections","nodes":["docs_mockups_settings_basic_settings","docs_mockups_settings_pattern_settings","docs_mockups_settings_advanced_settings","docs_mockups_settings_network_settings"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/settings.html"},{"id":"docs_mockups_ui_mockup_suite","label":"LED Driver UI Mockup Suite","nodes":["docs_mockups_index","docs_mockups_dashboard","docs_mockups_pattern_selector","docs_mockups_device_management","docs_mockups_readme_settings_mockup","docs_mockups_color_picker_readme_presets_mockup"],"relation":"foLine truncated
|
||||
@@ -0,0 +1,140 @@
|
||||
{
|
||||
"1": "htmx Library",
|
||||
"3": "Browser Tests & Mockup Images",
|
||||
"4": "Audio UI (JS)",
|
||||
"5": "ESP-NOW TX & DMX Pulse",
|
||||
"6": "Driver OTA over ESP-NOW",
|
||||
"7": "led-tool Device CLI",
|
||||
"10": "Spec: Pi Animation Engine",
|
||||
"11": "Beat Sync on Driver",
|
||||
"12": "Presets UI (JS)",
|
||||
"13": "Zones UI (JS)",
|
||||
"14": "Pattern Store & Web (C)",
|
||||
"15": "ESP-NOW Receive Tests",
|
||||
"16": "Sequences UI (JS)",
|
||||
"17": "Driver Controller Messages",
|
||||
"19": "led_strip Component Docs",
|
||||
"20": "Art-Net Output",
|
||||
"21": "Reliable ESP-NOW Link (C)",
|
||||
"23": "Driver Presets Store",
|
||||
"28": "Devices UI (JS)",
|
||||
"29": "DMX Driver HTTP App",
|
||||
"30": "Colour Picker Mockups",
|
||||
"31": "ESP-NOW Wire & Transport",
|
||||
"33": "Driver OTA Broadcast (C)",
|
||||
"35": "Binary Envelope (test)",
|
||||
"36": "API Docs: Outputs & Audio",
|
||||
"37": "mpremote Commands",
|
||||
"39": "Beat Detection DSP (C)",
|
||||
"43": "Driver Test Runner",
|
||||
"44": "Microdot Helpers",
|
||||
"45": "Bridge WebSocket Blink Test",
|
||||
"47": "USB Latency Tools",
|
||||
"48": "Colour Picker JS",
|
||||
"49": "Chromium Colour Picker JS",
|
||||
"51": "API Tests: Devices",
|
||||
"52": "Presets & Settings Mockups",
|
||||
"53": "mpremote Transport",
|
||||
"54": "Outputs Config (C)",
|
||||
"55": "Microdot Handlers (dmx)",
|
||||
"56": "MultiDict (dmx)",
|
||||
"58": "Microdot Handlers (led)",
|
||||
"59": "MultiDict (led)",
|
||||
"60": "mpremote Serial Transport",
|
||||
"61": "API Test Fixtures & Audio",
|
||||
"62": "Microdot Request (dmx)",
|
||||
"63": "Help: Zones & Palette",
|
||||
"68": "API Tests: Zones",
|
||||
"70": "Index Page Modals",
|
||||
"71": "Microdot Templates (led)",
|
||||
"72": "Microdot Templates (dmx)",
|
||||
"73": "Microdot WebSocket (dmx)",
|
||||
"74": "Microdot WebSocket (led)",
|
||||
"76": "Controller Overview & OTA Docs",
|
||||
"78": "Driver Hello Discovery",
|
||||
"79": "Audio Monitor Page",
|
||||
"80": "Art-Net DMX Tests",
|
||||
"81": "DMX Output Manager",
|
||||
"83": "Microdot Sessions (led)",
|
||||
"85": "ESP-NOW Sender Bridge",
|
||||
"87": "Microdot Async IO (dmx)",
|
||||
"88": "DMX Settings",
|
||||
"89": "Microdot Async IO (led)",
|
||||
"91": "Microdot Routing (dmx)",
|
||||
"92": "Bench Test Plan",
|
||||
"93": "Microdot Routing (led)",
|
||||
"94": "Flame Pattern",
|
||||
"95": "Microdot Auth (dmx)",
|
||||
"96": "Serial DMX & WiFi",
|
||||
"97": "DMX Pattern Player",
|
||||
"98": "DMX Preset Model",
|
||||
"99": "Twinkle Pattern",
|
||||
"100": "Driver Settings",
|
||||
"101": "Groups UI (JS)",
|
||||
"102": "Microdot Auth (led)",
|
||||
"103": "Help: Mobile Menu Image",
|
||||
"104": "Pattern Selector Mockup Image",
|
||||
"105": "Driver Pattern Docs",
|
||||
"106": "Driver Preset Model",
|
||||
"108": "Microdot JWT Session",
|
||||
"109": "Driver Message API Docs",
|
||||
"110": "Driver Binary Envelope",
|
||||
"111": "led_strip Manifest",
|
||||
"113": "Outputs UI (JS)",
|
||||
"114": "DMX Driver Docs",
|
||||
"115": "Help PDF: Overview",
|
||||
"116": "Mockups Index Image",
|
||||
"118": "Help: Header Toolbar Image",
|
||||
"119": "Help: Preset Editor Image",
|
||||
"120": "Dashboard Mockup Image",
|
||||
"121": "Device Management Mockup Image",
|
||||
"122": "Presets Mockup Image",
|
||||
"123": "Pattern Contract",
|
||||
"124": "Microdot SessionDict",
|
||||
"127": "Numpad Shortcuts (JS)",
|
||||
"129": "Colour Picker Demo Image",
|
||||
"130": "Settings Mockup Image",
|
||||
"134": "API Tests: Settings",
|
||||
"137": "HTTPException (dmx)",
|
||||
"138": "Help: Colour Palette Image",
|
||||
"139": "HTTPException (led)",
|
||||
"140": "LED Driver README",
|
||||
"142": "SPI Example Manifest",
|
||||
"145": "Help PDF: Modes",
|
||||
"146": "Help: Tab Preset Strip Image",
|
||||
"147": "Blink Pattern",
|
||||
"148": "Circle Pattern",
|
||||
"151": "Plasma Pattern",
|
||||
"152": "Radiate Pattern",
|
||||
"153": "Transition Pattern",
|
||||
"154": "Driver Runtime State",
|
||||
"156": "RMT Example Manifest",
|
||||
"157": "Help Tab JS",
|
||||
"158": "Settings Page Template",
|
||||
"171": "List Search (JS)",
|
||||
"172": "DMX Solid Pattern",
|
||||
"173": "led-test Manifest",
|
||||
"174": "VPN Autoconnect Script",
|
||||
"175": "Zone Devices Panel",
|
||||
"176": "graphify Instructions",
|
||||
"177": "Microdot Package (dmx)",
|
||||
"178": "Microdot Package (led)",
|
||||
"179": "Env Check",
|
||||
"180": "Device Mockup Modals",
|
||||
"181": "bulk.sh Script",
|
||||
"182": "deploy.sh Script",
|
||||
"183": "Driver install.sh",
|
||||
"184": "Pattern Package Init",
|
||||
"185": "led-tool install.sh",
|
||||
"186": "Help PDF Build Script",
|
||||
"187": "Web Build Script",
|
||||
"188": "Patterns UI (JS)",
|
||||
"189": "DMX Patterns Init",
|
||||
"190": "Mockup Tab Switch",
|
||||
"191": "Spec: Pattern Selector UI",
|
||||
"192": "mpremote Package",
|
||||
"193": "Bundle Import/Export (JS)",
|
||||
"194": "Colour Palette (JS)",
|
||||
"195": "Profiles UI (JS)",
|
||||
"196": "Zone Palette (JS)"
|
||||
}
|
||||
@@ -0,0 +1,864 @@
|
||||
# Graph Report - led-controller (2026-11-10)
|
||||
|
||||
## Corpus Check
|
||||
- 355 files · ~244,821 words
|
||||
- Verdict: corpus is large enough that graph structure adds value.
|
||||
- Unclassified: 47 file(s) not represented in the graph (top: (none) 25, .mdc 6, .css 5)
|
||||
|
||||
## Summary
|
||||
- 4136 nodes · 9245 edges · 235 communities (139 shown, 96 thin omitted)
|
||||
- Extraction: 88% EXTRACTED · 12% INFERRED · 0% AMBIGUOUS · INFERRED: 1133 edges (avg confidence: 0.86)
|
||||
- Token cost: 0 input · 0 output
|
||||
|
||||
## Graph Freshness
|
||||
- Built from commit: `2543673b`
|
||||
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
|
||||
- Run `graphify update .` after code changes (no API cost).
|
||||
|
||||
## Community Hubs (Navigation)
|
||||
- os
|
||||
- htmx Library
|
||||
- machine
|
||||
- Browser Tests & Mockup Images
|
||||
- Audio UI (JS)
|
||||
- ESP-NOW TX & DMX Pulse
|
||||
- Driver OTA over ESP-NOW
|
||||
- led-tool Device CLI
|
||||
- utime
|
||||
- Compiler
|
||||
- Spec: Pi Animation Engine
|
||||
- Beat Sync on Driver
|
||||
- Presets UI (JS)
|
||||
- Zones UI (JS)
|
||||
- Pattern Store & Web (C)
|
||||
- ESP-NOW Receive Tests
|
||||
- Sequences UI (JS)
|
||||
- Driver Controller Messages
|
||||
- main/main.c
|
||||
- led_strip Component Docs
|
||||
- Art-Net Output
|
||||
- Reliable ESP-NOW Link (C)
|
||||
- rel.c
|
||||
- Driver Presets Store
|
||||
- style_mode
|
||||
- Microdot
|
||||
- Microdot
|
||||
- seqplay.c
|
||||
- Devices UI (JS)
|
||||
- DMX Driver HTTP App
|
||||
- Colour Picker Mockups
|
||||
- ESP-NOW Wire & Transport
|
||||
- mic.c
|
||||
- Driver OTA Broadcast (C)
|
||||
- test_sequences.py
|
||||
- Binary Envelope (test)
|
||||
- API Docs: Outputs & Audio
|
||||
- mpremote Commands
|
||||
- startup.py
|
||||
- Beat Detection DSP (C)
|
||||
- LedSimulatorApp
|
||||
- string
|
||||
- presets.py
|
||||
- Driver Test Runner
|
||||
- Microdot Helpers
|
||||
- Bridge WebSocket Blink Test
|
||||
- BridgeSim
|
||||
- USB Latency Tools
|
||||
- Colour Picker JS
|
||||
- Chromium Colour Picker JS
|
||||
- led_strip_spi_dev.c
|
||||
- API Tests: Devices
|
||||
- Presets & Settings Mockups
|
||||
- mpremote Transport
|
||||
- Outputs Config (C)
|
||||
- Microdot Handlers (dmx)
|
||||
- MultiDict (dmx)
|
||||
- led_strip_rmt_dev.c
|
||||
- Microdot Handlers (led)
|
||||
- MultiDict (led)
|
||||
- mpremote Serial Transport
|
||||
- API Test Fixtures & Audio
|
||||
- Microdot Request (dmx)
|
||||
- Help: Zones & Palette
|
||||
- api/helpers.py
|
||||
- engine_init
|
||||
- rig.py
|
||||
- audio_api.c
|
||||
- API Tests: Zones
|
||||
- pytest
|
||||
- Index Page Modals
|
||||
- Microdot Templates (led)
|
||||
- Microdot Templates (dmx)
|
||||
- Microdot WebSocket (dmx)
|
||||
- Microdot WebSocket (led)
|
||||
- pathlib
|
||||
- Controller Overview & OTA Docs
|
||||
- bridge_sim.py
|
||||
- Driver Hello Discovery
|
||||
- Audio Monitor Page
|
||||
- Art-Net DMX Tests
|
||||
- DMX Output Manager
|
||||
- machine
|
||||
- Microdot Sessions (led)
|
||||
- test_groups.py
|
||||
- ESP-NOW Sender Bridge
|
||||
- stdlib
|
||||
- Microdot Async IO (dmx)
|
||||
- DMX Settings
|
||||
- Microdot Async IO (led)
|
||||
- test_routes.py
|
||||
- Microdot Routing (dmx)
|
||||
- Bench Test Plan
|
||||
- Microdot Routing (led)
|
||||
- Flame Pattern
|
||||
- Microdot Auth (dmx)
|
||||
- Serial DMX & WiFi
|
||||
- DMX Pattern Player
|
||||
- DMX Preset Model
|
||||
- Twinkle Pattern
|
||||
- Driver Settings
|
||||
- Groups UI (JS)
|
||||
- Microdot Auth (led)
|
||||
- Help: Mobile Menu Image
|
||||
- Pattern Selector Mockup Image
|
||||
- Driver Pattern Docs
|
||||
- Driver Preset Model
|
||||
- rig_seed.py
|
||||
- Microdot JWT Session
|
||||
- Driver Message API Docs
|
||||
- Driver Binary Envelope
|
||||
- led_strip Manifest
|
||||
- scanner.py
|
||||
- Outputs UI (JS)
|
||||
- DMX Driver Docs
|
||||
- Help PDF: Overview
|
||||
- Mockups Index Image
|
||||
- engine.c
|
||||
- Help: Header Toolbar Image
|
||||
- Help: Preset Editor Image
|
||||
- Dashboard Mockup Image
|
||||
- Device Management Mockup Image
|
||||
- Presets Mockup Image
|
||||
- Pattern Contract
|
||||
- Microdot SessionDict
|
||||
- driver_ota.py
|
||||
- time
|
||||
- Numpad Shortcuts (JS)
|
||||
- Rig
|
||||
- Colour Picker Demo Image
|
||||
- Settings Mockup Image
|
||||
- sim_demo.py
|
||||
- test_patterns.py
|
||||
- beat_get_info
|
||||
- store_coll
|
||||
- web.py
|
||||
- HTTPException (dmx)
|
||||
- Help: Colour Palette Image
|
||||
- HTTPException (led)
|
||||
- LED Driver README
|
||||
- Pin
|
||||
- SPI Example Manifest
|
||||
- test_rig_sim.py
|
||||
- settings_editor.js
|
||||
- Help PDF: Modes
|
||||
- Help: Tab Preset Strip Image
|
||||
- Blink Pattern
|
||||
- Circle Pattern
|
||||
- res_device.c
|
||||
- api_error
|
||||
- Plasma Pattern
|
||||
- Radiate Pattern
|
||||
- Transition Pattern
|
||||
- Driver Runtime State
|
||||
- app.js
|
||||
- RMT Example Manifest
|
||||
- Help Tab JS
|
||||
- Settings Page Template
|
||||
- led-driver/lib/microdot/microdot.py
|
||||
- random
|
||||
- host/conftest.py
|
||||
- beat.c
|
||||
- status_get_handler
|
||||
- store.c
|
||||
- Flicker
|
||||
- sequences_route
|
||||
- api_id
|
||||
- ws.c
|
||||
- SerialIntercept
|
||||
- dependencies
|
||||
- List Search (JS)
|
||||
- DMX Solid Pattern
|
||||
- led-test Manifest
|
||||
- VPN Autoconnect Script
|
||||
- graphify Instructions
|
||||
- bulk.sh Script
|
||||
- deploy.sh Script
|
||||
- Driver install.sh
|
||||
- led-tool install.sh
|
||||
- Help PDF Build Script
|
||||
- Web Build Script
|
||||
- Spec: Pattern Selector UI
|
||||
- envelope.c
|
||||
- res_group.c
|
||||
- Controller
|
||||
- _simlink_web.py
|
||||
- web.c
|
||||
- ._loop_main
|
||||
- _simlink_proc.py
|
||||
- device_groups.py
|
||||
- build_app
|
||||
- ESPNow
|
||||
- tests/patterns/circle.py
|
||||
- WLAN
|
||||
- MultiDict
|
||||
- MultiDict
|
||||
- tests/patterns/blink.py
|
||||
- SimRing
|
||||
- tests/patterns/transition.py
|
||||
- NeoPixel
|
||||
- dmx-driver/lib/microdot/microdot.py
|
||||
- Icicles
|
||||
- Rime
|
||||
- tests/patterns/rain_drops.py
|
||||
- snowfall.py
|
||||
- GradientWipe
|
||||
- BarGraph
|
||||
- ClockSweep
|
||||
- start_new_thread
|
||||
- examples/blink.py
|
||||
- examples/chase.py
|
||||
- README.md
|
||||
|
||||
## God Nodes (most connected - your core abstractions)
|
||||
1. `Presets` - 73 edges
|
||||
2. `store_coll()` - 70 edges
|
||||
3. `api_error()` - 52 edges
|
||||
4. `api_json()` - 48 edges
|
||||
5. `unique()` - 43 edges
|
||||
6. `new_id()` - 41 edges
|
||||
7. `api_set()` - 40 edges
|
||||
8. `store_save()` - 39 edges
|
||||
9. `WDT` - 37 edges
|
||||
10. `esp_timer_get_time()` - 34 edges
|
||||
|
||||
## Surprising Connections (you probably didn't know these)
|
||||
- `Preset editor modal` --semantically_similar_to--> `Preset fields (pattern, colors, delay, brightness, auto, n1-n6)` [INFERRED] [semantically similar]
|
||||
web/templates/index.html → led-driver/docs/API.md
|
||||
- `led-driver-style pattern engine (Preset object)` --semantically_similar_to--> `led-driver MicroPython firmware (submodule)` [INFERRED] [semantically similar]
|
||||
dmx-driver/README.md → README.md
|
||||
- `on_ping_rsp()` --calls--> `esp_timer_get_time()` [INFERRED]
|
||||
main/res_device.c → sim-controller/components/sim/sim_timer.c
|
||||
- `espnow-sender Microdot WebSocket receiver` --semantically_similar_to--> `WebSocket /ws driver message relay` [INFERRED] [semantically similar]
|
||||
espnow-sender/README.md → docs/API.md
|
||||
- `Art-Net output (UDP 6454)` --semantically_similar_to--> `Outputs (DDP, Art-Net, sACN, DMX serial pixel fixtures)` [INFERRED] [semantically similar]
|
||||
dmx-driver/README.md → docs/API.md
|
||||
|
||||
## Import Cycles
|
||||
- None detected.
|
||||
|
||||
## Hyperedges (group relationships)
|
||||
- **Audio page live endpoints** — web_audio_status, web_audio_beats, web_audio_audio_wav, web_audio_time, web_audio_tap_ep [EXTRACTED 1.00]
|
||||
- **Beat latency measurement methods** — docs_api_bench_endpoints, docs_bench_test_usb_latency, docs_bench_test_logic_analyzer, docs_bench_test_beat_lead [EXTRACTED 1.00]
|
||||
- **Combined brightness factors** — docs_api_combined_brightness, docs_api_settings, docs_api_groups, docs_api_devices, docs_api_zones [EXTRACTED 1.00]
|
||||
- **Color picker feature set** — docs_mockups_images_color_picker_demo_hsb_color_model, docs_mockups_images_color_picker_demo_hex_rgb_input, docs_mockups_images_color_picker_demo_keyboard_accessibility, docs_mockups_images_color_picker_demo_cross_platform_consistency [EXTRACTED 1.00]
|
||||
- **Edit-mode-only management features** — docs_help_edit_mode, docs_help_zones_modal, docs_help_send_presets, docs_help_patterns_dialog, docs_help_colour_palette, docs_help_presets_list [EXTRACTED 1.00]
|
||||
- **Preset editor actions (Try, Default, Save & Send, Remove from zone)** — docs_help_try_action, docs_help_default_preset, docs_help_save_and_send, docs_help_remove_from_zone [EXTRACTED 1.00]
|
||||
- **Header actions aggregated in mobile Menu** — docs_images_help_mobile_menu_run_mode, docs_images_help_mobile_menu_profiles, docs_images_help_mobile_menu_tabs, docs_images_help_mobile_menu_presets, docs_images_help_mobile_menu_help [EXTRACTED 1.00]
|
||||
- **Device/Group Modal Flow** — docs_mockups_device_management_showadddevicemodal, docs_mockups_device_management_showaddgroupmodal, docs_mockups_device_management_closemodal, docs_mockups_device_management_savedevice [EXTRACTED 1.00]
|
||||
- **LED Driver UI Mockup Set** — docs_mockups_images_index_dashboard_mockup, docs_mockups_images_index_pattern_selector_mockup, docs_mockups_images_index_device_management_mockup, docs_mockups_images_index_settings_mockup, docs_mockups_images_index_presets_mockup [EXTRACTED 1.00]
|
||||
- **Selectable LED Patterns** — docs_mockups_images_pattern_selector_on, docs_mockups_images_pattern_selector_off, docs_mockups_images_pattern_selector_blink, docs_mockups_images_pattern_selector_chase, docs_mockups_images_pattern_selector_circle, docs_mockups_images_pattern_selector_pulse, docs_mockups_images_pattern_selector_rainbow, docs_mockups_images_pattern_selector_transition [EXTRACTED 1.00]
|
||||
- **Preset/pattern configuration schema (pattern, colors, delay, step increment, N1-N8)** — docs_mockups_presets_led_patterns, docs_mockups_presets_delay, docs_mockups_presets_step_increment, docs_mockups_presets_n_parameters, docs_mockups_presets_step_offset [EXTRACTED 1.00]
|
||||
- **Device settings sections** — docs_mockups_settings_basic_settings, docs_mockups_settings_pattern_settings, docs_mockups_settings_advanced_settings, docs_mockups_settings_network_settings [EXTRACTED 1.00]
|
||||
- **LED Driver UI Mockup Suite** — docs_mockups_index, docs_mockups_dashboard, docs_mockups_pattern_selector, docs_mockups_device_management, docs_mockups_readme_settings_mockup, docs_mockups_color_picker_readme_presets_mockup [EXTRACTED 1.00]
|
||||
- **Pi-to-ESP32 Command Paths** — docs_specification_serial_espnow_bridge, docs_specification_wifi_driver_tcp, docs_specification_espnow, docs_specification_pi_controller [EXTRACTED 1.00]
|
||||
- **led_strip backend choice (RMT vs SPI, DMA)** — scripts_led_test_managed_components_espressif__led_strip_readme_rmt_backend, scripts_led_test_managed_components_espressif__led_strip_readme_spi_backend, scripts_led_test_managed_components_espressif__led_strip_readme_dma_support, scripts_led_test_managed_components_espressif__led_strip_readme_backend_selection_flowchart [EXTRACTED 1.00]
|
||||
- **led_strip pixel write and flush flow** — scripts_led_test_managed_components_espressif__led_strip_api_led_strip_set_pixel, scripts_led_test_managed_components_espressif__led_strip_api_led_strip_set_pixel_hsv, scripts_led_test_managed_components_espressif__led_strip_api_led_strip_set_pixel_rgbw, scripts_led_test_managed_components_espressif__led_strip_api_led_strip_refresh, scripts_led_test_managed_components_espressif__led_strip_api_led_strip_clear [EXTRACTED 1.00]
|
||||
- **Dynamic pattern contract** — led_driver_docs_pattern_contract_class_shape, led_driver_docs_pattern_contract_run_generator_rules, led_driver_docs_pattern_contract_drawing_brightness, led_driver_docs_pattern_contract_step_semantics, led_driver_docs_pattern_contract_error_handling [EXTRACTED 1.00]
|
||||
- **Pi Animation Engine Output Pipeline** — docs_specification_pixel_generator, docs_specification_output_drivers, docs_specification_output_record, docs_specification_zone_playback, docs_specification_sequencer [EXTRACTED 1.00]
|
||||
- **Beat-Driven Scene Activation** — docs_specification_beat_detection_device, docs_specification_bpm_sync, docs_specification_beat_counter_phases, docs_specification_scene_queue [INFERRED 0.85]
|
||||
- **Fields defining an LED preset (name, pattern, colours, parameters)** — docs_images_help_preset_editor_preset_name_field, docs_images_help_preset_editor_pattern_selector, docs_images_help_preset_editor_palette_linked_colour, docs_images_help_preset_editor_preset_parameters [INFERRED 0.85]
|
||||
- **Pattern settings composed and applied to devices** — docs_mockups_images_dashboard_pattern_selection, docs_mockups_images_dashboard_brightness_speed, docs_mockups_images_dashboard_colors, docs_mockups_images_dashboard_apply_settings [INFERRED 0.85]
|
||||
- **Preset lifecycle actions (create, apply, sync)** — docs_mockups_images_presets_create_preset, docs_mockups_images_presets_apply_preset, docs_mockups_images_presets_sync_presets_to_all_devices [INFERRED 0.85]
|
||||
- **ESP-NOW driver delivery layers** — docs_api_binary_envelope, docs_api_delivery_digest, docs_bench_test_reliable_link, docs_bench_test_beat_double_send [INFERRED 0.85]
|
||||
- **v1 message handling on driver** — led_driver_docs_api_v1_message, led_driver_docs_patterns_process_data_flow, led_driver_docs_patterns_pattern_registry, led_driver_docs_patterns_preset_short_keys, led_driver_docs_api_select_message [INFERRED 0.85]
|
||||
|
||||
## Communities (235 total, 96 thin omitted)
|
||||
|
||||
### Community 0 - "os"
|
||||
Cohesion: 0.14
|
||||
Nodes (4): main(), boot(), info(), upload()
|
||||
|
||||
### Community 1 - "htmx Library"
|
||||
Cohesion: 0.08
|
||||
Nodes (101): a(), Ae(), an(), at(), B(), be(), bn(), bt() (+93 more)
|
||||
|
||||
### Community 2 - "machine"
|
||||
Cohesion: 0.05
|
||||
Nodes (34): run_tick(), main(), run_for(), main(), run_for(), main(), run_for(), main() (+26 more)
|
||||
|
||||
### Community 3 - "Browser Tests & Mockup Images"
|
||||
Cohesion: 0.06
|
||||
Nodes (17): generate_image(), generate_with_html2image(), generate_with_playwright(), generate_with_selenium(), main(), browser(), _browser_sleep(), BrowserTest (+9 more)
|
||||
|
||||
### Community 4 - "Audio UI (JS)"
|
||||
Cohesion: 0.11
|
||||
Nodes (58): applyAudioStatus(), applyServerAudioUiFields(), audioRunPreferredDeviceId(), beatSyncButtonTitle(), bind(), clampLiveBpm(), clampSimulatedBpm(), clearBeatPhaseTimers() (+50 more)
|
||||
|
||||
### Community 5 - "ESP-NOW TX & DMX Pulse"
|
||||
Cohesion: 0.07
|
||||
Nodes (24): bench_on_echo(), bridge_active(), bridge_send(), bridge_start(), ap_event(), bulk_task(), espnow_tx_drop(), espnow_tx_init() (+16 more)
|
||||
|
||||
### Community 6 - "Driver OTA over ESP-NOW"
|
||||
Cohesion: 0.09
|
||||
Nodes (30): handle(), _makedirs(), Ota, _remove(), safe_path(), _hash_file(), load(), _normalize_path() (+22 more)
|
||||
|
||||
### Community 7 - "led-tool Device CLI"
|
||||
Cohesion: 0.08
|
||||
Nodes (13): download_presets(), download_settings(), _get_ordered_actions(), main(), resolve_flash_binary(), upload_presets(), upload_settings(), copy_file() (+5 more)
|
||||
|
||||
### Community 8 - "utime"
|
||||
Cohesion: 0.06
|
||||
Nodes (18): Orbit, Pulse, StrobeBurst, main(), run_for(), main(), run_for(), main() (+10 more)
|
||||
|
||||
### Community 9 - "Compiler"
|
||||
Cohesion: 0.06
|
||||
Nodes (8): Loader, Loader, Compiler, Loader, Loader, Loader, Compiler, Loader
|
||||
|
||||
### Community 10 - "Spec: Pi Animation Engine"
|
||||
Cohesion: 0.07
|
||||
Nodes (46): Pi Animation Engine (src/engine), docs/API.md, Beat Counter and Phases, Beat Detection Device, Binary Message Protocol, BPM Sync, Dashboard UI (dashboard.html), usqlite Database Schema (presets, profiles, scenes, scene_groups) (+38 more)
|
||||
|
||||
### Community 11 - "Beat Sync on Driver"
|
||||
Cohesion: 0.07
|
||||
Nodes (37): BeatSync, _diff(), _due(), LinkRx, send(), frame(), run(), test_bad_frames() (+29 more)
|
||||
|
||||
### Community 12 - "Presets UI (JS)"
|
||||
Cohesion: 0.09
|
||||
Nodes (42): arrayToGrid(), coerceManualBeatN(), coercePresetAuto(), coercePresetBackground(), coercePresetInt(), createPresetButton(), deviceNamesForPresetOnCurrentZone(), editPresetFromTab() (+34 more)
|
||||
|
||||
### Community 13 - "Zones UI (JS)"
|
||||
Cohesion: 0.10
|
||||
Nodes (42): applyBrightnessSliders(), applyZoneContentKindEditModal(), clamp255(), computeZoneNamesTargets(), computeZonePresetUnionTargets(), computeZoneTargets(), createZone(), effectiveGroupIdsForZonePreset() (+34 more)
|
||||
|
||||
### Community 14 - "Pattern Store & Web (C)"
|
||||
Cohesion: 0.23
|
||||
Nodes (20): add_name(), all_patterns(), base_name(), builtin(), create_driver_pattern(), create_pattern(), exists(), file_names() (+12 more)
|
||||
|
||||
### Community 15 - "ESP-NOW Receive Tests"
|
||||
Cohesion: 0.12
|
||||
Nodes (14): get_wdt(), main(), MockESPNow, run_main_loop_iterations(), test_beat_functionality(), test_color_conversion(), test_full_message(), test_preset_creation() (+6 more)
|
||||
|
||||
### Community 16 - "Sequences UI (JS)"
|
||||
Cohesion: 0.08
|
||||
Nodes (55): addSeqTarget(), addSequenceToTab(), addTargetsPerDriver(), appendZoneSequenceTiles(), applySequenceEditorMode(), applySequenceKindUi(), applySequenceSwitchWaitFromServer(), buildLaneGroupIdsForEditor() (+47 more)
|
||||
|
||||
### Community 17 - "Driver Controller Messages"
|
||||
Cohesion: 0.09
|
||||
Nodes (26): apply_brightness(), apply_clear_presets(), apply_default(), apply_device_config(), apply_patterns_ota(), apply_presets(), apply_select(), _config_flag() (+18 more)
|
||||
|
||||
### Community 18 - "main/main.c"
|
||||
Cohesion: 0.10
|
||||
Nodes (8): dhcp_settled(), gateway_answers(), have_static_ips(), link_up_task(), parse_static(), try_static_ips(), led_strip_spi_config_t, led_strip_t
|
||||
|
||||
### Community 19 - "led_strip Component Docs"
|
||||
Cohesion: 0.10
|
||||
Nodes (36): led_test ESP-IDF project, led_test main component (main.c), led_strip API Reference, led_model_t (WS2812/SK6812), led_pixel_format_t (GRB/GRBW), led_strip_clear(), led_strip_config_t, led_strip_del() (+28 more)
|
||||
|
||||
### Community 20 - "Art-Net Output"
|
||||
Cohesion: 0.10
|
||||
Nodes (9): ArtNet, build_artdmx(), _ip_bytes(), _pad(), port_lo(), ticks_diff(), ticks_ms(), _u16le() (+1 more)
|
||||
|
||||
### Community 21 - "Reliable ESP-NOW Link (C)"
|
||||
Cohesion: 0.12
|
||||
Nodes (21): beat_tap(), bench_running(), engine_groups_push_all(), send_cmd(), skip_unresponsive(), espnow_tx_beat(), on_beat(), send_beat_copy() (+13 more)
|
||||
|
||||
### Community 22 - "rel.c"
|
||||
Cohesion: 0.17
|
||||
Nodes (13): rel_set_ping_cb(), app_main(), app_main(), configure_led(), app_main(), configure_led(), led_strip_handle_t, led_strip_clear() (+5 more)
|
||||
|
||||
### Community 23 - "Driver Presets Store"
|
||||
Cohesion: 0.06
|
||||
Nodes (4): DMX, Presets, Strip, Pin
|
||||
|
||||
### Community 24 - "style_mode"
|
||||
Cohesion: 0.06
|
||||
Nodes (7): Aurora, Chase, ColourCycle, Meteor, Particles, style_mode(), Sparkle
|
||||
|
||||
### Community 27 - "seqplay.c"
|
||||
Cohesion: 0.13
|
||||
Nodes (43): add_id(), advance_time(), anchor_bar(), audio_drives(), bit(), chase_mask(), chase_move(), clear_drivers() (+35 more)
|
||||
|
||||
### Community 28 - "Devices UI (JS)"
|
||||
Cohesion: 0.10
|
||||
Nodes (32): applyEspnowPingAggregateToDots(), applyEspnowPingToDeviceRows(), applyTcpSnapshot(), applyTransportVisibility(), collectDeviceEditPayload(), createDeviceFromModal(), createDeviceIdentifyButton(), DEVICE_DOT_CLASSES (+24 more)
|
||||
|
||||
### Community 29 - "DMX Driver HTTP App"
|
||||
Cohesion: 0.09
|
||||
Nodes (9): _expand(), _preset_from_map(), process_data(), _select_entries(), _targets_for_key(), create_app(), serial_ports(), ws_handler() (+1 more)
|
||||
|
||||
### Community 30 - "Colour Picker Mockups"
|
||||
Cohesion: 0.11
|
||||
Nodes (25): Chromium-style Color Picker Demo, ColorPickerChromium Component, updateColors() (Chromium demo), Custom Color Picker Demo, updateColors() (standard demo), Custom Colour Picker README, POST /api/colors (example), ColorPicker Component (+17 more)
|
||||
|
||||
### Community 31 - "ESP-NOW Wire & Transport"
|
||||
Cohesion: 0.16
|
||||
Nodes (20): make_sender(), _dlog(), espnow_receive_loop(), _handle_packet(), init_espnow(), _schedule_ping_rsp(), send_boot_announce(), _send_ping_rsp() (+12 more)
|
||||
|
||||
### Community 32 - "mic.c"
|
||||
Cohesion: 0.09
|
||||
Nodes (15): audio_get_handler(), audio_register(), audio_stream_task(), beats_get_handler(), send_all(), tap_post_handler(), time_get_handler(), wav_header() (+7 more)
|
||||
|
||||
### Community 33 - "Driver OTA Broadcast (C)"
|
||||
Cohesion: 0.17
|
||||
Nodes (19): broadcast_chunks(), chunk_done(), command(), data_pkt(), drain_status(), drv_ota_register(), drv_ota_send(), finish() (+11 more)
|
||||
|
||||
### Community 34 - "test_sequences.py"
|
||||
Cohesion: 0.19
|
||||
Nodes (19): clock(), make(), presets(), test_animation_over_sequence_keeps_time(), test_animation_plays_once_alone(), test_animation_step_fires_overlay(), test_beat_and_time_lanes_together(), test_chase_moves_and_bounces() (+11 more)
|
||||
|
||||
### Community 35 - "Binary Envelope (test)"
|
||||
Cohesion: 0.15
|
||||
Nodes (18): brightness_0_255_from_wire(), brightness_wire_from_0_255(), _clamp_i16(), _colors_to_rgb_list(), _decode_default_blob(), _decode_preset_record(), _decode_presets_blob(), _decode_select_blob() (+10 more)
|
||||
|
||||
### Community 36 - "API Docs: Outputs & Audio"
|
||||
Cohesion: 0.14
|
||||
Nodes (23): Art-Net output (UDP 6454), Audio API /api/audio and /audio page routes, Profile/preset/sequence JSON bundles (import/export), Combined brightness (global x groups x device x zone), /db collection export and replace, Devices resource /devices, Driver group membership lists (group ids, z<zone id>), Device groups resource /groups (+15 more)
|
||||
|
||||
### Community 38 - "startup.py"
|
||||
Cohesion: 0.11
|
||||
Nodes (10): presets_loop(), apply_startup_pattern(), print_mem(), snapshot(), initialize_runtime(), boot_sta(), connect_until_up(), _one_association_campaign() (+2 more)
|
||||
|
||||
### Community 39 - "Beat Detection DSP (C)"
|
||||
Cohesion: 0.27
|
||||
Nodes (16): beat_feed(), analyse_beat(), bar_cue(), bar_decide(), beat_dsp_feed(), beat_dsp_init(), beat_dsp_tap(), best_phase() (+8 more)
|
||||
|
||||
### Community 40 - "LedSimulatorApp"
|
||||
Cohesion: 0.12
|
||||
Nodes (4): lan_ip(), _hex(), LedSimulatorApp, main()
|
||||
|
||||
### Community 41 - "string"
|
||||
Cohesion: 0.14
|
||||
Nodes (8): start_webserver(), esp_vfs_littlefs_register(), mic_get_level(), mic_start(), mic_stream_open(), mic_stream_read(), ota_register(), ota_unsupported()
|
||||
|
||||
### Community 42 - "presets.py"
|
||||
Cohesion: 0.14
|
||||
Nodes (5): blend(), is_reversed(), led_i(), signed(), convert_and_reorder_colors()
|
||||
|
||||
### Community 43 - "Driver Test Runner"
|
||||
Cohesion: 0.18
|
||||
Nodes (17): _bootstrap_import_path(), _pattern_loaded(), _process_message(), run_all(), _smoke_preset(), test_colour_conversion_and_transition(), test_default_requires_existing_preset(), test_default_targets_gate_by_device_name() (+9 more)
|
||||
|
||||
### Community 45 - "Bridge WebSocket Blink Test"
|
||||
Cohesion: 0.16
|
||||
Nodes (9): build_blink_envelope(), _format_mac(), _load_bridge_url(), main(), _send(), print_settings(), _default_image(), _info() (+1 more)
|
||||
|
||||
### Community 46 - "BridgeSim"
|
||||
Cohesion: 0.14
|
||||
Nodes (5): BridgeSim, index(), mac_str(), _read_json(), Strip
|
||||
|
||||
### Community 47 - "USB Latency Tools"
|
||||
Cohesion: 0.16
|
||||
Nodes (10): analyze(), edges(), main(), pct(), read(), fit_clock(), main(), pct() (+2 more)
|
||||
|
||||
### Community 50 - "led_strip_spi_dev.c"
|
||||
Cohesion: 0.32
|
||||
Nodes (7): led_strip_new_spi_device(), __led_strip_spi_bit(), led_strip_spi_clear(), led_strip_spi_del(), led_strip_spi_refresh(), led_strip_spi_set_pixel(), led_strip_spi_set_pixel_rgbw()
|
||||
|
||||
### Community 52 - "Presets & Settings Mockups"
|
||||
Cohesion: 0.15
|
||||
Nodes (3): _convert_filesystem_error(), stdout_write_bytes(), Transport
|
||||
|
||||
### Community 53 - "mpremote Transport"
|
||||
Cohesion: 0.12
|
||||
Nodes (20): Presets Mockup Page, addColorPicker() / initializeColorPickers(), ColorPicker component (color-picker.js / color-picker.css), Preset Delay (animation speed, 10-1000 ms), ESPNow preset distribution, filterPresets() / sortPresets() search, filter and sort, LED Patterns (on, off, blink, chase, circle, pulse, rainbow, transition), Pattern Parameters N1-N8 (+12 more)
|
||||
|
||||
### Community 54 - "Outputs Config (C)"
|
||||
Cohesion: 0.20
|
||||
Nodes (17): defaults(), fail(), fill(), int_field(), num(), one_of(), put16(), resolve() (+9 more)
|
||||
|
||||
### Community 55 - "Microdot Handlers (dmx)"
|
||||
Cohesion: 0.14
|
||||
Nodes (4): iscoroutine(), Response, aclose(), __anext__()
|
||||
|
||||
### Community 57 - "led_strip_rmt_dev.c"
|
||||
Cohesion: 0.07
|
||||
Nodes (22): led_strip_rmt_config_t, led_model_t, led_pixel_format_t, led_strip_config_t, led_strip_t, led_strip_new_rmt_device(), led_strip_rmt_clear(), led_strip_rmt_del() (+14 more)
|
||||
|
||||
### Community 58 - "Microdot Handlers (led)"
|
||||
Cohesion: 0.15
|
||||
Nodes (4): iscoroutine(), Response, aclose(), __anext__()
|
||||
|
||||
### Community 60 - "mpremote Serial Transport"
|
||||
Cohesion: 0.20
|
||||
Nodes (3): SerialTransport, TransportError, TransportExecError
|
||||
|
||||
### Community 61 - "API Test Fixtures & Audio"
|
||||
Cohesion: 0.17
|
||||
Nodes (5): base_url(), c(), Client, profile(), restore_db()
|
||||
|
||||
### Community 62 - "Microdot Request (dmx)"
|
||||
Cohesion: 0.17
|
||||
Nodes (4): Request, G, urldecode_bytes(), urldecode_str()
|
||||
|
||||
### Community 63 - "Help: Zones & Palette"
|
||||
Cohesion: 0.13
|
||||
Nodes (18): Colour Palette (per profile), Zone default preset (default hint), DJ zone starter option, From Palette linked colours, LED driver JSON (presets, select, save, default, manifest), Patterns dialog, POST /presets/send, Preset editor (Try, Save, Send, Manual) (+10 more)
|
||||
|
||||
### Community 64 - "api/helpers.py"
|
||||
Cohesion: 0.12
|
||||
Nodes (8): find_id_by_field(), missing(), test_preset_round_trip(), test_profile_round_trip(), test_sequence_round_trip(), test_scenes(), test_crud(), test_crud()
|
||||
|
||||
### Community 65 - "engine_init"
|
||||
Cohesion: 0.40
|
||||
Nodes (3): engine_init(), rel_set_announce_cb(), rel_set_resync_cb()
|
||||
|
||||
### Community 66 - "rig.py"
|
||||
Cohesion: 0.06
|
||||
Nodes (20): colors_of(), ease(), gradient(), mix(), scale(), FieldWave, Grow, Hit (+12 more)
|
||||
|
||||
### Community 67 - "audio_api.c"
|
||||
Cohesion: 0.14
|
||||
Nodes (30): audio_api_register(), audio_handler(), audio_run(), events(), ok_with_status(), send_json(), setting_int(), status_payload() (+22 more)
|
||||
|
||||
### Community 68 - "API Tests: Zones"
|
||||
Cohesion: 0.06
|
||||
Nodes (19): new_id(), unique(), preset(), test_create_belongs_to_current_profile(), test_create_fills_defaults(), test_presets_scoped_to_profile(), test_clone(), test_delete() (+11 more)
|
||||
|
||||
### Community 69 - "pytest"
|
||||
Cohesion: 0.13
|
||||
Nodes (7): lit(), test_geometry_unplaced_and_star_arm(), test_grow_from_centre_then_holds(), test_ripple_moves_out_along_an_arm(), test_spin_lights_one_arm_at_a_time(), test_sweep_crosses_grid_left_to_right(), output()
|
||||
|
||||
### Community 70 - "Index Page Modals"
|
||||
Cohesion: 0.11
|
||||
Nodes (19): Audio Beat Detection modal, Header BPM / beat sync indicator, Colour Palette modal, Devices modal, Edit device modal, Edit Zone modal, Device groups modal, Header global brightness slider (+11 more)
|
||||
|
||||
### Community 76 - "Controller Overview & OTA Docs"
|
||||
Cohesion: 0.17
|
||||
Nodes (16): led_controller ESP-IDF project, POST /patterns/upload (led-driver parity), Driver app update /drivers/ota (staged files, sha, commit/abort), Firmware OTA /ota (idle slot, rollback), Patterns resource /patterns, Driver app update over ESP-NOW test (tools/driver_ota.py), led-simulator, led-tool / led-cli serial device CLI (+8 more)
|
||||
|
||||
### Community 77 - "bridge_sim.py"
|
||||
Cohesion: 0.13
|
||||
Nodes (11): driver_mac(), load_config(), main(), _merge(), sync_patterns(), normalise_layout(), _reversed_for_column(), side_name() (+3 more)
|
||||
|
||||
### Community 78 - "Driver Hello Discovery"
|
||||
Cohesion: 0.13
|
||||
Nodes (10): broadcast_hello_udp(), discover_controller_udp(), ipv4_broadcast(), pack_hello_bytes(), pack_hello_dict(), pack_hello_line(), udp_discovery_targets(), _udp_discovery_targets_single() (+2 more)
|
||||
|
||||
### Community 79 - "Audio Monitor Page"
|
||||
Cohesion: 0.16
|
||||
Nodes (16): /audio.wav live PCM stream, bar() bar-position renderer, /beats SSE event stream, draw() timeline canvas, Listen button (WAV stream playback via AudioContext), median(), Audio and beats page (/audio), stats() tap vs computer agreement (+8 more)
|
||||
|
||||
### Community 80 - "Art-Net DMX Tests"
|
||||
Cohesion: 0.23
|
||||
Nodes (9): parse(), _assert_eq(), main(), test_artnet_send_loopback(), test_build_artdmx(), test_fixture_patch(), test_pattern_blink_and_select(), test_pattern_upload() (+1 more)
|
||||
|
||||
### Community 82 - "machine"
|
||||
Cohesion: 0.09
|
||||
Nodes (15): apply_cpu_freq(), default_led_pin(), mcu(), _drain(), main(), _mac_hex(), run_diag(), recv_loop() (+7 more)
|
||||
|
||||
### Community 84 - "test_groups.py"
|
||||
Cohesion: 0.13
|
||||
Nodes (4): device(), group(), test_group_identify_needs_devices(), test_profile_scoped_group()
|
||||
|
||||
### Community 85 - "ESP-NOW Sender Bridge"
|
||||
Cohesion: 0.24
|
||||
Nodes (9): _broadcast_ws(), _espnow_receive_loop(), _init_espnow(), main(), _send_espnow(), _validate_envelope(), ws(), format_mac() (+1 more)
|
||||
|
||||
### Community 86 - "stdlib"
|
||||
Cohesion: 0.15
|
||||
Nodes (13): bench_start(), fail(), ota_confirm_later(), ota_get_handler(), ota_post_handler(), reboot_post_handler(), arm(), esp_timer_create() (+5 more)
|
||||
|
||||
### Community 92 - "Bench Test Plan"
|
||||
Cohesion: 0.23
|
||||
Nodes (9): Bench endpoints /test/loss and /test/beats, 30 ms beat lead (CONFIG_BEAT_LEAD_MS), Bench test: S3 controller and one LED driver, ESP32-C3 vs S3 driver comparison, Logic analyzer latency (marker GPIO, tools/analyze_edges.py), Lossy-link test (simulated loss, retries, resync), Reliable link (rel: acked unicast, retransmits, ack timeouts), Bench troubleshooting (serial ports, channel mismatch, blank UI) (+1 more)
|
||||
|
||||
### Community 94 - "Flame Pattern"
|
||||
Cohesion: 0.26
|
||||
Nodes (6): _clamp(), Flame, _lerp_chan(), _lerp_rgb(), _palette_sample(), _triangle_255()
|
||||
|
||||
### Community 95 - "Microdot Auth (dmx)"
|
||||
Cohesion: 0.22
|
||||
Nodes (3): websocket_upgrade(), websocket_wrapper(), with_websocket()
|
||||
|
||||
### Community 96 - "Serial DMX & WiFi"
|
||||
Cohesion: 0.16
|
||||
Nodes (4): sleep_ms(), SerialDMX, sleep(), ap()
|
||||
|
||||
### Community 97 - "DMX Pattern Player"
|
||||
Cohesion: 0.17
|
||||
Nodes (3): main(), output_tick(), PatternPlayer
|
||||
|
||||
### Community 99 - "Twinkle Pattern"
|
||||
Cohesion: 0.23
|
||||
Nodes (6): Twinkle, cluster_base_index(), cluster_len_bounds(), dark_adjacent(), light_adjacent(), random_cluster_len()
|
||||
|
||||
### Community 101 - "Groups UI (JS)"
|
||||
Cohesion: 0.29
|
||||
Nodes (9): fetchDevicesMapForGroups(), fetchGroupsMap(), identifyGroupById(), loadGroupsModal(), loadWifiFieldsFromGroup(), openEditGroupModal(), renderGroupDevicesEditor(), renderGroupsList() (+1 more)
|
||||
|
||||
### Community 102 - "Microdot Auth (led)"
|
||||
Cohesion: 0.22
|
||||
Nodes (3): websocket_upgrade(), websocket_wrapper(), with_websocket()
|
||||
|
||||
### Community 103 - "Help: Mobile Menu Image"
|
||||
Cohesion: 0.24
|
||||
Nodes (10): Mobile Menu Help Illustration (narrow screen), Content Area (preset buttons), Menu Dropdown (Run mode, Profiles, Tabs, Presets, Help), Header Tab Buttons, Help, Menu Button (header dropdown trigger), Presets, Profiles (+2 more)
|
||||
|
||||
### Community 104 - "Pattern Selector Mockup Image"
|
||||
Cohesion: 0.20
|
||||
Nodes (11): Pattern Selector Mockup (Select LED Pattern), Apply Pattern / Cancel Actions, Blink Pattern, Chase Pattern, Circle Pattern, Off Pattern, On Pattern (solid color), Pattern Card Grid Layout (+3 more)
|
||||
|
||||
### Community 105 - "Driver Pattern Docs"
|
||||
Cohesion: 0.24
|
||||
Nodes (11): Message processing order (version, presets upsert, colour, selection), Auto vs manual (a) and manual chase flush, Built-in off / on patterns, Patterns and presets on the LED driver, MAX_PRESETS = 32, Pattern OTA via manifest / POST /patterns/upload, Pattern registry (Presets.reload_patterns), Preset short keys (p, c, d, b, a, bg, n1-n6) (+3 more)
|
||||
|
||||
### Community 107 - "rig_seed.py"
|
||||
Cohesion: 0.27
|
||||
Nodes (6): rig_placements(), controller_url(), _get(), _post(), seed(), seed_soon()
|
||||
|
||||
### Community 109 - "Driver Message API Docs"
|
||||
Cohesion: 0.38
|
||||
Nodes (10): Auto vs manual mode, Beat (re-select same preset restarts generator), Hex colour conversion and colour-order reordering, LED Driver API (message format), Pattern-specific parameters (rainbow, pulse, transition, chase, circle), Preset fields (pattern, colors, delay, brightness, auto, n1-n6), Select message (device -> [preset, step]), Step synchronization (+2 more)
|
||||
|
||||
### Community 110 - "Driver Binary Envelope"
|
||||
Cohesion: 0.20
|
||||
Nodes (11): _brightness_0_255_from_wire(), _decode_default_blob(), _decode_preset_ext(), _decode_preset_record(), _decode_presets_blob(), _decode_select_blob(), parse_binary_envelope(), parse_binary_envelope_v1() (+3 more)
|
||||
|
||||
### Community 111 - "led_strip Manifest"
|
||||
Cohesion: 0.20
|
||||
Nodes (9): dependencies, idf, description, repository, repository_info, commit_sha, path, url (+1 more)
|
||||
|
||||
### Community 113 - "Outputs UI (JS)"
|
||||
Cohesion: 0.33
|
||||
Nodes (8): fetchOutputs(), loadOutputsModal(), openOutputEditor(), OUTPUT_PROTOCOL_LABELS, outputSummary(), renderOutputsList(), setOutputField(), syncOutputProtocolFields()
|
||||
|
||||
### Community 114 - "DMX Driver Docs"
|
||||
Cohesion: 0.25
|
||||
Nodes (9): Controller WebSocket /ws (v1 presets/select), DMX Driver Art-Net and serial gateway, DMX fixture (output, start channel, role map; parcan/mover profiles), led-driver-style pattern engine (Preset object), Serial DMX512 output (250000 8N2), Binary envelope (main/envelope.c, test/binary_envelope.py), v1 driver messages (long/short keys), WebSocket /ws driver message relay (+1 more)
|
||||
|
||||
### Community 115 - "Help PDF: Overview"
|
||||
Cohesion: 0.25
|
||||
Nodes (9): API.md, LED controller user guide, Main web UI (Raspberry Pi app), Pattern OTA install over HTTP (/patterns/ota, upload, driver, send), Pattern parameters n1-n8, README, Serial to ESP-NOW bridge transport, WebSocket /ws (+1 more)
|
||||
|
||||
### Community 116 - "Mockups Index Image"
|
||||
Cohesion: 0.31
|
||||
Nodes (9): LED Driver UI Mockups Index (screenshot), Dashboard Mockup, Device Groups, Device Management Mockup, LED Patterns (On, Off, Blink, Chase, Circle, Pulse, Rainbow, Transition), N1-N8 Pattern Parameters, Pattern Selector Mockup, Presets Mockup (+1 more)
|
||||
|
||||
### Community 117 - "engine.c"
|
||||
Cohesion: 0.14
|
||||
Nodes (37): build_groups(), compact(), compact_preset(), device_name_for(), driver_in_zone(), emit_c(), emit_json(), emit_zone() (+29 more)
|
||||
|
||||
### Community 118 - "Help: Header Toolbar Image"
|
||||
Cohesion: 0.29
|
||||
Nodes (8): Header Toolbar Help Image, Edit Mode Action Bar, Run/Edit Mode Toggle Button, Patterns Action, Presets Action, Profiles Action, Header Tab Buttons, Tabs Action
|
||||
|
||||
### Community 119 - "Help: Preset Editor Image"
|
||||
Cohesion: 0.29
|
||||
Nodes (5): Default Action, Preset Pattern Selector, Preset Editor Modal (help illustration), Preset Name Field, Brightness, Delay and n1-n8 Parameters (0-255)
|
||||
|
||||
### Community 120 - "Dashboard Mockup Image"
|
||||
Cohesion: 0.32
|
||||
Nodes (8): LED Driver Control Panel Dashboard Mockup, Apply Settings Action, Brightness & Speed Card (Brightness % and Delay ms sliders), Colors Card (color swatches palette, Add Color), Connected Devices Card (devices with group and online status), Device Groups, Pattern Selection Card (On, Off, Blink, Chase, Circle, Pulse, Rainbow, Transition), Save to Device Action
|
||||
|
||||
### Community 121 - "Device Management Mockup Image"
|
||||
Cohesion: 0.32
|
||||
Nodes (8): + Add Device Button, Connected Devices List, Device Group, Device & Group Management Screen (mockup), Device Row Actions (edit, settings, stop), Online/Offline Status Badge, Devices / Groups Tab Switcher, LED Device (MAC, group, pattern)
|
||||
|
||||
### Community 122 - "Presets Mockup Image"
|
||||
Cohesion: 0.32
|
||||
Nodes (8): Preset Management UI Mockup, Apply Preset Action, Create Preset Action, LED Pattern Types (Rainbow, Pulse, Chase, Circle, Blink, Transition), Preset Card (name, pattern badge, color swatches, delay, n1, apply/edit/delete), Preset Search/Filter/Sort Toolbar (pattern filter, sort by name, grid/list toggle), Preset Parameters (colors, delay ms, n1), Sync Presets to All Devices
|
||||
|
||||
### Community 123 - "Pattern Contract"
|
||||
Cohesion: 0.29
|
||||
Nodes (6): Pattern Contract, Drawing via driver.n and apply_brightness, Pattern error handling (Presets.tick catches), Presets._load_dynamic_patterns(), Shared driver.step semantics, Global vs per-preset brightness
|
||||
|
||||
### Community 125 - "driver_ota.py"
|
||||
Cohesion: 0.23
|
||||
Nodes (6): file_set(), walk(), main(), norm_mac(), push(), wait_back()
|
||||
|
||||
### Community 126 - "time"
|
||||
Cohesion: 0.13
|
||||
Nodes (10): Blink, Pulse, main(), sleep(), sleep_ms(), sleep_us(), ticks_diff(), ticks_ms() (+2 more)
|
||||
|
||||
### Community 128 - "Rig"
|
||||
Cohesion: 0.11
|
||||
Nodes (9): bridge_downlink(), driver_mac(), lan_ip(), load_config(), mac_str(), main(), _merge(), _read_json() (+1 more)
|
||||
|
||||
### Community 129 - "Colour Picker Demo Image"
|
||||
Cohesion: 0.33
|
||||
Nodes (6): Custom Color Picker Demo (screenshot), Hex and RGB input support, HSB (Hue, Saturation, Brightness) color model, Keyboard accessible, customizable styling, Multiple Color Pickers for LED Patterns, Single Color Picker
|
||||
|
||||
### Community 130 - "Settings Mockup Image"
|
||||
Cohesion: 0.33
|
||||
Nodes (7): Advanced Settings (Step Counter, Step Increment, Device ID, Debug Mode), Basic Settings (Device Name, LED Pin, Number of LEDs), Color Order Selector (RGB/RBG/GRB/GBR/BRG/BGR), Device Settings Page Mockup, Network Settings (Access Point Name, Password, Enable AP), Pattern Parameters N1-N6, Pattern Settings (Pattern, Brightness, Delay)
|
||||
|
||||
### Community 131 - "sim_demo.py"
|
||||
Cohesion: 0.26
|
||||
Nodes (7): Api, main(), group(), preset(), sequence(), new_id(), rig_bars()
|
||||
|
||||
### Community 133 - "beat_get_info"
|
||||
Cohesion: 0.31
|
||||
Nodes (7): events_task(), send_all(), send_event(), beats_stream_task(), beat_get_info(), beat_subscribe(), beat_unsubscribe()
|
||||
|
||||
### Community 135 - "store_coll"
|
||||
Cohesion: 0.25
|
||||
Nodes (27): engine_groups_changed(), api_preset_defaults(), clone_profile(), clone_zone(), content_fragment(), create_profile(), create_zone(), current_profile_rec() (+19 more)
|
||||
|
||||
### Community 136 - "web.py"
|
||||
Cohesion: 0.32
|
||||
Nodes (3): handle_action(), index(), parse_settings_from_form()
|
||||
|
||||
### Community 138 - "Help: Colour Palette Image"
|
||||
Cohesion: 0.40
|
||||
Nodes (6): Colour Palette modal mockup (help image), Add Swatch (+) Button, Colour Palette Modal, Palette Colour Swatches, Preset Editor 'From Palette', Profile (palette owner)
|
||||
|
||||
### Community 140 - "LED Driver README"
|
||||
Cohesion: 0.47
|
||||
Nodes (6): dev.py deploy/sync script, LED Driver README (MicroPython ESP32), Optional HTTP polling (http_poll.py), Wi-Fi TCP transport to Pi (port 8765), transport_type setting (wifi / espnow), UDP discovery (port 8766)
|
||||
|
||||
### Community 142 - "SPI Example Manifest"
|
||||
Cohesion: 0.33
|
||||
Nodes (5): dependencies, espressif/led_strip, idf, override_path, version
|
||||
|
||||
### Community 143 - "test_rig_sim.py"
|
||||
Cohesion: 0.08
|
||||
Nodes (29): test_events_stream(), all_dark(), col_of(), frames(), led_x(), lit(), mac(), make_preset() (+21 more)
|
||||
|
||||
### Community 144 - "settings_editor.js"
|
||||
Cohesion: 0.27
|
||||
Nodes (7): loadEspnowDevices(), otaDriver(), otaFile(), otaRequest(), otaWaitBack(), showEspnowDevice(), showOtaTargets()
|
||||
|
||||
### Community 145 - "Help PDF: Modes"
|
||||
Cohesion: 0.40
|
||||
Nodes (4): Edit mode, Mobile layout Menu, Run mode, Zones modal
|
||||
|
||||
### Community 146 - "Help: Tab Preset Strip Image"
|
||||
Cohesion: 0.60
|
||||
Nodes (5): Help image: Main area brightness and preset tiles, Edit Mode: drag tiles to reorder, Global Brightness Slider, Preset Tile (gradient swatch, click to select on tab devices), Tab (e.g. lounge)
|
||||
|
||||
### Community 149 - "res_device.c"
|
||||
Cohesion: 0.18
|
||||
Nodes (30): api_effective_brightness(), api_identify_group(), clamp255(), create_device(), device_brightness(), device_config_from(), device_driver_config(), device_status() (+22 more)
|
||||
|
||||
### Community 150 - "api_error"
|
||||
Cohesion: 0.22
|
||||
Nodes (23): api_body(), api_body_opt(), api_current_profile(), api_error(), api_json(), api_message(), api_preset_in_profile(), api_result() (+15 more)
|
||||
|
||||
### Community 155 - "app.js"
|
||||
Cohesion: 0.16
|
||||
Nodes (35): addLog(), banner(), colourAt(), connectBridge(), deliver(), drawLabel(), drawPlaced(), drawStrip() (+27 more)
|
||||
|
||||
### Community 156 - "RMT Example Manifest"
|
||||
Cohesion: 0.40
|
||||
Nodes (4): dependencies, espressif/led_strip, override_path, version
|
||||
|
||||
### Community 157 - "Help Tab JS"
|
||||
Cohesion: 0.36
|
||||
Nodes (5): addStaticIpRow(), loadDeviceSettings(), loadNetworkStatus(), setApToggle(), switchSettingsTab()
|
||||
|
||||
### Community 158 - "Settings Page Template"
|
||||
Cohesion: 0.50
|
||||
Nodes (4): Settings modal (device, network), loadEspnowChannel(), Device Settings page (ESP-NOW channel), wifi_channel setting (1-11)
|
||||
|
||||
### Community 159 - "led-driver/lib/microdot/microdot.py"
|
||||
Cohesion: 0.18
|
||||
Nodes (5): invoke_handler(), mro(), _mro(), urldecode_bytes(), urldecode_str()
|
||||
|
||||
### Community 160 - "random"
|
||||
Cohesion: 0.12
|
||||
Nodes (3): Blizzard, CandleGlow, RainDrops
|
||||
|
||||
### Community 161 - "host/conftest.py"
|
||||
Cohesion: 0.08
|
||||
Nodes (4): Clock, driver(), NeoPixel, pixel()
|
||||
|
||||
### Community 162 - "beat.c"
|
||||
Cohesion: 0.09
|
||||
Nodes (19): beat_set_callback(), beat_start(), beat_dsp_bpm(), dsp_event(), led_off_cb(), led_set(), publish(), bench_on_beat_tx() (+11 more)
|
||||
|
||||
### Community 163 - "status_get_handler"
|
||||
Cohesion: 0.14
|
||||
Nodes (9): bridge_addr(), espnow_tx_ap_clients(), espnow_tx_stats(), reset_reason(), status_get_handler(), w5500_init(), rel_stats(), rel_ver() (+1 more)
|
||||
|
||||
### Community 164 - "store.c"
|
||||
Cohesion: 0.24
|
||||
Nodes (8): db_root(), index_of(), load_file(), mount(), store_init(), store_known(), store_next_id(), store_replace()
|
||||
|
||||
### Community 166 - "sequences_route"
|
||||
Cohesion: 0.29
|
||||
Nodes (10): api_migrate_sequences(), api_sequence_defaults(), apply_update(), colors_from(), has_steps(), in_profile(), migrate_seq(), palette_colors() (+2 more)
|
||||
|
||||
### Community 167 - "api_id"
|
||||
Cohesion: 0.16
|
||||
Nodes (34): api_add(), api_id(), api_merge(), api_register(), api_set(), api_settings_defaults(), outputs_route(), add_ref() (+26 more)
|
||||
|
||||
### Community 168 - "ws.c"
|
||||
Cohesion: 0.21
|
||||
Nodes (9): eth_event_handler(), got_ip_event_handler(), start_webserver(), ota_register(), forward(), on_open(), send_text(), ws_handler() (+1 more)
|
||||
|
||||
### Community 170 - "dependencies"
|
||||
Cohesion: 0.25
|
||||
Nodes (8): dependencies, espressif/mdns, joltwallet/littlefs, rules, version, rules, version, if
|
||||
|
||||
### Community 171 - "List Search (JS)"
|
||||
Cohesion: 0.83
|
||||
Nodes (3): applyListSearch(), initListSearch(), rowSearchText()
|
||||
|
||||
### Community 198 - "envelope.c"
|
||||
Cohesion: 0.29
|
||||
Nodes (15): resync_driver(), clamp(), color_rgb(), env_add_preset(), env_add_select(), env_blob_init(), env_frame(), get2() (+7 more)
|
||||
|
||||
### Community 199 - "res_group.c"
|
||||
Cohesion: 0.31
|
||||
Nodes (15): add_error(), api_driver_config(), api_mac(), api_migrate_groups(), brightness(), driver_config(), find(), groups_route() (+7 more)
|
||||
|
||||
### Community 201 - "_simlink_web.py"
|
||||
Cohesion: 0.19
|
||||
Nodes (10): _check_flash(), on_feed(), push_pixels(), real_sleep(), recv(), recv_nowait(), _run_jobs(), _send_pixels() (+2 more)
|
||||
|
||||
### Community 202 - "web.c"
|
||||
Cohesion: 0.26
|
||||
Nodes (12): audio_page_handler(), etag(), favicon_handler(), find_file(), index_handler(), mime_for(), send_gz(), static_handler() (+4 more)
|
||||
|
||||
### Community 204 - "_simlink_proc.py"
|
||||
Cohesion: 0.15
|
||||
Nodes (5): connect(), on_feed(), push_pixels(), _reader(), _send_pixels()
|
||||
|
||||
### Community 205 - "device_groups.py"
|
||||
Cohesion: 0.33
|
||||
Nodes (3): groups_replace(), in_group(), list_groups()
|
||||
|
||||
### Community 206 - "build_app"
|
||||
Cohesion: 0.22
|
||||
Nodes (5): build_app(), api_seed_layout(), index(), static(), web()
|
||||
|
||||
### Community 213 - "tests/patterns/blink.py"
|
||||
Cohesion: 0.33
|
||||
Nodes (3): _bootstrap_import_path(), main(), _run_ms()
|
||||
|
||||
### Community 217 - "dmx-driver/lib/microdot/microdot.py"
|
||||
Cohesion: 0.12
|
||||
Nodes (3): invoke_handler(), mro(), _mro()
|
||||
|
||||
## Knowledge Gaps
|
||||
- **97 isolated node(s):** `Design Guidelines`, `Device Management UI`, `Engine CLI`, `Output Drivers (DDP, Art-Net, sACN, USB-DMX)`, `Pixel Generator` (+92 more)
|
||||
These have ≤1 connection - possible missing edges or undocumented components. (Counts symbols only; 1286 node(s) total have ≤1 connection when file, concept and rationale nodes are included.)
|
||||
- **96 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
|
||||
|
||||
## Suggested Questions
|
||||
_Questions this graph is uniquely positioned to answer:_
|
||||
|
||||
- **Why does `PyboardCommand` connect `mpremote Commands` to `Presets & Settings Mockups`, `mpremote Serial Transport`?**
|
||||
_High betweenness centrality (0.019) - this node is a cross-community bridge._
|
||||
- **Are the 43 inferred relationships involving `Presets` (e.g. with `Pin` and `test_save_and_load_roundtrip()`) actually correct?**
|
||||
_`Presets` has 43 INFERRED edges - model-reasoned connections that need verification._
|
||||
- **What connects `Design Guidelines`, `Device Management UI`, `Engine CLI` to the rest of the system?**
|
||||
_97 weakly-connected nodes found - possible documentation gaps or missing edges._
|
||||
- **Should `os` be split into smaller, more focused modules?**
|
||||
_Cohesion score 0.1422924901185771 - nodes in this community are weakly interconnected._
|
||||
- **Why does `Microdot` connect `Microdot` to `Microdot Async IO (led)`, `HTTPException (led)`, `Microdot Routing (led)`, `led-driver/lib/microdot/microdot.py`?**
|
||||
_High betweenness centrality (0.017) - this node is a cross-community bridge._
|
||||
- **Are the 65 inferred relationships involving `store_coll()` (e.g. with `api_add()` and `api_current_profile()`) actually correct?**
|
||||
_`store_coll()` has 65 INFERRED edges - model-reasoned connections that need verification._
|
||||
- **Should `htmx Library` be split into smaller, more focused modules?**
|
||||
_Cohesion score 0.07897684839432412 - nodes in this community are weakly interconnected._
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"runs": [
|
||||
{
|
||||
"date": "2026-11-03T12:13:15.159050+00:00",
|
||||
"input_tokens": 1267015,
|
||||
"output_tokens": 0,
|
||||
"files": 332
|
||||
}
|
||||
],
|
||||
"total_input_tokens": 1267015,
|
||||
"total_output_tokens": 0
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"directed":false,"multigraph":false,"graph":{"hyperedges":[{"id":"audio_page_endpoints","label":"Audio page live endpoints","nodes":["web_audio_status","web_audio_beats","web_audio_audio_wav","web_audio_time","web_audio_tap_ep"],"relation":"participate_in","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"web/audio.html"},{"id":"beat_latency_measurement","label":"Beat latency measurement methods","nodes":["docs_api_bench_endpoints","docs_bench_test_usb_latency","docs_bench_test_logic_analyzer","docs_bench_test_beat_lead"],"relation":"participate_in","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/BENCH_TEST.md"},{"id":"brightness_combination","label":"Combined brightness factors","nodes":["docs_api_combined_brightness","docs_api_settings","docs_api_groups","docs_api_devices","docs_api_zones"],"relation":"participate_in","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/API.md"},{"id":"color_picker_feature_set","label":"Color picker feature set","nodes":["docs_mockups_images_color_picker_demo_hsb_color_model","docs_mockups_images_color_picker_demo_hex_rgb_input","docs_mockups_images_color_picker_demo_keyboard_accessibility","docs_mockups_images_color_picker_demo_cross_platform_consistency"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/images/color-picker-demo.png"},{"id":"docs_help_edit_mode_management","label":"Edit-mode-only management features","nodes":["docs_help_edit_mode","docs_help_zones_modal","docs_help_send_presets","docs_help_patterns_dialog","docs_help_colour_palette","docs_help_presets_list"],"relation":"participate_in","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/help.pdf"},{"id":"docs_help_preset_editor_actions","label":"Preset editor actions (Try, Default, Save & Send, Remove from zone)","nodes":["docs_help_try_action","docs_help_default_preset","docs_help_save_and_send","docs_help_remove_from_zone"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/help.pdf"},{"id":"docs_images_help_mobile_menu_header_actions","label":"Header actions aggregated in mobile Menu","nodes":["docs_images_help_mobile_menu_run_mode","docs_images_help_mobile_menu_profiles","docs_images_help_mobile_menu_tabs","docs_images_help_mobile_menu_presets","docs_images_help_mobile_menu_help"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/images/help/mobile-menu.svg"},{"id":"docs_mockups_device_modal_flow","label":"Device/Group Modal Flow","nodes":["docs_mockups_device_management_showadddevicemodal","docs_mockups_device_management_showaddgroupmodal","docs_mockups_device_management_closemodal","docs_mockups_device_management_savedevice"],"relation":"participate_in","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/device-management.html"},{"id":"docs_mockups_images_index_ui_mockup_set","label":"LED Driver UI Mockup Set","nodes":["docs_mockups_images_index_dashboard_mockup","docs_mockups_images_index_pattern_selector_mockup","docs_mockups_images_index_device_management_mockup","docs_mockups_images_index_settings_mockup","docs_mockups_images_index_presets_mockup"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/images/index.png"},{"id":"docs_mockups_images_pattern_selector_led_patterns","label":"Selectable LED Patterns","nodes":["docs_mockups_images_pattern_selector_on","docs_mockups_images_pattern_selector_off","docs_mockups_images_pattern_selector_blink","docs_mockups_images_pattern_selector_chase","docs_mockups_images_pattern_selector_circle","docs_mockups_images_pattern_selector_pulse","docs_mockups_images_pattern_selector_rainbow","docs_mockups_images_pattern_selector_transition"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/images/pattern-selector.png"},{"id":"docs_mockups_preset_schema","label":"Preset/pattern configuration schema (pattern, colors, delay, step increment, N1-N8)","nodes":["docs_mockups_presets_led_patterns","docs_mockups_presets_delay","docs_mockups_presets_step_increment","docs_mockups_presets_n_parameters","docs_mockups_presets_step_offset"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/presets.html"},{"id":"docs_mockups_settings_sections","label":"Device settings sections","nodes":["docs_mockups_settings_basic_settings","docs_mockups_settings_pattern_settings","docs_mockups_settings_advanced_settings","docs_mockups_settings_network_settings"],"relation":"form","confidence":"EXTRACTED","confidence_score":1.0,"source_file":"docs/mockups/settings.html"},{"id":"docs_mockups_ui_mockup_suite","label":"LED Driver UI Mockup Suite","nodes":["docs_mockups_index","docs_mockups_dashboard","docs_mockups_pattern_selector","docs_mockups_device_management","docs_mockups_readme_settings_mockup","docs_mockups_color_picker_readme_presets_mockup"],"relation":"foLine truncated
|
||||
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"1": "htmx Library",
|
||||
"3": "Browser Tests & Mockup Images",
|
||||
"4": "Audio UI (JS)",
|
||||
"5": "ESP-NOW TX & DMX Pulse",
|
||||
"7": "led-tool Device CLI",
|
||||
"10": "Spec: Pi Animation Engine",
|
||||
"12": "Presets UI (JS)",
|
||||
"13": "Zones UI (JS)",
|
||||
"16": "Sequences UI (JS)",
|
||||
"19": "led_strip Component Docs",
|
||||
"20": "Art-Net Output",
|
||||
"28": "Devices UI (JS)",
|
||||
"30": "Colour Picker Mockups",
|
||||
"36": "API Docs: Outputs & Audio",
|
||||
"39": "Beat Detection DSP (C)",
|
||||
"47": "USB Latency Tools",
|
||||
"48": "Colour Picker JS",
|
||||
"49": "Chromium Colour Picker JS",
|
||||
"51": "API Tests: Devices",
|
||||
"53": "mpremote Transport",
|
||||
"54": "Outputs Config (C)",
|
||||
"60": "mpremote Serial Transport",
|
||||
"61": "API Test Fixtures & Audio",
|
||||
"62": "Microdot Request (dmx)",
|
||||
"63": "Help: Zones & Palette",
|
||||
"70": "Index Page Modals",
|
||||
"73": "Microdot WebSocket (dmx)",
|
||||
"76": "Controller Overview & OTA Docs",
|
||||
"79": "Audio Monitor Page",
|
||||
"80": "Art-Net DMX Tests",
|
||||
"81": "DMX Output Manager",
|
||||
"85": "ESP-NOW Sender Bridge",
|
||||
"87": "Microdot Async IO (dmx)",
|
||||
"88": "DMX Settings",
|
||||
"91": "Microdot Routing (dmx)",
|
||||
"92": "Bench Test Plan",
|
||||
"95": "Microdot Auth (dmx)",
|
||||
"96": "Serial DMX & WiFi",
|
||||
"97": "DMX Pattern Player",
|
||||
"98": "DMX Preset Model",
|
||||
"101": "Groups UI (JS)",
|
||||
"103": "Help: Mobile Menu Image",
|
||||
"104": "Pattern Selector Mockup Image",
|
||||
"105": "Driver Pattern Docs",
|
||||
"109": "Driver Message API Docs",
|
||||
"111": "led_strip Manifest",
|
||||
"113": "Outputs UI (JS)",
|
||||
"114": "DMX Driver Docs",
|
||||
"115": "Help PDF: Overview",
|
||||
"116": "Mockups Index Image",
|
||||
"118": "Help: Header Toolbar Image",
|
||||
"119": "Help: Preset Editor Image",
|
||||
"120": "Dashboard Mockup Image",
|
||||
"121": "Device Management Mockup Image",
|
||||
"122": "Presets Mockup Image",
|
||||
"123": "Pattern Contract",
|
||||
"127": "Numpad Shortcuts (JS)",
|
||||
"129": "Colour Picker Demo Image",
|
||||
"130": "Settings Mockup Image",
|
||||
"134": "API Tests: Settings",
|
||||
"138": "Help: Colour Palette Image",
|
||||
"140": "LED Driver README",
|
||||
"142": "SPI Example Manifest",
|
||||
"145": "Help PDF: Modes",
|
||||
"146": "Help: Tab Preset Strip Image",
|
||||
"156": "RMT Example Manifest",
|
||||
"157": "Help Tab JS",
|
||||
"158": "Settings Page Template",
|
||||
"171": "List Search (JS)",
|
||||
"172": "DMX Solid Pattern",
|
||||
"173": "led-test Manifest",
|
||||
"174": "VPN Autoconnect Script",
|
||||
"175": "Zone Devices Panel",
|
||||
"176": "graphify Instructions",
|
||||
"180": "Device Mockup Modals",
|
||||
"181": "bulk.sh Script",
|
||||
"182": "deploy.sh Script",
|
||||
"183": "Driver install.sh",
|
||||
"185": "led-tool install.sh",
|
||||
"186": "Help PDF Build Script",
|
||||
"187": "Web Build Script",
|
||||
"188": "Patterns UI (JS)",
|
||||
"189": "DMX Patterns Init",
|
||||
"190": "Mockup Tab Switch",
|
||||
"191": "Spec: Pattern Selector UI",
|
||||
"192": "mpremote Package",
|
||||
"193": "Bundle Import/Export (JS)",
|
||||
"194": "Colour Palette (JS)",
|
||||
"195": "Profiles UI (JS)",
|
||||
"196": "Zone Palette (JS)"
|
||||
}
|
||||
@@ -0,0 +1,714 @@
|
||||
# Graph Report - led-controller (2026-11-11)
|
||||
|
||||
## Corpus Check
|
||||
- 262 files · ~235,047 words
|
||||
- Verdict: corpus is large enough that graph structure adds value.
|
||||
- Unclassified: 52 file(s) not represented in the graph (top: (none) 26, .mdc 6, .css 6)
|
||||
|
||||
## Summary
|
||||
- 3471 nodes · 8560 edges · 172 communities (116 shown, 56 thin omitted)
|
||||
- Extraction: 84% EXTRACTED · 16% INFERRED · 0% AMBIGUOUS · INFERRED: 1339 edges (avg confidence: 0.85)
|
||||
- Token cost: 0 input · 0 output
|
||||
|
||||
## Graph Freshness
|
||||
- Built from commit: `50ca46fe`
|
||||
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
|
||||
- Run `graphify update .` after code changes (no API cost).
|
||||
|
||||
## Community Hubs (Navigation)
|
||||
- IdfDevice
|
||||
- htmx Library
|
||||
- machine.py
|
||||
- Browser Tests & Mockup Images
|
||||
- Audio UI (JS)
|
||||
- ESP-NOW TX & DMX Pulse
|
||||
- audio.c
|
||||
- led-tool Device CLI
|
||||
- ab
|
||||
- Compiler
|
||||
- Spec: Pi Animation Engine
|
||||
- esp_timer
|
||||
- Presets UI (JS)
|
||||
- Zones UI (JS)
|
||||
- patterns.c
|
||||
- new_id
|
||||
- Sequences UI (JS)
|
||||
- bridge_sim.py
|
||||
- main/main.c
|
||||
- led_strip Component Docs
|
||||
- Art-Net Output
|
||||
- main/main.c
|
||||
- esp_log
|
||||
- http_app.py
|
||||
- ws.c
|
||||
- Microdot
|
||||
- led_strip_rmt_dev.c
|
||||
- seqplay.c
|
||||
- Devices UI (JS)
|
||||
- binary_envelope.py
|
||||
- Colour Picker Mockups
|
||||
- PyboardCommand
|
||||
- beat.c
|
||||
- web.cpp
|
||||
- test_sequences.py
|
||||
- microdot.py
|
||||
- API Docs: Outputs & Audio
|
||||
- esp_check
|
||||
- store_save
|
||||
- Beat Detection DSP (C)
|
||||
- audio_api.c
|
||||
- sim_stubs.c
|
||||
- ddp_test.py
|
||||
- ws_client.cpp
|
||||
- time
|
||||
- test_presets.py
|
||||
- BridgeSim
|
||||
- USB Latency Tools
|
||||
- Colour Picker JS
|
||||
- Chromium Colour Picker JS
|
||||
- WS2812
|
||||
- API Tests: Devices
|
||||
- Transport
|
||||
- mpremote Transport
|
||||
- Outputs Config (C)
|
||||
- patterns.cpp
|
||||
- test_routes.py
|
||||
- ESPNow
|
||||
- test_outputs.py
|
||||
- microdot.py
|
||||
- mpremote Serial Transport
|
||||
- API Test Fixtures & Audio
|
||||
- Microdot Request (dmx)
|
||||
- Help: Zones & Palette
|
||||
- test_audio.py
|
||||
- esp_timer_get_time
|
||||
- os
|
||||
- build_app
|
||||
- web.c
|
||||
- Index Page Modals
|
||||
- NeoPixel
|
||||
- Microdot WebSocket (dmx)
|
||||
- usb_cfg.cpp
|
||||
- test_patterns.py
|
||||
- Controller Overview & OTA Docs
|
||||
- relay_slot_t
|
||||
- Audio Monitor Page
|
||||
- Art-Net DMX Tests
|
||||
- DMX Output Manager
|
||||
- unique
|
||||
- ESP-NOW Sender Bridge
|
||||
- net.cpp
|
||||
- Microdot Async IO (dmx)
|
||||
- DMX Settings
|
||||
- settings.cpp
|
||||
- Microdot Routing (dmx)
|
||||
- Bench Test Plan
|
||||
- HTTPException
|
||||
- api_call_t
|
||||
- Microdot Auth (dmx)
|
||||
- Serial DMX & WiFi
|
||||
- DMX Pattern Player
|
||||
- DMX Preset Model
|
||||
- Groups UI (JS)
|
||||
- Help: Mobile Menu Image
|
||||
- Pattern Selector Mockup Image
|
||||
- Driver Pattern Docs
|
||||
- Driver Message API Docs
|
||||
- led_strip Manifest
|
||||
- Outputs UI (JS)
|
||||
- DMX Driver Docs
|
||||
- Help PDF: Overview
|
||||
- Mockups Index Image
|
||||
- Help: Header Toolbar Image
|
||||
- Help: Preset Editor Image
|
||||
- Dashboard Mockup Image
|
||||
- Device Management Mockup Image
|
||||
- Presets Mockup Image
|
||||
- Pattern Contract
|
||||
- Numpad Shortcuts (JS)
|
||||
- Colour Picker Demo Image
|
||||
- Settings Mockup Image
|
||||
- sim_demo.py
|
||||
- store_coll
|
||||
- Help: Colour Palette Image
|
||||
- LED Driver README
|
||||
- machine.py
|
||||
- SPI Example Manifest
|
||||
- test_rig_sim.py
|
||||
- settings_editor.js
|
||||
- Help PDF: Modes
|
||||
- Help: Tab Preset Strip Image
|
||||
- res_device.c
|
||||
- api_error
|
||||
- app.js
|
||||
- RMT Example Manifest
|
||||
- Help Tab JS
|
||||
- Settings Page Template
|
||||
- led-driver/web/app.js
|
||||
- sequences_route
|
||||
- api_id
|
||||
- dependencies
|
||||
- List Search (JS)
|
||||
- DMX Solid Pattern
|
||||
- led-test Manifest
|
||||
- VPN Autoconnect Script
|
||||
- graphify Instructions
|
||||
- bulk.sh Script
|
||||
- deploy.sh Script
|
||||
- Driver install.sh
|
||||
- led-tool install.sh
|
||||
- Help PDF Build Script
|
||||
- Web Build Script
|
||||
- Spec: Pattern Selector UI
|
||||
- presets.cpp
|
||||
- res_group.c
|
||||
- _simlink_web.py
|
||||
- _simlink_proc.py
|
||||
- WLAN
|
||||
- NoCaseDict
|
||||
- SimRing
|
||||
- dependencies
|
||||
- examples/blink.py
|
||||
- README.md
|
||||
|
||||
## God Nodes (most connected - your core abstractions)
|
||||
1. `store_coll()` - 69 edges
|
||||
2. `api_error()` - 51 edges
|
||||
3. `api_json()` - 47 edges
|
||||
4. `unique()` - 43 edges
|
||||
5. `ab()` - 42 edges
|
||||
6. `api_set()` - 41 edges
|
||||
7. `new_id()` - 41 edges
|
||||
8. `get_colours()` - 39 edges
|
||||
9. `store_save()` - 39 edges
|
||||
10. `esp_timer_get_time()` - 36 edges
|
||||
|
||||
## Surprising Connections (you probably didn't know these)
|
||||
- `Preset editor modal` --semantically_similar_to--> `Preset fields (pattern, colors, delay, brightness, auto, n1-n6)` [INFERRED] [semantically similar]
|
||||
web/templates/index.html → led-driver/docs/API.md
|
||||
- `led-driver-style pattern engine (Preset object)` --semantically_similar_to--> `led-driver MicroPython firmware (submodule)` [INFERRED] [semantically similar]
|
||||
dmx-driver/README.md → README.md
|
||||
- `espnow-sender Microdot WebSocket receiver` --semantically_similar_to--> `WebSocket /ws driver message relay` [INFERRED] [semantically similar]
|
||||
espnow-sender/README.md → docs/API.md
|
||||
- `Art-Net output (UDP 6454)` --semantically_similar_to--> `Outputs (DDP, Art-Net, sACN, DMX serial pixel fixtures)` [INFERRED] [semantically similar]
|
||||
dmx-driver/README.md → docs/API.md
|
||||
- `POST /patterns/upload (led-driver parity)` --semantically_similar_to--> `Patterns resource /patterns` [INFERRED] [semantically similar]
|
||||
dmx-driver/README.md → docs/API.md
|
||||
|
||||
## Import Cycles
|
||||
- None detected.
|
||||
|
||||
## Hyperedges (group relationships)
|
||||
- **Audio page live endpoints** — web_audio_status, web_audio_beats, web_audio_audio_wav, web_audio_time, web_audio_tap_ep [EXTRACTED 1.00]
|
||||
- **Beat latency measurement methods** — docs_api_bench_endpoints, docs_bench_test_usb_latency, docs_bench_test_logic_analyzer, docs_bench_test_beat_lead [EXTRACTED 1.00]
|
||||
- **Combined brightness factors** — docs_api_combined_brightness, docs_api_settings, docs_api_groups, docs_api_devices, docs_api_zones [EXTRACTED 1.00]
|
||||
- **Color picker feature set** — docs_mockups_images_color_picker_demo_hsb_color_model, docs_mockups_images_color_picker_demo_hex_rgb_input, docs_mockups_images_color_picker_demo_keyboard_accessibility, docs_mockups_images_color_picker_demo_cross_platform_consistency [EXTRACTED 1.00]
|
||||
- **Edit-mode-only management features** — docs_help_edit_mode, docs_help_zones_modal, docs_help_send_presets, docs_help_patterns_dialog, docs_help_colour_palette, docs_help_presets_list [EXTRACTED 1.00]
|
||||
- **Preset editor actions (Try, Default, Save & Send, Remove from zone)** — docs_help_try_action, docs_help_default_preset, docs_help_save_and_send, docs_help_remove_from_zone [EXTRACTED 1.00]
|
||||
- **Header actions aggregated in mobile Menu** — docs_images_help_mobile_menu_run_mode, docs_images_help_mobile_menu_profiles, docs_images_help_mobile_menu_tabs, docs_images_help_mobile_menu_presets, docs_images_help_mobile_menu_help [EXTRACTED 1.00]
|
||||
- **Device/Group Modal Flow** — docs_mockups_device_management_showadddevicemodal, docs_mockups_device_management_showaddgroupmodal, docs_mockups_device_management_closemodal, docs_mockups_device_management_savedevice [EXTRACTED 1.00]
|
||||
- **LED Driver UI Mockup Set** — docs_mockups_images_index_dashboard_mockup, docs_mockups_images_index_pattern_selector_mockup, docs_mockups_images_index_device_management_mockup, docs_mockups_images_index_settings_mockup, docs_mockups_images_index_presets_mockup [EXTRACTED 1.00]
|
||||
- **Selectable LED Patterns** — docs_mockups_images_pattern_selector_on, docs_mockups_images_pattern_selector_off, docs_mockups_images_pattern_selector_blink, docs_mockups_images_pattern_selector_chase, docs_mockups_images_pattern_selector_circle, docs_mockups_images_pattern_selector_pulse, docs_mockups_images_pattern_selector_rainbow, docs_mockups_images_pattern_selector_transition [EXTRACTED 1.00]
|
||||
- **Preset/pattern configuration schema (pattern, colors, delay, step increment, N1-N8)** — docs_mockups_presets_led_patterns, docs_mockups_presets_delay, docs_mockups_presets_step_increment, docs_mockups_presets_n_parameters, docs_mockups_presets_step_offset [EXTRACTED 1.00]
|
||||
- **Device settings sections** — docs_mockups_settings_basic_settings, docs_mockups_settings_pattern_settings, docs_mockups_settings_advanced_settings, docs_mockups_settings_network_settings [EXTRACTED 1.00]
|
||||
- **LED Driver UI Mockup Suite** — docs_mockups_index, docs_mockups_dashboard, docs_mockups_pattern_selector, docs_mockups_device_management, docs_mockups_readme_settings_mockup, docs_mockups_color_picker_readme_presets_mockup [EXTRACTED 1.00]
|
||||
- **Pi-to-ESP32 Command Paths** — docs_specification_serial_espnow_bridge, docs_specification_wifi_driver_tcp, docs_specification_espnow, docs_specification_pi_controller [EXTRACTED 1.00]
|
||||
- **led_strip backend choice (RMT vs SPI, DMA)** — scripts_led_test_managed_components_espressif__led_strip_readme_rmt_backend, scripts_led_test_managed_components_espressif__led_strip_readme_spi_backend, scripts_led_test_managed_components_espressif__led_strip_readme_dma_support, scripts_led_test_managed_components_espressif__led_strip_readme_backend_selection_flowchart [EXTRACTED 1.00]
|
||||
- **led_strip pixel write and flush flow** — scripts_led_test_managed_components_espressif__led_strip_api_led_strip_set_pixel, scripts_led_test_managed_components_espressif__led_strip_api_led_strip_set_pixel_hsv, scripts_led_test_managed_components_espressif__led_strip_api_led_strip_set_pixel_rgbw, scripts_led_test_managed_components_espressif__led_strip_api_led_strip_refresh, scripts_led_test_managed_components_espressif__led_strip_api_led_strip_clear [EXTRACTED 1.00]
|
||||
- **Dynamic pattern contract** — led_driver_docs_pattern_contract_class_shape, led_driver_docs_pattern_contract_run_generator_rules, led_driver_docs_pattern_contract_drawing_brightness, led_driver_docs_pattern_contract_step_semantics, led_driver_docs_pattern_contract_error_handling [EXTRACTED 1.00]
|
||||
- **Pi Animation Engine Output Pipeline** — docs_specification_pixel_generator, docs_specification_output_drivers, docs_specification_output_record, docs_specification_zone_playback, docs_specification_sequencer [EXTRACTED 1.00]
|
||||
- **Beat-Driven Scene Activation** — docs_specification_beat_detection_device, docs_specification_bpm_sync, docs_specification_beat_counter_phases, docs_specification_scene_queue [INFERRED 0.85]
|
||||
- **Fields defining an LED preset (name, pattern, colours, parameters)** — docs_images_help_preset_editor_preset_name_field, docs_images_help_preset_editor_pattern_selector, docs_images_help_preset_editor_palette_linked_colour, docs_images_help_preset_editor_preset_parameters [INFERRED 0.85]
|
||||
- **Pattern settings composed and applied to devices** — docs_mockups_images_dashboard_pattern_selection, docs_mockups_images_dashboard_brightness_speed, docs_mockups_images_dashboard_colors, docs_mockups_images_dashboard_apply_settings [INFERRED 0.85]
|
||||
- **Preset lifecycle actions (create, apply, sync)** — docs_mockups_images_presets_create_preset, docs_mockups_images_presets_apply_preset, docs_mockups_images_presets_sync_presets_to_all_devices [INFERRED 0.85]
|
||||
- **ESP-NOW driver delivery layers** — docs_api_binary_envelope, docs_api_delivery_digest, docs_bench_test_reliable_link, docs_bench_test_beat_double_send [INFERRED 0.85]
|
||||
- **v1 message handling on driver** — led_driver_docs_api_v1_message, led_driver_docs_patterns_process_data_flow, led_driver_docs_patterns_pattern_registry, led_driver_docs_patterns_preset_short_keys, led_driver_docs_api_select_message [INFERRED 0.85]
|
||||
|
||||
## Communities (172 total, 56 thin omitted)
|
||||
|
||||
### Community 0 - "IdfDevice"
|
||||
Cohesion: 0.10
|
||||
Nodes (6): _idf_post(), _idf_show(), run_idf(), IdfDevice, IdfError, probe()
|
||||
|
||||
### Community 1 - "htmx Library"
|
||||
Cohesion: 0.08
|
||||
Nodes (101): a(), Ae(), an(), at(), B(), be(), bn(), bt() (+93 more)
|
||||
|
||||
### Community 3 - "Browser Tests & Mockup Images"
|
||||
Cohesion: 0.06
|
||||
Nodes (17): generate_image(), generate_with_html2image(), generate_with_playwright(), generate_with_selenium(), main(), browser(), _browser_sleep(), BrowserTest (+9 more)
|
||||
|
||||
### Community 4 - "Audio UI (JS)"
|
||||
Cohesion: 0.11
|
||||
Nodes (58): applyAudioStatus(), applyServerAudioUiFields(), audioRunPreferredDeviceId(), beatSyncButtonTitle(), bind(), clampLiveBpm(), clampSimulatedBpm(), clearBeatPhaseTimers() (+50 more)
|
||||
|
||||
### Community 5 - "ESP-NOW TX & DMX Pulse"
|
||||
Cohesion: 0.09
|
||||
Nodes (17): bench_running(), bridge_active(), bridge_send(), bridge_start(), ap_event(), bulk_task(), espnow_tx_beat(), espnow_tx_drop() (+9 more)
|
||||
|
||||
### Community 6 - "audio.c"
|
||||
Cohesion: 0.21
|
||||
Nodes (12): audio_get_handler(), audio_register(), audio_stream_task(), beats_get_handler(), beats_stream_task(), send_all(), tap_post_handler(), time_get_handler() (+4 more)
|
||||
|
||||
### Community 7 - "led-tool Device CLI"
|
||||
Cohesion: 0.06
|
||||
Nodes (17): download_presets(), download_settings(), _get_ordered_actions(), main(), print_settings(), resolve_flash_binary(), upload_presets(), upload_settings() (+9 more)
|
||||
|
||||
### Community 8 - "ab"
|
||||
Cohesion: 0.11
|
||||
Nodes (84): chase_draw(), ease_t(), first_call(), fx_aurora(), fx_bar_graph(), fx_blink(), fx_blizzard(), fx_candle_glow() (+76 more)
|
||||
|
||||
### Community 9 - "Compiler"
|
||||
Cohesion: 0.07
|
||||
Nodes (5): Template, Loader, Loader, Compiler, Loader
|
||||
|
||||
### Community 10 - "Spec: Pi Animation Engine"
|
||||
Cohesion: 0.07
|
||||
Nodes (46): Pi Animation Engine (src/engine), docs/API.md, Beat Counter and Phases, Beat Detection Device, Binary Message Protocol, BPM Sync, Dashboard UI (dashboard.html), usqlite Database Schema (presets, profiles, scenes, scene_groups) (+38 more)
|
||||
|
||||
### Community 11 - "esp_timer"
|
||||
Cohesion: 0.14
|
||||
Nodes (12): fail(), ota_get_handler(), ota_post_handler(), ota_preflight_handler(), ota_register(), reboot_post_handler(), web_allow_lan_origin(), web_start() (+4 more)
|
||||
|
||||
### Community 12 - "Presets UI (JS)"
|
||||
Cohesion: 0.09
|
||||
Nodes (42): arrayToGrid(), coerceManualBeatN(), coercePresetAuto(), coercePresetBackground(), coercePresetInt(), createPresetButton(), deviceNamesForPresetOnCurrentZone(), editPresetFromTab() (+34 more)
|
||||
|
||||
### Community 13 - "Zones UI (JS)"
|
||||
Cohesion: 0.10
|
||||
Nodes (42): applyBrightnessSliders(), applyZoneContentKindEditModal(), clamp255(), computeZoneNamesTargets(), computeZonePresetUnionTargets(), computeZoneTargets(), createZone(), effectiveGroupIdsForZonePreset() (+34 more)
|
||||
|
||||
### Community 14 - "patterns.c"
|
||||
Cohesion: 0.24
|
||||
Nodes (19): add_name(), all_patterns(), base_name(), builtin(), create_driver_pattern(), create_pattern(), exists(), file_names() (+11 more)
|
||||
|
||||
### Community 15 - "new_id"
|
||||
Cohesion: 0.10
|
||||
Nodes (10): new_id(), test_preset_round_trip(), test_profile_round_trip(), test_sequence_round_trip(), test_clone(), test_clone_default_name(), test_delete_removes_from_profile(), test_play_and_stop() (+2 more)
|
||||
|
||||
### Community 16 - "Sequences UI (JS)"
|
||||
Cohesion: 0.08
|
||||
Nodes (55): addSeqTarget(), addSequenceToTab(), addTargetsPerDriver(), appendZoneSequenceTiles(), applySequenceEditorMode(), applySequenceKindUi(), applySequenceSwitchWaitFromServer(), buildLaneGroupIdsForEditor() (+47 more)
|
||||
|
||||
### Community 17 - "bridge_sim.py"
|
||||
Cohesion: 0.07
|
||||
Nodes (21): normalise_layout(), _reversed_for_column(), rig_placements(), side_name(), strip_count(), strip_places(), StripPlace, controller_url() (+13 more)
|
||||
|
||||
### Community 18 - "main/main.c"
|
||||
Cohesion: 0.07
|
||||
Nodes (9): be16(), be32(), ddp_set_enabled(), ddp_sync_task(), ddp_task(), led_strip_spi_config_t, led_model_t, led_pixel_format_t (+1 more)
|
||||
|
||||
### Community 19 - "led_strip Component Docs"
|
||||
Cohesion: 0.10
|
||||
Nodes (36): led_test ESP-IDF project, led_test main component (main.c), led_strip API Reference, led_model_t (WS2812/SK6812), led_pixel_format_t (GRB/GRBW), led_strip_clear(), led_strip_config_t, led_strip_del() (+28 more)
|
||||
|
||||
### Community 20 - "Art-Net Output"
|
||||
Cohesion: 0.11
|
||||
Nodes (8): ArtNet, build_artdmx(), _ip_bytes(), _pad(), port_lo(), ticks_diff(), ticks_ms(), _u16le()
|
||||
|
||||
### Community 21 - "main/main.c"
|
||||
Cohesion: 0.08
|
||||
Nodes (19): espnow_tx_ap_clients(), app_main(), dhcp_settled(), eth_event_handler(), gateway_answers(), got_ip_event_handler(), have_static_ips(), link_up_task() (+11 more)
|
||||
|
||||
### Community 22 - "esp_log"
|
||||
Cohesion: 0.14
|
||||
Nodes (16): mic_start(), mic_stream_open(), mic_task(), to_dbfs(), app_main(), app_main(), configure_led(), app_main() (+8 more)
|
||||
|
||||
### Community 23 - "http_app.py"
|
||||
Cohesion: 0.21
|
||||
Nodes (3): serial_ports(), list_serial_ports(), output_tick()
|
||||
|
||||
### Community 24 - "ws.c"
|
||||
Cohesion: 0.44
|
||||
Nodes (5): forward(), on_open(), send_text(), ws_handler(), ws_register()
|
||||
|
||||
### Community 26 - "led_strip_rmt_dev.c"
|
||||
Cohesion: 0.15
|
||||
Nodes (15): led_strip_rmt_config_t, led_strip_config_t, led_strip_t, led_strip_new_rmt_device(), led_strip_rmt_clear(), led_strip_rmt_del(), led_strip_rmt_refresh(), led_strip_rmt_set_pixel() (+7 more)
|
||||
|
||||
### Community 27 - "seqplay.c"
|
||||
Cohesion: 0.06
|
||||
Nodes (96): build_groups(), compact(), compact_preset(), device_name_for(), driver_in_zone(), emit_c(), emit_json(), emit_zone() (+88 more)
|
||||
|
||||
### Community 28 - "Devices UI (JS)"
|
||||
Cohesion: 0.10
|
||||
Nodes (32): applyEspnowPingAggregateToDots(), applyEspnowPingToDeviceRows(), applyTcpSnapshot(), applyTransportVisibility(), collectDeviceEditPayload(), createDeviceFromModal(), createDeviceIdentifyButton(), DEVICE_DOT_CLASSES (+24 more)
|
||||
|
||||
### Community 29 - "binary_envelope.py"
|
||||
Cohesion: 0.15
|
||||
Nodes (18): brightness_0_255_from_wire(), brightness_wire_from_0_255(), _clamp_i16(), _colors_to_rgb_list(), _decode_default_blob(), _decode_preset_record(), _decode_presets_blob(), _decode_select_blob() (+10 more)
|
||||
|
||||
### Community 30 - "Colour Picker Mockups"
|
||||
Cohesion: 0.11
|
||||
Nodes (25): Chromium-style Color Picker Demo, ColorPickerChromium Component, updateColors() (Chromium demo), Custom Color Picker Demo, updateColors() (standard demo), Custom Colour Picker README, POST /api/colors (example), ColorPicker Component (+17 more)
|
||||
|
||||
### Community 32 - "beat.c"
|
||||
Cohesion: 0.07
|
||||
Nodes (26): LOCKED(), beat_reset(), beat_set_callback(), beat_start(), beat_subscribe(), beat_unsubscribe(), beat_dsp_bpm(), dsp_event() (+18 more)
|
||||
|
||||
### Community 33 - "web.cpp"
|
||||
Cohesion: 0.12
|
||||
Nodes (49): add_uri(), api_call_work(), api_fn_t, api_http_entry(), api_req_t, api_route_t, app_js_get(), brightness_post() (+41 more)
|
||||
|
||||
### Community 34 - "test_sequences.py"
|
||||
Cohesion: 0.19
|
||||
Nodes (19): clock(), make(), presets(), test_animation_over_sequence_keeps_time(), test_animation_plays_once_alone(), test_animation_step_fires_overlay(), test_beat_and_time_lanes_together(), test_chase_moves_and_bounces() (+11 more)
|
||||
|
||||
### Community 35 - "microdot.py"
|
||||
Cohesion: 0.15
|
||||
Nodes (4): iscoroutine(), Response, aclose(), __anext__()
|
||||
|
||||
### Community 36 - "API Docs: Outputs & Audio"
|
||||
Cohesion: 0.14
|
||||
Nodes (23): Art-Net output (UDP 6454), Audio API /api/audio and /audio page routes, Profile/preset/sequence JSON bundles (import/export), Combined brightness (global x groups x device x zone), /db collection export and replace, Devices resource /devices, Driver group membership lists (group ids, z<zone id>), Device groups resource /groups (+15 more)
|
||||
|
||||
### Community 37 - "esp_check"
|
||||
Cohesion: 0.13
|
||||
Nodes (12): led_strip_encoder_config_t, rmt_del_led_strip_encoder(), rmt_encode_led_strip(), rmt_led_strip_encoder_reset(), rmt_new_led_strip_encoder(), led_strip_new_spi_device(), __led_strip_spi_bit(), led_strip_spi_clear() (+4 more)
|
||||
|
||||
### Community 38 - "store_save"
|
||||
Cohesion: 0.22
|
||||
Nodes (12): api_register(), api_settings_defaults(), api_migrate_sequences(), db_root(), index_of(), load_file(), mount(), store_init() (+4 more)
|
||||
|
||||
### Community 39 - "Beat Detection DSP (C)"
|
||||
Cohesion: 0.18
|
||||
Nodes (18): Pulse, anim_breathe(), beat_feed(), analyse_beat(), bar_cue(), bar_decide(), beat_dsp_feed(), beat_dsp_init() (+10 more)
|
||||
|
||||
### Community 40 - "audio_api.c"
|
||||
Cohesion: 0.13
|
||||
Nodes (33): audio_api_register(), audio_handler(), audio_run(), events(), events_task(), ok_with_status(), send_all(), send_event() (+25 more)
|
||||
|
||||
### Community 41 - "sim_stubs.c"
|
||||
Cohesion: 0.11
|
||||
Nodes (11): espnow_tx_set_bridge(), app_main(), settings_str(), start_webserver(), esp_vfs_littlefs_register(), mic_get_level(), mic_start(), mic_stream_open() (+3 more)
|
||||
|
||||
### Community 42 - "ddp_test.py"
|
||||
Cohesion: 0.07
|
||||
Nodes (19): anim_rainbow(), expected(), find_devices(), frame(), frame_sum(), get(), local_prefix(), main() (+11 more)
|
||||
|
||||
### Community 43 - "ws_client.cpp"
|
||||
Cohesion: 0.18
|
||||
Nodes (11): ws_fast_call(), ws_slot_drop(), ws_slot_t, fd, host, read_handshake(), read_n(), ws_client_close() (+3 more)
|
||||
|
||||
### Community 44 - "time"
|
||||
Cohesion: 0.09
|
||||
Nodes (17): Blink, _default_image(), _info(), ota_update(), sleep(), sleep_ms(), sleep_us(), ticks_diff() (+9 more)
|
||||
|
||||
### Community 45 - "test_presets.py"
|
||||
Cohesion: 0.13
|
||||
Nodes (4): preset(), test_create_belongs_to_current_profile(), test_create_fills_defaults(), test_presets_scoped_to_profile()
|
||||
|
||||
### Community 46 - "BridgeSim"
|
||||
Cohesion: 0.05
|
||||
Nodes (15): BridgeSim, api_seed_layout(), index(), driver_mac(), lan_ip(), load_config(), mac_str(), main() (+7 more)
|
||||
|
||||
### Community 47 - "USB Latency Tools"
|
||||
Cohesion: 0.16
|
||||
Nodes (10): analyze(), edges(), main(), pct(), read(), fit_clock(), main(), pct() (+2 more)
|
||||
|
||||
### Community 50 - "WS2812"
|
||||
Cohesion: 0.07
|
||||
Nodes (13): new_ws2812_encoder(), rmt_del_ws2812_encoder(), rmt_encode_ws2812(), rmt_ws2812_encoder_reset(), rmt_ws2812_encoder_t, WS2812, channel_, encoder_ (+5 more)
|
||||
|
||||
### Community 52 - "Transport"
|
||||
Cohesion: 0.23
|
||||
Nodes (3): _convert_filesystem_error(), stdout_write_bytes(), Transport
|
||||
|
||||
### Community 53 - "mpremote Transport"
|
||||
Cohesion: 0.12
|
||||
Nodes (20): Presets Mockup Page, addColorPicker() / initializeColorPickers(), ColorPicker component (color-picker.js / color-picker.css), Preset Delay (animation speed, 10-1000 ms), ESPNow preset distribution, filterPresets() / sortPresets() search, filter and sort, LED Patterns (on, off, blink, chase, circle, pulse, rainbow, transition), Pattern Parameters N1-N8 (+12 more)
|
||||
|
||||
### Community 54 - "Outputs Config (C)"
|
||||
Cohesion: 0.23
|
||||
Nodes (16): defaults(), fail(), fill(), int_field(), num(), one_of(), put16(), resolve() (+8 more)
|
||||
|
||||
### Community 55 - "patterns.cpp"
|
||||
Cohesion: 0.10
|
||||
Nodes (32): net_ap_on(), net_sta_status(), clamp_leds(), ddp_show(), frame_alloc(), fx_fn, now_ms(), output() (+24 more)
|
||||
|
||||
### Community 59 - "microdot.py"
|
||||
Cohesion: 0.14
|
||||
Nodes (4): invoke_handler(), mro(), urldecode_bytes(), urldecode_str()
|
||||
|
||||
### Community 60 - "mpremote Serial Transport"
|
||||
Cohesion: 0.14
|
||||
Nodes (3): SerialIntercept, SerialTransport, TransportError
|
||||
|
||||
### Community 61 - "API Test Fixtures & Audio"
|
||||
Cohesion: 0.13
|
||||
Nodes (6): base_url(), c(), Client, profile(), restore_db(), missing()
|
||||
|
||||
### Community 63 - "Help: Zones & Palette"
|
||||
Cohesion: 0.13
|
||||
Nodes (18): Colour Palette (per profile), Zone default preset (default hint), DJ zone starter option, From Palette linked colours, LED driver JSON (presets, select, save, default, manifest), Patterns dialog, POST /presets/send, Preset editor (Try, Save, Send, Manual) (+10 more)
|
||||
|
||||
### Community 66 - "esp_timer_get_time"
|
||||
Cohesion: 0.09
|
||||
Nodes (26): bridge_addr(), skip_unresponsive(), espnow_tx_send(), espnow_tx_stats(), full_mask(), handle_rx(), peer_get(), record_done() (+18 more)
|
||||
|
||||
### Community 67 - "os"
|
||||
Cohesion: 0.09
|
||||
Nodes (4): mpremote_base(), main(), boot(), TransportExecError
|
||||
|
||||
### Community 68 - "build_app"
|
||||
Cohesion: 0.22
|
||||
Nodes (5): build_app(), api_seed_layout(), index(), static(), web()
|
||||
|
||||
### Community 69 - "web.c"
|
||||
Cohesion: 0.28
|
||||
Nodes (11): audio_page_handler(), etag(), favicon_handler(), find_file(), index_handler(), mime_for(), send_gz(), static_handler() (+3 more)
|
||||
|
||||
### Community 70 - "Index Page Modals"
|
||||
Cohesion: 0.11
|
||||
Nodes (19): Audio Beat Detection modal, Header BPM / beat sync indicator, Colour Palette modal, Devices modal, Edit device modal, Edit Zone modal, Device groups modal, Header global brightness slider (+11 more)
|
||||
|
||||
### Community 74 - "usb_cfg.cpp"
|
||||
Cohesion: 0.17
|
||||
Nodes (7): handle_api(), handle_line(), log_vprintf(), usb_cfg_start(), usb_cfg_task(), write_line(), web_api_call()
|
||||
|
||||
### Community 76 - "Controller Overview & OTA Docs"
|
||||
Cohesion: 0.17
|
||||
Nodes (16): led_controller ESP-IDF project, POST /patterns/upload (led-driver parity), Driver app update /drivers/ota (staged files, sha, commit/abort), Firmware OTA /ota (idle slot, rollback), Patterns resource /patterns, Driver app update over ESP-NOW test (tools/driver_ota.py), led-simulator, led-tool / led-cli serial device CLI (+8 more)
|
||||
|
||||
### Community 77 - "relay_slot_t"
|
||||
Cohesion: 0.50
|
||||
Nodes (3): relay_slot_t, cl, host
|
||||
|
||||
### Community 79 - "Audio Monitor Page"
|
||||
Cohesion: 0.16
|
||||
Nodes (16): /audio.wav live PCM stream, bar() bar-position renderer, /beats SSE event stream, draw() timeline canvas, Listen button (WAV stream playback via AudioContext), median(), Audio and beats page (/audio), stats() tap vs computer agreement (+8 more)
|
||||
|
||||
### Community 80 - "Art-Net DMX Tests"
|
||||
Cohesion: 0.26
|
||||
Nodes (9): parse(), _assert_eq(), main(), test_artnet_send_loopback(), test_build_artdmx(), test_fixture_patch(), test_pattern_blink_and_select(), test_pattern_upload() (+1 more)
|
||||
|
||||
### Community 81 - "DMX Output Manager"
|
||||
Cohesion: 0.18
|
||||
Nodes (3): as_channels(), main(), OutputManager
|
||||
|
||||
### Community 84 - "unique"
|
||||
Cohesion: 0.08
|
||||
Nodes (16): find_id_by_field(), unique(), test_scenes(), device(), group(), test_crud(), test_group_identify_needs_devices(), test_profile_scoped_group() (+8 more)
|
||||
|
||||
### Community 85 - "ESP-NOW Sender Bridge"
|
||||
Cohesion: 0.29
|
||||
Nodes (9): _broadcast_ws(), _espnow_receive_loop(), _init_espnow(), main(), _send_espnow(), _validate_envelope(), ws(), format_mac() (+1 more)
|
||||
|
||||
### Community 86 - "net.cpp"
|
||||
Cohesion: 0.10
|
||||
Nodes (25): ddp_start(), app_main(), ap_switch_later(), ap_timer_cb(), apply_ap(), apply_client_ip(), apply_sta_config(), net_ap_ssid() (+17 more)
|
||||
|
||||
### Community 90 - "settings.cpp"
|
||||
Cohesion: 0.17
|
||||
Nodes (9): patterns_set_global(), patterns_set_master(), get_str(), settings_load_hw(), settings_load_wifi(), settings_save_hw(), settings_save_net(), settings_save_wifi() (+1 more)
|
||||
|
||||
### Community 92 - "Bench Test Plan"
|
||||
Cohesion: 0.23
|
||||
Nodes (9): Bench endpoints /test/loss and /test/beats, 30 ms beat lead (CONFIG_BEAT_LEAD_MS), Bench test: S3 controller and one LED driver, ESP32-C3 vs S3 driver comparison, Logic analyzer latency (marker GPIO, tools/analyze_edges.py), Lossy-link test (simulated loss, retries, resync), Reliable link (rel: acked unicast, retransmits, ack timeouts), Bench troubleshooting (serial ports, channel mismatch, blank UI) (+1 more)
|
||||
|
||||
### Community 94 - "api_call_t"
|
||||
Cohesion: 0.33
|
||||
Nodes (5): api_call_t, cap, done, msg, out
|
||||
|
||||
### Community 95 - "Microdot Auth (dmx)"
|
||||
Cohesion: 0.19
|
||||
Nodes (6): wraps(), print_exception(), websocket_upgrade(), websocket_wrapper(), wrapper(), with_websocket()
|
||||
|
||||
### Community 96 - "Serial DMX & WiFi"
|
||||
Cohesion: 0.18
|
||||
Nodes (4): sleep_ms(), SerialDMX, sleep(), ap()
|
||||
|
||||
### Community 98 - "DMX Preset Model"
|
||||
Cohesion: 0.08
|
||||
Nodes (10): _expand(), _preset_from_map(), process_data(), _select_entries(), _targets_for_key(), create_app(), play(), ws_handler() (+2 more)
|
||||
|
||||
### Community 101 - "Groups UI (JS)"
|
||||
Cohesion: 0.29
|
||||
Nodes (9): fetchDevicesMapForGroups(), fetchGroupsMap(), identifyGroupById(), loadGroupsModal(), loadWifiFieldsFromGroup(), openEditGroupModal(), renderGroupDevicesEditor(), renderGroupsList() (+1 more)
|
||||
|
||||
### Community 103 - "Help: Mobile Menu Image"
|
||||
Cohesion: 0.24
|
||||
Nodes (10): Mobile Menu Help Illustration (narrow screen), Content Area (preset buttons), Menu Dropdown (Run mode, Profiles, Tabs, Presets, Help), Header Tab Buttons, Help, Menu Button (header dropdown trigger), Presets, Profiles (+2 more)
|
||||
|
||||
### Community 104 - "Pattern Selector Mockup Image"
|
||||
Cohesion: 0.20
|
||||
Nodes (11): Pattern Selector Mockup (Select LED Pattern), Apply Pattern / Cancel Actions, Blink Pattern, Chase Pattern, Circle Pattern, Off Pattern, On Pattern (solid color), Pattern Card Grid Layout (+3 more)
|
||||
|
||||
### Community 105 - "Driver Pattern Docs"
|
||||
Cohesion: 0.24
|
||||
Nodes (11): Message processing order (version, presets upsert, colour, selection), Auto vs manual (a) and manual chase flush, Built-in off / on patterns, Patterns and presets on the LED driver, MAX_PRESETS = 32, Pattern OTA via manifest / POST /patterns/upload, Pattern registry (Presets.reload_patterns), Preset short keys (p, c, d, b, a, bg, n1-n6) (+3 more)
|
||||
|
||||
### Community 109 - "Driver Message API Docs"
|
||||
Cohesion: 0.38
|
||||
Nodes (10): Auto vs manual mode, Beat (re-select same preset restarts generator), Hex colour conversion and colour-order reordering, LED Driver API (message format), Pattern-specific parameters (rainbow, pulse, transition, chase, circle), Preset fields (pattern, colors, delay, brightness, auto, n1-n6), Select message (device -> [preset, step]), Step synchronization (+2 more)
|
||||
|
||||
### Community 111 - "led_strip Manifest"
|
||||
Cohesion: 0.20
|
||||
Nodes (9): dependencies, idf, description, repository, repository_info, commit_sha, path, url (+1 more)
|
||||
|
||||
### Community 113 - "Outputs UI (JS)"
|
||||
Cohesion: 0.33
|
||||
Nodes (8): fetchOutputs(), loadOutputsModal(), openOutputEditor(), OUTPUT_PROTOCOL_LABELS, outputSummary(), renderOutputsList(), setOutputField(), syncOutputProtocolFields()
|
||||
|
||||
### Community 114 - "DMX Driver Docs"
|
||||
Cohesion: 0.25
|
||||
Nodes (9): Controller WebSocket /ws (v1 presets/select), DMX Driver Art-Net and serial gateway, DMX fixture (output, start channel, role map; parcan/mover profiles), led-driver-style pattern engine (Preset object), Serial DMX512 output (250000 8N2), Binary envelope (main/envelope.c, test/binary_envelope.py), v1 driver messages (long/short keys), WebSocket /ws driver message relay (+1 more)
|
||||
|
||||
### Community 115 - "Help PDF: Overview"
|
||||
Cohesion: 0.25
|
||||
Nodes (9): API.md, LED controller user guide, Main web UI (Raspberry Pi app), Pattern OTA install over HTTP (/patterns/ota, upload, driver, send), Pattern parameters n1-n8, README, Serial to ESP-NOW bridge transport, WebSocket /ws (+1 more)
|
||||
|
||||
### Community 116 - "Mockups Index Image"
|
||||
Cohesion: 0.31
|
||||
Nodes (9): LED Driver UI Mockups Index (screenshot), Dashboard Mockup, Device Groups, Device Management Mockup, LED Patterns (On, Off, Blink, Chase, Circle, Pulse, Rainbow, Transition), N1-N8 Pattern Parameters, Pattern Selector Mockup, Presets Mockup (+1 more)
|
||||
|
||||
### Community 118 - "Help: Header Toolbar Image"
|
||||
Cohesion: 0.29
|
||||
Nodes (8): Header Toolbar Help Image, Edit Mode Action Bar, Run/Edit Mode Toggle Button, Patterns Action, Presets Action, Profiles Action, Header Tab Buttons, Tabs Action
|
||||
|
||||
### Community 119 - "Help: Preset Editor Image"
|
||||
Cohesion: 0.29
|
||||
Nodes (5): Default Action, Preset Pattern Selector, Preset Editor Modal (help illustration), Preset Name Field, Brightness, Delay and n1-n8 Parameters (0-255)
|
||||
|
||||
### Community 120 - "Dashboard Mockup Image"
|
||||
Cohesion: 0.32
|
||||
Nodes (8): LED Driver Control Panel Dashboard Mockup, Apply Settings Action, Brightness & Speed Card (Brightness % and Delay ms sliders), Colors Card (color swatches palette, Add Color), Connected Devices Card (devices with group and online status), Device Groups, Pattern Selection Card (On, Off, Blink, Chase, Circle, Pulse, Rainbow, Transition), Save to Device Action
|
||||
|
||||
### Community 121 - "Device Management Mockup Image"
|
||||
Cohesion: 0.32
|
||||
Nodes (8): + Add Device Button, Connected Devices List, Device Group, Device & Group Management Screen (mockup), Device Row Actions (edit, settings, stop), Online/Offline Status Badge, Devices / Groups Tab Switcher, LED Device (MAC, group, pattern)
|
||||
|
||||
### Community 122 - "Presets Mockup Image"
|
||||
Cohesion: 0.32
|
||||
Nodes (8): Preset Management UI Mockup, Apply Preset Action, Create Preset Action, LED Pattern Types (Rainbow, Pulse, Chase, Circle, Blink, Transition), Preset Card (name, pattern badge, color swatches, delay, n1, apply/edit/delete), Preset Search/Filter/Sort Toolbar (pattern filter, sort by name, grid/list toggle), Preset Parameters (colors, delay ms, n1), Sync Presets to All Devices
|
||||
|
||||
### Community 123 - "Pattern Contract"
|
||||
Cohesion: 0.29
|
||||
Nodes (6): Pattern Contract, Drawing via driver.n and apply_brightness, Pattern error handling (Presets.tick catches), Presets._load_dynamic_patterns(), Shared driver.step semantics, Global vs per-preset brightness
|
||||
|
||||
### Community 129 - "Colour Picker Demo Image"
|
||||
Cohesion: 0.33
|
||||
Nodes (6): Custom Color Picker Demo (screenshot), Hex and RGB input support, HSB (Hue, Saturation, Brightness) color model, Keyboard accessible, customizable styling, Multiple Color Pickers for LED Patterns, Single Color Picker
|
||||
|
||||
### Community 130 - "Settings Mockup Image"
|
||||
Cohesion: 0.33
|
||||
Nodes (7): Advanced Settings (Step Counter, Step Increment, Device ID, Debug Mode), Basic Settings (Device Name, LED Pin, Number of LEDs), Color Order Selector (RGB/RBG/GRB/GBR/BRG/BGR), Device Settings Page Mockup, Network Settings (Access Point Name, Password, Enable AP), Pattern Parameters N1-N6, Pattern Settings (Pattern, Brightness, Delay)
|
||||
|
||||
### Community 131 - "sim_demo.py"
|
||||
Cohesion: 0.26
|
||||
Nodes (7): Api, main(), group(), preset(), sequence(), new_id(), rig_bars()
|
||||
|
||||
### Community 135 - "store_coll"
|
||||
Cohesion: 0.22
|
||||
Nodes (29): engine_groups_changed(), api_migrate_zones(), api_preset_defaults(), clone_profile(), clone_zone(), content_fragment(), create_profile(), create_zone() (+21 more)
|
||||
|
||||
### Community 138 - "Help: Colour Palette Image"
|
||||
Cohesion: 0.40
|
||||
Nodes (6): Colour Palette modal mockup (help image), Add Swatch (+) Button, Colour Palette Modal, Palette Colour Swatches, Preset Editor 'From Palette', Profile (palette owner)
|
||||
|
||||
### Community 140 - "LED Driver README"
|
||||
Cohesion: 0.47
|
||||
Nodes (6): dev.py deploy/sync script, LED Driver README (MicroPython ESP32), Optional HTTP polling (http_poll.py), Wi-Fi TCP transport to Pi (port 8765), transport_type setting (wifi / espnow), UDP discovery (port 8766)
|
||||
|
||||
### Community 142 - "SPI Example Manifest"
|
||||
Cohesion: 0.33
|
||||
Nodes (5): dependencies, espressif/led_strip, idf, override_path, version
|
||||
|
||||
### Community 143 - "test_rig_sim.py"
|
||||
Cohesion: 0.10
|
||||
Nodes (28): all_dark(), col_of(), frames(), led_x(), lit(), mac(), make_preset(), need_sim() (+20 more)
|
||||
|
||||
### Community 145 - "Help PDF: Modes"
|
||||
Cohesion: 0.40
|
||||
Nodes (4): Edit mode, Mobile layout Menu, Run mode, Zones modal
|
||||
|
||||
### Community 146 - "Help: Tab Preset Strip Image"
|
||||
Cohesion: 0.60
|
||||
Nodes (5): Help image: Main area brightness and preset tiles, Edit Mode: drag tiles to reorder, Global Brightness Slider, Preset Tile (gradient swatch, click to select on tab devices), Tab (e.g. lounge)
|
||||
|
||||
### Community 149 - "res_device.c"
|
||||
Cohesion: 0.18
|
||||
Nodes (30): api_apply_driver_cfg(), api_effective_brightness(), api_identify_group(), clamp255(), create_device(), device_brightness(), device_config_from(), device_driver_config() (+22 more)
|
||||
|
||||
### Community 150 - "api_error"
|
||||
Cohesion: 0.23
|
||||
Nodes (20): api_body(), api_error(), api_json(), api_merge(), api_message(), api_preset_in_profile(), api_result(), api_split() (+12 more)
|
||||
|
||||
### Community 155 - "app.js"
|
||||
Cohesion: 0.16
|
||||
Nodes (35): addLog(), banner(), colourAt(), connectBridge(), deliver(), drawLabel(), drawPlaced(), drawStrip() (+27 more)
|
||||
|
||||
### Community 156 - "RMT Example Manifest"
|
||||
Cohesion: 0.40
|
||||
Nodes (4): dependencies, espressif/led_strip, override_path, version
|
||||
|
||||
### Community 157 - "Help Tab JS"
|
||||
Cohesion: 0.36
|
||||
Nodes (5): addStaticIpRow(), loadDeviceSettings(), loadNetworkStatus(), setApToggle(), switchSettingsTab()
|
||||
|
||||
### Community 158 - "Settings Page Template"
|
||||
Cohesion: 0.50
|
||||
Nodes (4): Settings modal (device, network), loadEspnowChannel(), Device Settings page (ESP-NOW channel), wifi_channel setting (1-11)
|
||||
|
||||
### Community 159 - "led-driver/web/app.js"
|
||||
Cohesion: 0.10
|
||||
Nodes (49): api(), applyMode(), attachDrag(), closeEditor(), closeSock(), deviceChoices(), direct(), discoverDevices() (+41 more)
|
||||
|
||||
### Community 166 - "sequences_route"
|
||||
Cohesion: 0.23
|
||||
Nodes (13): api_body_opt(), api_current_profile(), api_sequence_defaults(), apply_update(), colors_from(), fire_sequence(), has_steps(), in_profile() (+5 more)
|
||||
|
||||
### Community 167 - "api_id"
|
||||
Cohesion: 0.19
|
||||
Nodes (29): api_add(), api_id(), api_set(), add_ref(), bundle(), bundle_of(), bundles_route(), export_profile() (+21 more)
|
||||
|
||||
### Community 170 - "dependencies"
|
||||
Cohesion: 0.25
|
||||
Nodes (8): dependencies, espressif/mdns, joltwallet/littlefs, rules, version, rules, version, if
|
||||
|
||||
### Community 171 - "List Search (JS)"
|
||||
Cohesion: 0.83
|
||||
Nodes (3): applyListSearch(), initListSearch(), rowSearchText()
|
||||
|
||||
### Community 197 - "presets.cpp"
|
||||
Cohesion: 0.20
|
||||
Nodes (21): patterns_index(), build_defaults(), find(), preset_from_json(), preset_to_json(), presets_add_defaults(), presets_apply_startup(), presets_at() (+13 more)
|
||||
|
||||
### Community 199 - "res_group.c"
|
||||
Cohesion: 0.31
|
||||
Nodes (15): add_error(), api_driver_config(), api_mac(), api_migrate_groups(), brightness(), driver_config(), find(), groups_route() (+7 more)
|
||||
|
||||
### Community 201 - "_simlink_web.py"
|
||||
Cohesion: 0.16
|
||||
Nodes (11): _check_flash(), on_feed(), push_pixels(), real_sleep(), recv(), recv_nowait(), _run_jobs(), _send_pixels() (+3 more)
|
||||
|
||||
### Community 204 - "_simlink_proc.py"
|
||||
Cohesion: 0.15
|
||||
Nodes (5): connect(), on_feed(), push_pixels(), _reader(), _send_pixels()
|
||||
|
||||
### Community 227 - "dependencies"
|
||||
Cohesion: 0.33
|
||||
Nodes (5): dependencies, espressif/cjson, espressif/mdns, version, version
|
||||
|
||||
## Knowledge Gaps
|
||||
- **113 isolated node(s):** `name`, `host`, `cl`, `host`, `fd` (+108 more)
|
||||
These have ≤1 connection - possible missing edges or undocumented components. (Counts symbols only; 900 node(s) total have ≤1 connection when file, concept and rationale nodes are included.)
|
||||
- **56 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
|
||||
|
||||
## Suggested Questions
|
||||
_Questions this graph is uniquely positioned to answer:_
|
||||
|
||||
- **Why does `esp_timer_get_time()` connect `esp_timer_get_time` to `beat.c`, `web.cpp`, `ESP-NOW TX & DMX Pulse`, `audio.c`, `Beat Detection DSP (C)`, `audio_api.c`, `main/main.c`, `api_error`, `patterns.cpp`, `Outputs Config (C)`, `res_device.c`, `net.cpp`, `seqplay.c`?**
|
||||
_High betweenness centrality (0.019) - this node is a cross-community bridge._
|
||||
- **Are the 64 inferred relationships involving `store_coll()` (e.g. with `api_add()` and `api_current_profile()`) actually correct?**
|
||||
_`store_coll()` has 64 INFERRED edges - model-reasoned connections that need verification._
|
||||
- **What connects `name`, `host`, `cl` to the rest of the system?**
|
||||
_113 weakly-connected nodes found - possible documentation gaps or missing edges._
|
||||
- **Should `IdfDevice` be split into smaller, more focused modules?**
|
||||
_Cohesion score 0.09523809523809523 - nodes in this community are weakly interconnected._
|
||||
- **Why does `Microdot` connect `Microdot` to `DMX Preset Model`, `microdot.py`, `build_app`, `Microdot Routing (dmx)`, `BridgeSim`, `microdot.py`, `HTTPException`?**
|
||||
_High betweenness centrality (0.018) - this node is a cross-community bridge._
|
||||
- **Are the 40 inferred relationships involving `api_error()` (e.g. with `outputs_route()` and `test_output()`) actually correct?**
|
||||
_`api_error()` has 40 INFERRED edges - model-reasoned connections that need verification._
|
||||
- **Should `htmx Library` be split into smaller, more focused modules?**
|
||||
_Cohesion score 0.07897684839432412 - nodes in this community are weakly interconnected._
|
||||