update editor

This commit is contained in:
2025-12-06 18:45:52 +07:00
parent e1a6be0836
commit d372104760
9 changed files with 76 additions and 44 deletions
+2
View File
@@ -207,6 +207,8 @@ func (s *Services) GetGraph(ctx context.Context, req *proto.GetGraphReq) (*proto
nodes = append(nodes, &proto.GetGraphRsp_Node{
Id: node.ID,
Label: node.Label,
Name: node.Name,
Text: node.Text,
})
}
edges := make([]*proto.GetGraphRsp_Edge, 0, len(graph.Edges))
+10 -1
View File
@@ -47,6 +47,8 @@ type Graph struct {
type Node struct {
ID int32
Label string
Name string
Text string
}
type Edge struct {
@@ -108,7 +110,14 @@ func (s *StoryService) GetGraph(ctx context.Context) *Graph {
nodes := make([]*Node, 0, len(s.story.Places))
for i, place := range s.story.Places {
m[clearCode(place.Code)] = int32(i)
nodes = append(nodes, &Node{ID: int32(i), Label: place.Code})
nodes = append(
nodes, &Node{
ID: int32(i),
Label: place.Code,
Name: place.Name,
Text: place.Text,
},
)
}
edges := make([]*Edge, 0, len(s.story.Places)*3)