This commit is contained in:
Daniel 2024-11-22 23:27:38 +08:00
parent 83b932478e
commit a48609755e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 10 additions and 8 deletions

View file

@ -845,7 +845,7 @@ func buildFullLinks(condition string) (forwardlinks, backlinks []*Block) {
func buildDefsAndRefs(condition string) (defBlocks []*Block) {
defBlockMap := map[string]*Block{}
refBlockMap := map[string]*Block{}
defRefs := sql.DefRefs(condition)
defRefs := sql.DefRefs(condition, Conf.Graph.MaxBlocks)
// 将 sql block 转为 block
for _, row := range defRefs {

View file

@ -84,10 +84,10 @@ func BuildTreeGraph(id, query string) (boxID string, nodes []*GraphNode, links [
var sqlBlocks []*sql.Block
var rootID string
if ast.NodeDocument == node.Type {
sqlBlocks = sql.GetAllChildBlocks([]string{block.ID}, stmt)
sqlBlocks = sql.GetAllChildBlocks([]string{block.ID}, stmt, Conf.Graph.MaxBlocks)
rootID = block.ID
} else {
sqlBlocks = sql.GetChildBlocks(block.ID, stmt)
sqlBlocks = sql.GetChildBlocks(block.ID, stmt, Conf.Graph.MaxBlocks)
}
blocks := fromSQLBlocks(&sqlBlocks, "", 0)
if "" != rootID {
@ -185,7 +185,7 @@ func BuildGraph(query string) (boxID string, nodes []*GraphNode, links []*GraphL
}
rootIDs = gulu.Str.RemoveDuplicatedElem(rootIDs)
sqlBlocks := sql.GetAllChildBlocks(rootIDs, stmt)
sqlBlocks := sql.GetAllChildBlocks(rootIDs, stmt, Conf.Graph.MaxBlocks)
treeBlocks := fromSQLBlocks(&sqlBlocks, "", 0)
genTreeNodes(treeBlocks, &nodes, &links, false)
blocks = append(blocks, treeBlocks...)