Skip to content

Instantly share code, notes, and snippets.

@timelyportfolio
Last active June 16, 2017 14:47
Show Gist options
  • Save timelyportfolio/44bd24c433126492c530dac618e2ddc7 to your computer and use it in GitHub Desktop.
Save timelyportfolio/44bd24c433126492c530dac618e2ddc7 to your computer and use it in GitHub Desktop.
flubberized sunburst
license: mit

spinoff of timelyportfolio's block: flubberized US states to/from hex
This is a combination of quite a few numerous generous open-source contributions. Thanks especially to [Mike Bostock](https://bost.ocks.org/mike/) and [Noah Veltman](https://noahveltman.com/).

Code in R

library(sunburstR)
library(htmltools)

# d3 source tree from Mike Bostock
# https://gist.githubusercontent.com/mbostock/8fe6fa6ed1fa976e5dd76cfa4d816fec/
d3_src <- read.csv(
  "https://gist.githubusercontent.com/mbostock/8fe6fa6ed1fa976e5dd76cfa4d816fec/raw/122aa364ef1b0134455654f446e15dbfd1c95f86/d3.csv",
  stringsAsFactors = FALSE
)

d3_tree <- sunburstR:::csv_to_hier(
  d3_src[,2:1],
  delim = "/"
)

sb <- sunburst(d3_tree, withD3 = TRUE)
sb$x$tasks <- list(htmlwidgets::JS("
function(){
  var chart = this.instance.chart;
  var el = this.el;
  var svg = d3.select(el).select('.sunburst-chart>svg');

  chart.on('click.tree', function(d) {
    svg.selectAll('.tree')
      .transition()
      .style('opacity', 0.001)
      .remove();

    // interpolate to rect
    var cloned = d3.select(event.target.cloneNode(true));
    cloned
      .classed('tree', true)
      .attr('transform', svg.select('g').attr('transform'));
    svg.node().appendChild(cloned.node());
    

    var interpolator = flubber.interpolate(
      d3.select(event.target).attr('d'),
      [[0,0],[0,100],[100,100],[100,0],[0,0]]
    );
    cloned
      .transition()
      .duration(1500)
      .attrTween('d', function(){ return interpolator; })
      .attr('transform', 'translate(0,0)');

    //interpolate rect to tree with separate
    var hier = d3.hierarchy(d3.select(event.target).datum())
      .sum(function(d) {return d.data.size});
    if(hier.children) {
      var tree = d3.treemap().size([100,100])(hier);
      tree.children.map(function(d) {
        svg.append('rect')
          .classed('tree', true)
          .attr('transform', 'translate(' + d.x0 + ',' + d.y0 + ')')
          .attr('width', d.x1 - d.x0)
          .attr('height', d.y1 - d.y0)
          .style('stroke', 'white')
          .style('fill','none')
          .style('opacity',0.00001)
          .transition()
          .delay(100)
          .style('opacity',1)
      });
    }
  })
}
"))

                 
                 
browsable(
  tagList(
    tags$head(tags$script(src="https://unpkg.com/flubber")),
    sb
  )
)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script src="data:application/x-javascript;base64,KGZ1bmN0aW9uKCkgewogIC8vIElmIHdpbmRvdy5IVE1MV2lkZ2V0cyBpcyBhbHJlYWR5IGRlZmluZWQsIHRoZW4gdXNlIGl0OyBvdGhlcndpc2UgY3JlYXRlIGEKICAvLyBuZXcgb2JqZWN0LiBUaGlzIGFsbG93cyBwcmVjZWRpbmcgY29kZSB0byBzZXQgb3B0aW9ucyB0aGF0IGFmZmVjdCB0aGUKICAvLyBpbml0aWFsaXphdGlvbiBwcm9jZXNzICh0aG91Z2ggbm9uZSBjdXJyZW50bHkgZXhpc3QpLgogIHdpbmRvdy5IVE1MV2lkZ2V0cyA9IHdpbmRvdy5IVE1MV2lkZ2V0cyB8fCB7fTsKCiAgLy8gU2VlIGlmIHdlJ3JlIHJ1bm5pbmcgaW4gYSB2aWV3ZXIgcGFuZS4gSWYgbm90LCB3ZSdyZSBpbiBhIHdlYiBicm93c2VyLgogIHZhciB2aWV3ZXJNb2RlID0gd2luZG93LkhUTUxXaWRnZXRzLnZpZXdlck1vZGUgPQogICAgICAvXGJ2aWV3ZXJfcGFuZT0xXGIvLnRlc3Qod2luZG93LmxvY2F0aW9uKTsKCiAgLy8gU2VlIGlmIHdlJ3JlIHJ1bm5pbmcgaW4gU2hpbnkgbW9kZS4gSWYgbm90LCBpdCdzIGEgc3RhdGljIGRvY3VtZW50LgogIC8vIE5vdGUgdGhhdCBzdGF0aWMgd2lkZ2V0cyBjYW4gYXBwZWFyIGluIGJvdGggU2hpbnkgYW5kIHN0YXRpYyBtb2Rlc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AgICAgdGFzayA9IHRhc2suY29kZTsKICAgICAgICB9CiAgICAgICAgdmFyIHRhc2tGdW5jID0gZXZhbCgiKCIgKyB0YXNrICsgIikiKTsKICAgICAgICBpZiAodHlwZW9mKHRhc2tGdW5jKSAhPT0gImZ1bmN0aW9uIikgewogICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCJUYXNrIG11c3QgYmUgYSBmdW5jdGlvbiEgU291cmNlOlxuIiArIHRhc2spOwogICAgICAgIH0KICAgICAgICB0YXNrRnVuYy5hcHBseSh0YXJnZXQsIHRoZXNlQXJncyk7CiAgICAgIH0pOwogICAgfQogIH0KCiAgZnVuY3Rpb24gaW5pdFNpemluZyhlbCkgewogICAgdmFyIHNpemluZyA9IHNpemluZ1BvbGljeShlbCk7CiAgICBpZiAoIXNpemluZykKICAgICAgcmV0dXJuOwoKICAgIHZhciBjZWwgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiaHRtbHdpZGdldF9jb250YWluZXIiKTsKICAgIGlmICghY2VsKQogICAgICByZXR1cm47CgogICAgaWYgKHR5cGVvZihzaXppbmcucGFkZGluZykgIT09ICJ1bmRlZmluZWQiKSB7CiAgICAgIGRvY3VtZW50LmJvZHkuc3R5bGUubWFyZ2luID0gIjAiOwogICAgICBkb2N1bWVudC5ib2R5LnN0eWxlLnBhZGRpbmcgPSBwYWRkaW5nVG9Dc3ModW5wYWNrUGFkZGluZyhzaXppbmcucGFkZGluZykpOwogICAgfQoKICAgIGlmIChzaXppbmcuZmlsbCkgewogICAgICBkb2N1bWVudC5ib2R5LnN0eWxlLm92ZXJmbG93ID0gImhpZGRlbiI7CiAgICAgIGRvY3VtZW50LmJvZHkuc3R5bGUud2lkdGggPSAiMTAwJSI7CiAgICAgIGRvY3VtZW50LmJvZHkuc3R5bGUuaGVpZ2h0ID0gIjEwMCUiOwogICAgICBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuc3R5bGUud2lkdGggPSAiMTAwJSI7CiAgICAgIGRvY3Vt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mcgaXQgaW1wb3NzaWJsZSBmb3IKICAgICAgICAgICAgLy8gdGhlIGVsZW1lbnQgdG8gc2hyaW5rOyBzbyB1c2UgbWF4LXdpZHRoIGluc3RlYWQKICAgICAgICAgICAgLmNzcygibWF4V2lkdGgiLCBlbC5vZmZzZXRXaWR0aCkKICAgICAgICAgICAgLmNzcygiaGVpZ2h0IiwgZWwub2Zmc2V0SGVpZ2h0KTsKICAgICAgICAgIGVycm9yRGl2LnRleHQoZXJyLm1lc3NhZ2UpOwogICAgICAgICAgJGVsLmFmdGVyKGVycm9yRGl2KTsKCiAgICAgICAgICAvLyBSZWFsbHkgZHVtYiB3YXkgdG8ga2VlcCB0aGUgc2l6ZS9wb3NpdGlvbiBvZiB0aGUgZXJyb3IgaW4gc3luYyB3aXRoCiAgICAgICAgICAvLyB0aGUgcGFyZW50IGVsZW1lbnQgYXMgdGhlIHdpbmRvdyBpcyByZXNpemVkIG9yIHdoYXRldmVyLgogICAgICAgICAgdmFyIGludElkID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24oKSB7CiAgICAgICAgICAgIGlmICghZXJyb3JEaXZbMF0ucGFyZW50RWxlbWVudCkgewogICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwoaW50SWQpOwogICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQogICAgICAgICAgICBlcnJvckRpdgogICAgICAgICAgICAgIC5jc3MoInRvcCIsIGVsLm9mZnNldFRvcCkKICAgICAgICAgICAgICAuY3NzKCJsZWZ0IiwgZWwub2Zmc2V0TGVmdCkKICAgICAgICAgICAgICAuY3NzKCJtYXhXaWR0aCIsIGVsLm9mZnNldFdpZHRoKQogICAgICAgICAgICAgIC5jc3MoImhlaWdodCIsIGVsLm9mZnNldEhlaWdodCk7CiAgICAgICAgICB9LCA1MDApOwogICAgICAgIH0KICAgICAgfQogICAgfSwKICAgIGNsZWFyRXJyb3I6IGZ1bmN0aW9uKGVsKSB7CiAgICAgIHZhciAkZWwgPSAkKGV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SkgZGF0YS5ldmFscyA9IFtkYXRhLmV2YWxzXTsKICAgICAgICBmb3IgKHZhciBpID0gMDsgZGF0YS5ldmFscyAmJiBpIDwgZGF0YS5ldmFscy5sZW5ndGg7IGkrKykgewogICAgICAgICAgd2luZG93LkhUTUxXaWRnZXRzLmV2YWx1YXRlU3RyaW5nTWVtYmVyKGRhdGEueCwgZGF0YS5ldmFsc1tpXSk7CiAgICAgICAgfQogICAgICAgIGlmICghYmluZGluZ0RlZi5yZW5kZXJPbk51bGxWYWx1ZSkgewogICAgICAgICAgaWYgKGRhdGEueCA9PT0gbnVsbCkgewogICAgICAgICAgICBlbC5zdHlsZS52aXNpYmlsaXR5ID0gImhpZGRlbiI7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGVsLnN0eWxlLnZpc2liaWxpdHkgPSAiaW5oZXJpdCI7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmICghZWxlbWVudERhdGEoZWwsICJpbml0aWFsaXplZCIpKSB7CiAgICAgICAgICBpbml0U2l6aW5nKGVsKTsKCiAgICAgICAgICBlbGVtZW50RGF0YShlbCwgImluaXRpYWxpemVkIiwgdHJ1ZSk7CiAgICAgICAgICBpZiAoYmluZGluZ0RlZi5pbml0aWFsaXplKSB7CiAgICAgICAgICAgIHZhciByZXN1bHQgPSBiaW5kaW5nRGVmLmluaXRpYWxpemUoZWwsIGVsLm9mZnNldFdpZHRoLAogICAgICAgICAgICAgIGVsLm9mZnNldEhlaWdodCk7CiAgICAgICAgICAgIGVsZW1lbnREYXRhKGVsLCAiaW5pdF9yZXN1bHQiLCByZXN1bHQpOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBTaGlueS5yZW5kZXJEZXBlbmRlbmNpZXMoZGF0YS5kZXBzKTsKICAgICAgICBiaW5kaW5nRGVmLnJlbmRlclZhbHVlKGVsLCBkYXRhLngsIGVsZW1lbnREYXRhKGVsLCAiaW5pdF9yZXN1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ogPyBzaXplT2JqLmdldEhlaWdodCgpIDogZWwub2Zmc2V0SGVpZ2h0CiAgICAgICAgICApOwogICAgICAgICAgZWxlbWVudERhdGEoZWwsICJpbml0X3Jlc3VsdCIsIGluaXRSZXN1bHQpOwogICAgICAgIH0KCiAgICAgICAgaWYgKGJpbmRpbmcucmVzaXplKSB7CiAgICAgICAgICB2YXIgbGFzdFNpemUgPSB7fTsKICAgICAgICAgIHZhciByZXNpemVIYW5kbGVyID0gZnVuY3Rpb24oZSkgewogICAgICAgICAgICB2YXIgc2l6ZSA9IHsKICAgICAgICAgICAgICB3OiBzaXplT2JqID8gc2l6ZU9iai5nZXRXaWR0aCgpIDogZWwub2Zmc2V0V2lkdGgsCiAgICAgICAgICAgICAgaDogc2l6ZU9iaiA/IHNpemVPYmouZ2V0SGVpZ2h0KCkgOiBlbC5vZmZzZXRIZWlnaHQKICAgICAgICAgICAgfTsKICAgICAgICAgICAgaWYgKHNpemUudyA9PT0gMCAmJiBzaXplLmggPT09IDApCiAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICBpZiAoc2l6ZS53ID09PSBsYXN0U2l6ZS53ICYmIHNpemUuaCA9PT0gbGFzdFNpemUuaCkKICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgIGxhc3RTaXplID0gc2l6ZTsKICAgICAgICAgICAgYmluZGluZy5yZXNpemUoZWwsIHNpemUudywgc2l6ZS5oLCBpbml0UmVzdWx0KTsKICAgICAgICAgIH07CgogICAgICAgICAgb24od2luZG93LCAicmVzaXplIiwgcmVzaXplSGFuZGxlcik7CgogICAgICAgICAgLy8gVGhpcyBpcyBuZWVkZWQgZm9yIGNhc2VzIHdoZXJlIHdlJ3JlIHJ1bm5pbmcgaW4gYSBTaGlueQogICAgICAgICAgLy8gYXBwLCBidXQgdGhlIHdpZGdldCBpdHNlbGYgaXMgbm90IGEgU2hpbnkgb3V0cHV0LCBidXQKICAgICAgICAgIC8vIHJhdGhlciBhIHNpbXBsZSBzdGF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HR5cGU6IGRlZm4udHlwZSwKICAgICAgaW5pdGlhbGl6ZTogZnVuY3Rpb24oZWwsIHdpZHRoLCBoZWlnaHQpIHsKICAgICAgICByZXR1cm4gZGVmbi5mYWN0b3J5KGVsLCB3aWR0aCwgaGVpZ2h0KTsKICAgICAgfSwKICAgICAgcmVuZGVyVmFsdWU6IGZ1bmN0aW9uKGVsLCB4LCBpbnN0YW5jZSkgewogICAgICAgIHJldHVybiBpbnN0YW5jZS5yZW5kZXJWYWx1ZSh4KTsKICAgICAgfSwKICAgICAgcmVzaXplOiBmdW5jdGlvbihlbCwgd2lkdGgsIGhlaWdodCwgaW5zdGFuY2UpIHsKICAgICAgICByZXR1cm4gaW5zdGFuY2UucmVzaXplKHdpZHRoLCBoZWlnaHQpOwogICAgICB9CiAgICB9OwoKICAgIGlmIChkZWZuLmZpbmQpCiAgICAgIHJlc3VsdC5maW5kID0gZGVmbi5maW5kOwogICAgaWYgKGRlZm4ucmVuZGVyRXJyb3IpCiAgICAgIHJlc3VsdC5yZW5kZXJFcnJvciA9IGRlZm4ucmVuZGVyRXJyb3I7CiAgICBpZiAoZGVmbi5jbGVhckVycm9yKQogICAgICByZXN1bHQuY2xlYXJFcnJvciA9IGRlZm4uY2xlYXJFcnJvcjsKCiAgICByZXR1cm4gcmVzdWx0OwogIH0KfSkoKTsKCg=="></script>
<link href="data:text/css;charset=utf-8,%2Esunburst%2Dmain%20%7B%0Awidth%3A%2090%25%3B%0Aheight%3A%20100%25%3B%0A%7D%0A%2Esunburst%2Dsidebar%20%7B%0Aposition%3A%20absolute%3B%0Aright%3A%2010px%3B%0Atop%3A%2010px%3B%0A%7D%0A%2Esunburst%2Dsequence%20%7B%0Awidth%3A%20100%25%3B%0Aposition%3A%20absolute%3B%0Atop%3A%200px%3B%0Aleft%3A%200px%3B%0Apointer%2Devents%3A%20none%3B%0A%7D%0A%2Esunburst%2Dlegend%20%7B%0Apadding%3A%2010px%200%200%203px%3B%0A%7D%0A%2Esunburst%2Dchart%20%7B%0Awidth%3A%20100%25%3B%0Aheight%3A%20100%25%3B%0Aposition%3A%20absolute%3B%0Atop%3A%2070px%3B%0A%7D%0A%2Esunburst%2Dchart%20path%20%7B%0Astroke%3A%20%23fff%3B%0A%7D%0A%2Esunburst%2Dexplanation%20%7B%0Aposition%3A%20absolute%3B%0Atext%2Dalign%3A%20center%3B%0Acolor%3A%20%23666%3B%0Az%2Dindex%3A%20999%3B%0Afont%2Dsize%3A%202em%3B%0Apointer%2Devents%3A%20none%3B%0A%7D%0A" rel="stylesheet" />
<script src="data:application/x-javascript;base64,KGZ1bmN0aW9uIGUodCxuLHIpe2Z1bmN0aW9uIHMobyx1KXtpZighbltvXSl7aWYoIXRbb10pe3ZhciBhPXR5cGVvZiByZXF1aXJlPT0iZnVuY3Rpb24iJiZyZXF1aXJlO2lmKCF1JiZhKXJldHVybiBhKG8sITApO2lmKGkpcmV0dXJuIGkobywhMCk7dmFyIGY9bmV3IEVycm9yKCJDYW5ub3QgZmluZCBtb2R1bGUgJyIrbysiJyIpO3Rocm93IGYuY29kZT0iTU9EVUxFX05PVF9GT1VORCIsZn12YXIgbD1uW29dPXtleHBvcnRzOnt9fTt0W29dWzBdLmNhbGwobC5leHBvcnRzLGZ1bmN0aW9uKGUpe3ZhciBuPXRbb11bMV1bZV07cmV0dXJuIHMobj9uOmUpfSxsLGwuZXhwb3J0cyxlLHQsbixyKX1yZXR1cm4gbltvXS5leHBvcnRzfXZhciBpPXR5cGVvZiByZXF1aXJlPT0iZnVuY3Rpb24iJiZyZXF1aXJlO2Zvcih2YXIgbz0wO288ci5sZW5ndGg7bysrKXMocltvXSk7cmV0dXJuIHN9KSh7MTpbZnVuY3Rpb24ocmVxdWlyZSxtb2R1bGUsZXhwb3J0cyl7DQooZnVuY3Rpb24gKGdsb2JhbCwgZmFjdG9yeSkgew0KCXR5cGVvZiBleHBvcnRzID09PSAnb2JqZWN0JyAmJiB0eXBlb2YgbW9kdWxlICE9PSAndW5kZWZpbmVkJyA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XJyX2JyZWFkY3J1bWJfaCArPSBiLmggKyBiLmgvMjsNCiAgICAgICAgICAgICAgY3Vycl9icmVhZGNydW1iX3ggPSBiLnQgKyBiLnM7ICAgICAvLyByZXN0YXJ0IGNvdW50ZXINCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIGJlbmQuZGF0dW0oew0KICAgICAgICAgICAgICAiYnJlYWRjcnVtYl94IjogY3Vycl9icmVhZGNydW1iX3gsDQogICAgICAgICAgICAgICJicmVhZGNydW1iX2giOiBjdXJyX2JyZWFkY3J1bWJfaA0KICAgICAgICAgICAgfSk7DQogICAgICAgICAgICByZXR1cm4gY3Vycl9icmVhZGNydW1iX3g7DQogICAgICAgICAgfSkNCiAgICAgICAgICAuYXR0cigieSIsIGZ1bmN0aW9uKGQpe3JldHVybiBkLmJyZWFkY3J1bWJfaH0pDQogICAgICAgICAgLmF0dHIoImR5IiwgIjAuMzVlbSIpDQogICAgICAgICAgLmF0dHIoInRleHQtYW5jaG9yIiwgInN0YXJ0IikNCiAgICAgICAgICAudGV4dChwZXJjZW50YWdlU3RyaW5nKTsNCg0KDQogICAgfSBlbHNlIHsNCiAgICAgIGVudGVyaW5nLmFwcGVuZCgicG9seWdvbiIpDQogICAgICAgICAgLmF0dHIoInBvaW50cyIsIGJyZWFkY3J1bWJQb2ludHMpDQogICAgICAgICAgLnN0eWxlKCJmaWxsIiwgZnVuY3Rpb24oZCkgeyByZXR1cm4gY29sb3JzLmNhbGwodGhpcywgZC5kYXRhLm5hbWUpOyB9KTsNCg0KICAgICAgZW50ZXJpbmcuYXBwZW5kKCJ0ZXh0IikNCiAgICAgICAgICAuYXR0cigieCIsIChiLncgKyBiLnQpIC8gMikNCiAgICAgICAgICAuYXR0cigieSIsIGIuaCAvIDIpDQogICAgICAgICAgLmF0dHIoImR5IiwgIjAuMzVlbSIpDQogICAgICAgICAgLmF0dHIoInRleHQtYW5jaG9yIiwgIm1pZGRsZSIpDQogICAgICAgICAgLnRleHQoZnVuY3Rpb24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pemV9Ow0KICAgICAJY2hpbGRyZW4ucHVzaChjaGlsZE5vZGUpOw0KICAgICAgICAgIH0NCiAgICAgICAgfQ0KICAgICAgfQ0KICAgICAgcmV0dXJuIHJvb3Q7DQoNCiAgICB9DQoNCiAgICByZXR1cm4gew0KDQogICAgICByZW5kZXJWYWx1ZTogZnVuY3Rpb24oeCkgew0KDQogICAgICAgIGluc3RhbmNlLnggPSB4Ow0KDQogICAgICAgIC8vIHguZGF0YSBzaG91bGQgYmUgYSBkYXRhLmZyYW1lIGluIFIgc28gYW4gSmF2YXNjcmlwdCBPYmplY3Qgb2YgT2JqZWN0cw0KICAgICAgICAvLyAgICAgYnV0IGJ1aWxkSGllcmFyY2h5IGV4cGVjdHMgYW4gQXJyYXkgb2YgQXJyYXlzDQogICAgICAgIC8vICAgICBzbyB1c2UgZDMuemlwIGFuZCBhcHBseSB0byBkbyB0aGlzDQogICAgICAgIHZhciBqc29uID0gW107DQogICAgICAgIGlmKHR5cGVvZih4LmNzdmRhdGEpICE9PSAidW5kZWZpbmVkIil7DQogICAgICAgICAganNvbiA9IGJ1aWxkSGllcmFyY2h5KA0KICAgICAgICAgICAgZDNBcnJheS56aXAuYXBwbHkoDQogICAgICAgICAgICAgIG51bGwsDQogICAgICAgICAgICAgIE9iamVjdC5rZXlzKHguY3N2ZGF0YSkubWFwKGZ1bmN0aW9uKGt5KXtyZXR1cm4geC5jc3ZkYXRhW2t5XX0pDQogICAgICAgICAgICApDQogICAgICAgICAgKTsNCiAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICBqc29uID0geC5kYXRhOw0KICAgICAgICB9DQogICAgICAgIGluc3RhbmNlLmpzb24gPSBqc29uOw0KDQogICAgICAgIGRyYXcoZWwsIGluc3RhbmNlLCBkaXNwYXRjaF8pOw0KDQogICAgICB9LA0KDQogICAgICByZXNpemU6IGZ1bmN0aW9uKHdpZHRoLCBoZWlnaHQpIHsNCg0KICAgICAgICBkcmF3KGVsLCBpbnN0YW5jZSwgZGlz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iAgfTsNCn0NCg0KZnVuY3Rpb24gZW5jbG9zZUJhc2lzMihhLCBiKSB7DQogIHZhciB4MSA9IGEueCwgeTEgPSBhLnksIHIxID0gYS5yLA0KICAgICAgeDIgPSBiLngsIHkyID0gYi55LCByMiA9IGIuciwNCiAgICAgIHgyMSA9IHgyIC0geDEsIHkyMSA9IHkyIC0geTEsIHIyMSA9IHIyIC0gcjEsDQogICAgICBsID0gTWF0aC5zcXJ0KHgyMSAqIHgyMSArIHkyMSAqIHkyMSk7DQogIHJldHVybiB7DQogICAgeDogKHgxICsgeDIgKyB4MjEgLyBsICogcjIxKSAvIDIsDQogICAgeTogKHkxICsgeTIgKyB5MjEgLyBsICogcjIxKSAvIDIsDQogICAgcjogKGwgKyByMSArIHIyKSAvIDINCiAgfTsNCn0NCg0KZnVuY3Rpb24gZW5jbG9zZUJhc2lzMyhhLCBiLCBjKSB7DQogIHZhciB4MSA9IGEueCwgeTEgPSBhLnksIHIxID0gYS5yLA0KICAgICAgeDIgPSBiLngsIHkyID0gYi55LCByMiA9IGIuciwNCiAgICAgIHgzID0gYy54LCB5MyA9IGMueSwgcjMgPSBjLnIsDQogICAgICBhMiA9IHgxIC0geDIsDQogICAgICBhMyA9IHgxIC0geDMsDQogICAgICBiMiA9IHkxIC0geTIsDQogICAgICBiMyA9IHkxIC0geTMsDQogICAgICBjMiA9IHIyIC0gcjEsDQogICAgICBjMyA9IHIzIC0gcjEsDQogICAgICBkMSA9IHgxICogeDEgKyB5MSAqIHkxIC0gcjEgKiByMSwNCiAgICAgIGQyID0gZDEgLSB4MiAqIHgyIC0geTIgKiB5MiArIHIyICogcjIsDQogICAgICBkMyA9IGQxIC0geDMgKiB4MyAtIHkzICogeTMgKyByMyAqIHIzLA0KICAgICAgYWIgPSBhMyAqIGIyIC0gYTIgKiBiMywNCiAgICAgIHhhID0gKGIyICogZDMgLSBiMyAqIGQyKSAvIChhYiAqIDIpIC0geDEsDQogICAgICB4YiA9IChiMyAqIGMyIC0gYjIgKiBjMykgLyBhYiwNCiAgICAgIHlhID0gKGEzICogZDIgLSBhMiAqIGQzKSAvIChhYiAqIDIpIC0geTEsDQogICAgICB5YiA9IChhMiAqIGMzIC0gYTMgKiBjMikgLyBhYiwNCiAgICAgIEEgPSB4YiAqIHhiICsgeWIgKiB5YiAtIDEsDQogICAgICBCID0gMiAqIChyMSArIHhhICogeGIgKyB5YSAqIHliKSwNCiAgICAgIEMgPSB4YSAqIHhhICsgeWEgKiB5YSAtIHIxICogcjEsDQogICAgICByID0gLShBID8gKEIgKyBNYXRoLnNxcnQoQiAqIEIgLSA0ICogQSAqIEMpKSAvICgyICogQSkgOiBDIC8gQik7DQogIHJldHVybiB7DQogICAgeDogeDEgKyB4YSArIHhiICogciwNCiAgICB5OiB5MSArIHlhICsgeWIgKiByLA0KICAgIHI6IHINCiAgfTsNCn0NCg0KZnVuY3Rpb24gcGxhY2UoYSwgYiwgYykgew0KICB2YXIgYXggPSBhLngsDQogICAgICBheSA9IGEueSwNCiAgICAgIGRhID0gYi5yICsgYy5yLA0KICAgICAgZGIgPSBhLnIgKyBjLnIsDQogICAgICBkeCA9IGIueCAtIGF4LA0KICAgICAgZHkgPSBiLnkgLSBheSwNCiAgICAgIGRjID0gZHggKiBkeCArIGR5ICogZHk7DQogIGlmIChkYykgew0KICAgIHZhciB4ID0gMC41ICsgKChkYiAqPSBkYikgLSAoZGEgKj0gZGEpKSAvICgyICogZGMpLA0KICAgICAgICB5ID0gTWF0aC5zcXJ0KE1hdGgubWF4KDAsIDIgKiBkYSAqIChkYiArIGRjKSAtIChkYiAtPSBkYykgKiBkYiAtIGRhICogZGEpKSAvICgyICogZGMpOw0KICAgIGMueCA9IGF4ICsgeCAqIGR4ICsgeSAqIGR5Ow0KICAgIGMueSA9IGF5ICsgeCAqIGR5IC0geSAqIGR4Ow0KICB9IGVsc2Ugew0KICAgIGMueCA9IGF4ICsgZGI7DQogICAgYy55ID0gYXk7DQogIH0NCn0NCg0KZnVuY3Rpb24gaW50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W1hcERpY2UgPSBmdW5jdGlvbihwYXJlbnQsIHgwLCB5MCwgeDEsIHkxKSB7DQogIHZhciBub2RlcyA9IHBhcmVudC5jaGlsZHJlbiwNCiAgICAgIG5vZGUsDQogICAgICBpID0gLTEsDQogICAgICBuID0gbm9kZXMubGVuZ3RoLA0KICAgICAgayA9IHBhcmVudC52YWx1ZSAmJiAoeDEgLSB4MCkgLyBwYXJlbnQudmFsdWU7DQoNCiAgd2hpbGUgKCsraSA8IG4pIHsNCiAgICBub2RlID0gbm9kZXNbaV0sIG5vZGUueTAgPSB5MCwgbm9kZS55MSA9IHkxOw0KICAgIG5vZGUueDAgPSB4MCwgbm9kZS54MSA9IHgwICs9IG5vZGUudmFsdWUgKiBrOw0KICB9DQp9Ow0KDQp2YXIgcGFydGl0aW9uID0gZnVuY3Rpb24oKSB7DQogIHZhciBkeCA9IDEsDQogICAgICBkeSA9IDEsDQogICAgICBwYWRkaW5nID0gMCwNCiAgICAgIHJvdW5kID0gZmFsc2U7DQoNCiAgZnVuY3Rpb24gcGFydGl0aW9uKHJvb3QpIHsNCiAgICB2YXIgbiA9IHJvb3QuaGVpZ2h0ICsgMTsNCiAgICByb290LngwID0NCiAgICByb290LnkwID0gcGFkZGluZzsNCiAgICByb290LngxID0gZHg7DQogICAgcm9vdC55MSA9IGR5IC8gbjsNCiAgICByb290LmVhY2hCZWZvcmUocG9zaXRpb25Ob2RlKGR5LCBuKSk7DQogICAgaWYgKHJvdW5kKSByb290LmVhY2hCZWZvcmUocm91bmROb2RlKTsNCiAgICByZXR1cm4gcm9vdDsNCiAgfQ0KDQogIGZ1bmN0aW9uIHBvc2l0aW9uTm9kZShkeSwgbikgew0KICAgIHJldHVybiBmdW5jdGlvbihub2RlKSB7DQogICAgICBpZiAobm9kZS5jaGlsZHJlbikgew0KICAgICAgICB0cmVlbWFwRGljZShub2RlLCBub2RlLngwLCBkeSAqIChub2RlLmRlcHRoICsgMSkgLyBuLCBub2RlLngxLCBkeSAqIChub2RlLm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ZWNpYWwgY2FzZSBmb3IgdTAg4omFIHUxLg0KICBpZiAoZDIgPCBlcHNpbG9uMikgew0KICAgIFMgPSBNYXRoLmxvZyh3MSAvIHcwKSAvIHJobzsNCiAgICBpID0gZnVuY3Rpb24odCkgew0KICAgICAgcmV0dXJuIFsNCiAgICAgICAgdXgwICsgdCAqIGR4LA0KICAgICAgICB1eTAgKyB0ICogZHksDQogICAgICAgIHcwICogTWF0aC5leHAocmhvICogdCAqIFMpDQogICAgICBdOw0KICAgIH07DQogIH0NCg0KICAvLyBHZW5lcmFsIGNhc2UuDQogIGVsc2Ugew0KICAgIHZhciBkMSA9IE1hdGguc3FydChkMiksDQogICAgICAgIGIwID0gKHcxICogdzEgLSB3MCAqIHcwICsgcmhvNCAqIGQyKSAvICgyICogdzAgKiByaG8yICogZDEpLA0KICAgICAgICBiMSA9ICh3MSAqIHcxIC0gdzAgKiB3MCAtIHJobzQgKiBkMikgLyAoMiAqIHcxICogcmhvMiAqIGQxKSwNCiAgICAgICAgcjAgPSBNYXRoLmxvZyhNYXRoLnNxcnQoYjAgKiBiMCArIDEpIC0gYjApLA0KICAgICAgICByMSA9IE1hdGgubG9nKE1hdGguc3FydChiMSAqIGIxICsgMSkgLSBiMSk7DQogICAgUyA9IChyMSAtIHIwKSAvIHJobzsNCiAgICBpID0gZnVuY3Rpb24odCkgew0KICAgICAgdmFyIHMgPSB0ICogUywNCiAgICAgICAgICBjb3NocjAgPSBjb3NoKHIwKSwNCiAgICAgICAgICB1ID0gdzAgLyAocmhvMiAqIGQxKSAqIChjb3NocjAgKiB0YW5oKHJobyAqIHMgKyByMCkgLSBzaW5oKHIwKSk7DQogICAgICByZXR1cm4gWw0KICAgICAgICB1eDAgKyB1ICogZHgsDQogICAgICAgIHV5MCArIHUgKiBkeSwNCiAgICAgICAgdzAgKiBjb3NocjAgLyBjb3NoKHJobyAqIHMgKyByMCkNCiAgICAgIF07DQogICAgfTsNCiAgfQ0KDQogIGkuZHVyYXRpb24gPSBTICog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2UsIGRyYXcgYW4gYXJjIQ0KICAgIGVsc2Ugew0KICAgICAgdmFyIHgyMCA9IHgyIC0geDAsDQogICAgICAgICAgeTIwID0geTIgLSB5MCwNCiAgICAgICAgICBsMjFfMiA9IHgyMSAqIHgyMSArIHkyMSAqIHkyMSwNCiAgICAgICAgICBsMjBfMiA9IHgyMCAqIHgyMCArIHkyMCAqIHkyMCwNCiAgICAgICAgICBsMjEgPSBNYXRoLnNxcnQobDIxXzIpLA0KICAgICAgICAgIGwwMSA9IE1hdGguc3FydChsMDFfMiksDQogICAgICAgICAgbCA9IHIgKiBNYXRoLnRhbigocGkgLSBNYXRoLmFjb3MoKGwyMV8yICsgbDAxXzIgLSBsMjBfMikgLyAoMiAqIGwyMSAqIGwwMSkpKSAvIDIpLA0KICAgICAgICAgIHQwMSA9IGwgLyBsMDEsDQogICAgICAgICAgdDIxID0gbCAvIGwyMTsNCg0KICAgICAgLy8gSWYgdGhlIHN0YXJ0IHRhbmdlbnQgaXMgbm90IGNvaW5jaWRlbnQgd2l0aCAoeDAseTApLCBsaW5lIHRvLg0KICAgICAgaWYgKE1hdGguYWJzKHQwMSAtIDEpID4gZXBzaWxvbikgew0KICAgICAgICB0aGlzLl8gKz0gIkwiICsgKHgxICsgdDAxICogeDAxKSArICIsIiArICh5MSArIHQwMSAqIHkwMSk7DQogICAgICB9DQoNCiAgICAgIHRoaXMuXyArPSAiQSIgKyByICsgIiwiICsgciArICIsMCwwLCIgKyAoKyh5MDEgKiB4MjAgPiB4MDEgKiB5MjApKSArICIsIiArICh0aGlzLl94MSA9IHgxICsgdDIxICogeDIxKSArICIsIiArICh0aGlzLl95MSA9IHkxICsgdDIxICogeTIxKTsNCiAgICB9DQogIH0sDQogIGFyYzogZnVuY3Rpb24oeCwgeSwgciwgYTAsIGExLCBjY3cpIHsNCiAgICB4ID0gK3gsIHkgPSAreSwgciA9ICtyOw0KICAgIHZhciBkeCA9IHIgKiBNYXRoLmNvcyhhMCksDQogICAgICAgIGR5ID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ogK2NvdW50LA0KICAgICAgICB6ID0gW107DQoNCiAgICBpZiAoIShiYXNlICUgMSkgJiYgaiAtIGkgPCBuKSB7DQogICAgICBpID0gTWF0aC5yb3VuZChpKSAtIDEsIGogPSBNYXRoLnJvdW5kKGopICsgMTsNCiAgICAgIGlmICh1ID4gMCkgZm9yICg7IGkgPCBqOyArK2kpIHsNCiAgICAgICAgZm9yIChrID0gMSwgcCA9IHBvd3MoaSk7IGsgPCBiYXNlOyArK2spIHsNCiAgICAgICAgICB0ID0gcCAqIGs7DQogICAgICAgICAgaWYgKHQgPCB1KSBjb250aW51ZTsNCiAgICAgICAgICBpZiAodCA+IHYpIGJyZWFrOw0KICAgICAgICAgIHoucHVzaCh0KTsNCiAgICAgICAgfQ0KICAgICAgfSBlbHNlIGZvciAoOyBpIDwgajsgKytpKSB7DQogICAgICAgIGZvciAoayA9IGJhc2UgLSAxLCBwID0gcG93cyhpKTsgayA+PSAxOyAtLWspIHsNCiAgICAgICAgICB0ID0gcCAqIGs7DQogICAgICAgICAgaWYgKHQgPCB1KSBjb250aW51ZTsNCiAgICAgICAgICBpZiAodCA+IHYpIGJyZWFrOw0KICAgICAgICAgIHoucHVzaCh0KTsNCiAgICAgICAgfQ0KICAgICAgfQ0KICAgIH0gZWxzZSB7DQogICAgICB6ID0gZDNBcnJheS50aWNrcyhpLCBqLCBNYXRoLm1pbihqIC0gaSwgbikpLm1hcChwb3dzKTsNCiAgICB9DQoNCiAgICByZXR1cm4gciA/IHoucmV2ZXJzZSgpIDogejsNCiAgfTsNCg0KICBzY2FsZS50aWNrRm9ybWF0ID0gZnVuY3Rpb24oY291bnQsIHNwZWNpZmllcikgew0KICAgIGlmIChzcGVjaWZpZXIgPT0gbnVsbCkgc3BlY2lmaWVyID0gYmFzZSA9PT0gMTAgPyAiLjBlIiA6ICIsIjsNCiAgICBpZiAodHlwZW9mIHNwZWNpZmllciAhPT0gImZ1bmN0aW9uIikgc3BlY2lmaWVyID0gZDNGb3JtYXQuZm9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ICBlbHNlIHsNCiAgICAgIHZhciBhMDEgPSBhMCwNCiAgICAgICAgICBhMTEgPSBhMSwNCiAgICAgICAgICBhMDAgPSBhMCwNCiAgICAgICAgICBhMTAgPSBhMSwNCiAgICAgICAgICBkYTAgPSBkYSwNCiAgICAgICAgICBkYTEgPSBkYSwNCiAgICAgICAgICBhcCA9IHBhZEFuZ2xlLmFwcGx5KHRoaXMsIGFyZ3VtZW50cykgLyAyLA0KICAgICAgICAgIHJwID0gKGFwID4gZXBzaWxvbikgJiYgKHBhZFJhZGl1cyA/ICtwYWRSYWRpdXMuYXBwbHkodGhpcywgYXJndW1lbnRzKSA6IHNxcnQocjAgKiByMCArIHIxICogcjEpKSwNCiAgICAgICAgICByYyA9IG1pbihhYnMocjEgLSByMCkgLyAyLCArY29ybmVyUmFkaXVzLmFwcGx5KHRoaXMsIGFyZ3VtZW50cykpLA0KICAgICAgICAgIHJjMCA9IHJjLA0KICAgICAgICAgIHJjMSA9IHJjLA0KICAgICAgICAgIHQwLA0KICAgICAgICAgIHQxOw0KDQogICAgICAvLyBBcHBseSBwYWRkaW5nPyBOb3RlIHRoYXQgc2luY2UgcjEg4omlIHIwLCBkYTEg4omlIGRhMC4NCiAgICAgIGlmIChycCA+IGVwc2lsb24pIHsNCiAgICAgICAgdmFyIHAwID0gYXNpbihycCAvIHIwICogc2luKGFwKSksDQogICAgICAgICAgICBwMSA9IGFzaW4ocnAgLyByMSAqIHNpbihhcCkpOw0KICAgICAgICBpZiAoKGRhMCAtPSBwMCAqIDIpID4gZXBzaWxvbikgcDAgKj0gKGN3ID8gMSA6IC0xKSwgYTAwICs9IHAwLCBhMTAgLT0gcDA7DQogICAgICAgIGVsc2UgZGEwID0gMCwgYTAwID0gYTEwID0gKGEwICsgYTEpIC8gMjsNCiAgICAgICAgaWYgKChkYTEgLT0gcDEgKiAyKSA+IGVwc2lsb24pIHAxICo9IChjdyA/IDEgOiAtMSksIGEwMSArPSBwMSwgYTExIC09IHAxOw0KICAgICAgICBlbHNlIGRhMSA9IDAsIGEwMSA9IGExMSA9IChhMCArIGExKSAvIDI7DQogICAgICB9DQoNCiAgICAgIHZhciB4MDEgPSByMSAqIGNvcyhhMDEpLA0KICAgICAgICAgIHkwMSA9IHIxICogc2luKGEwMSksDQogICAgICAgICAgeDEwID0gcjAgKiBjb3MoYTEwKSwNCiAgICAgICAgICB5MTAgPSByMCAqIHNpbihhMTApOw0KDQogICAgICAvLyBBcHBseSByb3VuZGVkIGNvcm5lcnM/DQogICAgICBpZiAocmMgPiBlcHNpbG9uKSB7DQogICAgICAgIHZhciB4MTEgPSByMSAqIGNvcyhhMTEpLA0KICAgICAgICAgICAgeTExID0gcjEgKiBzaW4oYTExKSwNCiAgICAgICAgICAgIHgwMCA9IHIwICogY29zKGEwMCksDQogICAgICAgICAgICB5MDAgPSByMCAqIHNpbihhMDApOw0KDQogICAgICAgIC8vIFJlc3RyaWN0IHRoZSBjb3JuZXIgcmFkaXVzIGFjY29yZGluZyB0byB0aGUgc2VjdG9yIGFuZ2xlLg0KICAgICAgICBpZiAoZGEgPCBwaSkgew0KICAgICAgICAgIHZhciBvYyA9IGRhMCA+IGVwc2lsb24gPyBpbnRlcnNlY3QoeDAxLCB5MDEsIHgwMCwgeTAwLCB4MTEsIHkxMSwgeDEwLCB5MTApIDogW3gxMCwgeTEwXSwNCiAgICAgICAgICAgICAgYXggPSB4MDEgLSBvY1swXSwNCiAgICAgICAgICAgICAgYXkgPSB5MDEgLSBvY1sxXSwNCiAgICAgICAgICAgICAgYnggPSB4MTEgLSBvY1swXSwNCiAgICAgICAgICAgICAgYnkgPSB5MTEgLSBvY1sxXSwNCiAgICAgICAgICAgICAga2MgPSAxIC8gc2luKGFjb3MoKGF4ICogYnggKyBheSAqIGJ5KSAvIChzcXJ0KGF4ICogYXggKyBheSAqIGF5KSAqIHNxcnQoYnggKiBieCArIGJ5ICogYnkpKSkgLyAyKSwNCiAgICAgICAgICAgICAgbGMgPSBzcXJ0KG9jWzBdICogb2NbM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gbnVsbCkgb3V0cHV0ID0gY3VydmUoYnVmZmVyID0gZDNQYXRoLnBhdGgoKSk7DQoNCiAgICBmb3IgKGkgPSAwOyBpIDw9IG47ICsraSkgew0KICAgICAgaWYgKCEoaSA8IG4gJiYgZGVmaW5lZChkID0gZGF0YVtpXSwgaSwgZGF0YSkpID09PSBkZWZpbmVkMCkgew0KICAgICAgICBpZiAoZGVmaW5lZDAgPSAhZGVmaW5lZDApIHsNCiAgICAgICAgICBqID0gaTsNCiAgICAgICAgICBvdXRwdXQuYXJlYVN0YXJ0KCk7DQogICAgICAgICAgb3V0cHV0LmxpbmVTdGFydCgpOw0KICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgIG91dHB1dC5saW5lRW5kKCk7DQogICAgICAgICAgb3V0cHV0LmxpbmVTdGFydCgpOw0KICAgICAgICAgIGZvciAoayA9IGkgLSAxOyBrID49IGo7IC0taykgew0KICAgICAgICAgICAgb3V0cHV0LnBvaW50KHgweltrXSwgeTB6W2tdKTsNCiAgICAgICAgICB9DQogICAgICAgICAgb3V0cHV0LmxpbmVFbmQoKTsNCiAgICAgICAgICBvdXRwdXQuYXJlYUVuZCgpOw0KICAgICAgICB9DQogICAgICB9DQogICAgICBpZiAoZGVmaW5lZDApIHsNCiAgICAgICAgeDB6W2ldID0gK3gwKGQsIGksIGRhdGEpLCB5MHpbaV0gPSAreTAoZCwgaSwgZGF0YSk7DQogICAgICAgIG91dHB1dC5wb2ludCh4MSA/ICt4MShkLCBpLCBkYXRhKSA6IHgweltpXSwgeTEgPyAreTEoZCwgaSwgZGF0YSkgOiB5MHpbaV0pOw0KICAgICAgfQ0KICAgIH0NCg0KICAgIGlmIChidWZmZXIpIHJldHVybiBvdXRwdXQgPSBudWxsLCBidWZmZXIgKyAiIiB8fCBudWxsOw0KICB9DQoNCiAgZnVuY3Rpb24gYXJlYWxpbmUoKSB7DQogICAgcmV0dXJuIGxpbmUoKS5kZWZpbmVkKGRlZmluZWQpLmN1cnZlKGN1cnZlK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c2l6ZSkgew0KICAgIHZhciByID0gTWF0aC5zcXJ0KHNpemUgLyA1KSAvIDI7DQogICAgY29udGV4dC5tb3ZlVG8oLTMgKiByLCAtcik7DQogICAgY29udGV4dC5saW5lVG8oLXIsIC1yKTsNCiAgICBjb250ZXh0LmxpbmVUbygtciwgLTMgKiByKTsNCiAgICBjb250ZXh0LmxpbmVUbyhyLCAtMyAqIHIpOw0KICAgIGNvbnRleHQubGluZVRvKHIsIC1yKTsNCiAgICBjb250ZXh0LmxpbmVUbygzICogciwgLXIpOw0KICAgIGNvbnRleHQubGluZVRvKDMgKiByLCByKTsNCiAgICBjb250ZXh0LmxpbmVUbyhyLCByKTsNCiAgICBjb250ZXh0LmxpbmVUbyhyLCAzICogcik7DQogICAgY29udGV4dC5saW5lVG8oLXIsIDMgKiByKTsNCiAgICBjb250ZXh0LmxpbmVUbygtciwgcik7DQogICAgY29udGV4dC5saW5lVG8oLTMgKiByLCByKTsNCiAgICBjb250ZXh0LmNsb3NlUGF0aCgpOw0KICB9DQp9Ow0KDQp2YXIgdGFuMzAgPSBNYXRoLnNxcnQoMSAvIDMpOw0KdmFyIHRhbjMwXzIgPSB0YW4zMCAqIDI7DQoNCnZhciBkaWFtb25kID0gew0KICBkcmF3OiBmdW5jdGlvbihjb250ZXh0LCBzaXplKSB7DQogICAgdmFyIHkgPSBNYXRoLnNxcnQoc2l6ZSAvIHRhbjMwXzIpLA0KICAgICAgICB4ID0geSAqIHRhbjMwOw0KICAgIGNvbnRleHQubW92ZVRvKDAsIC15KTsNCiAgICBjb250ZXh0LmxpbmVUbyh4LCAwKTsNCiAgICBjb250ZXh0LmxpbmVUbygwLCB5KTsNCiAgICBjb250ZXh0LmxpbmVUbygteCwgMCk7DQogICAgY29udGV4dC5jbG9zZVBhdGgoKTsNCiAgfQ0KfTsNCg0KdmFyIGthID0gMC44OTA4MTMwOTE1MjkyODUyMjgxMDsNCnZhciBrciA9IE1hdGguc2luKHBpIC8gMTApIC8gTWF0aC5zaW4oNyAqIHBpIC8gMTApOw0KdmFyIGt4ID0gTWF0aC5zaW4odGF1IC8gMTApICoga3I7DQp2YXIga3kgPSAtTWF0aC5jb3ModGF1IC8gMTApICoga3I7DQoNCnZhciBzdGFyID0gew0KICBkcmF3OiBmdW5jdGlvbihjb250ZXh0LCBzaXplKSB7DQogICAgdmFyIHIgPSBNYXRoLnNxcnQoc2l6ZSAqIGthKSwNCiAgICAgICAgeCA9IGt4ICogciwNCiAgICAgICAgeSA9IGt5ICogcjsNCiAgICBjb250ZXh0Lm1vdmVUbygwLCAtcik7DQogICAgY29udGV4dC5saW5lVG8oeCwgeSk7DQogICAgZm9yICh2YXIgaSA9IDE7IGkgPCA1OyArK2kpIHsNCiAgICAgIHZhciBhID0gdGF1ICogaSAvIDUsDQogICAgICAgICAgYyA9IE1hdGguY29zKGEpLA0KICAgICAgICAgIHMgPSBNYXRoLnNpbihhKTsNCiAgICAgIGNvbnRleHQubGluZVRvKHMgKiByLCAtYyAqIHIpOw0KICAgICAgY29udGV4dC5saW5lVG8oYyAqIHggLSBzICogeSwgcyAqIHggKyBjICogeSk7DQogICAgfQ0KICAgIGNvbnRleHQuY2xvc2VQYXRoKCk7DQogIH0NCn07DQoNCnZhciBzcXVhcmUgPSB7DQogIGRyYXc6IGZ1bmN0aW9uKGNvbnRleHQsIHNpemUpIHsNCiAgICB2YXIgdyA9IE1hdGguc3FydChzaXplKSwNCiAgICAgICAgeCA9IC13IC8gMjsNCiAgICBjb250ZXh0LnJlY3QoeCwgeCwgdywgdyk7DQogIH0NCn07DQoNCnZhciBzcXJ0MyA9IE1hdGguc3FydCgzKTsNCg0KdmFyIHRyaWFuZ2xlID0gew0KICBkcmF3OiBmdW5jdGlvbihjb250ZXh0LCBzaXplKSB7DQogICAgdmFyIHkgPSAtTWF0aC5zcXJ0KHNpemUgLyAoc3FydDMgKiAzKSk7DQogICAgY29udGV4dC5tb3ZlVG8oMCwgeSAqIDIpOw0KICAgIGNvbnRleHQubGluZVRvKC1zcXJ0MyAqIHksIC15KTsNCiAgICBjb250ZXh0LmxpbmVUbyhzcXJ0MyAqIHksIC15KTsNCiAgICBjb250ZXh0LmNsb3NlUGF0aCgpOw0KICB9DQp9Ow0KDQp2YXIgYyA9IC0wLjU7DQp2YXIgcyA9IE1hdGguc3FydCgzKSAvIDI7DQp2YXIgayA9IDEgLyBNYXRoLnNxcnQoMTIpOw0KdmFyIGEgPSAoayAvIDIgKyAxKSAqIDM7DQoNCnZhciB3eWUgPSB7DQogIGRyYXc6IGZ1bmN0aW9uKGNvbnRleHQsIHNpemUpIHsNCiAgICB2YXIgciA9IE1hdGguc3FydChzaXplIC8gYSksDQogICAgICAgIHgwID0gciAvIDIsDQogICAgICAgIHkwID0gciAqIGssDQogICAgICAgIHgxID0geDAsDQogICAgICAgIHkxID0gciAqIGsgKyByLA0KICAgICAgICB4MiA9IC14MSwNCiAgICAgICAgeTIgPSB5MTsNCiAgICBjb250ZXh0Lm1vdmVUbyh4MCwgeTApOw0KICAgIGNvbnRleHQubGluZVRvKHgxLCB5MSk7DQogICAgY29udGV4dC5saW5lVG8oeDIsIHkyKTsNCiAgICBjb250ZXh0LmxpbmVUbyhjICogeDAgLSBzICogeTAsIHMgKiB4MCArIGMgKiB5MCk7DQogICAgY29udGV4dC5saW5lVG8oYyAqIHgxIC0gcyAqIHkxLCBzICogeDEgKyBjICogeTEpOw0KICAgIGNvbnRleHQubGluZVRvKGMgKiB4MiAtIHMgKiB5MiwgcyAqIHgyICsgYyAqIHkyKTsNCiAgICBjb250ZXh0LmxpbmVUbyhjICogeDAgKyBzICogeTAsIGMgKiB5MCAtIHMgKiB4MCk7DQogICAgY29udGV4dC5saW5lVG8oYyAqIHgxICsgcyAqIHkxLCBjICogeTEgLSBzICogeDEpOw0KICAgIGNvbnRleHQubGluZVRvKGMgKiB4MiArIHMgKiB5MiwgYyAqIHkyIC0gcyAqIHgyKTsNCiAgICBjb250ZXh0LmNsb3NlUGF0aCgpOw0KICB9DQp9Ow0KDQp2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hY2sgPSBmdW5jdGlvbigpIHsNCiAgdmFyIGtleXMgPSBjb25zdGFudChbXSksDQogICAgICBvcmRlciA9IG5vbmUkMSwNCiAgICAgIG9mZnNldCA9IG5vbmUsDQogICAgICB2YWx1ZSA9IHN0YWNrVmFsdWU7DQoNCiAgZnVuY3Rpb24gc3RhY2soZGF0YSkgew0KICAgIHZhciBreiA9IGtleXMuYXBwbHkodGhpcywgYXJndW1lbnRzKSwNCiAgICAgICAgaSwNCiAgICAgICAgbSA9IGRhdGEubGVuZ3RoLA0KICAgICAgICBuID0ga3oubGVuZ3RoLA0KICAgICAgICBzeiA9IG5ldyBBcnJheShuKSwNCiAgICAgICAgb3o7DQoNCiAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7DQogICAgICBmb3IgKHZhciBraSA9IGt6W2ldLCBzaSA9IHN6W2ldID0gbmV3IEFycmF5KG0pLCBqID0gMCwgc2lqOyBqIDwgbTsgKytqKSB7DQogICAgICAgIHNpW2pdID0gc2lqID0gWzAsICt2YWx1ZShkYXRhW2pdLCBraSwgaiwgZGF0YSldOw0KICAgICAgICBzaWouZGF0YSA9IGRhdGFbal07DQogICAgICB9DQogICAgICBzaS5rZXkgPSBraTsNCiAgICB9DQoNCiAgICBmb3IgKGkgPSAwLCBveiA9IG9yZGVyKHN6KTsgaSA8IG47ICsraSkgew0KICAgICAgc3pbb3pbaV1dLmluZGV4ID0gaTsNCiAgICB9DQoNCiAgICBvZmZzZXQoc3osIG96KTsNCiAgICByZXR1cm4gc3o7DQogIH0NCg0KICBzdGFjay5rZXlzID0gZnVuY3Rpb24oXykgew0KICAgIHJldHVybiBhcmd1bWVudHMubGVuZ3RoID8gKGtleXMgPSB0eXBlb2YgXyA9PT0gImZ1bmN0aW9uIiA/IF8gOiBjb25zdGFudChzbGljZS5jYWxsKF8pKSwgc3RhY2spIDoga2V5czsNCiAgfTsNCg0KICBzdGFjay52YWx1ZSA9IGZ1bmN0aW9uKF8pIHsNCiAgICByZXR1cm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dCh0KSxuLGUscixpLGEsMSk7YnJlYWt9fX1mdW5jdGlvbiBldCh0KXt2YXIgbj10LnByZXYsZT10LHI9dC5uZXh0O2lmKHh0KG4sZSxyKT49MClyZXR1cm4hMTtmb3IodmFyIGk9dC5uZXh0Lm5leHQ7aSE9PXQucHJldjspe2lmKHZ0KG4ueCxuLnksZS54LGUueSxyLngsci55LGkueCxpLnkpJiZ4dChpLnByZXYsaSxpLm5leHQpPj0wKXJldHVybiExO2k9aS5uZXh0fXJldHVybiEwfWZ1bmN0aW9uIHJ0KHQsbixlLHIpe3ZhciBpPXQucHJldixhPXQsbz10Lm5leHQ7aWYoeHQoaSxhLG8pPj0wKXJldHVybiExO2Zvcih2YXIgcz1pLng8YS54P2kueDxvLng/aS54Om8ueDphLng8by54P2EueDpvLngsaD1pLnk8YS55P2kueTxvLnk/aS55Om8ueTphLnk8by55P2EueTpvLnksdT1pLng+YS54P2kueD5vLng/aS54Om8ueDphLng+by54P2EueDpvLngsYz1pLnk+YS55P2kueT5vLnk/aS55Om8ueTphLnk+by55P2EueTpvLnksZj1sdChzLGgsbixlLHIpLGw9bHQodSxjLG4sZSxyKSxwPXQubmV4dFo7cCYmcC56PD1sOyl7aWYocCE9PXQucHJldiYmcCE9PXQubmV4dCYmdnQoaS54LGkueSxhLngsYS55LG8ueCxvLnkscC54LHAueSkmJnh0KHAucHJldixwLHAubmV4dCk+PTApcmV0dXJuITE7cD1wLm5leHRafWZvcihwPXQucHJldlo7cCYmcC56Pj1mOyl7aWYocCE9PXQucHJldiYmcCE9PXQubmV4dCYmdnQoaS54LGkueSxhLngsYS55LG8ueCxvLnkscC54LHAueSkmJnh0KHAucHJldixwLHAubmV4dCk+PTApcmV0dXJuITE7cD1wLnByZXZafXJldHVybiEwfWZ1bmN0aW9uIGl0KHQsbixlKXt2YXIgcj10O2Rve3ZhciBpPXIucHJldixhPXIubmV4dC5uZXh0OyF5dChpLGEpJiZkdChpLHIsci5uZXh0LGEpJiZNdChpLGEpJiZN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dXJuIHQ8bj8tMTp0Pm4/MTp0Pj1uPzA6TmFOfSxYbj1mdW5jdGlvbih0KXtyZXR1cm4gMT09PXQubGVuZ3RoJiYodD1TdCh0KSkse2xlZnQ6ZnVuY3Rpb24obixlLHIsaSl7Zm9yKG51bGw9PXImJihyPTApLG51bGw9PWkmJihpPW4ubGVuZ3RoKTtyPGk7KXt2YXIgYT1yK2k+Pj4xO3QoblthXSxlKTwwP3I9YSsxOmk9YX1yZXR1cm4gcn0scmlnaHQ6ZnVuY3Rpb24obixlLHIsaSl7Zm9yKG51bGw9PXImJihyPTApLG51bGw9PWkmJihpPW4ubGVuZ3RoKTtyPGk7KXt2YXIgYT1yK2k+Pj4xO3QoblthXSxlKT4wP2k9YTpyPWErMX1yZXR1cm4gcn19fSxZbj1YbihObiksVm49KFluLnJpZ2h0LE1hdGguc3FydCg1MCksTWF0aC5zcXJ0KDEwKSxNYXRoLnNxcnQoMiksZnVuY3Rpb24odCxuKXtyZXR1cm4gVHQoWnQoRnQodCksdCksbil9KSxHbj1mdW5jdGlvbih0LG4pe3ZhciBlPXQubWFwKGZ1bmN0aW9uKHQpe3JldHVybiBuLm1hcChmdW5jdGlvbihuKXtyZXR1cm4ganQodCxuKX0pfSk7enQodCxuLGUpO3JldHVybiB0Lmxlbmd0aD44P3QubWFwKGZ1bmN0aW9uKHQsbil7cmV0dXJuIG59KTp6dCh0LG4sZSl9O3QuaW50ZXJwb2xhdGU9RW4sdC5zZXBhcmF0ZT1JdCx0LmNvbWJpbmU9TnQsdC5zcGxpdFBhdGhTdHJpbmc9SSx0LnRvUGF0aFN0cmluZz1qLHQuZnJvbUNpcmNsZT1YdCx0LnRvQ2lyY2xlPVl0LHQuZnJvbVJlY3Q9VnQsdC50b1JlY3Q9R3QsT2JqZWN0LmRlZmluZVByb3BlcnR5KHQsIl9fZXNNb2R1bGUiLHt2YWx1ZTohMH0pfSk7Cg=="></script>
</head>
<body style="background-color:white;">
<h3>
<a href="https://github.com/veltman/flubber">Flubbered</a>
(thx <a href="https://noahveltman.com/">Noah Veltman</a>)
Sunburst
</h3>
<div class="sunburst html-widget" id="htmlwidget-47f613d47c12a72ce1e3" style="width:960px;height:500px; position:relative;">
<div>
<div class="sunburst-main">
<div class="sunburst-sequence"></div>
<div class="sunburst-chart">
<div class="sunburst-explanation" style="visibility:hidden;"></div>
</div>
</div>
<div class="sunburst-sidebar">
<input type="checkbox" class="sunburst-togglelegend">Legend</input>
<div class="sunburst-legend" style="visibility:hidden;"></div>
</div>
</div>
</div>
<script type="application/json" data-for="htmlwidget-47f613d47c12a72ce1e3">{"x":{"data":{"children":[{"name":"d3","children":[{"name":"d3-array","children":[{"name":"threshold","children":[{"name":"freedmanDiaconis.js","size":361,"colname":"X4"},{"name":"scott.js","size":180,"colname":"X4"},{"name":"sturges.js","size":96,"colname":"X4"}],"colname":"X3"},{"name":"array.js","children":[],"size":90,"colname":"X3"},{"name":"ascending.js","children":[],"size":86,"colname":"X3"},{"name":"bisect.js","children":[],"size":238,"colname":"X3"},{"name":"bisector.js","children":[],"size":786,"colname":"X3"},{"name":"constant.js","children":[],"size":72,"colname":"X3"},{"name":"descending.js","children":[],"size":86,"colname":"X3"},{"name":"deviation.js","children":[],"size":135,"colname":"X3"},{"name":"extent.js","children":[],"size":553,"colname":"X3"},{"name":"histogram.js","children":[],"size":1876,"colname":"X3"},{"name":"identity.js","children":[],"size":43,"colname":"X3"},{"name":"max.js","children":[],"size":451,"colname":"X3"},{"name":"mean.js","children":[],"size":362,"colname":"X3"},{"name":"median.js","children":[],"size":452,"colname":"X3"},{"name":"merge.js","children":[],"size":339,"colname":"X3"},{"name":"min.js","children":[],"size":451,"colname":"X3"},{"name":"number.js","children":[],"size":63,"colname":"X3"},{"name":"pairs.js","children":[],"size":182,"colname":"X3"},{"name":"permute.js","children":[],"size":161,"colname":"X3"},{"name":"quantile.js","children":[],"size":416,"colname":"X3"},{"name":"range.js","children":[],"size":344,"colname":"X3"},{"name":"scan.js","children":[],"size":357,"colname":"X3"},{"name":"shuffle.js","children":[],"size":285,"colname":"X3"},{"name":"sum.js","children":[],"size":295,"colname":"X3"},{"name":"ticks.js","children":[],"size":672,"colname":"X3"},{"name":"transpose.js","children":[],"size":356,"colname":"X3"},{"name":"variance.js","children":[],"size":540,"colname":"X3"},{"name":"zip.js","children":[],"size":99,"colname":"X3"}],"colname":"X2"},{"name":"d3-axis","children":[{"name":"array.js","children":[],"size":42,"colname":"X3"},{"name":"axis.js","children":[],"size":5239,"colname":"X3"},{"name":"identity.js","children":[],"size":43,"colname":"X3"}],"colname":"X2"},{"name":"d3-brush","children":[{"name":"brush.js","children":[],"size":15778,"colname":"X3"},{"name":"constant.js","children":[],"size":72,"colname":"X3"},{"name":"event.js","children":[],"size":127,"colname":"X3"},{"name":"noevent.js","children":[],"size":202,"colname":"X3"}],"colname":"X2"},{"name":"d3-chord","children":[{"name":"array.js","children":[],"size":42,"colname":"X3"},{"name":"chord.js","children":[],"size":3178,"colname":"X3"},{"name":"constant.js","children":[],"size":72,"colname":"X3"},{"name":"math.js","children":[],"size":159,"colname":"X3"},{"name":"ribbon.js","children":[],"size":2340,"colname":"X3"}],"colname":"X2"},{"name":"d3-collection","children":[{"name":"entries.js","children":[],"size":137,"colname":"X3"},{"name":"keys.js","children":[],"size":104,"colname":"X3"},{"name":"map.js","children":[],"size":1988,"colname":"X3"},{"name":"nest.js","children":[],"size":2021,"colname":"X3"},{"name":"set.js","children":[],"size":800,"colname":"X3"},{"name":"values.js","children":[],"size":115,"colname":"X3"}],"colname":"X2"},{"name":"d3-color","children":[{"name":"color.js","children":[],"size":9276,"colname":"X3"},{"name":"cubehelix.js","children":[],"size":1855,"colname":"X3"},{"name":"define.js","children":[],"size":340,"colname":"X3"},{"name":"lab.js","children":[],"size":3167,"colname":"X3"},{"name":"math.js","children":[],"size":72,"colname":"X3"}],"colname":"X2"},{"name":"d3-dispatch","children":[{"name":"dispatch.js","children":[],"size":2729,"colname":"X3"}],"colname":"X2"},{"name":"d3-drag","children":[{"name":"constant.js","children":[],"size":72,"colname":"X3"},{"name":"drag.js","children":[],"size":4297,"colname":"X3"},{"name":"event.js","children":[],"size":430,"colname":"X3"},{"name":"nodrag.js","children":[],"size":857,"colname":"X3"},{"name":"noevent.js","children":[],"size":202,"colname":"X3"}],"colname":"X2"},{"name":"d3-dsv","children":[{"name":"csv.js","children":[],"size":199,"colname":"X3"},{"name":"dsv.js","children":[],"size":3582,"colname":"X3"},{"name":"tsv.js","children":[],"size":200,"colname":"X3"}],"colname":"X2"},{"name":"d3-ease","children":[{"name":"back.js","children":[],"size":653,"colname":"X3"},{"name":"bounce.js","children":[],"size":521,"colname":"X3"},{"name":"circle.js","children":[],"size":261,"colname":"X3"},{"name":"cubic.js","children":[],"size":210,"colname":"X3"},{"name":"elastic.js","children":[],"size":1309,"colname":"X3"},{"name":"exp.js","children":[],"size":251,"colname":"X3"},{"name":"linear.js","children":[],"size":43,"colname":"X3"},{"name":"poly.js","children":[],"size":596,"colname":"X3"},{"name":"quad.js","children":[],"size":192,"colname":"X3"},{"name":"sin.js","children":[],"size":236,"colname":"X3"}],"colname":"X2"},{"name":"d3-force","children":[{"name":"center.js","children":[],"size":654,"colname":"X3"},{"name":"collide.js","children":[],"size":2447,"colname":"X3"},{"name":"constant.js","children":[],"size":72,"colname":"X3"},{"name":"jiggle.js","children":[],"size":69,"colname":"X3"},{"name":"link.js","children":[],"size":3213,"colname":"X3"},{"name":"manyBody.js","children":[],"size":3181,"colname":"X3"},{"name":"simulation.js","children":[],"size":3444,"colname":"X3"},{"name":"x.js","children":[],"size":1030,"colname":"X3"},{"name":"y.js","children":[],"size":1030,"colname":"X3"}],"colname":"X2"},{"name":"d3-format","children":[{"name":"defaultLocale.js","children":[],"size":361,"colname":"X3"},{"name":"exponent.js","children":[],"size":134,"colname":"X3"},{"name":"formatDecimal.js","children":[],"size":656,"colname":"X3"},{"name":"formatDefault.js","children":[],"size":368,"colname":"X3"},{"name":"formatGroup.js","children":[],"size":475,"colname":"X3"},{"name":"formatPrefixAuto.js","children":[],"size":611,"colname":"X3"},{"name":"formatRounded.js","children":[],"size":458,"colname":"X3"},{"name":"formatSpecifier.js","children":[],"size":1589,"colname":"X3"},{"name":"formatTypes.js","children":[],"size":846,"colname":"X3"},{"name":"locale.js","children":[],"size":5247,"colname":"X3"},{"name":"precisionFixed.js","children":[],"size":119,"colname":"X3"},{"name":"precisionPrefix.js","children":[],"size":190,"colname":"X3"},{"name":"precisionRound.js","children":[],"size":186,"colname":"X3"}],"colname":"X2"},{"name":"d3-geo","children":[{"name":"clip","children":[{"name":"antimeridian.js","size":2897,"colname":"X4"},{"name":"buffer.js","size":470,"colname":"X4"},{"name":"circle.js","size":5956,"colname":"X4"},{"name":"extent.js","size":5527,"colname":"X4"},{"name":"index.js","size":3813,"colname":"X4"},{"name":"line.js","size":1099,"colname":"X4"},{"name":"polygon.js","size":2802,"colname":"X4"}],"colname":"X3"},{"name":"path","children":[{"name":"area.js","size":945,"colname":"X4"},{"name":"bounds.js","size":485,"colname":"X4"},{"name":"centroid.js","size":2033,"colname":"X4"},{"name":"context.js","size":914,"colname":"X4"},{"name":"index.js","size":1690,"colname":"X4"},{"name":"string.js","size":1149,"colname":"X4"}],"colname":"X3"},{"name":"projection","children":[{"name":"albers.js","size":235,"colname":"X4"},{"name":"albersUsa.js","size":3986,"colname":"X4"},{"name":"azimuthal.js","size":502,"colname":"X4"},{"name":"azimuthalEqualArea.js","size":447,"colname":"X4"},{"name":"azimuthalEquidistant.js","size":443,"colname":"X4"},{"name":"conic.js","size":402,"colname":"X4"},{"name":"conicConformal.js","size":1017,"colname":"X4"},{"name":"conicEqualArea.js","size":871,"colname":"X4"},{"name":"conicEquidistant.js","size":771,"colname":"X4"},{"name":"cylindricalEqualArea.js","size":314,"colname":"X4"},{"name":"equirectangular.js","size":253,"colname":"X4"},{"name":"fit.js","size":910,"colname":"X4"},{"name":"gnomonic.js","size":387,"colname":"X4"},{"name":"identity.js","size":1922,"colname":"X4"},{"name":"index.js","size":3752,"colname":"X4"},{"name":"mercator.js","size":1119,"colname":"X4"},{"name":"orthographic.js","size":376,"colname":"X4"},{"name":"resample.js","size":3275,"colname":"X4"},{"name":"stereographic.js","size":436,"colname":"X4"},{"name":"transverseMercator.js","size":762,"colname":"X4"}],"colname":"X3"},{"name":"adder.js","children":[],"size":906,"colname":"X3"},{"name":"area.js","children":[],"size":1958,"colname":"X3"},{"name":"bounds.js","children":[],"size":5361,"colname":"X3"},{"name":"cartesian.js","children":[],"size":929,"colname":"X3"},{"name":"centroid.js","children":[],"size":3816,"colname":"X3"},{"name":"circle.js","children":[],"size":2373,"colname":"X3"},{"name":"compose.js","children":[],"size":250,"colname":"X3"},{"name":"constant.js","children":[],"size":72,"colname":"X3"},{"name":"distance.js","children":[],"size":229,"colname":"X3"},{"name":"graticule.js","children":[],"size":3034,"colname":"X3"},{"name":"identity.js","children":[],"size":43,"colname":"X3"},{"name":"interpolate.js","children":[],"size":911,"colname":"X3"},{"name":"length.js","children":[],"size":1309,"colname":"X3"},{"name":"math.js","children":[],"size":880,"colname":"X3"},{"name":"noop.js","children":[],"size":34,"colname":"X3"},{"name":"pointEqual.js","children":[],"size":139,"colname":"X3"},{"name":"polygonContains.js","children":[],"size":2491,"colname":"X3"},{"name":"rotation.js","children":[],"size":2509,"colname":"X3"},{"name":"stream.js","children":[],"size":2305,"colname":"X3"},{"name":"transform.js","children":[],"size":701,"colname":"X3"}],"colname":"X2"},{"name":"d3-hierarchy","children":[{"name":"hierarchy","children":[{"name":"ancestors.js","size":138,"colname":"X4"},{"name":"descendants.js","size":121,"colname":"X4"},{"name":"each.js","size":381,"colname":"X4"},{"name":"eachAfter.js","size":353,"colname":"X4"},{"name":"eachBefore.js","size":282,"colname":"X4"},{"name":"index.js","size":1819,"colname":"X4"},{"name":"leaves.js","size":164,"colname":"X4"},{"name":"links.js","size":246,"colname":"X4"},{"name":"path.js","size":606,"colname":"X4"},{"name":"sort.js","size":151,"colname":"X4"},{"name":"sum.js","size":264,"colname":"X4"}],"colname":"X3"},{"name":"pack","children":[{"name":"enclose.js","size":2452,"colname":"X4"},{"name":"index.js","size":1917,"colname":"X4"},{"name":"shuffle.js","size":389,"colname":"X4"},{"name":"siblings.js","size":3497,"colname":"X4"}],"colname":"X3"},{"name":"treemap","children":[{"name":"binary.js","size":1184,"colname":"X4"},{"name":"dice.js","size":309,"colname":"X4"},{"name":"index.js","size":2810,"colname":"X4"},{"name":"resquarify.js","size":1029,"colname":"X4"},{"name":"round.js","size":166,"colname":"X4"},{"name":"slice.js","size":309,"colname":"X4"},{"name":"sliceDice.js","size":170,"colname":"X4"},{"name":"squarify.js","size":1868,"colname":"X4"}],"colname":"X3"},{"name":"accessors.js","children":[],"size":166,"colname":"X3"},{"name":"cluster.js","children":[],"size":2093,"colname":"X3"},{"name":"constant.js","children":[],"size":120,"colname":"X3"},{"name":"partition.js","children":[],"size":1266,"colname":"X3"},{"name":"stratify.js","children":[],"size":1934,"colname":"X3"},{"name":"tree.js","children":[],"size":7060,"colname":"X3"}],"colname":"X2"},{"name":"d3-interpolate","children":[{"name":"transform","children":[{"name":"decompose.js","size":672,"colname":"X4"},{"name":"index.js","size":2064,"colname":"X4"},{"name":"parse.js","size":980,"colname":"X4"}],"colname":"X3"},{"name":"array.js","children":[],"size":372,"colname":"X3"},{"name":"basis.js","children":[],"size":600,"colname":"X3"},{"name":"basisClosed.js","children":[],"size":360,"colname":"X3"},{"name":"color.js","children":[],"size":697,"colname":"X3"},{"name":"constant.js","children":[],"size":72,"colname":"X3"},{"name":"cubehelix.js","children":[],"size":760,"colname":"X3"},{"name":"date.js","children":[],"size":134,"colname":"X3"},{"name":"hcl.js","children":[],"size":547,"colname":"X3"},{"name":"hsl.js","children":[],"size":547,"colname":"X3"},{"name":"lab.js","children":[],"size":447,"colname":"X3"},{"name":"number.js","children":[],"size":100,"colname":"X3"},{"name":"object.js","children":[],"size":390,"colname":"X3"},{"name":"quantize.js","children":[],"size":163,"colname":"X3"},{"name":"rgb.js","children":[],"size":1277,"colname":"X3"},{"name":"round.js","children":[],"size":112,"colname":"X3"},{"name":"string.js","children":[],"size":1758,"colname":"X3"},{"name":"value.js","children":[],"size":598,"colname":"X3"},{"name":"zoom.js","children":[],"size":1387,"colname":"X3"}],"colname":"X2"},{"name":"d3-path","children":[{"name":"path.js","children":[],"size":4089,"colname":"X3"}],"colname":"X2"},{"name":"d3-polygon","children":[{"name":"area.js","children":[],"size":243,"colname":"X3"},{"name":"centroid.js","children":[],"size":346,"colname":"X3"},{"name":"contains.js","children":[],"size":411,"colname":"X3"},{"name":"cross.js","children":[],"size":402,"colname":"X3"},{"name":"hull.js","children":[],"size":1710,"colname":"X3"},{"name":"length.js","children":[],"size":375,"colname":"X3"}],"colname":"X2"},{"name":"d3-quadtree","children":[{"name":"add.js","children":[],"size":2441,"colname":"X3"},{"name":"cover.js","children":[],"size":1667,"colname":"X3"},{"name":"data.js","children":[],"size":170,"colname":"X3"},{"name":"extent.js","children":[],"size":206,"colname":"X3"},{"name":"find.js","children":[],"size":1696,"colname":"X3"},{"name":"quad.js","children":[],"size":134,"colname":"X3"},{"name":"quadtree.js","children":[],"size":2077,"colname":"X3"},{"name":"remove.js","children":[],"size":1898,"colname":"X3"},{"name":"root.js","children":[],"size":51,"colname":"X3"},{"name":"size.js","children":[],"size":155,"colname":"X3"},{"name":"visit.js","children":[],"size":695,"colname":"X3"},{"name":"visitAfter.js","children":[],"size":773,"colname":"X3"},{"name":"x.js","children":[],"size":138,"colname":"X3"},{"name":"y.js","children":[],"size":138,"colname":"X3"}],"colname":"X2"},{"name":"d3-queue","children":[{"name":"array.js","children":[],"size":29,"colname":"X3"},{"name":"queue.js","children":[],"size":2870,"colname":"X3"}],"colname":"X2"},{"name":"d3-random","children":[{"name":"bates.js","children":[],"size":168,"colname":"X3"},{"name":"exponential.js","children":[],"size":113,"colname":"X3"},{"name":"irwinHall.js","children":[],"size":137,"colname":"X3"},{"name":"logNormal.js","children":[],"size":178,"colname":"X3"},{"name":"normal.js","children":[],"size":503,"colname":"X3"},{"name":"uniform.js","children":[],"size":236,"colname":"X3"}],"colname":"X2"},{"name":"d3-request","children":[{"name":"csv.js","children":[],"size":101,"colname":"X3"},{"name":"dsv.js","children":[],"size":517,"colname":"X3"},{"name":"html.js","children":[],"size":157,"colname":"X3"},{"name":"json.js","children":[],"size":127,"colname":"X3"},{"name":"request.js","children":[],"size":4593,"colname":"X3"},{"name":"text.js","children":[],"size":109,"colname":"X3"},{"name":"tsv.js","children":[],"size":118,"colname":"X3"},{"name":"type.js","children":[],"size":370,"colname":"X3"},{"name":"xml.js","children":[],"size":174,"colname":"X3"}],"colname":"X2"},{"name":"d3-scale","children":[{"name":"array.js","children":[],"size":90,"colname":"X3"},{"name":"band.js","children":[],"size":2637,"colname":"X3"},{"name":"category10.js","children":[],"size":119,"colname":"X3"},{"name":"category20.js","children":[],"size":179,"colname":"X3"},{"name":"category20b.js","children":[],"size":179,"colname":"X3"},{"name":"category20c.js","children":[],"size":179,"colname":"X3"},{"name":"colors.js","children":[],"size":101,"colname":"X3"},{"name":"constant.js","children":[],"size":72,"colname":"X3"},{"name":"continuous.js","children":[],"size":3328,"colname":"X3"},{"name":"cubehelix.js","children":[],"size":188,"colname":"X3"},{"name":"identity.js","children":[],"size":463,"colname":"X3"},{"name":"linear.js","children":[],"size":1206,"colname":"X3"},{"name":"log.js","children":[],"size":3273,"colname":"X3"},{"name":"nice.js","children":[],"size":340,"colname":"X3"},{"name":"number.js","children":[],"size":44,"colname":"X3"},{"name":"ordinal.js","children":[],"size":1116,"colname":"X3"},{"name":"pow.js","children":[],"size":1000,"colname":"X3"},{"name":"quantile.js","children":[],"size":1280,"colname":"X3"},{"name":"quantize.js","children":[],"size":1066,"colname":"X3"},{"name":"rainbow.js","children":[],"size":536,"colname":"X3"},{"name":"sequential.js","children":[],"size":717,"colname":"X3"},{"name":"threshold.js","children":[],"size":802,"colname":"X3"},{"name":"tickFormat.js","children":[],"size":1203,"colname":"X3"},{"name":"time.js","children":[],"size":4565,"colname":"X3"},{"name":"utcTime.js","children":[],"size":379,"colname":"X3"},{"name":"viridis.js","children":[],"size":6471,"colname":"X3"}],"colname":"X2"},{"name":"d3-selection","children":[{"name":"selection","children":[{"name":"append.js","size":235,"colname":"X4"},{"name":"attr.js","size":1460,"colname":"X4"},{"name":"call.js","size":134,"colname":"X4"},{"name":"classed.js","size":1740,"colname":"X4"},{"name":"data.js","size":3597,"colname":"X4"},{"name":"datum.js","size":132,"colname":"X4"},{"name":"dispatch.js","size":869,"colname":"X4"},{"name":"each.js","size":289,"colname":"X4"},{"name":"empty.js","size":53,"colname":"X4"},{"name":"enter.js","size":792,"colname":"X4"},{"name":"exit.js","size":176,"colname":"X4"},{"name":"filter.js","size":546,"colname":"X4"},{"name":"html.js","size":520,"colname":"X4"},{"name":"index.js","size":2216,"colname":"X4"},{"name":"insert.js","size":468,"colname":"X4"},{"name":"lower.js","size":171,"colname":"X4"},{"name":"merge.js","size":575,"colname":"X4"},{"name":"node.js","size":258,"colname":"X4"},{"name":"nodes.js","size":140,"colname":"X4"},{"name":"on.js","size":3119,"colname":"X4"},{"name":"order.js","size":367,"colname":"X4"},{"name":"property.js","size":617,"colname":"X4"},{"name":"raise.js","size":138,"colname":"X4"},{"name":"remove.js","size":153,"colname":"X4"},{"name":"select.js","size":653,"colname":"X4"},{"name":"selectAll.js","size":550,"colname":"X4"},{"name":"size.js","size":98,"colname":"X4"},{"name":"sort.js","size":681,"colname":"X4"},{"name":"sparse.js","size":71,"colname":"X4"},{"name":"style.js","size":889,"colname":"X4"},{"name":"text.js","size":528,"colname":"X4"}],"colname":"X3"},{"name":"constant.js","children":[],"size":72,"colname":"X3"},{"name":"creator.js","children":[],"size":662,"colname":"X3"},{"name":"local.js","children":[],"size":536,"colname":"X3"},{"name":"matcher.js","children":[],"size":533,"colname":"X3"},{"name":"mouse.js","children":[],"size":224,"colname":"X3"},{"name":"namespace.js","children":[],"size":303,"colname":"X3"},{"name":"namespaces.js","children":[],"size":254,"colname":"X3"},{"name":"point.js","children":[],"size":448,"colname":"X3"},{"name":"select.js","children":[],"size":259,"colname":"X3"},{"name":"selectAll.js","children":[],"size":282,"colname":"X3"},{"name":"selector.js","children":[],"size":152,"colname":"X3"},{"name":"selectorAll.js","children":[],"size":171,"colname":"X3"},{"name":"sourceEvent.js","children":[],"size":175,"colname":"X3"},{"name":"touch.js","children":[],"size":407,"colname":"X3"},{"name":"touches.js","children":[],"size":323,"colname":"X3"},{"name":"window.js","children":[],"size":218,"colname":"X3"}],"colname":"X2"},{"name":"d3-shape","children":[{"name":"curve","children":[{"name":"basis.js","size":1436,"colname":"X4"},{"name":"basisClosed.js","size":1530,"colname":"X4"},{"name":"basisOpen.js","size":1069,"colname":"X4"},{"name":"bundle.js","size":1081,"colname":"X4"},{"name":"cardinal.js","size":1633,"colname":"X4"},{"name":"cardinalClosed.js","size":1605,"colname":"X4"},{"name":"cardinalOpen.js","size":1288,"colname":"X4"},{"name":"catmullRom.js","size":2637,"colname":"X4"},{"name":"catmullRomClosed.js","size":2083,"colname":"X4"},{"name":"catmullRomOpen.js","size":1760,"colname":"X4"},{"name":"linear.js","size":738,"colname":"X4"},{"name":"linearClosed.js","size":514,"colname":"X4"},{"name":"monotone.js","size":3203,"colname":"X4"},{"name":"natural.js","size":1761,"colname":"X4"},{"name":"radial.js","size":655,"colname":"X4"},{"name":"step.js","size":1367,"colname":"X4"}],"colname":"X3"},{"name":"offset","children":[{"name":"expand.js","size":319,"colname":"X4"},{"name":"none.js","size":310,"colname":"X4"},{"name":"silhouette.js","size":314,"colname":"X4"},{"name":"wiggle.js","size":740,"colname":"X4"}],"colname":"X3"},{"name":"order","children":[{"name":"ascending.js","size":305,"colname":"X4"},{"name":"descending.js","size":112,"colname":"X4"},{"name":"insideOut.js","size":545,"colname":"X4"},{"name":"none.js","size":120,"colname":"X4"},{"name":"reverse.js","size":97,"colname":"X4"}],"colname":"X3"},{"name":"symbol","children":[{"name":"circle.js","size":186,"colname":"X4"},{"name":"cross.js","size":476,"colname":"X4"},{"name":"diamond.js","size":307,"colname":"X4"},{"name":"square.js","size":137,"colname":"X4"},{"name":"star.js","size":609,"colname":"X4"},{"name":"triangle.js","size":255,"colname":"X4"},{"name":"wye.js","size":733,"colname":"X4"}],"colname":"X3"},{"name":"arc.js","children":[],"size":8831,"colname":"X3"},{"name":"area.js","children":[],"size":2917,"colname":"X3"},{"name":"array.js","children":[],"size":42,"colname":"X3"},{"name":"constant.js","children":[],"size":81,"colname":"X3"},{"name":"descending.js","children":[],"size":86,"colname":"X3"},{"name":"identity.js","children":[],"size":43,"colname":"X3"},{"name":"line.js","children":[],"size":1516,"colname":"X3"},{"name":"math.js","children":[],"size":106,"colname":"X3"},{"name":"noop.js","children":[],"size":29,"colname":"X3"},{"name":"pie.js","children":[],"size":2336,"colname":"X3"},{"name":"point.js","children":[],"size":81,"colname":"X3"},{"name":"radialArea.js","children":[],"size":934,"colname":"X3"},{"name":"radialLine.js","children":[],"size":396,"colname":"X3"},{"name":"stack.js","children":[],"size":1432,"colname":"X3"},{"name":"symbol.js","children":[],"size":1160,"colname":"X3"}],"colname":"X2"},{"name":"d3-time-format","children":[{"name":"defaultLocale.js","children":[],"size":867,"colname":"X3"},{"name":"isoFormat.js","children":[],"size":284,"colname":"X3"},{"name":"isoParse.js","children":[],"size":319,"colname":"X3"},{"name":"locale.js","children":[],"size":13876,"colname":"X3"}],"colname":"X2"},{"name":"d3-time","children":[{"name":"day.js","children":[],"size":462,"colname":"X3"},{"name":"duration.js","children":[],"size":164,"colname":"X3"},{"name":"hour.js","children":[],"size":569,"colname":"X3"},{"name":"interval.js","children":[],"size":1845,"colname":"X3"},{"name":"millisecond.js","children":[],"size":668,"colname":"X3"},{"name":"minute.js","children":[],"size":437,"colname":"X3"},{"name":"month.js","children":[],"size":414,"colname":"X3"},{"name":"second.js","children":[],"size":440,"colname":"X3"},{"name":"utcDay.js","children":[],"size":397,"colname":"X3"},{"name":"utcHour.js","children":[],"size":399,"colname":"X3"},{"name":"utcMinute.js","children":[],"size":412,"colname":"X3"},{"name":"utcMonth.js","children":[],"size":453,"colname":"X3"},{"name":"utcWeek.js","children":[],"size":979,"colname":"X3"},{"name":"utcYear.js","children":[],"size":808,"colname":"X3"},{"name":"week.js","children":[],"size":963,"colname":"X3"},{"name":"year.js","children":[],"size":754,"colname":"X3"}],"colname":"X2"},{"name":"d3-timer","children":[{"name":"interval.js","children":[],"size":400,"colname":"X3"},{"name":"timeout.js","children":[],"size":250,"colname":"X3"},{"name":"timer.js","children":[],"size":2771,"colname":"X3"}],"colname":"X2"},{"name":"d3-transition","children":[{"name":"selection","children":[{"name":"index.js","size":245,"colname":"X4"},{"name":"interrupt.js","size":138,"colname":"X4"},{"name":"transition.js","size":1090,"colname":"X4"}],"colname":"X3"},{"name":"transition","children":[{"name":"attr.js","size":2473,"colname":"X4"},{"name":"attrTween.js","size":904,"colname":"X4"},{"name":"delay.js","size":510,"colname":"X4"},{"name":"duration.js","size":528,"colname":"X4"},{"name":"ease.js","size":348,"colname":"X4"},{"name":"filter.js","size":574,"colname":"X4"},{"name":"index.js","size":1892,"colname":"X4"},{"name":"interpolate.js","size":340,"colname":"X4"},{"name":"merge.js","size":653,"colname":"X4"},{"name":"on.js","size":853,"colname":"X4"},{"name":"remove.js","size":284,"colname":"X4"},{"name":"schedule.js","size":4792,"colname":"X4"},{"name":"select.js","size":826,"colname":"X4"},{"name":"selectAll.js","size":883,"colname":"X4"},{"name":"selection.js","size":174,"colname":"X4"},{"name":"style.js","size":2119,"colname":"X4"},{"name":"styleTween.js","size":607,"colname":"X4"},{"name":"text.js","size":473,"colname":"X4"},{"name":"transition.js","size":691,"colname":"X4"},{"name":"tween.js","size":2026,"colname":"X4"}],"colname":"X3"},{"name":"active.js","children":[],"size":484,"colname":"X3"},{"name":"interrupt.js","children":[],"size":665,"colname":"X3"}],"colname":"X2"},{"name":"d3-voronoi","children":[{"name":"Beach.js","children":[],"size":4381,"colname":"X3"},{"name":"Cell.js","children":[],"size":4087,"colname":"X3"},{"name":"Circle.js","children":[],"size":1632,"colname":"X3"},{"name":"constant.js","children":[],"size":72,"colname":"X3"},{"name":"Diagram.js","children":[],"size":3415,"colname":"X3"},{"name":"Edge.js","children":[],"size":3634,"colname":"X3"},{"name":"point.js","children":[],"size":81,"colname":"X3"},{"name":"RedBlackTree.js","children":[],"size":5302,"colname":"X3"},{"name":"voronoi.js","children":[],"size":1420,"colname":"X3"}],"colname":"X2"},{"name":"d3-zoom","children":[{"name":"constant.js","children":[],"size":72,"colname":"X3"},{"name":"event.js","children":[],"size":137,"colname":"X3"},{"name":"noevent.js","children":[],"size":202,"colname":"X3"},{"name":"transform.js","children":[],"size":1336,"colname":"X3"},{"name":"zoom.js","children":[],"size":12133,"colname":"X3"}],"colname":"X2"}],"colname":"X1"}],"name":"root"},"options":{"legendOrder":null,"colors":null,"valueField":"size","percent":true,"count":false,"explanation":null,"breadcrumb":[],"legend":[],"sortFunction":null},"tasks":["\nfunction(){\n var chart = this.instance.chart;\n var el = this.el;\n var svg = d3.select(el).select('.sunburst-chart>svg');\n\n chart.on('click.tree', function(d) {\n svg.selectAll('.tree')\n .transition()\n .style('opacity', 0.001)\n .remove();\n\n // interpolate to rect\n var cloned = d3.select(event.target.cloneNode(true));\n cloned\n .classed('tree', true)\n .attr('transform', svg.select('g').attr('transform'));\n svg.node().appendChild(cloned.node());\n \n\n var interpolator = flubber.interpolate(\n d3.select(event.target).attr('d'),\n [[0,0],[0,100],[100,100],[100,0],[0,0]]\n );\n cloned\n .transition()\n .duration(1500)\n .attrTween('d', function(){ return interpolator; })\n .attr('transform', 'translate(0,0)');\n\n //interpolate rect to tree with separate\n var hier = d3.hierarchy(d3.select(event.target).datum())\n .sum(function(d) {return d.data.size});\n if(hier.children) {\n var tree = d3.treemap().size([100,100])(hier);\n tree.children.map(function(d) {\n svg.append('rect')\n .classed('tree', true)\n .attr('transform', 'translate(' + d.x0 + ',' + d.y0 + ')')\n .attr('width', d.x1 - d.x0)\n .attr('height', d.y1 - d.y0)\n .style('stroke', 'white')\n .style('fill','none')\n .style('opacity',0.00001)\n .transition()\n .delay(100)\n .style('opacity',1)\n });\n }\n })\n}\n"]},"evals":["tasks.0"],"jsHooks":[]}</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment