Live data from Hacker News

Graphtage: A semantic diff utility for JSON, HTML, YAML, CSV, etc

github.com

11–20 of 52 posts

Re: Graphtage: A semantic diff utility for JSON, HTML, YAML, CSV, etc

#14
post #5

Interesting use of U+031F COMBINING PLUS SIGN BELOW to indicate additions, I don't think I've seen that before.

It's the kind of UI experimentation I like to see people try, but I'm not sure they nailed this one. Probably onto something though. Try different diacritical symbols and see what sticks. Given how '"' looks, maybe combining above or below needs to vary by character. Above probably looks awful for '.' and ','. Really I think the strikethrough might suffice. The only way to know for sure is to take away the color high…

Using diacritics for this is extremely visually noisy and not very legible.

There has to be a better method.

Re: Graphtage: A semantic diff utility for JSON, HTML, YAML, CSV, etc

#15
post #5

Earlier quoted context omitted.

It's the kind of UI experimentation I like to see people try, but I'm not sure they nailed this one. Probably onto something though. Try different diacritical symbols and see what sticks. Given how '"' looks, maybe combining above or below needs to vary by character. Above probably looks awful for '.' and ','. Really I think the strikethrough might suffice. The only way to know for sure is to take away the color high…

Using diacritics for this is extremely visually noisy and not very legible. There has to be a better method.

Plus and minus symbols at the beginning of a colored line have worked pretty well. It is a neat trick, but it is noisy.

Re: Graphtage: A semantic diff utility for JSON, HTML, YAML, CSV, etc

#16

It's cool, but does seem quite slow. I'm diffing two 45kB CSVs on a fast computer and after 10 minutes I'm still at: Diffing: 0% ... 0/93195 [00:00

I think it’s ended up with a quadratic algorithm for diffing sequences and a quadratic log algorithm for diffing dictionaries. To understand why the sequences problem is quadratic, consider a sequence A of length m being doffed with a sequence B of length n. We want to express our diff in the minimum number of operations where an operation is removing, adding, or editing an element in the sequence. Construct a graph…

Quadratic doesn't need to equal "bad", especially in this case. Two 45 kB items is 2 billion entries. Allocating 2 billion bytes is easy enough. Iterating over 2 billion bytes is also not terrible. The GP says the process is estimated to take 150 hours, or half a million seconds, or 1.62e15 cycles... so around 1 million cycles per cell.

Re: Graphtage: A semantic diff utility for JSON, HTML, YAML, CSV, etc

#18

Anyone know of similar libraries in JavaScript? It's difficult to search for HTML diff libraries these days because all the hits are vdom like things, instead of diffing HTML text for development / testing.

Can relate. After some searching I found:

https://github.com/Teamwork/visual-dom-diff

Which is quite good and fast. Encodes HTML tags as Unicode chars, calls diff-match-path and uses diff to build a final visual output.

Re: Graphtage: A semantic diff utility for JSON, HTML, YAML, CSV, etc

#20

Cheers for making this a local tool. So many versions of this sort of tool are online-only, which is a non-starter for proprietary data.

My diff tool, diff.so, is a web app, but it doesn’t send the text to the server (unless you publish). I wish there were a technical mechanism that could guarantee and enforce that, and certify it to users.
Post reply on HN