Repository navigation
feat(vseed): 支持按坐标范围绘制区域标注 - #543
Merged
Merged
Conversation
Why: - Let charts mark numeric risk zones even when no data point falls inside them. - Keep selector bands and range annotations mutually exclusive and explicit. What: - Add validated range bounds and axis-aware clipped geometry for supported Cartesian charts. - Cover Builder validation, rendering, generated option docs, and runnable examples. - Fix generated preview fence whitespace and retain stable coverage floors.
Record the VSeed range-annotation feature as a patch Changeset so the fixed VSeed, VBI, and VQuery release group can advance together.
youngwinds
reviewed
Sep 24, 2026
| const issues = validation.error.issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`).join('; ') | ||
| throw new Error(`${path}.range: ${issues}`) | ||
| } | ||
| if (!rangeChartTypes.has(vseed.chartType)) { |
Collaborator
There was a problem hiding this comment.
建议pipe解除图表类型依赖, 最小功能pipe, 在各个图表类型中组装;
每个pipeline已经确定图表类型了, 应该避免在pipe内根据图表类型做不同的逻辑;
Contributor
Author
There was a problem hiding this comment.
已按建议调整:通用 annotation pipe 现在只提取并校验配置,不再维护图表类型白名单或按图表类型分支。各图表的 advanced pipeline 显式组合 range 限制;支持 range 的图表仅在透视分支拒绝,不支持的图表明确拒绝。原有校验与相关测试保持通过。改动见 1aebb23ed8;随后合并了最新 main,PR 冲突已清除。
Why: - Newer VChart exposes getBandwidth on linear axes but returns undefined, producing invalid area positions. What: - Treat only finite bandwidth values as categorical-axis evidence. - Cover the horizontal bar regression and raise the unit branch coverage floor.
Why: - The shared annotation pipe depended on a chart-type allowlist, so adding a chart could silently miss range support. What: - Keep annotation parsing independent of chart type. - Compose unsupported-chart and pivot guards at the relevant chart pipelines, preserving existing validation behavior.
Why: - Resolve the PR's drift from main after addressing review feedback. What: - Preserve main's docs and coverage updates while regenerating the combined feature examples. - Raise VSeed coverage floors to the verified post-merge results.
Why: - Keep unsupported charts fail-closed without repeating range guards in every pipeline. What: - Select annotationWithRange only in supported chart pipelines and retain pivot-specific errors. - Add mixed-annotation regressions and raise VSeed coverage thresholds to verified floors.
Why: - Four-quadrant regions need labels anchored at their own centers without alignment workarounds. What: - Expose middle in annotationArea types, validation, and both spec pipelines. - Add a four-quadrant scatter example and rendered label-position regressions.
youngwinds
approved these changes
Oct 9, 2026
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.
🤔 这个分支是...
🔗 相关 issue 链接
暂无。
🔗 相关的 PR 链接
无。
🐞 Bugserver 用例 id
不适用。
💡 问题的背景&解决方案
现有
annotationArea.selector依赖已选中的数据点,无法准确表达“y > 10 是高危险区域”或散点图中没有数据点的矩形区域。本 PR 新增与selector互斥的range模式,使用线性数值轴的坐标上下界绘制区域:range.x、range.y至少填写一项;每项必须同时提供min/max,可用导出的AxisBoundaryEnum.Min/Max指向当前轴边界。未填写的轴铺满绘图区。selector色带行为,并在类型、Schema 和 Builder 路径校验两种模式的互斥及必填约束。验证
main后,@visactor/vseed完整测试与覆盖率、单测覆盖率、类型检查及构建通过;完整覆盖率:语句/行 91.43%,分支 82.46%,函数 84.83%;单测覆盖率:语句/行 84.53%,分支 77.53%,函数 82.85%。/VBI/vseed/examples/features/annotationArea.html。本轮合并后浏览器工具因本地 URL 安全策略拒绝访问,未重新完成可视验收。发布计划
@visactor/vseed的 patch Changeset。pnpm changeset status确认固定版本组中的 VSeed、VBI、VQuery 都规划为 patch;合并main后当前版本为0.6.4,预计下一个 patch 版本为0.6.5(以版本 PR 为准)。此 PR 不直接修改包版本,也不执行发布。☑️ 自测