Skip to content

Instantly share code, notes, and snippets.

@timelyportfolio
Last active December 5, 2016 04:16
Show Gist options
  • Save timelyportfolio/e004c341597749f5d8afd9b90428e636 to your computer and use it in GitHub Desktop.
Save timelyportfolio/e004c341597749f5d8afd9b90428e636 to your computer and use it in GitHub Desktop.
football game with d3 sunburst from R sunburstR
license: mit

assembled with blockbuilder.org and htmwidgets

Football Visualization

I had an idea (sure I'm not the only one) to visualize football or sports in general as sequences using d3.js, so I tweeted and got a whopping two likes. Not a lot of motivation, but away I went using last weekend's Alabama vs. Texas A&M game.

Sunburst

With some very slight data work in R on the drive-chart HTML table and the sunburstR htmlwidget, I was able to easily create a prototype. There is a whole lot of potential improvement here starting with colors and explanation. Feel free to contribute. Thanks to Kerry Rodden one more time for his sequences sunburst.

# sunburst of drive chart
#  from rolltide.com

library(htmltools)
library(xml2)
library(rvest)
library(pipeR)
library(dplyr)
library(lubridate)
library(sunburstR)
library(d3r)

# Alabama vs Texas A&M
url <- "http://rolltide.com/boxscore.aspx?id=4471&path=football"

# make simple converter for minutes:seconds to seconds
#  based off http://stackoverflow.com/questions/29067375/r-convert-hoursminutesseconds
minsec_to_sec <- function(tim){
  res <- lubridate::ms(tim)       # format to 'hours:minutes:seconds'
  lubridate::minute(res)*60 + lubridate::second(res)
}

url %>>%
  read_html() %>%
  html_node("section#all-drives table") %>>%
  html_table(fill=TRUE, header=FALSE) %>>%
  {
    cnm <- .[2,]
    tbl <- .[-(1:2),]
    colnames(tbl) <- cnm
    tbl
  } %>>%
  {.[,c(2,3,9,11)]} %>>%
  mutate(
    Qtr = gsub(x=Qtr.,pattern="[a-z,A-Z]",replacement=""),
    result = `How Lost`,
    size = minsec_to_sec(TOP)
  ) %>>%
  select(Team, Qtr, result, size) %>>%
  d3r::d3_nest(value_cols="size") %>>%
  {
    sunburst(
      jsondata = .,
      count=TRUE,
      percent=TRUE,
      sortFunction=htmlwidgets::JS(
"
  function(a,b){debugger;return d3.ascending(a,b)}
"      
      )
    )
  }

Treemap

I did not originally plan to do a treemap, but R makes it so easy that I could not resist. See treemap of football.

Flamegraph

to be done... See Brendan Gregg's post on flamegraphs. Please help if you are interested.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script src="data:application/x-javascript;base64,IWZ1bmN0aW9uKCl7ZnVuY3Rpb24gbihuKXtyZXR1cm4gbiYmKG4ub3duZXJEb2N1bWVudHx8bi5kb2N1bWVudHx8bikuZG9jdW1lbnRFbGVtZW50fWZ1bmN0aW9uIHQobil7cmV0dXJuIG4mJihuLm93bmVyRG9jdW1lbnQmJm4ub3duZXJEb2N1bWVudC5kZWZhdWx0Vmlld3x8bi5kb2N1bWVudCYmbnx8bi5kZWZhdWx0Vmlldyl9ZnVuY3Rpb24gZShuLHQpe3JldHVybiB0Pm4/LTE6bj50PzE6bj49dD8wOk5hTn1mdW5jdGlvbiByKG4pe3JldHVybiBudWxsPT09bj9OYU46K259ZnVuY3Rpb24gaShuKXtyZXR1cm4haXNOYU4obil9ZnVuY3Rpb24gdShuKXtyZXR1cm57bGVmdDpmdW5jdGlvbih0LGUscixpKXtmb3IoYXJndW1lbnRzLmxlbmd0aDwzJiYocj0wKSxhcmd1bWVudHMubGVuZ3RoPDQmJihpPXQubGVuZ3RoKTtpPnI7KXt2YXIgdT1yK2k+Pj4xO24odFt1XSxlKTwwP3I9dSsxOmk9dX1yZXR1cm4gcn0scmlnaHQ6ZnVuY3Rpb24odCxlLHIsaSl7Zm9yKGFyZ3VtZW50cy5sZW5ndGg8MyYmKHI9MCksYXJndW1lbnRzLmxlbmd0aDw0JiYoaT10Lmxlbmd0aCk7aT5yOyl7dmFyIHU9citpPj4+MTtuKHRbdV0sZSk+MD9pPXU6cj11KzF9cmV0dXJuIHJ9fX1mdW5jdGlvbiBvKG4pe3JldHVybiBuLmxlbmd0aH1mdW5jdGlvbiBhKG4pe2Zvcih2YXIgdD0xO24qdCUxOyl0Kj0xMDtyZXR1cm4gdH1mdW5jdGlvbiBsKG4sdCl7Zm9yKHZhciB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JlIHBhc3NlZCB0byB0aGUgZnVuY3Rpb25zLiAoVGhlCiAgLy8gICBzYW1lIGFyZ3VtZW50cyB3aWxsIGJlIHBhc3NlZCB0byBhbGwgZnVuY3Rpb25zLikKICBmdW5jdGlvbiBldmFsQW5kUnVuKHRhc2tzLCB0YXJnZXQsIGFyZ3MpIHsKICAgIGlmICh0YXNrcykgewogICAgICBmb3JFYWNoKHRhc2tzLCBmdW5jdGlvbih0YXNrKSB7CiAgICAgICAgdmFyIHRoZXNlQXJncyA9IGFyZ3M7CiAgICAgICAgaWYgKHR5cGVvZih0YXNrKSA9PT0gIm9iamVjdCIpIHsKICAgICAgICAgIHRoZXNlQXJncyA9IHRoZXNlQXJncy5jb25jYXQoW3Rhc2suZGF0YV0pOwogICAgICAgICAgdGFzayA9IHRhc2suY29kZTsKICAgICAgICB9CiAgICAgICAgdmFyIHRhc2tGdW5jID0gZXZhbCgiKCIgKyB0YXNrICsgIikiKTsKICAgICAgICBpZiAodHlwZW9mKHRhc2tGdW5jKSAhPT0gImZ1bmN0aW9uIikgewogICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCJUYXNrIG11c3QgYmUgYSBmdW5jdGlvbiEgU291cmNlOlxuIiArIHRhc2spOwogICAgICAgIH0KICAgICAgICB0YXNrRnVuYy5hcHBseSh0YXJnZXQsIHRoZXNlQXJncyk7CiAgICAgIH0pOwogICAgfQogIH0KCiAgZnVuY3Rpb24gaW5pdFNpemluZyhlbCkgewogICAgdmFyIHNpemluZyA9IHNpemluZ1BvbGljeShlbCk7CiAgICBpZiAoIXNpemluZykKICAgICAgcmV0dXJuOwoKICAgIHZhciBjZWwgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiaHRtbHdpZGdldF9jb250YWluZXIiKTsKICAgIGlmICghY2VsKQogICAgICByZXR1cm47CgogICAgaWYgKHR5cGVvZihzaXppbmcucGFkZGluZykgIT09ICJ1bmRlZmluZWQiKSB7CiAgICAgIGRvY3VtZW50LmJvZHkuc3R5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2YWwoaW50SWQpOwogICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQogICAgICAgICAgICBlcnJvckRpdgogICAgICAgICAgICAgIC5jc3MoInRvcCIsIGVsLm9mZnNldFRvcCkKICAgICAgICAgICAgICAuY3NzKCJsZWZ0IiwgZWwub2Zmc2V0TGVmdCkKICAgICAgICAgICAgICAuY3NzKCJtYXhXaWR0aCIsIGVsLm9mZnNldFdpZHRoKQogICAgICAgICAgICAgIC5jc3MoImhlaWdodCIsIGVsLm9mZnNldEhlaWdodCk7CiAgICAgICAgICB9LCA1MDApOwogICAgICAgIH0KICAgICAgfQogICAgfSwKICAgIGNsZWFyRXJyb3I6IGZ1bmN0aW9uKGVsKSB7CiAgICAgIHZhciAkZWwgPSAkKGVsKTsKICAgICAgdmFyIGRpc3BsYXkgPSAkZWwuZGF0YSgicmVzdG9yZS1kaXNwbGF5LW1vZGUiKTsKICAgICAgJGVsLmRhdGEoInJlc3RvcmUtZGlzcGxheS1tb2RlIiwgbnVsbCk7CgogICAgICBpZiAoZGlzcGxheSA9PT0gImlubGluZSIgfHwgZGlzcGxheSA9PT0gImlubGluZS1ibG9jayIpIHsKICAgICAgICBpZiAoZGlzcGxheSkKICAgICAgICAgICRlbC5jc3MoImRpc3BsYXkiLCBkaXNwbGF5KTsKICAgICAgICAkKGVsLm5leHRTaWJsaW5nKS5maWx0ZXIoIi5odG1sd2lkZ2V0cy1lcnJvciIpLnJlbW92ZSgpOwogICAgICB9IGVsc2UgaWYgKGRpc3BsYXkgPT09ICJibG9jayIpewogICAgICAgICRlbC5jc3MoInZpc2liaWxpdHkiLCAiaW5oZXJpdCIpOwogICAgICAgICQoZWwubmV4dFNpYmxpbmcpLmZpbHRlcigiLmh0bWx3aWRnZXRzLWVycm9yIikucmVtb3ZlKCk7CiAgICAgIH0KICAgIH0sCiAgICBzaXppbmc6IHt9CiAgfTsKCiAgLy8gQ2FsbGVkIGJ5IHdpZGdldCBiaW5kaW5ncyB0byByZWdpc3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KICAgICAgfTsKCiAgICAgIC8vIFdyYXAgcmVuZGVyVmFsdWUgdG8gaGFuZGxlIGluaXRpYWxpemF0aW9uLCB3aGljaCB1bmZvcnR1bmF0ZWx5IGlzbid0CiAgICAgIC8vIHN1cHBvcnRlZCBuYXRpdmVseSBieSBTaGlueSBhdCB0aGUgdGltZSBvZiB0aGlzIHdyaXRpbmcuCgogICAgICBzaGlueUJpbmRpbmcucmVuZGVyVmFsdWUgPSBmdW5jdGlvbihlbCwgZGF0YSkgewogICAgICAgIC8vIFJlc29sdmUgc3RyaW5ncyBtYXJrZWQgYXMgamF2YXNjcmlwdCBsaXRlcmFscyB0byBvYmplY3RzCiAgICAgICAgaWYgKCEoZGF0YS5ldmFscyBpbnN0YW5jZW9mIEFycmF5KSkgZGF0YS5ldmFscyA9IFtkYXRhLmV2YWxzXTsKICAgICAgICBmb3IgKHZhciBpID0gMDsgZGF0YS5ldmFscyAmJiBpIDwgZGF0YS5ldmFscy5sZW5ndGg7IGkrKykgewogICAgICAgICAgd2luZG93LkhUTUxXaWRnZXRzLmV2YWx1YXRlU3RyaW5nTWVtYmVyKGRhdGEueCwgZGF0YS5ldmFsc1tpXSk7CiAgICAgICAgfQogICAgICAgIGlmICghYmluZGluZ0RlZi5yZW5kZXJPbk51bGxWYWx1ZSkgewogICAgICAgICAgaWYgKGRhdGEueCA9PT0gbnVsbCkgewogICAgICAgICAgICBlbC5zdHlsZS52aXNpYmlsaXR5ID0gImhpZGRlbiI7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGVsLnN0eWxlLnZpc2liaWxpdHkgPSAiaW5oZXJpdCI7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmICghZWxlbWVudERhdGEoZWwsICJpbml0aWFsaXplZCIpKSB7CiAgICAgICAgICBpbml0U2l6aW5nKGVsKTsKCiAgICAgICAgICBlbGVtZW50RGF0YShlbCwgImluaXRpYWxpemVkIiwgdHJ1Z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woKICAgICAgICBpZiAoaGFzQ2xhc3MoZWwsICJodG1sLXdpZGdldC1zdGF0aWMtYm91bmQiKSkKICAgICAgICAgIHJldHVybjsKICAgICAgICBlbC5jbGFzc05hbWUgPSBlbC5jbGFzc05hbWUgKyAiIGh0bWwtd2lkZ2V0LXN0YXRpYy1ib3VuZCI7CgogICAgICAgIHZhciBpbml0UmVzdWx0OwogICAgICAgIGlmIChiaW5kaW5nLmluaXRpYWxpemUpIHsKICAgICAgICAgIGluaXRSZXN1bHQgPSBiaW5kaW5nLmluaXRpYWxpemUoZWwsCiAgICAgICAgICAgIHNpemVPYmogPyBzaXplT2JqLmdldFdpZHRoKCkgOiBlbC5vZmZzZXRXaWR0aCwKICAgICAgICAgICAgc2l6ZU9iaiA/IHNpemVPYmouZ2V0SGVpZ2h0KCkgOiBlbC5vZmZzZXRIZWlnaHQKICAgICAgICAgICk7CiAgICAgICAgICBlbGVtZW50RGF0YShlbCwgImluaXRfcmVzdWx0IiwgaW5pdFJlc3VsdCk7CiAgICAgICAgfQoKICAgICAgICBpZiAoYmluZGluZy5yZXNpemUpIHsKICAgICAgICAgIHZhciBsYXN0U2l6ZSA9IHt9OwogICAgICAgICAgdmFyIHJlc2l6ZUhhbmRsZXIgPSBmdW5jdGlvbihlKSB7CiAgICAgICAgICAgIHZhciBzaXplID0gewogICAgICAgICAgICAgIHc6IHNpemVPYmogPyBzaXplT2JqLmdldFdpZHRoKCkgOiBlbC5vZmZzZXRXaWR0aCwKICAgICAgICAgICAgICBoOiBzaXplT2JqID8gc2l6ZU9iai5nZXRIZWlnaHQoKSA6IGVsLm9mZnNldEhlaWdodAogICAgICAgICAgICB9OwogICAgICAgICAgICBpZiAoc2l6ZS53ID09PSAwICYmIHNpemUuaCA9PT0gMCkKICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgIGlmIChzaXplLncgPT09IGxhc3RTaXplLncgJiYgc2l6ZS5oID09PSBsYXN0U2l6ZS5oKQogICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgbGFzdFNpemUgPSBzaXplOwogICAgICAgICAgICBiaW5kaW5nLnJlc2l6ZShlbCwgc2l6ZS53LCBzaXplLmgsIGluaXRSZXN1bHQpOwogICAgICAgICAgfTsKCiAgICAgICAgICBvbih3aW5kb3csICJyZXNpemUiLCByZXNpemVIYW5kbGVyKTsKCiAgICAgICAgICAvLyBUaGlzIGlzIG5lZWRlZCBmb3IgY2FzZXMgd2hlcmUgd2UncmUgcnVubmluZyBpbiBhIFNoaW55CiAgICAgICAgICAvLyBhcHAsIGJ1dCB0aGUgd2lkZ2V0IGl0c2VsZiBpcyBub3QgYSBTaGlueSBvdXRwdXQsIGJ1dAogICAgICAgICAgLy8gcmF0aGVyIGEgc2ltcGxlIHN0YXRpYyB3aWRnZXQuIE9uZSBleGFtcGxlIG9mIHRoaXMgaXMKICAgICAgICAgIC8vIGFuIHJtYXJrZG93biBkb2N1bWVudCB0aGF0IGhhcyBydW50aW1lOnNoaW55IGFuZCB3aWRnZXQKICAgICAgICAgIC8vIHRoYXQgaXNuJ3QgaW4gYSByZW5kZXIgZnVuY3Rpb24uIFNoaW55IG9ubHkga25vd3MgdG8KICAgICAgICAgIC8vIGNhbGwgcmVzaXplIGhhbmRsZXJzIGZvciBTaGlueSBvdXRwdXRzLCBub3QgZm9yIHN0YXRpYwogICAgICAgICAgLy8gd2lkZ2V0cywgc28gd2UgZG8gaXQgb3Vyc2VsdmVzLgogICAgICAgICAgaWYgKHdpbmRvdy5qUXVlcnkpIHsKICAgICAgICAgICAgd2luZG93LmpRdWVyeShkb2N1bWVudCkub24oCiAgICAgICAgICAgICAgInNob3duLmh0bWx3aWRnZXRzIHNob3duLmJzLnRhYi5odG1sd2lkZ2V0cyBzaG93bi5icy5jb2xsYXBzZS5odG1sd2lkZ2V0cyIsCiAgICAgICAgICAgICAgcmVzaXplSGFuZGxlcgogICAgICAgICAgICApOwogICAgICAgICAgICB3aW5kb3cualF1ZXJ5KGRvY3VtZW50KS5vbig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gIH0KICAgIHJldHVybiBsaW5rLmdldEF0dHJpYnV0ZSgiaHJlZiIpOwogIH07CgogIHdpbmRvdy5IVE1MV2lkZ2V0cy5kYXRhZnJhbWVUb0QzID0gZnVuY3Rpb24oZGYpIHsKICAgIHZhciBuYW1lcyA9IFtdOwogICAgdmFyIGxlbmd0aDsKICAgIGZvciAodmFyIG5hbWUgaW4gZGYpIHsKICAgICAgICBpZiAoZGYuaGFzT3duUHJvcGVydHkobmFtZSkpCiAgICAgICAgICAgIG5hbWVzLnB1c2gobmFtZSk7CiAgICAgICAgaWYgKHR5cGVvZihkZltuYW1lXSkgIT09ICJvYmplY3QiIHx8IHR5cGVvZihkZltuYW1lXS5sZW5ndGgpID09PSAidW5kZWZpbmVkIikgewogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIkFsbCBmaWVsZHMgbXVzdCBiZSBhcnJheXMiKTsKICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZihsZW5ndGgpICE9PSAidW5kZWZpbmVkIiAmJiBsZW5ndGggIT09IGRmW25hbWVdLmxlbmd0aCkgewogICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoIkFsbCBmaWVsZHMgbXVzdCBiZSBhcnJheXMgb2YgdGhlIHNhbWUgbGVuZ3RoIik7CiAgICAgICAgfQogICAgICAgIGxlbmd0aCA9IGRmW25hbWVdLmxlbmd0aDsKICAgIH0KICAgIHZhciByZXN1bHRzID0gW107CiAgICB2YXIgaXRlbTsKICAgIGZvciAodmFyIHJvdyA9IDA7IHJvdyA8IGxlbmd0aDsgcm93KyspIHsKICAgICAgICBpdGVtID0ge307CiAgICAgICAgZm9yICh2YXIgY29sID0gMDsgY29sIDwgbmFtZXMubGVuZ3RoOyBjb2wrKykgewogICAgICAgICAgICBpdGVtW25hbWVzW2NvbF1dID0gZGZbbmFtZXNbY29sXV1bcm93XTsKICAgICAgICB9CiAgICAgICAgcmVzdWx0cy5wdXNoKGl0ZW0pOwogICAgfQogICAgcmV0dXJuIHJ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AgfQp9KSgpOwoK"></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,SFRNTFdpZGdldHMud2lkZ2V0KHsNCg0KICBuYW1lOiAnc3VuYnVyc3QnLA0KDQogIHR5cGU6ICdvdXRwdXQnLA0KDQogIGZhY3Rvcnk6IGZ1bmN0aW9uKGVsLCB3aWR0aCwgaGVpZ2h0KSB7DQoNCiAgICB2YXIgaW5zdGFuY2UgPSB7fTsNCg0KICAgIGluc3RhbmNlLmNoYXJ0ID0ge307DQoNCiAgICB2YXIgZGlzcGF0Y2ggPSBkMy5kaXNwYXRjaCgibW91c2VvdmVyIiwibW91c2VsZWF2ZSIsImNsaWNrIik7DQoNCiAgICBkMy5yZWJpbmQoaW5zdGFuY2UuY2hhcnQsIGRpc3BhdGNoLCAnb24nKTsNCg0KICAgIHZhci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ICAgICB2YXIgY291bnRTdHJpbmcgPSBbDQogICAgICAgICAgICAnPHNwYW4gc3R5bGUgPSAiZm9udC1zaXplOi43ZW0iPicsDQogICAgICAgICAgICBkMy5mb3JtYXQoIjEuMnMiKShkLnZhbHVlKSArICcgb2YgJyArIGQzLmZvcm1hdCgiMS4ycyIpKHRvdGFsU2l6ZSksDQogICAgICAgICAgICAnPC9zcGFuPicNCiAgICAgICAgICBdLmpvaW4oJycpDQoNCiAgICAgICAgdmFyIGV4cGxhbmF0aW9uU3RyaW5nID0gIiI7DQogICAgICAgIGlmKHgub3B0aW9ucy5wZXJjZW50ICYmIHgub3B0aW9ucy5jb3VudCl7DQogICAgICAgICAgZXhwbGFuYXRpb25TdHJpbmcgPSBwZXJjZW50YWdlU3RyaW5nICsgJzxici8+JyArIGNvdW50U3RyaW5nOw0KICAgICAgICB9IGVsc2UgaWYoeC5vcHRpb25zLnBlcmNlbnQpew0KICAgICAgICAgIGV4cGxhbmF0aW9uU3RyaW5nID0gcGVyY2VudGFnZVN0cmluZzsNCiAgICAgICAgfSBlbHNlIGlmKHgub3B0aW9ucy5jb3VudCl7DQogICAgICAgICAgZXhwbGFuYXRpb25TdHJpbmcgPSBjb3VudFN0cmluZzsNCiAgICAgICAgfQ0KDQogICAgICAgIC8vaWYgZXhwbGFuYXRpb24gZGVmaW5lZCBpbiBSIHRoZW4gdXNlIHRoaXMgaW5zdGVhZA0KICAgICAgICBpZih4Lm9wdGlvbnMuZXhwbGFuYXRpb24gIT09IG51bGwpew0KICAgICAgICAgIGV4cGxhbmF0aW9uU3RyaW5nID0geC5vcHRpb25zLmV4cGxhbmF0aW9uLmJpbmQodG90YWxTaXplKShkKTsNCiAgICAgICAgfQ0KDQoNCiAgICAgICAgZDMuc2VsZWN0KGVsKS5zZWxlY3RBbGwoIi5zdW5idXJzdC1leHBsYW5hdGlvbiIpDQogICAgICAgICAgICAuc3R5bGUoInZpc2liaWxpdHkiLCAiIikNCiAgICAgICAgICAgIC5zdHlsZSgidG9wIiwoKGhlaWdodCAtIDcwKS8yKSArICJweCIpDQogICAgICAgICAgICAuc3R5bGUoIndpZHRoIix3aWR0aCArICJweCIpDQogICAgICAgICAgICAuaHRtbChleHBsYW5hdGlvblN0cmluZyk7DQoNCiAgICAgICAgdmFyIHNlcXVlbmNlQXJyYXkgPSBnZXRBbmNlc3RvcnMoZCk7DQoNCiAgICAgICAgY2hhcnQuX3NlbGVjdGlvbiA9IHNlcXVlbmNlQXJyYXkubWFwKA0KICAgICAgICAgIGZ1bmN0aW9uKGQpe3JldHVybiBkLm5hbWV9DQogICAgICAgICk7DQogICAgICAgIGRpc3BhdGNoLm1vdXNlb3ZlcihjaGFydC5fc2VsZWN0aW9uKTsNCg0KICAgICAgICB1cGRhdGVCcmVhZGNydW1icyhzZXF1ZW5jZUFycmF5LCBwZXJjZW50YWdlU3RyaW5nKTsNCg0KICAgICAgICAvLyBGYWRlIGFsbCB0aGUgc2VnbWVudHMuDQogICAgICAgIGQzLnNlbGVjdChlbCkuc2VsZWN0QWxsKCJwYXRoIikNCiAgICAgICAgICAgIC5zdHlsZSgib3BhY2l0eSIsIDAuMyk7DQoNCiAgICAgICAgLy8gVGhlbiBoaWdobGlnaHQgb25seSB0aG9zZSB0aGF0IGFyZSBhbiBhbmNlc3RvciBvZiB0aGUgY3VycmVudCBzZWdtZW50Lg0KICAgICAgICB2aXMuc2VsZWN0QWxsKCJwYXRoIikNCiAgICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24obm9kZSkgew0KICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoc2VxdWVuY2VBcnJheS5pbmRleE9mKG5vZGUpID49IDApOw0KICAgICAgICAgICAgICAgICAgICB9KQ0KICAgICAgICAgICAgLnN0eWxlKCJvcGFjaXR5IiwgMSk7DQogICAgICB9DQoNCiAgICAgIC8vIFJlc3RvcmUgZXZlcnl0aGluZyB0byBmdWxsIG9wYWNpdHkgd2hlbiBtb3Zpbmcgb2ZmIHRoZSB2aXN1Y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AvLyBBZGQgdGhlIGxhYmVsIGF0IHRoZSBlbmQsIGZvciB0aGUgcGVyY2VudGFnZS4NCiAgICAgICAgdHJhaWwuYXBwZW5kKCJ0ZXh0IikNCiAgICAgICAgICAuYXR0cigiaWQiLCBlbC5pZCArICItZW5kbGFiZWwiKQ0KICAgICAgICAgIC5zdHlsZSgiZmlsbCIsICIjMDAwIik7DQogICAgICB9DQoNCiAgICAgIC8vIEdlbmVyYXRlIGEgc3RyaW5nIHRoYXQgZGVzY3JpYmVzIHRoZSBwb2ludHMgb2YgYSBicmVhZGNydW1iIHBvbHlnb24uDQogICAgICBmdW5jdGlvbiBicmVhZGNydW1iUG9pbnRzKGQsIGkpIHsNCiAgICAgICAgdmFyIHBvaW50cyA9IFtdOw0KICAgICAgICBwb2ludHMucHVzaCgiMCwwIik7DQogICAgICAgIGlmIChiLncgPD0gMCkgew0KICAgICAgICAgIC8vIGNhbGN1bGF0ZSBicmVhZGNydW1iIHdpZHRoIGJhc2VkIG9uIHN0cmluZyBsZW5ndGgNCiAgICAgICAgICBwb2ludHMucHVzaChkLnN0cmluZ19sZW5ndGggKyAiLDAiKTsNCiAgICAgICAgICBwb2ludHMucHVzaChkLnN0cmluZ19sZW5ndGggKyBiLnQgKyAiLCIgKyAoYi5oIC8gMikpOw0KICAgICAgICAgIHBvaW50cy5wdXNoKGQuc3RyaW5nX2xlbmd0aCArICIsIiArIGIuaCk7DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgcG9pbnRzLnB1c2goYi53ICsgIiwwIik7DQogICAgICAgICAgcG9pbnRzLnB1c2goYi53ICsgYi50ICsgIiwiICsgKGIuaCAvIDIpKTsNCiAgICAgICAgICBwb2ludHMucHVzaChiLncgKyAiLCIgKyBiLmgpOw0KICAgICAgICB9DQogICAgICAgIHBvaW50cy5wdXNoKCIwLCIgKyBiLmgpOw0KDQogICAgICAgIGlmIChpID4gMCkgeyAvLyBMZWZ0bW9zdCBicmVhZGNydW1iOyBkb24ndCBpbmNs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GNydW1iX3ggPSAwOw0KICAgICAgICAgIG5vZGVBcnJheVswXS5icmVhZGNydW1iX3ggPSAwOw0KICAgICAgICAgIG5vZGVBcnJheVswXS5icmVhZGNydW1iX2ggPSAwOw0KDQogICAgICAgICAgZW50ZXJpbmcuYXBwZW5kKCJwb2x5Z29uIikNCiAgICAgICAgICAgICAgLnN0eWxlKCJ6LWluZGV4IixmdW5jdGlvbihkLGkpIHsgcmV0dXJuKDk5OS1pKTsgfSkNCiAgICAgICAgICAgICAgLnN0eWxlKCJmaWxsIiwgZnVuY3Rpb24oZCkgeyByZXR1cm4gY29sb3JzKGQubmFtZSk7IH0pOw0KDQogICAgICAgICAgZW50ZXJpbmcuYXBwZW5kKCJ0ZXh0IikNCiAgICAgICAgICAgICAgLmF0dHIoIngiLCBiLnQgKyAyKQ0KICAgICAgICAgICAgICAuYXR0cigieSIsIGIuaCAvIDIpDQogICAgICAgICAgICAgIC5hdHRyKCJkeSIsICIwLjM1ZW0iKQ0KICAgICAgICAgICAgICAuYXR0cigidGV4dC1hbmNob3IiLCAibGVmdCIpDQogICAgICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQubmFtZTsgfSk7DQoNCiAgICAgICAgICAvLyBSZW1vdmUgZXhpdGluZyBub2Rlcy4NCiAgICAgICAgICBnLmV4aXQoKS5yZW1vdmUoKTsNCg0KICAgICAgICAgIC8vIGxvb3AgdGhyb3VnaCBlYWNoIGcgZWxlbWVudA0KICAgICAgICAgIC8vICBjYWxjdWxhdGUgc3RyaW5nIGxlbmd0aA0KICAgICAgICAgIC8vICBkcmF3IHRoZSBicmVhZGNydW1iIHBvbHlnb24NCiAgICAgICAgICAvLyAgYW5kIGRldGVybWluZSBpZiBicmVhZGNydW1iIHNob3VsZCBiZSB3cmFwcGVkIHRvIG5leHQgcm93DQogICAgICAgICAgZy5lYWNoKGZ1bmN0aW9uKGQsayl7DQogICAgICAgICAgICB2YXIgY3J1bWJnID0gZDMuc2VsZWN0KHRoaXMpOw0KICAgICAgICAgICAgdmFyIG15X3N0cmluZ19sZW5ndGggPSBjcnVtYmcuc2VsZWN0KCJ0ZXh0Iikubm9kZSgpLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLndpZHRoOw0KICAgICAgICAgICAgbm9kZUFycmF5W2tdLnN0cmluZ19sZW5ndGggPSBteV9zdHJpbmdfbGVuZ3RoICsgMTI7DQogICAgICAgICAgICBjcnVtYmcuc2VsZWN0KCJwb2x5Z29uIikuYXR0cigicG9pbnRzIiwgZnVuY3Rpb24oZCl7DQogICAgICAgICAgICAgIHJldHVybiBicmVhZGNydW1iUG9pbnRzKGQsIGspOw0KICAgICAgICAgICAgfSk7DQogICAgICAgICAgICB2YXIgbXlfZ19sZW5ndGggPSBjcnVtYmcubm9kZSgpLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLndpZHRoOw0KICAgICAgICAgICAgY3Vycl9icmVhZGNydW1iX3ggKz0gaz09PTAgPyAwIDogbm9kZUFycmF5W2stMV0uc3RyaW5nX2xlbmd0aCArIGIuczsNCiAgICAgICAgICAgIG5vZGVBcnJheVtrXS5icmVhZGNydW1iX2ggPSBrPT09MCA/IDAgOiBub2RlQXJyYXlbay0xXS5icmVhZGNydW1iX2g7DQoNCiAgICAgICAgICAgIGlmIChjdXJyX2JyZWFkY3J1bWJfeCArIG15X2dfbGVuZ3RoID4gd2lkdGgqMC45OSkgew0KICAgICAgICAgICAgICBub2RlQXJyYXlba10uYnJlYWRjcnVtYl9oICs9IGIuaDsgIC8vIGdvdCB0byBuZXh0IGxpbmUNCiAgICAgICAgICAgICAgY3Vycl9icmVhZGNydW1iX3ggPSBiLnQgKyBiLnM7ICAgICAvLyByZXN0YXJ0IGNvdW50ZXINCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIG5vZGVBcnJheVtrXS5icmVhZGNydW1iX3ggPSBjdXJyX2JyZWFkY3J1bWJfeDsNCiAgICAgICAgICB9KTsNCg0KDQogICAgICAgICAgL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yZWFkY3J1bWJfaCArPSBiLmggKyBiLmgvMjsNCiAgICAgICAgICAgICAgICAgIGN1cnJfYnJlYWRjcnVtYl94ID0gYi50ICsgYi5zOyAgICAgLy8gcmVzdGFydCBjb3VudGVyDQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIGJlbmQuZGF0dW0oew0KICAgICAgICAgICAgICAgICAgImJyZWFkY3J1bWJfeCI6IGN1cnJfYnJlYWRjcnVtYl94LA0KICAgICAgICAgICAgICAgICAgImJyZWFkY3J1bWJfaCI6IGN1cnJfYnJlYWRjcnVtYl9oDQogICAgICAgICAgICAgICAgfSk7DQogICAgICAgICAgICAgICAgcmV0dXJuIGN1cnJfYnJlYWRjcnVtYl94Ow0KICAgICAgICAgICAgICB9KQ0KICAgICAgICAgICAgICAuYXR0cigieSIsIGZ1bmN0aW9uKGQpe3JldHVybiBkLmJyZWFkY3J1bWJfaH0pDQogICAgICAgICAgICAgIC5hdHRyKCJkeSIsICIwLjM1ZW0iKQ0KICAgICAgICAgICAgICAuYXR0cigidGV4dC1hbmNob3IiLCAic3RhcnQiKQ0KICAgICAgICAgICAgICAudGV4dChwZXJjZW50YWdlU3RyaW5nKTsNCg0KDQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgZW50ZXJpbmcuYXBwZW5kKCJwb2x5Z29uIikNCiAgICAgICAgICAgICAgLmF0dHIoInBvaW50cyIsIGJyZWFkY3J1bWJQb2ludHMpDQogICAgICAgICAgICAgIC5zdHlsZSgiZmlsbCIsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGNvbG9ycyhkLm5hbWUpOyB9KTsNCg0KICAgICAgICAgIGVudGVyaW5nLmFwcGVuZCgidGV4dCIpDQogICAgICAgICAgICAgIC5hdHRyKCJ4IiwgKGIudyArIGIudCkgLyAyKQ0KICAgICAgICAgICAgICAuYXR0cigieSIsIGIuaCAvIDIpDQogICAgICAgICAgICAgIC5hdHRyKCJkeSIsICIwLjM1ZW0iKQ0KICAgICAgICAgICAgICAuYXR0cigidGV4dC1hbmNob3IiLCAibWlkZGxlIikNCiAgICAgICAgICAgICAgLnRleHQoZnVuY3Rpb24oZCkgeyByZXR1cm4gZC5uYW1lOyB9KTsNCg0KICAgICAgICAgIC8vIFNldCBwb3NpdGlvbiBmb3IgZW50ZXJpbmcgYW5kIHVwZGF0aW5nIG5vZGVzLg0KICAgICAgICAgIGcuYXR0cigidHJhbnNmb3JtIiwgZnVuY3Rpb24oZCwgaSkgew0KICAgICAgICAgICAgcmV0dXJuICJ0cmFuc2xhdGUoIiArIGkgKiAoYi53ICsgYi5zKSArICIsIDApIjsNCiAgICAgICAgICB9KTsNCg0KICAgICAgICAgIC8vIFJlbW92ZSBleGl0aW5nIG5vZGVzLg0KICAgICAgICAgIGcuZXhpdCgpLnJlbW92ZSgpOw0KDQogICAgICAgICAgLy8gTm93IG1vdmUgYW5kIHVwZGF0ZSB0aGUgcGVyY2VudGFnZSBhdCB0aGUgZW5kLg0KICAgICAgICAgIGQzLnNlbGVjdChlbCkuc2VsZWN0KCIjIiArIGVsLmlkICsgIi10cmFpbCIpLnNlbGVjdCgiIyIgKyBlbC5pZCArICItZW5kbGFiZWwiKQ0KICAgICAgICAgICAgICAuYXR0cigieCIsIChub2RlQXJyYXkubGVuZ3RoICsgMC41KSAqIChiLncgKyBiLnMpKQ0KICAgICAgICAgICAgICAuYXR0cigieSIsIGIuaCAvIDIpDQogICAgICAgICAgICAgIC5hdHRyKCJkeSIsICIwLjM1ZW0iKQ0KICAgICAgICAgICAgICAuYXR0cigidGV4dC1hbmNob3IiLCAibWlkZGxlIikNCiAgICAgICAgICAgICAgLnRleHQocGVyY2VudGFnZVN0cmluZyk7DQoNCiAgICAgICAgfQ0KDQogICAgICAgIC8vIE1ha2UgdGhlIGJyZWFkY3J1bWIgdHJhaWwgdmlzaWJsZSwgaWYgaXQncyBoaWRkZW4uDQogICAgICAgIGQzLnNlbGVjdChlbCkuc2VsZWN0KCIjIiArIGVsLmlkICsgIi10cm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gICAgICAgIGlmKHgub3B0aW9ucy5sZWdlbmRPcmRlciAhPT0gbnVsbCl7DQogICAgICAgICAgICAgICAgcmV0dXJuIHgub3B0aW9ucy5sZWdlbmRPcmRlcjsNCiAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAvLyBnZXQgc29ydGVkIGJ5IHRvcCBsZXZlbA0KICAgICAgICAgICAgICAgIHNvcnRlZG5hbWUgPSBkMy5zZXQoT2JqZWN0LmtleXMoZDMubmVzdCgpLmtleShmdW5jdGlvbihkKXtyZXR1cm4gZC5uYW1lfSkucm9sbHVwKGZ1bmN0aW9uKGQpe3JldHVybiBkWzBdLnZhbHVlfSkubWFwKGpzb24uY2hpbGRyZW4pICkpDQogICAgICAgICAgICAgICAgLy8gYWRkIGFueSBvdGhlciBtaXNzaW5nDQogICAgICAgICAgICAgICAgY29sb3JzLmRvbWFpbigpDQogICAgICAgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uKGQpew0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gZCAhPT0ganNvbi5uYW1lOw0KICAgICAgICAgICAgICAgICAgfSkNCiAgICAgICAgICAgICAgICAgIC5mb3JFYWNoKGZ1bmN0aW9uKGQpew0KICAgICAgICAgICAgICAgICAgICBzb3J0ZWRuYW1lLmFkZChkKQ0KICAgICAgICAgICAgICAgICAgfSkNCiAgICAgICAgICAgICAgICByZXR1cm4gc29ydGVkbmFtZS52YWx1ZXMoKTsNCiAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfSkNCiAgICAgICAgICAgIC5lbnRlcigpLmFwcGVuZCgiZyIpDQogICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgZnVuY3Rpb24oZCwgaSkgew0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gInRyYW5zbGF0ZSgwLCIgKyBpICogKGxpLmggKyBsaS5zKSArICIpIjsNCiAgICAgICAgICAgICAgICAgfSk7DQoNCiAgICAgICAgZy5hcHBlbmQoInJlY3QiKQ0KICAgICAgICAgICAgLmF0dHIoInJ4IiwgbGkucikNCiAgICAgICAgICAgIC5hdHRyKCJyeSIsIGxpLnIpDQogICAgICAgICAgICAuYXR0cigid2lkdGgiLCBsaS53KQ0KICAgICAgICAgICAgLmF0dHIoImhlaWdodCIsIGxpLmgpDQogICAgICAgICAgICAuc3R5bGUoImZpbGwiLCBmdW5jdGlvbihkKSB7IHJldHVybiBjb2xvcnMoZCk7IH0pOw0KDQogICAgICAgIGcuYXBwZW5kKCJ0ZXh0IikNCiAgICAgICAgICAgIC5hdHRyKCJ4IiwgbGkudyAvIDIpDQogICAgICAgICAgICAuYXR0cigieSIsIGxpLmggLyAyKQ0KICAgICAgICAgICAgLmF0dHIoImR5IiwgIjAuMzVlbSIpDQogICAgICAgICAgICAuYXR0cigidGV4dC1hbmNob3IiLCAibWlkZGxlIikNCiAgICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQ7IH0pOw0KICAgICAgfQ0KDQogICAgICBmdW5jdGlvbiB0b2dnbGVMZWdlbmQoKSB7DQogICAgICAgIHZhciBsZWdlbmQgPSBkMy5zZWxlY3QoZWwpLnNlbGVjdCgiLnN1bmJ1cnN0LWxlZ2VuZCIpDQogICAgICAgIGlmIChsZWdlbmQuc3R5bGUoInZpc2liaWxpdHkiKSA9PSAiaGlkZGVuIikgew0KICAgICAgICAgIGxlZ2VuZC5zdHlsZSgidmlzaWJpbGl0eSIsICIiKTsNCiAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICBsZWdlbmQuc3R5bGUoInZpc2liaWxpdHkiLCAiaGlkZGVuIik7DQogICAgICAgIH0NCiAgICAgIH0NCiAgICB9Ow0KDQogICAgLy8gVGFrZSBhIDItY29sdW1uIENTViBhbmQgdHJhbnNmb3JtIGl0IGludG8gYSBoaWVyYXJjaGljYWwgc3RydWN0dXJlIHN1aXRhYmxlDQogICAgLy8gZm9yIGEgcGFydGl0aW9uIGxheW91dC4gVGhlIGZ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cw0KICAgICAgICAvLyAgICAgYnV0IGJ1aWxkSGllcmFyY2h5IGV4cGVjdHMgYW4gQXJyYXkgb2YgQXJyYXlzDQogICAgICAgIC8vICAgICBzbyB1c2UgZDMuemlwIGFuZCBhcHBseSB0byBkbyB0aGlzDQogICAgICAgIHZhciBqc29uID0gW107DQogICAgICAgIGlmKHguY3N2ZGF0YSAhPT0gbnVsbCl7DQogICAgICAgICAganNvbiA9IGJ1aWxkSGllcmFyY2h5KA0KICAgICAgICAgICAgZDMuemlwLmFwcGx5KA0KICAgICAgICAgICAgICBudWxsLA0KICAgICAgICAgICAgICBPYmplY3Qua2V5cyh4LmNzdmRhdGEpLm1hcChmdW5jdGlvbihreSl7cmV0dXJuIHguY3N2ZGF0YVtreV19KQ0KICAgICAgICAgICAgKQ0KICAgICAgICAgICk7DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAganNvbiA9IHguanNvbmRhdGENCiAgICAgICAgfQ0KICAgICAgICBpbnN0YW5jZS5qc29uID0ganNvbjsNCg0KICAgICAgICBkcmF3KGVsLCBpbnN0YW5jZSk7DQoNCiAgICAgIH0sDQoNCiAgICAgIHJlc2l6ZTogZnVuY3Rpb24od2lkdGgsIGhlaWdodCkgew0KDQogICAgICAgIGRyYXcoZWwsIGluc3RhbmNlKTsNCg0KICAgICAgfSwNCg0KICAgICAgaW5zdGFuY2U6IGluc3RhbmNlDQoNCiAgICB9Ow0KICB9DQp9KTsNCg=="></script>
</head>
<body style="background-color:white;">
<div id="htmlwidget_container">
<div id="htmlwidget-9ca9bed3915643cff4c4" class="sunburst html-widget" 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-9ca9bed3915643cff4c4">{"x":{"csvdata":null,"jsondata":{"children":[{"name":"UA","children":[{"name":"1","children":[{"name":"FG","size":183},{"name":"FG","size":305},{"name":"TD","size":199}]},{"name":"2","children":[{"name":"PUNT","size":179},{"name":"INT","size":49},{"name":"FGA","size":170},{"name":"INT","size":38}]},{"name":"3","children":[{"name":"TD","size":381},{"name":"PUNT","size":147},{"name":"TD","size":0}]},{"name":"4","children":[{"name":"TD","size":77},{"name":"DOWNS","size":315},{"name":"HALF","size":107}]}]},{"name":"TAMU","children":[{"name":"1","children":[{"name":"PUNT","size":129},{"name":"PUNT","size":205}]},{"name":"2","children":[{"name":"PUNT","size":161},{"name":"PUNT","size":73},{"name":"INT","size":7},{"name":"TD","size":102},{"name":"HALF","size":0}]},{"name":"3","children":[{"name":"TD","size":126},{"name":"PUNT","size":87},{"name":"FUMB","size":138},{"name":"PUNT","size":97}]},{"name":"4","children":[{"name":"DOWNS","size":129},{"name":"DOWNS","size":196}]}]}],"name":"root"},"options":{"legendOrder":null,"colors":null,"percent":true,"count":true,"explanation":null,"breadcrumb":[],"legend":[],"sortFunction":"\n function(a,b){debugger;return d3.ascending(a,b)}\n"}},"evals":["options.sortFunction"],"jsHooks":[]}</script>
<script type="application/htmlwidget-sizing" data-for="htmlwidget-9ca9bed3915643cff4c4">{"viewer":{"width":450,"height":350,"padding":15,"fill":true},"browser":{"width":960,"height":500,"padding":40,"fill":true}}</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment