diff options
| author | LV-426 <lv-426@taproot.org.il> | 2014-12-10 15:32:24 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2014-12-16 10:59:14 +0200 |
| commit | b231e0807fffb01351a978ad61a39de2a3e6fd2f (patch) | |
| tree | 918c53551f4eb46f52f4f6dba21e0316206736e2 /src | |
| parent | 2c770b193e6a4b840b7bf6e264dd01eee20e814a (diff) | |
adapt_format_read/write_node/link update
Diffstat (limited to 'src')
| -rw-r--r-- | src/model/util.js | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/model/util.js b/src/model/util.js index 0b3fd2f3..11f131bd 100644 --- a/src/model/util.js +++ b/src/model/util.js @@ -32,9 +32,9 @@ function($, model_diff) { '__label_set' : [n_raw.type], }, n_raw); - delete ret.type; delete ret.state; delete ret.status + delete ret.type; return ret } @@ -42,21 +42,19 @@ function($, model_diff) { /** * read by adapting from backend format */ - function adapt_format_read_link(l_raw) { + function adapt_format_read_link_ptr(l_raw) { var ret; ret = $.extend({ - '__src_id' : l_raw['__src'], - '__dst_id' : l_raw['__dst'], + '__src_id' : l_raw['__src_id'], + '__dst_id' : l_raw['__dst_id'], 'type' : l_raw['__label_set'][0].toLowerCase(), // discard all // labels except - 'state' : 'temp', + 'state' : 'perm', }, l_raw); ret['name'] = ret['type']; - delete ret.__src; - delete ret.__dst; delete ret.__type; return ret; @@ -67,14 +65,17 @@ function($, model_diff) { */ function adapt_format_write_link(l_raw) { var ret = $.extend({ - '__src_id' : l_raw.sourceId, - '__dst_id' : l_raw.targetId, - '__label_set' : ['textual_link'], + '__src_id' : l_raw.source.id, + '__dst_id' : l_raw.target.id, + '__label_set' : [l_raw.name], }, l_raw); - delete ret.source; - delete ret.target; + delete ret.__dst; + delete ret.__src; + delete ret.source; // introduced by d3 accessor methods delete ret.state; + delete ret.status; + delete ret.target; return ret; } @@ -110,7 +111,7 @@ function($, model_diff) { return { adapt_format_read_node : adapt_format_read_node, - adapt_format_read_link : adapt_format_read_link, + adapt_format_read_link_ptr : adapt_format_read_link_ptr, adapt_format_write_node : adapt_format_write_node, adapt_format_write_link : adapt_format_write_link, adapt_format_write_topo_diff : adapt_format_write_topo_diff, |
