-
Notifications
You must be signed in to change notification settings - Fork 0
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
Visual graph element #31
Comments
Having tried out vis.js in the form of react-graph-vis I didn't find it suitable for the following reasons:
For this reason I have moved on to cytoscape.js packaged as /react-cytoscapejs. This solution fixes At this point I should probably also make a note about react-flow which on the surface seems like a well-documented, well-supported solution—and also something which could be used to edit graphs with at some point! However, I think react-flow is more suited to very small graphs with a clear "flow", rather than the type of graphs we must support, i.e. a single central node with a handful to several hundred outgoing connections. |
While trying out Cytoscape.js I did found it to be an improvement over vis.js. However, it still has some major issues that at least require loading and configuring various extensions which may or may not solve these issues. The concentric layout is definitely preferable out of all of the layouts I have tried (including several custom ones), but I cannot configure the following:
Some illustrations: Working well (cykel)Too close (lexikalt begreb)Too far (ord)Based on these issue I have decided to try out a third method: D3's radial tidy tree layout. I am currently unsure how to best use D3 from Rum. Some reading:
One thing that will not possible using a dendogram are self-referential relations. However, it should still be possible to include many-to-one relations as all of relations are from the same subject, so the objects can simply be duplicated many times over in the resulting tree. |
Collapsible example: https://codepen.io/fernoftheandes/pen/kyQRNe |
Having serious issues implementing the D3 radial tree for several reasons:
Now I just discovered that there is actually a radial tree layout in vega too, which seems to look very similar—perhaps even better—and it seems much more compatible with my needs. I will go investigate.
I think I will attempt the React interop to begin with. |
Vega attempt being tracked in: https://github.com/kuhumcst/DanNet/tree/feature/31d-vega |
More inspiration: https://vega.github.io/vega/examples/tree-layout/ |
This looks interesting: https://unovis.dev/gallery Perhaps an alternative to a graph could be the expanded sankey? |
Some very interesting force graphs here: https://github.com/vasturiano/react-force-graph I might also take a look at this one again: https://www.npmjs.com/package/react-d3-tree |
Since the added JS dependencies take up quite a lot of additional MBs, I will likely need to use a shadow-cljs module of some kind. |
This also looks promising, especially if the performance is good: https://github.com/reaviz/reagraph I tried getting react-force-graph to work, but it's having some dependency issue in shadow-cljs that I'm unsure how to solve. |
Current status: With regard to reagraph, I simply can't figure out why it isn't working. The canvas shows up, but actually displaying nodes and edges isn't happening. As react-force-graph, the solution provided by theller did in fact mute the warning, but the module compilation error is still present and in fact crashes Firefox after a short while. |
I managed to get react-force-graph working by updating some deps (shadow-cljs, Rum, reagent-utils, and React itself). The basic layout is working, but adding labels even seems to be quite a bit of work, unfortunately. Replicating the old-school radial layouts that Bolette loves might be possible with https://uber.github.io/react-vis/examples/showcases/sunbursts |
To create proper nodes with text I'll have to manually style them with |
Word cloud visual conceptOne thing I'm playing with is displaying collections of synsets as word clouds, in order to have something meaningful to show in every case, e.g. rather than linking to each synset individually, a word cloud stands in as the single object that is linked to for each particular relation. This will probably scale quite well, since more important words will be more prominent than less important ones in cases where there are many connections. Obviously, this requires the
|
Ok, so naively querying for all synsets is OK, but querying for incoming synset connections to synsets is very costly, at least in a single query. Perhaps it is less expensive to query first for all synsets and then do the incoming connections bit sequentially? |
It turns out that the indegree is also a great way to display a small summary for the long lists of synsets that sometime appear for different synset pages, e.g. http://localhost:3456/dannet/data/synset-36945 I will need to design the summary/details element currently in use, though, as that no longer is for for purpose. |
The simple word cloud in https://npm.io/package/react-wordcloud looks quite attractive and I can make callbacks to change the page when clicking a word. |
I got a word cloud going with d3-cloud, however this brings also brings in D3 and associated deps, so the main.js size has gone up from 1.13 MB to 1.65 MB, i.e. roughly half a MB. This sucks, but it's hard to see how I can avoid it. |
Examples: http://localhost:3456/dannet/external/en/oewn-00244785-n (has_domain_topic)![]() http://localhost:3456/dannet/data/synset-16749 (hyponym)![]() |
Another thing I have not considered is accessibility. I guess no one would care to randomly jump through a thousand randomly ordered clickable eleemnets, so perhaps it's ok to leave out. They are available in the list anyway, after all. |
I think I will first attempt to integrate the word cloud into the basic entity page by creating a stylised checkbox widget for toggling word cloud/list views. |
I am recently satisfied with the word cloud + display options select dropdown in 72a1860. Next on the visualisation agenda is combining this word cloud stuff into a network graph. |
I've managed to get an example workingbased on https://observablehq.com/@d3/radial-tree/2 The original plan was to combine it with the word clouds, however, now I think it might be more beneficial to simply duplicate the old Yahoo YUI widget on Andre Ord: I would be placing a visualisation widget at the top of the Semantic Relations section and use only those relations for the visualisation. One of these visualisations would then be a D3 copy of the Andre Ord viz. |
Closing as of 8862dfe since the MVP for the I will make several smaller issues for the remaining stuff that needs to be done, e.g. fixes for and integrated functionality of these visualisations + the (now) nice-to-have visualisation combining word clouds and the radial diagram. |
Some kind of React graph element, presumably.
Should probably be a special element that can be opened or a separate page that is navigated to.
Requires moving the frontend dependencies from
deps.edn
intoshadow-cljs.edn
since I will need to use the NPM library integration of shadow-cljs.The text was updated successfully, but these errors were encountered: