nicoespeon / sass-graph-viz

Draw a visual graph of Sass dependencies
https://medium.com/@nicoespeon/i-built-a-tool-to-work-with-complicated-sass-codebases-b5c909e269fb
MIT License
26 stars 2 forks source link

how to eliminate the overlapping of file nodes on the tree? tried to pull aways, but bounce back to overlap #9

Closed SueCheng closed 5 years ago

SueCheng commented 5 years ago

Good work!, yet there are some overlapping of file nodes on the tree? tried to pull aways, but bounce back to overlap

nicoespeon commented 5 years ago

Hi @SueCheng 👋

Good question, I see what you mean. I've got a couple of suggestions to do so:

Let me know if you manage to get a more helpful result for you.

nicoespeon commented 5 years ago

Closing the issue. Feel free to re-open it if you need further details.

kerryj89 commented 4 years ago

Thanks @nicoespeon for this!

My company's project has hundreds of imports as it's shared across projects and also uses Bootstrap.

The default setup does not play well when wanting to keep import references across projects and libraries.

2020-06-30_23-53-29

If you follow @nicoespeon advice above and replace it with the below options I've set, you can get something a little more tidier and readable. It goes from left to right which works better for long import paths.

var options = {
  autoResize: true,
  height: '100%',
  width: '100%',
  edges: {
    arrows: 'to',
    smooth: {
      type: "cubicBezier",
      roundness: 1
    }
  },
  nodes: {
    font: {
      align: 'left'
    },
    shape: 'box'
  },
  layout: {
    hierarchical: {
      levelSeparation: 800, 
      treeSpacing: 300, 
      blockShifting: true, 
      edgeMinimization: true, 
      parentCentralization: true, 
      direction: 'LR', 
      nodeSpacing: 15, 
      sortMethod: "directed" 
    }
  }
};

2020-07-01_02-39-02

nicoespeon commented 4 years ago

That's amazing, thank you @kerryj89 for sharing ❤️