\n
Last updated = {singleData['lastUpdated']}
\n {showHistogram ? (\n
\n ) : null}\n {/*
Distribution
\n
*/}\n {showComplete ? (\n
\n {' '}\n
\n Total Records {singleData['count']}/{singleData['totalNumbers']}\n
\n
\n
\n ) : null}\n
\n );\n // return downloadCSV(props.data)} />,\n // [props.data]\n // );\n const subHeaderComponent = (\n \n
\n {' '}\n {props.tableData.length == 0 ? '' : props.selectedMainNav[1]}\n
\n
\n \n \n
\n
\n );\n\n const customStyles = {\n rows: {\n style: {\n paddingTop: '5px',\n paddingBottom: '5px',\n },\n },\n headCells: {\n style: {\n backgroundColor: '#f5f8fe',\n fontSize: '14px',\n minHeight: '56px',\n },\n },\n subHeader: {\n style: {\n margin: 0,\n padding: 0,\n },\n },\n };\n\n return (\n \n \n \n \n
\n );\n}\n\nexport default DataTableMain;\n","import React, { useState } from 'react';\r\nimport emailjs from 'emailjs-com';\r\n\r\nlet dataKeys = {\r\n 'Variable / Field Name': '',\r\n 'Form Name': '',\r\n 'Section Header': '',\r\n 'Field Type': '',\r\n 'Field Label': '',\r\n 'Choices Calculations OR Slider Labels': '',\r\n 'Field Note': '',\r\n 'Text Validation Type OR Show Slider Number': '',\r\n 'Text Validation Min': '',\r\n 'Text Validation Max': '',\r\n 'Identifier?': '',\r\n 'Branching Logic (Show field only if...)': '',\r\n 'Required Field?': '',\r\n 'Custom Alignment': '',\r\n 'Question Number (surveys only)': '',\r\n 'Matrix Group Name': '',\r\n 'Matrix Ranking?': '',\r\n 'Field Annotation': '',\r\n Type: '',\r\n VisitID: '',\r\n VisitIDNum: '',\r\n};\r\nfunction convertArrayOfObjectsToCSV(array) {\r\n let result;\r\n const columnDelimiter = ',';\r\n const lineDelimiter = '\\n';\r\n\r\n const keys = Object.keys(dataKeys);\r\n\r\n result = '';\r\n result += keys.join(columnDelimiter);\r\n result += lineDelimiter;\r\n array.forEach((item) => {\r\n let ctr = 0;\r\n keys.forEach((key) => {\r\n if (ctr > 0) result += columnDelimiter;\r\n\r\n result += item[key];\r\n // eslint-disable-next-line no-plusplus\r\n ctr++;\r\n });\r\n result += lineDelimiter;\r\n });\r\n\r\n return result;\r\n}\r\n\r\nfunction downloadCSV(array) {\r\n const link = document.createElement('a');\r\n\r\n let csv = convertArrayOfObjectsToCSV(array);\r\n if (csv == null) return;\r\n\r\n const filename = 'export.csv';\r\n\r\n if (!csv.match(/^data:text\\/csv/i)) {\r\n csv = `data:text/csv;charset=utf-8,${csv}`;\r\n }\r\n\r\n link.setAttribute('href', encodeURI(csv));\r\n return link.href;\r\n}\r\n\r\nconst RequestDataForm = (props) => {\r\n // const serviceID = 'service_7y34p38';\r\n\r\n const [name, setName] = useState('');\r\n const [email, setEmail] = useState('');\r\n const [institution, setInstitution] = useState('');\r\n const [additionalMessage, setAdditionalMessage] = useState('');\r\n const [dataCSV, setDataCSV] = useState('');\r\n\r\n const handleSubmit = (evt) => {\r\n evt.preventDefault();\r\n\r\n let array = props.smallTableData;\r\n\r\n let link = downloadCSV(array);\r\n\r\n var templateParams = {\r\n name: name,\r\n email: email,\r\n institution: institution,\r\n additionalMessage: additionalMessage,\r\n link: link,\r\n };\r\n props.setIsOpen(!props.isOpen);\r\n\r\n emailjs\r\n .send(\r\n process.env.REACT_APP_serviceID,\r\n process.env.REACT_APP_templateID,\r\n templateParams,\r\n process.env.REACT_APP_user\r\n )\r\n\r\n .then(\r\n function (response) {\r\n console.log('SUCCESS!', response.status, response.text);\r\n },\r\n function (error) {\r\n console.log('FAILED...', error);\r\n }\r\n );\r\n };\r\n return (\r\n \r\n
\r\n
\r\n x\r\n \r\n <>\r\n
\r\n >\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default RequestDataForm;\r\n","import RequestDataForm from './RequestDataForm';\r\nexport default RequestDataForm;\r\n","import React from 'react';\nimport Button from '@mui/material/Button';\nimport Typography from '@mui/material/Typography';\nimport ShowChartOutlinedIcon from '@mui/icons-material/ShowChartOutlined';\n\nconst UpsetDataButton = ({ buttonLabel, onClickHandler }) => (\n }\n onClick={onClickHandler}\n >\n \n {buttonLabel}\n \n \n);\nexport default UpsetDataButton;\n","import React from 'react';\nimport Button from '@mui/material/Button';\nimport Typography from '@mui/material/Typography';\nimport HighlightOffOutlinedIcon from '@mui/icons-material/HighlightOffOutlined';\n\nconst DeselectButton = ({ buttonLabel, onClickHandler }) => (\n }\n onClick={onClickHandler}>\n \n {buttonLabel}\n \n )\nexport default DeselectButton;\n","import React from 'react';\nimport Button from '@mui/material/Button';\nimport Typography from '@mui/material/Typography';\nimport AttachEmailOutlinedIcon from '@mui/icons-material/AttachEmailOutlined';\n\nconst RequestButton = ({ buttonLabel, onClickHandler }) => (\n }\n onClick={onClickHandler}>\n \n {buttonLabel}\n \n )\nexport default RequestButton;\n","import React, { useMemo, useState, useEffect } from 'react';\nimport _ from 'lodash';\nimport StackedBarChart from '../StackedBarChart/StackedBarChart';\nimport CheckBox from '../../Components/Menu/CheckBox';\nimport DataTable from 'react-data-table-component';\nimport { MyCheckBox } from '../../Components/Menu/style';\nimport Button from '../../Components/Menu/Button';\nimport { parseTreeNav } from '../loadData';\nimport RequestDataForm from '../RequestDataForm';\nimport UpsetDataButton from '../../Components/TableButton/UpsetDataButton';\nimport Card from '@mui/material/Card';\nimport DeselectButton from '../../Components/TableButton/DeselectButton';\nimport RequestButton from '../../Components/TableButton/RequestButton';\nimport Checkbox from '@mui/material/Checkbox';\n\n// import setDatabaseData from '../../index';\n\nconst columns = [\n {\n name: 'Variable Id',\n selector: (row) => row['Variable / Field Name'],\n wrap: true,\n },\n {\n name: 'Description',\n selector: (row) => row['Field Label'],\n wrap: true,\n },\n {\n name: 'Choices',\n selector: (row) => row['Choices Calculations OR Slider Labels'],\n wrap: true,\n },\n];\n\nfunction DataTableSmall(props) {\n const [selectedRows, setSelectedRows] = React.useState([]);\n const [upsetArray, setUpsetArray] = React.useState([]);\n const [toggledClearRows, setToggleClearRows] = React.useState(false);\n const [isOpen, setIsOpen] = useState(false);\n\n // setSelectedRows([]);\n\n // const [seeView, setSeeView] = useState(false);\n function findDifference() {\n let differenceArray = [];\n let rowsSmallTable = upsetArray;\n let rowsSmallTableData = props.smallTableData;\n\n for (let i = 0; i < rowsSmallTable.length; i++) {\n for (let j = 0; j < rowsSmallTableData.length; j++) {\n if (\n rowsSmallTable[i]['Type'] === rowsSmallTableData[j]['Type'] &&\n rowsSmallTable[i]['Variable / Field Name'] ===\n rowsSmallTableData[j]['Variable / Field Name'] &&\n rowsSmallTable[i]['Form Name'] ===\n rowsSmallTableData[j]['Form Name'] &&\n rowsSmallTable[i]['VisitID'] === rowsSmallTableData[j]['VisitID']\n ) {\n differenceArray.push(rowsSmallTableData[j]);\n }\n }\n }\n\n return _.differenceBy(rowsSmallTableData, differenceArray);\n }\n\n const handleChange = (state) => {\n if (props.clearSelectedRows == true) {\n setUpsetArray([]);\n }\n props.setDataToSee(upsetArray);\n\n if (state.selectedRows.length == 0) {\n upsetArray.pop();\n } else {\n if (upsetArray.indexOf(state.selectedRows[0]) == -1) {\n upsetArray.push(state.selectedRows[0]);\n // upsetArray.push(state.selectedRows[0]);\n }\n }\n props.setChangeText(!props.changeText);\n props.setClearSelectedRows(false);\n\n setSelectedRows(state.selectedRows);\n };\n\n // Toggle the state so React Data Table changes to clearSelectedRows are triggered\n const handleClearRows = () => {\n if (!_.isEqual(props.smallTable, [])) {\n props.setSmallTableNav(parseTreeNav(findDifference()));\n props.setSmallTable(_.differenceBy(props.smallTable, upsetArray));\n props.setSmallTableData(findDifference());\n }\n\n // props.setSmallTable(selectedRows);\n\n setToggleClearRows(!toggledClearRows);\n };\n\n const upsetData = () => {\n var urlString = '';\n\n if (upsetArray == []) {\n return;\n }\n console.log(upsetArray)\n for (let i of upsetArray) {\n urlString =\n urlString +\n i['Variable / Field Name'] +\n ',' +\n i['Form Name'] +\n ',' +\n i['VisitIDNum'] +\n ',' +\n i['Section Header'] +\n 'xxx';\n }\n\n fetch('https://manati.ece.neu.edu/vizquery/sdss/upsetData/' + urlString)\n .then((response) => {\n return response.json();\n })\n .then((data) => {\n let intersectionData = data[1];\n let setData = data[0];\n for (let inter of intersectionData) {\n let interName = inter.name;\n const set1 = new Set();\n inter.sets = set1;\n for (let s of setData) {\n if (interName.includes(s.name)) {\n inter.sets.add(s);\n }\n }\n }\n\n let newData = [setData, intersectionData];\n\n props.setDatabaseData(newData);\n props.setHideUpset(true);\n });\n };\n\n const togglePopup = () => {\n setIsOpen(!isOpen);\n };\n const subHeaderComponent = (\n \n
\n {' '}\n {props.smallTableData.length == 0 ? '' : props.selectedNav[1]}\n
\n
\n \n \n \n
\n
\n );\n\n const customStyles = {\n rows: {\n style: {\n paddingTop: '5px',\n paddingBottom: '5px',\n },\n },\n headCells: {\n style: {\n backgroundColor: '#f5f8fe',\n fontSize: '14px',\n minHeight: '56px',\n },\n },\n subHeader: {\n style: {\n margin: 0,\n padding: 0,\n },\n },\n };\n\n return (\n \n \n {isOpen && (\n \n )}\n \n \n
\n );\n}\nexport default DataTableSmall;\n","import React, { useState, useRef, useMemo } from 'react';\r\nimport { extractCombinations, UpSetJS } from '@upsetjs/react';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport { faInfoCircle } from '@fortawesome/free-solid-svg-icons';\r\n\r\nimport useResizeObserver from '../../Components/useResizeObserver';\r\nimport { height } from '@mui/system';\r\n\r\n/**\r\n * Component that renders a StackedBarChart\r\n */\r\n\r\nconst UpsetView = (props) => {\r\n const [showInfo, setShowInfo] = useState(false);\r\n const [width, setWidth] = useState(600);\r\n // console.log(props.databaseData[0]);\r\n // if (props.databaseData[0]) {\r\n // setSeeView(true);\r\n // }\r\n // console.log(props.databaseData[1][0]['sets']);\r\n // console.log('showInfo', showInfo);\r\n const showInfoDiv = () => {\r\n setShowInfo(!showInfo);\r\n if (width == 600) {\r\n setWidth(600);\r\n } else {\r\n setWidth(600);\r\n }\r\n };\r\n function printString(data) {\r\n var string = '';\r\n for (let d of data) {\r\n string = string + d['Section Header'] + ',' + d['VisitIDNum'] + ',';\r\n }\r\n return string;\r\n }\r\n\r\n // const imageUrl = `${process.env.PUBLIC_URL}/upsetExplanation.JPG`;\r\n return (\r\n \r\n
\r\n This view cannot be used with the environmental data.\r\n
Data to be visualized
\r\n
{printString(props.dataToSee)}
\r\n {/*
*/}\r\n
\r\n\r\n {/* {showInfo ? (\r\n
\r\n

\r\n
\r\n ) : null} */}\r\n {props.hideUpset ? (\r\n
\r\n \r\n
\r\n ) : null}\r\n
\r\n );\r\n};\r\n\r\nexport default UpsetView;\r\n","import React, { useState } from 'react';\nimport ListItem from '@material-ui/core/ListItem';\nimport List from '@mui/material/List';\nimport ListItemButton from '@mui/material/ListItemButton';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\nimport Collapse from '@material-ui/core/Collapse';\nimport ExpandLessIcon from '@material-ui/icons/ExpandLess';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { margin } from '@mui/system';\n\nconst hasChildren = (item) => {\n const { nodes: children } = item;\n\n if (children === undefined) {\n return false;\n }\n\n if (children.constructor !== Array) {\n return false;\n }\n\n if (children.length === 0) {\n return false;\n }\n\n return true;\n};\n\nconst MenuItem = ({\n level,\n item,\n parentItem,\n setTableData,\n setSelectedMainNav,\n}) => {\n const Component = hasChildren(item) ? MultiLevel : SingleLevel;\n return (\n \n );\n};\n\nconst SingleLevel = ({\n level,\n item,\n parentItem,\n setTableData,\n setSelectedMainNav,\n}) => {\n const handleSingleLevelClick = () => {\n setSelectedMainNav([parentItem.label, item.label]);\n setTableData(item.props);\n };\n\n return (\n \n \n \n );\n};\n\nconst MultiLevel = ({\n level,\n item,\n parentItem,\n setTableData,\n setSelectedMainNav,\n}) => {\n const { nodes: children } = item;\n const [open, setOpen] = useState(false);\n\n const handleClick = () => {\n if (open) {\n setTableData([]);\n }\n setOpen((prev) => !prev);\n };\n\n return (\n \n \n \n {open ? (\n \n ) : (\n \n )}\n \n \n \n {children.map((child) => (\n \n ))}\n
\n \n
\n );\n};\n\nexport default MenuItem;\n","import React, { useState } from 'react';\nimport MenuItem from './MenuItem';\n\nconst MainDrawer = ({ treeNav, setTableData, setSelectedMainNav }) => {\n const DrawerStyling = {\n boxShadow: '1px 0 0 0',\n // borderRight: \"1px solid #f1f2f9\",\n paddingRight: 10,\n };\n return (\n \n {treeNav.map((item) => (\n \n ))}\n
\n );\n};\n\nexport default MainDrawer;\n","import React, { useState } from 'react';\nimport ListItem from '@material-ui/core/ListItem';\nimport List from '@mui/material/List';\nimport ListItemButton from '@mui/material/ListItemButton';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@mui/material/ListItemText';\nimport Collapse from '@material-ui/core/Collapse';\nimport ExpandLessIcon from '@material-ui/icons/ExpandLess';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport { margin } from '@mui/system';\nimport { curveNatural } from 'd3';\n\nconst hasChildren = (item) => {\n const { nodes: children } = item;\n\n if (children === undefined) {\n return false;\n }\n\n if (children.constructor !== Array) {\n return false;\n }\n\n if (children.length === 0) {\n return false;\n }\n\n return true;\n};\n\nconst SmallMenuItem = ({\n level,\n item,\n parentItem,\n setSmallTable,\n setSelectedSmallNav,\n}) => {\n const Component = hasChildren(item) ? MultiLevel : SingleLevel;\n return (\n \n );\n};\n\nconst SingleLevel = ({\n level,\n item,\n parentItem,\n setSmallTable,\n setSelectedSmallNav,\n}) => {\n const handleSingleLevelClick = () => {\n setSelectedSmallNav([parentItem.label, item.label]);\n setSmallTable(item.props);\n };\n\n return (\n \n \n \n );\n};\n\nconst MultiLevel = ({\n level,\n item,\n parentItem,\n setSmallTable,\n setSelectedSmallNav,\n}) => {\n const { nodes: children } = item;\n const [open, setOpen] = useState(false);\n const handleClick = () => {\n if (open) {\n setSmallTable([]);\n }\n setOpen((prev) => !prev);\n };\n\n return (\n \n \n \n {open ? (\n \n ) : (\n \n )}\n \n \n \n {children.map((child) => (\n \n ))}\n
\n \n
\n );\n};\n\nexport default SmallMenuItem;\n","import React, { useState } from 'react';\nimport SmallMenuItem from './SmallMenuItem';\n\nconst SmallDrawer = ({ smallTableNav, setSmallTable, setSelectedSmallNav }) => {\n const DrawerStyling = {\n boxShadow: '1px 0 0 0',\n // borderRight: \"1px solid #f1f2f9\",\n paddingRight: 10,\n };\n\n return (\n \n {smallTableNav.map((item) => (\n \n ))}\n
\n );\n};\n\nexport default SmallDrawer;\n","import React, { useEffect, useState } from 'react';\nimport _, { result } from 'lodash';\nimport { ReflexContainer, ReflexSplitter, ReflexElement } from 'react-reflex';\nimport { BsArrowBarRight } from 'react-icons/bs';\nimport { Button, InputGroup } from 'react-bootstrap';\nimport './style.css';\nimport { readString } from 'react-papaparse';\nimport MenuPanel from './menu';\nimport Header from './header';\nimport {\n getCorrectData,\n addAditionalData,\n parseSmallTable,\n parseTreeNav,\n} from './loadData';\nimport TreeNav from './TreeNav';\nimport Search from './Search';\nimport DataTableMain from './DataTableMain/DataTableMain';\nimport DataTableSmall from './DataTableSmall/DataTableSmall';\nimport SmallTreeNav from './SmallTreeNav/SmallTreeNav';\nimport UpsetView from './upsetView/upsetView';\nimport MainDrawer from './MainDrawer/MainDrawer';\nimport SmallDrawer from './SmallDrawer/SmallDrawer';\n\nconst Views = (props) => {\n const [data, setData] = useState(null);\n const [treeNav, setTreeNav] = useState([]);\n\n const [searchData, setSearchData] = useState(null);\n const [tableData, setTableData] = useState([]);\n const [selectedMainNav, setSelectedMainNav] = useState([]);\n const [smallTable, setSmallTable] = useState([]);\n const [smallTableNav, setSmallTableNav] = useState([]);\n const [smallTableData, setSmallTableData] = useState([]);\n const [selectedSmallNav, setSelectedSmallNav] = useState([]);\n const [clearSelectedRows, setClearSelectedRows] = useState(true);\n const [dataToSee, setDataToSee] = useState([]);\n const [changeText, setChangeText] = useState(true);\n const [transferRows, setTransferRows] = useState([]);\n\n const [rowSelectCritera, setRowSelectCriteria] = useState((row) => false);\n const [databaseData, setDatabaseData] = useState([[], []]);\n const [hideUpset, setHideUpset] = useState(false);\n\n const loadData = async () => {\n try {\n const allPosts = await fetch(\n `${process.env.PUBLIC_URL}data/bioPlayground.csv`\n ).then((res) => res.text());\n return allPosts;\n } catch (err) {\n console.log(err);\n }\n };\n useEffect(() => {\n loadData().then((res) => {\n readString(res, {\n header: true,\n worker: true,\n complete: (results) => {\n var newData = addAditionalData(results.data);\n setTreeNav(parseTreeNav(results.data));\n setData(newData);\n },\n });\n });\n }, []);\n\n // const rowSelectCritera = (row) => {\n // if (smallTableData.includes(row)) {\n // return true;\n // }\n // };\n //https://www.npmjs.com/package/react-reflex\n\n return (\n <>\n \n\n \n \n \n \n \n \n\n \n \n\n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {/* \n \n
{this.state.footMessage}
\n
\n */}\n \n >\n );\n};\n\nexport default Views;\n","import Views from './views';\n\nfunction App() {\n return ;\n}\n\nexport default App;\n","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\n\nimport reportWebVitals from './reportWebVitals';\nimport 'bootstrap/dist/css/bootstrap.min.css';\nimport 'react-reflex/styles.css';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}