Added new legend positions#136
Open
kullJul wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds new right-aligned horizontal legend placements and refactors/shared orientation helpers, aligning behavior with native Power BI legend layout (including overflow handling) while fixing a centered-vertical clipping issue.
Changes:
- Added
LegendPosition.TopRight/LegendPosition.BottomRightplus matchinglegendPositionstring constants. - Exported orientation helper functions (
isRight,isBottom,isTopOrBottom,isCentered,isRightAligned, etc.) and updatedSVGLegendto use them. - Fixed centered vertical legend overflow translation by clamping the computed offset to
>= 0.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/legend/svgLegend.ts | Adds right-aligned horizontal rendering/overflow fallback and uses shared orientation helpers; fixes vertical centered overflow clipping. |
| src/legend/legendPosition.ts | Adds topRight / bottomRight string constants. |
| src/legend/legendInterfaces.ts | Extends LegendPosition enum with TopRight / BottomRight. |
| src/legend/legend.ts | Exports additional orientation helper functions and expands isTop/isBottom to include right-aligned variants. |
| package.json | Bumps package version to 8.3.0. |
| package-lock.json | Updates lockfile version metadata and transitive dependency resolution entries. |
| CHANGELOG.md | Adds 8.3.0 release notes describing the legend changes. |
| .github/workflows/release.yml | Renames the workflow (Release Build → release). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Module
legendLegendPosition.TopRightandLegendPosition.BottomRight— horizontal legend with items right-aligned to the chart area; falls back to left-aligned with a navigation arrow on overflow.legendPositionstring constantstopRightandbottomRight.isLeft,isRight,isTop,isBottom,isTopOrBottom,isCentered,isRightAligned.isTop/isBottomnow also match the new right-aligned variants.LeftCenter/RightCenter) when items overflowed (missingMath.max(0, ...)clamp).