Skip to content
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

Long Node names truncated issue resolved in WebVOWL #188

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nandikajain
Copy link
Contributor

Fixes #82
As pointed out in the issue thread, I have implemented the solution where the names are split based on the whitespace and each word is then displayed in separate lines.
The issues arises here in src/webvowl/js/util/:

CenteringTextElement.prototype.addTextline = function ( text, style, prefix, postfix ){
  var truncatedText = textTools.truncate(text, this._textBlock().datum().textWidth(), style);
AbsoluteTextElement.prototype.addTextline = function ( text, style, yShift, prefix, postfix ){
  var truncatedText = textTools.truncate(text, this._textBlock().datum().textWidth(yShift), style);

Here, the text is truncated. If we split the text based on the white spaces and then call addTextLine, the issue gets resolved.

Screenshots:
Before:
before_update

After:
after_update

@nandikajain
Copy link
Contributor Author

@vitalis-wiens @steffen-l

AbsoluteTextElement.prototype.addText = function ( text, yShift, prefix, suffix ){
if ( text ) {
this.addTextline(text, this.CSS_CLASSES.default, yShift, prefix, suffix);
AbsoluteTextElement.prototype.addText = function (text, yShift, prefix, suffix) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main changes are done there. Rest all are due to the formatter in VSCode.

@nandikajain
Copy link
Contributor Author

@vitalis-wiens The only 2 files that I changed are AbsoluteTextElement.js and CenteringTextElement.js
The package-lock.json got updated on its own, and the rest of the changes are formatting changes which add indentation and line space done by linting in vscode.

@L4B0MB4
Copy link

L4B0MB4 commented Jan 3, 2023

While this repo is more or less unactive I checked out the PR and it seems there is still something that need to be done as textoverlow now happens on nodes that are too small
image

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 node names truncated
2 participants