Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2024-11-04 17:08:28 +08:00
commit 358fedbbd9
6 changed files with 25 additions and 12 deletions

View file

@ -624,12 +624,12 @@ export class Graph extends Model {
damping: 0.4,
avoidOverlap: 0.5
},
maxVelocity: 50,
minVelocity: 0.1,
maxVelocity: 512,
minVelocity: 64,
solver: "forceAtlas2Based",
stabilization: {
enabled: true,
iterations: 256,
iterations: 64,
updateInterval: 64,
onlyDynamicEdges: false,
fit: false
@ -646,11 +646,11 @@ export class Graph extends Model {
const time = 256;
const intervalNodeTime = Math.max(Math.ceil(time / 8), 32);
let batch = this.graphData.nodes.length / time / 2;
if (batch < 32) {
batch = 32;
if (batch < 64) {
batch = 64;
}
if (batch > 128) {
batch = 128;
if (batch > 256) {
batch = 256;
}
let count = 0;
const intervalNode = setInterval(() => {
@ -666,7 +666,7 @@ export class Graph extends Model {
network.body.data.nodes.add(nodesAdded);
i += batch;
count++;
if (0 === count % (batch / 8)) {
if (0 === count % (batch / 128)) {
network.fit({animation: false});
}
}, intervalNodeTime);

File diff suppressed because one or more lines are too long

View file

@ -10,7 +10,7 @@ require (
github.com/88250/epub v0.0.0-20230830085737-c19055cd1f48
github.com/88250/go-humanize v0.0.0-20240424102817-4f78fac47ea7
github.com/88250/gulu v1.2.3-0.20240612035750-c9cf5f7a4d02
github.com/88250/lute v1.7.7-0.20241103012411-a8a9e2f09aa7
github.com/88250/lute v1.7.7-0.20241104041903-6639d831bb56
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ClarkThan/ahocorasick v0.0.0-20231011042242-30d1ef1347f4

View file

@ -14,8 +14,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950 h1:Pa5hMiBceT
github.com/88250/go-sqlite3 v1.14.13-0.20231214121541-e7f54c482950/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/88250/gulu v1.2.3-0.20240612035750-c9cf5f7a4d02 h1:3e5+yobj655pTeKOYMbJrnc1mE51ZkbXIxquTYZuYCY=
github.com/88250/gulu v1.2.3-0.20240612035750-c9cf5f7a4d02/go.mod h1:MUfzyfmbPrRDZLqxc7aPrVYveatTHRfoUa5TynPS0i8=
github.com/88250/lute v1.7.7-0.20241103012411-a8a9e2f09aa7 h1:RYL3C4DRTBZpa2JVCTcekFJ/+ECil5eAVTt3Np1msa8=
github.com/88250/lute v1.7.7-0.20241103012411-a8a9e2f09aa7/go.mod h1:VDAzL8b+oCh+e3NAlmwwLzC53ten0rZlS8NboB7ljtk=
github.com/88250/lute v1.7.7-0.20241104041903-6639d831bb56 h1:AbOT5NYZZwsREshKGfj5/cTOn82aMqe42eXuH6mLrMk=
github.com/88250/lute v1.7.7-0.20241104041903-6639d831bb56/go.mod h1:VDAzL8b+oCh+e3NAlmwwLzC53ten0rZlS8NboB7ljtk=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c h1:Dl/8S9iLyPMTElnWIBxmjaLiWrkI5P4a21ivwAn5pU0=
github.com/88250/pdfcpu v0.3.14-0.20230401044135-c7369a99720c/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=

View file

@ -109,6 +109,7 @@ func GetBackmentionDoc(defID, refTreeID, keyword string, containChildren bool) (
if 0 < len(trees) {
sortBacklinks(ret, refTree)
filterBlockPaths(ret)
}
return
}
@ -151,6 +152,7 @@ func GetBacklinkDoc(defID, refTreeID, keyword string, containChildren bool) (ret
}
sortBacklinks(ret, refTree)
filterBlockPaths(ret)
for i := len(ret) - 1; 0 < i; i-- {
curPaths := ret[i].BlockPaths
@ -163,6 +165,16 @@ func GetBacklinkDoc(defID, refTreeID, keyword string, containChildren bool) (ret
return
}
func filterBlockPaths(blockLinks []*Backlink) {
for _, b := range blockLinks {
if 1 == len(b.BlockPaths) && "NodeDocument" == b.BlockPaths[0].Type {
// 如果只有根文档这一层则不显示
b.BlockPaths = []*BlockPath{}
}
}
return
}
func blockPathsEqual(paths1, paths2 []*BlockPath) bool {
if len(paths1) != len(paths2) {
return false

View file

@ -1098,6 +1098,7 @@ func processPDFWatermark(pdfCtx *pdfcpu.Context, watermark bool) {
if err != nil {
logging.LogErrorf("parse watermark failed: %s", err)
util.PushErrMsg(err.Error(), 7000)
return
}