A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Tchanders/treeDiffer.js below:

Tchanders/treeDiffer.js: Library for running tree diffs.

A JavaScript library for diffing trees in the browser, implementing the algorithm outlined in: http://epubs.siam.org/doi/abs/10.1137/0218082?journalCode=smjcat

This library forms the basis for visual diffs in Wikimedia's visual editor.

treeDiffer finds the minimum transactions to get from the first tree to the second tree. Nodes in each tree are labelled in post order, starting from 0. Each transaction is of the form [nodeToRemove, nodeToInsert], where nodeToRemove or nodeToInsert (but not both) can be null. E.g:

The only allowed transactions are insert, remove and change; a move would be captured by a remove and an insert. See the above paper for more details.

Trees can be made of any type of node, as long as the nodes are connected in a tree structure.

The abstract treeDiffer.treeNode class should be extended to work with the specific node type.

Using treeDiffer to diff HTML: https://tchanders.github.io/treeDiffer.js/


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4