Skip to content

test: lock boxPlot outliers after updateDataSync from empty data - #4695

Merged
xile611 merged 3 commits into
VisActor:developfrom
dyk1454683243-sudo:cursor/fix-boxplot-outliers-updatedatasync-4270-b8e8
Oct 14, 2026
Merged

xile611 merged 3 commits into
VisActor:developfrom
dyk1454683243-sudo:cursor/fix-boxplot-outliers-updatedatasync-4270-b8e8

Conversation

@dyk1454683243-sudo

@dyk1454683243-sudo dyk1454683243-sudo commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Regression lock for #4270 (not a production fix).

Investigation showed develop already handles this: BoxPlotChartSpecTransformer adds outliersField to the value-axis fields even with empty initial data, so the domain covers outliers and viewDataUpdate() refreshes the outlier marks. The earlier statistic fallback was unnecessary and has been removed; getStatisticFields() matches develop.

This PR now only adds tests via the public API (new VChart(spec) + updateDataSync) covering vertical/horizontal layouts, out-of-box outliers, and clear-then-refill. Change file type: none.

…ataSync

Register array-min/array-max for outliersField even when empty initial data omits that key, so updateDataSync can render outlier points.

Co-authored-by: David <dyk1454683243-sudo@users.noreply.github.com>
Add the issue-shaped VChart render cases and keep the node-runner unit coverage for empty-init updateData plus foldOutlierData.

Co-authored-by: David <dyk1454683243-sudo@users.noreply.github.com>

@xile611 xile611 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dyk1454683243-sudo 已完成 review,目前建议先补充真实回归证据,再以修复 #4270 合并。

对比基线 c4191139a340f18f0e32dcb353c51009d88a6205 和本 PR 的 5227b8caababa2f6ef1f8d224bceb053ad27a159,直接使用 #4270 的 spec(初始 data: [{ id: 'boxPlot' }],renderSync 后 updateDataSync),浏览器中两者都能正确显示三个离群点,离群值统计均为 min=12.01、max=14.03,轴域均为 [0, 15]。因此当前基线已无法复现 issue,尚未证明本次统计字段兜底是必要修复。

验证情况:

  • 本地补充的真实 VChart 场景:纵向、横向、清空后再次填充,基线和 PR 均通过。
  • 合并运行上述用例和 PR 新增测试,PR 为 11 passed / 2 skipped(node 环境跳过两个 DOM 渲染用例,另做了实际浏览器验证);仅撤回生产代码改动后为 9 passed / 2 failed / 2 skipped。失败的两个用例分别手动移除了内部字段和清空 axis helpers,不能证明 issue 的公共 API 路径存在该问题。
  • 修改文件的 ESLint、Prettier 检查通过;未发现新增渲染回归。

请补充一个通过有效 spec / 公共 API 能在基线失败、在本 PR 通过的回归用例,并据此定位根因。如果找不到该场景,建议移除缺乏复现依据的生产代码兜底,保留有效的回归测试,并调整 PR 的修复声明。具体测试问题见行内意见。

Comment thread packages/vchart/__tests__/unit/series/box-plot-outliers.test.ts Outdated
VisActor#4270's public spec already renders outliers on develop. The chart
transformer places outliersField on the value axis, and viewDataUpdate
refreshes the folded marks. Pushing a statistic when that field is
absent does not change the axis domain or outlier graphics.

Remove that fallback and the tests that stripped _fieldY or axis
helpers. Keep VChart regressions for empty-init updateDataSync,
outliers outside the box range, horizontal layout, and clear-then-refill.

Co-authored-by: David <dyk1454683243-sudo@users.noreply.github.com>
@dyk1454683243-sudo dyk1454683243-sudo changed the title fix: render boxPlot outliers after updateDataSync from empty data test: lock boxPlot outliers after updateDataSync from empty data Oct 13, 2026
@dyk1454683243-sudo

Copy link
Copy Markdown
Contributor Author

@xile611 Thanks for the review. You were right: the statistic fallback wasn't needed, since develop already includes outliersField in the axis fields. I removed it and restored getStatisticFields(), so this PR is now test-only (public VChart + updateDataSync regression tests for #4270). Title/body updated accordingly. Could you take another look?

@xile611
xile611 merged commit b575ab8 into VisActor:develop Oct 14, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants