How yangziwen/myers-diff works
Myers Diff is a browser tool for comparing two text inputs and visualizing the paths explored by the Myers algorithm. The main workflow is to enter both texts, run the comparison, inspect the best diff, and select a (d, k) step to inspect another solution. The source excerpts show separate algorithm, chart, editor, and module-loader components, but do not show the page-level wiring between them; only the algorithm-to-chart data relationship is visible in the chart API.
Main entry points: myers.js Myers algorithm · index.html Diff page · diffchart.js Step chart
Components 8
Comparison interface
- Diff page
index.html - Text editors
js/diffeditor.js - Diff editors
js/diffeditor.js
Diff computation
- Myers algorithm
js/myers.js
Result visualization
- Position chart
js/diffchart.js - Step chart
js/diffchart.js
Browser runtime
- RequireJS loader
js/require.js
Other components
- User
Connections 5
- User → Diff page: enters texts
README.md - User → Diff page: runs comparison
README.md - User → Step chart: selects step
README.md - Myers algorithm → Step chart: provides diff
js/diffchart.js - Myers algorithm → Position chart: provides positions
js/diffchart.js