3rd / tsdiagram

Create diagrams and plan your code with TypeScript.
https://tsdiagram.com
GNU General Public License v3.0
429 stars 16 forks source link

Suggestion: Visualize `extends` #5

Closed jhoermann closed 11 months ago

jhoermann commented 11 months ago

Lets say we have these interfaces:

interface User {
    id: string
    name: string
}

interface ExtendedUser extends User {
    address: string
}

It will result in: 2023-12-12_13-45

I'm not quite sure what the optimal visualization would be. Maybe list the original properties too or somehow reference the extended interface. At least there should be a connection.

3rd commented 11 months ago

Added support, ideally we'd have a port for each extended/implemented model, and the parser can support that now, but I'm not sure how to make it not ugly. Thank you for the issue!

How it works now:

diagram (3)

3rd commented 11 months ago

Didn't implement edges for the case where generics are used, see H and G here: https://tsdiagram.com/#/N4IgJg9gxgrgtgUwHYBcDOIBcBtUBLMLcBAMwEMYAbFEAGhBTxUoSIBFSLq6Q0IYATlFaYQeVAgHlhAAgCCM4AB0kMtTJIQImGWhQDxAcwDcKgL4rxKSdITzFK9TMQDDCMDr0GkJ85YlSZLIAQg6q6gBGZAI6cqZIFkj+1oGyAMJhTmQ6AEoIUBACYAA8Xka08gB88U4ROgCyZAAOxcEVZT6VfkhWNkF2bJnq2fLYALrxicl9sgCiMggAHtZIYGj2yuFqUTG6+kaT06l2AGILy8hr8hWhm7VkAF6e+z6HST0BtjIA4sUAKhUAKqVIZqLw6P41dRIeA6QFvXrHGQACX+5xWVw6hiBMgAvDIYXAIpIQUsMetfgCZMDQTJrHpnt5fAkQGYxvRYAIBMgUGxoPAeQBJQiiMCcKg0MxAA

But will do it soon.

jhoermann commented 11 months ago

@3rd Wow that was fast! Great improvement. Your tool is super helpful for team communication!