Live data from Hacker News

Graphviz in the browser

mdaines.github.io

11–20 of 74 posts

Re: Graphviz in the browser

#11

This is very cool. I love graphs, they're really expressive. P.S. if you're interested, just the other day I posted a related experiment of mine on Show HN ... https://news.ycombinator.com/item?id=13308150

This may be a tangent, but I feel like pointing out that I, for one, have recently become more aware of the fact that a graph is really just a binary relation.

This is not discussed much in all the talk about social networks. It's always the graph (the "one") that's foregrounded, rather than the multiplicity of edges, each a relation.

I know this is mathematically an obvious thing, but surely the relational perspective is more amenable to generalization. We should make more of it.

Re: Graphviz in the browser

#12
post #4

Seems much like this: http://cpettitt.github.io/project/dagre-d3/latest/demo/inter... what are the differences?

So far it seems like dagre-d3 is the best option for those that want directed graphs to be automatically redrawn (with transitions) based off of user input. I'm continually looking for better options, though.

viz.js is Graphviz recompiled to javascript with Emscripten. Dagre is the dot algorithm implemented in JS. I found dagre to work really well in most cases but Graphviz beats dagre in some edge cases (e.g. not order dependent, better with hierarchies, ...).

Re: Graphviz in the browser

#13
post #3

Nice work! I needed to use something to render directed graph in the browser and the biggest problem was the download size. This library is 851KB gzip, which is way better than the 1.3MB I was using. Maybe being able to bundle the engines (and output format) as separate modules could reduce its size? So once again, great work!

WebAssembly would help reduce the size.

Re: Graphviz in the browser

#17
post #11

This is very cool. I love graphs, they're really expressive. P.S. if you're interested, just the other day I posted a related experiment of mine on Show HN ... https://news.ycombinator.com/item?id=13308150

This may be a tangent, but I feel like pointing out that I, for one, have recently become more aware of the fact that a graph is really just a binary relation. This is not discussed much in all the talk about social networks. It's always the graph (the "one") that's foregrounded, rather than the multiplicity of edges, each a relation. I know this is mathematically an obvious thing, but surely the relational perspecti…

Mostly, if you cant have multiple edges, that is true.

If you can't represent some well in a graph because it's too messy, you could try using an adjacency matrix, along with a clustering algorithm to figure out how to order the columns / rows.

Re: Graphviz in the browser

#19
post #11

This is very cool. I love graphs, they're really expressive. P.S. if you're interested, just the other day I posted a related experiment of mine on Show HN ... https://news.ycombinator.com/item?id=13308150

This may be a tangent, but I feel like pointing out that I, for one, have recently become more aware of the fact that a graph is really just a binary relation. This is not discussed much in all the talk about social networks. It's always the graph (the "one") that's foregrounded, rather than the multiplicity of edges, each a relation. I know this is mathematically an obvious thing, but surely the relational perspecti…

If you're thinking of weighted, directed graphs, a binary relation doesn't quite fully represent it. In the weighted directed case, a graph is a function from Nodes × NodesWeights, (where Weights ⊆ ℤ or Weights ⊆ ℝ or something like that)...

Which makes weighted graphs perfect for representation by matrices!

Studying adjacency matrix of weighted, directed graphs gave me a profound realization matrices are a table of relationships between their "dimensions". I never looked at matrices the same way again. I realized that the identity column was literally the entries that represented a relationship between a dimension/node and itself. I went down many rabbit holes... particularly the question of graph isomorphism. That problem is a rabbit hole. Another rabbit hole is the Hamiltonian cycle problem.

P.S. check out hypergraphs, which are not necessarily binary relations and generalize graphs. Incidentally, hypergraphs have an adjacency tensor. I've started to understand that tensors are like 'tables' of relationships between dimensions + dimensions representing some or all of their possible combinations.

By the way, if you can figure out a way to do fast multiplication of matrices over degree-truncated polynomial rings, I'll show you a fast way to count the number of hamiltonian cycles in a graph. These problems are intricately linked.

Post reply on HN