OXIESEC PANEL
- Current Dir:
/
/
home
/
cubot
/
docroot
/
showcase
/
js
/
D3
/
plugins
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/14/2022 11:05:22 AM
rwxr-xr-x
📄
Radar.js
8.86 KB
08/14/2022 11:05:21 AM
rw-r--r--
📄
bar.js
17.59 KB
08/14/2022 11:05:19 AM
rw-r--r--
📄
bullet.css
422 bytes
08/14/2022 11:05:19 AM
rw-r--r--
📄
bullet.js
10.65 KB
08/14/2022 11:05:20 AM
rw-r--r--
📄
calendar.js
16.63 KB
08/14/2022 11:05:19 AM
rw-r--r--
📄
calender.css
541 bytes
08/14/2022 11:05:20 AM
rw-r--r--
📄
combo.js
16.74 KB
08/14/2022 11:05:20 AM
rw-r--r--
📄
combo_2.js
17.91 KB
08/14/2022 11:05:19 AM
rw-r--r--
📄
combo_wip.js
16.61 KB
08/14/2022 11:05:18 AM
rw-r--r--
📄
commonFunc.js
25.28 KB
08/14/2022 11:05:20 AM
rw-r--r--
📄
customChart.js
577 bytes
08/14/2022 11:05:20 AM
rw-r--r--
📄
d3Charts.css
2.88 KB
08/14/2022 11:05:19 AM
rw-r--r--
📄
donut.js
5.67 KB
08/14/2022 11:05:19 AM
rw-r--r--
📄
filledAreaPercent.js
17.95 KB
08/14/2022 11:05:19 AM
rw-r--r--
📄
funnel.js
6.03 KB
08/14/2022 11:05:20 AM
rw-r--r--
📄
funnel.js_previous_o4aug17
5.86 KB
08/14/2022 11:05:20 AM
rw-r--r--
📄
gauged.js
15.3 KB
08/14/2022 11:05:20 AM
rw-r--r--
📄
groupbar.js
13.18 KB
08/14/2022 11:05:19 AM
rw-r--r--
📄
groupbar_23Aug2019.js
10.85 KB
08/14/2022 11:05:18 AM
rw-r--r--
📄
heatmap.js
9.77 KB
08/14/2022 11:05:20 AM
rw-r--r--
📄
html2canvas.min.js
161.47 KB
08/14/2022 11:05:19 AM
rw-r--r--
📄
makeJson.js
1.64 KB
08/14/2022 11:05:19 AM
rw-r--r--
📄
makeJsonmulti.js
3.75 KB
08/14/2022 11:05:18 AM
rw-r--r--
📄
multiLine.js
17.24 KB
08/14/2022 11:05:20 AM
rw-r--r--
📄
multipleDonut.js
5.29 KB
08/14/2022 11:05:19 AM
rw-r--r--
📄
pie.js
4.52 KB
08/14/2022 11:05:20 AM
rw-r--r--
📄
radar.js
6.49 KB
08/14/2022 11:05:19 AM
rw-r--r--
📄
saveSvgAsPng.js
14.62 KB
08/14/2022 11:05:21 AM
rw-r--r--
📄
stackedAreaDate.js
17.56 KB
08/14/2022 11:05:20 AM
rw-r--r--
📄
stackedAreaDate_bkup23Nov2020.js
17.56 KB
08/14/2022 11:05:20 AM
rw-r--r--
📄
stackedbar.js
10.72 KB
08/14/2022 11:05:20 AM
rw-r--r--
📄
stackedbar_bkup21Apr2020.js
10.72 KB
08/14/2022 11:05:20 AM
rw-r--r--
📄
stock.js
13.6 KB
08/14/2022 11:05:19 AM
rw-r--r--
📄
sun.js
7.59 KB
08/14/2022 11:05:20 AM
rw-r--r--
📄
sunburst.js
7.13 KB
08/14/2022 11:05:19 AM
rw-r--r--
📄
tableChart.js
11.54 KB
08/14/2022 11:05:21 AM
rw-r--r--
📄
tableChart_07Jan2020.js
6.7 KB
08/14/2022 11:05:19 AM
rw-r--r--
📄
tree.js
7.34 KB
08/14/2022 11:05:19 AM
rw-r--r--
📄
waterfall.js
9.17 KB
08/14/2022 11:05:21 AM
rw-r--r--
📄
zoomTree.js
7.59 KB
08/14/2022 11:05:19 AM
rw-r--r--
Editing: sun.js
Close
function drawSunburst(data, divId, Title, Width, Height, Ndim, Nmeas, MeasFormats,dispObj,toolTip){ d3.select("#"+divId).html('<div class="myChart"><div class="svgLegend"></div><div class="tipsy"><div class="tipsy-arrow"></div><div class="tipsy-inner"></div></div></div>'); d3.selectAll(".tipsy").style("display", "none"); var svg, w, h, measNum=1, json=makeJsonFromArrayNew(data, Ndim, Nmeas, MeasFormats[0], dispObj), curNode=json; svg = findSvgArea(Nmeas,dispObj,json, Width, Height,divId); resolveComputeMeasure(json, dispObj.RD.General.Measures); var radius = Math.min(svg[2], svg[3]) / 2, x = d3.scale.linear() .range([0, 2 * Math.PI]), y = d3.scale.pow().exponent(1.3).domain([0, 1]).range([0, radius]), color = d3.scale.ordinal().range(dispObj.colorArr); if(dispObj.getShowLegend()) makeLegend(svg,Nmeas,measNum,clickSunLegend,0,json,0,0, dispObj); svg[0].attr("transform", "translate(" + svg[3]/2 + "," + svg[2]/2 + ")"); var partition = d3.layout.partition() .value(function(d) {return d.size[measNum-1];}) .sort(null); var arc = d3.svg.arc() .startAngle(function(d) { return Math.max(0, Math.min(2 * Math.PI, x(d.x))); }) .endAngle(function(d) { return Math.max(0, Math.min(2 * Math.PI, (x(d.x + d.dx)).toFixed(14))); }) .innerRadius(function(d) { return Math.max(0, y(d.y)); }) .outerRadius(function(d) { return Math.max(0, y(d.y + d.dy)); }); function findParentCol(d){ return d.parent ? d.parent.depth!=1 ? findParentCol(d.parent) : color(d.parent.name):color(d.name); } var path = svg[0].selectAll("path") .data(partition.nodes(json)) .enter().append("path") .attr("d", arc) .style("fill", function(d) { if(d.depth<=1) return color(d.name); else return findParentCol(d); }) .style("stroke","white") .on("click", function(d){clicksun(d)})//click(divId, d) .on("mouseover", function(d,i){showToolTips(divId, d,measNum,MeasFormats)}) .on("mouseout", function(d,i){hideToolTip(divId, d,i)}); var text = svg[0].selectAll("text") .data(partition.nodes(json)) var textEnter = text.enter().append("text") .attr("text-anchor", "middle") .attr("dy", ".2em") .style("fill","white") .attr("transform", function(d) { var multiline = (d.name || "").split(" ").length > 1, angle = x(d.x + d.dx / 2) * 180 / Math.PI - 90, rotate = angle + (multiline ? -.5 : 0); return textPos(d,rotate,angle) }) .text(function(d) { return d.name.replace("'","'");}) .style("visibility",function(d){ return d.name.length < (Math.max(0, Math.min(2 * Math.PI, x(d.x + d.dx)))-Math.max(0, Math.min(2 * Math.PI, x(d.x))))*(radius*d.depth/24) ? "visible" : d.name.length > (Math.max(0, y(d.y + d.dy))- Math.max(0, y(d.y)))/6 ? "hidden" : (Math.max(0, Math.min(2 * Math.PI, x(d.x + d.dx)))-Math.max(0, Math.min(2 * Math.PI, x(d.x)))) < 0.1 ? "hidden" : "visible" ; } ) .on("click", function(d){clicksun(d)}) .on("mouseover", function(d,i){showToolTips(divId, d,measNum,MeasFormats)}) .on("mouseout", function(d,i){hideToolTip(divId, d,i)}); if(dispObj.getShowLabel()) svg[0].append("text").attr("class","label") .text(json.dimName) .attr("transform","translate("+(radius+lblPad+10)+","+0+")") .style("text-anchor", "middle"); function clicksun( d) { curNode=d; path.transition() .duration(300) .attrTween("d", arcTween(d)); text.transition() .duration(300) .attrTween("text-anchor", function(d){ return function() { return "middle";} }) .attrTween("transform", function(d) { var multiline = (d.name || "").split(" ").length > 1; return function() { var angle = x(d.x + d.dx / 2) * 180 / Math.PI - 90, rotate = angle + (multiline ? -.5 : 0); return textPos(d,rotate,angle) }; }) .style("fill-opacity", function(e) { return isParentOf(d, e) ? 1 : 1e-6; }) .each("end", function(e) { d3.select(this).style("visibility", isParentOf(d, e) ? e.name.length < (Math.max(0, Math.min(2 * Math.PI, x(e.x + e.dx)))-Math.max(0, Math.min(2 * Math.PI, x(e.x))))*(radius*e.depth/24) ? "visible" : e.name.length > (Math.max(0, y(e.y + e.dy))- Math.max(0, y(e.y)))/6 ? "hidden" : (Math.max(0, Math.min(2 * Math.PI, x(e.x + e.dx)))-Math.max(0, Math.min(2 * Math.PI, x(e.x)))) < 0.1 ? "hidden" : "visible" : "hidden"); }) updateLegend(divId, d, measNum); } function clickSunLegend(measNum){ //Update data and measNum according to new measure. partition.value(function(d) { return d.size[measNum-1]; }); path.data(partition.nodes(json)).on("mouseover", function(d,i){showToolTips(divId, d,measNum,MeasFormats)}); text.data(partition.nodes(json)).on("mouseover", function(d,i){showToolTips(divId, d,measNum,MeasFormats)}); clicksun(curNode); } function textPos (d,rotate,angle){ if(d.depth!=0){ return d.name.length < (Math.max(0, Math.min(2 * Math.PI, x(d.x + d.dx)))-Math.max(0, Math.min(2 * Math.PI, x(d.x))))*(radius*d.depth/24) ? "rotate(" + rotate + ")translate(" + ( y(d.y + d.dy / 2)) + ")rotate(" + (angle > 90 ? (angle > 135 ? 90 : -90) : (angle < 0 ? 90 : -90))+")" : "rotate(" + rotate + ")translate(" + (y(d.y+d.dy / 2)) + ")rotate(" + (angle > 90 ? -180 : 0) + ")"; } } function isParentOf(p, c) { if (p === c) return true; if (p.children) { return p.children.some(function(d) { return isParentOf(d, c); }); } return false; } function arcTween(d,f) { var xd = d3.interpolate(x.domain(), [d.x,d.x+d.dx/0.99999999]),//d.dx yd = d3.interpolate(y.domain(), [d.y, 1]), yr = d3.interpolate(y.range(), [d.y ? 20 : 0, radius]); return function(d, i) { return i ? function(t) { return arc(d); } : function(t) { x.domain(xd(t)); y.domain(yd(t)).range(yr(t)); return arc(d); }; }; } function updateLegend(divId, d, n){ d3.select("#"+divId).select(".myChart").select(".svgLegend").selectAll("#trail").remove(); var trail = d3.select("#"+divId).select(".myChart").select(".svgLegend").append("svg:svg") .attr("id", "trail"); var b = { w: 0, h: 17, s: 3, t: 10, wd:0 }; var w = new Array(); w[-1]=0; var t=0; function breadcrumbPoints(d,i) { var points = []; w[i] = d.name.length*4+15; t = t+w[i]; b.w = b.w + d.name.length+15; points.push(t-w[i]+b.t*i+",0"); points.push(t+b.t*i + ",0"); points.push(b.t*(i+1)+t + "," + (b.h / 2)); points.push(t+b.t*i + "," + b.h); points.push(b.t*i + (i ? t-w[i] : 0) +"," + b.h); if (i > 0) { // Leftmost breadcrumb; don't include 6th vertex. points.push(b.t +b.t*i + (i ? t-w[i] : 0)+ "," + (b.h / 2)); } return points.join(" "); } var i =0; var g; dispIfParent(d); function dispIfParent (d){ if(d.parent) dispIfParent(d.parent); g = trail.append("svg:g") g.append("svg:polygon") .attr("points", function(){return breadcrumbPoints(d,i);}) .on("click",function(){ trail.selectAll("g").remove(); clicksun(d) }) .style("fill",function() { if(d.depth<=1) return color(d.name); else return findParentCol(d); }) g.append("svg:text") .text(d.name.replace("'","'")) .attr("x",t-w[i]/2+b.t*i ) .attr("y",b.h/2) .style("text-anchor","middle") .attr("dy","0.4em") .attr("dx","0.7em") .style("fill","white") .on("click",function(){ trail.selectAll("g").remove(); clicksun(d) }); i++; } if(d==json) trail.selectAll("g").remove(); } //clickSunLegend(1); // TEMP FIX }