ogobrecht / d3-force-apex-plugin

Oracle APEX Region Type Plugin: D3 Force Network Chart
https://ogobrecht.github.io/d3-force-apex-plugin
MIT License
24 stars 9 forks source link

Is there a way to put labels on links? #36

Closed Ignacius68 closed 5 years ago

Ignacius68 commented 5 years ago

I've been hoping to find a way to add labels to the links, intended to be very short, but so far I have come up with nothing workable. What I'm hoping for is similar to Visio, where a short label is placed in the middle of the link line.

Is there a way to do this that I may be missing?

I have used the infostring attribute for links, but that displays where I've configured the tooltip display, which is top left. For these short link labels, that's both difficult to place the mouse accurately, and they are so short, it becomes difficult to notice and read.

Appreciate any info!

As usual, my appreciation for the great plugin!

ogobrecht commented 5 years ago

Hi Ignacius,

as mentioned in the other (already closed) issue, let me see what I can do for you regarding link labels and the centering problem on hidden graphs. You will hear from me the next days.

Best regards Ottmar

ogobrecht commented 5 years ago

Hi Ignacius,

sorry, the last weekend was very fast for me and full with other things. I need some more days and will come back to you.

Best regards Ottmar

Ignacius68 commented 5 years ago

Not a giant hurry on this, in fact taking your time would be preferred. :) It would be useful to know if it's feasible or not, though.

With that, while you're looking at the links, is it possible to adjust the weights of the lines, so they are more easily clickable? Or possibly make the labels clickable as part of the "link" object? I'm having a little bit of an accessibility challenge in being able to click on the links themselves and fire the link click event.

Much appreciated!

ogobrecht commented 5 years ago

Hi Ignacius,

yesterday evening I was able to implement the labels on links - it is working. Next step is now to check, how to enable also the link clicks on the labels. You will hear from me.

Best regards Ottmar

ogobrecht commented 5 years ago

Hi Ignacius,

please download the plugin from the v3.1 branch and test it. I have to check the problem with hidden regions, but all the rest should work. Thank you for your help and sorry for the delay...

Best regards Ottmar

ogobrecht commented 5 years ago

Hi Ignacius,

I am currently think of to use the provided link color (if one was provided) also for the link labels. What do you think about it? Or do you like more the grey, not so disturbing color?

Best regards Ottmar

Ignacius68 commented 5 years ago

Hi Ottmar,

I'm just getting to testing the new version.

As to colors for the links, hopefully that can still be left out. Would it be a legend, like the node colors? Anyway, if colors were used, I would think not using it on the labels, just like the nodes don't use the node color. That can result in labels that are too difficult to read.

ogobrecht commented 5 years ago

Hi Ignacius,

currently the link labels are grey so that they are not so extreme visual and therefore not overload the graph. Please let me know after testing if you like the link labels in this grey color or if you like it in black as with the node labels. You can play around with it by modifying the css:

.net_gobrechts_d3_force text.linkLabel {
    fill: #bbb;
    font-size: 8px;
    letter-spacing: 0;
    cursor: default;
}

I am only interested how you would like to see the defaults - you can change it later on with the css rules. My current preference is the grey color,,,

I have no plans for a link color legend - but this is still a good idea...

Best regards Ottmar

Ignacius68 commented 5 years ago

Hi Ottmar,

For the links, default is definitely the grey. I think to use colors on the links, then they would need to have a legend, like the nodes do. Could just be another list at the bottom of the node legend list.

For the link labels, definitely leave the default as grey, which puts the labels associated with the default link color, and effectively de-emphasizes the link labels, when a node and link label are close together.

If you're looking at possible customizations/configurations, being able to change the "weight" of the link lines would be great, as an emphasis option.

[[ While you're thinking about the legends, is there any way to make those clickable, and highlight all of the associated nodes?? Just a thought... }}

Thanks again!

ogobrecht commented 5 years ago

Hi Ignacius,

the links support the COLOR attribute since a long time now. But I have no legend implemented for it (was not in scope when there was a demand for colored links). That was the reason to ask if the link labels should have the same color as the links in case there is link color defined. I have tested a little bit and found it slightly nicer to have the same color for the link labels as for the links - especially when you hover a node with the mouse and all connected nodes and links get highlighted. In this case the color of an link is lost, because highlighting means that a node border in black is shown and the connected links are also switching the color to black. Then it is nice to have the link labels remaining in the link color, otherwise the color of the link is lost during highlighting. Just a thought...

The graph logic is already really complex... anyway, I wrote me a node to think about a link legend.

Thank you again for testing and the good ideas.

Best regards Ottmar

ogobrecht commented 5 years ago

Hi Ignacius,

forgot to tell you, that I wrote me also a node to think about the weight attribute for links.

Best regards Ottmar

ogobrecht commented 5 years ago

see #37