From 9e08623999498d33ab425dba618a9552a8c95669 Mon Sep 17 00:00:00 2001 From: luigser Date: Fri, 20 Nov 2015 18:46:04 +0100 Subject: [PATCH] graph datalet updtaes --- controllets/animated-grid-controllet/animated-grid-controllet.html | 0 controllets/fullsize-page-with-card-controllet/fullsize-page-with-card-controllet.html | 0 datalets/base-datalet/static/images/spin.svg | 0 datalets/graph-datalet/graph-datalet.html | 27 +++++++++++++++++++++++++-- datalets/graph-datalet/static/css/graphStyle.css | 0 datalets/graph-datalet/static/js/d3.v3.js | 0 6 files changed, 25 insertions(+), 2 deletions(-) mode change 100644 => 100755 controllets/animated-grid-controllet/animated-grid-controllet.html mode change 100644 => 100755 controllets/fullsize-page-with-card-controllet/fullsize-page-with-card-controllet.html mode change 100644 => 100755 datalets/base-datalet/static/images/spin.svg mode change 100644 => 100755 datalets/graph-datalet/graph-datalet.html mode change 100644 => 100755 datalets/graph-datalet/static/css/graphStyle.css mode change 100644 => 100755 datalets/graph-datalet/static/js/d3.v3.js diff --git a/controllets/animated-grid-controllet/animated-grid-controllet.html b/controllets/animated-grid-controllet/animated-grid-controllet.html old mode 100644 new mode 100755 index 17f6f47..17f6f47 --- a/controllets/animated-grid-controllet/animated-grid-controllet.html +++ b/controllets/animated-grid-controllet/animated-grid-controllet.html diff --git a/controllets/fullsize-page-with-card-controllet/fullsize-page-with-card-controllet.html b/controllets/fullsize-page-with-card-controllet/fullsize-page-with-card-controllet.html old mode 100644 new mode 100755 index b40344f..b40344f --- a/controllets/fullsize-page-with-card-controllet/fullsize-page-with-card-controllet.html +++ b/controllets/fullsize-page-with-card-controllet/fullsize-page-with-card-controllet.html diff --git a/datalets/base-datalet/static/images/spin.svg b/datalets/base-datalet/static/images/spin.svg old mode 100644 new mode 100755 index 5b931d7..5b931d7 --- a/datalets/base-datalet/static/images/spin.svg +++ b/datalets/base-datalet/static/images/spin.svg diff --git a/datalets/graph-datalet/graph-datalet.html b/datalets/graph-datalet/graph-datalet.html old mode 100644 new mode 100755 index a0d626b..06ff9b0 --- a/datalets/graph-datalet/graph-datalet.html +++ b/datalets/graph-datalet/graph-datalet.html @@ -130,6 +130,21 @@ Example: .attr("width", width) .attr("height", height); + this.svg.append("defs") + .append("pattern") + .attr("id","urlimage") + .attr("patternUnits","userSpaceOnUse") + .attr("width","320") + .attr("height","320") + .append("image") + .attr("xlink:href","http://lorempixel.com/400/200") + .attr("patternUnits","userSpaceOnUse") + .attr("x","0") + .attr("y","0") + .attr("width","400") + .attr("height","200"); + + var graph = {}; graph.nodes = t.nodes; @@ -157,10 +172,18 @@ Example: return t.fixed ? "" : "drag" }).attr("r", function (t) { return t.r ? t.r : 15 - }).attr("style", function (t) { + }) + .attr("style", function (t) { return t.color ? "stroke:" + t.color : !1 }); + d3.selectAll('circle').style("fill", function(t){return t.image ? 'url(#urlimage)' : ""})/*.append("svg:image") + .attr('xlink:href', function(t){ + return t.image ? t.image : ""; + }) + .attr('width', 150) + .attr('height', 200);*/ + //d3.selectAll(".drag").call(force.drag), svg.selectAll("g.fixed").call(text); d3.selectAll(".drag").call(force.drag), this.svg.selectAll("g.node").call(this.text); @@ -217,7 +240,7 @@ Example: mouseover : function (t) { d3.select(this).selectAll("circle").transition().duration(600).ease("elastic").attr("r", function (t) { //return 1 == t.fixed ? 1.4 * t.r : 15 - return 1 == t.fixed ? 1.4 * t.r : 15 + return 1 == t.fixed ? 1.4 * t.r : t.r + 10; }); }, diff --git a/datalets/graph-datalet/static/css/graphStyle.css b/datalets/graph-datalet/static/css/graphStyle.css old mode 100644 new mode 100755 index dd0faf0..dd0faf0 --- a/datalets/graph-datalet/static/css/graphStyle.css +++ b/datalets/graph-datalet/static/css/graphStyle.css diff --git a/datalets/graph-datalet/static/js/d3.v3.js b/datalets/graph-datalet/static/js/d3.v3.js old mode 100644 new mode 100755 index 5b4afa0..5b4afa0 --- a/datalets/graph-datalet/static/js/d3.v3.js +++ b/datalets/graph-datalet/static/js/d3.v3.js -- libgit2 0.21.4