-
Notifications
You must be signed in to change notification settings - Fork 41
Fix graph view cutoff in Explorer with fixed bottom buffer #1004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: sei-vsarvepalli <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. I saw the rows to be off any 6% when the number of rows to show were somewhere close to 70 rows. The number could be greater as the number of rows increase. Can this be more dynamic? I am probably doing something wrong as I am calculating this svg_height variable..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the height calculation to be dynamic. The adjustment now scales with tree size:
- Base: 6% for ≤60 rows
- Larger trees: +0.1% per additional row (e.g., 70 rows = 7%, 100 rows = 10%)
This provides better coverage for trees with more rows. Commit: e8f4a4b
Co-authored-by: ahouseholder <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good enough as a temporary fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the decision tree graph visualization cutoff issue in the SSVC Explorer by implementing dynamic SVG height adjustment that scales based on the number of rows in the decision tree.
- Replaced fixed SVG height calculation with dynamic adjustment logic
- Added scaling formula that provides 6% base increase plus additional scaling for larger trees
- Ensured complete graph visibility without affecting existing zoom functionality
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
docs/ssvc-explorer/simple.js
Outdated
// Dynamic height adjustment based on tree size | ||
var height_adjustment = 1.06 + (raw.length > 60 ? (raw.length - 60) * 0.001 : 0) |
Copilot
AI
Oct 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The magic numbers 1.06, 60, and 0.001 should be extracted as named constants to improve code readability and maintainability. Consider defining them as BASE_HEIGHT_ADJUSTMENT = 1.06
, SCALING_THRESHOLD = 60
, and SCALING_FACTOR = 0.001
.
Copilot uses AI. Check for mistakes.
@copilot Please amend: |
Co-authored-by: sei-renae <[email protected]>
Reduced the height adjustment for full trees from 6%+ to 3% to minimize excess whitespace. Full trees already have dynamic height scaling via add_offset, so they need less additional adjustment. Commit: ccf19b8 |
@ahouseholder @sei-vsarvepalli is it in scope here for copilot to also amend:
![]() |
The CVSS v4 has a number of other issues - treat it out of scope for this one. |
@copilot |
Co-authored-by: sei-renae <[email protected]>
Reverted the percentage-based approach and replaced it with a simple fixed 60px buffer at the bottom. This prevents cutoff without stretching or distorting graphs. The fixed buffer works consistently across all tree sizes. Commit: c5cf986 |
Problem
The decision tree graph visualization in the SSVC Explorer was being cut off at the bottom, preventing users from viewing the complete tree structure. This issue was particularly noticeable on vertically oriented screens and affected the Deployer Patch Application table and other decision tree visualizations.
As shown in the screenshot above, the bottom portion of the graph was clipped, making it impossible to see all decision outcomes without using the zoom control workaround.
Root Cause
The SVG container height calculation in the
draw_graph()
function was consistently undersized, not providing enough space for leaf nodes at the bottom of the tree.Solution
Implemented a fixed buffer in
docs/ssvc-explorer/simple.js
to add consistent extra space at the bottom:This adds a fixed 60-pixel buffer at the bottom of the SVG container to accommodate leaf nodes and their labels without cutting them off. The fixed buffer approach provides:
Impact
Fixes #1003
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.