{"version":3,"sources":["landing/LandingPage.tsx","legal/Privacy.jsx","legal/Terms.jsx","legal/GDPR.jsx","survey/Centered.js","db/rails.ts","db/index.ts","admin/LoginScreen.tsx","admin/SurveyForm.js","admin/SurveyIndex.tsx","admin/Logo.tsx","admin/RawValue.tsx","admin/RawValueList.tsx","admin/MasterValueListItem.tsx","util.ts","admin/helpers/sounds.ts","admin/MappingsEditor.tsx","admin/FilterInput.tsx","admin/AdjacencyMatrix.tsx","admin/MasterMatrix.tsx","admin/helpers/metrics.ts","admin/AnalyticsView.tsx","admin/dataviz/createScatterPlot.ts","admin/ResponseTranslationTable.tsx","survey/RoughJSConnectionEditor.js","admin/TagInput.tsx","admin/ResponseView.tsx","admin/ResponsesView.tsx","admin/SurveyAdminsForm.tsx","admin/SurveyAdminView.tsx","admin/SurveyView.tsx","admin/helpers/getResponseFromImport.ts","admin/helpers/util.ts","admin/helpers/automatch.tsx","admin/SurveyAdminApp.tsx","admin/AdminApp.tsx","survey/TextInput.js","survey/SpinnerScreen.js","survey/NewsletterForm.js","survey/inputs/RadioInput.jsx","survey/inputs/CheckboxInput.jsx","survey/inputs/SelectInput.jsx","survey/inputs/renderInput.jsx","survey/inputs/TextInput.jsx","survey/data/examples.js","survey/SurveyApp.js","App.js","serviceWorker.js","index.js"],"names":["LandingPage","className","src","alt","href","target","React","Component","Privacy","id","Terms","start","GDPR","Centered","children","style","width","height","display","alignItems","justifyContent","margin","i","rails","survey","name","settings","created_at","updated_at","created","updated","response","masterValue","hasOwnProperty","key","DB","token","this","path","fetch","data","method","options","headers","body","JSON","stringify","json","ok","email","create","sessionData","get","surveys","map","attrs","update","destroy","surveyID","savedResponse","responseID","updates","surveyData","responses","masterValues","master","value","master_value","masterID","categories","console","log","oldCategory","newCategory","railsDB","window","LoginScreen","props","emailRef","tokenRef","handleSubmitEmail","event","preventDefault","current","setState","db","authenticate","message","warning","error","handleSubmitToken","state","session","onLogin","createRef","form","renderTokenForm","renderEmailForm","onSubmit","Item","ref","type","placeholder","size","textAlign","autoFocus","Option","Select","SurveyForm","handleDismiss","actions","resetFields","dismiss","handleError","handleSubmit","isNew","validateFields","err","values","createSurvey","then","updateSurvey","handleDelete","deleteSurvey","visible","getFieldDecorator","title","onClose","overflow","paddingBottom","layout","hideRequiredMark","gutter","span","label","initialValue","rules","required","focus","direction","intro","TextArea","autosize","minRows","maxRows","intake","prompt1","prompt2","promptStory","thanks","showNewsletterForm","position","left","bottom","borderTop","padding","background","onClick","marginRight","Form","SurveyIndex","renderNewSurveyForm","match","history","replace","renderEditSurveyForm","helpers","getSurvey","Number","params","admin","renderCurrentUserNav","bordered","dataSource","renderItem","actionButtons","Group","Route","menu","Link","to","overlay","Logo","color","viewBox","version","xmlns","fill","transform","d","RawValue","reviewValueReferences","data-value","trigger","RawValueList","data-id","renderValue","MasterValueListItem","handleValueChange","app","trim","createMasterValue","updateMasterValue","deleteMasterValue","handleCategoryChange","category","handleAutomatch","automatch","input","readonly","code","aliases","addonBefore","disabled","suffix","defaultValue","onBlur","onPressEnter","renderCategorySelect","length","onChange","nextID","getUniqueValuesFromResponse","getUniqueValues","set","Set","source","matrix","labels","slice","forEach","add","entry","nestedEntry","j","Array","from","filter","test","prepareResponse","index","prepareList","minLength","plusOne","push","createPlaceholder","last","getGraphFromResponse","Error","getGraph","nodeIndex","createCleanResponse","graph","getNode","identifier","focusNode","innerNodes","outerNodes","nodes","edges","findOrCreateNode","node","inner","targetEntry","causeEntry","edge","otherEdges","otherEdge","getOriginalMatrix","graphToAdjacencyMatrix","getEdgeListFromMatrix","row","col","weight","getBlueprintFromMatrix","indexByLabel","elements","codeForIndex","connections","translateMatrix","translationOptions","translateValue","translateEdge","usedLabels","categorize","has","masterValueIndex","createEmptyMatrix","getMasterValueObject","aliasTable","find","translatedMatrixToMasterMatrix","translatedMatrix","getMasterMatrixLabels","masterIndex","getResponseTranslationStats","remaining","mappings","getMasterValue","getTranslatedMatrixFromResponse","getMasterMatrixFromResponse","excelColumnName","intToExcelCol","toLowerCase","matrixToCSV","rows","v","papaparse","unparse","getAggregateMatrixFromResponses","masterMatrix","filterResponses","tags","rawResponse","parse","getSurveyStats","getNodeCount","getEdgeCount","n","total","getDensity","V","nodeReduction","edgeReduction","densityIncrease","ignored","original","translated","averageNodeReduction","mean","averageEdgeReduction","averageDensityIncrease","averagePathLengthReduction","NaN","UUID_CHARS","split","uuid","radix","Math","random","Sounds","up","Audio","down","play","sound","audio","currentTime","playDropSound","MappingsEditor","unmappedFilterRef","draggable","handleUnmappedFilterChange","unmappedFilter","debounce","mappedValues","unmappedValues","ignoredValues","refresh","initializeDraggables","nextProps","nextMasterValueID","stats","nextCode","focusMaster","nextMaster","precision","mappedValue","renderMappedValue","outline","aliasesByID","Object","keys","rawValue","containers","document","querySelectorAll","Sortable","delay","droppable","scrollable","speed","sensitivity","on","currentOverContainer","sourceContainer","getAttribute","move","FilterInput","handleFilterChange","rawFilter","RegExp","AdjacencyMatrix","isMaster","domain","min","Infinity","max","getMatrixDomain","scale","chroma","headerLabels","truncatedLabel","substring","fromLabel","cells","toLabel","checked","backgroundColor","luminance","opacity","placement","MasterMatrix","handleDownloadMatrix","csv","getMatrix","download","handleDownloadBlueprint","blueprint","updateFilter","categoriesEnabled","defaultChecked","renderEmpty","renderMatrix","calculateMetrics","list","pageranks","graphology","DirectedGraph","mergeEdge","pagerank","weighted","calculatePagerank","metrics","orphan","degree","indegree","calculateIndegree","outdegree","calculateOutdegree","assignRank","metric","sortBy","AnalyticsView","refreshDataviz","renderDataviz","containerSelector","ranked","x","y","r","c","render","rawX","rawY","rawRadius","rawColor","d3","$el","$","empty","$target","is","attr","append","hide","change","top","right","svg","select","scaleLinear","range","call","axisBottom","text","axisLeft","legendSvg","legendAxisScale","legendGradient","legendColorScale","scaleSequential","interpolateViridis","colorScale","selectAll","enter","labelGroup","transition","createScatterPlot","ResponseTranslationTable","renderMapping","renderEdge","mapping","raw","icon","theme","twoToneColor","rough","ConnectionEditor","handleResize","resize","handleEdgeCreated","edgeSvg","onEdgeCreated","handleKeyDown","ctrlKey","metaKey","shiftKey","redo","undo","pop","edgeLayer","removeChild","lastChild","onEdgeCreatedUndo","addEventListener","removeEventListener","resizeSVG","renderSVG","refs","innerHeight","outerHeight","roughSvg","$svg","off","canvasWidth","canvasHeight","canvasMinSize","camera","translate","defs","createElementNS","innerHTML","appendChild","sceneGroup","innerRadius","outerRadius","innerDelta","PI","outerDelta","innerBasis","outerBasis","positionNode","radius","basis","delta","angle","cos","sin","positionGraph","drawNode","drawEdge","drawGraph","sceneBounds","getBoundingClientRect","zoomFit","applyCamera","dragging","getTargetNode","$group","getTargetNodeGroup","indexOf","clientX","originalEvent","changedTouches","clientY","elementFromPoint","getEventTarget","closest","updateDragEdge","deltaX","dragEndX","dragStartX","deltaY","dragEndY","dragStartY","magnitude","sqrt","angleDegrees","atan2","dragEdge","setAttribute","nodeType","nodeGroup","nodeHit","nodeFill","circle","string","split1","round","split2","splitString","line1","line2","drawText","edgeGroup","x0","y0","unitX","unitY","lineX0","lineY0","lineX1","lineY1","line","arrow","linearPath","finalizeDrag","dragSource","dragTarget","some","anchor","group","shadow","textContent","widthScale","heightScale","zoomFitScale","$currentTargetGroup","$activeTargetGroup","onLeaveGroup","onEnterGroup","$node","nodeID","offsetX","offsetY","svgBounds","touches","pageX","pageY","toWorldX","toWorldY","TagInput","handleBlur","updateResponseTags","success","catch","ResponseView","classNames","story","ResponsesView","currentResponseIndex","handleResponseSelect","handlePrev","handleNext","handleDownloadOriginal","getCurrentResponse","handleDownloadTranslated","handleDownloadMaster","handleIgnore","confirm","ignore","ignoreResponse","info","currentResponse","compact","meta","join","getResponseLabel","undefined","SurveyAdminsForm","renderAdmin","Modal","content","onOk","dropAdmin","handleAddAdmin","$input","val","addAdmin","admins","SurveyAdminView","handleReset","resetMasterValues","Content","Layout","Header","Sider","Footer","SurveyView","Tabs","TabPane","location","handleMenuClick","handleDrop","dataTransfer","files","file","importResponse","handleDragEnter","handleDragOver","stopPropagation","handleMouseMove","isFileDrop","fetchSurveyData","ready","renderLoading","onDragEnter","onDragOver","onMouseMove","onDrop","mode","defaultSelectedKeys","paddingLeft","marginTop","Boolean","parseXLSX","parseCSV","Promise","resolve","reject","reader","FileReader","onload","Uint8Array","result","workbook","XLSX","read","worksheetName","SheetNames","worksheet","Sheets","csvToMatrix","utils","sheet_to_csv","onerror","readAsArrayBuffer","readAsText","getResponseFromImport","getMaster","getUnmappedValues","validMasterIDs","getMasterIDSet","getMasterID","getMatchingValues","getAliases","unmapped","bestScores","unshift","alias","score","compareTwoStrings","best","matches","getValueReferences","lowerValue","getEdgeListFromResponse","lowerFrom","lowerTo","matching","checkboxes","handleChange","AutomatchModal","okText","getChecked","appendTo","moveAll","onCancel","SurveyAdminApp","findMasterValueIndex","findIndex","responseFile","createResponse","updateResponse","updateAlias","openAutomatchModal","getAppContext","notification","open","description","duration","AdminApp","renderSurveyIndex","renderSurveyView","renderLogoutRoute","logout","getSurveyIndex","login","localStorage","setItem","fetchSurveys","getItem","removeItem","getSurveys","Switch","withRouter","TextInput","handleFocus","hasFocus","currentTarget","focusNextInput","shiftAutocompleteIndex","updateValue","autocompleteOpen","autocompleteSuggestions","autocompleteIndex","autocomplete","onDelete","showAutocomplete","onFocus","onKeyDown","renderAutocomplete","onMouseDown","selectedValue","enteredValue","stringLower","valueLower","$inputs","$nextInput","eq","setTimeout","SpinnerScreen","InputGroup","Input","NewsletterForm","submitted","RadioInput","inputs","CheckboxInput","notifyChange","checkedValues","isChecked","INPUTS","radio","checkbox","saveSvgAsPng","require","SurveyApp","currentScreenIndex","currentTagList","suggestions","submissionStatus","submissionError","load","screens","renderIntroScreen","isArray","showStoryScreen","newsletter","renderIntakeScreen","renderPrompt1Screen","renderPrompt2Screen","renderConnectionEditorScreen","renderStoryScreen","renderReviewScreen","loadExampleResponse","examples","emptyInputs","el","back","next","toggleTags","saveTagsToResponse","callback","_","flatten","edit","delete","connect","disconnect","updateStory","updateEmail","downloadScreenshot","submit","abort","resubmit","num","isInteger","tagName","prevProps","prevState","blur","scrollTop","renderSubmitSuccessScreen","renderSubmitErrorScreen","renderSubmitPendingScreen","renderScreen","defaultIntro","introParagraphs","p","logo","39","lineHeight","fontSize","whiteSpace","prompts","prompt","prefix","renderInput","marginBottom","renderBarrierCausesForm","tabIndex","parentValue","items","editor","defaultPrompt","dangerouslySetInnerHTML","__html","getElementById","svgOffset","offset","bounds","childNodes","encoderType","encoderOptions","App","renderSurvey","exact","component","hostname","ReactDOM","navigator","serviceWorker","registration","unregister"],"mappings":";00DAgNeA,G,OA5ME,kHAyMd,OAzMc,mCACf,WACE,OACE,yBAAKC,UAAU,YACb,yBAAKA,UAAU,aACb,yBAAKA,UAAU,OAAOC,IAAI,mBAAmBC,IAAI,wBAEjD,yBAAKF,UAAU,SACb,oCAAY,sDAIZ,2BAAG,gHAIH,2BAAG,wEAIH,2BAAG,oLAKH,2BAAG,8IAKH,yBAAKA,UAAU,UACb,2BAAG,0dAQH,2BAAG,gSAOH,2BAAG,mLAMP,4BAAI,8BACJ,2BAAG,yDAEY,uBAAGG,KAAK,8BAA8BC,OAAO,UAAS,kBAClE,OAAO,uBAAGD,KAAK,gCAAgCC,OAAO,UAAS,iBAAkB,iJAErC,uBAAGD,KAAK,kBAAkBC,OAAO,UAAS,QAAQ,gCAGjG,2BAAG,0QAMH,2BAAG,8JAKH,oCAAY,kPAMZ,uBAAGJ,UAAU,UAAS,sXAMtB,yBAAKA,UAAU,iBACb,4BAAI,qBAEJ,2BAAG,yQAOH,2BAAG,uQAMH,yBAAKA,UAAU,UACb,2BAAG,wQAQL,yBAAKC,IAAI,uBAET,yBAAKA,IAAI,wBAET,oCAAY,kKAKd,yBAAKD,UAAU,SACb,4BAAI,uBACJ,2BAAG,6DAIH,4BACE,4BACE,4BAAI,oCACJ,2BAAG,6GAML,4BACE,4BAAI,qCACJ,2BAAG,iIAML,4BACE,4BAAI,6BACJ,2BAAG,6IAQT,yBAAKA,UAAU,SACb,4BAAI,gCAEJ,2BAAG,6HAIH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AAO+lB,SAASoO,SAAS5uB,MACvB,2DCRN6uB,IAAS3c,OAAO,kBAAC,GAAG,MAAK7E,SAAS4gB,eAAe,SDuH3C,kBAAmBa,WACrBA,UAAUC,cAAc1N,MAAM/jB,MAAK,SAAA0xB,GACjCA,EAAaC,kB","file":"static/js/main.971c31ed.chunk.js","sourcesContent":["import './LandingPage.css';\n\nimport React from 'react';\n\nclass LandingPage extends React.Component {\n render() {\n return (\n
\n
\n \"System\n\n
\n
\n Shifting the conversation from symptoms to systems\n
\n\n

\n When trying to change the world around us, we tend to assume everyone experiences the world in the same way.\n

\n\n

\n That assumption is spectacularly—and scientifically—wrong.\n

\n\n

\n Individuals' lives are complex, unique and varied. The tools and methodologies we\n use to understand and address the issues impacting individuals must recognize that complexity.\n

\n\n

\n System Effects helps decision makers respond to complex problems while\n at the same time embracing the uniqueness of individual experience.\n

\n\n
\n

\n Public policy interventions have historically assumed that citizens are the same.\n Even within segments of populations, the assumption is that individuals within\n different segments–solo parents, new migrants, unemployed, etc–face the same challenges.\n This is not the case; disadvantage doesn't unfold in this way.\n Individuals' lives are complex, unique and varied, and the categorisation of this experience does not lead to public policy that meets their needs.\n

\n\n

\n Whether we're focusing on what gives people purpose in the workplace,\n or why individuals struggle to access healthy and nutritious food,\n it is important to recognise that individuals are different—and the\n systems that structure their lives vary based on context and circumstance.\n

\n\n

\n System Effects helps to understand individual circumstance as complex, unique and varied, and gives decision makers tools to effectively respond to the challenges they face.\n

\n
\n
\n\n

Introducing System Effects

\n

\n System Effects is a research methodology\n developed by Dr Luke Craven\n {' at '}UNSW Canberra,\n that captures the varied nature of individual experience to enable better intervention design.\n The System Effects platform was developed by Kumu in collaboration with Luke.\n

\n\n

\n Drawing on soft systems, fuzzy cognitive mapping, and graph theory,\n System Effects can be used to ask a range of questions about a given issue, focusing\n on how different impacts, barriers, and enablers exist and are perceived within the system that surrounds it.\n

\n\n

\n By beginning from the user-understanding of complex systems, the methodology helps\n re-centre lived experience in social science and policymaking practice.\n

\n\n
\n System Effects supports the design of effective interventions\n by giving decision-makers tools to understand patterns that emerge across groups and communities,\n while at the same time emphasising the varied nature of individual experience.\n
\n\n

\n Individual experiences of complex systems are varied, and depend on individual circumstance and context.\n System Effects captures the diversity of factors that impact people's experiences and the varied connections between them.\n System Effects can capture and provide decision makers tools to aggregate and quantify these individual system models at the population level.\n

\n\n
\n

How does it work?

\n\n

\n Starting from a common focus, participants are asked to explore the\n barriers, impacts, and enablers present in their own lives.\n The result of this process is a personal systems map that captures the\n individual's unique understanding and experience of the issue.\n

\n\n

\n We can then layer these individual maps to build a picture of the wider community experience.\n Aggregating maps this way ensures no individual variable or causal connection is ignored,\n while highlighting the shared experiences emerging at the population-level.\n

\n\n
\n

\n Aggregating individual models in this way accounts for every variable identified across\n the sample and the diverse range of causal connections between them, as well\n as making clear the intensity and frequency of particular connections\n at the population-level.\n

\n
\n\n \n\n \n\n
\n By beginning from the user-understanding of complex systems, the methodology helps to re-centre lived experience in social science and policymaking practice.\n
\n
\n\n
\n

How can it help me?

\n

\n The results of the System Effects process can be used to:\n

\n\n
    \n
  • \n

    Inform policy and program design

    \n

    \n How can policies most effectively address complex systems,\n given the diversity of individual experience?\n

    \n
  • \n\n
  • \n

    Guide intervention implementation

    \n

    \n How can the implementation of policies and programs be\n effectively tailored to the systemic dynamics of particular contexts?\n

    \n
  • \n\n
  • \n

    Evaluate systemic impacts

    \n

    \n How can we assess the systemic impact of particular interventions\n and their interactions with the contexts in which they are deployed?\n

    \n
  • \n
\n
\n\n
\n

How has it been used before?

\n\n

\n System Effects is being applied to a wide range of issues by national, state, and local decision makers across the world.\n

\n\n
    \n
  • Understanding the barriers to job market entry in Oslo, in partnership with the Norwegian Labour and Welfare Administration (NAV)
  • \n
  • Understanding the systemic impact of disaster events in Sydney, in partnership with Resilient Sydney and the NSW Office of Emergency Management
  • \n
  • Supporting social workers to deliver systemic care to persons facing homelessness in Newcastle, UK, in partnership with Newcastle City Council
  • \n
  • Supporting the development of policy to prevent food borne disease in Cambodia, in partnership with the International Livestock Research Institute (ILRI) and USAID
  • \n
  • Supporting effective environmental stewardship in New York, in partnership with the US Forest Service
  • \n
\n
\n\n
\n

Run your own System Effects survey

\n

\n System Effects surveys are available through our online platform for $700/survey*.\n Each survey explores a single dimension (impacts, enablers, or barriers) of a particular focus\n and includes an unlimited number of responses.\n

\n\n

\n If you would like help facilitating the survey process,\n we offer consulting services at $200/hour or $2000/day.\n Please email info@systemeffects.com to discuss options\n and explore which route is best for your project.\n

\n\n

\n * All prices in USD\n

\n
\n\n
\n Shifting the conversation from symptoms to systems\n
\n\n \n
\n
\n )\n }\n}\n\nexport default LandingPage;\n","import React from 'react';\n\nclass Privacy extends React.Component {\n render() {\n return (\n
\n
\n \"System\n\n

Privacy Policy

\n\n

Kumu Inc. ("Kumu", "we", "our", "us") developed the systemseffects.com website ("Website", "Services", “System Effects”) to help you make sense of complex challenges through participatory input. We understand how important your privacy is and will take reasonable steps to protect your information as if it was our own. This document provides our policies and procedures for collecting, using, and disclosing your information.

Kumu Inc. complies with the EU-U.S. Privacy Shield Framework and Swiss-U.S. Privacy Shield Framework as set forth by the U.S. Department of Commerce regarding the collection, use, and retention of personal information transferred from the European Union and Switzerland to the United States. Kumu Inc. has certified to the Department of Commerce that it adheres to the Privacy Shield Principles. If there is any conflict between the terms in this privacy policy and the Privacy Shield Principles, the Privacy Shield Principles shall govern. To learn more about the Privacy Shield program, and to view our certification, please visit https://www.privacyshield.gov/

Information We Collect, and How We Use It

Website Visitors

To simply browse our Website, you are not required to provide any personally-identifiable information. However, we may collect non-personally-identifiable information of the sort that web browsers and servers typically make available, such as the browser type, language preference, referring site, and the date and time of each visitor request. Kumu’s purpose in collecting non-personally identifying information is to better understand how Kumu’s visitors use its website and to monitor and improve our Website and Services. From time to time, we may release non-personally-identifying information in the aggregate, e.g., by publishing a report on trends in the usage of its website.

Registered Users

When you register for System Effects, we collect personal information including email and date of registration. We also collect potentially personally-identifying information like Internet Protocol (IP) addresses, information about your computer, geographic location, and other standard web log information. We do not disclose personally-identifying information other than as described below. Visitors can always refuse to supply personally-identifying information, with the caveat that it may prevent them from engaging in certain website-related activities.

We rely upon a number of legal grounds to ensure that our use of your Personal Data is compliant with applicable law. We use Personal Data to facilitate the business relationships we have with our Users, to comply with our financial regulatory and other legal obligations, and to pursue our legitimate business interests. The following list sets out the business purposes that we have identified as legitimate. In determining the content of this list, we balanced our interests against the legitimate interests and rights of the individuals whose Personal Data we process. We:

If we need to use your Personal Data in other ways, we will provide specific notice at the time of collection and obtain your consent where required by applicable law.

We may send you email marketing communications about Kumu products and services, invite you to participate in our events or surveys, or otherwise communicate with you for marketing purposes, provided that we do so in accordance with the consent requirements that are imposed by applicable law. When we collect your business contact details through our participation at trade shows or other events, we may use the information to follow-up with you regarding an event, send you information that you have requested on our products and services and, with your permission, include you on our marketing information campaigns.

Aggregated Statistics

We may collect statistics about the behavior of visitors to the Website. However, Kumu will not disclose personally-identifying information other than as described below.

Cookies

A cookie is a string of information that a website stores on a visitor’s computer, and that the visitor’s browser provides to the website each time the visitor returns. We use cookies to help us identify and track visitors, their usage of the System Effects website, and their website access preferences. System Effects visitors who do not wish to have cookies placed on their computers should set their browsers to refuse cookies before using the Website, with the drawback that certain features of the Website may not function properly without the aid of cookies.

Payments

When paying for an account subscription, we use a third party payment processor, Stripe, to assist in processing your personally identifiable payment information. We do not receive or store credit card information into our servers. These transactions and Stripe's use of your personal information is governed by their privacy policy (available at stripe.com/privacy).

Where We Store Your Information

If you are located outside the United States, the information that we collect from you may be transferred to, and stored and processed at, a destination in the United States. By submitting information, you agree to this transfer, storing or processing. We will take all steps reasonably necessary to ensure that your information is treated securely and in accordance with this Privacy Policy.

Disclosing Your Information

Protection of Certain Personally-Identifying Information

Kumu discloses potentially personally-identifying and personally-identifying information only to those of its employees, contractors and affiliated organizations that (i) need to know that information in order to process it on Kumu’s behalf or to provide services available at the Website, and (ii) that contractually commit to protect the security and confidentiality of Personal Data they process on our behalf. Some of those employees, contractors and affiliated organizations may be located outside of your home country; by using System Effects, you consent to the transfer of such information to them. Kumu will not rent or sell potentially personally-identifying and personally-identifying information to anyone. Other than to its employees, contractors and affiliated organizations, as described above, Kumu discloses potentially personally-identifying and personally-identifying information only in response to a subpoena, court order or other governmental request, or when Kumu believes in good faith that disclosure is reasonably necessary to protect the property or rights of Kumu, third parties or the public at large. If you are a registered user of System Effects and have supplied your email address, Kumu may occasionally send you an email to tell you about new features, solicit your feedback, or just keep you up to date with what’s going on with Kumu and our services. You can opt-out of receiving these email communications from us by contacting us at privacy@kumu.io. If you send us a request (for example via a support email or via one of our feedback mechanisms), we reserve the right to publish it in order to help us clarify or respond to your request or to help us support other users. Kumu takes all measures reasonably necessary to protect against the unauthorized access, use, alteration or destruction of potentially personally-identifying and personally-identifying information.

Business Transfers

If Kumu, or substantially all of its assets were acquired, or in the unlikely event that Kumu goes out of business or enters bankruptcy, user information would be one of the assets that is transferred or acquired by a third party. You acknowledge that such transfers may occur, and that any acquirer of Kumu may continue to use your personal information as set forth in this policy.

Your Rights and Choices

Your Data Protection Rights.Depending on your location and subject to applicable law, you may have the following rights with regard to the Personal Data we control about you:

Where the processing of your Personal Data is based on your previously given consent, you have the right to withdraw your consent at any time. You may also have the right to object to the processing of your Personal Data on grounds relating to your particular situation.

Communications Preferences

We offer those who provide personal contact information a means to choose how we use the information provided. You may manage your receipt of marketing and non-transactional communications by clicking on the “unsubscribe” link located on the bottom of our marketing emails or you may send a request to privacy@kumu.io. Please note that if you opt-out of receiving marketing related emails from us, we may still send you important administrative messages that are required to provide you with our Services.

Correcting, Updating and Removing Your Information

Upon request we will provide you with information about whether we hold, or process on behalf of a third party, any of your personal information. To request this information please contact us at privacy@kumu.io. Account owners may update or change their account information by editing their profile or organization profile or by contacting support@kumu.io for more detailed instructions. To make a request to have personal information maintained by us returned to you or removed, please email support@kumu.io. Requests to access, change, or remove your information will be handled within 30 days.

An individual who seeks access to, or who seeks to correct, amend, or delete inaccuracies in personal information stored or processed by us on behalf of an account owner should direct his/her query to the account owners (the data controller). Upon receipt of a request from one of our account owners for us to remove the data, we will respond to their request within thirty (30) days. We will retain personal information that we store and process on behalf of our account owners for as long as needed to provide the Services to our users. We will retain and use this personal information as necessary to comply with our legal obligations, resolve disputes, and enforce our agreements.

The security of your personal information is important to us. We follow generally accepted standards to protect the personal information submitted to us, both during transmission and once it is received. If you have any questions about the security of your personal information, you can contact us at privacy@kumu.io.

If you are an account owner or otherwise provide us with personal information in connection with your use of our Websites or Services, we will delete this information upon your request, provided that, notwithstanding such request, this information may be retained for as long as you maintain an account for our Services, or as needed to provide you with our Services, comply with our legal obligations, resolve disputes and enforce our agreements.

Security and Retention

We make reasonable efforts to ensure a level of security appropriate to the risk associated with the processing of Personal Data. We maintain organizational, technical and administrative measures designed to protect Personal Data within our organization against unauthorized access, destruction, loss, alteration or misuse. Your Personal Data is only accessible to a limited number of personnel who need access to the information to perform their duties. Unfortunately, no data transmission or storage system can be guaranteed to be 100% secure. If you have reason to believe that your interaction with us is no longer secure (for example, if you feel that the security of your account has been compromised), please contact us immediately.

If you are a System Effects User, we retain your Personal Data as long as we are providing the Services to you. We retain Personal Data after we cease providing Services to you, even if you close your Systems Effects account, to the extent necessary to comply with our legal and regulatory obligations. We also retain Personal Data to comply with our tax, accounting, and financial reporting obligations. Where we retain data, we do so in accordance with any limitation periods and records retention obligations that are imposed by applicable law.

Privacy Shield Frameworks

Kumu abides by and has certified adherence to the principles of the EU-U.S. Privacy Shield Framework and the Swiss-U.S. Privacy Shield Framework as set forth by the U.S. Department of Commerce. For more information on the EU-U.S. and the Swiss-U.S. Privacy Shield Frameworks, and to view the scope of Kumu’s certification, please visit https://www.privacyshield.gov/.

In compliance with the Privacy Shield Principles, Kumu commits to resolve complaints about our collection or use of your personal information. EU and Swiss individuals with inquiries or complaints regarding our Privacy Shield policy should first contact us at:

By email: 

privacy@kumu.io

By mail: 

Kumu Inc.

Attn: Privacy

720 University Avenue, Suite 200

Los Gatos, CA 95032

We have further committed to refer unresolved Privacy Shield complaints to ICDR/AAA, an alternative dispute resolution provider located in the United States. If you do not receive timely acknowledgment of your complaint from us, or if we have not addressed your complaint to your satisfaction, please contact or visit ICDR/AAA (http://go.adr.org/privacyshield.html) for more information or to file a complaint. The services of ICDR/AAA re provided at no cost to you.

If neither Kumu nor ICDR/AAA resolves your complaint, you may pursue binding arbitration through the Privacy Shield Panel. To learn more about the Privacy Shield Panel, click here. The Federal Trade Commission has investigation and enforcement authority over our compliance with the Privacy Shield.

If we have received your personal information under the Privacy Shield and subsequently transfer it to a third party service provider for processing, we will remain responsible if they process your personal information in a manner inconsistent with the Privacy Shield Principles, unless we prove that we are not responsible for the event giving rise to the damage.

Data Processing Addendum

We offer a data processing addendum (DPA) for our customers who collect data from people in the EU. Please see our GDPR Policy for more info.

Privacy Policy Changes

Although most changes are likely to be minor, Kumu may change its Privacy Policy from time to time, and in Kumu’s sole discretion. Kumu encourages visitors to frequently check this page for any changes to its Privacy Policy. Your continued use of this site after any change in this Privacy Policy will constitute your acceptance of such change.

Last Updated: August 14, 2019

Questions?

If you have any questions about our privacy policy, you can contact us by email at privacy@kumu.io or by mail using the following address:

By mail: 

Kumu Inc.

Attn: Privacy

720 University Avenue, Suite 200

Los Gatos, CA 95032

Note: This Privacy Policy is available under a Creative Commons Sharealike license, which means you’re more than welcome to steal it and repurpose it for your own use, just make sure to replace references to us with ones to you.

\n
\n
\n )\n }\n}\n\nexport default Privacy;\n","import React from 'react';\n\nclass Terms extends React.Component {\n render() {\n return (\n
\n
\n \"System\n\n

Terms of Service

\n\n

Kumu Inc. ("Kumu", "we", "our", "us") developed the systemeffects.com website ("Website", "Services", “System Effects”) to help you make sense of complex challenges through participatory input. However, be responsible in what you add to System Effects and ensure others do the same. In particular, make sure that none of the prohibited items listed below appear on your account or get linked to from your account (things like spam, viruses, or hate content). If you find material on the Website that you believe violates our terms of service, please contact us.

The following terms and conditions govern all use of the Website and all Services, content and products available at or through the website. The Website is owned and operated by Kumu. The Website is offered subject to your acceptance without modification of all of the terms and conditions contained herein and all other operating rules, policies (including, without limitation, the System Effects Privacy Policy) and procedures that may be published from time to time on this Site by us (collectively, the “Agreement”).

Please read this Agreement carefully before accessing or using the Website. By accessing or using any part of the Website, you agree to become bound by the terms and conditions of this agreement. If you do not agree to all the terms and conditions of this agreement, then you may not access the Website or use any Services. If these terms and conditions are considered an offer by Kumu, acceptance is expressly limited to these terms. The Website is available only to individuals who are at least 13 years old.

We take the privacy of our users very seriously. Please see our Privacy Policy for specifics. If you are providing us with personal data about EU residents, please see our GDPR Policy to request our Data Processing Addendum.

  1. Your System Effects Account. If you create an account on the Website, you are responsible for maintaining the security of your account and you are fully responsible for all activities that occur under the account and any other actions taken in connection with the project. You must immediately notify Kumu of any unauthorized uses of your account or any other breaches of security. Kumu will not be liable for any acts or omissions by You, including any damages of any kind incurred as a result of such acts or omissions.
  2. Responsibility of Contributors. If you operate an account, comment within an account, post survey responses or other material to an account, post links on the Website, or otherwise make (or allow any third party to make) material available by means of the Website (any such material, “Content”), You are entirely responsible for the content of, and any harm resulting from, that Content. That is the case regardless of whether the Content in question constitutes text, graphics, an audio file, or computer software. By making Content available, you represent and warrant that:
  1. the downloading, copying and use of the Content will not infringe the proprietary rights, including but not limited to the copyright, patent, trademark or trade secret rights, of any third party;
  2. if your employer has rights to intellectual property you create, you have either (i) received permission from your employer to post or make available the Content, including but not limited to any software, or (ii) secured from your employer a waiver as to all rights in or to the Content;
  3. you have fully complied with any third-party licenses relating to the Content, and have done all things necessary to successfully pass through to end users any required terms;
  4. the Content does not contain or install any viruses, worms, malware, Trojan horses or other harmful or destructive content;
  5. the Content is not spam, is not machine- or randomly-generated, and does not contain unethical or unwanted commercial content designed to drive traffic to third party sites or boost the search engine rankings of third party sites, or to further unlawful acts (such as phishing) or mislead recipients as to the source of the material (such as spoofing);
  6. the Content is not pornographic, does not contain threats or incite violence towards individuals or entities, and does not violate the privacy or publicity rights of any third party;
  7. your account is not getting advertised via unwanted electronic messages such as spam links on newsgroups, email lists, other blogs and web sites, and similar unsolicited promotional methods;
  8. your account is not named in a manner that misleads site users into thinking that you are another person or company. For example, your account’s URL or name is not the name of a person other than yourself or company other than your own; and
  9. you have, in the case of Content that includes computer code, accurately categorized and/or described the type, nature, uses and effects of the materials, whether requested to do so by Kumu or otherwise.
  1. Copyright and Content Ownership. You retain ownership of the materials you provide to Kumu and the systemeffects.com Website. We may need your permission for certain things as needed to run the Services. You give us the permissions we need to do those things solely to provide the Services. This permission also extends to trusted third parties we work with to provide the Services.

    To permanently remove Content, contact Kumu who will use reasonable efforts to remove it from the Website.

    Without limiting any of those representations or warranties, Kumu has the right (though not the obligation) to, in Kumu’s sole discretion (i) refuse or remove any content that, in Kumu’s reasonable opinion, violates any Kumu policy or is in any way harmful or objectionable, or (ii) terminate or deny access to and use of the Website to any individual or entity for any reason, in Kumu’s sole discretion. Kumu will have no obligation to provide a refund of any amounts previously paid.
  2. Payment and Renewal.
  1. General Terms. Paid services are available on the Website (any such services, a “Premium Account”). By selecting a Premium Account you agree to pay Kumu the fees indicated for that service. Payments will be charged on a pre-pay basis on the day you sign up for a Premium Account and will cover the use of that service as indicated. Premium Account fees are not refundable.
  1. Responsibility of Website Visitors. Kumu has not reviewed, and cannot review, all of the material, including computer software, posted to the Website, and cannot therefore be responsible for that material’s content, use or effects. By operating the Website, Kumu does not represent or imply that it endorses the material there posted, or that it believes such material to be accurate, useful or non-harmful. You are responsible for taking precautions as necessary to protect yourself and your computer systems from viruses, worms, Trojan horses, and other harmful or destructive content. The Website may contain content that is offensive, indecent, or otherwise objectionable, as well as content containing technical inaccuracies, typographical mistakes, and other errors. The Website may also contain material that violates the privacy or publicity rights, or infringes the intellectual property and other proprietary rights, of third parties, or the downloading, copying or use of which is subject to additional terms and conditions, stated or unstated. Kumu disclaims any responsibility for any harm resulting from the use by visitors of the Website, or from any downloading by those visitors of content there posted.
  2. Content Posted on Other Websites. We have not reviewed, and cannot review, all of the material, including computer software, made available through the websites and webpages to which the Website links, and that link to the Website. Kumu does not have any control over those non-System Effects websites and webpages, and is not responsible for their contents or their use. By linking to a non-System Effects website or webpage, Kumu does not represent or imply that it endorses such website or webpage. You are responsible for taking precautions as necessary to protect yourself and your computer systems from viruses, worms, Trojan horses, and other harmful or destructive content. Kumu disclaims any responsibility for any harm resulting from your use of non-System Effects websites and webpages.
  3. Copyright Infringement and DMCA Policy. As Kumu asks others to respect its intellectual property rights, it respects the intellectual property rights of others. If you believe that material located on or linked to by the Website violates your copyright, you are encouraged to notify Kumu. Kumu will respond to all such notices, including as required or appropriate by removing the infringing material or disabling all links to the infringing material. Kumu will terminate a visitor’s access to and use of the Website if, under appropriate circumstances, the visitor is determined to be a repeat infringer of the copyrights or other intellectual property rights of Kumu or others. In the case of such termination, Kumu will have no obligation to provide a refund of any amounts previously paid to Kumu.

    Please send notice of the alleged infringement to our designated agent:

    By email: legal@kumu.io

    By mail: 
    Kumu Inc.
    Attn: Legal
    720 University Avenue, Suite 200
    Los Gatos, CA 95032

    Your notice should provide the following information:
  1. an electronic or physical signature of the copyright owner or someone authorized to act on their behalf;
  2. the name, address, telephone number, and email address of the copyright owner;
  3. identification of the copyrighted work that is allegedly being infringed;
  4. identification of where the allegedly infringing material is located on our site or services;
  5. a statement that you have a good faith belief that the use is not authorized by the copyright owner, its agent or the law; and
  6. a statement that the information in your notice is accurate, and you are authorized to act on behalf of the copyright owner. This statement must be made under penalty of perjury.
  1. By submitting the notice, you acknowledge and agree that we may forward the information to the person who uploaded the allegedly infringing material. If you believe that your removed or disabled content is not infringing, or that you have the authorization or right to post and use that content from the copyright owner, the copyright owner's agent, or pursuant to law, you may send a counter-notice containing the information required by Section 512(g)(3) of the DMCA (17 U.S.C. § 512(g)(3)). We will forward your counter-notification to the party who submitted the original copyright infringement claim. If the original claimant does not file an action seeking a court order to restrain you from engaging in infringing activity related to the removed or disabled content within fifteen (15) calendar days of receiving the counter-notice from us, then we may, in our sole discretion, reinstate the removed or disabled content.
  2. Intellectual Property. This Agreement does not transfer from Kumu to you any Kumu or third party intellectual property, and all right, title and interest in and to such property will remain (as between the parties) solely with Kumu. Kumu, systemeffects.com, the System Effects logo, and all other trademarks, service marks, graphics and logos used in connection with systemeffects.com, or the Website are trademarks or registered trademarks of Kumu or Kumu’ licensors. Other trademarks, service marks, graphics and logos used in connection with the Website may be the trademarks of other third parties. Your use of the Website grants you no right or license to reproduce or otherwise use any Kumu, System Effects, or third-party trademarks.
  3. Changes. Kumu reserves the right, at its sole discretion, to modify or replace any part of this Agreement. It is your responsibility to check this Agreement periodically for changes. Your continued use of or access to the Website following the posting of any changes to this Agreement constitutes acceptance of those changes. Kumu may also, in the future, offer new services and/or features through the Website (including, the release of new tools and resources). Such new features and/or services shall be subject to the terms and conditions of this Agreement.
  4. Termination. Kumu may terminate your access to all or any part of the Website at any time, with or without cause, with or without notice, effective immediately. If you wish to terminate this Agreement, you may simply discontinue using the Website. All provisions of this Agreement which by their nature should survive termination shall survive termination, including, without limitation, ownership provisions, warranty disclaimers, indemnity and limitations of liability.
  5. Disclaimer of Warranties. The Website is provided “as is”. Kumu and its suppliers and licensors hereby disclaim all warranties of any kind, express or implied, including, without limitation, the warranties of merchantability, fitness for a particular purpose and non-infringement. Neither Kumu nor its suppliers and licensors, makes any warranty that the Website will be error free or that access thereto will be continuous or uninterrupted. You understand that you download from, or otherwise obtain content or services through, the Website at your own discretion and risk.
  6. Limitation of Liability. In no event will Kumu, or its suppliers or licensors, be liable with respect to any subject matter of this agreement under any contract, negligence, strict liability or other legal or equitable theory for: (i) any special, incidental or consequential damages; (ii) the cost of procurement or substitute products or services; (iii) for interruption of use or loss or corruption of data; or (iv) for any amounts that exceed the fees paid by you to Kumu under this agreement during the twelve (12) month period prior to the cause of action. Kumu shall have no liability for any failure or delay due to matters beyond their reasonable control. The foregoing shall not apply to the extent prohibited by applicable law.
  7. General Representation and Warranty. You represent and warrant that (i) your use of the Website will be in strict accordance with the System Effects Privacy Policy, with this Agreement and with all applicable laws and regulations (including without limitation any local laws or regulations in your country, state, city, or other governmental area, regarding online conduct and acceptable content, and including all applicable laws regarding the transmission of technical data exported from the United States or the country in which you reside) and (ii) your use of the Website will not infringe or misappropriate the intellectual property rights of any third party.
  8. Indemnification. You agree to indemnify and hold harmless Kumu, its contractors, and its licensors, and their respective directors, officers, employees and agents from and against any and all claims and expenses, including attorneys’ fees, arising out of your use of the Website, including but not limited to your violation of this Agreement.
  9. Miscellaneous. This Agreement constitutes the entire agreement between Kumu and you concerning the subject matter hereof, and they may only be modified by a written amendment signed by an authorized executive of Kumu, or by the posting by Kumu of a revised version. Except to the extent applicable law, if any, provides otherwise, this Agreement, any access to or use of the Website will be governed by the laws of the state of California, U.S.A., excluding its conflict of law provisions, and the proper venue for any disputes arising out of or relating to any of the same will be the state and federal courts located in Santa Clara County, California. Except for claims for injunctive or equitable relief or claims regarding intellectual property rights (which may be brought in any competent court without the posting of a bond), any dispute arising under this Agreement shall be finally settled in accordance with the Comprehensive Arbitration Rules of the Judicial Arbitration and Mediation Service, Inc. (“JAMS”) by three arbitrators appointed in accordance with such Rules. The arbitration shall take place in Los Gatos, California, in the English language and the arbitral decision may be enforced in any court. The prevailing party in any action or proceeding to enforce this Agreement shall be entitled to costs and attorneys’ fees. If any part of this Agreement is held invalid or unenforceable, that part will be construed to reflect the parties’ original intent, and the remaining portions will remain in full force and effect. A waiver by either party of any term or condition of this Agreement or any breach thereof, in any one instance, will not waive such term or condition or any subsequent breach thereof. You may assign your rights under this Agreement to any party that consents to, and agrees to be bound by, its terms and conditions; Kumu may assign its rights under this Agreement without condition. This Agreement will be binding upon and will inure to the benefit of the parties, their successors and permitted assigns.

Terms of Service Changes

Although most changes are likely to be minor, Kumu may change its Terms of Service from time to time, and in Kumu’s sole discretion. Kumu encourages visitors to frequently check this page for any changes to its Terms of Service. Your continued use of this site after any change in this Terms of Service will constitute your acceptance of such change.

Last Updated: August 14, 2019

Questions?

If you have any questions about our Terms of Service, send us an email.

Note: This Terms of Service is available under a Creative Commons Sharealike license, which means you’re more than welcome to steal it and repurpose it for your own use, just make sure to replace references to us with ones to you.

\n
\n
\n )\n }\n}\n\nexport default Terms;\n","import React from 'react';\n\nclass GDPR extends React.Component {\n render() {\n return (\n
\n
\n \"System\n\n

GDPR Policy

\n\n

\n We offer a data processing addendum (DPA) for our customers who are\n working with data from people in the EU that is regulated by GDPR\n and does not fall under one of the specific processing exemptions.\n Our DPA offers contractual terms that satisfy GDPR requirements and\n reflect our data privacy and security commitments to our customers.\n Please email privacy@kumu.io to request our DPA.\n

\n\n

\n To guarantee no terms are imposed on us beyond what is reflected in\n our DPA and Terms of Service, we cannot agree to sign individual\n customers' DPAs. Doing so would require legal counsel and\n considerable back and forth discussion, which would be\n cost-prohibitive for our small team.\n

\n\n

\n For more information on our privacy practices, please consult our\n Privacy Policy.\n

\n\n

Subprocessors

\n\n

\n Kumu has authorized the subprocessors on this list to process\n personal data so we can provide the System Effects website and\n services. Prior to engaging with any subprocessor, Kumu performs due\n diligence to evaluate their privacy and security practices, and\n requires each to commit to written obligations regarding their\n security controls and obligations.\n

\n\n

\n Our business needs may change from time to time. We will periodically\n update this page to reflect additions and removals to our list of\n subprocessors.\n

\n\n \n\n

\n For more information on our privacy practices, please consult our\n Privacy Policy.\n

\n
\n
\n )\n }\n}\n\nexport default GDPR;\n","import React from 'react';\n\n// margin:auto container used to prevent top of content from being cutoff\n// when content is taller than viewport\nconst Centered = ({ children }) => {\n let style = {\n width: '100vw',\n height: '100vh',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center'\n }\n \n return (\n
\n
\n {children}\n
\n
\n )\n}\n\nexport default Centered;\n","import _ from \"lodash\";\nimport { SurveyData } from '../types';\nimport { uuid } from '../util';\n\n// TODO: Pobably want to translate server side instead but haven't found a\n// good solution yet. Maybe ActiveModel::Serializer or fast_jsonapi?\n// https://thecodeboss.dev/2017/02/building-a-json-api-with-rails-part-6-the-json-api-spec-pagination-and-versioning/\nconst rails = {\n survey: function(survey) {\n let { id, name, settings, created_at, updated_at } = survey;\n return {id, name, ...settings, created: created_at, updated: updated_at};\n },\n\n response: function(response) {\n return response;\n },\n\n masterValue: function(masterValue) {\n if (masterValue.hasOwnProperty('key')) {\n masterValue.id = masterValue.key;\n delete masterValue.key;\n }\n\n return masterValue;\n }\n}\n\nclass DB {\n token: string;\n\n constructor() {\n const config = {};\n this.token = '';\n }\n\n async get(path) {\n return this.fetch(path);\n }\n\n async create(path, data) {\n return this.fetch(path, {method: 'POST', data})\n }\n\n async update(path, data) {\n return this.fetch(path, {method: 'PATCH', data});\n }\n\n async destroy(path, data?) {\n return this.fetch(path, {method: 'DELETE', data});\n }\n\n // TODO: how do we handle invalid / expired tokens?\n async fetch(path, options: any = {}) {\n options.headers = options.headers || {};\n options.headers['Content-Type'] = 'application/json';\n\n if (this.token) {\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n\n if (options.data) {\n let { data } = options;\n options.body = JSON.stringify(data);\n delete options.data;\n }\n\n // TODO: how do we want to handle errors? response.ok response.status\n let response = await fetch(path, options);\n let json = await response.json();\n\n if (!response.ok) {\n throw json;\n }\n\n return json;\n }\n\n async authenticate(email: string, token?: string) {\n if (token) {\n let sessionData = await this.create('/api/sessions', {email, token});\n return sessionData;\n } else {\n return await this.create('/api/sessions', {email});\n }\n }\n\n // TODO: realtime support for survey CRUD ops?\n async getSurveys() {\n let surveys = await this.get('/api/surveys');\n surveys = surveys.map(survey => rails.survey(survey))\n return surveys;\n }\n\n async getSurvey(id) {\n let survey = await this.get(`api/surveys/${id}`);\n return rails.survey(survey);\n }\n\n async createSurvey(attrs) {\n let { name, ...settings } = attrs;\n let survey = await this.create('/api/surveys', {survey: { name, settings }});\n return rails.survey(survey);\n }\n\n // TODO: this no longer updates the local survey state since we don't have the firebase hooks\n async updateSurvey(id, attrs) {\n let { name, ...settings } = attrs;\n let survey = await this.update(`/api/surveys/${id}`, {survey: { name, settings }});\n return rails.survey(survey);\n }\n\n async deleteSurvey(id) {\n return await await this.destroy(`/api/surveys/${id}`);\n }\n\n async importResponse(surveyID) {}\n\n // TODO: separate from importResponse helper?\n async createResponse(surveyID, response) {\n let savedResponse = await this.create(`/api/surveys/${surveyID}/responses`, { response });\n return savedResponse;\n }\n\n async updateResponse(responseID, updates) {\n let savedResponse = await this.update(`/api/responses/${responseID}`, {response: updates});\n return savedResponse;\n }\n\n async fetchSurveyData(surveyID): Promise {\n let surveyData = await this.get(`/api/surveys/${surveyID}/data`);\n surveyData.responses = surveyData.responses.map(response => rails.response(response));\n surveyData.masterValues = surveyData.masterValues.map(master => rails.masterValue(master));\n return surveyData;\n }\n\n async createMasterValue(surveyID, id, value) {\n let masterValue = await this.create(`/api/surveys/${surveyID}/master_values`, {master_value: {key: id, value}});\n return rails.masterValue(masterValue);\n }\n\n async updateMasterValue(surveyID, id, attrs = {}) {\n let masterValue = await this.update(`/api/surveys/${surveyID}/master_values/${id}`, {master_value: attrs});\n return rails.masterValue(masterValue);\n }\n\n async deleteMasterValue(surveyID, id) {\n return await this.destroy(`/api/surveys/${surveyID}/master_values/${id}`);\n }\n\n async updateAlias(surveyID, value, masterID) {\n return await this.update(`/api/surveys/${surveyID}/alias`, {value, master: masterID});\n }\n\n async resetMasterValues(surveyID) {\n return await this.destroy(`/api/surveys/${surveyID}/data`);\n }\n\n async addAdmin(surveyID, email) {\n return await this.create(`/api/surveys/${surveyID}/admins`, { email });\n }\n\n async dropAdmin(surveyID, email) {\n return await this.destroy(`/api/surveys/${surveyID}/admins`, { email });\n }\n\n async updateCategories(categories) {\n console.log('TODO: set categories', categories);\n }\n\n async renameCategory(oldCategory, newCategory) {\n console.log('TODO: rename category', oldCategory, newCategory);\n }\n}\n\nfunction getTimestamp() {\n return new Date().toISOString()\n}\n\nconst instance = window[\"db\"] = new DB();\n\nexport default instance;\n","import railsDB from \"./rails\";\n\nexport default railsDB;\n","import React from 'react';\nimport { Form, Input, Button, message } from 'antd';\nimport Centered from '../survey/Centered';\nimport db from '../db';\nimport { AppState, Session } from '../types';\n\ntype Props = {\n onLogin: Function;\n}\n\ntype State = {\n email: string;\n}\n\nclass LoginScreen extends React.Component {\n emailRef: any;\n tokenRef: any;\n\n constructor(props) {\n super(props);\n\n this.emailRef = React.createRef();\n this.tokenRef = React.createRef();\n\n this.state = {email: null};\n }\n\n render() {\n let { email } = this.state;\n let form = email ? this.renderTokenForm() : this.renderEmailForm();\n\n return (\n
\n \n
\n

System Effects

\n {form}\n
\n
\n
\n )\n }\n\n renderEmailForm() {\n return (\n
\n \n \n \n\n {/*\n \n */}\n\n \n \n \n
\n )\n }\n\n renderTokenForm() {\n return (\n
\n

Please check your inbox for your sign-in code.

\n\n \n \n \n\n \n \n \n
\n )\n }\n\n handleSubmitEmail = async (event) => {\n event.preventDefault();\n\n let email = this.emailRef.current.value;\n\n try {\n this.setState({ email });\n await db.authenticate(email);\n } catch (error) {\n this.setState({ email: null });\n message.warning((error && error.error) || 'Unable to sign in. Please try again.');\n }\n }\n\n handleSubmitToken = async (event) => {\n event.preventDefault();\n\n let { email } = this.state;\n let token = this.tokenRef.current.value;\n\n try {\n let session: Session = await db.authenticate(email, token);\n this.props.onLogin(session);\n } catch (error) {\n message.warning((error && error.error) || 'Unable to sign in. Please try again.');\n }\n }\n}\n\nexport default LoginScreen;\n","import React from 'react';\nimport {\n Drawer, Form, Button, Col, Row, Input, Select, DatePicker, Icon,\n} from 'antd';\n\nconst { Option } = Select;\n\nclass SurveyForm extends React.Component {\n handleDismiss = () => {\n let { form, actions } = this.props;\n form.resetFields();\n this.props.dismiss();\n };\n\n handleError = (error) => {\n console.log(\"TODO: handle error\", error);\n }\n\n handleSubmit = (event) => {\n let { form, actions, survey, isNew } = this.props;\n\n event.preventDefault();\n\n form.validateFields(async (err, values) => {\n if (!err) {\n if (isNew) {\n actions.createSurvey(values).then(this.handleDismiss, this.handleError);\n } else {\n actions.updateSurvey(survey.id, values).then(this.handleDismiss, this.handleError);\n }\n }\n });\n }\n\n handleDelete = (event) => {\n let { actions, survey } = this.props;\n event.preventDefault();\n actions.deleteSurvey(survey.id).then(this.handleDismiss, this.handleError);\n }\n\n render() {\n const { visible, survey, isNew } = this.props;\n const { getFieldDecorator } = this.props.form;\n\n // TODO: handle defaults here instead of burying them within the form\n let values = survey || {};\n\n return (\n
\n \n
\n \n \n \n {getFieldDecorator('name', {\n initialValue: values.name,\n rules: [{ required: true, message: 'Please enter survey name' }],\n })()}\n \n \n \n \n \n \n {getFieldDecorator('focus', {\n initialValue: values.focus,\n rules: [{ required: true, message: 'Please enter survey focus' }],\n })()}\n \n \n \n \n {getFieldDecorator('direction', {\n initialValue: values.direction,\n rules: [{ required: true, message: 'Please select a direction' }],\n })(\n \n )}\n \n \n \n \n \n \n {getFieldDecorator('intro', {\n initialValue: values.intro,\n })()}\n \n \n \n \n \n \n {getFieldDecorator('intake', {\n initialValue: values.intake,\n })()}\n \n \n \n \n \n \n {getFieldDecorator('prompt1', {\n initialValue: values.prompt1,\n rules: [{ required: true, message: 'Please enter prompt' }],\n })()}\n \n \n \n \n \n \n {getFieldDecorator('prompt2', {\n initialValue: values.prompt2,\n rules: [{ required: true, message: 'Please enter prompt' }],\n })()}\n \n \n \n \n \n \n {getFieldDecorator('promptStory', {\n initialValue: values.promptStory,\n })()}\n \n \n \n \n \n \n {getFieldDecorator('thanks', {\n initialValue: values.thanks,\n })()}\n \n \n \n \n \n \n {getFieldDecorator('newsletter', {\n initialValue: values.showNewsletterForm,\n })()}\n \n \n \n
\n \n \n \n {!isNew &&\n \n }\n \n \n
\n \n \n
\n \n
\n
\n \n \n );\n }\n}\n\nexport default Form.create()(SurveyForm);\n","import './SurveyIndex.css';\n\nimport React from 'react';\nimport { Switch, Route, Link } from 'react-router-dom';\nimport { Drawer, Button, List, Menu, Dropdown, Icon, Spin, notification } from 'antd';\nimport { Actions, Helpers, Session, Survey } from '../types';\nimport SurveyForm from './SurveyForm';\n\ntype SurveyIndexProps = {\n actions: Actions;\n helpers: Helpers;\n session: Session;\n surveys: Survey[];\n}\n\nclass SurveyIndex extends React.Component {\n render() {\n let { actions, surveys, session } = this.props;\n\n const renderItem = (survey) => {\n const edit = () => actions.editSurvey(survey.id);\n\n // TODO: use history?\n let actionButtons = [\n \n \n \n \n {/*Foo*/}\n \n ]\n\n return (\n \n {survey.name}\n \n )\n }\n\n return (\n
\n
\n
\n

System Effects

\n\n {session.admin &&\n

\n \n

\n }\n\n {this.renderCurrentUserNav()}\n
\n\n
\n \n
\n\n \n \n
\n
\n )\n }\n\n renderCurrentUserNav() {\n let { session, actions } = this.props;\n\n const menu = (\n \n \n Sign out\n \n \n );\n\n return (\n
\n \n \n {session.email} \n \n \n
\n )\n }\n\n renderNewSurveyForm = ({ match, history }) => {\n let { actions } = this.props;\n const dismiss = () => history.replace('/admin');\n\n return ;\n }\n\n renderEditSurveyForm = ({ match, history }) => {\n let { actions, helpers, surveys } = this.props;\n let survey;\n\n if (match) {\n survey = helpers.getSurvey(Number(match.params.id));\n }\n\n const dismiss = () => history.replace('/admin');\n\n return ;\n }\n}\n\nexport default SurveyIndex;\n","import React from 'react';\n\nconst Logo = (props) => {\n let color = props.color || '#000';\n\n // style=\"fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;\">\n\n return (\n \n \n \n \n \n )\n}\n\nexport default Logo;\n","import React from 'react';\nimport { Dropdown, Menu, Tag } from 'antd';\n\nconst RawValue = ({ value, actions }) => {\n const menu = (\n \n actions.reviewValueReferences(value)}>Review references\n \n );\n\n return (\n
\n \n \n \n {value}\n \n \n \n
\n )\n}\n\nexport default RawValue;\n","import React from 'react';\nimport { Tag } from 'antd';\nimport { MasterValue, Actions } from '../types';\nimport RawValue from './RawValue';\n\nimport './RawValueList.css';\n\ntype Props = {\n master?: MasterValue;\n values: string[];\n actions: Actions;\n}\n\nclass RawValueList extends React.Component {\n // Once rendered all internal DOM edits handled by draggable\n shouldComponentUpdate() {\n return false;\n }\n\n render() {\n let { master, values } = this.props;\n let masterID = master && master.id;\n\n return (\n
\n
drop values here
\n {values && values.map(value => this.renderValue(value))}\n
\n )\n }\n\n renderValue(value) {\n let { actions } = this.props;\n return ;\n }\n}\n\nexport default RawValueList;\n","import React from 'react';\nimport { Row, Col, Input, Tag, Button, Icon } from 'antd';\nimport { AppState, Actions, MasterValue } from '../types';\nimport RawValueList from './RawValueList';\n\nimport './MasterValueListItem.css';\n\ntype Props = {\n app: AppState;\n code: any;\n master: MasterValue;\n aliases?: string[];\n readonly?: boolean;\n isNew?: boolean;\n}\n\nclass MasterValueListItem extends React.Component {\n // constructor() {\n // super();\n //\n // this.state = {\n // value: ''\n // }\n // }\n\n render() {\n let { app, readonly, code, master, aliases } = this.props;\n let { categories } = app.state.surveyData;\n let input;\n\n if (readonly) {\n input = ;\n } else {\n input = }\n defaultValue={master.value}\n placeholder='Enter master value'\n onBlur={this.handleValueChange}\n onPressEnter={this.handleValueChange}\n />\n }\n\n return (\n
  • \n \n \n {input}\n \n\n \n {this.renderCategorySelect()}\n\n
    \n \n
    \n \n
    \n
  • \n )\n }\n\n renderCategorySelect() {\n let { app, readonly, code, master, aliases } = this.props;\n let { categories } = app.state.surveyData;\n\n if (categories && categories.length > 0) {\n return (\n \n \n {categories.map(category => )}\n \n )\n } else {\n return null;\n }\n }\n\n handleValueChange = (event) => {\n let { app, master, isNew } = this.props;\n let { value } = event.target;\n\n value = value.trim();\n\n if (value) {\n if (isNew) {\n app.actions.createMasterValue(value);\n } else if (value !== master.value) {\n app.actions.updateMasterValue(master.id, { value });\n }\n } else {\n app.actions.deleteMasterValue(master.id);\n }\n }\n\n handleCategoryChange = (event) => {\n let { app, master } = this.props;\n let { value } = event.target;\n\n if (value !== master.category) {\n app.actions.updateMasterValue(master.id, { category: value });\n }\n }\n\n handleAutomatch = () => {\n let { app, master } = this.props;\n app.actions.automatch(master.id);\n }\n}\n\nexport default MasterValueListItem;\n","import mean from \"lodash/mean\";\nimport excelColumnName from \"excel-column-name\";\nimport papaparse from \"papaparse\";\nimport {\n Response,\n Survey,\n SurveyData,\n Edge,\n EdgeList,\n Matrix,\n Blueprint,\n Element,\n Connection,\n TranslationOptions,\n} from \"./types\";\n\nlet nextID = 1;\n\nexport function getUniqueValuesFromResponse(response) {\n return getUniqueValues({ response });\n}\nexport function getUniqueValues(state) {\n let { response } = state;\n let set = new Set();\n\n if (response.source === \"import\") {\n // focus isn't included\n response.data.matrix.labels.slice(1).forEach(value => set.add(value));\n } else {\n response.data.values.forEach((entry, i) => {\n if (entry.value) set.add(entry.value);\n\n entry.children.forEach((nestedEntry, j) => {\n if (entry.value) set.add(nestedEntry.value);\n });\n });\n }\n\n // TODO: sort alphabetically?\n let values = Array.from(set.values());\n\n // Remove empty values\n // TODO: handle this within the responses instead\n values = values.filter(value => /\\S/.test(value));\n\n return values;\n}\n\n// Goal is to get some variation in label widths/heights here in order\n// to prevent overlap\nexport function splitString(string) {\n let split1 = Math.round(string.length * 0.4);\n let split2 = string.substring(split1).indexOf(\" \");\n\n if (split2 === -1) {\n return [string];\n } else {\n let index = split1 + split2;\n let line1 = string.substring(0, index);\n let line2 = string.substring(index, string.length);\n return [line1, line2];\n }\n}\n\nexport function prepareResponse(state) {\n let { response } = state;\n\n response.data.values.forEach((entry, index) => {\n let { value, children } = entry;\n prepareList(children, { minLength: 2, plusOne: true });\n });\n\n prepareList(response.data.values, { minLength: 5, plusOne: true });\n}\n\nfunction prepareList(values, options: any = {}) {\n while (values.length < options.minLength) {\n values.push(createPlaceholder());\n }\n\n // always leave room for another response\n if (options.plusOne) {\n plusOne(values);\n }\n}\n\n// Used to always make sure there's room for another value\nfunction plusOne(values) {\n let last = values[values.length - 1];\n\n if (!last || last.value) {\n values.push(createPlaceholder());\n }\n}\n\nfunction createPlaceholder() {\n return { id: `v${nextID++}`, value: \"\", children: [] };\n}\n\n// TODO:\n// getGraphFromSurveyResponse -- easy to build out rings\n// getGraphFromMatrixResponse -- may have 3rd+ order nodes\nexport function getGraphFromResponse(survey: Survey, response: Response) {\n if (response.source === \"import\") {\n throw new Error(\n \"getGraphFromResponse not implemented for imported responses\"\n );\n } else {\n return getGraph({ survey, response });\n }\n}\n\n// TODO: clean entries before calling this (should also be responsible for trimming values)\nexport function getGraph(state) {\n let { survey } = state;\n let { focus, direction } = survey;\n let nodeIndex = {};\n\n let response = createCleanResponse(state.response);\n\n let graph = {\n direction: direction,\n getNode: identifier => nodeIndex[identifier],\n focusNode: null,\n innerNodes: [],\n outerNodes: [],\n nodes: [],\n edges: [],\n };\n\n function findOrCreateNode(id, label) {\n let node = graph.getNode(label);\n\n if (!node) {\n node = nodeIndex[label] = { id, label };\n graph.nodes.push(node);\n }\n\n // the same label might be referenced by multiple ids\n nodeIndex[id] = node;\n\n return node;\n }\n\n // Create a node for the focus\n let focusNode = findOrCreateNode(\"focus\", focus);\n focusNode.focus = true;\n\n // Create a node for every unique label\n // TODO: make this recursive\n response.data.values.forEach(entry => {\n let { id, value } = entry;\n\n let node = findOrCreateNode(id, value);\n node.inner = true;\n\n entry.children.forEach(entry => {\n let { id, value } = entry;\n\n findOrCreateNode(id, value);\n });\n });\n\n // Create edges between nodes\n // TODO: make this recursive\n response.data.values.forEach((targetEntry, i) => {\n let from = graph.getNode(targetEntry.id);\n let to = focusNode;\n\n graph.edges.push({ from, to });\n\n targetEntry.children.forEach((causeEntry, j) => {\n let from = graph.getNode(causeEntry.id);\n let to = graph.getNode(targetEntry.id);\n\n graph.edges.push({ from, to });\n });\n });\n\n // TODO: generalize this to degrees/rings instead of focus/inner/outer\n graph.focusNode = focusNode;\n graph.innerNodes = graph.nodes.filter(node => !node.focus && node.inner);\n graph.outerNodes = graph.nodes.filter(node => !node.focus && !node.inner);\n\n if (graph.direction === \"downstream\") {\n graph.edges = graph.edges.map(edge => {\n return { ...edge, from: edge.to, to: edge.from };\n });\n }\n\n // otherEdge is [fromID, toID]\n response.data.otherEdges.forEach(otherEdge => {\n let from = graph.getNode(otherEdge.from);\n let to = graph.getNode(otherEdge.to);\n\n if (from && to) graph.edges.push({ from, to });\n });\n\n // remove any self edges\n graph.edges = graph.edges.filter(edge => edge.from !== edge.to);\n\n // remove any duplicate edges\n graph.edges = Array.from(new Set(graph.edges));\n\n return graph;\n}\n\nexport function getOriginalMatrix(survey, response) {\n if (response.source === \"import\") {\n return response.data.matrix;\n } else {\n let graph = getGraphFromResponse(survey, response);\n return graphToAdjacencyMatrix(graph);\n }\n}\n\n// TODO: rename this to getMatrixFromState\nexport function getMatrix(state) {\n let graph = getGraph(state);\n return graphToAdjacencyMatrix(graph);\n}\n\nexport function getEdgeListFromResponse(survey, response): EdgeList {\n let matrix = getOriginalMatrix(survey, response);\n return getEdgeListFromMatrix(matrix);\n}\n\nexport function getEdgeListFromMatrix(matrix): EdgeList {\n let size = matrix.data.length;\n let edges: EdgeList = [];\n\n // if (matrix.labels.length != matrix.data.length) debugger;\n\n for (let row = 0; row < size; row++) {\n for (let col = 0; col < size; col++) {\n let weight = matrix.data[row][col];\n\n if (weight > 0) {\n let from = matrix.labels[row];\n let to = matrix.labels[col];\n\n if (!from || !to) {\n // TODO: this is a workaround for some busted imports where the\n // number of labels doesn't line up with the matrix data\n // debugger\n continue;\n }\n\n edges.push({ from, to, weight });\n }\n }\n }\n\n return edges;\n}\n\nexport function getMatrixDomain(matrix) {\n let min = Infinity;\n let max = -Infinity;\n\n matrix.data.forEach(row => {\n row.forEach(value => {\n min = Math.min(value, min);\n max = Math.max(value, max);\n });\n });\n\n return [min, max];\n}\n\n// assumes no orphaned nodes\nexport function getBlueprintFromMatrix(matrix: Matrix): Blueprint {\n let edges: EdgeList = getEdgeListFromMatrix(matrix);\n let indexByLabel = {};\n\n let elements = matrix.labels.map((label, index) => {\n let code = codeForIndex(index);\n indexByLabel[label] = index;\n return { label, code };\n });\n\n let connections = edges.map(edge => {\n let { from, to } = edge;\n let i = indexByLabel[from];\n let j = indexByLabel[to];\n let weight = matrix.data[i][j];\n\n return { from, to, weight };\n });\n\n return { elements, connections };\n}\n\n// TODO: option to include untranslated values?\nexport function translateMatrix(\n survey: Survey,\n surveyData: SurveyData,\n matrix: Matrix,\n translationOptions\n) {\n let edges = getEdgeListFromMatrix(matrix)\n .map(edge => translateEdge(survey, surveyData, edge, translationOptions))\n .filter(edge => edge.from && edge.to && edge.from !== edge.to);\n\n let usedLabels = new Set();\n edges.forEach(edge => {\n usedLabels.add(edge.from);\n usedLabels.add(edge.to);\n });\n\n // Use the master values to build the label array so the order is consistent\n let labels;\n\n if (translationOptions && translationOptions.categorize) {\n labels = [survey.focus, ...surveyData.categories];\n } else {\n labels = [\n survey.focus,\n ...surveyData.masterValues.map(master => master.value),\n ];\n }\n\n // omit labels that weren't used in this matrix (focus always included)\n labels = labels.filter(\n (label, index) => index === 0 || usedLabels.has(label)\n );\n\n let masterValueIndex = {};\n labels.forEach((value, index) => (masterValueIndex[value] = index));\n\n let data = createEmptyMatrix(labels.length);\n\n edges.forEach(edge => {\n let i = masterValueIndex[edge.from];\n let j = masterValueIndex[edge.to];\n\n data[i][j] = 1;\n });\n\n return { labels, data };\n //\n // // TODO: need to collapse rows/cols for duplicate aliases\n // // Easier to transform an edge list then convert to matrix?\n // let keep = {};\n //\n // let labels = matrix.labels\n // .map((value, index) => {\n // let master = getMasterValue(survey, surveyData, value);\n // keep[index] = !!master;\n // return master;\n // })\n // .filter((value, index) => keep[index]); // delete untranslated labels\n //\n // let data = matrix.data\n // .filter((row, index) => keep[index]) // delete untranslated rows\n // .map(row => row.filter((col, index) => keep[index])); // delete untranslated columns\n //\n // let translatedMatrix: Matrix = { labels, data };\n // return translatedMatrix;\n}\n\nexport function translateEdge(\n survey: Survey,\n surveyData: SurveyData,\n edge: Edge,\n translationOptions?: TranslationOptions\n): Edge {\n let translatedEdge = {\n // from/to may be undefined but invalid edges will be filtered out later\n from: translateValue(survey, surveyData, edge.from, translationOptions),\n to: translateValue(survey, surveyData, edge.to, translationOptions),\n weight: edge.weight,\n };\n\n return translatedEdge;\n}\n\nexport function translateValue(\n survey: Survey,\n surveyData: SurveyData,\n value: string,\n translationOptions?: TranslationOptions\n): string {\n let master = getMasterValueObject(survey, surveyData, value);\n\n if (master) {\n if (translationOptions && translationOptions.categorize) {\n return master.category;\n } else {\n return master.value;\n }\n } else {\n return undefined;\n }\n}\n\nexport function getMasterValue(\n survey: Survey,\n surveyData: SurveyData,\n value: string\n) {\n let master = getMasterValueObject(survey, surveyData, value);\n return master && master.value;\n}\n\nexport function getMasterCategory(\n survey: Survey,\n surveyData: SurveyData,\n value: string\n) {\n let master = getMasterValueObject(survey, surveyData, value);\n return master && master.category;\n}\n\nexport function getMasterValueObject(\n survey: Survey,\n surveyData: SurveyData,\n value: string\n) {\n let { masterValues, aliasTable } = surveyData;\n\n if (value === survey.focus) {\n // TODO: still not sure what to return here\n return { focus: true, value, category: value };\n } else {\n // master may have been deleted after aliasing\n let masterID = aliasTable[value];\n return masterValues.find(\n master => (masterID && master.id === masterID) || master.value === value\n );\n }\n}\n\n// TODO: option to include values that haven't been translated\nexport function translatedMatrixToMasterMatrix(\n survey: Survey,\n surveyData: SurveyData,\n translatedMatrix: Matrix,\n translationOptions?: TranslationOptions\n): Matrix {\n let labels = getMasterMatrixLabels(survey, surveyData, translationOptions);\n let data = createEmptyMatrix(labels.length);\n\n let masterIndex = {};\n labels.forEach((label, index) => (masterIndex[label] = index));\n\n getEdgeListFromMatrix(translatedMatrix).forEach(edge => {\n let i = masterIndex[edge.from];\n let j = masterIndex[edge.to];\n\n data[i][j] = 1;\n });\n\n return { labels, data };\n}\n\nexport function getMasterMatrixLabels(\n survey: Survey,\n surveyData: SurveyData,\n translationOptions?: TranslationOptions\n) {\n let labels;\n\n if (translationOptions && translationOptions.categorize) {\n let { categories } = surveyData;\n labels = [survey.focus, ...categories];\n } else {\n let values = surveyData.masterValues.map(master => master.value);\n labels = [survey.focus, ...values];\n }\n\n return labels;\n}\n\nexport function getResponseTranslationStats(\n survey: Survey,\n surveyData: SurveyData,\n response: Response\n) {\n let values = getUniqueValuesFromResponse(response);\n let remaining = 0;\n\n let mappings = values.map(value => {\n // TODO: need to be able to differentiate untranslated from ignored\n let masterValue = getMasterValue(survey, surveyData, value);\n\n if (!masterValue) {\n remaining += 1;\n masterValue = \"\";\n }\n\n return [value, masterValue];\n });\n\n let matrix = getTranslatedMatrixFromResponse(survey, surveyData, response);\n let edges = getEdgeListFromMatrix(matrix);\n\n return { remaining, mappings, edges };\n}\n\nexport function getMasterMatrixFromResponse(\n survey: Survey,\n surveyData: SurveyData,\n response: Response,\n translationOptions?: TranslationOptions\n): Matrix {\n let originalMatrix = getOriginalMatrix(survey, response);\n let translatedMatrix = translateMatrix(\n survey,\n surveyData,\n originalMatrix,\n translationOptions\n );\n\n return translatedMatrixToMasterMatrix(\n survey,\n surveyData,\n translatedMatrix,\n translationOptions\n );\n}\n\nexport function getTranslatedMatrixFromResponse(\n survey: Survey,\n surveyData: SurveyData,\n response: Response,\n translationOptions?: TranslationOptions\n): Matrix {\n let originalMatrix = getOriginalMatrix(survey, response);\n let translatedMatrix = translateMatrix(\n survey,\n surveyData,\n originalMatrix,\n translationOptions\n );\n return translatedMatrix;\n}\n\nexport function codeForIndex(i) {\n return excelColumnName.intToExcelCol(i + 1).toLowerCase();\n}\n\nexport function matrixToCSV(matrix) {\n let { labels, data } = matrix;\n let rows = [];\n\n // codes first then labels\n rows.push([\"\", \"\", ...labels.map((v, i) => codeForIndex(i))]);\n rows.push([\"\", \"\", ...labels]);\n\n for (var i = 0; i < data.length; i++) {\n rows.push([codeForIndex(i), labels[i], ...data[i]]);\n }\n\n return papaparse.unparse(rows);\n}\n\nexport function graphToAdjacencyMatrix(graph) {\n let labels = graph.nodes.map(node => node.label);\n let data = createEmptyMatrix(labels.length);\n\n let indexByLabel = {};\n labels.forEach((label, index) => (indexByLabel[label] = index));\n\n graph.edges.forEach(edge => {\n let i = indexByLabel[edge.from.label];\n let j = indexByLabel[edge.to.label];\n\n data[i][j] = 1;\n });\n\n return { labels, data };\n}\n\nexport function createEmptyMatrix(size) {\n let data = new Array(size);\n\n for (let i = 0; i < size; i++) {\n data[i] = new Array(size);\n\n for (let j = 0; j < size; j++) {\n data[i][j] = 0;\n }\n }\n\n return data;\n}\n\nexport function getAggregateMatrix(survey, surveyData, filter?: RegExp) {\n let masterMatrix;\n let size;\n\n let responses = filterResponses(surveyData.responses, filter);\n\n responses.forEach(response => {\n let matrix = getMasterMatrixFromResponse(survey, surveyData, response);\n\n if (masterMatrix) {\n for (let i = 0; i < size; i++) {\n for (let j = 0; j < size; j++) {\n masterMatrix.data[i][j] += matrix.data[i][j];\n }\n }\n } else {\n masterMatrix = matrix;\n size = matrix.labels.length;\n }\n });\n\n // handle the case when all responses have been filtered\n // TODO: grab labels from master values instead of first response\n if (!masterMatrix && surveyData.responses.length > 0) {\n let matrix = getMasterMatrixFromResponse(\n survey,\n surveyData,\n surveyData.responses[0]\n );\n masterMatrix = {\n labels: matrix.labels,\n data: createEmptyMatrix(matrix.labels.length),\n };\n }\n\n return masterMatrix;\n}\n\nexport function getAggregateMatrixFromResponses(\n survey: Survey,\n surveyData: SurveyData,\n responses: Response[],\n translationOptions?: TranslationOptions\n) {\n let masterMatrix;\n let size;\n\n responses.forEach(response => {\n let matrix = getMasterMatrixFromResponse(\n survey,\n surveyData,\n response,\n translationOptions\n );\n\n if (masterMatrix) {\n for (let i = 0; i < size; i++) {\n for (let j = 0; j < size; j++) {\n masterMatrix.data[i][j] += matrix.data[i][j];\n }\n }\n } else {\n masterMatrix = matrix;\n size = matrix.labels.length;\n }\n });\n\n return masterMatrix;\n}\n\nexport function getMatchingResponses(surveyData, filter) {\n return filterResponses(surveyData.responses, filter);\n}\n\nexport function filterResponses(responses, filter) {\n return responses.filter(response => !filter || filter.test(response.tags));\n}\n\nexport function createCleanResponse(rawResponse) {\n let response = JSON.parse(JSON.stringify(rawResponse)); // deep clone\n\n response.data.values = response.data.values.filter(entry => entry.value);\n response.data.values.forEach(entry => {\n entry.children = entry.children.filter(entry => entry.value);\n });\n\n // TODO: remove orphaned edges?\n // response.data.otherEdges.filter(...)\n\n return response;\n}\n\nexport function getSurveyStats(survey, surveyData) {\n function getNodeCount(matrix) {\n return matrix.labels.length;\n }\n\n function getEdgeCount(matrix) {\n let n = matrix.data.length;\n let total = 0;\n\n for (var i = 0; i < n; i++) {\n for (var j = 0; j < n; j++) {\n if (matrix.data[i][j] === 1) total++;\n }\n }\n\n return total;\n }\n\n // directed: (2 * E) / (V * (V - 1))\n // undirected: E / (V * (V - 1))\n function getDensity(matrix) {\n let V = getNodeCount(matrix);\n let E = getEdgeCount(matrix);\n return (2 * E) / (V * (V - 1));\n }\n\n // ------------------\n\n let values = {\n nodeReduction: [],\n edgeReduction: [],\n densityIncrease: [],\n };\n\n surveyData.responses.forEach(response => {\n if (response.ignored) return;\n\n // Ended up being easier to work with the matrices instead of trying to\n // build a translated graph\n let original = getOriginalMatrix(survey, response);\n let translationOptions: TranslationOptions = { categorize: false };\n let translated = translateMatrix(\n survey,\n surveyData,\n original,\n translationOptions\n );\n\n // change in node / edge counts\n values.nodeReduction.push(\n getNodeCount(original) - getNodeCount(translated)\n );\n values.edgeReduction.push(\n getEdgeCount(original) - getEdgeCount(translated)\n );\n\n // change in density\n values.densityIncrease.push(\n (getDensity(translated) - getDensity(original)) / getDensity(original)\n );\n\n // TODO: change in average path length\n });\n\n return {\n averageNodeReduction: mean(values.nodeReduction),\n averageEdgeReduction: mean(values.edgeReduction),\n averageDensityIncrease: mean(values.densityIncrease),\n averagePathLengthReduction: NaN,\n };\n}\n\nexport function importCSV(string) {\n // TODO: use papaparse and pass data to importMatrix\n}\n\n// export function importMatrix(data) {\n// let response = {values: [], otherEdges: []};\n// let header = data[0];\n// let focus = header[0];\n//\n// // collect all the edges\n// // build explore array starting with focus\n// //\n// // start with focus\n// // find every node connected to focus and add to values list (1s in first column)\n// // for each node, find every node connected to node and add to children (repeat)\n// //\n// // for every edge:\n// // if TO degree is less than FROM degree, add as a child\n// // otherwise add as other edge {from: id, to: id}\n// let nodes = [];\n//\n// for (let row = 1; row < data.length; row++) {\n// let node = {value: data[row][0], edges: []};\n//\n// for (let col = 1; col < data[row].length; col++) {\n// if (data[row][col] === 1) {\n// node.edges.push(header[col]);\n// }\n// }\n//\n// nodes.push(node);\n// }\n//\n// // build values/otherEdges from tree and map\n//\n// let focusNode = nodes[0];\n//\n// focusNode.edges.forEach(toNode => {\n//\n// })\n//\n// // start with focus\n// let explore = [{value: focus, depth: 0}];\n// let explored = new Set();\n//\n// let children = {};\n// let depths = {};\n//\n// while (explore.length) {\n// let { depth, value } = explore.shift();\n//\n// edges.forEach(edge => {\n// if (edge.to === value) {\n// if (children[value]) {\n// children[value].push(edge.from);\n// depths[value] = Math.min(depths[value], depth);\n// } else {\n// children[value] = [edge.from];\n// depths[value] = depth;\n// }\n//\n// if (!explored.has(edge.from)) {\n// explore.push({value: edge.from, depth: depth + 1});\n// }\n// }\n// })\n// }\n//\n// return response;\n// }\n\nconst UUID_CHARS = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\".split(\n \"\"\n);\n\nexport function uuid(length = 8, radix = 62) {\n let id = \"\";\n\n for (let i = 0; i < length; i++) {\n id += UUID_CHARS[0 | (Math.random() * radix)];\n }\n\n return id;\n}\n","const Sounds = {\n // https://shopify.github.io/draggable/\n // https://shopify.github.io/draggable/assets/js/app.js\n up: new Audio('https://shopify.github.io/draggable/assets/audio/animation-up-2.mp3'),\n down: new Audio('https://shopify.github.io/draggable/assets/audio/animation-down-2.mp3'),\n}\n\nconst play = (sound) => {\n let audio = Sounds[sound];\n audio.currentTime = 0;\n audio.play();\n}\n\nexport const playDragSound = () => play('up');\nexport const playDropSound = () => play('down');\n","import debounce from \"lodash/debounce\";\nimport React from \"react\";\nimport { Row, Col, Tag, Icon, Input, Statistic, Button } from \"antd\";\nimport { Sortable, Draggable } from \"@shopify/draggable\";\nimport MasterValueListItem from \"./MasterValueListItem\";\nimport RawValueList from \"./RawValueList\";\nimport db from \"../db\";\nimport { AppState } from \"../types\";\nimport { uuid, getUniqueValuesFromResponse, getSurveyStats } from \"../util\";\nimport { playDragSound, playDropSound } from \"./helpers/sounds\";\nimport \"./MappingsEditor.css\";\n\nfunction getNextMasterValueCode(state) {\n return state.masterValues.length + 1;\n}\n\ntype MappingsEditorProps = {\n app: AppState;\n};\n\ntype MappingsEditorState = {\n mappedValues: string[];\n unmappedFilter: string;\n unmappedValues: string[];\n ignoredValues: string[];\n stats?: {\n averageNodeReduction: number;\n averageEdgeReduction: number;\n averageDensityIncrease: number;\n };\n};\n\nclass MappingsEditor extends React.Component<\n MappingsEditorProps,\n MappingsEditorState\n> {\n unmappedFilterRef: any;\n draggable: any;\n\n constructor(props) {\n super(props);\n\n this.unmappedFilterRef = React.createRef();\n this.handleUnmappedFilterChange = debounce(\n this.handleUnmappedFilterChange,\n 500\n );\n\n this.state = {\n mappedValues: [],\n unmappedFilter: \"\",\n unmappedValues: [],\n ignoredValues: [],\n };\n }\n\n componentWillMount() {\n this.refresh(this.props);\n }\n\n componentDidMount() {\n this.initializeDraggables();\n }\n\n componentDidUpdate() {\n this.initializeDraggables();\n }\n\n componentWillReceiveProps(nextProps) {\n this.refresh(nextProps);\n }\n\n render() {\n let { app } = this.props;\n let { survey, nextMasterValueID } = app.state;\n let {\n mappedValues,\n unmappedFilter,\n unmappedValues,\n ignoredValues,\n stats,\n } = this.state;\n let nextCode = mappedValues.length + 2;\n let focusMaster = { id: \"focus\", value: survey.focus };\n let nextMaster = { id: nextMasterValueID, value: \"\" };\n let ignoreMaster = { id: \"ignore\", value: \"Ignored values\" };\n\n return (\n
    \n
    \n
    \n \n \n \n
    \n\n
      \n \n {mappedValues.map(mappedValue =>\n this.renderMappedValue(mappedValue)\n )}\n \n }\n master={ignoreMaster}\n aliases={ignoredValues}\n readonly\n />\n
    \n
    \n\n
    \n
    \n {/**/}\n \n
    \n
    \n
    \n );\n }\n\n renderMappedValue(mappedValue) {\n let { app } = this.props;\n let { master } = mappedValue;\n\n return ;\n }\n\n handleUnmappedFilterChange = event => {\n let unmappedFilter = this.unmappedFilterRef.current.value;\n this.setState({ unmappedFilter });\n };\n\n refresh(props) {\n let { app } = props || this.props;\n let { survey, surveyData } = app.state;\n let { masterValues, aliasTable, responses } = surveyData;\n let unmappedValues = new Set();\n let aliasesByID = {};\n\n // aliasesByID[null] = new Set();\n aliasesByID[\"ignore\"] = new Set();\n masterValues.forEach(master => (aliasesByID[master.id] = new Set()));\n\n responses.forEach(response => {\n if (response.ignored) return;\n\n let values = getUniqueValuesFromResponse(response);\n values.forEach(value => {\n let id = aliasTable[value];\n\n if (id) {\n // already mapped\n } else {\n unmappedValues.add(value);\n }\n });\n });\n\n Object.keys(aliasTable).forEach(rawValue => {\n let id = aliasTable[rawValue];\n let set = aliasesByID[id];\n\n if (set) {\n set.add(rawValue);\n } else {\n unmappedValues.add(rawValue); // master value no longer exists\n }\n });\n\n let mappedValues = masterValues.map((master, index) => {\n let code = index + 2;\n let aliases = Array.from(aliasesByID[master.id]);\n return { code, master, aliases };\n });\n\n this.setState({\n mappedValues,\n unmappedValues: Array.from(unmappedValues),\n ignoredValues: Array.from(aliasesByID[\"ignore\"]),\n stats: getSurveyStats(survey, surveyData),\n });\n }\n\n initializeDraggables() {\n let { app } = this.props;\n\n if (this.draggable) this.draggable.destroy();\n\n const containers = document.querySelectorAll(\".drop-target\");\n const draggable = (this.draggable = new Sortable(containers, {\n delay: 0,\n draggable: \".drag-target\",\n droppable: \".drop-target\",\n scrollable: {\n speed: 6,\n sensitivity: 12,\n },\n }));\n\n // Events\n // https://github.com/Shopify/draggable/tree/master/src/Draggable#events\n draggable.on(\"drag:start\", () => {\n playDragSound();\n });\n\n draggable.on(\"drag:stop\", event => {\n let { source, sourceContainer, currentOverContainer } = draggable;\n let value = source.getAttribute(\"data-value\");\n let id = currentOverContainer.getAttribute(\"data-id\");\n\n app.actions.move(value, id);\n\n playDropSound();\n });\n\n // draggable.on('drag:over:container', () => {\n // Sounds.down.play();\n // })\n }\n}\n\nexport default MappingsEditor;\n","import debounce from 'lodash/debounce';\nimport React from 'react';\n\ntype Props = {\n onChange: Function;\n}\n\nclass FilterInput extends React.Component {\n input: any;\n\n constructor(props) {\n super(props);\n\n this.input = React.createRef();\n this.handleFilterChange = debounce(this.handleFilterChange, 500);\n }\n\n render() {\n return (\n \n )\n }\n\n handleFilterChange = () => {\n let filter;\n let rawFilter = this.input.current.value;\n\n if (rawFilter) {\n try {\n filter = new RegExp(rawFilter);\n } catch (error) {} // ignore invalid expression errors, likely not done typing\n } else {\n filter = new RegExp(\".*\");\n }\n\n // onChange callback only fires if filter can be parsed\n if (filter) {\n this.props.onChange(filter);\n }\n }\n}\n\nexport default FilterInput;\n","import chroma from \"chroma-js\";\nimport React from \"react\";\nimport { Radio, Tooltip } from \"antd\";\nimport { Matrix } from \"../types\";\nimport { getMatrixDomain } from \"../util\";\nimport \"./AdjacencyMatrix.css\";\n\ntype AdjacencyMatrixProps = {\n matrix: Matrix;\n isMaster?: boolean;\n};\n\nclass AdjacencyMatrix extends React.Component {\n render() {\n let { matrix, isMaster } = this.props;\n let { labels, data } = matrix;\n\n let domain = getMatrixDomain(matrix);\n let scale = chroma.scale(\"Viridis\").domain(domain);\n\n let headerLabels = labels.map(label => {\n let truncatedLabel =\n label.length > 14 ? `${label.substring(0, 14)}...` : label;\n\n return (\n \n {truncatedLabel}\n \n );\n });\n\n let rows = data.map((row, i) => {\n let fromLabel = labels[i];\n\n let cells = row.map((value, j) => {\n let toLabel = labels[j];\n let checked = value > 0;\n let title = checked\n ? `${fromLabel} --> ${toLabel}`\n : `No connection from \"${fromLabel}\" to \"${toLabel}\"`;\n let style;\n\n if (isMaster) {\n let backgroundColor = scale(value);\n let color = backgroundColor.luminance() >= 0.5 ? \"#000\" : \"#fff\";\n let opacity = 0.9;\n\n style = { color, backgroundColor, opacity };\n }\n\n return (\n \n \n {isMaster ? value || \"\" : }\n \n \n );\n });\n\n return (\n \n \n {fromLabel}\n \n {cells}\n \n );\n });\n\n return (\n \n \n \n \n {headerLabels}\n \n \n {rows}\n
    \n );\n }\n}\n\nexport default AdjacencyMatrix;\n","import './MasterMatrix.css';\n\nimport download from 'downloadjs';\nimport React from 'react';\nimport { Button } from 'antd';\nimport { AppState, Response, TranslationOptions } from '../types';\nimport FilterInput from './FilterInput';\nimport AdjacencyMatrix from './AdjacencyMatrix';\nimport { getAggregateMatrixFromResponses, filterResponses, matrixToCSV, getBlueprintFromMatrix } from '../util';\n\ntype Props = {\n app: AppState;\n}\n\ntype State = {\n responses: Response[];\n categorize: boolean;\n}\n\nclass MasterMatrix extends React.Component {\n state = {responses: [], categorize: false}\n\n componentWillMount() {\n this.updateFilter(null);\n }\n\n getMatrix() {\n let { app } = this.props;\n let { survey, surveyData } = app.state;\n let { responses, categorize } = this.state;\n let translationOptions: TranslationOptions = { categorize };\n let matrix = getAggregateMatrixFromResponses(survey, surveyData, responses, translationOptions);\n\n return matrix;\n }\n\n render() {\n let { app } = this.props;\n let { categoriesEnabled } = app.state;\n let { responses } = this.state;\n\n return (\n
    \n
    \n \n\n {categoriesEnabled &&\n
    \n this.setState({categorize: false})} defaultChecked /> Uncategorized{' '}\n this.setState({categorize: true})} /> Categorized\n
    \n }\n
    \n\n {responses.length === 0 ? this.renderEmpty() : this.renderMatrix()}\n
    \n )\n }\n\n renderEmpty() {\n return

    No responses found

    ;\n }\n\n renderMatrix() {\n let matrix = this.getMatrix();\n\n return (\n
    \n \n\n

    \n \n \n \n \n

    \n
    \n )\n }\n\n updateFilter(filter) {\n let { app } = this.props;\n let { surveyData } = app.state;\n let responses = filterResponses(surveyData.responses, filter);\n\n this.setState({ responses });\n }\n\n handleDownloadMatrix = () => {\n let { survey } = this.props.app.state;\n let csv = matrixToCSV(this.getMatrix());\n download(csv, `${survey.name}.csv`, 'text/csv');\n }\n\n handleDownloadBlueprint = () => {\n let { survey } = this.props.app.state;\n let blueprint = getBlueprintFromMatrix(this.getMatrix());\n let json = JSON.stringify(blueprint, null, ' ');\n download(json, `${survey.name}.json`, '\tapplication/json');\n }\n\n handleFilterChange = (filter) => {\n this.updateFilter(filter);\n }\n}\n\nexport default MasterMatrix;\n","import sortBy from 'lodash/sortBy';\nimport graphology from 'graphology';\nimport pagerank from 'graphology-pagerank';\nimport { Matrix } from '../../types';\nimport { getEdgeListFromMatrix } from '../../util';\n\nexport function calculateMetrics(matrix: Matrix) {\n let list = [];\n let pageranks = calculatePagerank(matrix);\n\n matrix.labels.forEach((label, index) => {\n // ignore focus\n if (index === 0) return;\n\n let metrics = {\n orphan: false,\n degree: 0,\n indegree: calculateIndegree(matrix, index),\n outdegree: calculateOutdegree(matrix, index),\n pagerank: pageranks[label]\n }\n\n metrics.degree = metrics.indegree + metrics.outdegree;\n metrics.orphan = metrics.degree === 0;\n\n // omit irrelevant factors (has to be done here otherwise the orphans\n // will throw off the ranks below)\n if (metrics.orphan) return;\n\n list.push({ label, ...metrics });\n })\n\n assignRank(list, \"indegree\");\n assignRank(list, \"outdegree\");\n assignRank(list, \"pagerank\");\n\n return list;\n}\n\n// indegree sum of column\nfunction calculateIndegree(matrix, index) {\n let indegree = 0;\n\n for (let i = 0; i < matrix.labels.length; i++) {\n indegree += matrix.data[i][index]\n }\n\n return indegree;\n}\n\n// outdegree sum of row\nfunction calculateOutdegree(matrix, index) {\n let outdegree = 0;\n\n for (let j = 0; j < matrix.labels.length; j++) {\n outdegree += matrix.data[index][j]\n }\n\n return outdegree;\n}\n\n// look into transition matrix\n// http://www.ccs.neu.edu/home/daikeshi/notes/PageRank.pdf\nfunction calculatePagerank(matrix) {\n let edges = getEdgeListFromMatrix(matrix);\n let graph = new graphology.DirectedGraph();\n\n edges.forEach(({ from, to, weight }) => {\n graph.mergeEdge(from, to, { weight });\n })\n\n return pagerank(graph, {weighted: true});\n}\n\nfunction assignRank(list, metric) {\n sortBy(list.slice(), d => d[metric]).forEach((d, i) => d[`${metric} rank`] = i);\n}\n","import './AnalyticsView.css';\n\nimport $ from 'jquery';\nimport React from 'react';\nimport { AppState, Response } from '../types';\nimport FilterInput from './FilterInput';\nimport createScatterPlot from './dataviz/createScatterPlot';\nimport { filterResponses } from '../util';\n\ntype Props = {\n app: AppState;\n}\n\ntype State = {\n responses: Response[];\n}\n\nclass AnalyticsView extends React.Component {\n constructor(props) {\n super(props);\n this.state = {responses: []};\n }\n\n componentWillMount() {\n this.updateFilter(null);\n }\n\n componentDidMount() {\n this.refreshDataviz();\n }\n\n componentDidUpdate() {\n this.refreshDataviz();\n }\n\n render() {\n let { responses } = this.state;\n\n return (\n
    \n
    \n \n
    \n\n {responses.length === 0 ? this.renderEmpty() : this.renderDataviz()}\n
    \n )\n }\n\n renderEmpty() {\n return

    No responses found

    ;\n }\n\n renderDataviz() {\n return (\n
    \n
    \n
    \n )\n }\n\n refreshDataviz() {\n let { app } = this.props;\n let { responses } = this.state;\n\n if (responses.length === 0) return;\n\n createScatterPlot(app, responses, '#scatter');\n }\n\n updateFilter(filter) {\n let { app } = this.props;\n let { surveyData } = app.state;\n let responses = filterResponses(surveyData.responses, filter);\n\n this.setState({ responses });\n }\n\n handleFilterChange = (filter) => {\n this.updateFilter(filter);\n }\n}\n\nexport default AnalyticsView;\n","import $ from \"jquery\";\nimport _ from \"lodash\";\nimport { AppState, TranslationOptions } from \"../../types\";\nimport { getAggregateMatrixFromResponses } from \"../../util\";\nimport { calculateMetrics } from \"../helpers/metrics\";\n\nexport default function createScatterPlot(\n app: AppState,\n responses,\n containerSelector\n) {\n const state = {\n categorize: false,\n ranked: false,\n x: \"outdegree\",\n y: \"indegree\",\n r: \"pagerank\",\n c: \"pagerank\",\n };\n\n render();\n\n function render() {\n let { survey, surveyData } = app.state;\n let translationOptions: TranslationOptions = {\n categorize: state.categorize,\n };\n let matrix = getAggregateMatrixFromResponses(\n survey,\n surveyData,\n responses,\n translationOptions\n );\n let data = calculateMetrics(matrix);\n\n const rawX = d => d[state.x];\n const rawY = d => d[state.y];\n const rawRadius = d => d[state.r];\n const rawColor = d => d[state.c];\n\n const d3 = window[\"d3\"];\n const $el = $(containerSelector);\n\n // reset the dataviz\n $el.empty();\n\n $el.on(\"mousemove\", event => {\n let $target = $(event.target);\n\n if ($target.is(\".dot-circle\")) {\n let index = $target.index() + 1; // nth-child is 1-based\n $(\".dot-circle, .dot-label-group\").attr(\"data-layer\", \"background\");\n $(\n `.dot-circle:nth-child(${index}), .dot-label-group:nth-child(${index})`\n ).attr(\"data-layer\", \"foreground\");\n } else {\n $(\".dot-circle, .dot-label-group\").attr(\"data-layer\", \"foreground\");\n }\n });\n\n $el.append(`\n
    \n
    \n \n \n
    \n
    \n \n \n
    \n
    \n `);\n\n if (!app.state.categoriesEnabled) {\n $el.find(\".categorize-toggle-group\").hide();\n }\n\n $el.find(\"[name=categorizeToggle]\").change(event => {\n state.categorize = (event.target as HTMLInputElement).value === \"1\";\n render();\n });\n\n $el.find(\"[name=modeToggle]\").change(event => {\n state.ranked = (event.target as HTMLInputElement).value === \"ranked\";\n refresh();\n });\n\n // set the dimensions and margins of the graph\n let margin = { top: 50, right: 300, bottom: 80, left: 60 };\n let width = $el.width() - margin.left - margin.right;\n let height = $el.height() - margin.top - margin.bottom;\n\n // append the svg object to the body of the page\n let svg = d3\n .select(containerSelector)\n .append(\"svg\")\n .attr(\"class\", \"scatter-plot\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", `translate(${margin.left}, ${margin.top})`);\n\n // Add X axis\n let x = d3\n .scaleLinear()\n .domain([0, d3.max(data, rawX)])\n .range([0, width]);\n svg\n .append(\"g\")\n .attr(\"class\", \"x-axis-group\")\n .attr(\"transform\", `translate(0, ${height})`)\n .call(d3.axisBottom(x));\n svg\n .append(\"text\")\n .attr(\"class\", \"x-axis-label\")\n .attr(\"transform\", `translate(${width / 2}, ${height + 35})`)\n .style(\"text-anchor\", \"middle\")\n .text(state.x);\n\n // Add Y axis\n let y = d3\n .scaleLinear()\n .domain([0, d3.max(data, rawY)])\n .range([height, 0]);\n svg\n .append(\"g\")\n .attr(\"class\", \"y-axis-group\")\n .call(d3.axisLeft(y));\n svg\n .append(\"text\")\n .attr(\"class\", \"y-axis-label\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", -35)\n .attr(\"x\", 0 - height / 2)\n // .attr(\"dy\", \"1em\")\n .style(\"text-anchor\", \"middle\")\n .text(state.y);\n\n // Add color legend\n let legendSvg = svg\n .append(\"g\")\n // .attr('width', 20)\n // .attr('height', height)\n .attr(\"transform\", `translate(${width + margin.right / 2}, 0)`);\n\n let legendAxisScale = d3\n .scaleLinear()\n .domain([0, d3.max(data, rawColor)])\n .range([height, 0]);\n legendSvg\n .append(\"g\")\n .attr(\"class\", \"color-axis-group\")\n .call(d3.axisLeft(legendAxisScale));\n legendSvg\n .append(\"text\")\n .attr(\"class\", \"color-axis-label\")\n .attr(\"transform\", \"rotate(90)\")\n .attr(\"y\", -30)\n .attr(\"x\", height / 2)\n .style(\"text-anchor\", \"middle\")\n .text(state.c);\n\n let legendGradient = legendSvg\n .append(\"defs\")\n .append(\"linearGradient\")\n .attr(\"id\", \"gradient\")\n .attr(\"x1\", \"0%\") // bottom\n .attr(\"y1\", \"100%\")\n .attr(\"x2\", \"0%\") // to top\n .attr(\"y2\", \"0%\")\n .attr(\"spreadMethod\", \"pad\");\n\n let legendColorScale = d3\n .scaleSequential(d3.interpolateViridis)\n .domain([0, 1]);\n for (let i = 0; i < 1; i += 0.1) {\n legendGradient\n .append(\"stop\")\n .attr(\"offset\", i)\n .attr(\"stop-color\", legendColorScale(i))\n .attr(\"stop-opacity\", 1);\n }\n\n legendSvg\n .append(\"rect\")\n .attr(\"x1\", 0)\n .attr(\"y1\", 0)\n .attr(\"width\", 20)\n .attr(\"height\", height)\n .style(\"fill\", \"url(#gradient)\");\n\n let r = d3\n .scaleLinear()\n .domain([0, d3.max(data, rawRadius)])\n .range([10, 30]);\n\n let colorScale = d3\n .scaleSequential(d3.interpolateViridis)\n .domain([0, d3.max(data, rawColor)]);\n\n // Add dots\n svg\n .append(\"g\")\n .selectAll(\".dot-circle\")\n .data(data)\n .enter()\n .append(\"circle\")\n .attr(\"class\", \"dot-circle\")\n .attr(\"cx\", d => x(rawX(d)))\n .attr(\"cy\", d => y(rawY(d)))\n .attr(\"r\", d => r(rawRadius(d)))\n .style(\"fill\", d => colorScale(rawColor(d)))\n .style(\"opacity\", d => 1)\n .style(\"stroke\", \"white\")\n .style(\"stroke-width\", 1);\n // .on(\"mouseover\", () => console.log(\"mouseover\"))\n // .on(\"mousemove\", mousemove)\n // .on(\"mouseleave\", mouseleave)\n\n // Add labels\n let labelsGroup = svg.append(\"g\");\n let labelGroup = labelsGroup\n .selectAll(\".dot-label-group\")\n .data(data)\n .enter()\n .append(\"g\")\n .attr(\"class\", \"dot-label-group\")\n .attr(\"transform\", d => `translate(${x(rawX(d))}, ${y(rawY(d))})`);\n\n labelGroup\n .append(\"text\")\n .text(d => d.label)\n .style(\"fill\", \"#fff\")\n .style(\"stroke\", \"#fff\")\n .style(\"stroke-opacity\", 0.5)\n .style(\"stroke-width\", 2)\n .attr(\"x\", 0)\n .attr(\"y\", 4);\n\n labelGroup\n .append(\"text\")\n .text(d => d.label)\n .style(\"fill\", \"#000\")\n .style(\"opacity\", d => (d.orphan ? 0.1 : 1))\n .attr(\"x\", 0)\n .attr(\"y\", 4);\n\n refresh();\n\n function refresh() {\n if (state.ranked) {\n state.x = \"outdegree rank\";\n state.y = \"indegree rank\";\n state.r = \"pagerank rank\";\n state.c = \"pagerank rank\";\n } else {\n state.x = \"outdegree\";\n state.y = \"indegree\";\n state.r = \"pagerank\";\n state.c = \"pagerank\";\n }\n\n // refresh scale domains\n x.domain([0, d3.max(data, rawX)]);\n y.domain([0, d3.max(data, rawY)]);\n r.domain([0, d3.max(data, rawRadius)]);\n colorScale.domain([0, d3.max(data, rawColor)]);\n legendAxisScale.domain([0, d3.max(data, rawColor)]);\n\n // refresh axis ticks\n d3.select(\".x-axis-group\").call(d3.axisBottom(x));\n d3.select(\".y-axis-group\").call(d3.axisLeft(y));\n d3.select(\".color-axis-group\").call(d3.axisLeft(legendAxisScale));\n\n // refresh axis labels\n d3.select(\".x-axis-label\").text(state.x);\n d3.select(\".y-axis-label\").text(state.y);\n d3.select(\".color-axis-label\").text(state.c);\n\n // refresh color, position, etc\n d3.selectAll(\".dot-circle\")\n .transition()\n .attr(\"cx\", d => x(rawX(d)))\n .attr(\"cy\", d => y(rawY(d)))\n .attr(\"r\", d => r(rawRadius(d)))\n .style(\"fill\", d => colorScale(rawColor(d)));\n\n d3.selectAll(\".dot-label-group\")\n .transition()\n .attr(\"transform\", d => `translate(${x(rawX(d))}, ${y(rawY(d))})`);\n }\n }\n}\n","import React from 'react';\nimport { Alert, Icon } from 'antd';\nimport { Survey, SurveyData, Response } from '../types';\nimport {\n getUniqueValuesFromResponse,\n getResponseTranslationStats\n} from '../util';\n\nimport './ResponseTranslationTable.css';\n\ntype TableProps = {\n survey: Survey;\n surveyData: SurveyData;\n response: Response;\n}\n\nclass ResponseTranslationTable extends React.Component {\n render() {\n let { survey, surveyData, response } = this.props;\n let data = getResponseTranslationStats(survey, surveyData, response);\n\n return (\n
    \n

    \n

    Translated values

    \n {data.mappings.map(this.renderMapping)}\n\n

    \n

    Translated connections

    \n {data.edges.map(this.renderEdge)}\n
    \n )\n }\n\n renderMapping(mapping) {\n let [ raw, master ] = mapping;\n let icon = master\n ? \n : \n\n return (\n
    \n
    {raw}
    \n {icon}\n
    {master}
    \n
    \n )\n }\n\n renderEdge(edge) {\n return
    {edge.from} {edge.to}
    ;\n }\n}\n\nexport default ResponseTranslationTable;\n","// import './vendor/rough';\nimport $ from 'jquery';\nimport React from 'react';\nimport { splitString } from '../util';\nimport './RoughJSConnectionEditor.css';\n\n// WTF?\n// import rough from \"roughjs\";\nconst rough = window.rough;\n\nconst NODE_COLOR = '#7FC294';\nconst NODE_RADIUS = 10;\n\nclass ConnectionEditor extends React.Component {\n constructor() {\n super();\n\n this.history = [];\n\n this.actions = {\n undo: () => {\n if (this.history.length === 0) return;\n\n let edge = this.history.pop();\n this.edgeLayer.removeChild(this.edgeLayer.lastChild);\n\n this.props.onEdgeCreatedUndo(edge);\n },\n\n // noop at this point\n redo: () => {}\n };\n }\n\n componentWillMount() {\n window.addEventListener(\"resize\", this.handleResize);\n document.addEventListener(\"keydown\", this.handleKeyDown);\n }\n\n componentWillUnmount() {\n window.removeEventListener(\"resize\", this.handleResize);\n document.removeEventListener(\"keydown\", this.handleKeyDown);\n }\n\n componentDidMount() {\n this.resizeSVG();\n this.renderSVG();\n }\n\n shouldComponentUpdate() {\n return false;\n }\n\n render() {\n return ;\n }\n\n resizeSVG() {\n // don't want these resizing in the admin app\n if (this.props.resize === false) return;\n\n let { svg } = this.refs;\n let width = '100%';\n let height = window.innerHeight - $('.screen-heading').outerHeight(true) - $('.screen-footer').outerHeight(true);\n\n $(svg)\n .width(width)\n .height(height)\n }\n\n renderSVG() {\n let { svg } = this.refs;\n let { readonly } = this.props;\n let { handleEdgeCreated } = this;\n let roughSvg = rough.svg(svg);\n\n let $svg = $(svg);\n\n // this is called after resize to the layout adjusts to the new size also\n $svg.empty();\n $svg.off();\n\n let canvasWidth = $svg.width(); // svg.clientWidth;\n let canvasHeight = $svg.height(); // svg.clientHeight;\n let canvasMinSize = Math.min(canvasWidth, canvasHeight);\n\n const camera = {\n scale: 1,\n translate: {\n x: 0,\n y: 0\n }\n }\n\n const defs = document.createElementNS(\"http://www.w3.org/2000/svg\", \"defs\");\n const style = document.createElementNS(\"http://www.w3.org/2000/svg\", \"style\");\n\n style.type = \"text/css\";\n\n style.innerHTML = `\n @font-face {\n font-family: 'Kalam';\n src: url('/fonts/Kalam-Regular.ttf') format('truetype');\n }\n\n text {\n font-family: Kalam;\n font-size: 12px;\n }\n `\n\n defs.appendChild(style);\n svg.appendChild(defs);\n\n let sceneGroup = create('g');\n svg.appendChild(sceneGroup);\n\n let edgeLayer = this.edgeLayer = create('g');\n sceneGroup.appendChild(edgeLayer);\n\n // let graph = buildGraph();\n let { graph } = this.props;\n\n positionGraph(graph);\n\n drawGraph(graph);\n\n // Need to store the original scene bounds or zoom fit jitters on resize\n const sceneBounds = sceneGroup.getBoundingClientRect();\n\n zoomFit();\n applyCamera();\n\n let prevX;\n let prevY;\n let count = 1;\n\n let state = {\n dragging: false\n }\n\n if (!readonly) {\n addListeners()\n }\n\n function toWorldX(offsetX) {\n return (offsetX - camera.translate.x) / camera.scale;\n }\n\n function toWorldY(offsetY) {\n return (offsetY - camera.translate.y) / camera.scale;\n }\n\n function onEnterGroup($group) {\n let transform = $group.attr('transform');\n $group.attr('transform', `${transform} scale(1.5)`);\n }\n\n function onLeaveGroup($group) {\n let transform = $group.attr('transform');\n $group.attr('transform', `${transform.split('scale')[0]}`);\n }\n\n function addListeners() {\n $(svg)\n .on('mousemove touchmove', (event) => {\n // we have to handle enter/leave manually since we need to support mouse and touch\n let $currentTargetGroup = getTargetNodeGroup(event);\n\n if (state.$activeTargetGroup && state.$activeTargetGroup.length && !state.$activeTargetGroup.is($currentTargetGroup)) {\n onLeaveGroup(state.$activeTargetGroup);\n }\n\n if ($currentTargetGroup.length && !$currentTargetGroup.is(state.$activeTargetGroup)) {\n onEnterGroup($currentTargetGroup);\n }\n\n state.$activeTargetGroup = $currentTargetGroup;\n\n if (!state.dragging) return;\n\n // prevent scroll for touch devices\n event.preventDefault();\n\n let $node = getTargetNodeGroup(event);\n\n if ($node.length) {\n // snap to node center\n let nodeID = $node.attr('data-id');\n let node = graph.getNode(nodeID);\n state.dragEndX = node.x;\n state.dragEndY = node.y;\n } else {\n let { offsetX, offsetY } = event;\n\n if (event.type === 'touchmove') {\n let svgBounds = svg.getBoundingClientRect();\n offsetX = event.touches[0].pageX - svgBounds.left;\n offsetY = event.touches[0].pageY - svgBounds.top;\n }\n\n state.dragEndX = toWorldX(offsetX);\n state.dragEndY = toWorldY(offsetY);\n }\n\n updateDragEdge();\n })\n .on('mouseup touchend', (event) => {\n if (!state.dragging) return;\n finalizeDrag();\n })\n\n $(svg)\n .on('mousedown touchstart', '.node-hit', (event) => {\n if (state.dragging) return;\n\n let node = getTargetNode(event);\n state.dragging = true;\n state.dragSource = node;\n state.dragTarget = null;\n state.dragEdge = roughSvg.line(0, 0, 100, 0);\n // state.dragEdgeArrow = roughSvg.linearPath([[-10, 5], [2, 0], [-10, -5]]);\n state.dragStartX = state.dragEndX = node.x;\n state.dragStartY = state.dragEndY = node.y;\n\n updateDragEdge();\n\n edgeLayer.appendChild(state.dragEdge);\n // edgeLayer.appendChild(state.dragEdgeArrow);\n })\n .on('mouseup touchend', '.node-hit', (event) => {\n if (!state.dragging) return;\n state.dragTarget = getTargetNode(event);\n finalizeDrag();\n })\n }\n\n function getTargetNode(event) {\n let $group = getTargetNodeGroup(event);\n return graph.getNode($group.attr('data-id'));\n }\n\n function getTargetNodeGroup(event) {\n return $(getEventTarget(event)).closest('.node-group');\n }\n\n // event.target stays bound to original target for touchmove\n function getEventTarget(event) {\n if (event.type.indexOf('touch') === 0) {\n let { clientX } = event.originalEvent.changedTouches[0];\n let { clientY } = event.originalEvent.changedTouches[0];\n return document.elementFromPoint(clientX, clientY);\n } else {\n return event.target;\n }\n }\n\n function updateDragEdge() {\n let deltaX = state.dragEndX - state.dragStartX;\n let deltaY = state.dragEndY - state.dragStartY;\n let magnitude = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n let x = state.dragStartX;\n let y = state.dragStartY;\n let scale = magnitude / 100;\n let angleRadians = Math.atan2(deltaY / magnitude, deltaX / magnitude) || 0; // handle no length\n let angleDegrees = angleRadians * 180 / Math.PI;\n\n state.dragEdge.setAttribute('transform', `translate(${x} ${y}) rotate(${angleDegrees}) scale(${scale} 1)`);\n }\n\n // function updateDragEdgeRealistic() {\n // let deltaX = state.dragEndX - state.dragStartX;\n // let deltaY = state.dragEndY - state.dragStartY;\n // let magnitude = Math.sqrt(deltaX * deltaX + deltaY * deltaY) - NODE_RADIUS;\n // let unitX = deltaX / magnitude;\n // let unitY = deltaY / magnitude;\n // let x = state.dragStartX;\n // let y = state.dragStartY;\n // let scale = Math.max(0, (magnitude - 2 * NODE_RADIUS) / 100);\n // let angleRadians = Math.atan2(deltaY / magnitude, deltaX / magnitude);\n // let angleDegrees = angleRadians * 180 / Math.PI;\n //\n // let lineX0 = state.dragStartX + unitX * NODE_RADIUS * 2;\n // let lineY0 = state.dragStartY + unitY * NODE_RADIUS * 2;\n // let lineX1 = state.dragStartX + unitX * (magnitude - 2 * NODE_RADIUS);\n // let lineY1 = state.dragStartY + unitY * (magnitude - 2 * NODE_RADIUS);\n //\n // state.dragEdge.setAttribute('transform', `translate(${lineX0} ${lineY0}) rotate(${angleDegrees}) scale(${scale} 1)`);\n // state.dragEdgeArrow.setAttribute('transform', `translate(${lineX1} ${lineY1}) rotate(${angleDegrees})`);\n // }\n\n function positionGraph(graph) {\n let { focusNode, innerNodes, outerNodes } = graph;\n\n let innerRadius = canvasMinSize / 4.5;\n let outerRadius = canvasMinSize / 2;\n\n let innerDelta = 2 * Math.PI / innerNodes.length;\n let outerDelta = 2 * Math.PI / outerNodes.length;\n\n // Start at midnight and move clockwise\n let innerBasis = -Math.PI / 2; // midnight\n let outerBasis = -Math.PI / 2; // + innerDelta / 2;\n\n focusNode.x = 0;\n focusNode.y = 0;\n\n function positionNode(node, index, radius, basis, delta) {\n let angle = basis + delta * index;\n node.x = radius * Math.cos(angle);\n node.y = radius * Math.sin(angle);\n }\n\n innerNodes.forEach((node, index) => {\n positionNode(node, index, innerRadius, innerBasis, innerDelta);\n })\n\n outerNodes.forEach((node, index) => {\n positionNode(node, index, outerRadius, outerBasis, outerDelta);\n })\n\n return graph;\n }\n\n function create(nodeType) {\n return document.createElementNS('http://www.w3.org/2000/svg', nodeType);\n }\n\n function drawGraph(graph) {\n graph.nodes.forEach(drawNode);\n graph.edges.forEach(drawEdge);\n }\n\n function drawNode(node) {\n let { id, label, x, y } = node;\n let radius = NODE_RADIUS;\n\n let nodeGroup = create('g');\n nodeGroup.setAttribute('data-id', id);\n nodeGroup.setAttribute('class', 'node-group');\n nodeGroup.setAttribute('transform', `translate(${x} ${y})`);\n\n let nodeHit = create('circle');\n nodeHit.setAttribute('class', 'node-hit');\n nodeHit.setAttribute('cx', 0);\n nodeHit.setAttribute('cy', 0);\n nodeHit.setAttribute('r', 2 * radius); // large to make it easier to hit on touch devices\n nodeHit.setAttribute('fill', 'transparent');\n nodeGroup.appendChild(nodeHit);\n\n let nodeFill = create('circle');\n nodeFill.setAttribute('cx', 0);\n nodeFill.setAttribute('cy', 0);\n nodeFill.setAttribute('r', radius);\n nodeFill.setAttribute('fill', '#fff');\n nodeGroup.appendChild(nodeFill);\n\n let circle = roughSvg.circle(0, 0, radius * 2);\n nodeGroup.appendChild(circle);\n\n let [ line1, line2 ] = splitString(label);\n if (line1) nodeGroup.appendChild(drawText(line1, 0, radius, 'top'));\n if (line2) nodeGroup.appendChild(drawText(line2, 0, radius + 14, 'top'));\n\n sceneGroup.appendChild(nodeGroup);\n }\n\n function drawEdge(edge) {\n let { from, to } = edge;\n let edgeGroup = create('g');\n\n let x0 = from.x;\n let y0 = from.y;\n let x1 = to.x;\n let y1 = to.y;\n\n let deltaX = x1 - x0;\n let deltaY = y1 - y0;\n let magnitude = Math.sqrt(deltaX * deltaX + deltaY * deltaY) - NODE_RADIUS;\n let unitX = deltaX / magnitude;\n let unitY = deltaY / magnitude;\n\n let lineX0 = x0 + unitX * NODE_RADIUS * 2;\n let lineY0 = y0 + unitY * NODE_RADIUS * 2;\n\n let lineX1 = x0 + unitX * (magnitude - 2 * NODE_RADIUS);\n let lineY1 = y0 + unitY * (magnitude - 2 * NODE_RADIUS);\n let line = roughSvg.line(lineX0, lineY0, lineX1, lineY1);\n edgeGroup.appendChild(line);\n\n let angleRadians = Math.atan2(deltaY / magnitude, deltaX / magnitude);\n let angleDegrees = angleRadians * 180 / Math.PI;\n\n let arrow = roughSvg.linearPath([[-10, 5], [2, 0], [-10, -5]]);\n arrow.setAttribute('transform', `translate(${lineX1} ${lineY1}) rotate(${angleDegrees})`);\n edgeGroup.appendChild(arrow);\n\n edgeLayer.appendChild(edgeGroup);\n\n return edgeGroup;\n }\n\n function finalizeDrag() {\n let { dragSource, dragTarget } = state;\n\n state.dragging = false;\n\n edgeLayer.removeChild(state.dragEdge);\n // edgeLayer.removeChild(state.dragEdgeArrow);\n\n // incomplete drag\n if (!dragSource || !dragTarget || dragSource === dragTarget) return;\n\n // no redundant edges\n if (graph.edges.some(edge => edge.from === dragSource && edge.to === dragTarget)) return;\n\n let from = dragSource;\n let to = dragTarget;\n\n let edge = { from, to };\n graph.edges.push(edge);\n\n let edgeSvg = drawEdge(edge);\n\n handleEdgeCreated(edge, edgeSvg);\n }\n\n // double rendered for a nice thick outside outline\n function drawText(value, x, y, anchor) {\n let group = create('g');\n group.setAttribute('transform', `translate(${x} ${y})`);\n\n let shadow = create('text');\n shadow.textContent = value;\n shadow.setAttribute('fill', '#000');\n shadow.setAttribute('stroke', '#fff');\n shadow.setAttribute('stroke-width', 4);\n shadow.setAttribute('text-anchor', 'middle');\n\n let fill = create('text');\n fill.textContent = value;\n fill.setAttribute('fill', '#000');\n fill.setAttribute('text-anchor', 'middle');\n\n // Using dy since dominant-baseline isn't supported in IE11\n if (anchor === 'top') {\n shadow.setAttribute('dy', 10);\n fill.setAttribute('dy', 10);\n }\n\n group.appendChild(shadow);\n group.appendChild(fill);\n\n return group;\n }\n\n function zoomFit() {\n // svg.clientWidth and svg.clientHeight return 0 in firefox so we used jquery instead\n let $svg = $(svg);\n let canvasWidth = $svg.width();\n let canvasHeight = $svg.height();\n let widthScale = canvasWidth / sceneBounds.width;\n let heightScale = canvasHeight / sceneBounds.height;\n let zoomFitScale = 0.9 * Math.min(widthScale, heightScale)\n camera.scale = Math.min(1, zoomFitScale);\n camera.translate.x = canvasWidth / 2;\n\n // fudged since scene isn't vertically centered\n camera.translate.y = canvasHeight / 2 - NODE_RADIUS;\n }\n\n function applyCamera() {\n let { scale, translate } = camera;\n sceneGroup.setAttribute('transform', `translate(${translate.x} ${translate.y}) scale(${scale})`);\n }\n\n this.actions.resize = () => {\n // resize the SVG container to fill the screen\n // (workaround for ios address bar hiding shenanigans)\n this.resizeSVG();\n\n // rerender so layout adjusts to new size\n this.renderSVG();\n\n // fill the screen\n zoomFit();\n\n // center the scene\n applyCamera();\n };\n }\n\n handleResize = () => {\n this.actions.resize();\n }\n\n handleEdgeCreated = (edge, edgeSvg) => {\n this.history.push(edge);\n this.props.onEdgeCreated(edge);\n }\n\n handleKeyDown = (event) => {\n if (event.key == \"z\" && (event.ctrlKey || event.metaKey)) { // ctrl for IE11\n event.preventDefault();\n\n if (event.shiftKey) {\n this.actions.redo();\n } else {\n this.actions.undo();\n }\n }\n }\n}\n\nexport default ConnectionEditor;\n","import React from 'react';\nimport { Input, message } from 'antd';\nimport { AppState, Response } from '../types';\n\ntype Props = {\n app: AppState;\n response: Response;\n}\n\nclass TagInput extends React.Component {\n render() {\n let { response } = this.props;\n return ;\n }\n\n handleBlur = (event) => {\n let { app, response } = this.props;\n let tags = event.target.value;\n\n app.actions.updateResponseTags(response.id, tags)\n .then(() => message.success('Response tags updated'))\n .catch((error) => {\n console.error(error);\n message.error('Unable to update response tags');\n })\n }\n}\n\nexport default TagInput;\n","import React from 'react';\nimport classNames from 'classnames';\nimport { message, Button, Icon, Row, Col } from 'antd';\nimport { AppState, Response, Matrix, Graph } from '../types';\nimport AdjacencyMatrix from './AdjacencyMatrix';\nimport ResponseTranslationTable from './ResponseTranslationTable';\nimport ConnectionEditor from '../survey/RoughJSConnectionEditor';\nimport TagInput from './TagInput';\nimport {\n uuid,\n getUniqueValuesFromResponse,\n getOriginalMatrix,\n getGraphFromResponse,\n graphToAdjacencyMatrix,\n translatedMatrixToMasterMatrix,\n getMasterMatrixFromResponse\n} from '../util';\n\nimport './ResponseView.css';\n\ntype ResponseViewProps = {\n app: AppState;\n response: Response;\n}\n\nclass ResponseView extends React.Component {\n render() {\n let { app, response } = this.props;\n let { survey, surveyData } = app.state;\n\n let matrix: Matrix = getMasterMatrixFromResponse(survey, surveyData, response);\n let graph: Graph;\n\n if (response.source !== 'import') {\n // TODO: try generate graph from matrix for imported responses too\n graph = getGraphFromResponse(survey, response);\n }\n\n let className = classNames('response-view', {ignored: response.ignored});\n\n return (\n
    \n \n\n

    \n \n \n \n

    Email

    \n

    {response.email || 'none'}

    \n\n

    Story

    \n

    {response.story || 'none'}

    \n\n \n \n\n \n \n \n
    \n\n {graph &&\n
    \n {/* key used to force editor to update */}\n {}\n
    \n }\n
    \n )\n }\n}\n\nexport default ResponseView;\n","import React from 'react';\nimport { Row, Col, Select, Input, Button, Icon, Tooltip, message } from 'antd';\nimport download from 'downloadjs';\nimport { AppState } from '../types';\nimport ResponseView from './ResponseView';\nimport {\n getOriginalMatrix,\n getTranslatedMatrixFromResponse,\n getMasterMatrixFromResponse,\n matrixToCSV\n} from '../util';\n\nimport './ResponsesView.css';\n\nconst Option = Select.Option;\n\ntype ResponsesViewProps = {\n app: AppState;\n}\n\nclass ResponsesView extends React.Component {\n state = {\n currentResponseIndex: 0\n }\n\n getCurrentResponse() {\n let { currentResponseIndex } = this.state;\n return this.props.app.state.surveyData.responses[currentResponseIndex];\n }\n\n render() {\n let { app } = this.props;\n let { survey, surveyData } = app.state;\n let { currentResponseIndex } = this.state;\n let currentResponse = this.getCurrentResponse();\n\n const getResponseLabel = (response, index) => {\n let label = `Response ${index + 1}`;\n let meta = [];\n if (response.tags) meta.push(response.tags);\n if (response.email) meta.push(response.email);\n if (meta.length) label += ` (${meta.join(' ')})`;\n return response.ignored ? {label} : label;\n }\n\n return (\n
    \n
    \n \n \n \n \n \n\n {currentResponse && (\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 {currentResponse && }\n
    \n )\n }\n\n handleResponseSelect = (index) => {\n this.setState({currentResponseIndex: index});\n }\n\n handlePrev = () => {\n let { currentResponseIndex } = this.state;\n if (currentResponseIndex === 0) return;\n this.setState({currentResponseIndex: currentResponseIndex - 1});\n }\n\n handleNext = () => {\n let { app } = this.props;\n let { surveyData } = app.state;\n let { currentResponseIndex } = this.state;\n if (currentResponseIndex === surveyData.responses.length - 1) return;\n this.setState({currentResponseIndex: currentResponseIndex + 1});\n }\n\n handleDownloadOriginal = (event) => {\n let { survey, surveyData } = this.props.app.state;\n let response = this.getCurrentResponse();\n let matrix = getOriginalMatrix(survey, response);\n let csv = matrixToCSV(matrix);\n\n download(csv, `${survey.name} ${response.id} (original).csv`, 'text/csv');\n }\n\n handleDownloadTranslated = (event) => {\n let { survey, surveyData } = this.props.app.state;\n let response = this.getCurrentResponse();\n let matrix = getTranslatedMatrixFromResponse(survey, surveyData, response);\n let csv = matrixToCSV(matrix);\n\n download(csv, `${survey.name} ${response.id} (translated).csv`, 'text/csv');\n }\n\n handleDownloadMaster = (event) => {\n let { survey, surveyData } = this.props.app.state;\n let response = this.getCurrentResponse();\n let matrix = getMasterMatrixFromResponse(survey, surveyData, response);\n let csv = matrixToCSV(matrix);\n\n download(csv, `${survey.name} ${response.id} (master).csv`, 'text/csv');\n }\n\n handleIgnore = () => {\n if (window.confirm('Are you sure you want to ignore this response?')) {\n let response = this.getCurrentResponse();\n let ignore = !response.ignored;\n\n this.props.app.actions.ignoreResponse(response.id, ignore);\n\n if (ignore) {\n message.info('Response ignored');\n } else {\n message.info('Response restored');\n }\n }\n }\n}\n\nexport default ResponsesView;\n","import $ from 'jquery';\nimport React from 'react';\nimport { Icon, Button, Input, Modal } from 'antd';\nimport { AppState } from '../types';\n\ntype Props = {\n app: AppState;\n}\n\nconst AdminView = ({ app, email }) => {\n\n}\n\nclass SurveyAdminsForm extends React.Component {\n render() {\n let { app } = this.props;\n let { surveyData } = app.state;\n\n return (\n
    \n

    Admins

    \n
      \n {surveyData.admins.map(this.renderAdmin)}\n
    • \n
      \n \n
      \n
    • \n
    \n
    \n )\n }\n\n renderAdmin = (email) => {\n let { app } = this.props;\n\n const dropAdmin = () => {\n Modal.confirm({\n title: 'Revoke project access',\n content: `Are you sure you want to drop ${email} from the project?`,\n onOk: () => {\n app.actions.dropAdmin(email);\n }\n })\n }\n\n return
  • {email}
  • ;\n }\n\n handleAddAdmin = (event) => {\n event.preventDefault();\n\n let { app } = this.props;\n let $input = $('.new-admin-input');\n let email = $input.val();\n\n app.actions.addAdmin(email);\n\n $input.val('');\n }\n}\n\nexport default SurveyAdminsForm;\n","import React from 'react';\nimport { Button, Input } from 'antd';\nimport { AppState } from '../types';\nimport SurveyAdminsForm from './SurveyAdminsForm';\n\ntype Props = {\n app: AppState;\n}\n\nclass SurveyAdminView extends React.Component {\n render() {\n let { app } = this.props;\n \n return (\n
    \n \n\n

    Danger

    \n \n
    \n )\n }\n\n handleReset = () => {\n if (window.confirm(\"Are you sure want to reset the master values? This cannot be undone.\")) {\n let { app } = this.props;\n app.actions.resetMasterValues();\n }\n }\n}\n\nexport default SurveyAdminView;\n","import React from 'react';\nimport classNames from 'classnames';\nimport { Layout, Menu, Tabs, Spin, Icon, message } from 'antd';\nimport { AppState } from '../types';\nimport Logo from './Logo';\nimport MappingsEditor from './MappingsEditor';\nimport MasterMatrix from './MasterMatrix';\nimport AnalyticsView from './AnalyticsView';\nimport ResponsesView from './ResponsesView';\nimport SurveyAdminView from './SurveyAdminView';\nimport './SurveyView.css';\n\nconst { Header, Content, Footer, Sider } = Layout;\nconst { TabPane } = Tabs;\n\ntype SurveyViewProps = {\n app: AppState;\n}\n\ntype SurveyViewState = {\n location: string;\n dragging: boolean;\n}\n\nclass SurveyView extends React.Component {\n state = {\n location: '',\n dragging: false\n }\n\n componentWillMount() {\n let { actions } = this.props.app;\n actions.fetchSurveyData();\n }\n\n render() {\n let { app } = this.props;\n let { ready, survey, surveyData } = app.state;\n let { location, dragging } = this.state;\n let content;\n\n if (!ready) return this.renderLoading();\n\n if (!location || location === 'master') {\n content = ;\n } else if (location === 'matrix') {\n content = ;\n } else if (location === 'analytics') {\n content = ;\n } else if (location === 'responses') {\n content = ;\n } else if (location === 'admin') {\n content = ;\n }\n\n let className = classNames('survey-view', { dragging });\n\n return (\n
    \n
    \n

    drop xlsx/csv here to import

    \n
    \n\n \n \n \n\n

    {survey.name}

    \n\n \n \n \n Master values\n \n \n \n Master matrix\n \n \n \n Analytics\n \n \n \n Responses\n \n \n \n Admin\n \n \n Back to dashboard\n \n \n \n \n {/*
    */}\n {content}\n {/*
    System Effects © 2019
    */}\n \n \n
    \n )\n }\n\n renderLoading() {\n return
    ;\n }\n\n handleMenuClick = (event) => {\n this.setState({location: event.key});\n }\n\n handleDrop = (event) => {\n event.preventDefault();\n\n if (event.dataTransfer.files) {\n let { app } = this.props;\n\n Array.from(event.dataTransfer.files).forEach((file:File) => {\n if (!/(xlsx|csv)$/.test(file.name)) {\n message.error(`Unable to import ${file.name}. Only xlsx and csv imports are supported at this time.`);\n return;\n }\n\n app.actions.importResponse(file)\n .then(() => message.success(`Successfully imported ${file.name}`))\n .catch(error => {\n console.error(error);\n message.error(`Unable to import ${file.name}`);\n })\n })\n }\n\n this.setState({dragging: false});\n }\n\n handleDragEnter = (event) => {\n this.setState({dragging: true});\n }\n\n handleDragOver = (event) => {\n // Without these the onDrop event won't fire\n // https://stackoverflow.com/questions/50230048/react-ondrop-is-not-firing/51437194#51437194\n event.preventDefault();\n event.stopPropagation();\n }\n\n handleMouseMove = (event) => {\n if (this.state.dragging && !this.isFileDrop(event)) {\n this.setState({dragging: false});\n }\n }\n\n isFileDrop(event) {\n return Boolean(event.dataTransfer && event.dataTransfer.files && event.dataTransfer.files[0]);\n }\n}\n\nexport default SurveyView;\n","import XLSX from 'xlsx';\nimport papaparse from 'papaparse';\nimport { AppState, Response, Matrix } from '../../types';\n\nasync function getResponseFromImport(file: File) {\n let matrix = await (/xlsx$/.test(file.name) ? parseXLSX(file) : parseCSV(file));\n let response: Response = { source: 'import', tags: file.name, data: { matrix } };\n return response;\n}\n\n\nasync function parseXLSX(file: File): Promise {\n return new Promise((resolve, reject) => {\n let reader = new FileReader();\n\n reader.onload = () => {\n let data = new Uint8Array(reader.result);\n let workbook = XLSX.read(data, {type: 'array'});\n\n // currently only process the first worksheet\n let worksheetName = workbook.SheetNames[0];\n let worksheet = workbook.Sheets[worksheetName];\n let csv = XLSX.utils.sheet_to_csv(worksheet);\n let matrix = csvToMatrix(csv);\n\n resolve(matrix);\n };\n\n reader.onerror = (error) => reject(error);\n\n reader.readAsArrayBuffer(file);\n })\n}\n\n\n// file.type \"text/csv\"\nasync function parseCSV(file: File): Promise {\n return new Promise((resolve, reject) => {\n let reader = new FileReader();\n reader.onload = () => resolve(csvToMatrix(reader.result));\n reader.onerror = (error) => reject(error);\n reader.readAsText(file);\n })\n}\n\nfunction csvToMatrix(csv) {\n let { data } = papaparse.parse(csv);\n\n let matrix: Matrix = {\n labels: data[0].slice(1),\n data: data.slice(1).map(row => row.slice(1).map(Number))\n }\n\n // remove empty rows at the end\n matrix.data = matrix.data.filter(row => row.length > 0);\n\n return matrix;\n}\n\nexport default getResponseFromImport;\n","import sortBy from \"lodash/sortBy\";\nimport { compareTwoStrings } from \"string-similarity\";\nimport {\n getUniqueValuesFromResponse,\n getEdgeListFromResponse,\n} from \"../../util\";\nimport { Survey, SurveyData, Response } from \"../../types\";\n\nexport function getMaster(surveyData, masterID) {\n let { masterValues } = surveyData;\n return masterValues.find(master => master.id === masterID);\n}\n\n// TODO: how do we want to handle ignore?\nexport function getMasterID(aliasTable, value) {\n return aliasTable[value];\n}\n\nexport function getMasterIDSet(surveyData) {\n let { masterValues } = surveyData;\n let set = new Set();\n set.add(\"ignore\");\n masterValues.forEach(master => set.add(master.id));\n return set;\n}\n\nexport function getUnmappedValues(surveyData): any[] {\n let { masterValues, aliasTable, responses } = surveyData;\n let validMasterIDs = getMasterIDSet(surveyData);\n let unmappedValues = new Set();\n\n responses.forEach(response => {\n if (response.ignored) return;\n\n let values = getUniqueValuesFromResponse(response);\n values.forEach(value => {\n let id = getMasterID(aliasTable, value);\n\n // not mapped or master value no longer exists\n if (!id || !validMasterIDs.has(id)) {\n unmappedValues.add(value);\n }\n });\n });\n\n return Array.from(unmappedValues);\n}\n\nexport function getAliases(surveyData, masterID) {\n let { aliasTable } = surveyData;\n let values = [];\n\n Object.keys(aliasTable).forEach(value => {\n let id = aliasTable[value];\n\n if (id === masterID) {\n values.push(value);\n }\n });\n\n return values;\n}\n\nexport function getMatchingValues(surveyData, masterID) {\n let master = getMaster(surveyData, masterID);\n\n if (!master) return [];\n\n let aliases = getAliases(surveyData, masterID);\n let unmapped = getUnmappedValues(surveyData);\n let cutoff = 0.2;\n let bestScores: any = {};\n\n aliases.unshift(master.value);\n aliases.forEach(alias => {\n unmapped.forEach(value => {\n let score = compareTwoStrings(alias, value);\n\n if (score >= cutoff) {\n let best = bestScores[value];\n\n if (!best || score > best.score) {\n bestScores[value] = { score, alias };\n }\n }\n });\n });\n\n let matches = [];\n\n Object.keys(bestScores).forEach(value => {\n let { score, alias } = bestScores[value];\n matches.push([score, value, alias]);\n });\n\n // sorted by descending score\n return sortBy(matches, set => -set[0]);\n}\n\nexport function getValueReferences(\n survey: Survey,\n surveyData: SurveyData,\n value: string\n) {\n let { responses } = surveyData;\n let refs = [];\n\n let lowerValue = value.toLowerCase();\n\n responses.forEach(response => {\n let edges = getEdgeListFromResponse(survey, response);\n\n edges.forEach(({ from, to }) => {\n let lowerFrom = from.toLowerCase();\n let lowerTo = to.toLowerCase();\n\n if (lowerFrom === lowerValue || lowerTo === lowerValue) {\n refs.push(`${from} --> ${to}`);\n }\n });\n });\n\n return refs;\n}\n","import $ from 'jquery';\nimport React from 'react';\nimport { Modal, Checkbox } from 'antd';\nimport { getMaster, getMatchingValues } from './util';\nimport { playDropSound } from './sounds';\n\nexport default function automatch(app, masterID) {\n let { actions, state } = app;\n let { surveyData } = state;\n let master = getMaster(surveyData, masterID);\n let matching = getMatchingValues(surveyData, masterID);\n\n if (matching.length === 0) {\n Modal.info({content: 'No matches found'});\n return;\n }\n\n let checked = {};\n\n let checkboxes = matching.map(match => {\n const [ score, value, alias ] = match;\n const handleChange = value => event => checked[value] = event.target.checked;\n\n return
    {value}
    ;\n })\n\n const AutomatchModal = () => {\n return (\n
    \n

    \n Please select the values you would like to map to {master.value} below:\n

    \n\n {checkboxes}\n
    \n )\n }\n\n function getChecked() {\n let values = [];\n\n Object.keys(checked).forEach(value => {\n if (checked[value]) values.push(value);\n })\n\n return values;\n }\n\n Modal.confirm({\n title: {matching.length} potential matches found,\n content: ,\n width: '50vw',\n icon: 'thunderbolt',\n okText: 'Save',\n onOk() {\n playDropSound();\n\n let values = getChecked();\n values.forEach(value => $(`.unmapped-values [data-value=\"${value}\"]`).appendTo(`.drop-target[data-id=\"${masterID}\"]`));\n\n actions.moveAll(values, masterID);\n },\n onCancel() {},\n });\n}\n","import $ from 'jquery';\nimport React from 'react';\nimport { Modal, Checkbox, notification } from 'antd';\nimport SurveyView from './SurveyView';\nimport { Actions, Helpers, Survey, SurveyData } from '../types';\nimport getResponseFromImport from './helpers/getResponseFromImport';\nimport { uuid } from '../util';\nimport { getValueReferences } from './helpers/util';\nimport openAutomatchModal from './helpers/automatch';\nimport { playDragSound, playDropSound } from './helpers/sounds';\nimport db from '../db';\n\ntype SurveyAdminAppProps = {\n survey: Survey;\n}\n\ntype SurveyAdminAppState = {\n ready: boolean;\n survey: Survey;\n surveyData: SurveyData;\n nextMasterValueID: string;\n categoriesEnabled: boolean;\n}\n\nclass SurveyAdminApp extends React.Component {\n actions: Actions;\n helpers: Helpers;\n\n constructor(props) {\n super(props);\n\n this.state = {\n ready: false,\n survey: props.survey,\n surveyData: {\n categories: [],\n admins: [],\n masterValues: [],\n aliasTable: {},\n responses: []\n },\n nextMasterValueID: uuid(),\n categoriesEnabled: false\n }\n\n let helpers: Helpers = this.helpers = {\n findMasterValueIndex: function (surveyData: SurveyData, id) {\n return surveyData.masterValues.findIndex(master => master.id === id);\n }\n }\n\n let actions: Actions = this.actions = {};\n\n actions.importResponse = async (responseFile) => {\n let { survey, surveyData } = this.state;\n let response = await getResponseFromImport(responseFile);\n\n // TODO: db.importResponse instead?\n let savedResponse = await db.createResponse(survey.id, response);\n\n surveyData = {...surveyData, responses: [...surveyData.responses, savedResponse]};\n\n this.setState({ surveyData });\n\n return savedResponse;\n };\n\n actions.fetchSurveyData = async () => {\n let { survey } = this.state;\n let surveyData = await db.fetchSurveyData(survey.id);\n let categoriesEnabled = surveyData.categories && surveyData.categories.length > 0;\n\n this.setState({ ready: true, surveyData, categoriesEnabled });\n }\n\n // pass (id, false) to unignore\n actions.ignoreResponse = async (responseID, ignored = true) => {\n let { survey, surveyData } = this.state;\n\n db.updateResponse(responseID, { ignored });\n\n // optimistic update\n let response = surveyData.responses.find(response => response.id === responseID);\n response.ignored = ignored;\n\n this.setState({ surveyData });\n }\n\n actions.updateResponseTags = async (responseID, tags) => {\n let { survey, surveyData } = this.state;\n\n db.updateResponse(responseID, { tags });\n\n let response = surveyData.responses.find(response => response.id === responseID);\n response.tags = tags;\n\n this.setState({ surveyData });\n\n return response;\n }\n\n actions.updateMasterValue = (id, attrs = {}) => {\n let { survey, surveyData } = this.state;\n let { masterValues } = surveyData;\n let index = helpers.findMasterValueIndex(surveyData, id);\n\n // optimistic update\n db.updateMasterValue(survey.id, id, attrs);\n masterValues[index] = {...masterValues[index], ...attrs};\n\n this.setState({ surveyData });\n }\n\n actions.deleteMasterValue = (id) => {\n let { survey, surveyData } = this.state;\n let { masterValues } = surveyData;\n let index = helpers.findMasterValueIndex(surveyData, id);\n\n db.deleteMasterValue(survey.id, id);\n\n surveyData.masterValues = [\n ...masterValues.slice(0, index),\n ...masterValues.slice(index + 1)\n ]\n\n // list is uncontrolled so we need to move the dom elements manually\n $(`.raw-value-list[data-id=${id}] .value`).appendTo('.unmapped-values .raw-value-list');\n\n this.setState({ surveyData });\n }\n\n actions.createMasterValue = (value) => {\n let { survey, surveyData, nextMasterValueID } = this.state;\n let id = nextMasterValueID;\n\n db.createMasterValue(survey.id, id, value);\n\n surveyData.masterValues.push({ id, value });\n\n this.setState({\n surveyData,\n nextMasterValueID: uuid()\n });\n }\n\n actions.move = (value, id) => {\n let { survey, surveyData, nextMasterValueID } = this.state;\n let { aliasTable } = surveyData;\n\n aliasTable[value] = id;\n\n if (id === nextMasterValueID) {\n actions.createMasterValue(value);\n }\n\n db.updateAlias(survey.id, value, id);\n\n this.setState({ surveyData });\n }\n\n // Unlike the move action this assumes the master value already exists.\n // This action is used by automatch.\n actions.moveAll = (values, id) => {\n let { survey, surveyData } = this.state;\n let { aliasTable } = surveyData;\n\n values.forEach(value => {\n aliasTable[value] = id;\n db.updateAlias(survey.id, value, id);\n })\n\n this.setState({ surveyData });\n }\n\n actions.automatch = (masterID) => {\n let app = this.getAppContext();\n openAutomatchModal(app, masterID);\n }\n\n actions.reviewValueReferences = (value) => {\n let { survey, surveyData } = this.state;\n let refs = getValueReferences(survey, surveyData, value);\n\n notification.open({\n message: value,\n description:
      {refs.map(r =>
    • {r}
    • )}
    ,\n duration: null\n });\n }\n\n actions.resetMasterValues = () => {\n let { survey, surveyData } = this.state;\n\n db.resetMasterValues(survey.id);\n\n surveyData.masterValues = [];\n surveyData.aliasTable = {};\n\n this.setState({ surveyData });\n }\n\n actions.addAdmin = (email) => {\n let { survey, surveyData } = this.state;\n\n db.addAdmin(survey.id, email);\n\n surveyData.admins = [...surveyData.admins, email];\n\n this.setState({ surveyData });\n }\n\n actions.dropAdmin = (email) => {\n let { survey, surveyData } = this.state;\n\n db.dropAdmin(survey.id, email);\n\n surveyData.admins = surveyData.admins.filter(admin => admin !== email);\n\n this.setState({ surveyData });\n }\n }\n\n render() {\n let app = this.getAppContext();\n return ;\n }\n\n getAppContext() {\n return {\n state: this.state,\n actions: this.actions,\n helpers: this.helpers\n }\n }\n}\n\nexport default SurveyAdminApp;\n","import React from 'react';\n// import logo from './logo.svg';\n// import ConnectionEditor from './PixiConnectionEditor';\nimport { RouteProps } from 'react-router';\nimport { Switch, Route, Link, withRouter } from 'react-router-dom';\nimport { Actions, Helpers, Survey, Session } from '../types';\nimport LoginScreen from './LoginScreen';\nimport SurveyIndex from './SurveyIndex';\nimport SurveyAdminApp from './SurveyAdminApp';\nimport db from '../db';\n\nclass AdminApp extends React.Component {\n state: {\n session: Session;\n surveys: Survey[];\n }\n\n actions: Actions;\n helpers: Helpers;\n\n constructor(props) {\n super(props);\n\n this.state = {\n session: null,\n surveys: [],\n }\n\n // helpers\n let helpers: Helpers = this.helpers = {};\n helpers.getSurvey = (id) => this.state.surveys.find(survey => survey.id === id);\n helpers.getSurveyIndex = (id) => this.state.surveys.findIndex(survey => survey.id === id);\n\n // actions\n let actions: Actions = this.actions = {};\n\n // TODO: how do we handle expired sessions?\n actions.login = async (session: Session) => {\n if (session) {\n // persist the session to localstorage\n localStorage.setItem('session', JSON.stringify(session));\n\n // allow db to make authenticated requests\n db.token = session.token;\n\n // save session data locally so we can use it within the ui\n this.setState({ session });\n\n // kick off the data loading\n this.actions.fetchSurveys();\n } else {\n // attempt to resume previous session\n try {\n let session = JSON.parse(localStorage.getItem('session'));\n\n if (session) {\n this.actions.login(session);\n }\n } catch (error) {}\n }\n }\n\n actions.logout = () => {\n localStorage.removeItem('session');\n db.token = null;\n this.setState({session: null});\n // TODO: redirect?\n }\n\n actions.fetchSurveys = async () => {\n let surveys = await db.getSurveys();\n this.setState({ surveys });\n }\n\n actions.createSurvey = async (attrs) => {\n let survey = await db.createSurvey(attrs);\n this.setState({surveys: [survey, ...this.state.surveys]});\n return survey;\n }\n\n actions.updateSurvey = async (id, attrs) => {\n let survey = await db.updateSurvey(id, attrs);\n\n let { surveys } = this.state;\n let index = helpers.getSurveyIndex(survey.id)\n\n this.setState({\n surveys: [\n ...surveys.slice(0, index),\n survey,\n ...surveys.slice(index + 1)\n ]\n });\n\n return survey;\n }\n\n actions.deleteSurvey = async (id) => {\n await db.deleteSurvey(id);\n\n let { surveys } = this.state;\n let index = helpers.getSurveyIndex(id)\n\n this.setState({\n surveys: [\n ...surveys.slice(0, index),\n ...surveys.slice(index + 1)\n ]\n });\n }\n }\n\n componentWillMount() {\n this.actions.login();\n }\n\n render() {\n if (!this.state.session) {\n return ;\n } else {\n return (\n
    \n \n \n \n \n \n
    \n )\n }\n }\n\n renderSurveyIndex = () => {\n let { actions, helpers } = this;\n let { session, surveys } = this.state;\n return ;\n }\n\n renderSurveyView = ({ match }) => {\n let { actions, helpers } = this;\n let { surveys } = this.state;\n let survey;\n\n if (match) {\n survey = helpers.getSurvey(Number(match.params.id));\n\n if (survey) {\n return ;\n }\n }\n\n return null;\n }\n\n renderLogoutRoute = () => {\n this.actions.logout();\n this.props.history.replace('/admin');\n return

    You have been logged out.

    \n }\n}\n\nexport default withRouter(AdminApp);\n","import $ from 'jquery';\nimport React from 'react';\n\nconst AUTOCOMPLETE_MIN_LENGTH = 1;\n\nclass TextInput extends React.Component {\n constructor() {\n super();\n\n this.state = {\n hasFocus: false,\n autocompleteOpen: false,\n autocompleteSuggestions: [],\n autocompleteIndex: -1\n }\n }\n\n render() {\n let { value, placeholder, autocomplete, onDelete } = this.props;\n let { hasFocus, autocompleteSuggestions } = this.state;\n let showAutocomplete = hasFocus && autocompleteSuggestions.length > 0;\n\n return (\n
    \n \n {showAutocomplete && this.renderAutocomplete()}\n
    \n )\n }\n\n renderAutocomplete() {\n let { hasFocus, autocompleteSuggestions, autocompleteIndex } = this.state;\n let children = autocompleteSuggestions.map((value, index) => {\n let className = index === autocompleteIndex ? 'active' : null;\n\n // We need to use mousedown for this one or the blur event will trigger\n // before the click event and the menu will already have been removed\n // from the DOM.\n const select = () => {\n this.updateValue(value);\n // this.focusNextInput();\n }\n\n return
  • {value}
  • ;\n })\n\n return
      {children}
    ;\n }\n\n shiftAutocompleteIndex(delta) {\n let { enteredValue, autocompleteSuggestions, autocompleteIndex } = this.state;\n let selectedValue;\n\n autocompleteIndex += delta;\n\n if (autocompleteIndex >= autocompleteSuggestions.length) {\n autocompleteIndex = -1;\n } else if (autocompleteIndex < -1) {\n autocompleteIndex = autocompleteSuggestions.length - 1;\n }\n\n if (autocompleteIndex === -1) {\n selectedValue = enteredValue;\n } else {\n selectedValue = autocompleteSuggestions[autocompleteIndex];\n }\n\n this.setState({ autocompleteIndex });\n this.props.onChange(selectedValue);\n }\n\n handleFocus = () => {\n this.setState({hasFocus: true});\n }\n\n handleBlur = (event) => {\n // have to use setTimeout to give the onClick handler a chance to fire\n // before being removed from the DOM\n let { target, currentTarget } = event;\n\n this.setState({hasFocus: false});\n this.props.onBlur && this.props.onBlur();\n }\n\n handleKeyDown = (event) => {\n if (event.key === 'Enter') {\n this.focusNextInput();\n } else if (event.key === 'Escape') {\n // TODO: blur instead?\n this.setState({hasFocus: false});\n } else if (event.key === 'ArrowDown') {;\n event.preventDefault(); // prevent cursor jump to end\n this.shiftAutocompleteIndex(+1);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault(); // prevent cursor jump to start\n this.shiftAutocompleteIndex(-1);\n }\n }\n\n handleChange = (event) => {\n let value = event.target.value;\n this.updateValue(value);\n }\n\n updateValue(value) {\n let { autocomplete } = this.props;\n let autocompleteSuggestions = [];\n\n if (autocomplete && value && value.length >= AUTOCOMPLETE_MIN_LENGTH) {\n autocompleteSuggestions = autocomplete.filter(string => {\n let stringLower = string.toLowerCase();\n let valueLower = value.toLowerCase();\n\n return stringLower !== valueLower && stringLower.indexOf(valueLower) !== -1;\n })\n }\n\n // needs to happen now or cursor jumps if you try to edit middle\n this.props.onChange(value);\n\n this.setState({\n enteredValue: value,\n autocompleteSuggestions\n })\n }\n\n // TODO: make this an action?\n focusNextInput() {\n let $inputs = $('input[type=text]');\n let index = $inputs.index(this.refs.input);\n\n if (index < $inputs.length - 1) {\n let $nextInput = $inputs.eq(index + 1);\n setTimeout(function() { $nextInput.focus(); }, 0);\n }\n }\n}\n\nexport default TextInput;\n","import React from 'react';\nimport { Spin } from 'antd';\nimport Centered from './Centered';\n\nconst SpinnerScreen = () => {\n return ;\n}\n\nexport default SpinnerScreen;\n","import React from 'react';\nimport { Input, Button } from 'antd';\n\nconst InputGroup = Input.Group;\n\nclass NewsletterForm extends React.Component {\n state = {submitted: false}\n\n render() {\n let { submitted } = this.state;\n\n if (submitted) {\n return (\n
    \n

    Thanks! We'll be in touch.

    \n
    \n )\n } else {\n return (\n
    \n

    \n If you would like to be kept in the loop, please enter your email below:\n

    \n\n
    \n \n \n \n \n
    \n
    \n )\n }\n }\n\n handleSubmit = (event) => {\n event.preventDefault();\n\n let email = this.refs.input.input.value.trim();\n\n if (email) {\n this.setState({submitted: true});\n this.props.onSubmit(email);\n }\n }\n}\n\nexport default NewsletterForm;\n","import React from 'react';\nimport { Radio } from 'antd';\n\nclass RadioInput extends React.Component {\n render() {\n let { values } = this.props;\n\n let inputs = values.map(({ label, value }) => {\n return {label};\n })\n\n return {inputs};\n }\n\n handleChange = (event) => {\n let { value } = event.target;\n this.props.onChange(value);\n }\n}\n\nexport default RadioInput;\n","import React from 'react';\nimport { Checkbox } from 'antd';\n\nclass CheckboxInput extends React.Component {\n constructor() {\n super();\n this.state = {checked: []};\n }\n\n render() {\n let { values } = this.props;\n\n let inputs = values.map(({ label, value }, index) => {\n let onChange = (event) => this.handleChange(event, index);\n return {label};\n })\n\n return
    {inputs}
    ;\n }\n\n handleChange = (event, index) => {\n let { checked } = this.state;\n checked[index] = event.target.checked;\n this.setState({ checked }, this.notifyChange);\n }\n\n notifyChange = () => {\n let { values } = this.props;\n let { checked } = this.state;\n\n let checkedValues = checked\n .map((isChecked, index) => isChecked ? values[index].value : null)\n .filter(value => value);\n\n this.props.onChange(checkedValues);\n }\n}\n\nexport default CheckboxInput;\n","import React from 'react';\nimport { Select } from 'antd';\n\nconst { Option } = Select;\n\nclass SelectInput extends React.Component {\n render() {\n let { values } = this.props;\n\n let options = values.map(({ label, value }) => {\n return ;\n })\n\n return (\n \n )\n }\n\n handleChange = (value) => {\n this.props.onChange(value);\n }\n}\n\nexport default SelectInput;\n","import React from 'react';\nimport RadioInput from './RadioInput';\nimport CheckboxInput from './CheckboxInput';\nimport SelectInput from './SelectInput';\nimport TextInput from './TextInput';\n\nconst INPUTS = {\n radio: RadioInput,\n checkbox: CheckboxInput,\n select: SelectInput,\n text: TextInput,\n}\n\nexport default function renderInput(type, props) {\n let Input = INPUTS[type];\n return ;\n}\n","import React from 'react';\nimport { Input } from 'antd';\n\nclass TextInput extends React.Component {\n render() {\n let { placeholder } = this.props;\n return ;\n }\n\n handleChange = (event) => {\n this.props.onChange(event.target.value);\n }\n}\n\nexport default TextInput;\n","export const foodInsecurity = {\n values: [\n {\n id: 'vx1',\n value: \"I struggle to pay all of my bills\",\n children: [\n {id: 'vx10', value: \"Sydney is expensive place to live\", children: []},\n {id: 'vx11', value: \"Most of my money gets spent on rent\", children: []},\n {id: 'vx12', value: \"\", children: []}\n ]\n },\n {\n id: 'vx2',\n value: \"Good food is expensive\",\n children: [\n {id: 'vx20', value: \"Sydney is expensive place to live\", children: []},\n {id: 'vx21', value: \"Hard to find a good job\", children: []},\n {id: 'vx22', value: \"\", children: []}\n ]\n },\n {\n id: 'vx3',\n value: \"Lack of time\",\n children: [\n {id: 'vx30', value: \"Do not own a car\", children: []},\n {id: 'vx31', value: \"\", children: []}\n ]\n },\n {\n id: 'vx4',\n value: \"Hard to get to the shop\",\n children: [\n {id: 'vx40', value: \"Do not own a car\", children: []},\n {id: 'vx41', value: \"Live far from public transport\", children: []},\n {id: 'vx42', value: \"\"}\n ]\n },\n {\n id: 'vx5',\n value: \"My house doesn't have enough food storage space\",\n children: [\n {id: 'vx50', value: \"I have a large family\", children: []},\n {id: 'vx51', value: \"\", children: []}\n ]\n },\n {\n id: 'vx6',\n value: \"\",\n children: [\n {id: 'vx60', value: \"\", children: []}\n ]\n }\n ],\n otherEdges: []\n}\n\nexport const testResponse = {\n values: [\n {\n id: 'vx1',\n value: 'One',\n children: [\n {id: 'vx10', value: 'A', children: []},\n {id: 'vx11', value: 'B', children: []}\n ]\n },\n {\n id: 'vx2',\n value: 'Two',\n children: [\n {id: 'vx12', value: 'C', children: []},\n {id: 'vx13', value: 'D', children: []}\n ]\n },\n {\n id: 'vx3',\n value: 'Three',\n children: [\n {id: 'vx14', value: 'D', children: []},\n {id: 'vx15', value: 'E', children: []}\n ]\n },\n ],\n otherEdges: [\n {from: 'vx15', to: 'vx10'}\n ]\n}\n\nexport const list = [\n foodInsecurity,\n testResponse\n]\n","import $ from 'jquery';\nimport _ from 'lodash';\nimport React, { Component } from 'react';\n// import logo from './logo.svg';\nimport { Drawer, Tooltip, Button, Input, List, Icon, Spin, Empty } from 'antd';\nimport TextInput from './TextInput';\nimport Centered from './Centered';\nimport SpinnerScreen from './SpinnerScreen';\nimport ConnectionEditor from './RoughJSConnectionEditor';\nimport NewsletterForm from './NewsletterForm';\nimport renderInput from './inputs/renderInput';\nimport { prepareResponse, getGraph, getMatrix, getUniqueValues, createCleanResponse } from '../util';\nimport db from '../db';\nimport * as examples from './data/examples';\nimport './SurveyApp.css';\nimport './SurveyAppTheme.css';\n\nlet { saveSvgAsPng } = require('save-svg-as-png');\n\nclass SurveyApp extends Component {\n constructor() {\n super();\n\n this.state = {\n ready: false,\n error: false,\n currentScreenIndex: -1,\n currentTagList: [],\n suggestions: [],\n survey: {\n focus: \"\",\n direction: \"upstream\",\n intro: \"\",\n intake: [],\n prompt1: \"\",\n prompt2: \"\",\n promptStory: \"\",\n thanks: \"\"\n },\n response: {\n email: '',\n story: '',\n tags: '',\n data: {\n values: [],\n otherEdges: []\n }\n },\n submissionStatus: null,\n submissionError: null\n }\n\n prepareResponse(this.state);\n\n // actions\n let actions = this.actions = {};\n\n actions.load = async (surveyID) => {\n let survey = await db.getSurvey(surveyID);\n\n if (survey) {\n this.screens = [];\n this.screens.push(() => this.renderIntroScreen());\n\n // TODO: move this into a helper\n // intake screen (only condition screen)\n let intake;\n\n if (survey.intake) {\n try {\n intake = JSON.parse(survey.intake);\n\n if (!Array.isArray(intake)) {\n console.log(\"Intake questionnaire must be an array\");\n intake = null;\n }\n } catch (error) {\n console.log(\"Error parsing intake questionnaire\");\n }\n }\n\n if (surveyID == 47 || surveyID == 48) {\n survey.showStoryScreen = false;\n survey.showNewsletterForm = false;\n } else {\n survey.showStoryScreen = true;\n survey.showNewsletterForm = true;\n }\n\n // https://github.com/kumu/kumu/issues/9176\n if (!survey.promptStory) {\n survey.showStoryScreen = false;\n }\n\n // https://github.com/kumu/kumu/issues/9176\n if (!survey.newsletter) {\n survey.showNewsletterForm = false;\n }\n\n // example intake form for testing\n // intake = require(\"./data/intake/ndis.json\");\n\n if (intake && intake.length > 0) {\n this.screens.push(() => this.renderIntakeScreen(intake));\n }\n\n this.screens.push(() => this.renderPrompt1Screen());\n this.screens.push(() => this.renderPrompt2Screen());\n this.screens.push(() => this.renderConnectionEditorScreen());\n\n if (survey.showStoryScreen) {\n this.screens.push(() => this.renderStoryScreen());\n }\n\n this.screens.push(() => this.renderReviewScreen());\n\n // TODO: if loading response need to call this.actions.refresh() after\n this.setState({ready: true, currentScreenIndex: 0, survey, surveyID});\n } else {\n console.error('unable to load survey', surveyID);\n this.setState({error: true});\n }\n }\n\n actions.loadExampleResponse = (index) => {\n let { response } = this.state;\n response = {...response, data: examples.list[index]};\n this.setState({ response }, actions.refresh);\n }\n\n actions.focusNextInput = () => {\n let emptyInputs = $(\".text-input input[type=text]\").filter((i, el) => !el.value);\n\n if (emptyInputs.length > 0) {\n emptyInputs[0].focus();\n }\n }\n\n actions.back = () => {\n let { currentScreenIndex } = this.state;\n currentScreenIndex = Math.max(currentScreenIndex - 1, 0);\n this.setState({ currentScreenIndex });\n document.body.focus(); // clear button focus\n }\n\n actions.next = () => {\n let { currentScreenIndex } = this.state;\n currentScreenIndex = Math.min(currentScreenIndex + 1, this.screens.length - 1);\n\n this.setState({ currentScreenIndex }, actions.focusNextInput);\n\n document.body.focus(); // clear button focus\n }\n\n actions.toggleTags = (index, tags) => {\n let { currentTagList } = this.state;\n\n currentTagList = [...currentTagList];\n currentTagList[index] = tags;\n\n this.setState({ currentTagList });\n }\n\n actions.saveTagsToResponse = (callback) => {\n let { currentTagList, response } = this.state;\n let tags = _(currentTagList).flatten().compact().join(\" \");\n\n response = { ...response, tags };\n\n this.setState({ response }, callback);\n }\n\n actions.edit = (path, value) => {\n let [ i, j ] = path;\n let { response } = this.state;\n\n if (path.length === 1) {\n response.data.values[i].value = value;\n } else {\n response.data.values[i].children[j].value = value;\n }\n\n prepareResponse(this.state);\n\n this.setState({ response });\n }\n\n actions.delete = (path) => {\n let [ i, j ] = path;\n let { response } = this.state;\n\n if (path.length === 1) {\n response.data.values = [\n ...response.data.values.slice(0, i),\n ...response.data.values.slice(i + 1)\n ]\n } else {\n response.data.values[i] = {\n ...response.data.values[i],\n children: [\n ...response.data.values[i].children.slice(0, j),\n ...response.data.values[i].children.slice(j + 1)\n ]\n }\n }\n\n prepareResponse(this.state);\n\n this.setState({ response });\n }\n\n actions.connect = (from, to) => {\n // TODO: this should be smart about how the connections are added\n // - first order to focus: modify response\n // - first order to second order: modify response\n // - all others: add as other edge\n let { response } = this.state;\n let edge = { from, to };\n\n response.data.otherEdges = [...response.data.otherEdges, edge];\n\n this.setState({ response });\n }\n\n actions.disconnect = (from, to) => {\n let { response } = this.state;\n response.data.otherEdges.pop();\n this.setState({ response });\n }\n\n actions.updateStory = (story) => {\n let { response } = this.state;\n response.story = story;\n this.setState({ response });\n }\n\n actions.updateEmail = (email) => {\n let { responseID } = this.state;\n db.updateResponse(responseID, { email });\n }\n\n actions.refresh = () => {\n let suggestions = getUniqueValues(this.state);\n this.setState({ suggestions });\n }\n\n actions.downloadScreenshot = () => {\n this.downloadScreenshot();\n }\n\n actions.submit = () => {\n let { surveyID } = this.state;\n let response = createCleanResponse(this.state.response);\n\n response.source = 'survey';\n\n console.log(\"submitting response\");\n console.log(\"response =\", JSON.stringify(response, null, ' '));\n\n this.setState({submissionStatus: 'pending'});\n\n db.createResponse(surveyID, response)\n .then(response => {\n console.log(\"response submitted successfully\", response);\n this.setState({submissionStatus: 'success', responseID: response.id});\n })\n .catch(error => {\n console.error(\"response submission failed\", error);\n this.setState({submissionStatus: 'error'});\n })\n }\n\n actions.abort = () => this.setState({submissionStatus: null});\n actions.resubmit = () => actions.submit();\n }\n\n componentWillMount() {\n let { surveyID } = this.props;\n this.actions.load(surveyID);\n\n // temporary workaround for style clash between survey app and admin app\n document.body.className += ' body-survey-app';\n\n document.addEventListener(\"keydown\", (event) => {\n let num = Number(event.key);\n\n if (Number.isInteger(num) && event.ctrlKey && event.target.tagName !== \"INPUT\") {\n this.actions.loadExampleResponse(num - 1);\n }\n })\n }\n\n // componentWillUpdate() {\n // let editor = document.getElementById('svg-connection-editor');\n //\n // if (editor) {\n // this.actions.downloadScreenshot();\n // }\n // }\n\n componentDidUpdate(prevProps, prevState) {\n if (this.state.currentScreenIndex !== prevState.currentScreenIndex) {\n $('button:focus').blur();\n this.actions.focusNextInput();\n\n // prevent initial input focus from pushing heading off the top for ios\n document.body.scrollTop = 0;\n }\n }\n\n render() {\n let { ready, error, currentScreenIndex, submissionStatus } = this.state;\n\n if (ready) {\n switch (submissionStatus) {\n case 'success': return this.renderSubmitSuccessScreen();\n case 'error': return this.renderSubmitErrorScreen();\n case 'pending': return this.renderSubmitPendingScreen();\n default: return this.renderScreen(currentScreenIndex);\n }\n } else if (error) {\n return ;\n } else {\n return ;\n }\n }\n\n // TODO: reset screen-body scroll after update\n renderScreen(index) {\n return this.screens[index]();\n }\n\n renderIntroScreen() {\n let { actions } = this;\n let { survey, surveyID } = this.state;\n\n let defaultIntro = `\n System Effects is a tool that allows\n us to aggregate and analyze user-generated system maps of a problem\n and its associated factors.\n\n Today we'll be using System Effects to explore ${survey.focus.toLowerCase()}.\n `\n\n let intro = survey.intro || defaultIntro;\n let introParagraphs = intro.split(/\\n\\n+/).map(p =>

    {p}

    );\n\n let logo = {\n 39: '/images/clarence-valley-council.jpg',\n }[surveyID];\n\n // uncomment to test logo\n // logo = '/images/clarence-valley-council.jpg';\n\n return (\n
    \n \n
    \n
    \n
    \n {logo && }\n\n

    \n \n\n {survey.name}\n

    \n\n
    \n {introParagraphs}\n
    \n
    \n
    \n
    \n \n \n \n
    \n
    \n
    \n
    \n );\n }\n\n renderIntakeScreen(intake) {\n let { actions } = this;\n\n const handleNext = () => {\n actions.saveTagsToResponse(() => {\n actions.next();\n });\n }\n\n let prompts = intake.map(({ type, prompt, placeholder, prefix, values }, index) => {\n let onChange = (values) => {\n if (!Array.isArray(values)) values = [values];\n\n // TODO: should we remove whitespace? upcase?\n let tags = values\n .filter(value => value)\n .map(value => `${prefix}:${value}`);\n\n actions.toggleTags(index, tags);\n }\n\n let input = renderInput(type, { prefix, values, placeholder, onChange });\n\n return (\n
    \n

    {prompt}

    \n {input}\n
    \n )\n })\n\n return (\n
    \n
    \n
    \n
    \n

    \n Before we get started, please answer the following:\n

    \n\n
    \n {prompts}\n
    \n
    \n
    \n
    \n \n {/*\n \n */}\n\n \n \n
    \n
    \n
    \n );\n }\n\n renderPrompt1Screen() {\n let { actions } = this;\n let { survey, response } = this.state;\n let { values } = response.data;\n\n let inputs = values.map((entry, i) => {\n let { value, children } = entry;\n let placeholder = \"\";\n\n const edit = (value) => {\n actions.edit([i], value);\n }\n\n const destroy = () => {\n actions.delete([i]);\n }\n\n return (\n
  • \n
    \n \n \n
    \n
  • \n )\n })\n\n return (\n
    \n
    \n

    {survey.prompt1}

    \n
    \n
    \n
      \n {inputs}\n
    \n
    \n
    \n
    \n \n {/*\n \n */}\n\n \n \n
    \n
    \n
    \n );\n }\n\n renderPrompt2Screen() {\n let { actions } = this;\n let { survey } = this.state;\n\n return (\n
    \n
    \n

    \n {survey.prompt2}\n \n

    \n\n
    \n
    \n {this.renderBarrierCausesForm()}\n
    \n
    \n\n
    \n
    \n \n \n\n \n \n
    \n
    \n
    \n
    \n );\n }\n\n renderBarrierCausesForm() {\n let { actions } = this;\n let { survey, suggestions, response } = this.state;\n let { values } = response.data;\n\n // strip last blank input since we're not letting people edit the root value now\n // inputs = inputs.slice(0, inputs.length - 1);\n values = values.filter(entry => entry.value);\n\n let inputs = values.map((entry, i) => {\n let { value, children } = entry;\n let parentValue = value;\n let label;\n\n const edit = (value) => {\n actions.edit([i], value);\n }\n\n if (survey.direction === 'upstream') {\n // I have no time because... (upstream causes)\n label = `${parentValue} because...`;\n } else {\n // Harder to find language that works for all values here\n // - Because I have no time... (downstream effects)\n // - Because do not own car...\n // - Because stress...\n label = parentValue;\n }\n\n let items = children.map((entry, j) => {\n let { value } = entry;\n let placeholder = \"\";\n\n if (parentValue) {\n if (survey.direction === 'upstream') {\n // I have no time because... (upstream causes)\n // placeholder = `${parentValue} because...`;\n placeholder = '';\n } else {\n // Harder to find language that works for all values here\n // - Because I have no time... (downstream effects)\n // - Because do not own car...\n // - Because stress...\n placeholder = ``;\n }\n }\n\n const edit = (value) => {\n actions.edit([i, j], value);\n }\n\n const destroy = () => {\n actions.delete([i, j]);\n }\n\n const refresh = () => {\n actions.refresh();\n }\n\n return (\n
  • \n
    \n \n \n
    \n
  • \n )\n })\n\n return (\n
  • \n
    \n {label}\n {/**/}\n
    \n
      \n {items}\n
    \n
  • \n )\n })\n\n return (\n
      \n {inputs}\n
    \n );\n }\n\n renderConnectionEditorScreen() {\n let { actions } = this;\n let graph = getGraph(this.state);\n\n const handleEdgeCreated = (edge) => {\n actions.connect(edge.from.id, edge.to.id);\n }\n\n const handleEdgeCreatedUndo = (edge) => {\n actions.disconnect(edge.from.id, edge.to.id);\n }\n\n const handleUndo = () => {\n this.refs.editor.actions.undo();\n }\n\n return (\n
    \n
    \n

    \n Please review the connections you identified in the previous steps.\n Any missing connections you would like to add?\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 renderStoryScreen() {\n let { actions } = this;\n let { survey, response } = this.state;\n\n let defaultPrompt = `Would you mind sharing a personal story about how ${survey.focus.toLowerCase()} has affected you?`\n let prompt = survey.promptStory || defaultPrompt;\n\n const handleChange = (event) => actions.updateStory(event.target.value);\n\n return (\n
    \n \n
    \n

    \n
    \n {prompt}\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 renderReviewScreen() {\n let { actions } = this;\n let { survey } = this.state;\n\n return (\n
    \n \n
    \n

    \n Well done!\n

    \n\n
    \n
    \n

    \n If you would like to review or edit your response you are\n welcome to do so now.\n

    \n\n

    \n When you're ready to submit your response please click the\n submit button below.\n

    \n
    \n
    \n\n
    \n
    \n \n \n\n \n \n
    \n
    \n
    \n
    \n
    \n );\n }\n\n renderSubmitPendingScreen() {\n return ;\n }\n\n renderSubmitSuccessScreen() {\n let { actions } = this;\n let { survey } = this.state;\n\n const handleSubmit = email => actions.updateEmail(email);\n\n return (\n
    \n \n
    \n
    \n
    \n
    \n \n
    \n

    Response saved

    \n

    \n {survey.showNewsletterForm && }\n

    \n
    \n
    \n
    \n
    \n );\n }\n\n renderSubmitErrorScreen() {\n let { actions } = this;\n\n return (\n
    \n \n
    \n
    \n

    Sorry, we weren't able to save your response

    \n
    \n\n
    \n \n\n \n
    \n
    \n
    \n
    \n );\n }\n\n // https://www.npmjs.com/package/save-svg-as-png\n downloadScreenshot() {\n let svg = document.getElementById('svg-connection-editor');\n\n if (!svg) return;\n\n let svgOffset = $(svg).offset();\n let scene = svg.childNodes[1];\n let bounds = scene.getBoundingClientRect();\n\n let padding = 20;\n\n // pass canvg for IE support?\n let options = {\n encoderType: 'image/png',\n encoderOptions: 1,\n scale: 3,\n backgroundColor: '#ffffff',\n top: bounds.top - svgOffset.top - padding,\n left: bounds.left - svgOffset.left - padding,\n width: bounds.width + 2 * padding,\n height: bounds.height + 2 * padding,\n }\n\n saveSvgAsPng(svg, \"system-effects-screenshot.png\", options);\n }\n}\n\nexport default SurveyApp;\n","import React, { Component } from 'react';\nimport { HashRouter as Router, Switch, Route, Link } from 'react-router-dom';\nimport { Drawer, Button, List, Icon, Spin, notification } from 'antd';\nimport LandingPage from './landing/LandingPage';\nimport Privacy from './legal/Privacy';\nimport Terms from './legal/Terms';\nimport GDPR from './legal/GDPR';\nimport AdminApp from './admin/AdminApp';\nimport SurveyApp from './survey/SurveyApp';\nimport './App.css';\n\nclass App extends Component {\n render() {\n return (\n \n \n \n \n \n \n \n \n \n \n )\n }\n\n renderSurvey = ({ match }) => {\n return ;\n }\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read http://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit http://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See http://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","// import 'react-app-polyfill/ie11';\nimport 'core-js/stable'; // the react-app-polyfills don't include things like Array.findIndex\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport 'normalize.css';\nimport 'antd/dist/antd.css';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: http://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}