WebVOWL icon indicating copy to clipboard operation
WebVOWL copied to clipboard

Long Node names truncated issue resolved in WebVOWL

Open nandikajain opened this issue 3 years ago • 3 comments

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 avatar May 10 '22 14:05 nandikajain

@vitalis-wiens @steffen-l

nandikajain avatar May 10 '22 17:05 nandikajain

@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.

nandikajain avatar May 11 '22 17:05 nandikajain

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

L4B0MB4 avatar Jan 03 '23 17:01 L4B0MB4