Changed data labels rendering and offset calculation#257
Merged
Demonkratiy merged 5 commits intomicrosoft:mainfrom Dec 23, 2025
Merged
Changed data labels rendering and offset calculation#257Demonkratiy merged 5 commits intomicrosoft:mainfrom
Demonkratiy merged 5 commits intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the data labels rendering system in the StreamGraph visual by replacing the legacy PowerBI data label utilities with a custom implementation. The changes add a new label overlap handling feature with three modes (Standard, Hide Overlap, Offset Overlap), improve label positioning logic, and update several dependencies.
Key Changes:
- Replaced dataLabelUtils with custom label rendering logic that provides better control over label positioning and overlap detection
- Added new label overlap handling setting with three modes to manage overlapping labels
- Refactored localization to use ILocalizedItemMember interface for automatic localization support
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| test/visualTest.ts | Added comprehensive test coverage for the three overlap handling modes and enum value formats |
| test/visualBuilder.ts | Updated data labels selector to match new DOM structure (.data-labels-container) |
| stringResources/en-US/resources.resjson | Added localization keys for new overlap handling options and reorganized file alphabetically |
| src/visual.ts | Major refactoring: removed dataLabelUtils dependency, implemented custom label rendering with overlap detection algorithms, added style caching for performance |
| src/utils.ts | Added LabelOverlapHandling enum to define the three overlap handling modes |
| src/streamGraphSettingsModel.ts | Refactored to use ILocalizedItemMember for automatic localization, removed manual setLocalizedOptions method, added overlapHandling setting |
| src/dataInterfaces.ts | Added LabelStyleProperties and LabelDataItem interfaces to support new label rendering architecture |
| src/behavior.ts | Enhanced renderSelection to update label opacity based on highlight states, optimized with pre-calculated highlight states |
| package.json & package-lock.json | Updated powerbi-visuals-utils-formattingutils (6.0.3→6.1.2) and powerbi-visuals-utils-formattingmodel (6.0.1→6.2.2) dependencies |
| capabilities.json | Fixed displayNameKey references and added overlapHandling enumeration property |
| CHANGELOG.md | Documented new features and fixes for version 3.2.0.0 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Demonkratiy
approved these changes
Dec 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.