Skip to content

Conversation

@sei-vsarvepalli
Copy link
Contributor

A small update to try to fix any text that is too long for display inside a SVG. It is quite simple first step to avoid SVG Graph looking too crowded.

This pull request enhances the visualization in docs/ssvc-explorer/simple.js by improving how node labels are displayed and ensuring class names are generated safely. The changes focus on truncating long node names for better readability and sanitizing class names to avoid issues with invalid characters.

Improvements to node label display:

  • Added a truncateEllipsis function to shorten node names longer than 25 characters, appending an ellipsis for clarity. This function is now used wherever node names are displayed, improving readability in the graph. [1] [2] [3]
  • Node labels now include a data-fullname attribute containing the full, untruncated name, allowing access to the complete value if needed (e.g., for tooltips or accessibility). [1] [2]

Class name sanitization:

  • Updated the logic for generating class names from node names to ensure they start with a letter and contain only safe characters, preventing potential CSS or JavaScript issues.

Copilot AI review requested due to automatic review settings October 28, 2025 20:42
Copy link
Contributor

Copilot AI left a 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 adds text truncation functionality to prevent long node and path labels from causing layout issues in the SSVC decision tree visualization. The changes introduce ellipsis truncation for text exceeding 25 characters and add CSS class sanitization to prevent invalid class names.

  • Added truncateEllipsis function to truncate long text with ellipsis
  • Implemented CSS class name sanitization using regex replacements
  • Added data-fullname attributes to preserve original text for tooltips/interactions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sei-vsarvepalli sei-vsarvepalli marked this pull request as draft October 29, 2025 16:12
@sei-vsarvepalli
Copy link
Contributor Author

There are these two screenshots that show before and after the patch.
After patch
After-Patch

--- Before Patch ---

Before-Patch

@sei-vsarvepalli sei-vsarvepalli marked this pull request as ready for review October 29, 2025 16:45
@ahouseholder ahouseholder changed the title updates also to truncate long fields Truncate long labels in decision table visualization Oct 30, 2025
@ahouseholder ahouseholder merged commit 073f634 into main Oct 30, 2025
4 checks passed
@ahouseholder ahouseholder deleted the add-ellipsis branch October 30, 2025 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Long words in Graph view of the Decision Tree could use ellipsis and mouse over features in SVG

4 participants