@reicek/neataptic-ts 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/.github/agents/boundary-mapper.agent.md +29 -0
  2. package/.github/agents/docs-scout.agent.md +29 -0
  3. package/.github/agents/plan-scout.agent.md +29 -0
  4. package/.github/agents/solid-split.agent.md +138 -0
  5. package/.github/copilot-instructions.md +103 -0
  6. package/package.json +6 -3
  7. package/plans/ES2023 migration +13 -8
  8. package/plans/Evolution_Training_Interoperability_Contracts.md +1 -1
  9. package/plans/Interactive_Examples_and_Learning_Path.md +10 -2
  10. package/plans/Memory_Optimization.md +3 -3
  11. package/plans/README.md +63 -0
  12. package/plans/Roadmap.md +15 -3
  13. package/plans/asciiMaze_SOLID_split.done.md +130 -0
  14. package/plans/flappy_bird_SOLID_split.done.md +67 -0
  15. package/scripts/assets/theme.css +221 -34
  16. package/scripts/copy-examples.mjs +9 -5
  17. package/scripts/export-onnx.mjs +3 -3
  18. package/scripts/generate-bench-tables.mjs +10 -10
  19. package/scripts/generate-bench-tables.ts +10 -10
  20. package/scripts/generate-docs.ts +1415 -449
  21. package/scripts/render-docs-html.ts +15 -8
  22. package/src/README.md +101 -223
  23. package/src/architecture/README.md +57 -185
  24. package/src/architecture/layer/README.md +38 -38
  25. package/src/architecture/network/README.md +33 -31
  26. package/src/architecture/network/activate/README.md +77 -77
  27. package/src/architecture/network/connect/README.md +15 -13
  28. package/src/architecture/network/deterministic/README.md +7 -7
  29. package/src/architecture/network/evolve/README.md +44 -44
  30. package/src/architecture/network/gating/README.md +20 -20
  31. package/src/architecture/network/genetic/README.md +51 -51
  32. package/src/architecture/network/mutate/README.md +97 -97
  33. package/src/architecture/network/onnx/README.md +264 -264
  34. package/src/architecture/network/prune/README.md +39 -39
  35. package/src/architecture/network/remove/README.md +26 -26
  36. package/src/architecture/network/serialize/README.md +56 -56
  37. package/src/architecture/network/slab/README.md +61 -61
  38. package/src/architecture/network/standalone/README.md +24 -24
  39. package/src/architecture/network/stats/README.md +9 -9
  40. package/src/architecture/network/topology/README.md +46 -46
  41. package/src/architecture/network/training/README.md +21 -21
  42. package/src/methods/README.md +9 -87
  43. package/src/multithreading/README.md +8 -77
  44. package/src/multithreading/workers/README.md +2 -2
  45. package/src/multithreading/workers/browser/README.md +0 -6
  46. package/src/multithreading/workers/node/README.md +0 -3
  47. package/src/neat/README.md +562 -568
  48. package/src/utils/README.md +18 -18
  49. package/test/examples/asciiMaze/README.md +59 -59
  50. package/test/examples/asciiMaze/asciiMaze.e2e.test.ts +14 -9
  51. package/test/examples/asciiMaze/browser-entry/README.md +196 -0
  52. package/test/examples/asciiMaze/browser-entry/browser-entry.abort.services.ts +95 -0
  53. package/test/examples/asciiMaze/browser-entry/browser-entry.constants.ts +23 -0
  54. package/test/examples/asciiMaze/browser-entry/browser-entry.curriculum.services.ts +115 -0
  55. package/test/examples/asciiMaze/browser-entry/browser-entry.globals.services.ts +106 -0
  56. package/test/examples/asciiMaze/browser-entry/browser-entry.host.services.ts +157 -0
  57. package/test/examples/asciiMaze/browser-entry/browser-entry.services.ts +14 -0
  58. package/test/examples/asciiMaze/browser-entry/browser-entry.ts +129 -0
  59. package/test/examples/asciiMaze/browser-entry/browser-entry.types.ts +120 -0
  60. package/test/examples/asciiMaze/browser-entry/browser-entry.utils.ts +98 -0
  61. package/test/examples/asciiMaze/browser-entry.ts +10 -576
  62. package/test/examples/asciiMaze/dashboardManager/README.md +276 -0
  63. package/test/examples/asciiMaze/dashboardManager/archive/README.md +16 -0
  64. package/test/examples/asciiMaze/dashboardManager/archive/dashboardManager.archive.services.ts +267 -0
  65. package/test/examples/asciiMaze/dashboardManager/dashboardManager.constants.ts +35 -0
  66. package/test/examples/asciiMaze/dashboardManager/dashboardManager.services.ts +103 -0
  67. package/test/examples/asciiMaze/dashboardManager/dashboardManager.ts +181 -0
  68. package/test/examples/asciiMaze/dashboardManager/dashboardManager.types.ts +267 -0
  69. package/test/examples/asciiMaze/dashboardManager/dashboardManager.utils.ts +254 -0
  70. package/test/examples/asciiMaze/dashboardManager/live/README.md +14 -0
  71. package/test/examples/asciiMaze/dashboardManager/live/dashboardManager.live.services.ts +264 -0
  72. package/test/examples/asciiMaze/dashboardManager/telemetry/README.md +47 -0
  73. package/test/examples/asciiMaze/dashboardManager/telemetry/dashboardManager.telemetry.services.ts +513 -0
  74. package/test/examples/asciiMaze/dashboardManager.ts +13 -2335
  75. package/test/examples/asciiMaze/evolutionEngine/README.md +1058 -0
  76. package/test/examples/asciiMaze/evolutionEngine/curriculumPhase.ts +90 -0
  77. package/test/examples/asciiMaze/evolutionEngine/engineState.constants.ts +36 -0
  78. package/test/examples/asciiMaze/evolutionEngine/engineState.ts +58 -513
  79. package/test/examples/asciiMaze/evolutionEngine/engineState.types.ts +212 -0
  80. package/test/examples/asciiMaze/evolutionEngine/engineState.utils.ts +301 -0
  81. package/test/examples/asciiMaze/evolutionEngine/evolutionEngine.types.ts +445 -0
  82. package/test/examples/asciiMaze/evolutionEngine/evolutionLoop.ts +81 -50
  83. package/test/examples/asciiMaze/evolutionEngine/optionsAndSetup.ts +2 -4
  84. package/test/examples/asciiMaze/evolutionEngine/populationDynamics.ts +17 -33
  85. package/test/examples/asciiMaze/evolutionEngine/populationPruning.ts +1 -1
  86. package/test/examples/asciiMaze/evolutionEngine/rngAndTiming.ts +1 -2
  87. package/test/examples/asciiMaze/evolutionEngine/sampling.ts +1 -1
  88. package/test/examples/asciiMaze/evolutionEngine/scratchPools.ts +2 -5
  89. package/test/examples/asciiMaze/evolutionEngine/setupHelpers.ts +30 -37
  90. package/test/examples/asciiMaze/evolutionEngine/telemetryMetrics.ts +16 -58
  91. package/test/examples/asciiMaze/evolutionEngine/trainingWarmStart.ts +2 -2
  92. package/test/examples/asciiMaze/evolutionEngine.ts +55 -55
  93. package/test/examples/asciiMaze/fitness.ts +2 -2
  94. package/test/examples/asciiMaze/fitness.types.ts +65 -0
  95. package/test/examples/asciiMaze/interfaces.ts +64 -1352
  96. package/test/examples/asciiMaze/mazeMovement/README.md +356 -0
  97. package/test/examples/asciiMaze/mazeMovement/finalization/README.md +49 -0
  98. package/test/examples/asciiMaze/mazeMovement/finalization/mazeMovement.finalization.ts +138 -0
  99. package/test/examples/asciiMaze/mazeMovement/mazeMovement.constants.ts +101 -0
  100. package/test/examples/asciiMaze/mazeMovement/mazeMovement.services.ts +230 -0
  101. package/test/examples/asciiMaze/mazeMovement/mazeMovement.ts +299 -0
  102. package/test/examples/asciiMaze/mazeMovement/mazeMovement.types.ts +185 -0
  103. package/test/examples/asciiMaze/mazeMovement/mazeMovement.utils.ts +153 -0
  104. package/test/examples/asciiMaze/mazeMovement/policy/README.md +91 -0
  105. package/test/examples/asciiMaze/mazeMovement/policy/mazeMovement.policy.ts +467 -0
  106. package/test/examples/asciiMaze/mazeMovement/runtime/README.md +95 -0
  107. package/test/examples/asciiMaze/mazeMovement/runtime/mazeMovement.runtime.ts +354 -0
  108. package/test/examples/asciiMaze/mazeMovement/shaping/README.md +124 -0
  109. package/test/examples/asciiMaze/mazeMovement/shaping/mazeMovement.shaping.ts +459 -0
  110. package/test/examples/asciiMaze/mazeMovement.ts +12 -2978
  111. package/test/examples/flappy_bird/Trace-20260309T191949.json +24124 -0
  112. package/test/examples/flappy_bird/browser-entry/README.md +1129 -0
  113. package/test/examples/flappy_bird/browser-entry/browser-entry.host.utils.ts +4 -324
  114. package/test/examples/flappy_bird/browser-entry/browser-entry.network-view.utils.ts +6 -399
  115. package/test/examples/flappy_bird/browser-entry/browser-entry.playback.utils.ts +1 -717
  116. package/test/examples/flappy_bird/browser-entry/browser-entry.spawn.utils.ts +11 -31
  117. package/test/examples/flappy_bird/browser-entry/browser-entry.visualization.utils.ts +15 -893
  118. package/test/examples/flappy_bird/browser-entry/host/README.md +307 -0
  119. package/test/examples/flappy_bird/browser-entry/host/host.resize.service.ts +1 -295
  120. package/test/examples/flappy_bird/browser-entry/host/host.ts +562 -6
  121. package/test/examples/flappy_bird/browser-entry/host/resize/README.md +274 -0
  122. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.constants.ts +31 -0
  123. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.services.ts +360 -0
  124. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.ts +117 -0
  125. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.types.ts +63 -0
  126. package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.utils.ts +250 -0
  127. package/test/examples/flappy_bird/browser-entry/network-view/README.md +399 -0
  128. package/test/examples/flappy_bird/browser-entry/network-view/network-view.topology.utils.ts +255 -0
  129. package/test/examples/flappy_bird/browser-entry/network-view/network-view.ts +802 -7
  130. package/test/examples/flappy_bird/browser-entry/playback/README.md +684 -0
  131. package/test/examples/flappy_bird/browser-entry/playback/background/README.md +277 -0
  132. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/README.md +770 -0
  133. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.cache.services.ts +178 -0
  134. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.constants.ts +107 -0
  135. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.utils.ts +518 -0
  136. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.math.utils.ts +117 -0
  137. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.utils.ts +233 -0
  138. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.services.ts +211 -0
  139. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.ts +48 -0
  140. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.types.ts +212 -0
  141. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.utils.ts +81 -0
  142. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.cache.services.ts +96 -0
  143. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.constants.ts +62 -0
  144. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.services.ts +244 -0
  145. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.ts +53 -0
  146. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.types.ts +68 -0
  147. package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.utils.ts +100 -0
  148. package/test/examples/flappy_bird/browser-entry/playback/frame-render/README.md +310 -0
  149. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.service.ts +92 -0
  150. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.services.ts +272 -0
  151. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.types.ts +39 -0
  152. package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.utils.ts +493 -0
  153. package/test/examples/flappy_bird/browser-entry/playback/playback.constants.ts +1 -1
  154. package/test/examples/flappy_bird/browser-entry/playback/playback.frame-render.service.ts +4 -0
  155. package/test/examples/flappy_bird/browser-entry/playback/playback.snapshot.utils.ts +44 -0
  156. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.service.ts +39 -122
  157. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.services.ts +272 -0
  158. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.types.ts +62 -0
  159. package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.utils.ts +11 -4
  160. package/test/examples/flappy_bird/browser-entry/playback/playback.ts +409 -8
  161. package/test/examples/flappy_bird/browser-entry/playback/playback.types.ts +4 -12
  162. package/test/examples/flappy_bird/browser-entry/runtime/README.md +235 -0
  163. package/test/examples/flappy_bird/browser-entry/runtime/runtime.evolution-launch.service.ts +45 -0
  164. package/test/examples/flappy_bird/browser-entry/runtime/runtime.lifecycle.service.ts +81 -0
  165. package/test/examples/flappy_bird/browser-entry/runtime/runtime.startup.service.ts +74 -0
  166. package/test/examples/flappy_bird/browser-entry/runtime/runtime.ts +31 -121
  167. package/test/examples/flappy_bird/browser-entry/runtime/runtime.types.ts +36 -0
  168. package/test/examples/flappy_bird/browser-entry/visualization/README.md +557 -0
  169. package/test/examples/flappy_bird/browser-entry/visualization/visualization.constants.ts +110 -0
  170. package/test/examples/flappy_bird/browser-entry/visualization/visualization.draw.service.ts +957 -19
  171. package/test/examples/flappy_bird/browser-entry/visualization/visualization.legend.utils.ts +138 -3
  172. package/test/examples/flappy_bird/browser-entry/visualization/visualization.topology.utils.ts +3 -27
  173. package/test/examples/flappy_bird/browser-entry/visualization/visualization.ts +1 -23
  174. package/test/examples/flappy_bird/browser-entry/worker-channel/README.md +156 -0
  175. package/test/examples/flappy_bird/constants/README.md +1179 -0
  176. package/test/examples/flappy_bird/constants/constants.network-view.ts +24 -0
  177. package/test/examples/flappy_bird/constants/constants.palette.ts +7 -0
  178. package/test/examples/flappy_bird/constants/constants.starfield.ts +78 -3
  179. package/test/examples/flappy_bird/environment/README.md +143 -0
  180. package/test/examples/flappy_bird/environment/environment.observation.utils.ts +1 -19
  181. package/test/examples/flappy_bird/environment/environment.step.service.ts +3 -66
  182. package/test/examples/flappy_bird/evaluation/README.md +130 -0
  183. package/test/examples/flappy_bird/evaluation/evaluation.fitness.utils.ts +1 -1
  184. package/test/examples/flappy_bird/evaluation/evaluation.rollout.service.ts +5 -375
  185. package/test/examples/flappy_bird/evaluation/rollout/README.md +291 -0
  186. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.constants.ts +30 -0
  187. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.service.ts +58 -0
  188. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.services.ts +310 -0
  189. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.types.ts +56 -0
  190. package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.utils.ts +368 -0
  191. package/test/examples/flappy_bird/flappy-evolution-worker/README.md +618 -0
  192. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.playback.service.ts +7 -7
  193. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.frame.service.ts +364 -0
  194. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.types.ts +14 -0
  195. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.utils.ts +4 -201
  196. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.ts +184 -345
  197. package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.warm-start.service.ts +291 -0
  198. package/test/examples/flappy_bird/flappy.simulation.shared.utils.ts +5 -0
  199. package/test/examples/flappy_bird/simulation-shared/README.md +417 -0
  200. package/test/examples/flappy_bird/simulation-shared/observation/README.md +183 -0
  201. package/test/examples/flappy_bird/simulation-shared/observation/observation.features.utils.ts +301 -0
  202. package/test/examples/flappy_bird/simulation-shared/observation/observation.ts +9 -0
  203. package/test/examples/flappy_bird/simulation-shared/observation/observation.vector.utils.ts +59 -0
  204. package/test/examples/flappy_bird/simulation-shared/simulation-shared.observation.utils.ts +5 -403
  205. package/test/examples/flappy_bird/simulation-shared/simulation-shared.spawn.utils.ts +20 -6
  206. package/test/examples/flappy_bird/{evaluation/evaluation.statistics.utils.ts → simulation-shared/simulation-shared.statistics.utils.ts} +23 -8
  207. package/test/examples/flappy_bird/trainer/README.md +563 -0
  208. package/test/examples/flappy_bird/trainer/evaluation/README.md +199 -0
  209. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.constants.ts +9 -0
  210. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.services.ts +73 -0
  211. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.ts +165 -0
  212. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.types.ts +25 -0
  213. package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.utils.ts +161 -0
  214. package/test/examples/flappy_bird/trainer/trainer.evaluation.service.ts +13 -0
  215. package/test/examples/flappy_bird/trainer/trainer.report.service.services.ts +181 -0
  216. package/test/examples/flappy_bird/trainer/trainer.report.service.ts +126 -0
  217. package/test/examples/flappy_bird/trainer/trainer.selection.utils.ts +89 -0
  218. package/test/examples/flappy_bird/trainer/trainer.ts +11 -553
  219. package/test/examples/flappy_bird/browser-entry/browser-entry.utils.ts +0 -12
  220. package/test/examples/flappy_bird/environment/environment.ts +0 -7
  221. package/test/examples/flappy_bird/evaluation/evaluation.ts +0 -7
  222. package/test/examples/flappy_bird/simulation-shared/simulation-shared.ts +0 -15
  223. package/test/examples/flappy_bird/trainer/trainer.statistics.utils.ts +0 -78
@@ -0,0 +1,557 @@
1
+ # browser-entry/visualization
2
+
3
+ ## browser-entry/visualization/visualization.types.ts
4
+
5
+ ### DynamicColorScale
6
+
7
+ Dynamic tiered color scale used by visualization render layers.
8
+
9
+ ### NetworkVisualizationColorScales
10
+
11
+ Grouped color scales for connection and bias channels.
12
+
13
+ ## browser-entry/visualization/visualization.ts
14
+
15
+ ### resolveNetworkVisualizationLayers
16
+
17
+ `(network: import("src/architecture/network").default | undefined, inputSize: number, outputSize: number) => import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").VisualNetworkNodeLike[][]`
18
+
19
+ Resolves layered node groups for network-view layout and rendering.
20
+
21
+ Educational note:
22
+ Layer grouping is a network-view concern because it drives sizing, node
23
+ placement, and architecture presentation. Visualization code can still reuse
24
+ the result, but this helper now lives with the module that owns layout.
25
+
26
+ Parameters:
27
+
28
+ - `network` - - Runtime network instance.
29
+ - `inputSize` - - Input count fallback.
30
+ - `outputSize` - - Output count fallback.
31
+
32
+ Returns: Layered nodes for rendering.
33
+
34
+ ## browser-entry/visualization/visualization.errors.ts
35
+
36
+ ### visualization.errors
37
+
38
+ Error text for non-finite legend bounds.
39
+
40
+ ### assertFiniteLegendBound
41
+
42
+ `(value: number) => void`
43
+
44
+ Guards legend-bound formatting against non-finite values.
45
+
46
+ Parameters:
47
+
48
+ - `value` - - Legend bound candidate.
49
+
50
+ Returns: Nothing.
51
+
52
+ ### FLAPPY_VISUALIZATION_NON_FINITE_BOUND_ERROR_MESSAGE
53
+
54
+ ### VisualizationNonFiniteBoundError
55
+
56
+ Thrown when a legend bound cannot be safely formatted.
57
+
58
+ ## browser-entry/visualization/visualization.constants.ts
59
+
60
+ ### visualization.constants
61
+
62
+ Pixel side length for dotted negative-connection square markers.
63
+
64
+ ### FLAPPY_NETWORK_DISABLED_CONNECTION_ALPHA
65
+
66
+ ### FLAPPY_NETWORK_DISABLED_CONNECTION_DASH_PATTERN
67
+
68
+ ### FLAPPY_NETWORK_DOTTED_CONNECTION_ALIGNMENT_EPSILON
69
+
70
+ ### FLAPPY_NETWORK_DOTTED_CONNECTION_SQUARE_SIDE_PX
71
+
72
+ ### FLAPPY_NETWORK_DOTTED_CONNECTION_STEP_COMPACT_RATIO
73
+
74
+ ### FLAPPY_NETWORK_DOTTED_CONNECTION_WIDTH_SPACING_RATIO
75
+
76
+ ### FLAPPY_NETWORK_ENABLED_CONNECTION_ALPHA
77
+
78
+ ### FLAPPY_NETWORK_HEADER_LINE_HEIGHT_PX
79
+
80
+ ### FLAPPY_NETWORK_HEADER_PADDING_PX
81
+
82
+ ### FLAPPY_NETWORK_HIDDEN_NODE_STROKE_WIDTH_PX
83
+
84
+ ### FLAPPY_NETWORK_HIDDEN_NODE_VERTICAL_PADDING_PX
85
+
86
+ ### FLAPPY_NETWORK_LEGEND_ARCHITECTURE_GAP_PX
87
+
88
+ ### FLAPPY_NETWORK_LEGEND_BIAS_LABEL_X_PX
89
+
90
+ ### FLAPPY_NETWORK_LEGEND_BIAS_SWATCH_SIZE_PX
91
+
92
+ ### FLAPPY_NETWORK_LEGEND_BIAS_SWATCH_X_PX
93
+
94
+ ### FLAPPY_NETWORK_LEGEND_BIAS_SWATCH_Y_PX
95
+
96
+ ### FLAPPY_NETWORK_LEGEND_BOX_PADDING_PX
97
+
98
+ ### FLAPPY_NETWORK_LEGEND_CONNECTION_LABEL_X_PX
99
+
100
+ ### FLAPPY_NETWORK_LEGEND_CONNECTION_SAMPLE_END_X_PX
101
+
102
+ ### FLAPPY_NETWORK_LEGEND_CONNECTION_SAMPLE_Y_OFFSET_PX
103
+
104
+ ### FLAPPY_NETWORK_LEGEND_HEADER_TOP_PADDING_PX
105
+
106
+ ### FLAPPY_NETWORK_LEGEND_MIN_ARCHITECTURE_TOP_PX
107
+
108
+ ### FLAPPY_NETWORK_MIN_RENDER_NODE_HEIGHT_PX
109
+
110
+ ### FLAPPY_NETWORK_OUTPUT_NODE_HEIGHT_REDUCTION_PX
111
+
112
+ ### FLAPPY_NETWORK_OUTPUT_NODE_SHADOW_BLUR_PX
113
+
114
+ ### FLAPPY_NETWORK_OUTPUT_NODE_STROKE_WIDTH_PX
115
+
116
+ ## browser-entry/visualization/visualization.draw.service.ts
117
+
118
+ ### drawBiasNodeScene
119
+
120
+ `(context: CanvasRenderingContext2D, biasNodeScene: BiasNodeScene, nodeWidthPx: number) => void`
121
+
122
+ Draws a resolved node rectangle and optional bias label.
123
+
124
+ Parameters:
125
+
126
+ - `context` - - Render context.
127
+ - `biasNodeScene` - - Paint-ready node scene.
128
+ - `nodeWidthPx` - - Shared node width.
129
+
130
+ Returns: Nothing.
131
+
132
+ ### drawBiasNodesLayer
133
+
134
+ `(context: CanvasRenderingContext2D, positionedNodes: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").PositionedNetworkNodeLike[], nodeDimensions: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").NetworkNodeDimensionsLike, biasScale: import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").DynamicColorScale) => void`
135
+
136
+ Draws all network nodes with bias labels.
137
+
138
+ Parameters:
139
+
140
+ - `context` - - Render context.
141
+ - `positionedNodes` - - Positioned nodes.
142
+ - `nodeDimensions` - - Node dimensions.
143
+ - `biasScale` - - Dynamic bias color scale.
144
+
145
+ Returns: Nothing.
146
+
147
+ ### drawLeftAlignedTextRows
148
+
149
+ `(context: CanvasRenderingContext2D, request: { lines: string[]; leftPx: number; topPx: number; lineHeightPx: number; font: string; fillStyle: string; }) => void`
150
+
151
+ Draws multiline text rows aligned to a fixed left edge.
152
+
153
+ Parameters:
154
+
155
+ - `context` - - Render context.
156
+ - `request` - - Multiline text draw request.
157
+
158
+ Returns: Nothing.
159
+
160
+ ### drawLegendArchitectureLabel
161
+
162
+ `(context: CanvasRenderingContext2D, legendSceneContext: LegendSceneContext) => void`
163
+
164
+ Draws the architecture label block above the legend frame.
165
+
166
+ Parameters:
167
+
168
+ - `context` - - Render context.
169
+ - `legendSceneContext` - - Legend scene context.
170
+
171
+ Returns: Nothing.
172
+
173
+ ### drawLegendBiasRow
174
+
175
+ `(context: CanvasRenderingContext2D, legendSceneContext: LegendSceneContext, biasLegendRow: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").ColorLegendRow, biasRowTopPx: number) => void`
176
+
177
+ Draws a single bias legend row.
178
+
179
+ Parameters:
180
+
181
+ - `context` - - Render context.
182
+ - `legendSceneContext` - - Legend scene context.
183
+ - `biasLegendRow` - - Legend row.
184
+ - `biasRowTopPx` - - Row top coordinate.
185
+
186
+ Returns: Nothing.
187
+
188
+ ### drawLegendBiasSection
189
+
190
+ `(context: CanvasRenderingContext2D, legendSceneContext: LegendSceneContext) => void`
191
+
192
+ Draws the bias legend section.
193
+
194
+ Parameters:
195
+
196
+ - `context` - - Render context.
197
+ - `legendSceneContext` - - Legend scene context.
198
+
199
+ Returns: Nothing.
200
+
201
+ ### drawLegendConnectionRow
202
+
203
+ `(context: CanvasRenderingContext2D, legendSceneContext: LegendSceneContext, connectionLegendRow: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").ColorLegendRow, connectionRowTopPx: number) => void`
204
+
205
+ Draws a single connection legend row.
206
+
207
+ Parameters:
208
+
209
+ - `context` - - Render context.
210
+ - `legendSceneContext` - - Legend scene context.
211
+ - `connectionLegendRow` - - Legend row.
212
+ - `connectionRowTopPx` - - Row top coordinate.
213
+
214
+ Returns: Nothing.
215
+
216
+ ### drawLegendConnectionSection
217
+
218
+ `(context: CanvasRenderingContext2D, legendSceneContext: LegendSceneContext) => void`
219
+
220
+ Draws the connection-weight legend section.
221
+
222
+ Parameters:
223
+
224
+ - `context` - - Render context.
225
+ - `legendSceneContext` - - Legend scene context.
226
+
227
+ Returns: Nothing.
228
+
229
+ ### drawLegendFrame
230
+
231
+ `(context: CanvasRenderingContext2D, legendSceneContext: LegendSceneContext) => void`
232
+
233
+ Draws the legend container frame.
234
+
235
+ Parameters:
236
+
237
+ - `context` - - Render context.
238
+ - `legendSceneContext` - - Legend scene context.
239
+
240
+ Returns: Nothing.
241
+
242
+ ### drawLegendHeader
243
+
244
+ `(context: CanvasRenderingContext2D, legendSceneContext: LegendSceneContext) => void`
245
+
246
+ Draws the legend title row.
247
+
248
+ Parameters:
249
+
250
+ - `context` - - Render context.
251
+ - `legendSceneContext` - - Legend scene context.
252
+
253
+ Returns: Nothing.
254
+
255
+ ### drawNetworkColorLegend
256
+
257
+ `(context: CanvasRenderingContext2D, architectureLabel: string, colorScales: import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").NetworkVisualizationColorScales) => void`
258
+
259
+ Draws the color legend for connections and node bias values.
260
+
261
+ Parameters:
262
+
263
+ - `context` - - Render context.
264
+ - `architectureLabel` - - Compact architecture description.
265
+ - `colorScales` - - Connection and bias color scales.
266
+
267
+ Returns: Nothing.
268
+
269
+ ### drawNetworkVisualizationHeader
270
+
271
+ `(context: CanvasRenderingContext2D, architectureLabel: string) => void`
272
+
273
+ Draws network architecture header text.
274
+
275
+ Parameters:
276
+
277
+ - `context` - - Render context.
278
+ - `architectureLabel` - - Header label.
279
+
280
+ Returns: Nothing.
281
+
282
+ ### drawSquareDottedConnection
283
+
284
+ `(context: CanvasRenderingContext2D, input: { fromXPx: number; fromYPx: number; toXPx: number; toYPx: number; color: string; lineWidthPx: number; }) => void`
285
+
286
+ Draws a square-dotted connection stroke for negative weights.
287
+
288
+ Parameters:
289
+
290
+ - `context` - - Render context.
291
+ - `input` - - Dotted-stroke endpoints and style.
292
+
293
+ Returns: Nothing.
294
+
295
+ ### drawWeightedConnectionScene
296
+
297
+ `(context: CanvasRenderingContext2D, weightedConnectionScene: WeightedConnectionScene) => void`
298
+
299
+ Draws a previously resolved weighted connection scene.
300
+
301
+ Parameters:
302
+
303
+ - `context` - - Render context.
304
+ - `weightedConnectionScene` - - Render-ready connection scene.
305
+
306
+ Returns: Nothing.
307
+
308
+ ### drawWeightedConnectionsLayer
309
+
310
+ `(context: CanvasRenderingContext2D, runtimeConnections: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").VisualNetworkConnectionLike[], positionByNodeIndex: Map<number, import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").PositionedNetworkNodeLike>, connectionScale: import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").DynamicColorScale) => void`
311
+
312
+ Draws weighted connection lines.
313
+
314
+ Parameters:
315
+
316
+ - `context` - - Render context.
317
+ - `runtimeConnections` - - Runtime connection list.
318
+ - `positionByNodeIndex` - - Node layout map.
319
+ - `connectionScale` - - Dynamic connection color scale.
320
+
321
+ Returns: Nothing.
322
+
323
+ ### resolveBiasNodeHeightPx
324
+
325
+ `(nodeDimensions: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").NetworkNodeDimensionsLike, biasNodeLabelMetrics: BiasNodeLabelMetrics, isOutputNode: boolean) => number`
326
+
327
+ Resolves node rectangle height from label metrics and node role.
328
+
329
+ Parameters:
330
+
331
+ - `nodeDimensions` - - Shared node dimensions.
332
+ - `biasNodeLabelMetrics` - - Measured label metrics.
333
+ - `isOutputNode` - - Whether the node is an output node.
334
+
335
+ Returns: Render height for the node rectangle.
336
+
337
+ ### resolveBiasNodeLabelMetrics
338
+
339
+ `(context: CanvasRenderingContext2D, nodeLabel: string, nodeDimensions: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").NetworkNodeDimensionsLike) => BiasNodeLabelMetrics`
340
+
341
+ Measures a bias label and resolves its font declaration.
342
+
343
+ Parameters:
344
+
345
+ - `context` - - Render context.
346
+ - `nodeLabel` - - Bias label string.
347
+ - `nodeDimensions` - - Shared node dimensions.
348
+
349
+ Returns: Measured label metrics.
350
+
351
+ ### resolveBiasNodePaintStyle
352
+
353
+ `(positionedNode: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").PositionedNetworkNodeLike, biasScale: import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").DynamicColorScale) => BiasNodePaintStyle`
354
+
355
+ Resolves node fill, stroke, and glow styling.
356
+
357
+ Parameters:
358
+
359
+ - `positionedNode` - - Positioned node payload.
360
+ - `biasScale` - - Bias color scale.
361
+
362
+ Returns: Node paint style.
363
+
364
+ ### resolveBiasNodeScene
365
+
366
+ `(context: CanvasRenderingContext2D, positionedNode: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").PositionedNetworkNodeLike, nodeDimensions: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").NetworkNodeDimensionsLike, halfNodeWidthPx: number, biasScale: import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").DynamicColorScale) => BiasNodeScene`
367
+
368
+ Resolves all paint attributes needed to render a single node.
369
+
370
+ Parameters:
371
+
372
+ - `context` - - Render context.
373
+ - `positionedNode` - - Positioned node payload.
374
+ - `nodeDimensions` - - Shared node dimensions.
375
+ - `halfNodeWidthPx` - - Cached half node width.
376
+ - `biasScale` - - Bias color scale.
377
+
378
+ Returns: Paint-ready node scene.
379
+
380
+ ### resolveLegendSceneContext
381
+
382
+ `(context: CanvasRenderingContext2D, architectureLabel: string, colorScales: import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").NetworkVisualizationColorScales) => LegendSceneContext`
383
+
384
+ Resolves the legend rows, layout, and architecture label bounds.
385
+
386
+ Parameters:
387
+
388
+ - `context` - - Render context.
389
+ - `architectureLabel` - - Multiline architecture label.
390
+ - `colorScales` - - Connection and bias color scales.
391
+
392
+ Returns: Legend scene context.
393
+
394
+ ### resolveWeightedConnectionScene
395
+
396
+ `(runtimeConnection: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").VisualNetworkConnectionLike, positionByNodeIndex: Map<number, import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").PositionedNetworkNodeLike>, connectionScale: import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").DynamicColorScale) => WeightedConnectionScene | undefined`
397
+
398
+ Resolves a renderable connection scene from runtime data and node positions.
399
+
400
+ Parameters:
401
+
402
+ - `runtimeConnection` - - Candidate runtime connection.
403
+ - `positionByNodeIndex` - - Node layout map.
404
+ - `connectionScale` - - Connection color scale.
405
+
406
+ Returns: Renderable connection scene, when both endpoint nodes exist.
407
+
408
+ ### shouldHideNetworkColorLegend
409
+
410
+ `(context: CanvasRenderingContext2D) => boolean`
411
+
412
+ Determines whether the responsive viewport intentionally hides the overlay legend.
413
+
414
+ Parameters:
415
+
416
+ - `context` - - Render context.
417
+
418
+ Returns: True when the legend should be omitted.
419
+
420
+ ## browser-entry/visualization/visualization.colors.utils.ts
421
+
422
+ ### createLogDivergingColorTiers
423
+
424
+ `(input: { maxAbsValue: number; centerBlueThreshold: number; negativePalette: readonly string[]; centerBluePalette: readonly string[]; positivePalette: readonly string[]; logarithmicSteepness: number; edgeStartAbsValue?: number | undefined; edgeTierCount?: number | undefined; }) => import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").ColorTier[]`
425
+
426
+ Builds logarithmic diverging color tiers with a center band and edge extension.
427
+
428
+ Parameters:
429
+
430
+ - `input` - - Tier creation options.
431
+
432
+ Returns: Ordered tier list.
433
+
434
+ ### resolveBiasRangeColor
435
+
436
+ `(nodeBias: number) => string`
437
+
438
+ Resolves bias color for a raw node bias.
439
+
440
+ Parameters:
441
+
442
+ - `nodeBias` - - Node bias.
443
+
444
+ Returns: Tier color.
445
+
446
+ ### resolveConnectionRangeColor
447
+
448
+ `(connectionWeight: number) => string`
449
+
450
+ Resolves connection color for a raw weight.
451
+
452
+ Parameters:
453
+
454
+ - `connectionWeight` - - Connection weight.
455
+
456
+ Returns: Tier color.
457
+
458
+ ### resolveNetworkVisualizationColorScales
459
+
460
+ `(network: import("src/architecture/network").default | undefined) => import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").NetworkVisualizationColorScales`
461
+
462
+ Resolves dynamic connection/bias color scales from the active network range.
463
+
464
+ Parameters:
465
+
466
+ - `network` - - Active network.
467
+
468
+ Returns: Dynamic scales used by graph drawing and legend rows.
469
+
470
+ ### resolveTierColor
471
+
472
+ `(value: number, tiers: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").ColorTier[], aboveTierColor: string) => string`
473
+
474
+ Resolves a color from ordered tier definitions.
475
+
476
+ Parameters:
477
+
478
+ - `value` - - Numeric value to classify.
479
+ - `tiers` - - Ordered tier list.
480
+ - `aboveTierColor` - - Fallback color for values above the last tier.
481
+
482
+ Returns: Resolved color string.
483
+
484
+ ## browser-entry/visualization/visualization.legend.utils.ts
485
+
486
+ ### createColorLegendRows
487
+
488
+ `(scale: import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").DynamicColorScale, symbol: "w" | "b") => import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").ColorLegendRow[]`
489
+
490
+ Creates legend rows from ordered tiers.
491
+
492
+ Parameters:
493
+
494
+ - `scale` - - Dynamic color scale containing bounds, tiers, and overflow color.
495
+ - `symbol` - - Label symbol.
496
+
497
+ Returns: Legend rows.
498
+
499
+ ### resolveDefaultNetworkLegendLayout
500
+
501
+ `(context: CanvasRenderingContext2D, network: import("src/architecture/network").default | undefined) => import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").NetworkLegendLayout`
502
+
503
+ Resolves default legend layout from internal tier definitions.
504
+
505
+ Parameters:
506
+
507
+ - `context` - - Render context.
508
+ - `network` - - Active network instance.
509
+
510
+ Returns: Legend layout.
511
+
512
+ ### resolveNetworkLegendLayout
513
+
514
+ `(context: CanvasRenderingContext2D, connectionLegendRows: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").ColorLegendRow[], biasLegendRows: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").ColorLegendRow[]) => import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").NetworkLegendLayout`
515
+
516
+ Resolves network legend layout from canvas constraints.
517
+
518
+ Parameters:
519
+
520
+ - `context` - - Render context.
521
+ - `connectionLegendRows` - - Connection legend rows.
522
+ - `biasLegendRows` - - Bias legend rows.
523
+
524
+ Returns: Computed legend layout.
525
+
526
+ ## browser-entry/visualization/visualization.topology.utils.ts
527
+
528
+ ### formatNodeBiasLabel
529
+
530
+ `(nodeBias: number) => string`
531
+
532
+ Formats node bias labels with fixed sign and precision.
533
+
534
+ Parameters:
535
+
536
+ - `nodeBias` - - Node bias value.
537
+
538
+ Returns: Label text.
539
+
540
+ ### resolveNetworkVisualizationLayers
541
+
542
+ `(network: import("src/architecture/network").default | undefined, inputSize: number, outputSize: number) => import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").VisualNetworkNodeLike[][]`
543
+
544
+ Resolves layered node groups for network-view layout and rendering.
545
+
546
+ Educational note:
547
+ Layer grouping is a network-view concern because it drives sizing, node
548
+ placement, and architecture presentation. Visualization code can still reuse
549
+ the result, but this helper now lives with the module that owns layout.
550
+
551
+ Parameters:
552
+
553
+ - `network` - - Runtime network instance.
554
+ - `inputSize` - - Input count fallback.
555
+ - `outputSize` - - Output count fallback.
556
+
557
+ Returns: Layered nodes for rendering.
@@ -3,6 +3,21 @@
3
3
  */
4
4
  export const FLAPPY_NETWORK_DOTTED_CONNECTION_SQUARE_SIDE_PX = 2;
5
5
 
6
+ /**
7
+ * Stroke alpha used for enabled connection lines.
8
+ */
9
+ export const FLAPPY_NETWORK_ENABLED_CONNECTION_ALPHA = 0.95;
10
+
11
+ /**
12
+ * Stroke alpha used for disabled connection lines.
13
+ */
14
+ export const FLAPPY_NETWORK_DISABLED_CONNECTION_ALPHA = 0.2;
15
+
16
+ /**
17
+ * Dash pattern used for disabled positive connection lines.
18
+ */
19
+ export const FLAPPY_NETWORK_DISABLED_CONNECTION_DASH_PATTERN = [5, 4] as const;
20
+
6
21
  /**
7
22
  * Spacing multiplier used to tighten square-dot trail cadence.
8
23
  */
@@ -17,3 +32,98 @@ export const FLAPPY_NETWORK_DOTTED_CONNECTION_WIDTH_SPACING_RATIO = 2.6;
17
32
  * Tiny alignment epsilon to stabilize axis-aligned dot centering.
18
33
  */
19
34
  export const FLAPPY_NETWORK_DOTTED_CONNECTION_ALIGNMENT_EPSILON = 0.01;
35
+
36
+ /**
37
+ * Extra vertical padding reserved for hidden-node labels inside rectangles.
38
+ */
39
+ export const FLAPPY_NETWORK_HIDDEN_NODE_VERTICAL_PADDING_PX = 2;
40
+
41
+ /**
42
+ * Stroke width used for emphasized output nodes.
43
+ */
44
+ export const FLAPPY_NETWORK_OUTPUT_NODE_STROKE_WIDTH_PX = 2.1;
45
+
46
+ /**
47
+ * Stroke width used for hidden and input nodes.
48
+ */
49
+ export const FLAPPY_NETWORK_HIDDEN_NODE_STROKE_WIDTH_PX = 1.3;
50
+
51
+ /**
52
+ * Glow blur radius used for output-node emphasis.
53
+ */
54
+ export const FLAPPY_NETWORK_OUTPUT_NODE_SHADOW_BLUR_PX = 7;
55
+
56
+ /**
57
+ * Minimum render height for any node rectangle.
58
+ */
59
+ export const FLAPPY_NETWORK_MIN_RENDER_NODE_HEIGHT_PX = 4;
60
+
61
+ /**
62
+ * Height reduction applied to output-node rectangles for tighter framing.
63
+ */
64
+ export const FLAPPY_NETWORK_OUTPUT_NODE_HEIGHT_REDUCTION_PX = 2;
65
+
66
+ /**
67
+ * Left and top padding used by the network header block.
68
+ */
69
+ export const FLAPPY_NETWORK_HEADER_PADDING_PX = 8;
70
+
71
+ /**
72
+ * Vertical spacing between multiline header rows.
73
+ */
74
+ export const FLAPPY_NETWORK_HEADER_LINE_HEIGHT_PX = 12;
75
+
76
+ /**
77
+ * Minimum top bound for architecture text above the legend box.
78
+ */
79
+ export const FLAPPY_NETWORK_LEGEND_MIN_ARCHITECTURE_TOP_PX = 4;
80
+
81
+ /**
82
+ * Gap between architecture text and the legend container.
83
+ */
84
+ export const FLAPPY_NETWORK_LEGEND_ARCHITECTURE_GAP_PX = 4;
85
+
86
+ /**
87
+ * Shared inner padding used by legend labels and swatches.
88
+ */
89
+ export const FLAPPY_NETWORK_LEGEND_BOX_PADDING_PX = 8;
90
+
91
+ /**
92
+ * Top offset for the legend title inside the legend box.
93
+ */
94
+ export const FLAPPY_NETWORK_LEGEND_HEADER_TOP_PADDING_PX = 6;
95
+
96
+ /**
97
+ * End x-position for connection sample lines in legend rows.
98
+ */
99
+ export const FLAPPY_NETWORK_LEGEND_CONNECTION_SAMPLE_END_X_PX = 28;
100
+
101
+ /**
102
+ * Vertical offset for connection sample lines inside legend rows.
103
+ */
104
+ export const FLAPPY_NETWORK_LEGEND_CONNECTION_SAMPLE_Y_OFFSET_PX = 4;
105
+
106
+ /**
107
+ * Label x-position for connection legend row text.
108
+ */
109
+ export const FLAPPY_NETWORK_LEGEND_CONNECTION_LABEL_X_PX = 32;
110
+
111
+ /**
112
+ * X-position for bias legend swatches.
113
+ */
114
+ export const FLAPPY_NETWORK_LEGEND_BIAS_SWATCH_X_PX = 10;
115
+
116
+ /**
117
+ * Y-position offset for bias legend swatches.
118
+ */
119
+ export const FLAPPY_NETWORK_LEGEND_BIAS_SWATCH_Y_PX = 1;
120
+
121
+ /**
122
+ * Side length for bias legend color swatches.
123
+ */
124
+ export const FLAPPY_NETWORK_LEGEND_BIAS_SWATCH_SIZE_PX = 6;
125
+
126
+ /**
127
+ * Label x-position for bias legend row text.
128
+ */
129
+ export const FLAPPY_NETWORK_LEGEND_BIAS_LABEL_X_PX = 22;