Skip to content

feat(vseed): 支持静态图例与饼环图样式,保持既有默认行为 - #554

Merged
youngwinds merged 2 commits into
mainfrom
codex/vseed-pie-presentation
Sep 29, 2026
Merged

youngwinds merged 2 commits into
mainfrom
codex/vseed-pie-presentation

Conversation

@youngwinds

Copy link
Copy Markdown
Collaborator

🤔 This is a ...

  • New feature
  • TypeScript definition update
  • Test Case
  • Site / documentation update
  • Demo update
  • Workflow

💡 Background and solution

轻量 dashboard 的静态图例、饼环图几何与样式、固定中心文本此前依赖调用方覆盖 VChart spec。本次将这些能力下沉到 VSeed DSL 和主题,通过独立 pipe 组合,dashboard 直接使用公开配置。

  • legend.interactive: false 关闭图例交互;原有标记尺寸、间距、最大宽度、padding 和默认筛选行为保持不变。
  • 饼图/环图支持内外半径、起止角度及 pieStyle。默认继续悬停放大,边框沿用 ≤30 条数据时 1px、>30 条时隐藏的规则;未配置角度时继续由 VChart 及其主题决定。
  • centerText.titleText/subTitleText 提供固定中心内容,字号、字重、间距等由主题提供默认值;不配置内容时不显示。
  • 普通图和透视图复用相同的原子 pipe;race 主题 schema 保留原有字段与校验规则,仅扩展新字段。

示例:在现有环图 DSL 中增加以下配置即可,无需覆盖 VChart spec:

{
  legend: { interactive: false },
  pieStyle: { pieBorderWidth: 0, pieHoverEffect: 'opacity' },
  centerText: { titleText: '62%', subTitleText: '消费者' },
}

更新配套配置文档、示例、patch changeset 与覆盖率门槛;同时整理开发规范,统一能力归属、原子 pipeline、兼容性与覆盖率要求。

Validation

  • pnpm --filter @visactor/vseed run g:通过。
  • VSeed 完整测试及覆盖率:1415 项通过;单测及覆盖率:606 项通过。
  • website 完整测试及覆盖率:3 项通过。
  • 根目录 lint:check、typecheck:通过;提交钩子的格式与 lint 检查通过。
  • 对比 main 62f73ac10f:205 个已有示例分别使用 light/dark 主题,另加 96 个普通/透视、稠密数据和旧主题场景,共 506 组输出 spec 一致。
  • 浏览器验收:既有普通/透视环图的图例筛选和悬停放大、race 环图播放与切换年份正常;静态图例、显式透明度悬停、固定中心文本正常。无观察到的控制台错误或资源加载失败日志。
单测覆盖率 修改前基线 修改后
Statements 82.52% 82.57%
Branches 76.66% 77.10%
Functions 81.35% 81.73%
Lines 82.52% 82.57%

全量覆盖率 S/B/F/L:90.98% / 82.17% / 84.52% / 90.98%。未降低门槛或调整统计范围,未更新测试快照。

☑️ Self-Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@youngwinds
youngwinds merged commit 050ce19 into main Sep 29, 2026
4 of 5 checks passed
@youngwinds
youngwinds deleted the codex/vseed-pie-presentation branch September 29, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant