Skip to main content
In metz, everything is classes and methods. This works well when you think about boxes and hierarchies that you see in typical diagrams. A class represents a common behaviour with some data and methods to carry out that behaviour. And that’s what we render as boxes. Each class acts as a parent node, holding child nodes which represent methods.
We currently only support TypeScipt
docker-demo.ts
/*boundary*/
class Docker {
  
  /*data*/
  readonly shouldCrash?: boolean;
  
  /*behavior*/
  container() {
    if (this.shouldCrash) {
      return 'exiting with code 1';
    }
  }
}

Calling methods

So we have boxes but how do we get lines between them? Well, they come from function calls!
docker-demo.ts
class Docker {
  readonly shouldCrash?: boolean;
  
  container() {
    if (this.shouldCrash) {
      return 'exiting with code 1';
    }

    /* This function call will become an edge */
    this.sideCar('hello world!')
  }

  sideCar(arg: string) {
    console.log(`Logging: ${arg}`)
  }
}