Repository navigation
feat(vocabulary): the word cloud as SVG (M19b) - #31
Open
jgrodziski wants to merge 5 commits into
Open
jgrodziski wants to merge 5 commits into
jgrodziski wants to merge 5 commits into
Conversation
layoutCloud (PLAN.md §20.2): pure geometry, no randomness. Words by weight, ties by text then class, so any order of the same words lays out the same; the font size on the square root of the weight (area reads as magnitude); each padded box at the first point of a 2:1 Archimedean spiral where it overlaps nothing placed. The measurer is injected: a monospace default that counts a mark as no cell and a wide character as two, or a page's measureText. Type imports only, so the navigator's tab can run the same function. Properties: no overlap, every box inside the canvas, order-independent, weight order with sizes never inverted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vocabularyCloudSvg draws one scope's words: size by weight, colour by class and nothing else (a stylesheet keyed by class, light and dark; no inline fill), a key when more than one class is drawn, and a legend stating the scope, counts, weights, view and technical list. The font is monospace, so the bytes are the same on every run: fixtures/java/expected/vocabulary.svg is a snapshot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--svg FILE draws the cloud of the one scope reported, the corpus or the --scope one (an operation counted on demand too), from the words --class and --top pick, and confirms on stderr. A cloud is one scope's, so --svg with --level module|type or --drift is a usage error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/cli.md and the website's vocabulary page describe --svg: what size, colour and the legend say, and when the flag is refused. docs/vocabulary-broadleaf.svg is BroadleafCommerce's corpus cloud, drawn by the command with --top 80. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
§20.1's command paragraph states when --svg is refused; §20.2 records the layout's settings, the measurer's cells and the SVG's palette as built, and the Broadleaf demo. The first M19b item is checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
codegraph | 9ba26fa | Commit Preview URL Branch Preview URL |
Oct 26 2026, 11:40 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First step of milestone M19b in PLAN.md §20 (word cloud / glossary, #6). Stacked on #30 (itself on #29, #28, #27 and #26): review those first; this PR's diff is the five commits after #30.
It draws the word cloud:
codegraph vocabulary --svg FILEwrites one scope's words as an SVG image, beside the usual report.The layout (
cloud.ts)measureTextand run the same function. The module imports types only, so a page can load it without the Node pipeline.The SVG (
svg.ts)prefers-color-scheme: darkpalette applies on a dark page. No word has an inline fill.fixtures/java/expected/vocabulary.svg.The flag
--svgdraws the scope the report shows: the corpus by default, or the one--scopenames, an operation included.--classand--topchoose the words.--level module|typeand with--drift(exit 2), since a cloud shows one scope.wrote 3794 bytes to F (cloud of corpus src: 40 of 73 domain terms).The demo image
docs/vocabulary-broadleaf.svgis Broadleaf's corpus cloud at--top 80(6.7 KB). It reads as commerce:order item customer product offer fulfillment payment sku cart catalog….docs/cli.mdand the website'svocabularypage link it and describe the flag.Worth a look in review:
--height vocabulary:order, not--color. PLAN §20.2 asked for colour, but the city has no numeric colour channel. That's the last M19b PR; PLAN notes it.Verification
pnpm -r buildandpnpm -r typecheckgreen; eslint clean on every changed file;pnpm run gen:schemasleavesschemas/unchanged; the Hugo site builds.node:sqlitewarning test noted on feat(core): language lexicons on profiles (M19a) #26.codegraph.cjs) reproduces the Java snapshot byte for byte. The single-executable build fails on this machine because Homebrew's Node lacks SEA support.PLAN §20.4's first M19b item is checked.
Part of #6.
🤖 Generated with Claude Code