Skip to content

docs: fix storyline previews and isolate demo scrolling - #4716

Merged
xile611 merged 2 commits into
developfrom
codex/fix-storyline-demo-covers
Oct 19, 2026
Merged

xile611 merged 2 commits into
developfrom
codex/fix-storyline-demo-covers

Conversation

@skie1997

@skie1997 skie1997 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

五个叙事图示例缺少 frontmatter cover,导致站点示例图库回退到默认堆叠柱状图。同时,示例直接修改站点复用容器的样式,会影响切换后其他图表的布局;长画布需要在当前示例内部滚动查看。

本 PR 为 landscape、portrait、clock、arc、wing 增加真实图表 PNG 封面,并在中英文示例中补齐 /vchart/preview/storyline-*.png 引用,继续沿用现有 menu.json 构建流程。

五种布局的中英文 demo 同步调整:

  • 使用固定尺寸画布:横向、时钟、弧形为 1200 × 675,纵向、翼形为 675 × 1200。
  • 在当前 demo 内创建独立的滚动容器,设置 overflow: auto,不修改站点复用容器的样式。
  • 使用站点的 window.customRelease 钩子删除自身 DOM;清理可重复调用,旧回调不会删除新 demo 的清理钩子。
  • 用 Object.assign 替换对象展开语法,兼容站点当前的 Bublé 编译配置。

验证

  • 10 个中英文 demo 均通过与站点一致的 Bublé 配置编译。
  • 使用 Chrome、VChart 2.2.0 和本分支叙事图源码验证全部 10 个 demo:真实图表渲染、横纵滚动、外层样式保持不变、重复运行、重复清理、旧清理回调以及切换普通柱状图后无滚动溢出,全部通过。此轮布局与生命周期检查使用图片占位资源,不替代真实图片视觉回归。
  • 封面生成时使用真实外部图片,五种布局均无 pageerror;人工检查五张 PNG,确认中英文 cover 引用均指向存在的文件。
  • Prettier 格式化完成,git diff --check 通过。
  • 已按 AGENTS.md 尝试 Node.js 22 下的全量 node packages/vchart/scripts/visual-test.mjs(264 个用例)。预检因新检出仓库未安装 Rush 依赖、tools/bundler 找不到 typescript 而退出,未执行全量基线比较,不能视为通过。

站点同步说明

时序分析的三张 sequence-analysis-*.png 已存在于本仓库,Markdown 引用也正确。其空白封面涉及 chartspace-site 构建脚本中的 docs/public/VChart 与实际小写目录 docs/public/vchart 不一致,需要在站点仓库同步修复。本 PR 不重复添加已有时序分析图片。

Changelog

Language Changelog
中文 补齐五个叙事图示例的中英文封面,为 demo 添加独立滚动区域与清理逻辑,并兼容站点编译器。
English Add storyline preview covers, isolate scrolling and cleanup in all five bilingual demos, and support the site's compiler.

@github-actions github-actions Bot added the docs label Oct 19, 2026
@skie1997 skie1997 changed the title docs: fix missing covers for storyline demos docs: fix storyline previews and isolate demo scrolling Oct 19, 2026
@xile611
xile611 merged commit 72e4ae6 into develop Oct 19, 2026
11 of 13 checks passed
@xile611
xile611 deleted the codex/fix-storyline-demo-covers branch October 19, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants