VChart
VChart copied to clipboard
fix: update VennSeries to handle empty keys and filter valid legend keys
🤔 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
emptyKeyconstant and added logic to check for and handle empty keys ('') in theselectedKeysarray. This ensures that empty keys are preserved when appropriate. - Refined the filtering process by separating non-empty keys from the
selectedKeysarray and using only valid keys fromoriginalLegendKeysfor further operations. This avoids processing invalid or empty keys. - Updated the logic for removing derived keys from the
selectedKeysarray to operate on the filterednonEmptykeys, improving clarity and correctness.
🔍 Walkthrough
copilot:walkthrough