%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/opti/workflow/src/public/app-assets/js/scripts/charts/d3/other/
Upload File :
Create Path :
Current File : /home/opti/workflow/src/public/app-assets/js/scripts/charts/d3/other/treemap.min.js

/*!
 * stack-admin-theme (https://pixinvent.com/bootstrap-admin-template/stack)
 * Copyright 2018 PIXINVENT
 * Licensed under the Themeforest Standard Licenses
 */
$(window).on("load",function(){function position(){this.style("left",function(d){return d.x+"px"}).style("top",function(d){return d.y+"px"}).style("width",function(d){return Math.max(0,d.dx-1)+"px"}).style("height",function(d){return Math.max(0,d.dy-1)+"px"})}var ele=d3.select("#treemap"),margin={top:20,right:20,bottom:30,left:50},width=ele.node().getBoundingClientRect().width-margin.left-margin.right,height=500-margin.top-margin.bottom,color=d3.scale.ordinal().range(["#99B898","#FECEA8","#FF847C","#E84A5F","#F8B195","#F67280","#C06C84"]),treemap=d3.layout.treemap().size([width,height]).sticky(!0).value(function(d){return d.size}),container=ele.append("div"),div=container.style("position","relative").style("width",width+margin.left+margin.right+"px").style("height",height+margin.top+margin.bottom+"px").style("left",margin.left+"px").style("top",margin.top+"px");d3.json("../../../app-assets/data/d3/other/treemap.json",function(error,root){if(error)throw error;var node=div.datum(root).selectAll(".node").data(treemap.nodes).enter().append("div").attr("class","node").call(position).style("background",function(d){return d.children?color(d.name):null}).style("border","solid 1px white").style("font-size","10px").style("line-height","12px").style("overflow","hidden").style("position","absolute").style("text-indent","2px").style("color","#000").text(function(d){return d.children?null:d.name});d3.selectAll("input").on("change",function(){var value="count"===this.value?function(){return 1}:function(d){return d.size};node.data(treemap.value(value).nodes).transition().duration(1500).call(position)})})});

Zerion Mini Shell 1.0