VisualDataWeb / WebVOWL

Visualizing ontologies on the Web
http://vowl.visualdataweb.org/webvowl.html
MIT License
718 stars 211 forks source link

Long Node names truncated issue resolved in WebVOWL #188

Open nandikajain opened 2 years ago

nandikajain commented 2 years ago

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 commented 2 years ago

@vitalis-wiens @steffen-l

nandikajain commented 2 years ago

@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 commented 1 year ago

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