Skip to content

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

Merged
merged 36 commits into from
Jul 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a4a9dbd
d3clean: Separate render from pure data via NCGraph, NCGraphRenderer,…
benloh Jun 27, 2023
e6537e4
dev-bl/d3clean: Rename *-logic to *-mgr.
benloh Jun 27, 2023
2af9ae3
Merge remote-tracking branch 'origin/dev' into dev-bl/d3clean
benloh Jun 28, 2023
602e859
d3clean: Merge eslint-config into d3clean
benloh Jun 28, 2023
b5820ac
d3clean: lint fix: Remove use of ReactDOM.findDOMNode
benloh Jun 28, 2023
5f4a817
d3clean: lint fix: no-prototype-builtins
benloh Jun 28, 2023
f3e65b7
d3clean: lint fix: Use "
benloh Jun 28, 2023
c967dde
d3clean: Rename *-logic to *-mgr
benloh Jun 28, 2023
046cb6e
d3clean: lint fixes: autospacing, quotes, layout
benloh Jun 28, 2023
86e59b7
d3clean: lint fix: unreachable code
benloh Jun 28, 2023
cc235c1
d3clean: react fix: use componentDidMount instead of deprecated compo…
benloh Jun 28, 2023
24a301d
d3clean: lint fix: autospacing, layout
benloh Jun 28, 2023
f6b6c87
d3clean: lint fix: referneces to *-mgr
benloh Jun 28, 2023
03217d0
d3clean: Rename SYNTHESIZEDD3DATA to VDATA
benloh Jun 28, 2023
674dbc9
d3clean: Rename `FILTEREDD3DATA` to `FILTEREDNCDATA`
benloh Jun 28, 2023
8515913
d3clean: Rename `FDATA` to `FILTERDEFS`
benloh Jun 28, 2023
39d20e3
d3clean: lint fix: autolayout
benloh Jun 28, 2023
65784cc
d3clean: Rename `MOUSE_OVER_NODE` to `USER_HIGHLIGHT_NODE`
benloh Jun 28, 2023
8997e77
d3clean: Rename `d3NetGraph` to `ncGraphRenderer` to clarify relation…
benloh Jun 28, 2023
5806c30
d3clean: Skip force updates during mouseover to prevent nodes from sh…
benloh Jun 28, 2023
9d67b97
d3clean: Migrate core template values
benloh Jun 28, 2023
fc20324
d3clean: Rename `D3DATA` to `VDATA`
benloh Jun 28, 2023
7e53914
d3clean: lint fixes autolayout
benloh Jun 28, 2023
a3250b0
d3clean: Restore search highlighting.
benloh Jun 28, 2023
9d161e2
d3clean: Restore autosuggest highlighting.
benloh Jun 28, 2023
c9f64da
d3clean: Remove old selection marking calls. Replaced by new selecti…
benloh Jun 28, 2023
63cd842
d3clean: lint fix: autolayout
benloh Jun 29, 2023
5ab8bb9
d3clean: Experimental use of shaped nodes. Commented out.
benloh Jun 29, 2023
6f7acf7
d3clean: Add table row highlight
benloh Jun 30, 2023
8bd5336
d3clean: lint fix: autolayout
benloh Jun 30, 2023
2024f4c
d3clean: Add HILITE AppState and hilite-mgr class to separate SELECTI…
benloh Jun 30, 2023
5f773c7
Merge branch 'dev-bl/d3clean' of https://github.com/daveseah/netcreat…
benloh Jun 30, 2023
ee67924
d3clean: Note NetGraph and d3-simplenetgraph deprecation.
benloh Jun 30, 2023
92537c4
d3clean: Update template-schema descriptions to better describe highl…
benloh Jun 30, 2023
01bfe82
d3clean: Clear autosuggestHighlight when selecting a node (either by …
benloh Jun 30, 2023
0f539f8
d3clean: Add "selection" highlight as animated arrows.
benloh Jun 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions app/system/datastore.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ let NCDATA = {};
DSTOR.Hook("INITIALIZE", () => {
// DBUPDATE_ALL is a local call originating from within the app
// Used to update the full NCDATA object during template updates
UDATA.HandleMessage("DBUPDATE_ALL", function(data) {
UDATA.HandleMessage("DBUPDATE_ALL", function (data) {
DSTOR.UpdateDataPromise(data);
});

// DB_UPDATE is a local call originating from within the app
// Generally used to update individual nodes and edges
UDATA.HandleMessage("DB_UPDATE", function(data) {
UDATA.HandleMessage("DB_UPDATE", function (data) {
DSTOR.UpdateServerDB(data);
});

// DB_INSERT is a local call originating from within the app
// Generally used to add new nodes and edges after an import
UDATA.HandleMessage("DB_INSERT", function(data) {
UDATA.HandleMessage("DB_INSERT", function (data) {
DSTOR.InsertServerDB(data);
});

Expand All @@ -58,9 +58,9 @@ DSTOR.Hook("INITIALIZE", () => {
// Unlike DB_INSERT, it'll update existing nodes/edges
UDATA.HandleMessage("DB_MERGE", DSTOR.MergeServerDB);

UDATA.OnAppStateChange('SESSION', function( decodedData ) {
UDATA.OnAppStateChange('SESSION', function (decodedData) {
let { isValid, token } = decodedData;
console.log('Handling SESSION',isValid);
console.log('Handling SESSION', isValid);
if (isValid) DSTOR.SetSessionGroupID(decodedData);
});

Expand All @@ -72,30 +72,30 @@ DSTOR.Hook("INITIALIZE", () => {
/*/ datastore needs to set NetMessage GroupID property on behalf of SESSIONS
because SESSION can't include NetMessage (or vice versa)
/*/
DSTOR.SetSessionGroupID = function ( decodedData ) {
DSTOR.SetSessionGroupID = function (decodedData) {
let { token, isValid } = decodedData;
if (isValid) {
NetMessage.GlobalSetGroupID(token);
console.log('setting NetMessage group id',token);
console.log('setting NetMessage group id', token);
} else {
console.warn('will not set bad group id:',token);
console.warn('will not set bad group id:', token);
}
};

/// DB INTERFACE //////////////////////////////////////////////////////////////
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*/ API: Placeholder DATA access function
/*/
DSTOR.Data = function() {
DSTOR.Data = function () {
return NCDATA;
};
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*/ API: Write update to database
/*/
DSTOR.UpdateServerDB = function(data) {
DSTOR.UpdateServerDB = function (data) {
// check that network is online
if (UNISYS.IsStandaloneMode()) {
console.warn(PR,`STANDALONE MODE: UpdateServerDB() suppressed!`);
console.warn(PR, `STANDALONE MODE: UpdateServerDB() suppressed!`);
return;
}
// it is!
Expand Down Expand Up @@ -125,7 +125,7 @@ DSTOR.PromiseCalculateMaxNodeId = function () {
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*/ get a unique NodeID
/*/
DSTOR.PromiseNewNodeID = function() {
DSTOR.PromiseNewNodeID = function () {
return new Promise((resolve, reject) => {
UDATA.NetCall("SRV_DBGETNODEID").then(data => {
if (data.nodeID) {
Expand All @@ -144,9 +144,9 @@ DSTOR.PromiseNewNodeID = function() {
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*/ get multiple unique NodeIDs
/*/
DSTOR.PromiseNewNodeIDs = function(count) {
DSTOR.PromiseNewNodeIDs = function (count) {
return new Promise((resolve, reject) => {
UDATA.NetCall("SRV_DBGETNODEIDS", {count}).then(data => {
UDATA.NetCall("SRV_DBGETNODEIDS", { count }).then(data => {
if (data.nodeIDs) {
if (DBG) console.log(PR, "server allocated node_id", data.nodeIDs);
resolve(data.nodeIDs);
Expand Down Expand Up @@ -174,7 +174,7 @@ DSTOR.PromiseCalculateMaxEdgeId = function () {
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*/ get a unique Edge
/*/
DSTOR.PromiseNewEdgeID = function() {
DSTOR.PromiseNewEdgeID = function () {
return new Promise((resolve, reject) => {
UDATA.NetCall("SRV_DBGETEDGEID").then(data => {
if (data.edgeID) {
Expand All @@ -193,9 +193,9 @@ DSTOR.PromiseNewEdgeID = function() {
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*/ get multiple unique EdgeIDs
/*/
DSTOR.PromiseNewEdgeIDs = function(count) {
DSTOR.PromiseNewEdgeIDs = function (count) {
return new Promise((resolve, reject) => {
UDATA.NetCall("SRV_DBGETEDGEIDS", {count}).then(data => {
UDATA.NetCall("SRV_DBGETEDGEIDS", { count }).then(data => {
if (data.edgeIDs) {
if (DBG) console.log(PR, "server allocated edge_id:", data.edgeIDs);
resolve(data.edgeIDs);
Expand All @@ -210,7 +210,7 @@ DSTOR.PromiseNewEdgeIDs = function(count) {
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*/ API: Load default data set from a JSON file in /assets/data
/*/
DSTOR.PromiseJSONFile = function(jsonFile) {
DSTOR.PromiseJSONFile = function (jsonFile) {
if (typeof jsonFile !== "string") {
throw new Error("pass arg <filename_in_assets/data>");
}
Expand Down Expand Up @@ -256,7 +256,7 @@ DSTOR.PromiseTOMLFile = function (tomlFile) {
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*/ API: Load D3 Database
/*/
DSTOR.PromiseD3Data = function() {
DSTOR.PromiseD3Data = function () {
// UDATA.Call() returns a promise
return UDATA.Call("SRV_DBGET", {}); // server.js
};
Expand All @@ -265,11 +265,11 @@ DSTOR.PromiseD3Data = function() {
/*/
DSTOR.SaveTemplateFile = template => {
// UDATA.Call() returns a promise
return UDATA.Call("SRV_TEMPLATESAVE", {template}); // server.js
return UDATA.Call("SRV_TEMPLATESAVE", { template }); // server.js
};
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*/ API: Get Template File Path.
Called by templateEditor-logic when downloading template file.
Called by templateEditor-mgr when downloading template file.
/*/
DSTOR.GetTemplateTOMLFileName = () => {
return UDATA.Call("SRV_GET_TEMPLATETOML_FILENAME");
Expand Down
Loading