-
Notifications
You must be signed in to change notification settings - Fork 1
d3 Renderer Cleanup #31
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
Conversation
… selection-mgr, and render-mgr.
Exception: `nc-logic` is not renamed yet.
These should have been built into the core template from the start. Since we want to reference the values in the code, we make sure the values exist.
…n-mgr and render-mgr.
…ON from HILITE Fixes source/target selection bug when editing Edges. When highlights were treated as SELECTION events, highlight updates would be treated as node selection during edge edit.
…e-itest into dev-bl/d3clean # Conflicts: # app/view/netcreate/render-mgr.js
Mermaid Diagram Generated by ChatGPT Test graph LR
server.js[server.js] -->|Broadcasts| nc-logic[nc-logic]
nc-logic -->|NCDATA| filter-mgr[filter-mgr]
filter-mgr -->|FILTEREDNCDATA| edge-mgr[edge-mgr]
edge-mgr -->|VDATA| NCGraph[NCGraph]
NCGraph -->|Visual data updates| NCGraphRenderer[NCGraphRenderer]
hilite-mgr[hilite-mgr] -- SELECTION/HILITE actions --> NCGraph
hilite-mgr -- SELECTION/HILITE actions --> NCGraphRenderer
|
…clicking node directly or selecting it from the autosuggest menu)
To TestThis was a pretty deep rewrite, but the application should behave like it used to with a few improvements and no regression errors. So all aspects of the system ought to be tested, e.g.
A specific test of the selection/hilite system:
|
Tested quickly:
|
Seems to work overall! I can accept it, and then look into the warning part as a separate fixup pass when we address any remaining linting issues and errors as a separate pull request. |
Overview
The main goal of this work was to refactor the
d3-simplenetgraph
renderer so that it could reliably render visual data (VDATA
). It introduces a number of new managers that transform the working Net.Create network graph data (NCDATA
) into visual data (VDATA
).The end result is a new renderer
NCGraphRenderer
, with a wrapper React ComponentNCGraph
that manages the visual data. This potentially enables us to create multiple renderers in the same window.Please see User Input Data Flow v2.x diagram for an overview.
Main Features
Data Flow:
NCDATA
=>FILTEREDNCDATA
=>VDATA
Data is now better differentiated.
NCDATA
-- conceptual Net.Create data, including metadata (e.g. degrees, weight)FILTEREDNCDATA
-- a subset of NCDATA, with nodes and edges removed or marked by user-selected filtersVDATA
-- the visual data used by the renderer (e.g. size, opacity).The flow is basically:
server.js
loads and broadcasts node and edge updates.nc-logic
listens to the broadcasts and constructsNCDATA
based on them.filter-mgr
listens forNCDATA
updates and applies any active filters, and then broadcastsFILTEREDNCDATA
edge-mgr
listens forFILTEREDNCDATA
updates and renders it asVDATA
. The reasonedge-mgr
handles this is because we need to simplify the edges before rendering them. See #285NCGraph
listens for updates toVDATA
and passes it on toNCGraphRenderer
NCGraphRenderer
draws the graph.NCGraph and NCGraphRenderer
NCGraph
replacesNetGraph
. It is the new wrapper for the renderer,NCGraphRenderer
. It decides what data updates to listen to (e.g.VDATA
)NCGraphRenderer.js
replacesd3-simplenetgraph.js
NetGraph
andd3-simplenetgraph.js
remain in the repo, but are not being used.SELECTION vs HILITE
We will eventually need to implement a more centralized selection manager, which is outside of the scope of this PR. However, refactoring the renderer broke some of the existing functionality (when editing an edge, you could no longer select a source/target node). So we had to introduce a new
hilite-mgr
module to differentiate SELECTION (e.g. clicking on a node) from HILITE (e.g. hovering over a node, hovering over a row in the Node Table, nodes found by search, hovering over an autosuggest selection).Visually differentiating a selection from a highlight is difficult, especially on a colorful graph. So we've added an experimental animated arrows to indicate the currently selected node. We can revise this and try other approaches if this is too busy, but it really does make the currently selected node much more obvious.
selection-mgr.js
is currently an empty placeholder. We anticipate that the selection methods fromnc-logic
will eventually be moved here.Additional Features/Fixes
ReactDOM.findDOMNode
).The introduction of the rudimentary selection manager ended up breaking Edge Editing. So we had to flesh out the selection and highlight managers even though they were not originally a part of this scope. We also added a few new features along the way: