visually.nuggetFunctions || (visually.nuggetFunctions = {});
visually.nuggetFunctions['testNugget'] = function (view) {
return NuggetFactory({
// define the original size of the SVG block
getDimensions: function () {
return {
width: 500,
height: 500
};
},
// define the SVG rendering function
// 'parent' is a d3 wrapper for the parent SVG block - either a top-level SVG element or a '<svg:g>' element
draw: function (parent) {
var dimensions = this.getDimensions(),
// retrieve the data passed to the nugget constructor (see below)
data = this.data(),
// retrieve the config settings passed to the nugget constructor (see below)
config = this.config();
// draw some SVG elements based on the data passed //
/*
parent.append('text')
//.text(data[0].age)
.text(config.r)
.style('fill', config.color(14106543))
.attr('y',20);
*/
var group = parent.append("g")
.attr("transform", "translate(200, 200)");
var div = d3.select("body").append("div")
.attr("class", "tooltip")
.style("opacity", 0);
var arcs = group.selectAll(".arc")
.data(config.pie(data))
.enter()
.append("g")
.attr("class", "arc");
arcs.append("path")
.attr("d", config.arc)
.attr("fill", function (d, i) {
//return config.color1(d.data[0]);
return config.color1(d.data);
})
.attr("id", function (d) {
return d.data[1];
})
.on("mousemove", function (d, i) {
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.