angular-d3-charts
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -36,4 +36,3 @@ "use strict"; | ||
var arcNew = d3.svg.arc() | ||
.outerRadius(160) | ||
.innerRadius(70); | ||
.outerRadius(160); | ||
var svg = d3.select('#pieChart').append('svg') | ||
@@ -51,8 +50,8 @@ .attr('width', 330) | ||
.style('stroke', 'white').style('fill', function (d, i) { | ||
return d.data.color; | ||
return [d.data.color]; | ||
}) | ||
.attr('id', function (d) { | ||
return 'iconId' + d.data.id; | ||
return 'iconId' + d.data.event; | ||
}) | ||
.attr('cursor', this.spreadSlice ? 'pointer' : 'default') | ||
.attr('cursor', 'pointer') | ||
.on('click', function (d) { | ||
@@ -73,18 +72,16 @@ d3.selectAll('path').transition() | ||
}); | ||
if (chartComponent.spreadSlice) { | ||
d3.select(this).transition() | ||
.duration(50) | ||
.attr('d', function (d) { | ||
if (d.data.expanded) { | ||
this.selectedId = null; | ||
d.data.expanded = false; | ||
return arc(d); | ||
} | ||
else { | ||
d.data.expanded = true; | ||
this.selectedId = d.data.id; | ||
return arcNew(d); | ||
} | ||
}); | ||
} | ||
d3.select(this).transition() | ||
.duration(50) | ||
.attr('d', function (d) { | ||
if (d.data.expanded) { | ||
this.selectedId = null; | ||
d.data.expanded = false; | ||
return arc(d); | ||
} | ||
else { | ||
d.data.expanded = true; | ||
this.selectedId = d.data.id; | ||
return arcNew(d); | ||
} | ||
}); | ||
}); | ||
@@ -95,8 +92,4 @@ g.append('g') | ||
}) | ||
.append('svg:image') | ||
.attr('xlink:href', function (d) { | ||
return d.data.iconImage; | ||
}) | ||
.attr('id', function (d) { | ||
return d.data.iconImage; | ||
return [d.data.id]; | ||
}) | ||
@@ -107,3 +100,3 @@ .attr('width', imageWidth) | ||
.attr('y', -1 * imageHeight / 2) | ||
.attr('cursor', this.spreadSlice ? 'pointer' : 'default') | ||
.attr('cursor', 'pointer') | ||
.on('click', function (d) { | ||
@@ -124,18 +117,16 @@ d3.selectAll('path').transition() | ||
}); | ||
if (chartComponent.spreadSlice) { | ||
d3.select('path#iconId' + d.data.id).transition() | ||
.duration(50) | ||
.attr('d', function (d) { | ||
if (d.data.expanded) { | ||
this.selectedId = null; | ||
d.data.expanded = false; | ||
return arc(d); | ||
} | ||
else { | ||
d.data.expanded = true; | ||
this.selectedId = d.data.id; | ||
return arcNew(d); | ||
} | ||
}); | ||
} | ||
d3.select('path#iconId' + d.data.event).transition() | ||
.duration(50) | ||
.attr('d', function (d) { | ||
if (d.data.expanded) { | ||
this.selectedId = null; | ||
d.data.expanded = false; | ||
return arc(d); | ||
} | ||
else { | ||
d.data.expanded = true; | ||
this.selectedId = d.data.id; | ||
return arcNew(d); | ||
} | ||
}); | ||
}); | ||
@@ -142,0 +133,0 @@ }; |
{ | ||
"name": "angular-d3-charts", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Integrate angular 2 app with interactive d3 charts e.g. Doughnut, Pie, Single Bar chart, Multiple bar chart and Stacked bar chart. Beautiful charts for Angular2 based on d3.js", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16206
391