graph-grammar-react@2.0.0
Minor Changes
-
63f6597: Add batch ("seed sweep") runs to the left run rail. Choose how many runs to perform and either sweep a consecutive range of seeds (reproducible) or use fresh random seeds (broader exploration); the grammar is run to completion once per seed and every output is captured. A navigator then lets you flip through the results , prev/next buttons plus a clickable chip per run , loading each run's final graph onto the canvas with its seed and node/edge/step counts. Backed by new
AppState.runBatch/showBatchRun/nextBatchRun/prevBatchRun/clearBatchand thebatchRuns/batchIndex/batchActiveviews; results are cleared automatically when the grammar or start axiom changes. -
63f6597: The Modules sidebar panel is now collapsible (click its header to toggle), and each rule-group header in the Rules panel now shows the aggregate count of current matches across the group's rules alongside its rule count, so a collapsed group still surfaces how "hot" it is.
-
63f6597: Add drag-to-reorder across the workbench. Modules in the Modules sidebar can be dragged to reorder them (changing which one is primary and supplies the start axiom, and the rule composition order); rule-group sections in the Rules panel can be dragged to move all of their rules together; and individual rule rows can be dragged to reorder within the list, replacing the old ▲▼ buttons. Backed by new
AppState.reorderModules/AppState.reorderRuleGroups/AppState.reorderRules. -
63f6597: Toggle label visibility straight from the Stats legend.
Each chip in the Stats legend is now a switch: click the chip body to hide or show every node with that label, with the hidden ones dimmed and struck through. The colour swatch stays a separate control, so picking a colour never flips visibility.
The legend and the graph filter popover now share one hidden-label set, so toggling in either place keeps the other in sync. That set moved into the (persisted, serialisable) workbench settings —
WorkbenchSettingsgainshiddenNodes/hiddenEdges(label-name arrays), the renderer self-applies them off thesettingsevent, and they survive reloads and round-trip through settings export/import (sanitised on the way in). -
63f6597: Add tunable force-layout controls and a serialisable workbench-settings file.
The force simulation's repulsion is now a runtime knob: a new Layout section in the left rail exposes Repulsion (charge), Link distance, and Collision radius sliders, so dense diagrams can be spread out without code changes. The force layout applies tuning live (
ForceLayout.setForceParams), and a layout swap inherits the current tuning.Also adds per-label colour overrides: node colours are normally a hash of the label, which can collide so two distinct labels look identical. Each swatch in the Stats legend is now a colour picker — pick a colour to recolour every node with that label, with a one-click reset back to the automatic colour. Overrides only replace the fallback label colour, so an app-supplied
nodeStyleresolver's explicit fills still win.These plus the existing display toggles (engine, labels, match preview, reflow, respread) are now first-class workbench settings on
AppState: they live outside undo/redo, auto-persist tolocalStorageso adjustments stick across reloads, and serialise to a portable JSON file via File ▸ Export / Import / Reset settings. New public API:WorkbenchSettings(incl.labelColors),ForceParams,defaultSettings,clampSettings,mergeSettings,serializeSettings,parseSettings,FORCE_BOUNDS, theLayoutSettingscomponent, and thesettingsAppState event withsetSettings/resetSettings/importSettings/exportSettings. Imported values are clamped/sanitised (force ranges, valid hex colours only), and parsing tolerates partial / hand-edited JSON.
Patch Changes
- 63f6597: Fix "Add grammars…" replacing the active grammar instead of composing onto it. A grammar loaded outside the module system (from the Examples menu, a single import, or the initial grammar) is now seeded as the primary module on the first add, so subsequent additive loads keep it and union their rules over its start axiom. Backed by seeding logic in
AppState.addGrammarModule. - 63f6597: Make rule rows more compact. Row actions (drag handle, duplicate, delete) now float as a hover-revealed cluster at the top-right instead of taking a dedicated row, and the LHS/RHS size chips are combined into a single
1n/0e → 2n/1echip so the meta no longer wraps in the narrow rail. This shortens each rule row by roughly a quarter without losing any information or controls. - 63f6597: Keep the graph framed within the viewport while a reheated layout settles, instead of only re-fitting once it comes to rest. Flipping between seeded batch runs (or loading a new graph) now stays centred the whole time the force layout spreads the nodes out, rather than briefly showing an off-centre or clipped graph mid-settle. Manual pan/zoom still cancels the auto-fit as before.
- Updated dependencies [63f6597]
- Updated dependencies [63f6597]
- graph-grammar@1.1.0