bafolts / tplant

Typescript to plantuml
https://segmentationfaults.com/tplant/default.html
GNU General Public License v3.0
266 stars 34 forks source link

Target class #74

Closed loopingz closed 3 years ago

loopingz commented 3 years ago

Added a --targetClass to select only the class hierarchy

For example, a full diagram like

classDiagram
IVehicle <|.. Vehicle
class Vehicle {
    +color: string
    +start(type: string): string
}
class IVehicle {
    +start(type: string): string
}
<<Interface>> IVehicle
Vehicle <|-- Car
class Car {
    +start(): string
}
class ITrunk {
    +openTrunk(): void
}
<<Interface>> ITrunk
class IWindow {
    +openWindow(): void
}
<<Interface>> IWindow
Car <|-- Sedan
ITrunk <|.. Sedan
IWindow <|.. Sedan
class Sedan {
    +start(): string
    +openTrunk(): void
    +openWindow(): void
}
Vehicle <|-- Truck
class Truck {
    +start(): string
}

If launched with --targetClass Vehicle the result will be stripped to

classDiagram
IVehicle <|.. Vehicle
class Vehicle:::targetClassDiagram {
    +color: string
    +start(type: string): string
}
class IVehicle {
    +start(type: string): string
}
<<Interface>> IVehicle
Vehicle <|-- Car
class Car {
    +start(): string
}
Car <|-- Sedan
class Sedan {
    +start(): string
    +openTrunk(): void
    +openWindow(): void
}
Vehicle <|-- Truck
class Truck {
    +start(): string
}
loopingz commented 3 years ago

No worries at all, thanks for the merge