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: zoomTree.js
Close
function drawZoomTree(data, divId, Title, Width, Height, Ndim, Nmeas, MeasFormats, dispObj, toolTip){ var root, node, measNum = 1, n = Nmeas, margin={top:24, right:0, bottom:0, left:0}; var json=makeJsonFromArrayNew(data, Ndim, Nmeas, MeasFormats[0], dispObj); makeParentsJson(json,0); resolveComputeMeasure(json, dispObj.RD.General.Measures); d3.select("#"+divId).html('<div class="myChart"><div class="tipsy"><div class="tipsy-arrow"></div><div class="tipsy-inner"></div></div></div>'); d3.selectAll(".tipsy").style("display", "none"); var color = d3.scale.category20c(); var svg = findSvgArea(Nmeas,dispObj,json, Width, Height+20,divId); if(dispObj.getShowLegend()) makeLegend(svg,n,measNum,plotTree,0,json,0,0, dispObj); var height = svg[2]-24, width=svg[3]; var x = d3.scale.linear() .domain([0, width]) .range([0, width]); var y = d3.scale.linear() .domain([0, height]) .range([0, height]); plotTree(measNum ) ; function plotTree(measNum ) { var root; var transitioning; var treemap = d3.layout.treemap() .children(function(d, depth) { return depth ? null : d._children; }) .sort(function(a, b) { return a.size[measNum-1]- b.size[measNum-1]; }) .ratio(height / width * 0.5 * (1 + Math.sqrt(5))) .value(function(d) { return d.size[measNum-1]; }) .round(false); d3.select(svg[0][0][0]).attr("transform", "translate(" + margin.left + "," + margin.top + ")"); /*var svg = d3.select("#chart").append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.bottom + margin.top) .style("margin-left", -margin.left + "px") .style("margin.right", -margin.right + "px") .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")") .style("shape-rendering", "crispEdges"); */ /*svg[0].append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")") .style("shape-rendering", "crispEdges") */ var grandparent = svg[0] .append("g") .attr("class", "grandparent"); grandparent.append("rect") .attr("y", -margin.top) .attr("width", width) .attr("height", margin.top); grandparent.append("text") .attr("x", 6) .attr("y", 6 - margin.top) .attr("dy", ".75em"); root = json; initialize(root); accumulate(root); layout(root); console.log(root); display(root); if (window.parent !== window) { var myheight = document.documentElement.scrollHeight || document.body.scrollHeight; window.parent.postMessage({height: myheight}, '*'); } function initialize(root) { root.x = root.y = 0; root.dx = width; root.dy = height; root.depth = 0; } // Aggregate the values for internal nodes. This is normally done by the // treemap layout, but not here because of our custom implementation. // We also take a snapshot of the original children (_children) to avoid // the children being overwritten when when layout is computed. function accumulate(d) { if(d.children){ d._children=d.children; for(var i=0; i<d.children.length; i++){ accumulate(d.children[i]); } } //return (d._children = d.values) // ? d.value = d.values.reduce(function(p, v) { return p + accumulate(v); }, 0) // : d.value; } // Compute the treemap layout recursively such that each group of siblings // uses the same size (1Γ1) rather than the dimensions of the parent cell. // This optimizes the layout for the current zoom state. Note that a wrapper // object is created for the parent node for each group of siblings so that // the parentβs dimensions are not discarded as we recurse. Since each group // of sibling was laid out in 1Γ1, we must rescale to fit using absolute // coordinates. This lets us use a viewport to zoom. function layout(d) { if (d._children) { treemap.nodes({_children: d._children}); d._children.forEach(function(c) { c.x = d.x + c.x * d.dx; c.y = d.y + c.y * d.dy; c.dx *= d.dx; c.dy *= d.dy; c.parent = d; layout(c); }); } } function display(d) { grandparent .datum(d.parent) .on("click", transition) .select("text") .text(name(d)); var g1 = svg[0].insert("g", ".grandparent") .datum(d) .attr("class", "depth"); var g = g1.selectAll("g") .data(d._children) .enter().append("g"); g.filter(function(d) { return d._children; }) .classed("children", true) .on("click", transition); var children = g.selectAll(".child") .data(function(d) { return d._children || [d]; }) .enter().append("g"); children.append("rect") .attr("class", "child") .call(rect) .on("mouseover", function(d,i){showToolTips(divId, d, measNum,MeasFormats)}) .on("mouseout", function(d,i){hideToolTip(divId, d,i)}); children.append("text") .attr("class", "ctext") .text(function(d) { return d.name; }) .call(text2); g.append("rect") .attr("class", "parent") .call(rect); var t = g.append("text") .attr("class", "ptext") .attr("dy", ".75em") t.append("tspan") .text(function(d) { return d.name; }); t.append("tspan") .attr("dy", "1.0em") .text(function(d) { return formatData(d.size[measNum-1], MeasFormats[measNum-1],0); }); t.call(text); g.selectAll("rect") .style("fill", function(d) { return color(d.name); }); function transition(d) { if (transitioning || !d) return; transitioning = true; var g2 = display(d), t1 = g1.transition().duration(750), t2 = g2.transition().duration(750); // Update the domain only after entering new elements. x.domain([d.x, d.x + d.dx]); y.domain([d.y, d.y + d.dy]); // Enable anti-aliasing during the transition. svg[0].style("shape-rendering", null); // Draw child nodes on top of parent nodes. svg[0].selectAll(".depth").sort(function(a, b) { return a.depth - b.depth; }); // Fade-in entering text. g2.selectAll("text").style("fill-opacity", 0); // Transition to the new view. t1.selectAll(".ptext").call(text).style("fill-opacity", 0); t1.selectAll(".ctext").call(text2).style("fill-opacity", 0); t2.selectAll(".ptext").call(text).style("fill-opacity", 1); t2.selectAll(".ctext").call(text2).style("fill-opacity", 1); t1.selectAll("rect").call(rect); t2.selectAll("rect").call(rect); // Remove the old node when the transition is finished. t1.remove().each("end", function() { svg[0].style("shape-rendering", "crispEdges"); transitioning = false; }); } return g; } function text(text) { text.selectAll("tspan") .attr("x", function(d) { return x(d.x) + 6; }) text.attr("x", function(d) { return x(d.x) + 6; }) .attr("y", function(d) { return y(d.y) + 6; }) .style("opacity", function(d) { return this.getComputedTextLength() < x(d.x + d.dx) - x(d.x) ? 1 : 0; }); } function text2(text) { text.attr("x", function(d) { return x(d.x + d.dx) - this.getComputedTextLength() - 6; }) .attr("y", function(d) { return y(d.y + d.dy) - 6; }) .style("opacity", function(d) { return this.getComputedTextLength() < x(d.x + d.dx) - x(d.x) ? 1 : 0; }); } function rect(rect) { rect.attr("x", function(d) { return x(d.x); }) .attr("y", function(d) { return y(d.y); }) .attr("width", function(d) { return x(d.x + d.dx) - x(d.x); }) .attr("height", function(d) { return y(d.y + d.dy) - y(d.y); }); } function name(d) { return d.parent ? name(d.parent) + " / " + d.name + " (" + formatData(d.size[measNum-1], MeasFormats[measNum-1], 0) + ")" : d.name + " (" + formatData(d.size[measNum-1], MeasFormats[measNum-1], 0) + ")"; } } }