dagre-d3 icon indicating copy to clipboard operation
dagre-d3 copied to clipboard

Filter nodes

Open bsideup opened this issue 8 years ago • 5 comments

Hi!

Is it possible to filter out some nodes? i.e. I want to make them a part of the graph, but I don't want nodesep to be applied to them and I also want to make them invisible.

Thanks!

bsideup avatar Mar 08 '16 21:03 bsideup

Better to filter with d3.filter method.

kdh6429 avatar Apr 07 '16 04:04 kdh6429

nope. It will create missing connections.

But I want:

a -> b -> c

filter B

a -> c

bsideup avatar Apr 07 '16 06:04 bsideup

You need to re-process your data yourself. It's supported in dagre-d3.

kdh6429 avatar Apr 07 '16 06:04 kdh6429

I can do a lot myself :) But, if we talk about a library, I expect some handy stuff to be built-in, this is why I raised this issue :)

bsideup avatar Apr 07 '16 06:04 bsideup

@bsideup Apparently there is a un documented filterNodes function inside dagre: https://github.com/dagrejs/graphlib/issues/107

Created a pull request to add types for it: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/54433

sand4rt avatar Jul 11 '21 12:07 sand4rt