Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reports show foamtree link #5

Closed
jdalton opened this issue Nov 1, 2016 · 6 comments
Closed

Reports show foamtree link #5

jdalton opened this issue Nov 1, 2016 · 6 comments

Comments

@jdalton
Copy link

jdalton commented Nov 1, 2016

I noticed the reports show a link which looks like it could be part of the report but it's a link to the foamtree project. Not sure if this is intentional but figured I'd pass it along.

@th0r
Copy link
Collaborator

th0r commented Nov 2, 2016

Carrot Search doesn't allow to use unbranded version of FoamTree in opensource projects and I couldn't find any suitable alternative to it.

@jdalton Maybe you know some?

@jdalton
Copy link
Author

jdalton commented Nov 2, 2016

I don't know but maybe @anvaka knows some.

@th0r
Copy link
Collaborator

th0r commented Nov 7, 2016

Well, if anybody is bored by FoamTree logo in analyzer report and knows any good OSS alternative it feel free to comment here and I'll reopen it.

@th0r th0r closed this as completed Nov 7, 2016
eirikurn pushed a commit to aranja/webpack-bundle-analyzer that referenced this issue Feb 7, 2017
@simonbuchan
Copy link

If this still interests anybody, the name of this type of graph is a "Treemap" (confusingly, also occasionally used by people implementing a Map<> type with a tree structure). Googling "treemap js" comes up with several options:

etc....

And it's not too complex to implement the basics from scratch either, if none of those quite work for you:

  • Convert your tree into a binary tree, probably with Huffman (this is just keep joining the two smallest)
  • At each level, split the available area in proportion to the tree values either horizontally or vertically, preferring the one that has child aspect ratios closer to square (or golden ratio if you're into that)
  • Then all the real details, of course: visually separating both siblings and levels of hierarchy (radial gradients and colors are popular), rendering labels, tooltips, etc.

I will say the current implementation is a bit misleading in the size of leafs with how it displays paths, but that seems like it might be solvable without throwing the whole thing out.

Not going to promise anything (my attention span is pretty short!) but I'm currently interested if you know what you're after.

@valscion
Copy link
Member

@simonbuchan if you'd like to tackle this, one way of trying out a new treemap renderer could be to start off from where #97 is currently at. See #102 on an example of how I allowed the customization of the reporter for that upcoming version.

Would you be interested? I'd be curious to see a new pull request against version-3 branch for anything you could whip up — if it turns out that we wouldn't want to replace the current treemap, we could provide your treemap visualization as an alternative still. Or you could even publish such a reporter yourself.

@simonbuchan
Copy link

Neato, that should make things easier. Here's just about the worst possible implementation of a Treemap you can do in HTML (abusing the heck out of flexbox) I made just to play around with the concept: https://codepen.io/simonbuchan/pen/KZKzww?editors=0110

The performance is nightmarish as it's bouncing back and forward between layout: I think for N leafs it would run layout O(N^3) times :), and it doesn't help DOM operations are already slow.

I'll take some time later to move the layout to JS and render in SVG or whatever, which I expect to be fast enough to animate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants