{"version":3,"sources":["components/chartutils.js","components/ResponsiveTable.js","components/chart.js","components/timeSeriesChart.js","components/barChart.js","components/donutChart.js","sections/tabset2/demographics/index.js","sections/tabset2/index.js"],"names":["utils","x","digits","Number","isInteger","toFixed","undefined","data","column","reduce","total","num","index","list","map","item","Object","keys","_sort_order","assign","target","TypeError","arguments","length","source","key","prototype","hasOwnProperty","call","sort","item1","item2","i","order","direction","pos1","indexOf","pos2","number","format","mask","isNaN","Math","round","toLocaleString","style","currency","maximumSignificantDigits","replace","measures","sortorder","result","current","rec","forEach","measure","newfirst","checkkeys","push","newcurrent","groupBy","summands","acc","cur","findIndex","d","group","every","summand","obj","names_from","values_from","fixed","groupVars","value","groupVarValues","groupVar","Set","add","var1","var2","newObj","useStyles","makeStyles","root","width","container","maxHeight","scrollbarWidth","overflowX","scrollbarColor","paddingLeft","paddingRight","webkitScrollbar","styledScrollBar","webkitScrollbarTrack","background","webkitScrollbarThumb","backgroundColor","borderRadius","border","descendingComparator","a","b","orderBy","ResponsiveTable","props","rows","columns","columnOrder","sortBy","React","useState","setOrder","setOrderBy","classes","createSortHandler","property","event","handleRequestSort","className","stickyHeader","aria-label","size","id","align","minWidth","borderBottom","fontWeight","active","onClick","label","array","comparator","stabilizedThis","el","stableSort","getComparator","row","hover","role","tabIndex","random","toString","minimumFractionDigits","decimals","Chart","this","generateChart","chart","destroy","c3","generate","bindto","node","config","otherProps","ref","PureComponent","this_chart","createRef","String","endsWith","search","this_len","substring","TimeSeriesChart","divref","chartref","state","chartid","updateFlag","date_type","datain","datecolumns","date_col","concat","datacolumns_confirmed","datacolumns_prelim","measure_cols","measure_col_labels","inAnyRegion","categories","chartutils","listValues","cat_data","curr_category","measure_col","sorted","select_data","sortIt","dayData","inRegion","regions","region","test_date","start","end","some","transformData","types","ret","columnName","colors","chartdata","prepareData","color","textAlign","tooltip","title","dateparts","toDateString","split","substr","measure_format","ratio","calcnumber","calcpercent","calcpercent_decimal","calcpercent_number","calcdollarMillions","calcdollarBillions","calcdollarNoCents","calcdollar","c3_config","assignTypes","height","axis","type","tick","toLocaleDateString","month","day","fit","culling","max","min","Date","y","padding","bottom","top","ymax","grid","show","lines","date_lines","line","text","legend","hide","point","showPoints","r","bar","zoom","enabled","extent","subchart","Box","justifyContent","updateflag","Component","BarChart","rotated","datalabels","hideYLabels","category_groups","category","category_col_label","category_col_labels","category_order","by_category_order","chartdiv","element","DOMNode","ReactDOM","findDOMNode","offsetWidth","offsetHeight","measureElement","rotated_small","height_small","datalabels_small","culling_small","hideYLabels_small","resize","setState","preparedData","group_display","groups","showlegend","position","legendposition","multiline","xmultiline","xwidth","d3","totals","datalabelformat","labels","datelables","v","j","shown","ycount","count","onrendered","center","display","alignItems","buttonselected","boxShadow","DonutChart","view","sum_data","sumByGroup","totValues","table_data","percent","donut","table","ButtonGroup","margin","variant","Button","selectChart","bind","selectTable","Demographics","epicurve_by_race_sex","setEpicurve_by_race_sex","currdate","useContext","CacheContext","useEffect","fetch","then","resp","csv","Papa","parse","header","skipEmptyLines","dynamicTyping","json","race_order","age_order","demographics_info","epicurve_by_age","demoCaseCategory","setDemoCaseCategory","demographicBarView","setDemographicBarView","epicurveAgeView","setEpicurveAgeView","Typography","component","gutterBottom","horizontalAlign","flexDirection","mx","whiteSpace","overflow","ToggleButtonGroup","onChange","exclusive","toggleContainer","ToggleButton","measure_type","hideXLabels_small","pattern","sumMeasures","hr","Grid","xs","filter","age_group_major","fillMissing","left","sm","md","lg","mediaFlow","paddingBottom","fontSize","borderColor","Select","selectBox","child","MenuItem","Container","maxWidth","pivotWider","county_name","race","Female","Male","Total","Unknown","ageMap","Map","raceMap","Tabset2","setDemographics_info","setEpicurve_by_age","get","age_group","race_other","sex","fallback"],"mappings":"2+CAEqBA,E,oGAgLNC,EAAGC,GACd,OAAID,EAAI,IACC,KAEHE,OAAOC,UAAUH,GACZA,EAAEI,aAAmBC,IAAXJ,EAAuB,EAAIA,GAAU,KACvC,OAAND,EAAqB,MACvBA,EAAEI,aAAmBC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,gBAAkBuB,EAAOM,IAAIvY,EAAKwY,cAGzCF,EAAmB5D,EAAKlV,WAElC,CAACqU,IAEL,IAAMzN,EAAUT,EAAMS,QAEtB,OACEyO,EAAkBrU,QAAYsU,EAAgBtU,OAC1C,kBAAC,WAAD,CAAUmY,SAAU,kBAAC,IAAD,OAClB,kBAAC,EAAD,CACEvS,QAASA,EACTuO,WAAYA,EACZC,UAAWA,EACXC,kBAAmBA,EACnBC,gBAAiBA,KAGvB","file":"static/js/12.5a5ef82a.chunk.js","sourcesContent":["import 'core-js/stable'\n\nexport default class utils {\n  static totValues (data, column) {\n    /**\n       * @name totValues (function)\n       * @property data - data array\n       * @property column - column name to be totalled\n       * @example totValues(data, 'column1')\n       */\n    var total = data.reduce((total, num, index) => {\n      return total + num[column]\n    }, 0)\n    return total\n  }\n\n  static listValues (data, column) {\n    /**\n     * @name listValues (function)\n     * @property data - data array\n     * @property column - column name to enumerate values\n     * @example totValues(data, 'column1')\n     */\n    const list = {}\n    data.map((item) => {\n      list[item[column]] = item[column]\n      return null\n    })\n    return Object.keys(list).map((item) => list[item])\n  }\n\n  /**\n     * @name sortIt (function)\n     * @property data - data to be sorted\n     * @property sortorder - array of sort keys in order\n     * @property sortorder.key - column to be sorted\n     * @property sortorder.direction - 'ASC'/ 'DSC'\n     * @property sortorder.order - (optional) array of values for custom order\n     * @example sortIt(data, [{key: 'column1', direction: 'ASC'},\n     *            {key: 'column2', direction: 'ASC',\n     *            order: ['item1','item2','item4','item5']})\n     */\n  static sortIt (data, _sort_order) {\n    if (typeof Object.assign !== 'function') {\n      Object.assign = function (target) {\n        // 'use strict';\n        if (target == null) {\n          throw new TypeError('Cannot convert undefined or null to object')\n        }\n\n        target = Object(target)\n        for (var index = 1; index < arguments.length; index++) {\n          var source = arguments[index]\n          if (source != null) {\n            for (var key in source) {\n              if (Object.prototype.hasOwnProperty.call(source, key)) {\n                target[key] = source[key]\n              }\n            }\n          }\n        }\n        return target\n      }\n    }\n    var dataIn = Object.assign([], data)\n    var sorteddata = dataIn.sort((item1, item2) => {\n      for (var i = 0; i < _sort_order.length; i++) {\n        if (_sort_order[i].order === undefined) { // No custom order\n          if (((item1[_sort_order[i].key] > item2[_sort_order[i].key]) && _sort_order[i].direction === 'ASC') ||\n                  ((item1[_sort_order[i].key] < item2[_sort_order[i].key]) && _sort_order[i].direction === 'DSC')\n          ) {\n            return 1\n          } else if (((item1[_sort_order[i].key] < item2[_sort_order[i].key]) && _sort_order[i].direction === 'ASC') ||\n                  ((item1[_sort_order[i].key] > item2[_sort_order[i].key]) && _sort_order[i].direction === 'DSC')\n          ) {\n            return -1\n          }\n        } else { // custom order\n          var pos1 = _sort_order[i].order.indexOf(item1[_sort_order[i].key])\n          var pos2 = _sort_order[i].order.indexOf(item2[_sort_order[i].key])\n          if ((pos1 > pos2 && _sort_order[i].direction === 'ASC') ||\n                  (pos1 < pos2 && _sort_order[i].direction === 'DSC')) {\n            return 1\n          } else if ((pos1 < pos2 && _sort_order[i].direction === 'ASC') ||\n                  (pos1 > pos2 && _sort_order[i].direction === 'DSC')) {\n            return -1\n          }\n        }\n      }\n      return 0\n    })\n    return sorteddata\n  }\n\n  static numFormat (number, format, digits, mask) {\n    if (isNaN(number)) {\n      number = Number(number)\n    }\n    switch (format) {\n      case 'dollar':\n        return digits === 0 ? '$' + Math.round(number).toLocaleString()\n          : number.toLocaleString('USD', { style: 'currency', currency: 'USD' })\n      case 'dollar-nocents':\n        if (number > 999999999) {\n          return '$ ' + ((number / 1000000000)).toFixed(1) + ' B'\n        } else if (number > 999999) {\n          return '$ ' + ((number / 1000000)).toFixed(1) + ' M'\n        } else {\n          return number.toLocaleString('USD', { style: 'currency', currency: 'USD' })\n        }\n      case 'percent-number':\n        // console.log(\"Mask is \", mask, \"Number is \", number)\n        if (isNaN(number) || number === null) {\n          return 'N/A'\n        } else if (mask === undefined) {\n          return Number(number).toFixed(digits === undefined ? 1 : digits)\n        } else {\n          if (mask === 1) {\n            return '>95'\n          } else if (mask === 2) {\n            return '<5'\n          } else if (mask === 3) {\n            return '<10'\n          } else {\n            return Number(number).toFixed(digits)\n          }\n        }\n      case 'percent':\n        // console.log(\"Mask is \", mask, \"Number is \", number)\n        if (mask === undefined) {\n          return Number(number).toFixed(digits === undefined ? 1 : digits) + '%'\n        } else {\n          if (mask === 1) {\n            return '>95%'\n          } else if (mask === 2) {\n            return '<5%'\n          } else if (mask === 3) {\n            return '<10%'\n          } else {\n            return Number(number).toFixed(digits) + '%'\n          }\n        }\n      case 'percent-decimal':\n        if (mask === undefined) {\n          return Number(number * 100).toFixed(digits === undefined ? 1 : digits) + '%'\n        } else {\n          if (mask === 1) {\n            return '>95%'\n          } else if (mask === 2) {\n            return '<5%'\n          } else if (mask === 3) {\n            return '<10%'\n          } else {\n            return Number(number).toFixed(digits) + '%'\n          }\n        }\n      case 'number':\n\n        if (isNaN(number) || number === null) {\n          return 'N/A'\n        } else if (mask === undefined) {\n          return digits === undefined || digits < 1 ? Math.round(Number(number)).toLocaleString() : Number(number).toFixed(digits).toLocaleString({ maximumSignificantDigits: digits })\n        } else {\n          if (mask === 1) {\n            return 'N/A'\n          } else if (mask === 2) {\n            return 'N/A'\n          } else if (mask === 3) {\n            return '<10'\n          } else {\n            return Number(number).toFixed(digits)\n          }\n        }\n      default:\n        break\n    }\n  }\n\n  calcpercent (x, digits) {\n    if (x > 100) {\n      return null\n    } else {\n      if (Number.isInteger(x)) {\n        return x.toFixed(digits === undefined ? 0 : digits) + ' %'\n      } else if (x === null) { return 'N/A' } else {\n        return x.toFixed(digits === undefined ? 2 : digits) + ' %'\n      }\n    }\n  }\n\n  static calcpercent_number (x, digits) {\n    if (x > 100) { return null } else {\n      if (Number.isInteger(x)) { return x.toFixed(digits === undefined ? 0 : digits) } else if (x === null) { return 'N/A' } else { return x.toFixed(digits === undefined ? 2 : digits) }\n    }\n  }\n\n  static calcpercent_decimal (x, digits) {\n    if (x > 1) { return null } else {\n      // var value = 100*Number(x);\n      if (Number.isInteger(x)) {\n        // console.log(\"Calcpercent_decimal\",x,\"Formatted\",(x*100).toFixed(digits === undefined ? 0 : digits) + \" %\" );\n        return (x * 100).toFixed(0) + ' %'\n      } else if (x === null) { return 'N/A' } else {\n        // console.log(\"Calcpercent_decimal-2\",x,value,Math.round(value),\"Formatted\",(x*100).toFixed(digits === undefined ? 1 : digits) + \" %\" );\n        return (x * 100).toFixed(digits === undefined ? 1 : digits) + ' %'\n      }\n    }\n  }\n\n  static calcnumber (x, digits) {\n    digits = digits === undefined ? 2 : digits\n    if (Number.isInteger(x)) { return x.toLocaleString() } else { return (Number(Math.round(x + 'e' + digits) + 'e-' + digits)).toLocaleString() }\n  }\n\n  static calcdollar (x, digits) {\n    return '$' + Number(x).toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, '$1,')\n  }\n\n  static calcdollarNoCents (x, digits) {\n    if (x > 999999999) {\n      return '$ ' + ((x / 1000000000)).toFixed(1) + ' B'\n    } else if (x > 999999) {\n      return '$ ' + ((x / 1000000)).toFixed(1) + ' M'\n    } else {\n      return 0 // numFormat(x,\"dollar\",0);\n    }\n  }\n\n  static calcdollarMillions (x, digits) {\n    return '$ ' + ((x / 1000000)).toFixed(1) + ' M'\n  }\n\n  static calcdollarBillions (x, digits) {\n    return '$ ' + ((x / 1000000000)).toFixed(1) + ' B'\n  }\n\n  static sumMeasures (data, keys, measures, sortorder) {\n    // data -JSON Array to be summarized\n    // key - key for values to summarize\n    // amount - value to be used to create subtotals\n    // limitentries - Maximum number of entries\n    // console.log(\"Data in SumMeasures\", data, keys,measures)\n    const result = []\n    const checkkeys = (item1, item2, keys) => {\n      let result = true\n      keys.forEach((key) => { if (item1[key] !== item2[key]) { result = false } })\n      // console.log(\"Compare \", result, item1, item2)\n      return result\n    }\n    const newfirst = (item) => {\n      const rec = {}\n      measures.forEach((measure) => rec[measure] = 0)\n      keys.forEach((key) => rec[key] = item[key])\n      return rec\n    }\n    const newcurrent = (item) => {\n      const rec = {}\n      measures.forEach((measure) => rec[measure] = item[measure])\n      keys.forEach((key) => rec[key] = item[key])\n      return rec\n    }\n    let current = newfirst(data[0])\n    data.map(function (item, index) {\n      if (!checkkeys(item, current, keys)) {\n        result.push(current)\n        current = newcurrent(item)\n      } else {\n        for (let i = 0; i < measures.length; i++) {\n          current[measures[i]] = current[measures[i]] + data[index][measures[i]]\n        }\n      }\n      return null\n    })\n    result.push(current)\n    // console.log(\"Result\", result)\n    return result\n  }\n\n  /** Sums an array of objects by a grouping variable.\n     *  Returns an array of objects, one for each level of the grouby variable.\n     *@param {array} data\n     *@param {string[]} groupBy Variables to group by\n     *@param {string[]} summands Variables to sum up\n     */\n  static sumByGroup (data, groupBy, summands) {\n    const ret = data.reduce((acc, cur) => {\n      const i = acc.findIndex((d) => {\n        return groupBy.map((group) => d[group] === cur[group]).every(item => item === true)\n      })\n      if (i > -1) {\n        for (const summand of summands) {\n          acc[i][summand] = acc[i][summand] + cur[summand]\n        }\n      } else {\n        const obj = {}\n        for (const group of groupBy) {\n          obj[group] = cur[group]\n        }\n        for (const summand of summands) {\n          obj[summand] = cur[summand]\n        }\n        acc.push(obj)\n      }\n      return acc\n    }, []\n    )\n    return ret\n  }\n\n  /** \"Widens\" data, increasing the number of columns and decreasing the number of rows.\n     *  Returns a (shorter) array of objects, one for each level of the \"fixed\" variable\n     * @param {array} data\n     * @param {string} names_from which column to get the name of the output columns from\n     * @param {string} values_from  which column to get the cell values from\n     * @param {string} fixed columns that do not get pivotted\n     */\n  static pivotWider (data, names_from, values_from, fixed) {\n    const ret = data.reduce((acc, cur) => {\n      const i = acc.findIndex((d) => {\n        return (d[fixed] === cur[fixed])\n      })\n      if (i > -1) {\n        acc[i][cur[names_from]] = cur[values_from]\n      } else {\n        const obj = {}\n        obj[fixed] = cur[fixed]\n        obj[cur[names_from]] = cur[values_from]\n        acc.push(obj)\n      }\n      return acc\n    }, []\n    )\n    return ret\n  }\n\n  /** Find missing combinations of groupVars and add in zeroes.\n     *  Only works for combinations of 2 variables.\n     * @param {array} data\n     * @param {string[]} groupVars The variables whose combinations we need values for\n     * @param {string} value  The name of the value column that needs to be filled in\n     */\n  static fillMissing (data, groupVars, value) {\n    // Get all unique values of each groupVar\n    const groupVarValues = {}\n    for (const groupVar of groupVars) {\n      groupVarValues[groupVar] = new Set()\n      data.forEach((value) => {\n        groupVarValues[groupVar].add(value[groupVar])\n      })\n    }\n\n    // For each combination of groupvars, see if an entry exists in the data\n    // If not, add an entry with that combination of groupvars and a value of 0\n    for (const var1 of groupVarValues[groupVars[0]]) {\n      for (const var2 of groupVarValues[groupVars[1]]) {\n        const i = data.findIndex((d) => {\n          return (d[groupVars[0]] === var1 && d[groupVars[1]] === var2)\n        })\n        if (i < 0) {\n          const newObj = {}\n          newObj[groupVars[0]] = var1\n          newObj[groupVars[1]] = var2\n          newObj[value] = 0\n          data.push(newObj)\n        }\n      }\n    }\n    // console.log('fillMissing', data)\n    return data\n  }\n\n}\n","import React from 'react'\nimport { makeStyles } from '@material-ui/core/styles'\nimport Paper from '@material-ui/core/Paper'\nimport Table from '@material-ui/core/Table'\nimport TableBody from '@material-ui/core/TableBody'\nimport TableCell from '@material-ui/core/TableCell'\nimport TableContainer from '@material-ui/core/TableContainer'\nimport TableHead from '@material-ui/core/TableHead'\n// import TablePagination from '@material-ui/core/TablePagination';\nimport TableRow from '@material-ui/core/TableRow'\nimport TableSortLabel from '@material-ui/core/TableSortLabel'\n\nconst useStyles = makeStyles({\n  root: {\n    width: '100%'\n  },\n  container: {\n    maxHeight: 440,\n    // maxWidth: 500,\n    scrollbarWidth: 'thin',\n    overflowX: 'scroll',\n    scrollbarColor: '#002137 #314c68',\n    paddingLeft: '15px',\n    paddingRight: '15px',\n    webkitScrollbar: {\n      width: '11px'\n    }\n  // backgroundColor: \"#002137\"\n  },\n  styledScrollBar: {\n    webkitScrollbar: {\n      width: '11px'\n    },\n    webkitScrollbarTrack: {\n      background: '#314c68'\n    },\n    webkitScrollbarThumb: {\n      backgroundColor: '#002137',\n      borderRadius: '6px',\n      border: '2px solid #314c68'\n    }\n  }\n})\n\nfunction descendingComparator (a, b, orderBy) {\n  if (b[orderBy] < a[orderBy]) {\n    return -1\n  }\n  if (b[orderBy] > a[orderBy]) {\n    return 1\n  }\n  return 0\n}\n\nfunction getComparator (order, orderBy) {\n  return order === 'desc'\n    ? (a, b) => descendingComparator(a, b, orderBy)\n    : (a, b) => -descendingComparator(a, b, orderBy)\n}\n\nfunction stableSort (array, comparator) {\n  const stabilizedThis = array.map((el, index) => [el, index])\n  stabilizedThis.sort((a, b) => {\n    const order = comparator(a[0], b[0])\n    if (order !== 0) return order\n    return a[1] - b[1]\n  })\n\n  return stabilizedThis.map((el) => el[0])\n}\n\nexport default function ResponsiveTable (props) {\n  const { rows, columns, columnOrder, sortBy } = props\n  const [order, setOrder] = React.useState(columnOrder)\n  const [orderBy, setOrderBy] = React.useState(sortBy)\n  const classes = useStyles()\n  // const [page] = React.useState(0)\n  // const [rowsPerPage] = React.useState(19999)\n\n  const handleRequestSort = (event, property) => {\n    const isAsc = orderBy === property && order === 'asc'\n    setOrder(isAsc ? 'desc' : 'asc')\n    setOrderBy(property)\n  }\n\n  const createSortHandler = (property) => (event) => {\n    handleRequestSort(event, property)\n  }\n  // const createSortHandler = (property) => (event) => {\n  //   onRequestSort(event, property);\n  // };\n  // const handleChangePage = (event, newPage) => {\n  //   setPage(newPage);\n  // };\n\n  // const handleChangeRowsPerPage = (event) => {\n  //   setRowsPerPage(+event.target.value);\n  //   setPage(0);\n  // };\n\n  return (\n    <Paper className={classes.root}>\n      <TableContainer className={classes.container}>\n        <Table stickyHeader aria-label='sticky table' size='small'>\n          <TableHead>\n            <TableRow>\n              {columns.map((column) => (\n                <TableCell\n                  key={column.id}\n                  align={column.align}\n                  style={{ minWidth: column.minWidth, border: 'none', borderBottom: '1px grey solid', fontWeight: 600 }}\n                >\n                  <TableSortLabel\n                    active={orderBy === column.id}\n                    direction={orderBy === column.id ? order : 'asc'}\n                    onClick={createSortHandler(column.id)}\n                  >\n                    {column.label}\n                  </TableSortLabel>\n                </TableCell>\n              ))}\n            </TableRow>\n          </TableHead>\n          <TableBody>\n            {stableSort(rows, getComparator(order, orderBy))\n              // .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)\n              .map((row) => {\n                return (\n                  <TableRow hover role='checkbox' tabIndex={-1} key={'row' + Math.random().toString()}>\n                    {columns.map((column) => {\n                      const value = row[column.id]\n                      return (\n                        <TableCell key={column.id} align={column.align} style={{ border: 'none' }}>\n                          {typeof value === 'number' ? \n                            value.toLocaleString(undefined, {minimumFractionDigits: column.decimals}) : \n                            value\n                          }\n                        </TableCell>\n                      )\n                    })}\n                  </TableRow>\n                )\n              })}\n          </TableBody>\n        </Table>\n      </TableContainer>\n      {/* <TablePagination\n        rowsPerPageOptions={[999, 25, 100]}\n        component=\"div\"\n        count={rows.length}\n        rowsPerPage={rowsPerPage}\n        page={page}\n        onChangePage={handleChangePage}\n        onChangeRowsPerPage={handleChangeRowsPerPage}\n      /> */}\n    </Paper>\n  )\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport c3 from 'c3';\n// import * as d3 from 'd3';\nexport default class Chart extends React.PureComponent {\n  static propTypes = {\n    config: PropTypes.object,\n  };\n  static this_chart = React.createRef;\n\n  componentDidMount() {\n    this.generateChart();\n  }\n\n  componentDidUpdate() {\n    this.generateChart();\n  }\n\n  componentWillUnmount() {\n    this.chart = this.chart.destroy();\n  }\n\n\n  generateChart() {\n    this.chart = c3.generate({\n      bindto: this.node,\n      ...this.props.config,\n    }); \n    \n    // let columns = this.props.config.data.columns.map((column) => column[0]);\n    // let colors = this.props.config.color.pattern;\n    // columns.splice(0,1) \n    // let thischart = this.chart\n    // console.log(\"Generate chart\", this.props,columns, this.chart) \n    // d3.select(this.node).insert('div', '.chart').attr('class', 'legend').selectAll('span')\n    //     .data(columns) \n    // .enter().append('span')\n    //     .attr('data-id', function (id) { return id; })\n    //     .html(function (id) { return id; })\n    //     .each(function (id,idx) {\n    //         d3.select(this).style('background-color',  colors[idx]);\n    //     })\n    //     .on('mouseover', function (id) {\n    //         thischart.focus(id);\n    //     })\n    //     .on('mouseout', function (id) {\n    //         thischart.revert();\n    //     })\n    //     .on('click', function (id) {\n    //         thischart.toggle(id);\n    //     });\n  }\n\n  render() {\n    // return <div ref={node => (this.node = node)} {...otherProps} />;\n    const { config, ...otherProps } = this.props;\n    return <div ref={node => (this.node = node)} {...otherProps} />;\n  }\n}","import React from \"react\";\n// import ReactDOM from \"react-dom\";\n// import * as d3 from 'd3';\nimport Chart from \"./chart.js\";\n\n// import { makeStyles } from '@material-ui/core/styles';\nimport \"c3/c3.css\";\nimport \"../css/c3.css\";\nimport chartutils from \"./chartutils.js\";\nimport { Box } from \"@material-ui/core\";\n\nif (!String.prototype.endsWith) {\n  // eslint-disable-next-line\n  String.prototype.endsWith = function (search, this_len) {\n    if (this_len === undefined || this_len > this.length) {\n      this_len = this.length;\n    }\n    return this.substring(this_len - search.length, this_len) === search;\n  };\n}\nexport default class TimeSeriesChart extends React.Component {\n  // classes = useStyles();\n  constructor(props) {\n    super(props);\n\n    this.divref = React.createRef();\n    this.chartref = React.createRef();\n    this.state = {\n      chartid: \"c3_chart\" + Math.random().toString,\n      updateFlag: true,\n      date_type: \"onset\",\n    };\n  }\n\n  transformData(datain) {\n    const datecolumns = [this.props.date_col].concat(\n      datain.map((data) => data[this.props.date_col])\n    );\n    let datacolumns_confirmed = [];\n    let datacolumns_prelim = [];\n    if (this.props.measure_cols !== undefined) {\n      datacolumns_confirmed = this.props.measure_cols.map((measure, index) => {\n        const measure_col_label =\n          this.props.measure_col_labels === undefined\n            ? measure\n            : this.props.measure_col_labels[index];\n        return [measure_col_label].concat(\n          datain.map((data) => {\n            return data.inAnyRegion ? null : data[measure];\n          })\n        );\n      });\n      datacolumns_prelim = this.props.measure_cols.map((measure, index) => {\n        const measure_col_label =\n          this.props.measure_col_labels === undefined\n            ? measure + \" (Preliminary)\"\n            : this.props.measure_col_labels[index] + \" (Preliminary)\";\n        return [measure_col_label].concat(\n          datain.map((data) => {\n            return data.inAnyRegion ? data[measure] : null;\n          })\n        );\n      });\n    } else {\n      const categories = chartutils.listValues(\n        datain,\n        this.props.categories[0]\n      );\n      let cat_data = [];\n      let curr_category = 0;\n      datain.forEach((data, index) => {\n        if (data[this.props.categories[0]] !== categories[curr_category]) {\n          datacolumns_confirmed.push(\n            [categories[curr_category]].concat(cat_data)\n          );\n          cat_data = [data.inAnyRegion ? null : data[this.props.measure_col]];\n          cat_data = [];\n          curr_category = curr_category + 1;\n          cat_data.push(data.inAnyRegion ? null : data[this.props.measure_col]);\n        } else {\n          cat_data.push(data.inAnyRegion ? null : data[this.props.measure_col]);\n        }\n      });\n      datacolumns_confirmed.push([categories[curr_category]].concat(cat_data));\n      cat_data = [];\n      curr_category = 0;\n      datain.forEach((data, index) => {\n        if (data[this.props.categories[0]] !== categories[curr_category]) {\n          datacolumns_prelim.push(\n            [categories[curr_category] + \" (Preliminary)\"].concat(cat_data)\n          );\n          cat_data = [data.inAnyRegion ? data[this.props.measure_col] : null];\n          cat_data = [];\n          curr_category = curr_category + 1;\n        } else {\n          cat_data.push(data.inAnyRegion ? data[this.props.measure_col] : null);\n        }\n      });\n      datacolumns_prelim.push(\n        [categories[curr_category] + \" (Preliminary)\"].concat(cat_data)\n      );\n    }\n    return [datecolumns]\n      .concat(datacolumns_confirmed)\n      .concat(datacolumns_prelim);\n    // return datacolumns\n  }\n\n  prepareData() {\n    const select_data = this.props.data;\n    if (select_data.length < 2) {\n      return null;\n    }\n    // console.log(\"Select data\",this.state.current_select, this.props.filter_select,select_data)\n    let sorted;\n    if (this.props.sort === false) {\n      sorted = select_data;\n    } else {\n      sorted = chartutils.sortIt(select_data, [\n        { key: this.props.date_col, direction: \"ASC\" },\n      ]);\n    }\n    sorted = sorted.map((dayData) => {\n      const inRegion =\n        this.props.regions === undefined\n          ? undefined\n          : this.props.regions.map(\n              (region) =>\n                dayData.test_date > region.start &&\n                dayData.test_date <= region.end\n            );\n      if (this.props.regions !== undefined) {\n        dayData.inAnyRegion = inRegion.some((region) => region === true);\n      }\n      return dayData;\n    });\n    const data = this.transformData(sorted);\n    const regions = {};\n    if (this.props.regions !== undefined) {\n      data.map((item, index) => {\n        if (index === 0) return null;\n        regions[item[0]] = this.props.regions.map((region) => {\n          return { start: region.start, end: region.end };\n        });\n        return null;\n      });\n    }\n    return {\n      x: this.props.date_col,\n      columns: data,\n      regions: this.props.regions === undefined ? undefined : regions,\n      types: this.props.types,\n    };\n  }\n\n  assignTypes(types, columns) {\n    const ret = {};\n    columns.forEach((column) => {\n      let columnName = column[0];\n      if (columnName.endsWith(\"(Preliminary)\")) {\n        ret[columnName] = \"scatter\";\n      } else {\n        ret[columnName] = types === undefined ? undefined : types[columnName];\n      }\n    });\n    return ret;\n  }\n\n  render() {\n    // console.log(this.props);\n    const { colors } = this.props;\n    const chartdata = this.prepareData();\n    if (chartdata === null) {\n      return (\n        <h3 style={{ color: \"white\", textAlign: \"center\" }}>\n          Not enough data to draw a chart\n        </h3>\n      );\n    }\n    var tooltip = {\n      order: null,\n      format: {\n        title: (x, index) => {\n          const dateparts = x.toDateString().split(\" \");\n          return dateparts[2] + dateparts[1] + dateparts[3].substr(2, 3);\n        },\n      },\n    };\n    if (this.state.measure_format === \"number\") {\n      tooltip.format.value = (value, ratio, id, index) =>\n        chartutils.calcnumber(value, this.props.digits);\n    } else if (this.state.measure_format === \"percent\") {\n      tooltip.format.value = (value, ratio, id, index) =>\n        chartutils.calcpercent(value, this.props.digits);\n    } else if (this.state.measure_format === \"percent-decimal\") {\n      tooltip.format.value = (value, ratio, id, index) =>\n        chartutils.calcpercent_decimal(value);\n    } else if (this.state.measure_format === \"percent-number\") {\n      tooltip.format.value = (value, ratio, id, index) =>\n        chartutils.calcpercent_number(value);\n    } else if (this.state.measure_format === \"dollar-millions\") {\n      tooltip.format.value = (value, ratio, id, index) =>\n        chartutils.calcdollarMillions(value);\n    } else if (this.state.measure_format === \"dollar-billions\") {\n      tooltip.format.value = (value, ratio, id, index) =>\n        chartutils.calcdollarBillions(value);\n    } else if (this.state.measure_format === \"dollar-nocents\") {\n      tooltip.format.value = (value, ratio, id, index) =>\n        chartutils.calcdollarNoCents(value);\n    } else if (\n      this.state.measure_format === \"dollar\" &&\n      this.state.digits === 0\n    ) {\n      tooltip.format.value = (value, ratio, id, index) =>\n        chartutils.calcdollarNoCents(value);\n    } else if (this.state.measure_format === \"dollar\") {\n      tooltip.format.value = (value, ratio, id, index) =>\n        chartutils.calcdollar(value);\n    } else {\n      tooltip.format.value = (value, ratio, id, index) =>\n        chartutils.calcnumber(value, this.props.digits);\n    }\n\n    const c3_config = {\n      data: {\n        x: chartdata.x,\n        columns: chartdata.columns,\n        types: this.assignTypes(this.props.types, chartdata.columns),\n      },\n      size: {\n        height: this.props.height === undefined ? undefined : this.props.height,\n        width: this.props.width === undefined ? undefined : this.props.width,\n      },\n      axis: {\n        x: {\n          type: \"timeseries\",\n          tick: {\n            format: (x) => {\n              const dateparts = x.toLocaleDateString(\"en-US\", {\n                month: \"short\",\n                day: \"numeric\",\n              });\n              return dateparts;\n            },\n            // count: 7,\n            fit: false,\n            culling: {\n              max: 5,\n            },\n          },\n          min: new Date(2020, 2, 1),\n        },\n        y: {\n          tick: {\n            format: (x) => {\n              if (Number.isInteger(x) === true) {\n                return x;\n              } else {\n                return null;\n              }\n            },\n          },\n          padding: {\n            bottom: 0,\n            top: this.props.ymax === undefined ? undefined : this.props.ymax / 10,\n          },\n          max: this.props.ymax,\n        },\n      },\n      grid: {\n        x: {\n          show: true,\n          lines:\n            this.props.date_lines === undefined\n              ? undefined\n              : this.props.date_lines.map((line) => {\n                  return {\n                    value: line.value,\n                    text: line.label,\n                  };\n                }),\n        },\n        y: {\n          show: true,\n        },\n      },\n      // this.props.date_lines === undefined\n      //   ? undefined\n      //   : {\n      //       x: {\n      //         lines: this.props.date_lines.map((line) => {\n      //           return {\n      //             value: line.value,\n      //             text: line.label,\n      //             // position: \"start\",\n      //           };\n      //         }),\n      //       },\n      //     },\n      regions:\n        this.props.regions === undefined ? undefined : this.props.regions,\n      color: colors,\n      legend: {\n        hide: chartdata.columns.reduce((result, column) => {\n          if (column[0].endsWith(\"(Preliminary)\")) {\n            // console.log(\"Hide \", \"|\" + column[0] + \"|\");\n            result.push(column[0]);\n          }\n          return result;\n        }, []),\n      },\n      tooltip: tooltip,\n      point: {\n        show: this.props.showPoints,\n        r: 3,\n      },\n      bar: {\n        width: 3,\n      },\n      zoom: {\n        enabled: true,\n        extent: [1, 100],\n      },\n      subchart: {\n        show: this.props.subchart,\n        size: {\n          height: 100,\n        },\n        axis: {\n          x: {\n            show: false,\n          },\n        },\n      },\n\n      //   types: this.props.types\n    };\n    //   c3_config.legend.item = {     onclick: function (id) { console.log(\"Clicked on legend\", id)}   }\n    //   console.log(\"C3 Config \",c3_config)\n    //   console.log(\"Props \",this.props.filter_select.default_select !== this.state.current_select,this.props.filter_select,this.state )\n    return (\n      <Box ref={this.divref} justifyContent=\"center\">\n        <Chart\n          ref={this.chartref}\n          updateflag={this.state.updateFlag.toString()}\n          config={c3_config}\n        />\n      </Box>\n    );\n  }\n}\n","import React from 'react'\nimport ReactDOM from 'react-dom'\nimport * as d3 from 'd3'\nimport Chart from 'react-c3-component'\nimport 'c3/c3.css'\nimport '../css/c3.css'\nimport chartutils from './chartutils.js'\nimport Box from '@material-ui/core/Box'\nconst measureElement = element => {\n  const DOMNode = ReactDOM.findDOMNode(element)\n  return {\n    width: DOMNode.offsetWidth,\n    height: DOMNode.offsetHeight\n  }\n}\n\n/*\n\n*/\nexport default class BarChart extends React.Component {\n  constructor (props) {\n    super(props)\n\n    this.divref = React.createRef()\n    this.chartref = React.createRef()\n    this.state = {\n      chartid: 'c3_chart' + (Math.random().toString),\n      updateFlag: true,\n      rotated: props.rotated === undefined ? undefined : props.rotated,\n      height: props.height === undefined ? undefined : props.height,\n      datalabels: props.datalabels === undefined ? undefined : props.datalabels,\n      culling: props.culling === undefined ? undefined : props.culling,\n      hideYLabels: props.hideYLabels === undefined ? undefined : props.hideYLabels,\n      measure_format: props.measure_format === undefined ? 'number' : props.measure_format\n    }\n  }\n\n  transformData (datain) {\n    // Categories are enumerated value of the second category\n    let columns = []\n    let category_groups = []\n    let categories = []\n    if (this.props.measure_cols !== undefined) { // If multiple measures\n      categories = chartutils.listValues(datain, this.props.categories[0])\n      columns = this.props.measure_cols.map((measure, index) => {\n        const measure_col_label = this.props.measure_col_labels === undefined ? measure : this.props.measure_col_labels[index]\n        return [measure_col_label].concat(datain.map((data) => data[measure]))\n      })\n    } else { // Multiple measure in second category\n      category_groups = chartutils.listValues(this.props.data, this.props.categories[0])\n      categories = chartutils.listValues(this.props.data, this.props.categories[1])\n      columns = category_groups.map((category, index) => {\n        const category_col_label = this.props.category_col_labels === undefined ? category : this.props.category_col_labels[index]\n        const cat_data = []\n        datain.map((data) => {\n          if (data[this.props.categories[0]] === category) {\n            cat_data.push(data[this.props.measure_col])\n          }\n          return null\n        })\n        return [category_col_label].concat(cat_data)\n      })\n    }\n\n    return { columns: columns, category_groups: category_groups, categories: categories }\n    // return datacolumns\n  }\n\n  prepareData () {\n    let data\n    if (this.props.sort === true || this.props.sort === undefined) {\n      const sorted = chartutils.sortIt(this.props.data,\n        this.props.measure_cols === undefined ? [\n          { key: this.props.categories[0], direction: 'ASC', order: this.state.category_order === undefined ? undefined : this.state.category_order },\n          { key: this.props.categories[1], direction: 'ASC', order: this.props.by_category_order === undefined ? undefined : this.props.by_category_order }]\n          : [{ key: this.props.categories[0], direction: 'ASC', order: this.props.category_order === undefined ? undefined : this.props.category_order }])\n      data = this.transformData(sorted)\n    } else {\n      data = this.transformData(this.props.data)\n    }\n    return data\n  }\n\n  componentDidMount () {\n    const chartdiv = measureElement(this.divref.current)\n    // console.log(\"Resizing\")\n    var height = this.state.height\n    var rotated = this.state.rotated\n    var datalabels = this.state.datalabels\n    var culling = this.state.culling\n    var hideYLabels = this.state.hideYLabels\n    if (this.props.rotated_small === true) {\n      if (chartdiv.width < 500) {\n        rotated = true\n        if (this.props.height_small !== undefined) {\n          height = this.props.height_small\n        }\n        if (this.props.datalabels_small !== undefined) {\n          datalabels = this.props.datalabels_small\n        }\n        if (this.props.culling_small !== undefined) {\n          culling = this.props.culling_small\n        }\n        if (this.props.hideYLabels_small !== undefined) {\n          hideYLabels = this.props.hideYLabels_small\n        }\n      } else {\n        rotated = false\n        if (this.props.height_small !== undefined) {\n          height = undefined\n        }\n        if (this.props.datalabels_small !== undefined) {\n          datalabels = this.props.datalabels\n        }\n        if (this.props.culling_small !== undefined) {\n          culling = this.props.culling\n        }\n        if (this.props.hideYLabels_small !== undefined) {\n          hideYLabels = this.props.hideYLabels\n        }\n      }\n    }\n    this.chartref.current.chart.resize({ height: chartdiv.height, width: chartdiv.width - 20 })\n    this.setState({ hideYLabels: hideYLabels, culling: culling, datalabels: datalabels, height: height, rotated: rotated, updateflag: this.state.updateFlag !== true })\n\n    // })\n  }\n\n  checkParameters () {\n\n  }\n\n  render () {\n    const { colors } = this.props\n    const preparedData = this.prepareData()\n    const chartdata = {\n      columns: preparedData.columns,\n      type: 'bar',\n      order: null\n    }\n    if (this.props.group_display === true) {\n      chartdata.groups = [preparedData.category_groups]\n    }\n    // console.log(\"Chartdata is\", chartdata,this.props.data)\n    const legend = {\n      show: this.props.showlegend !== false,\n      position: 'bottom'\n    }\n    if (this.props.legendposition !== undefined) {\n      legend.position = this.props.legendposition\n    }\n\n    const axis = {\n      rotated: this.state.rotated === undefined ? undefined : this.state.rotated,\n      x: {\n        categories: preparedData.categories,\n        tick: {\n          multiline: (this.props.xmultiline === undefined ? true : this.props.xmultiline),\n          culling: this.state.culling === undefined ? undefined : { max: this.state.culling }\n        },\n        type: 'category'\n      },\n      y: {\n        tick: {\n          multiline: true\n        },\n        padding: {\n          // top: 2\n        }\n      }\n    }\n\n    if (this.props.xwidth !== undefined) {\n      axis.x.tick.width = this.props.xwidth\n    }\n\n    if (this.state.measure_format === 'number') {\n      axis.y.tick.format = chartutils.calcnumber\n    } else if (this.state.measure_format === 'percent') {\n      axis.y.tick.format = chartutils.calcpercent\n    } else if (this.state.measure_format === 'percent-decimal') {\n      axis.y.tick.format = chartutils.calcpercent_decimal\n    } else if (this.state.measure_format === 'percent-number') {\n      axis.y.tick.format = chartutils.calcpercent_number\n    } else if (this.state.measure_format === 'dollar-millions') {\n      axis.y.tick.format = chartutils.calcdollarMillions\n    } else if (this.state.measure_format === 'dollar-billions') {\n      axis.y.tick.format = chartutils.calcdollarBillions\n    } else if (this.state.measure_format === 'dollar-nocents') {\n      axis.y.tick.format = chartutils.calcdollarNoCents\n    } else if (this.state.measure_format === 'dollar' && this.state.digits === 0) {\n      axis.y.tick.format = chartutils.calcdollarNoCents\n    } else if (this.state.measure_format === 'dollar') {\n      axis.y.tick.format = chartutils.calcdollar\n    } else if (this.state.measure_format === 'numberTrunc') {\n      axis.y.tick.format = d3.format('~s')\n    } else {\n      axis.y.tick.format = chartutils.calcpercent_decimal\n    }\n\n    // Data Labels have been modified to display totals\n    // function showLastLabel()\n    // {\n    //     var shown = chartdata.shown().map(function(item){ return item.id }) // get visible ids: ['data1', 'data2', ...]\n    //     var last = (shown[shown.length - 1])\n    //     d3.select('.c3-chart-texts').selectAll('.c3-target').style('display', 'none') // hide all\n    //     d3.select('.c3-chart-texts').selectAll('.c3-target-' + last).style('display', 'block') // show last\n    // }\n\n    var totals = []\n    // console.log(chartdata.columns)\n\n    if (this.props.datalabelformat !== undefined) {\n      chartdata.labels = { format: this.props.datalabelformat }\n    }\n    if (this.state.datelables === false) {\n      return\n    } else if (this.state.datalabels === true) {\n      // chartdata.labels = {format: axis.y.tick.format};\n      chartdata.labels = {\n        format: function (v, id, i, j) {\n          if (isNaN(totals[i])) totals[i] = 0\n          // sum only visible\n          if (chartdata.data) {\n            var shown = chartdata.data.shown().map(function (item) { return item.id })\n            if (shown.indexOf(id) !== -1) totals[i] += v\n          } else {\n            totals[i] += v\n          }\n          return totals[i].toLocaleString()\n        }\n      }\n    }\n\n    if (this.state.hideYLabels === true) {\n      axis.x.show = false\n    }\n    if (this.props.hideYLabels === true) {\n      axis.y.show = false\n    }\n    if (this.props.ymax !== undefined) {\n      axis.y.max = this.props.ymax\n    }\n    if (this.props.ycount !== undefined) {\n      axis.y.tick.count = this.props.ycount\n    }\n\n    if (this.props.width !== undefined) {\n      axis.x.width = this.props.xwidth\n      // console.log(\"Okay set x height\", axis)\n    }\n\n    if (this.props.xwidth !== undefined) {\n      axis.x.tick.width = this.props.xwidth\n    }\n    const c3_config = {\n      // Prevent totals from adding to data labels on each re-render\n      onrendered: function () {\n        totals = []\n      },\n      data: chartdata,\n      type: 'bar',\n      bar: {\n        width: {\n          ratio: 0.5 // this makes bar width 50% of length between ticks\n        }\n      },\n      axis: axis,\n      legend: legend,\n      color: colors,\n      size: this.state.height === undefined ? undefined : { height: this.state.height },\n      padding: this.props.padding,\n      grid: {\n        y: {\n          show: true\n        }\n      },\n      tooltip: {\n        // format: {\n        //     title: (x, index) => {\n        //         let dateparts = x.toDateString().split(\" \")\n        //         return dateparts[2]+dateparts[1]+dateparts[3].substr(2,3);\n        //     }\n        // }\n        // contents: function (d, defaultTitleFormat, defaultValueFormat, color) {\n        //       return \"<font color='red'>\" + d[0].value\n        //     }\n      }\n\n      //   types: this.props.types\n    }\n    // console.log(\"C3 Config \",c3_config,\"data\",this.props.data)\n    // return <h1 style={{color: \"white\"}}> No Bar Chart Yet -TBD</h1>\n\n    return <Box id={'barchart' + Math.random().toString()} ref={this.divref}>\n      <Chart\n        ref={this.chartref}\n        updateflag={this.state.updateFlag.toString()}\n        config={c3_config}\n      />\n    </Box>\n  }\n}\n","import React from 'react'\nimport ReactDOM from 'react-dom'\nimport Chart from 'react-c3-component'\nimport 'c3/c3.css'\nimport '../css/c3.css'\nimport ResponsiveTable from './ResponsiveTable'\n// import { makeStyles } from '@material-ui/core/styles';\nimport chartutils from './chartutils.js'\nimport Box from '@material-ui/core/Box'\n\nimport ButtonGroup from '@material-ui/core/ButtonGroup'\nimport Button from '@material-ui/core/Button'\nconst measureElement = element => {\n  const DOMNode = ReactDOM.findDOMNode(element)\n  return {\n    width: DOMNode.offsetWidth,\n    height: DOMNode.offsetHeight\n  }\n}\n// const useStyles = makeStyles((theme) => ({\n//     toggleContainer: {\n//       margin: theme.spacing(2, 0),\n//       color: \"white\",\n//       textTransform: \"none\"\n//     },\n//     selectBox: {\n//         WebkitAppearance: \"menulist\",\n//         MozAppearance: \"menulist\"\n//     }\n//   }));\n\nconst center = {\n  display: 'flex',\n  justifyContent: 'center',\n  alignItems: 'center'\n}\nconst buttonselected = {\n  backgroundColor: 'rgb(11, 33, 57)',\n  boxShadow: '0px 2px 4px -1px rgba(0,0,0,0.2), 0px 4px 5px 0px rgba(0,0,0,0.14), 0px 1px 10px 0px rgba(0,0,0,0.12)',\n  fontWeight: 'bold'\n}\n\n//   const classes = useStyles();\n/*\n\n*/\nexport default class DonutChart extends React.Component {\n  constructor (props) {\n    super(props)\n\n    this.divref = React.createRef()\n    this.chartref = React.createRef()\n    this.state = {\n      chartid: 'c3_chart' + (Math.random().toString),\n      view: 'chart',\n      measure_format: props.measure_format === undefined ? 'number' : props.measure_format\n    }\n  }\n\n  transformData (datain) {\n    // Categories are enumerated value of the second category\n    const sum_data = chartutils.sumByGroup(datain, [this.props.category], [this.props.measure_col])\n    // console.log('Sum data ', sum_data)\n    const total = chartutils.totValues(sum_data, this.props.measure_col)\n    const table_data = sum_data.map((item) => {\n      item.percent = (item[this.props.measure_col] / total * 100).toFixed(1) + '%'\n      return item\n    })\n    // console.log('Table data', table_data)\n    const categories = sum_data.map((item) => item[this.props.category])\n    const columns = sum_data.map((item) => [item[this.props.category], item[this.props.measure_col]])\n    return { columns: columns, categories: categories, table_data: table_data }\n    // return datacolumns\n  }\n\n  prepareData () {\n    const data = this.transformData(this.props.data)\n    return data\n  }\n\n  selectChart () {\n    this.setState({\n      view: 'chart'\n    })\n  }\n\n  selectTable () {\n    this.setState({\n      view: 'table'\n    })\n  }\n\n  componentDidMount () {\n    // console.log(\"Component mounted\",this.chartref.current)\n    // window.addEventListener('resize', (event) => {\n\n    const chartdiv = measureElement(this.divref.current)\n    // console.log(\"Resizing\")\n    this.chartref.current.chart.resize({ height: chartdiv.height, width: chartdiv.width - 20 })\n    this.setState({ updateflag: this.state.updateFlag !== true })\n\n    // })\n  }\n\n  checkParameters () {\n\n  }\n\n  render () {\n    const { colors } = this.props\n    const preparedData = this.prepareData()\n    const chartdata = {\n      columns: preparedData.columns,\n      type: 'donut'\n    }\n    // console.log(\"Chartdata is\", chartdata,this.props.data)\n    const legend = {\n      show: this.props.showlegend !== false,\n      position: 'bottom'\n    }\n    if (this.props.legendposition !== undefined) {\n      legend.position = this.props.legendposition\n    }\n\n    const c3_config = {\n      data: chartdata,\n      type: 'donut',\n      legend: legend,\n      color: colors,\n      size: this.props.height === undefined ? undefined : { height: this.props.height },\n      padding: this.props.padding,\n      donut: {\n        title: this.props.title === undefined ? undefined : this.props.title\n      }\n      // tooltip: {\n      //     format: {\n      //         title: (x, index) => {\n      //             let dateparts = x.toDateString().split(\" \")\n      //             return dateparts[2]+dateparts[1]+dateparts[3].substr(2,3);\n      //         }\n      //     }\n      // }\n\n      //   types: this.props.types\n    }\n    // console.log('C3 Config ', c3_config, 'data', this.props.data)\n    // return <h1 style={{color: \"white\"}}> No Bar Chart Yet -TBD</h1>\n\n    return <Box id={'donutchart' + Math.random().toString()} ref={this.divref}>\n      {this.state.view === 'chart' ? <Chart\n        ref={this.chartref}\n        config={c3_config}\n      />\n        : <ResponsiveTable\n          rows={preparedData.table_data}\n          columns={this.props.table.columns}\n          sortBy={this.props.table.sortBy} columnOrder={this.props.table.columnOrder}\n        />}<br />\n      <div style={center}>\n        <ButtonGroup style={{ margin: '0 auto' }} variant='contained' color='primary'>\n          <Button onClick={this.selectChart.bind(this)} style={this.state.view === 'chart' ? buttonselected : null}>Chart</Button>\n          <Button onClick={this.selectTable.bind(this)} style={this.state.view !== 'chart' ? buttonselected : null}>Table</Button>\n        </ButtonGroup>\n      </div>\n    </Box>\n  }\n}\n","import React from \"react\";\nimport Papa from 'papaparse';\n\nimport { Typography, Box, Grid, MenuItem, Container, Select } from \"@material-ui/core\";\nimport ToggleButtonGroup from \"@material-ui/lab/ToggleButtonGroup\";\nimport ToggleButton from \"@material-ui/lab/ToggleButton\";\nimport chartutils from \"../../../components/chartutils\";\nimport BarChart from \"../../../components/barChart\";\nimport DonutChart from \"../../../components/donutChart\";\nimport TimeSeriesChart from \"../../../components/timeSeriesChart\";\nimport ResponsiveTable from \"../../../components/ResponsiveTable\";\nimport CacheContext from \"../../../cacheBuster\";\n\nconst Demographics = (props) => {\n  const [epicurve_by_race_sex, setEpicurve_by_race_sex] = React.useState([]);\n  \n  const currdate = React.useContext(CacheContext);\n    React.useEffect(() => {\n        fetch('./data/epicurve_by_race_sex.csv?tstamp='+currdate)\n            .then((resp) => resp.text())\n            .then(csv => Papa.parse(csv, { header:true, skipEmptyLines:true, dynamicTyping:true }))\n            .then((json) => {\n                setEpicurve_by_race_sex(json.data);\n            });\n    },[currdate]);\n  \n  const race_order = props.race_order;\n  const age_order = props.age_order;\n  const classes = props.classes;\n  const demographics_info = props.demographics_info;\n  const epicurve_by_age = props.epicurve_by_age;\n\n  const [demoCaseCategory, setDemoCaseCategory] = React.useState(\"Age Group\");\n  const [demographicBarView, setDemographicBarView] = React.useState(0);\n  const [epicurveAgeView, setEpicurveAgeView] = React.useState(0);\n\n  return (\n    !!epicurve_by_race_sex.length? (\n    <Box>\n      <Typography\n        variant=\"h1\"\n        component=\"h4\"\n        gutterBottom\n        style={{ horizontalAlign: \"center\", color: \"white\" }}\n      >\n          COVID-19 Case Demographics\n      </Typography>\n      <Box display=\"flex\" flexDirection=\"column\" justifyContent=\"center\">\n        <h2\n          style={{\n            color: \"white\",\n            textAlign: \"center\",\n            fontWeight: \"normal\",\n          }}\n        >\n          Confirmed COVID-19 Cases, { /* Hospitalizations, */ } Deaths by{\" \"}\n          {demoCaseCategory}\n        </h2>\n        <Box mx=\"auto\" whiteSpace=\"nowrap\" overflow=\"hidden\">\n          <ToggleButtonGroup\n            value={demoCaseCategory}\n            onChange={(event, value) => setDemoCaseCategory(value)}\n            exclusive\n            className={classes.toggleContainer}\n          >\n            <ToggleButton value={\"Age Group\"}>Age Group</ToggleButton>\n            <ToggleButton value={\"Race\"}>Race</ToggleButton>\n            <ToggleButton value={\"Ethnicity\"}>Ethnicity</ToggleButton>\n          </ToggleButtonGroup>\n        </Box>\n        {(() => {\n          switch (demoCaseCategory) {\n            case \"Race\":\n              return (\n                <BarChart\n                  data={chartutils.sortIt(\n                    chartutils.sumByGroup(\n                      demographics_info,\n                      [\"race_other\"],\n                      [/* \"hospitalization\", */ \"positives\", \"deaths\"]\n                    ),\n                    [\n                      {\n                        key: \"race_other\",\n                        direction: \"ASC\",\n                        order: race_order,\n                      },\n                    ]\n                  )}\n                  categories={[\"race_other\"]}\n                  category_order={race_order}\n                  sort={false}\n                  measure_cols={[\"positives\", /* \"hospitalization\", */ \"deaths\"]}\n                  measure_col_labels={[\n                    \"Confirmed Cases\",\n                    /* \"Hospitalizations\", */\n                    \"Deaths\",\n                  ]}\n                  measure_type=\"number\"\n                  measure_format=\"numberTrunc\"\n                  group_display\n                  // datalabels ={true}\n                  padding={{ bottom: 50 }}\n                  height={500}\n                  datalabels_small={false}\n                  hideXLabels_small\n                  colors={{ pattern: [\"#33a3ff\", /* \"#ffcc32\", */ \"#dd5757\"] }}\n                  rotated\n                  order={null}\n                />\n              );\n            case \"Ethnicity\":\n              return (\n                <BarChart\n                  data={chartutils.sortIt(\n                    chartutils.sumByGroup(\n                      demographics_info,\n                      [\"ethnicity\"],\n                      [/* \"hospitalization\", */ \"positives\", \"deaths\"]\n                    ),\n                    [\n                      {\n                        key: \"ethnicity\",\n                        direction: \"ASC\",\n                      },\n                    ]\n                  )}\n                  categories={[\"ethnicity\"]}\n                  // category_order={age_order}\n                  sort={false}\n                  measure_cols={[\"positives\", /* \"hospitalization\", */ \"deaths\"]}\n                  measure_col_labels={[\n                    \"Confirmed Cases\",\n                    /* \"Hospitalizations\", */\n                    \"Deaths\",\n                  ]}\n                  measure_type=\"number\"\n                  measure_format=\"numberTrunc\"\n                  group_display\n                  // datalabels ={true}\n                  padding={{ bottom: 50 }}\n                  height={500}\n                  datalabels_small={false}\n                  hideXLabels_small\n                  colors={{ pattern: [\"#33a3ff\", /* \"#ffcc32\", */ \"#dd5757\"] }}\n                  rotated\n                  order={null}\n                />\n              );\n            default:\n              return (\n                <BarChart\n                  data={chartutils.sortIt(\n                    chartutils.sumMeasures(\n                      demographics_info,\n                      [\"age_group\"],\n                      [/* \"hospitalization\", */ \"positives\", \"deaths\"]\n                    ),\n                    [\n                      {\n                        key: \"age_group\",\n                        direction: \"ASC\",\n                        order: age_order,\n                      },\n                    ]\n                  )}\n                  categories={[\"age_group\"]}\n                  category_order={age_order}\n                  sort={false}\n                  measure_cols={[\"positives\", /* \"hospitalization\", */ \"deaths\"]}\n                  measure_col_labels={[\n                    \"Confirmed Cases\",\n                    /* \"Hospitalizations\", */\n                    \"Deaths\",\n                  ]}\n                  measure_type=\"number\"\n                  measure_format=\"numberTrunc\"\n                  group_display\n                  // datalabels ={true}\n                  padding={{ bottom: 50 }}\n                  height={500}\n                  datalabels_small={false}\n                  hideXLabels_small\n                  colors={{ pattern: [\"#33a3ff\", /* \"#ffcc32\", */ \"#dd5757\"] }}\n                  rotated\n                  order={null}\n                />\n              );\n          }\n        })()}\n      </Box>\n      <hr className={classes.hr} />\n\n      <Grid item xs={12}>\n        <Box display=\"flex\" flexDirection=\"column\" justifyContent=\"center\">\n          <Typography\n            style={{\n              color: \"white\",\n              textAlign: \"center\",\n            }}\n          >\n            Cases by Age Over Time (7 Day Moving Average)\n          </Typography>\n          <Box mx=\"auto\" whiteSpace=\"nowrap\" overflow=\"hidden\">\n            <ToggleButtonGroup\n              value={epicurveAgeView}\n              onChange={(event, value) => setEpicurveAgeView(value)}\n              exclusive\n              className={classes.toggleContainer}\n            >\n              <ToggleButton value={0}>All Ages</ToggleButton>\n              <ToggleButton value={1}>Children Only</ToggleButton>\n            </ToggleButtonGroup>\n          </Box>\n          {(() => {\n            switch (epicurveAgeView) {\n              case 0:\n                return (\n                  <TimeSeriesChart\n                    data={chartutils.sumByGroup(\n                      epicurve_by_age,\n                      [\"report_date\", \"age_group_major\"],\n                      [\"moving_avg\"]\n                    )}\n                    date_col=\"report_date\"\n                    measure_col=\"moving_avg\"\n                    categories={[\"age_group_major\"]}\n                    sort={false}\n                    colors={{\n                      pattern: [\n                        \"#33a3ff\",\n                        \"#ffcc32\",\n                        \"#dd5757\",\n                        \"#9471ff\",\n                        \"#15b57b\",\n                      ],\n                    }}\n                  />\n                );\n              default:\n                return (\n                  <TimeSeriesChart\n                    data={chartutils.sortIt(\n                      epicurve_by_age.filter(\n                        (item) => item.age_group_major === \"0-17\"\n                      ),\n                      [\n                        {\n                          key: \"age_group\",\n                          direction: \"ASC\",\n                          order: age_order,\n                        },\n                      ]\n                    )}\n                    date_col=\"report_date\"\n                    measure_col=\"moving_avg\"\n                    categories={[\"age_group\"]}\n                    sort={false}\n                    colors={{\n                      pattern: [\n                        \"#33a3ff\",\n                        \"#ffcc32\",\n                        \"#dd5757\",\n                        \"#9471ff\",\n                        \"#15b57b\",\n                      ],\n                    }}\n                  />\n                );\n            }\n          })()}\n        </Box>\n      </Grid>\n\n      <hr className={classes.hr} />\n\n      <Grid item xs={12}>\n        <Typography\n          style={{\n            color: \"white\",\n            textAlign: \"center\",\n          }}\n        >\n          Confirmed Deaths by Age and Race\n        </Typography>\n        <BarChart\n          data={chartutils.sortIt(\n            chartutils.fillMissing(\n              chartutils.sumByGroup(\n                demographics_info,\n                [\"race_other\", \"age_group\"],\n                [\"deaths\"]\n              ),\n              [\"race_other\", \"age_group\"],\n              \"deaths\"\n            ),\n            [\n              {\n                key: \"race_other\",\n                direction: \"ASC\",\n                order: race_order,\n              },\n              {\n                key: \"age_group\",\n                direction: \"ASC\",\n                order: age_order,\n              },\n            ]\n          )}\n          categories={[\"race_other\", \"age_group\"]}\n          measure_col=\"deaths\"\n          measure_col_labels={[\"Confirmed Deaths\"]}\n          measure_type=\"number\"\n          sort={false}\n          group_display\n          height={650}\n          padding={{ bottom: 75, left: 150 }}\n          datalabels\n          // rotated\n          // rotated_small={true}\n          colors={{\n            pattern: [\"#33a3ff\", \"#ffcc32\", \"#dd5757\", \"#9471ff\", \"#15b57b\"],\n          }}\n          order={null}\n        />\n      </Grid>\n\n      <hr className={classes.hr} />\n\n      <Grid\n        id=\"KPI1\"\n        container\n        direction=\"row\"\n        item\n        justifyContent=\"space-around\"\n        xs={12}\n        sm={12}\n        md={12}\n        lg={12}\n        className={classes.mediaFlow}\n        style={{ paddingBottom: 375 }}\n      >\n        <Grid item xs={12} sm={12} md={8} lg={8}>\n          {/* Component for user to choose demographic view */}\n          <Box display={{ xs: \"none\", sm: \"block\" }}>\n            <ToggleButtonGroup\n              value={demographicBarView}\n              onChange={(event, value) => setDemographicBarView(value)}\n              exclusive\n              style={{\n                fontSize: \"1.2em\",\n                borderColor: \"white\",\n                color: \"white\",\n                backgroundColor: \"#103052\",\n              }}\n            >\n              <ToggleButton value={0}>Race and Sex</ToggleButton>\n              {/* <ToggleButton value={1}>Race and Ethnicity</ToggleButton> */}\n              {/* <ToggleButton value={2}>Ethnicity and Sex</ToggleButton> */}\n            </ToggleButtonGroup>\n          </Box>\n          <Box display={{ xs: \"block\", sm: \"none\" }}>\n            <Select\n              id=\"selectbox\"\n              className={classes.selectBox}\n              value={demographicBarView}\n              onChange={(event, child) =>\n                setDemographicBarView(event.target.value)\n              }\n            >\n              <MenuItem key=\"0\" value={0}>\n                Race and Sex\n              </MenuItem>\n              {/* <MenuItem key=\"1\" value={1}>\n              Race and Ethnicity\n            </MenuItem>\n            <MenuItem key=\"2\" value={2}>\n              Ethnicity and Sex\n            </MenuItem> */}\n            </Select>\n          </Box>\n\n          {/* Render Barchart based on user's selection. A self-calling function handles the switching logic */}\n          <div>\n            {(() => {\n              switch (demographicBarView) {\n                case 0:\n                  return (\n                    <>\n                      <Typography\n                        style={{\n                          color: \"white\",\n                          textAlign: \"center\",\n                        }}\n                      >\n                        Confirmed Cases by Race and Sex\n                      </Typography>\n                      <BarChart\n                        data={chartutils.sortIt(\n                          chartutils.fillMissing(\n                            chartutils.sumByGroup(\n                              demographics_info,\n                              [\"race_other\", \"sex\"],\n                              [\"positives\"]\n                            ),\n                            [\"race_other\", \"sex\"],\n                            \"positives\"\n                          ),\n                          [\n                            {\n                              key: \"race_other\",\n                              direction: \"ASC\",\n                              order: race_order,\n                            },\n                            {\n                              key: \"sex\",\n                              direction: \"ASC\",\n                              order: [\"Female\", \"Male\", \"Unknown\"],\n                            },\n                          ]\n                        )}\n                        categories={[\"sex\", \"race_other\"]}\n                        measure_col=\"positives\"\n                        measure_col_labels={[\"Confirmed Cases\"]}\n                        measure_type=\"number\"\n                        measure_format=\"numberTrunc\"\n                        sort={false}\n                        group_display\n                        height={650}\n                        padding={{ bottom: 75, left: 150 }}\n                        datalabels\n                        rotated\n                        // rotated_small={true}\n                        colors={{\n                          pattern: [\"#dd5757\", \"#33a3ff\", \"#9471ff\"],\n                        }}\n                        order={null}\n                      />\n                    </>\n                  );\n                case 1:\n                  return (\n                    <>\n                      <Typography\n                        style={{\n                          color: \"white\",\n                          textAlign: \"center\",\n                        }}\n                      >\n                        Confirmed Cases by Race and Ethnicity\n                      </Typography>\n                      <BarChart\n                        data={chartutils.sortIt(\n                          chartutils.sumByGroup(\n                            epicurve_by_race_sex,\n                            [\"race\", \"ethnicity\"],\n                            [\"positives\"]\n                          ),\n                          [\n                            {\n                              key: \"race\",\n                              direction: \"ASC\",\n                              order: race_order,\n                            },\n                            { key: \"ethnicity\", direction: \"ASC\" },\n                          ]\n                        )}\n                        categories={[\"ethnicity\", \"race\"]}\n                        measure_col=\"positives\"\n                        measure_col_labels={[\"Confirmed Cases\"]}\n                        measure_type=\"number\"\n                        sort={false}\n                        group_display\n                        height={650}\n                        padding={{ bottom: 75, left: 150 }}\n                        datalabels\n                        rotated\n                        colors={{\n                          pattern: [\"#dd5757\", \"#33a3ff\", \"#9471ff\"],\n                        }}\n                      />\n                    </>\n                  );\n                case 2:\n                  return (\n                    <>\n                      <Typography\n                        style={{\n                          color: \"white\",\n                          textAlign: \"center\",\n                        }}\n                      >\n                        Confirmed Cases by Ethnicity and Sex\n                      </Typography>\n                      <BarChart\n                        data={chartutils.sumMeasures(\n                          chartutils.sortIt(epicurve_by_race_sex, [\n                            { key: \"ethnicity\", direction: \"ASC\" },\n                            { key: \"sex\", direction: \"ASC\" },\n                          ]),\n                          [\"sex\", \"ethnicity\"],\n                          [\"positives\"]\n                        )}\n                        categories={[\"sex\", \"ethnicity\"]}\n                        measure_col=\"positives\"\n                        measure_col_labels={[\"Confirmed Cases\"]}\n                        measure_type=\"number\"\n                        sort={false}\n                        // group_display= {true}\n                        height={650}\n                        padding={{ bottom: 75 }}\n                        datalabels={false}\n                        rotated_small\n                        colors={{\n                          pattern: [\"#dd5757\", \"#33a3ff\", \"#9471ff\"],\n                        }}\n                      />\n                    </>\n                  );\n                default:\n                  return <>default</>;\n              }\n            })()}\n          </div>\n        </Grid>\n\n        <Grid item xs={12} sm={8} md={4} lg={4}>\n          <Typography\n            style={{\n              color: \"white\",\n              textAlign: \"center\",\n              fontWeight: \"normal\",\n            }}\n          >\n            Confirmed COVID-19 Cases by Sex\n          </Typography>\n          <DonutChart\n            data={chartutils.sumMeasures(\n              chartutils.sortIt(demographics_info, [\n                { key: \"sex\", direction: \"ASC\" },\n              ]),\n              [\"sex\"],\n              [\"positives\"]\n            )}\n            category=\"sex\"\n            measure_col=\"positives\"\n            // measure_col_labels ={[\"Confirmed Cases\" ]}\n            measure_type=\"number\"\n            sort={false}\n            title=\"Confirmed Cases\"\n            table={{\n              columns: [\n                {\n                  id: \"sex\",\n                  label: \"Sex\",\n                  minWidth: 15,\n                  align: \"left\",\n                },\n                {\n                  id: \"positives\",\n                  label: \"Confirmed Cases\",\n                  minWidth: 12,\n                  align: \"right\",\n                },\n                {\n                  id: \"percent\",\n                  label: \"Percent\",\n                  minWidth: 12,\n                  align: \"right\",\n                },\n              ],\n              sortBy: \"sex\",\n              columnOrder: \"asc\",\n            }}\n            // datalabels = {false}\n            // height = {500}\n            // padding = {{bottom: 75, top: 150 }}\n            datalabels={false}\n            // backgroundColor = \"#d9d9d9\"\n            rotated_small\n            // colors = {{pattern: [ '#cc3300', '#000066', 'green',  'gray', '#ff9933', '#6667a3', '#654321', 'black', 'purple', 'tan','#b76e79','brown','#174800']}}\n            // colors= {{pattern: ['#ff7f0e','#e9e9e9','#35a5ff','#8782DD','#f9f9f9','#98FB98','#ad7100','#bedefe']}}\n            // colors = {{pattern: [ '#cc3300', '#000066', 'green',  'gray', '#ff9933', '#6667a3', '#654321', 'black', 'purple', 'tan','#b76e79','brown','#174800']}}\n            colors={{ pattern: [\"#dd5757\", \"#33a3ff\", \"#9471ff\"] }}\n          />\n        </Grid>\n        <hr className={classes.hr} />\n        <h2\n          style={{\n            color: \"white\",\n            textAlign: \"center\",\n            fontWeight: \"normal\",\n          }}\n        >\n          Confirmed COVID-19 Cases by Race and Sex\n        </h2>\n        <br />\n        <Grid item xs={12}>\n          <Container maxWidth=\"md\">\n            <ResponsiveTable\n              rows={chartutils\n                .pivotWider(\n                  chartutils.sumByGroup(\n                    demographics_info.filter(\n                      (d) => d.county_name === \"Georgia\"\n                    ),\n                    [\"race\", \"sex\"],\n                    [\"positives\"]\n                  ),\n                  \"sex\",\n                  \"positives\",\n                  \"race\"\n                )\n                .map((row) => {\n                  return {\n                    race: row.race,\n                    Female: row.Female,\n                    Male: row.Male,\n                    Total:\n                      row.Female +\n                      row.Male +\n                      (row.Unknown !== undefined ? row.Unknown : 0),\n                  };\n                })}\n              columns={[\n                {\n                  id: \"race\",\n                  label: \"Race\",\n                  minWidth: 15,\n                  align: \"left\",\n                },\n                { id: \"Total\", label: \"Total Cases\", align: \"right\" },\n                {\n                  id: \"Female\",\n                  label: \"Female Cases\",\n                  minWidth: 12,\n                  align: \"right\",\n                },\n                {\n                  id: \"Male\",\n                  label: \"Male Cases\",\n                  minWidth: 12,\n                  align: \"right\",\n                },\n              ]}\n              sortBy=\"Total\"\n              columnOrder=\"desc\"\n            />\n          </Container>\n        </Grid>\n      </Grid>\n    </Box>)\n    : null\n  );\n};\n\nexport default Demographics;\n","import Papa from 'papaparse';\n\nimport React, { Suspense } from \"react\";\nimport LoadingSpinner from \"../../components/loadingSpinner\";\nimport Demographics from \"./demographics\";\nimport CacheContext from \"../../cacheBuster\";\n\nconst ageMap = new Map([\n  [\"<1\", \"0-17\"],\n  [\"01-04\", \"0-17\"],\n  [\"05-09\", \"0-17\"],\n  [\"10-17\", \"0-17\"],\n  [\"18-29\", \"18-29\"],\n  [\"30-39\", \"30-59\"],\n  [\"40-49\", \"30-59\"],\n  [\"50-59\", \"30-59\"],\n  [\"60-69\", \"60 & Older\"],\n  [\"70-79\", \"60 & Older\"],\n  [\"80 & Older\", \"60 & Older\"],\n  [\"Unknown\", \"Unknown\"],\n]);\n\nconst raceMap = new Map([\n  [\"African-American/ Black\", \"African-American/ Black\"],\n  [\"White\", \"White\"],\n  [\"Asian\", \"Asian\"],\n  [\"American Indian/ Alaska Native\", \"Other\"],\n  [\"Native Hawaiian/ Pacific Islander\", \"Other\"],\n  [\"Other\", \"Other\"],\n  [\"Unknown\", \"Unknown\"],\n]);\n\nconst race_order = [\n  \"African-American/ Black\",\n  \"White\",\n  \"Asian\",\n  \"American Indian/ Alaska Native\",\n  \"Native Hawaiian/ Pacific Islander\",\n  \"Other\",\n  \"Unknown\",\n  \"Missing\",\n];\nconst age_order = [\n  \"<1\",\n  \"01-04\",\n  \"05-09\",\n  \"10-17\",\n  \"18-29\",\n  \"30-39\",\n  \"40-49\",\n  \"50-59\",\n  \"60-69\",\n  \"70-79\",\n  \"80 & Older\",\n  \"Unknown\",\n];\n\nlet totals = 0;\n\nconst Tabset2 = (props) => {\n  const [demographics_info, setDemographics_info] = React.useState([]);\n  const [epicurve_by_age, setEpicurve_by_age] = React.useState([]);\n  \n  const currdate = React.useContext(CacheContext);\n    React.useEffect(() => {\n        fetch('./data/demographics.csv?tstamp='+currdate)\n            .then((resp) => resp.text())\n            .then(csv => Papa.parse(csv, { header:true, skipEmptyLines:true, dynamicTyping:true }))\n            .then((json) => {\n                json.data.forEach((item) => {\n                  item.age_group_major = ageMap.get(item.age_group);\n                  item.race_other = raceMap.get(item.race);\n                });\n                \n                json.data.forEach((item) => {\n                  if (item.sex === \"Female\" && item.race === \"White\") {\n                    totals = totals + item.count;\n                  }\n                });\n                \n                setDemographics_info(json.data);\n            });\n        fetch('./data/epicurve_age_group_rpt_date.csv?tstamp='+currdate)\n            .then((resp) => resp.text())\n            .then(csv => Papa.parse(csv, { header:true, skipEmptyLines:true, dynamicTyping:true }))\n            .then((json) => {\n                json.data.forEach((item) => {\n                  item.age_group_major = ageMap.get(item.age_group);\n                });\n                \n                setEpicurve_by_age(json.data);\n            });\n    },[currdate]);\n  \n  const classes = props.classes;\n\n  return (\n  !!demographics_info.length && !!epicurve_by_age.length? (\n        <Suspense fallback={<LoadingSpinner />}>\n          <Demographics\n            classes={classes}\n            race_order={race_order}\n            age_order={age_order}\n            demographics_info={demographics_info}\n            epicurve_by_age={epicurve_by_age}\n          />\n        </Suspense>)\n    : null\n  );\n};\n\nexport default Tabset2;\n"],"sourceRoot":""}