How to use the graphlib.alg.components function in graphlib

To help you get started, we’ve selected a few graphlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yitzchak / dicy / packages / core / src / State.ts View on Github external
get components (): Rule[][] {
    if (!this.graphProperties.components) {
      this.graphProperties.components = alg.components(this.graph)
        .map(component => component.map(id => this.rules.get(id)).filter(rule => rule) as Rule[])
        .filter(component => component.length > 0)
    }

    return this.graphProperties.components
  }