oc-lib/models/resources/workflow/graph/graph.go
2024-07-18 16:46:54 +02:00

42 lines
1.8 KiB
Go

package graph
type Graph struct {
Items map[string]GraphItem `bson:"items" json:"items" default:"{}" required:"true"`
Links []GraphLink `bson:"links" json:"links" default:"{}" required:"true"`
}
type GraphItem struct {
ID string `bson:"ID" json:"ID" required:"true"`
Width float64 `bson:"width" json:"width" required:"true"`
Height float64 `bson:"height" json:"height" required:"true"`
Position Position `bson:"position" json:"position" required:"true"`
ResourceID string `bson:"resource_id" json:"resource_id" required:"true"`
}
type GraphLink struct {
Source Position `bson:"source" json:"source" required:"true"`
Destination Position `bson:"destination" json:"destination" required:"true"`
Style GraphLinkStyle `bson:"style" json:"style" required:"true"`
}
type GraphLinkStyle struct {
Color int64 `bson:"color" json:"color" required:"true"`
Stroke float64 `bson:"stroke" json:"stroke" required:"true"`
Tension float64 `bson:"tension" json:"tension"`
HeadRadius float64 `bson:"head_radius" json:"head_radius"`
DashWidth float64 `bson:"dash_width" json:"dash_width"`
DashSpace float64 `bson:"dash_space" json:"dash_space"`
EndArrow Position `bson:"end_arrow" json:"end_arrow"`
StartArrow Position `bson:"start_arrow" json:"start_arrow"`
ArrowStyle int64 `bson:"arrow_style" json:"arrow_style" required:"true"`
ArrowDirection int64 `bson:"arrow_direction" json:"arrow_direction" required:"true"`
StartArrowWidth float64 `bson:"start_arrow_style" json:"start_arrow_style"`
EndArrowWidth float64 `bson:"end_arrow_style" json:"end_arrow_style"`
}
type Position struct {
ID string `json:"ID" required:"true"`
X float64 `json:"x" required:"true"`
Y float64 `json:"y" required:"true"`
}