summaryrefslogtreecommitdiff
path: root/src/client/view
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-08-09 18:41:04 +0300
committerAlon Levy <alon@pobox.com>2015-08-09 18:41:04 +0300
commit9d04ff02657f6881379c7cf701180789edfce7fe (patch)
tree934e1b1e19b15715cd36c2bb506eb0a4bc97a4bf /src/client/view
parent9fd7137edc8b4f24e2da8af487e093b05e9539f7 (diff)
client/view/grpah_view: reduce update_view size a bit (way to go)
Diffstat (limited to 'src/client/view')
-rw-r--r--src/client/view/graph_view.js50
1 files changed, 27 insertions, 23 deletions
diff --git a/src/client/view/graph_view.js b/src/client/view/graph_view.js
index c2e3c572..bcd04b91 100644
--- a/src/client/view/graph_view.js
+++ b/src/client/view/graph_view.js
@@ -417,6 +417,33 @@ function GraphView(spec) {
return translate(d.bx, d.by);
}
+ function model_id_from_dom_id(dom_id) {
+ return dom_id.split('__')[0];
+ }
+
+ function node__radius (d) {
+ return urlValid(d['image-url']) ? 20 : 10;
+ }
+ function filter_id(id) {
+ return id + '__node_filter';
+ }
+ function feimage_id(id) {
+ return id + '__node_filter_feimage';
+ }
+ function clip_path_id(id) {
+ return id + '__node_clip_path';
+ }
+ function svg_url(id) {
+ return 'url(#' + id + ')';
+ }
+
+ var node__text_x = function(d) {
+ return node_text_dx + node__radius(d) + (urlValid(d.url) ? node_url_dx : 0);
+ };
+
+ function graphics__node_text(node) {
+ }
+
function update_view(relayout) {
var node,
link,
@@ -436,14 +463,6 @@ function GraphView(spec) {
});
}
- var node__text_x = function(d) {
- return node_text_dx + node__radius(d) + (urlValid(d.url) ? node_url_dx : 0);
- };
-
- function model_id_from_dom_id(dom_id) {
- return dom_id.split('__')[0];
- }
-
function node_text_setup() {
var node_text;
@@ -718,21 +737,6 @@ function GraphView(spec) {
}
}
- function node__radius (d) {
- return urlValid(d['image-url']) ? 20 : 10;
- }
- function filter_id(id) {
- return id + '__node_filter';
- }
- function feimage_id(id) {
- return id + '__node_filter_feimage';
- }
- function clip_path_id(id) {
- return id + '__node_clip_path';
- }
- function svg_url(id) {
- return 'url(#' + id + ')';
- }
var filter_group = d3.select('.nodefilter-group').selectAll(".nodefilter")
.data(visible_nodes, function (d) { return d.id; });
var filter = filter_group.enter()