Commit f9d86f4cb467c2cfad1b49f1d822d82bb7187796
1 parent
39ddc298
graph datalet updates
Showing
1 changed file
with
21 additions
and
15 deletions
datalets/graph-datalet/graph-datalet.html
| @@ -130,19 +130,30 @@ Example: | @@ -130,19 +130,30 @@ Example: | ||
| 130 | .attr("width", width) | 130 | .attr("width", width) |
| 131 | .attr("height", height); | 131 | .attr("height", height); |
| 132 | 132 | ||
| 133 | - this.svg.append("defs") | 133 | + //pezzotto |
| 134 | + this.svg.append("filter") | ||
| 135 | + .attr("id","filter1") | ||
| 136 | + .attr("x","0%") | ||
| 137 | + .attr("y","0%") | ||
| 138 | + .attr("width","100%") | ||
| 139 | + .attr("height","100%") | ||
| 140 | + .append("feImage") | ||
| 141 | + .attr("xlink:href","http://icons.iconarchive.com/icons/hopstarter/soft-scraps/256/User-Executive-Green-icon.png"); | ||
| 142 | + | ||
| 143 | + /*this.svg.append("defs") | ||
| 134 | .append("pattern") | 144 | .append("pattern") |
| 135 | .attr("id","urlimage") | 145 | .attr("id","urlimage") |
| 136 | - .attr("patternUnits","userSpaceOnUse") | ||
| 137 | - .attr("width","320") | ||
| 138 | - .attr("height","320") | 146 | + //.attr("patternUnits","userSpaceOnUse") |
| 147 | + .attr("width","100%") | ||
| 148 | + .attr("height","100%") | ||
| 139 | .append("image") | 149 | .append("image") |
| 140 | .attr("xlink:href","http://lorempixel.com/400/200") | 150 | .attr("xlink:href","http://lorempixel.com/400/200") |
| 141 | - .attr("patternUnits","userSpaceOnUse") | ||
| 142 | - .attr("x","0") | ||
| 143 | - .attr("y","0") | ||
| 144 | - .attr("width","400") | ||
| 145 | - .attr("height","200"); | 151 | + //.attr("patternUnits","userSpaceOnUse") |
| 152 | + .attr("x","0%") | ||
| 153 | + .attr("y","0%") | ||
| 154 | + .attr("width","100%") | ||
| 155 | + .attr("height","100%");*/ | ||
| 156 | + //end pezzotto | ||
| 146 | 157 | ||
| 147 | 158 | ||
| 148 | var graph = {}; | 159 | var graph = {}; |
| @@ -177,12 +188,7 @@ Example: | @@ -177,12 +188,7 @@ Example: | ||
| 177 | return t.color ? "stroke:" + t.color : !1 | 188 | return t.color ? "stroke:" + t.color : !1 |
| 178 | }); | 189 | }); |
| 179 | 190 | ||
| 180 | - d3.selectAll('circle').style("fill", function(t){return t.image ? 'url(#urlimage)' : ""})/*.append("svg:image") | ||
| 181 | - .attr('xlink:href', function(t){ | ||
| 182 | - return t.image ? t.image : ""; | ||
| 183 | - }) | ||
| 184 | - .attr('width', 150) | ||
| 185 | - .attr('height', 200);*/ | 191 | + d3.selectAll('circle').attr("filter", function(t){return t.image ? 'url(#filter1)' : ""}); |
| 186 | 192 | ||
| 187 | //d3.selectAll(".drag").call(force.drag), svg.selectAll("g.fixed").call(text); | 193 | //d3.selectAll(".drag").call(force.drag), svg.selectAll("g.fixed").call(text); |
| 188 | d3.selectAll(".drag").call(force.drag), this.svg.selectAll("g.node").call(this.text); | 194 | d3.selectAll(".drag").call(force.drag), this.svg.selectAll("g.node").call(this.text); |