VChart icon indicating copy to clipboard operation
VChart copied to clipboard

fix: update VennSeries to handle empty keys and filter valid legend keys

Open afkdsghk211331 opened this issue 7 months ago • 0 comments

[中文版模板 / Chinese template]

🤔 This is a ...

  • [X] New feature
  • [ ] Bug fix
  • [ ] TypeScript definition update
  • [ ] Bundle size optimization
  • [ ] Performance optimization
  • [ ] Enhancement feature
  • [ ] Refactoring
  • [ ] Update dependency
  • [ ] Code style optimization
  • [ ] Test Case
  • [ ] Branch merge
  • [ ] Release
  • [ ] Site / documentation update
  • [ ] Demo update
  • [ ] Workflow
  • [ ] Other (about what?)

🔗 Related issue link

#2847

🔗 Related PR link

https://github.com/VisActor/VUtil/pull/239

🐞 Bugserver case id

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • [ ] 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

🚀 Summary

This pull request refines the logic for handling selected keys in the VennSeries class to improve filtering and ensure proper handling of empty keys. The most important changes focus on enhancing the filtering process and maintaining consistency in the selected keys array.

Improvements to key filtering and handling:

  • Introduced a new emptyKey constant and added logic to check for and handle empty keys ('') in the selectedKeys array. This ensures that empty keys are preserved when appropriate.
  • Refined the filtering process by separating non-empty keys from the selectedKeys array and using only valid keys from originalLegendKeys for further operations. This avoids processing invalid or empty keys.
  • Updated the logic for removing derived keys from the selectedKeys array to operate on the filtered nonEmpty keys, improving clarity and correctness.

🔍 Walkthrough

copilot:walkthrough

afkdsghk211331 avatar May 28 '25 07:05 afkdsghk211331