The highlight is drawn last - #584
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
选中/悬停时的高亮在画布上有三处对不上,都在这里收拾了。
高亮的边会被压暗的边切断
放大看,一条白边会被一条条黑细条打断。
zIndex一直在设(压暗 0、邻居 2、选中 3、指到 4、高亮的边 5),但两件事同时不成立:zIndex: true没开,sigma 默认按缓冲区顺序画;line、弧边走curved,是两批,所以一条压暗的直边照样盖在高亮的弧边上。先试过把所有边并进曲线程序,这条路走不通:
@sigma/edge-curve的包围盒宽度里有sign(curvature),曲率 0 时整个偏移为 0,四边形零面积,一个像素都不画——独一条的直边会全部消失,只剩标签飘着。内置代码分两个程序正是为了绕开它。改成同一个类注册两遍,后注册的
lineTop/curvedTop专给高亮的边用,借绘制批次的先后压在最上层。顺带修了一处真会切线的情况:boost()之后还有一道时间过滤,会把「挨着选中项、但此刻不成立」的边压回背景色——颜色暗了却还留在置顶批里,那就成了画在所有高亮边之上的一条暗线。量法:sigma 的
afterRender里gl.readPixels取边图层,沿高亮边中心线逐像素采样。节点亮着,线却没画出来
悬停 Google DeepMind,Arthur Mensch 亮着,可它那条
former_employee_of早就结束了,线被压回背景色——看着像凭空亮了一个。边那边问了「时间轴停的这一刻它还成不成立」(
liveNow/activeEdges),节点那边只用g.areNeighbors(),只问图上有没有这条边。换成isLiveNeighbor(),用同一个activeEdges,派生边关掉的情况一并算进去。按焦点节点缓存一份:这个判断每帧要对每个节点问一次,枢纽点动辄几百条边。选中之后再指别处,指到的那一个孤零零
边那边悬停是压过选中的(
boost()在最前面),节点这边没跟上:sel一旦成立就走不到悬停那一支,于是一圈亮着的边通向一圈黑着的点。指过去正是想读「它连着谁」,而那一问什么也答不出来。顺手
面板分组标题的方向箭头是 10,下面每条事实行是 12。它们是同一个记号、还特意排成一列,那 2px 只会读成没对齐。两页都统一到 12,实测两个箭头都是
x=459, 12×12。pnpm build(style-guard + tsc + vite)与pnpm test(18 passed)干净。一次完整refresh()平均 7.3ms。🤖 Generated with Claude Code