dice-group / deer

RDF Dataset Enrichment Framework
https://dice-group.github.io/deer/
GNU Affero General Public License v3.0
10 stars 7 forks source link

Fix cosmetic issues #13

Closed kvndrsslr closed 3 years ago

kvndrsslr commented 3 years ago

Rendered nodes look scrambled up - find a clean way to display them Also please have a look at general CSS / looks.

pskLana commented 3 years ago

I looked at the issue with overlapped symbols and it turned out that the problem is in the library 'litegraph.js' itself, because even their demo has this problem. image

First of all, all styles inside canvas based on Canvas2D rendering context and it does nothing with CSS. The whole library based on drawing these inputs and forms on canvas, like with a pen, so it is impossible just to change the length or style of fields by using CSS.

After looking at the library code, I found the place where the title string is always undefined. They call the function to count the width of the title, but it always returns 0 when it is undefined. image

I have no idea what is wrong with their library, but what we can do:

What do you think? @kvndrsslr, let me know, please.

kvndrsslr commented 3 years ago

Hey @pskLana thanks for the report!

Would you be able to change the rendering code in the library such that inside the nodes we show a static description, i.e. some text that describes the purpose of the node, instead of all the inputs?

If so, we could do that in our own fork of the library first and then eventually try to get a PR upstream.

Otherwise, if this is not possible or you feel that would be too much work we can also just get rid of all the inputs in the rendered view as you suggested.

pskLana commented 3 years ago

Would you be able to change the rendering code in the library such that inside the nodes we show a static description, i.e. some text that describes the purpose of the node, instead of all the inputs? -> @kvndrsslr, yes, it is possible, even without changing the code in the library, there is a callback function that allows us to change the content of the node (like now the content consists of Widgets that are part of the library, I can remove them and write text instead of them). We can easily write text because it is supported by canvas. It can look as follows: image

kvndrsslr commented 3 years ago

Thats very, very nice. The content of this description will be provided by the backend in the future!

PS: Is it also possible to use links in there? 🤔

pskLana commented 3 years ago

Canvas doesn't give an opportunity to add links there. The only way to add them is to calculate their position manually and other parameters like height and width and add the eventListener for mousedown.

pskLana commented 3 years ago

The sample of the node looks as follows: image

kvndrsslr commented 3 years ago

Please make the canvas auto-resize with the browser window.

kvndrsslr commented 3 years ago

From what I saw today the demo looks fine. I'll reopen if something comes up once we have the demo tested.