{"version":3,"sources":["utils/countryLookup.js","DataLoader.js","utils/getSelectionsFromParams.js","utils/gradient.js","images/arrow-down.svg","images/arrow-up.svg","utils/smallWidthMode.js","HistoricalBubbleGraph/index.js","Tooltip/index.js","Map/MapRenderer.js","Map/scaleProjection.js","images/globe.svg","Map/index.js","Legends/index.js","Overview/index.js","InlineButtons/index.js","CountrySelect/index.js","InsightsView/index.js","images/factor_icons/Factor1.svg","images/factor_icons/factorImages.js","images/factor_icons/Factor2.svg","images/factor_icons/Factor3.svg","images/factor_icons/Factor4.svg","images/factor_icons/Factor5.svg","images/factor_icons/Factor6.svg","images/factor_icons/Factor7.svg","images/factor_icons/Factor8.svg","images/factor_icons/Factor1_grey.svg","images/factor_icons/Factor2_grey.svg","images/factor_icons/Factor3_grey.svg","images/factor_icons/Factor4_grey.svg","images/factor_icons/Factor5_grey.svg","images/factor_icons/Factor6_grey.svg","images/factor_icons/Factor7_grey.svg","images/factor_icons/Factor8_grey.svg","CountryFactorBarGraph/index.js","Factors/index.js","utils/getShortCountryLabel.js","GlobalInsights/GlobalInsightsTable.js","GlobalInsights/GlobalInsightsHistorical.js","GlobalInsights/GlobalInsightsRanking.js","images/lightbulb-icon.svg","GlobalInsights/GlobalInsights.js","GlobalInsights/index.js","CountryFactorFillGraph/CountryFactorFillGraphTooltip.js","CountryFactorFillGraph/index.js","images/arrow-down-dark.svg","images/arrow-up-dark.svg","CountryInsights/CountryCardOverall.js","CountryInsights/CountryCardRanks.js","SingleFillGraph/index.js","CountryInsights/CountryCardFactors.js","CountryInsights/CountryCardCOT.js","CountryInsights/index.js","DownArrow.js","Insights/InsightsHeader.js","images/aboutBackground.png","images/slideshow/about_slideshow1_slide1.png","images/slideshow/21-OCT_Slide-1_02.jpg","images/slideshow/21-OCT_Slide-1_03.jpg","images/slideshow/about_slideshow1_slide3.png","images/slideshow/21-OCT_Slide-1_05.jpg","images/slideshow/21-OCT_Slide-1_06.jpg","images/slideshow/21-OCT_Slide-2_01.jpg","images/slideshow/21-OCT_Slide-2_02.png","images/slideshow/21-OCT_Slide-2_03.jpg","images/slideshow/21-OCT_Slide-2_04.jpg","images/slideshow/21-OCT_Slide-2_05.png","images/slideshow/21-OCT_Slide-2_06.jpg","images/slideshow/21-OCT_Slide-2_07.png","images/slideshow/whoUsesSlide00.jpg","images/slideshow/whoUsesSlide01.jpg","images/slideshow/whoUsesSlide02.jpg","images/slideshow/whoUsesSlide03.jpg","images/slideshow/whoUsesSlide04.jpg","images/slideshow/whoUsesSlide05.jpg","About/index.js","images/insightsBackground.png","Insights/images/graph-global-decline.png","Insights/images/map-global-decline.png","Insights/images/legend.svg","Insights/images/piechart-access-to-justice.png","Insights/images/map-access-to-justice.png","Insights/images/global-decline-piechart.png","Insights/images/map-global-score-2024.png","Insights/images/long-term-trend-graph.png","Insights/images/lineGraphLegend.svg","Insights/images/electionsChart.png","Insights/index.js","routes.js","images/share/fbShare.svg","images/share/twitterShare.svg","images/share/emailShare.svg","images/share/linkedinShare.svg","images/share/linkShare.svg","ShareButtons/index.js","images/pdfIcon.svg","images/csvIcon.svg","DownloadMenu/index.js","Nav/index.js","App.js","index.js"],"names":["countries","name","code","id","getCountryByName","find","n","getCountryByCode","c","getName","years","factors","defaultCountry","defaultFactor","defaultYear","length","groupAttributes","countryCodeValidation","dataLoaderInstance","constructor","getCopy","memoize","this","_getCopy","_loadWorldMap","response","fetch","data","json","w","feature","objects","features","filter","d","_getCountryByCode","properties","WB_NAME","WB_A3","undefined","worldMap","_loadCopy","text","copy","csvParse","trim","_loadPercentChange","percentChange","key","row","Original","Final","console","warn","_validate","Object","keys","forEach","country","load","dataByYear","responsesByYear","Promise","all","map","async","year","csvParseRows","processData","yearIndex","rows","questionKeys","aggregateFactorKeys","rowIndex","header","columns","slice","column","columnIndex","value","questionKeyMatches","match","questionKey","factorKey","includes","push","overall","Country","yearlyData","groups","groupAverages","groupAttribute","grouped","_ref","groupKey","groupItems","groupResponses","question","mean","factorNumber","factor","questions","q","group","averageFactors","allQuestionKeys","global","countriesInThePreviousYear","groupsToSort","array","previousYear","previousYearData","p","previousYearCountry","thisYear","lastYear","difference","_ref2","sortedArray","sort","a","b","countryIndex","_ref3","_","countriesInGroup","sortedGroup","setupYearsForCountries","processPercentChange","yearsForCountries","percentChangeRow","latestYearData","percentChangeCountry","matchingCountry","externalPercentChange","parseFloat","getSelectionsFromParams","params","selectedYear","selectedCountry","selectedFactor","opts","opt1","opt2","opt3","opt4","unusedOpts","optEncoded","opt","decodeURIComponent","DataLoader","gradientColors","offset","hex","scaleLinear","domain","range","useSmallWidthMode","window","innerWidth","useMediumWidthMode","HistoricalBubbleGraph","props","scoreKey","smallVersion","ref","containerDimensions","useDimensions","margins","useMemo","left","right","top","bottom","containerWidth","Math","min","max","width","containerHeight","height","historicalData","datum","xScale","dataExtent","extent","yScale","gridlines","Array","from","index","yValue","_jsx","x1","x2","y1","y2","stroke","strokeDasharray","yearDots","score","x","yClamped","fill","gradient","label","yearLabel","_jsxs","transform","fontColor","children","dy","y","substr","valueLabel","toFixed","replace","fontWeight","r","polylinePoints","join","className","points","defaultProps","scaleBarWidth","scaleBarWidthSmallMode","scaleBarMargins","scaleBarHeight","mapSize","Tooltip","colorByPercentDifferenceData","windowScroll","useWindowScroll","wrapperRef","wrapperMeasure","useMeasure","isVisible","setIsVisible","useState","clickInstructionsVisible","setClickInstructionsVisible","inSmallMode","tooltipEle","document","querySelector","mapCountryData","scoreColor","percentChangeColorScale","factorIndexLabel","scoreKeyMatch","indexOf","split","useEffect","tooltipMessage","showTimeout","setTimeout","clickInstructionsTimeout","clearTimeout","_x","_y","flipX","flipY","innerHeight","tooltipStyle","opacity","transition","selectedYearIndex","icons","overallCOTIcon","globalRankCOTIcon","regionalRankCOTIcon","incomeRankCOTIcon","previousYearScore","globalRankIndexedByLastYearsCountriesOnly","regionRankIndexedByLastYearsCountriesOnly","incomeRankIndexedByLastYearsCountriesOnly","src","arrowUp","alt","arrowDown","scaleBarWidthToUse","createPortal","style","color","stopColor","mask","cx","cy","strokeWidth","textAnchor","Map","visibleCountries","overrideFill","marginLeft","marginRight","Region","Count_Global","Count_Region","backgroundColor","React","Fragment","showHistoricalPlot","onClick","gotoDetails","hideTooltip","classnames","visible","closeTooltip","MapRenderer","translate","scale","_useState","_useState2","_slicedToArray","hoveredCountry","setHoveredCountry","hoverCountry","event","tooltipEnabled","pageX","pageY","touches","preventDefault","stopPropagation","gotoCountryPage","info","countryData","originalDatum","addEventListener","removeEventListener","overflow","concat","countryOpacity","pointOpacity","paths","strokedCountries","customStroke","defaultStroke","defaultStrokeWidth","colorByData","percentDifferenceColor","defaultFill","active","onMouseOver","onMouseMove","onMouseOut","onTouchEnd","labelOpacity","selectedLabels","line3Label","showPercentDifferenceLabel","overall_percentDifference","rank","count","center","toUpperCase","_objectSpread","filterGeometry","geometry","filterByDeviation","arguments","target","assign","type","innerCoordinates","coordinates","coordinateFilter","i","floor","deviation","filteredCoordinates","maxGeometry","scaleProjection","projection","geoMercator","rotate","path","geoPath","dx","_getBounds","maxBounds","bounds","getBounds","highResolution","standaloneWorld","updateTransform","selectedRegion","geography","f","toString","updatePaths","_features","mapId","_path$centroid","centroid","_path$centroid2","getCenter","memoizedNewPaths","regionIds","geoIds","measured","initTransform","to","transformState","matchTransform","setMapSize","_measure","nextWidth","nextHeight","parent","current","getBoundingClientRect","debouncedMeasure","debounce","leading","trailing","cloneDeep","all_features","targetGeography","_memoizedNewPaths","_memoizedNewPaths2","updatedPaths","assignData","animate","useWidth","fromTransform","interpolator","interpolateZoom","Spring","config","duration","easing","easeQuadInOut","reset","t","onStart","onRest","start","end","time","view","globeButton","allowZoomOut","targetHeight","translateX","mapScale","translateY","globeButtonStyle","globeIcon","position","formatter","format","getXScale","ticks","padding","SVGGradient","sideLabelY","LegendContainer","GradientLegend","_getXScale2","PercentChangeLegend","percentChangeScale","availWidth","tickWidth","tickPadding","emptyArray","currentYear","toTransform","smallWidthMode","body","clientWidth","colors","overviewShownOnce","InlineButtons","options","_toConsumableArray","reverse","instruction","unshift","option","pointerEvents","setValue","selected","unselectedCountryLabel","renderSuggestion","suggestion","startsWith","word","prefix","wordLower","toLowerCase","prefixLower","prefixLength","countrySortWithValue","aCountry","bCountry","aStartsWith","bStartsWith","CountrySelect","selectOpen","setSelectOpen","_useState3","_useState4","currentTypedInputValue","setCurrentTypedInputValue","_useState5","_useState6","currentSuggestions","setCurrentSuggestions","containerRef","useRef","inputRef","focus","close","clear","useOnClickOutside","onClearButton","onClear","autoselect","AutoSuggest","suggestions","onSuggestionsFetchRequested","input","getSuggestionValue","inputProps","onChange","newValue","alwaysRenderSuggestions","onSuggestionSelected","suggestionValue","onSuggestionHighlighted","_ref4","onHighlight","renderInputComponent","clearButton","focusInputOnSuggestionClick","open","defaultEmptyRegionSelection","mapStrokeOutline","setOverrideMapVisibility","InsightsView","mapRef","mapDimensions","useParams","history","useHistory","location","useLocation","otherProps","updateUrlFromEvent","property","updateUrl","useCallback","newUrlParams","baseUrl","pathname","url","encodeURIComponent","selectCountryFromMinimap","onGlobalInsights","onCountryInsights","showGlobalInsightsInstructions","setShowGlobalInsightsInstructions","mainMapInteractable","setMainMapInteractable","timeoutId","toggleGlobalInsightsInstructions","currentYearData","k","mapData","miniMapWidth","headerHeight","miniMapHeight","isNaN","sidebarMap","scrollbarSize","useScrollbarWidth","mapWidth","mobile","useSmallerMapHeight","mapMaxHeight","mapSizeBasedOnWidth","fullscreenMapHeight","scrollTo","fade","setFade","factorOptions","yearSelectOptions","factorSelectOptions","naturalMapScale","pow","showSelectCountryNotice","showMiniMap","displaySidebarMap","listItem","listItemHeight","offsetHeight","helpItem2Offset","fullscreenMap","instructionsStyle","itemPositions","totalBoundingBox","items","selector","el","boundingBox","reduce","acc","item","Infinity","interactiveInstructionsStyle","firstItemCenterX","innerInstructionsStyle","innerInteractiveInstructionsStyle","helpIconXOffset","helpIconYOffset","gloalInsightsInstructionsPointerEvents","display","marginTop","globalInsightInstructions","classNames","e","borderBottom","factorIndex","instructions","arrow","cloneElement","factorImages","CountryFactorBarGraph","tooltipData","setTooltipData","title","_useDimensions","_useDimensions2","_useIsInViewport","useIsInViewport","_useIsInViewport2","isInViewPort","wrappedRef","isPrinting","useDetectPrint","axis","graphContents","clientX","clientY","countriesSortedByScore","countriesSortedAlpha","barWidth","selectedValues","getBarDimensions","countryScoreIndex","findIndex","barHeight","countryIsSelected","rankAttribute","bars","useTransition","enter","update","immediate","state","springProps","animated","rect","yTicksValues","selectedValueTransition","yTicks","tick","tickIndex","tickSize","majorTickSize","selectedCountryScorePercentage","countryLabelTextAnchor","countryLabelTextOffset","selectedValueIndicator","g","fontStyle","stdDeviation","floodColor","memo","factorHeaderLabels","Factors","containerNode","factorGraphRef","inSmallWidthMode","factorSelected","cardFactorIndex","factorDisplay","subfactor","subfactorIndex","subfactorKey","textKey","subfactorText","ReactMarkdown","source","nextFactorValue","nextFactorLabel","nextFactorButton","factorTitle","cachedRef","observer","IntersectionObserver","intersectionRatio","threshold","observe","unobserve","documentElement","behavior","scrollHeight","factorText","Helmet","content","marginBottom","labels","getShortCountryLabel","GlobalInsightsTable","selectedFilterIncome","selectedFilterRegion","selectedSortOrder","selectedCountryRef","scrollDomNode","scrollOffset","scrollTop","scrollToCountryNeeded","rowHeight","globalInsightsConstants","labelRankPadding","sidePadding","svgHeight","sidePaddingToUse","svgWidth","sortScoreKey","sortedRank","labelWidth","labelWidthPercentage","minLabelWidth","fullBarWidth","allFactors","factorWidth","getTransitionValues","totalTransitions","numberTransitionsCompleted","countryGroups","textY","bgRect","topMargins","countryTextStyle","cursor","factorBoxes","rankLabel","boxPadding","interpolate","headerLabelsOnOneLine","tableHeaderHeight","headerTop","primary","selectFactor","factorToSet","headers","textFill","labelValues","singleRowFactorLabels","labelIndex","fontSize","GlobalInsightsHistorical","labelRankWidth","yearsToUse","countryDatum","bValue","aValue","yearWidth","radiusScale","scaleSqrt","countPerYear","showTooltip","result","countryPoints","yearsWithData","tries","xy","distance","Number","MAX_SAFE_INTEGER","yearIndexToTry","yearToTry","potentialDistance","abs","countryLine","point","yearsCircles","circle","numberOfBackgroundRects","ceil","backgroundRects","overrideRegionFilter","sortedCountries","countryIndicies","maxValue","valueLabelWidth","getSpringValues","_transition$props","countryLabelWeight","countryLabel","labelSubstitutions","GlobalInsights","setFilterRegion","setFilterIncome","setSortOrder","mouseOverFilter","setMouseOverFilter","controlsRef","useLayoutEffect","selectView","globalInsightButtons","GlobalInsightsRanking","matchingButton","updateFromSelect","setter","hoverFilter","regionValues","regionOptions","incomeValues","incomeOptions","regionFilterOpacity","incomeFilterOpacity","showSortSelect","sortStyle","maxWidth","flexDirection","helpIcon","toggleHelp","fullBarWidthPercentage","printFullWidth","printHalfWidth","CountryFactorFillGraph","_useSpring","useSpring","_useSpring2","setSelectedValues","printStyle","getTrianglePositions","hovered","triangleTransitions","attribute","groupValue","getGroupPositions","groupTransitions","triangles","polygon","groupLines","groupIndex","_item$props","textX","v","gradientId","random","line","viewBox","CountryFactorFillGraphTooltip","CountryCardOverall","overallTitle","overallColor","globalRank","regionRank","incomeRank","globalDemoninator","regionDemoninator","incomeDenominator","rankChange","scoreChange","hasPreviousYearData","rankChangeIcon","scoreChangeIcon","arrowUpDark","arrowDownDark","previousYearGlobalRank","previousYearRegionRank","previousYearIncomeRank","values","setValues","href","span","s","round","valueSignless","valueWithSign","CountryCardRanks","selectedRankAttribute","setRankAttribute","ordinal","rankCount","graphTitle","SingleFillGraph","defs","leftMargin","spring","set","maskId","leftAxisLabel","rightAxisLabel","CountryCardFactors","previousFactors","setPreviousFactors","factorSort","setFactorSort","factorsExpanded","setFactorsExpanded","isEqual","sortOptions","factorsSorted","_useSprings","useSprings","regionalRank","regionalRankCount","incomeRankCount","globalRankCount","_useSprings2","factorSprings","setFactorValues","factorDivs","_factorSprings$factor","factorParts","factorName","expandCollapseButton","scoreCOTIcon","gotoFactorPageCallback","subfactors","isLink","CountryCardCOT","minMaxYear","yearSpan","cotText","links","CountryInsights","scrollyRef","scrollyContainerDimensions","scrollNode","_useDimensions3","_useDimensions4","defaultMapRef","defaultMapDimensions","selectedFactorScoreKey","previousSelectedFactor","message","mapHeight","scrollIntoView","link","factorDescription","linkAnchor","xmlns","DownArrow","InsightsHeader","backgroundImage","borderBottomColor","factorColors","slides1","description","_Fragment","image","slide0Image","slide1Image","longestTitle","longestDescription","slide2Image","slide3Image","slide4Image","slide5Image","slides2","secondSlide0Image","secondSlide1Image","secondSlide2Image","secondSlide3Image","secondSlide4Image","secondSlide5Image","secondSlide6Image","slidesWhoUsesIndex","whoUsesSlide0Image","whoUsesSlide1Image","whoUsesSlide2Image","whoUsesSlide3Image","whoUsesSlide4Image","whoUsesSlide5Image","pastLinks","nonCoveredYears","Next","disabled","onMouseDown","Previous","Arrow","Slideshow","slides","navlink","currentSlide","setCurrentSlide","nextSlide","showStartButton","maxContentWidth","buttons","imageSize","imageContainerSize","activeSlide","translation","progress","padStart","slide","noStretch","loading","portrait","Insight","insights","graphGlobalDecline","mapGlobalDecline","legend","pieChartAccessToJustice","globalScoreAccess","pieChartHumanRightsInTrouble","globalScoreRights","lineGraphLegend","longTermTrendGraph","electionsChart","margin","routes","route","component","navHeight","navRef","locationKey","setLocationKey","legendContainer","metrics","setMetrics","baseWidth","baseHeight","activeWidth","activeHeight","setColorByData","slideData","showModal","setShowModal","priorYear","gradientScale","overall_Rank_Global","radius","updateData","mapOpacity","setMapOpacity","background","zIndex","Link","hide","loaded","setLoaded","hasInsights","scroller","hash","element","insightsBackground","logInsights","gtag","event_category","event_label","rel","maxYear","logDownload","aboutBackgroundImage","factorSubfactors","borderColor","order","yearLink","routesReversed","share","site","selections","latestYear","origin","process","createElement","appendChild","select","execCommand","removeChild","alert","ShareButtons","toggle","copiedToClipboard","setCopiedToClipboard","rightAlign","facebook","twitter","email","linkedin","linkShare","globalLinks","DownloadMenu","showCountryDownloads","linker","eventLabel","pdfIcon","csvIcon","countrySpecificContent","pdfUrl","transposeCountryData","keyMatcher","_key1","_key2","key1","key2","subfactorRE","key1Match","key2Match","csv","csvFormat","blob","Blob","URL","createObjectURL","setAttribute","visibility","click","Nav","modalOpen","setModalOpen","shareMenuOpen","setShareMenuOpen","downloadMenuOpen","setDownloadMenuOpen","page","page_location","charAt","page_title","activeRoute","isSmallWidthMode","closeModal","noSpace","toggleShareMenu","toggleDownloadMenu","countrySpecificPage","downloadButtonLabel","shareButtonWrapperRef","downloadButtonWrapperRef","toggleMenuModal","ShareMenu","App","isLoading","setIsLoading","finally","updateFade","bool","basename","Router","Route","Switch","container","getElementById","createRoot","render"],"mappings":"y3BAEA,MAAMA,EAAY,CAChB,CAAEC,KAAM,cAAeC,KAAM,MAAOC,GAAI,OACxC,CAAEF,KAAM,UAAWC,KAAM,MAAOC,GAAI,OACpC,CAAEF,KAAM,UAAWC,KAAM,MAAOC,GAAI,OACpC,CAAEF,KAAM,SAAUC,KAAM,MAAOC,GAAI,OACnC,CAAEF,KAAM,sBAAuBC,KAAM,MAAOC,GAAI,OAChD,CAAEF,KAAM,YAAaC,KAAM,MAAOC,GAAI,OACtC,CAAEF,KAAM,YAAaC,KAAM,MAAOC,GAAI,OACtC,CAAEF,KAAM,UAAWC,KAAM,MAAOC,GAAI,OACpC,CAAEF,KAAM,cAAeC,KAAM,MAAOC,GAAI,OACxC,CAAEF,KAAM,aAAcC,KAAM,MAAOC,GAAI,OACvC,CAAEF,KAAM,WAAYC,KAAM,MAAOC,GAAI,OACrC,CAAEF,KAAM,UAAWC,KAAM,MAAOC,GAAI,OACpC,CAAEF,KAAM,UAAWC,KAAM,MAAOC,GAAI,OACpC,CAAEF,KAAM,SAAUC,KAAM,MAAOC,GAAI,OACnC,CAAEF,KAAM,QAASC,KAAM,MAAOC,GAAI,OAClC,CAAEF,KAAM,UAAWC,KAAM,MAAOC,GAAI,OACpC,CAAEF,KAAM,yBAA0BC,KAAM,MAAOC,GAAI,OACnD,CAAEF,KAAM,WAAYC,KAAM,MAAOC,GAAI,OACrC,CAAEF,KAAM,SAAUC,KAAM,MAAOC,GAAI,OACnC,CAAEF,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AC+7B,IAAM,CAAA76B,SACJ21B,GAAe7+B,KAAI,SAACk3B,GAAI,OACvBlvB,cAAC87B,IAAK,CAACtwB,KAAM0jB,EAAK4E,MAAM5yB,SACtBlB,cAACkvB,EAAK6E,UAAS,CACbE,OAAQA,EACRzb,KAAMA,EACNC,QAASijB,KAJiBxM,EAAKtY,IAM3B,SAKhB5W,cAAA,OAAK7L,GAAG,cAGd,EC5CM6nC,I,OAAY74B,SAAS84B,eAAe,SAC7BC,qBAAWF,IACnBG,OAAOn8B,cAACs7B,GAAG,I","file":"static/js/main.c8786301.chunk.js","sourcesContent":["import { getName } from \"country-list\"\n\nconst countries = [\n { name: \"Afghanistan\", code: \"AFG\", id: \"004\" },\n { name: \"Albania\", code: \"ALB\", id: \"008\" },\n { name: \"Algeria\", code: \"DZA\", id: \"012\" },\n { name: \"Angola\", code: \"AGO\", id: \"024\" },\n { name: \"Antigua and Barbuda\", code: \"ATG\", id: \"028\" },\n { name: \"Argentina\", code: \"ARG\", id: \"032\" },\n { name: \"Australia\", code: \"AUS\", id: \"036\" },\n { name: \"Austria\", code: \"AUT\", id: \"040\" },\n { name: \"The Bahamas\", code: \"BHS\", id: \"044\" },\n { name: \"Bangladesh\", code: \"BGD\", id: \"050\" },\n { name: \"Barbados\", code: \"BRB\", id: \"052\" },\n { name: \"Belarus\", code: \"BLR\", id: \"112\" },\n { name: \"Belgium\", code: \"BEL\", id: \"056\" },\n { name: \"Belize\", code: \"BLZ\", id: \"084\" },\n { name: \"Benin\", code: \"BEN\", id: \"204\" },\n { name: \"Bolivia\", code: \"BOL\", id: \"068\" },\n { name: \"Bosnia and Herzegovina\", code: \"BIH\", id: \"070\" },\n { name: \"Botswana\", code: \"BWA\", id: \"072\" },\n { name: \"Brazil\", code: \"BRA\", id: \"076\" },\n { name: \"Bulgaria\", code: \"BGR\", id: \"100\" },\n { name: \"Burkina Faso\", code: \"BFA\", id: \"854\" },\n { name: \"Cambodia\", code: \"KHM\", id: \"116\" },\n { name: \"Cameroon\", code: \"CMR\", id: \"120\" },\n { name: \"Canada\", code: \"CAN\", id: \"124\" },\n { name: \"Chile\", code: \"CHL\", id: \"152\" },\n { name: \"China\", code: \"CHN\", id: \"156\" },\n { name: \"Colombia\", code: \"COL\", id: \"170\" },\n { name: \"Congo, Dem. Rep.\", code: \"COD\", id: \"180\" },\n { name: \"Costa Rica\", code: \"CRI\", id: \"188\" },\n { name: \"Côte d'Ivoire\", code: \"CIV\", id: \"384\" },\n { name: \"Croatia\", code: \"HRV\", id: \"191\" },\n { name: \"Czechia\", code: \"CZE\", id: \"203\" },\n { name: \"Denmark\", code: \"DNK\", id: \"208\" },\n { name: \"Dominica\", code: \"DMA\", id: \"212\" },\n { name: \"Dominican Republic\", code: \"DOM\", id: \"214\" },\n { name: \"Ecuador\", code: \"ECU\", id: \"218\" },\n { name: \"Egypt, Arab Rep.\", code: \"EGY\", id: \"818\" },\n { name: \"El Salvador\", code: \"SLV\", id: \"222\" },\n { name: \"Estonia\", code: \"EST\", id: \"233\" },\n { name: \"Ethiopia\", code: \"ETH\", id: \"231\" },\n { name: \"Finland\", code: \"FIN\", id: \"246\" },\n { name: \"France\", code: \"FRA\", id: \"250\" },\n { name: \"Georgia\", code: \"GEO\", id: \"268\" },\n { name: \"Germany\", code: \"DEU\", id: \"276\" },\n { name: \"Ghana\", code: \"GHA\", id: \"288\" },\n { name: \"Greece\", code: \"GRC\", id: \"300\" },\n { name: \"Grenada\", code: \"GRD\", id: \"308\" },\n { name: \"Guatemala\", code: \"GTM\", id: \"320\" },\n { name: \"Guinea\", code: \"GIN\", id: \"324\" },\n { name: \"Guyana\", code: \"GUY\", id: \"328\" },\n { name: \"Honduras\", code: \"HND\", id: \"340\" },\n { name: \"Hong Kong SAR, China\", code: \"HKG\", id: \"344\" },\n { name: \"Hungary\", code: \"HUN\", id: \"348\" },\n { name: \"India\", code: \"IND\", id: \"356\" },\n { name: \"Indonesia\", code: \"IDN\", id: \"360\" },\n { name: \"Iran, Islamic Rep.\", code: \"IRN\", id: \"364\" },\n { name: \"Italy\", code: \"ITA\", id: \"380\" },\n { name: \"Jamaica\", code: \"JAM\", id: \"388\" },\n { name: \"Japan\", code: \"JPN\", id: \"392\" },\n { name: \"Jordan\", code: \"JOR\", id: \"400\" },\n { name: \"Kazakhstan\", code: \"KAZ\", id: \"398\" },\n { name: \"Kenya\", code: \"KEN\", id: \"404\" },\n { name: \"Kyrgyz Republic\", code: \"KGZ\", id: \"417\" },\n { name: \"Lebanon\", code: \"LBN\", id: \"422\" },\n { name: \"Liberia\", code: \"LBR\", id: \"430\" },\n { name: \"North Macedonia\", code: \"MKD\", id: \"807\" },\n { name: \"Madagascar\", code: \"MDG\", id: \"450\" },\n { name: \"Malawi\", code: \"MWI\", id: \"454\" },\n { name: \"Malaysia\", code: \"MYS\", id: \"458\" },\n { name: \"Mali\", code: \"MLI\", id: \"466\" },\n { name: \"Mauritania\", code: \"MRT\", id: \"478\" },\n { name: \"Mauritius\", code: \"MUS\", id: \"480\" },\n { name: \"Mexico\", code: \"MEX\", id: \"484\" },\n { name: \"Moldova\", code: \"MDA\", id: \"498\" },\n { name: \"Mongolia\", code: \"MNG\", id: \"496\" },\n { name: \"Morocco\", code: \"MAR\", id: \"504\" },\n { name: \"Mozambique\", code: \"MOZ\", id: \"508\" },\n { name: \"Myanmar\", code: \"MMR\", id: \"104\" },\n { name: \"Namibia\", code: \"NAM\", id: \"516\" },\n { name: \"Nepal\", code: \"NPL\", id: \"524\" },\n { name: \"Netherlands\", code: \"NLD\", id: \"528\" },\n { name: \"New Zealand\", code: \"NZL\", id: \"554\" },\n { name: \"Nicaragua\", code: \"NIC\", id: \"558\" },\n { name: \"Niger\", code: \"NER\", id: \"562\" },\n { name: \"Nigeria\", code: \"NGA\", id: \"566\" },\n { name: \"Norway\", code: \"NOR\", id: \"578\" },\n { name: \"Pakistan\", code: \"PAK\", id: \"586\" },\n { name: \"Panama\", code: \"PAN\", id: \"591\" },\n { name: \"Peru\", code: \"PER\", id: \"604\" },\n { name: \"Philippines\", code: \"PHL\", id: \"608\" },\n { name: \"Poland\", code: \"POL\", id: \"616\" },\n { name: \"Portugal\", code: \"PRT\", id: \"620\" },\n { name: \"Korea, Rep.\", code: \"KOR\", id: \"410\" },\n { name: \"Romania\", code: \"ROU\", id: \"642\" },\n { name: \"Russian Federation\", code: \"RUS\", id: \"643\" },\n { name: \"Rwanda\", code: \"RWA\", id: \"646\" },\n { name: \"Senegal\", code: \"SEN\", id: \"686\" },\n { name: \"Serbia\", code: \"SRB\", id: \"688\" },\n { name: \"Sierra Leone\", code: \"SLE\", id: \"694\" },\n { name: \"Singapore\", code: \"SGP\", id: \"702\" },\n { name: \"Slovenia\", code: \"SVN\", id: \"705\" },\n { name: \"South Africa\", code: \"ZAF\", id: \"710\" },\n { name: \"Spain\", code: \"ESP\", id: \"724\" },\n { name: \"Sri Lanka\", code: \"LKA\", id: \"144\" },\n { name: \"St. Kitts and Nevis\", code: \"KNA\", id: \"659\" },\n { name: \"St. Lucia\", code: \"LCA\", id: \"662\" },\n { name: \"St. Vincent and the Grenadines\", code: \"VCT\", id: \"670\" },\n { name: \"Suriname\", code: \"SUR\", id: \"740\" },\n { name: \"Sweden\", code: \"SWE\", id: \"752\" },\n { name: \"Tanzania\", code: \"TZA\", id: \"834\" },\n { name: \"Thailand\", code: \"THA\", id: \"764\" },\n { name: \"Togo\", code: \"TGO\", id: \"768\" },\n { name: \"Trinidad and Tobago\", code: \"TTO\", id: \"780\" },\n { name: \"Tunisia\", code: \"TUN\", id: \"788\" },\n { name: \"Türkiye\", code: \"TUR\", id: \"792\" },\n { name: \"Uganda\", code: \"UGA\", id: \"800\" },\n { name: \"Ukraine\", code: \"UKR\", id: \"804\" },\n { name: \"United Arab Emirates\", code: \"ARE\", id: \"784\" },\n { name: \"United Kingdom\", code: \"GBR\", id: \"826\" },\n { name: \"United States\", code: \"USA\", id: \"840\" },\n { name: \"Uruguay\", code: \"URY\", id: \"858\" },\n { name: \"Uzbekistan\", code: \"UZB\", id: \"860\" },\n { name: \"Venezuela, RB\", code: \"VEN\", id: \"862\" },\n { name: \"Vietnam\", code: \"VNM\", id: \"704\" },\n { name: \"Zambia\", code: \"ZMB\", id: \"894\" },\n { name: \"Zimbabwe\", code: \"ZWE\", id: \"716\" },\n\n { name: \"The Gambia\", code: \"GMB\", id: \"270\" },\n { name: \"Kosovo\", code: \"XKX\", id: \"383\" },\n\n { name: \"Haiti\", code: \"HTI\", id: \"332\" },\n { name: \"Sudan\", code: \"SDN\", id: \"729\" },\n { name: \"Cyprus\", code: \"CYP\", id: \"196\" },\n { name: \"Ireland\", code: \"IRL\", id: \"372\" },\n { name: \"Latvia\", code: \"LVA\", id: \"428\" },\n { name: \"Lithuania\", code: \"LTU\", id: \"440\" },\n { name: \"Luxembourg\", code: \"LUX\", id: \"442\" },\n { name: \"Malta\", code: \"MLT\", id: \"470\" },\n { name: \"Paraguay\", code: \"PRY\", id: \"600\" },\n { name: \"Slovak Republic\", code: \"SVK\", id: \"703\" },\n { name: \"Congo, Rep.\", code: \"COG\", id: \"178\" },\n { name: \"Gabon\", code: \"GAB\", id: \"266\" },\n { name: \"Kuwait\", code: \"KWT\", id: \"414\" },\n { name: \"Montenegro\", code: \"MNE\", id: \"499\" },\n]\n\nexport function getCountryByName(name) {\n return countries.find((n) => n.name === name)\n}\n\nlet id = 999\nexport function getCountryByCode(code) {\n const c = countries.find((n) => n.code === code)\n\n if (c) {\n return c\n }\n\n return {\n name: getName(code),\n code: code,\n id: id++,\n }\n}\n\nexport function getCountryById(id) {\n return countries.find((n) => n.id === id)\n}\n","import { csvParseRows, csvParse } from \"d3-dsv\"\nimport { groups, mean } from \"d3-array\"\nimport memoize from \"lodash/memoize\"\nimport { feature } from \"topojson\"\nimport { getCountryByName, getCountryByCode } from \"./utils/countryLookup\"\n\nexport const years = [\n \"2015\",\n \"2016\",\n \"2017-18\",\n \"2019\",\n \"2020\",\n \"2021\",\n \"2022\",\n \"2023\",\n \"2024\",\n]\n\nexport const factors = [\n \"Constraints on Government Powers\",\n \"Absence of Corruption\",\n \"Open Government\",\n \"Fundamental Rights\",\n \"Order and Security\",\n \"Regulatory Enforcement\",\n \"Civil Justice\",\n \"Criminal Justice\",\n]\n\nexport const defaultCountry = \"\"\nexport const defaultFactor = \"\"\nexport const defaultYear = years[years.length - 1]\n\nexport const groupAttributes = [\"Region\", \"Income Group\"]\n\nconst countryCodeValidation = {}\n\nfunction averageFactors(groups, questionKeys, aggregateFactorKeys) {\n return groups.map(([groupKey, groupItems]) => {\n const groupResponses = {}\n\n // Calculate all mean values at once\n questionKeys.forEach((question) => {\n groupResponses[question] = mean(groupItems, (d) => d[question])\n })\n\n // Calculate aggregate totals for each factor\n aggregateFactorKeys.forEach((factorKey) => {\n const factorNumber = factorKey.match(/Factor ([0-9])/)\n if (factorNumber && factorNumber[1]) {\n const factor = factorNumber[1]\n const questions = questionKeys.filter(\n (questionKey) => questionKey[0] === factor,\n )\n groupResponses[factorKey] = mean(\n questions.map((q) => groupResponses[q]),\n )\n }\n })\n\n return { group: groupKey, ...groupResponses }\n })\n}\n\nclass DataLoader {\n async _loadWorldMap() {\n const response = await fetch(\n `${process.env.PUBLIC_URL}/map_50m.topojson.json`,\n )\n const data = await response.json()\n const w = feature(data, data.objects.data)\n\n w.features = w.features.filter((d) => {\n d.properties.name = d.properties.WB_NAME\n d.id = getCountryByCode(d.properties.WB_A3)?.id //Remove the ? when generating PDFs\n return d.id !== undefined && d.id !== \"010\" && d.id !== \"-99\"\n })\n\n this.worldMap = w\n }\n\n async _loadCopy() {\n const response = await fetch(`${process.env.PUBLIC_URL}/copy.csv`)\n const text = await response.text()\n this.copy = csvParse(text.trim())\n }\n\n async _loadPercentChange() {\n const response = await fetch(\n `${process.env.PUBLIC_URL}/data/latest_percent_change.csv`,\n )\n const text = await response.text()\n this.percentChange = csvParse(text.trim())\n }\n\n _getCopy(key) {\n const row = this.copy.find((d) => d.Original === key)\n if (row) return row.Final\n console.warn(\"unfound copy key\", key)\n return \"\"\n }\n\n getCopy = memoize(this._getCopy)\n\n _validate() {\n Object.keys(countryCodeValidation).forEach((country) => {\n const countryCodes = Object.keys(countryCodeValidation[country])\n if (countryCodes.length > 1) {\n console.warn(\n country,\n \"has multiple country codes\",\n countryCodeValidation[country],\n )\n }\n })\n }\n\n async load() {\n //console.log(\"loading data\")\n this.dataByYear = {}\n this.responsesByYear = {}\n\n // Parallelize fetching all data\n await Promise.all([\n this._loadCopy(),\n this._loadPercentChange(),\n this._loadWorldMap(),\n ])\n\n await Promise.all(\n years.map(async (year) => {\n const response = await fetch(\n `${process.env.PUBLIC_URL}/data/${year}.csv`,\n )\n const text = await response.text()\n this.responsesByYear[year] = csvParseRows(text.trim())\n }),\n )\n\n //console.log(\"All data loaded\")\n this.processData()\n }\n\n processData() {\n years.forEach((year, yearIndex) => {\n const rows = this.responsesByYear[year]\n let countries = []\n const questionKeys = []\n const aggregateFactorKeys = []\n\n rows.forEach((row, rowIndex) => {\n const header = row[0].trim()\n const columns = row.slice(1)\n\n if (header === \"\") return\n\n if (rowIndex === 0) {\n countries = [...columns]\n .filter((country) => country !== \"\")\n .map((country) => ({ [header]: country }))\n } else {\n columns.forEach((column, columnIndex) => {\n if (columnIndex >= countries.length) return\n let value = column\n\n const questionKeyMatches = header.match(\n /([0-9]\\.[0-9])|(Factor [0-9])/,\n )\n if (questionKeyMatches) {\n const questionKey = questionKeyMatches[1] != null\n const factorKey = questionKeyMatches[2] != null\n\n if (questionKey && !questionKeys.includes(header))\n questionKeys.push(header)\n if (factorKey && !aggregateFactorKeys.includes(header))\n aggregateFactorKeys.push(header)\n\n value = +value\n }\n\n if (header === \"Abbreviation\") {\n countries[columnIndex][\"Country Code\"] = value\n return\n }\n\n if (\n header === \"Overall Score\" ||\n header === \"WJP Rule of Law Index: Overall Score\"\n ) {\n value = +value\n countries[columnIndex].overall = value\n }\n\n countries[columnIndex][header] = value\n })\n }\n })\n\n countries.forEach((country) => {\n const name = country.Country\n const code = country[\"Country Code\"]\n if (!countryCodeValidation[name]) {\n countryCodeValidation[name] = {}\n }\n countryCodeValidation[name][code] = true\n })\n\n questionKeys.push(\"overall\")\n\n const yearlyData = {\n countries,\n groups: {},\n groupAverages: {},\n questionKeys,\n aggregateFactorKeys,\n }\n\n groupAttributes.forEach((groupAttribute) => {\n const grouped = groups(countries, (d) => d[groupAttribute])\n yearlyData.groups[groupAttribute] = grouped\n yearlyData.groupAverages[groupAttribute] = averageFactors(\n grouped,\n questionKeys,\n aggregateFactorKeys,\n )\n })\n\n const allQuestionKeys = [...questionKeys, ...aggregateFactorKeys]\n yearlyData.groupAverages.global = {}\n\n allQuestionKeys.forEach((questionKey) => {\n yearlyData.groupAverages.global[questionKey] = mean(\n countries,\n (c) => c[questionKey],\n )\n })\n\n let countriesInThePreviousYear = null\n const groupsToSort = [{ array: countries, key: \"\" }]\n if (yearIndex !== 0) {\n const previousYear = years[yearIndex - 1]\n const previousYearData = this.dataByYear[previousYear].countries\n countriesInThePreviousYear = countries.filter((c) =>\n previousYearData.find((p) => p.Country === c.Country),\n )\n\n groupsToSort.push({\n array: countriesInThePreviousYear,\n key: \"_lastYear\",\n })\n\n countriesInThePreviousYear.forEach((country) => {\n const previousYearCountry = previousYearData.find(\n (p) => p.Country === country.Country,\n )\n const thisYear = country.overall\n const lastYear = previousYearCountry.overall\n const difference = thisYear - lastYear\n country[\"overall_percentDifference\"] = (difference / lastYear) * 100\n })\n }\n\n allQuestionKeys.forEach((questionKey) => {\n groupsToSort.forEach(({ array, key }) => {\n const sortedArray = [...array].sort(\n (a, b) => b[questionKey] - a[questionKey],\n )\n\n sortedArray.forEach((country, countryIndex) => {\n country[`${questionKey}_Rank_Global${key}`] = countryIndex + 1\n country[`Count_Global${key}`] = sortedArray.length\n })\n\n groupAttributes.forEach((groupAttribute) => {\n const groups = yearlyData.groups[groupAttribute]\n groups.forEach(([_, countriesInGroup]) => {\n const sortedGroup = [...countriesInGroup].sort(\n (a, b) => b[questionKey] - a[questionKey],\n )\n sortedGroup.forEach((country, countryIndex) => {\n country[`${questionKey}_Rank_${groupAttribute}${key}`] =\n countryIndex + 1\n country[`Count_${groupAttribute}${key}`] = sortedGroup.length\n })\n })\n })\n })\n })\n\n this.dataByYear[year] = yearlyData\n })\n\n this._validate()\n this.setupYearsForCountries()\n this.processPercentChange()\n }\n\n setupYearsForCountries() {\n this.yearsForCountries = {}\n Object.keys(this.dataByYear).forEach((year) => {\n const countries = this.dataByYear[year].countries\n countries.forEach((country) => {\n if (!this.yearsForCountries[country.Country]) {\n this.yearsForCountries[country.Country] = []\n }\n this.yearsForCountries[country.Country].push(year)\n })\n })\n\n Object.keys(this.yearsForCountries).forEach((country) => {\n this.yearsForCountries[country].sort()\n })\n }\n\n processPercentChange() {\n this.percentChange.forEach((percentChangeRow) => {\n const latestYearData = this.dataByYear[years[years.length - 1]]\n const percentChangeCountry = percentChangeRow[\"Country/Jurisdiction\"]\n const matchingCountry = latestYearData.countries.find(\n (d) => d.Country === percentChangeCountry,\n )\n\n if (matchingCountry) {\n const value = percentChangeRow[\"% Score Change\"].trim()\n matchingCountry.externalPercentChange = value.length\n ? parseFloat(value)\n : null\n }\n })\n }\n}\n\nconst dataLoaderInstance = new DataLoader()\nexport default dataLoaderInstance\n","import DataLoader, {\n years,\n factors,\n defaultCountry,\n defaultFactor,\n defaultYear,\n} from \"../DataLoader\"\n\nexport default function getSelectionsFromParams(params) {\n let selectedYear = defaultYear\n let selectedCountry = defaultCountry\n let selectedFactor = defaultFactor\n const opts = []\n if (\"opt1\" in params) {\n opts.push(params.opt1)\n }\n if (\"opt2\" in params) {\n opts.push(params.opt2)\n }\n if (\"opt3\" in params) {\n opts.push(params.opt3)\n }\n if (\"opt4\" in params) {\n opts.push(params.opt4)\n }\n const unusedOpts = []\n opts.forEach((optEncoded) => {\n if (!optEncoded) {\n return\n }\n const opt = decodeURIComponent(optEncoded)\n if (years.includes(opt)) {\n selectedYear = opt\n return\n }\n const countries =\n DataLoader.dataByYear && DataLoader.dataByYear[selectedYear].countries\n ? DataLoader.dataByYear[selectedYear].countries\n : []\n if (countries.map((d) => d.Country).includes(opt)) {\n selectedCountry = opt\n return\n }\n if (factors.includes(opt)) {\n selectedFactor = opt\n return\n }\n unusedOpts.push(opt)\n })\n\n return { selectedCountry, selectedYear, selectedFactor, unusedOpts }\n}\n","import { scaleLinear } from \"d3-scale\"\nexport const gradientColors = [\n { offset: 0, hex: \"#D40276\" },\n { offset: 10.3, hex: \"#D40276\" },\n { offset: 22.17, hex: \"#EA1813\" },\n { offset: 38.42, hex: \"#F19D4B\" },\n { offset: 50, hex: \"#F6C600\" },\n { offset: 67.68, hex: \"#ADC493\" },\n { offset: 77.58, hex: \"#6A9E89\" },\n { offset: 88.65, hex: \"#125459\" },\n { offset: 96.99, hex: \"#003632\" },\n { offset: 100, hex: \"#003632\" },\n]\n\nexport default scaleLinear()\n .domain(gradientColors.map((d) => d.offset / 100))\n .range(gradientColors.map((d) => d.hex))\n","export default __webpack_public_path__ + \"static/media/arrow-down.aa84c6ad.svg\";","export default __webpack_public_path__ + \"static/media/arrow-up.4b1f3840.svg\";","export const SMALL_WIDTH_MODE_SIZE = 900 // ideally matches value in variables.scss Change from 900 to 200 when generating PDFs\nexport const MEDIUM_WIDTH_MODE_SIZE = 1200 // ideally matches value in variables.scss\n\nexport const useSmallWidthMode = () => {\n return window.innerWidth <= SMALL_WIDTH_MODE_SIZE\n}\nexport const useMediumWidthMode = () => {\n return window.innerWidth <= MEDIUM_WIDTH_MODE_SIZE\n}\n","import React, { useMemo } from \"react\"\nimport useDimensions from \"react-use-dimensions\"\nimport DataLoader, { years } from \"../DataLoader\"\nimport { extent } from \"d3-array\"\nimport { scaleLinear } from \"d3-scale\"\nimport gradient from \"../utils/gradient\"\nimport \"./styles.scss\"\n\nexport default function HistoricalBubbleGraph(props) {\n const { selectedCountry, scoreKey, smallVersion = false } = props // Added smallVersion prop\n\n const [ref, containerDimensions] = useDimensions()\n const margins = useMemo(\n () => ({ left: 20, right: 20, top: 20, bottom: 44 }),\n [],\n )\n\n const containerWidth = useMemo(\n () => Math.min(Math.max(170, ~~containerDimensions.width), 600), //change from 600 to 460 for pdf generation\n [containerDimensions.width],\n )\n\n // Adjust the height based on the smallVersion prop\n const containerHeight = useMemo(\n () =>\n smallVersion\n ? Math.max(~~containerDimensions.height, 120)\n : Math.max(~~containerDimensions.height, 200), // Half height for small version\n [containerDimensions.height, smallVersion],\n )\n\n const width = useMemo(\n () => containerWidth - margins.left - margins.right,\n [containerWidth, margins],\n )\n\n const height = useMemo(\n () => containerHeight - margins.top - margins.bottom - 6,\n [containerHeight, margins],\n )\n\n const historicalData = useMemo(() => {\n return years\n .map((year) => {\n const countryDatum = DataLoader.dataByYear[year].countries.find(\n (country) => country.Country === selectedCountry,\n )\n return {\n year,\n data: countryDatum,\n }\n })\n .filter((datum) => datum.data)\n }, [selectedCountry])\n\n const xScale = useMemo(\n () =>\n scaleLinear()\n .domain([0, historicalData.length - 1])\n .range([0, width]),\n [historicalData.length, width],\n )\n\n const dataExtent = useMemo(\n () => extent(historicalData, (d) => d.data[scoreKey]),\n [historicalData, scoreKey],\n )\n\n const yScale = useMemo(\n () => scaleLinear().domain(dataExtent).range([height, 0]),\n [dataExtent, height],\n )\n\n const gridlines = useMemo(() => {\n if (smallVersion) return null // Skip rendering gridlines if smallVersion is true\n const numberOfGridlines = 4\n return Array.from({ length: numberOfGridlines }).map((_, index) => {\n const yValue = (index / (numberOfGridlines - 1)) * height\n return (\n \n )\n })\n }, [height, width, smallVersion])\n\n const yearDots = useMemo(() => {\n return historicalData.map((datum, index) => {\n const score = datum.data[scoreKey]\n const x = xScale(index)\n const yClamped = Math.min(Math.max(yScale(score), 6), height - 6)\n const fill = gradient(score)\n const label = datum.year\n\n const yearLabel =\n label === \"2017-18\" ? (\n \n '17\n '18\n \n ) : (\n \n {\"'\" + label.substr(2)}\n \n )\n\n const valueLabel = score.toFixed(2).replace(/^0\\./, \".\")\n\n return (\n \n \n \n {valueLabel}\n \n \n \n {yearLabel}\n \n )\n })\n }, [\n historicalData,\n scoreKey,\n xScale,\n yScale,\n height,\n props.fontColor,\n props.stroke,\n ])\n\n const polylinePoints = useMemo(() => {\n return historicalData\n .map((datum, index) => {\n const score = datum.data[scoreKey]\n const x = xScale(index)\n const yClamped = Math.min(Math.max(yScale(score), 6), height - 6)\n return [x, yClamped].join(\",\")\n })\n .join(\" \")\n }, [historicalData, scoreKey, xScale, yScale, height])\n\n return (\n
\n \n \n {!smallVersion && gridlines} {/* Conditionally render gridlines */}\n \n {yearDots}\n \n \n
\n )\n}\n\nHistoricalBubbleGraph.defaultProps = {\n stroke: \"#56565A\",\n fontColor: \"#56565A\",\n smallVersion: false, // Default to the larger version\n}\n","import React, { useEffect, useState, useMemo } from \"react\"\nimport { createPortal } from \"react-dom\"\nimport classnames from \"classnames\"\nimport \"./styles.scss\"\nimport gradient, { gradientColors } from \"../utils/gradient\"\nimport Map from \"../Map/\"\nimport { getCountryByName } from \"../utils/countryLookup\"\nimport DataLoader, { years } from \"../DataLoader\"\n\nimport arrowDown from \"../images/arrow-down.svg\"\nimport arrowUp from \"../images/arrow-up.svg\"\nimport { useSmallWidthMode } from \"../utils/smallWidthMode\"\nimport HistoricalBubbleGraph from \"../HistoricalBubbleGraph/\"\nimport { percentChangeColorScale } from \"../Overview/\"\nimport { useMeasure, useWindowScroll } from \"react-use\"\n\nconst scaleBarWidth = 200\nconst scaleBarWidthSmallMode = 100\nconst scaleBarMargins = {\n top: 10,\n left: 26,\n right: 30,\n bottom: 10,\n}\nconst scaleBarHeight = 7\nconst mapSize = 90\n\nexport default function Tooltip(props) {\n const {\n country,\n x,\n y,\n scoreKey,\n selectedYear,\n colorByPercentDifferenceData,\n } = props\n const windowScroll = useWindowScroll()\n const [wrapperRef, wrapperMeasure] = useMeasure()\n const [isVisible, setIsVisible] = useState(false)\n const [clickInstructionsVisible, setClickInstructionsVisible] =\n useState(false)\n\n const inSmallMode = useSmallWidthMode()\n\n // Memoize tooltip element lookup to prevent unnecessary querying\n const tooltipEle = useMemo(() => document.querySelector(\"#tooltip\"), [])\n\n // Memoize the country data lookup to avoid recalculating every render\n const mapCountryData = useMemo(\n () => getCountryByName(country.Country),\n [country],\n )\n\n // Calculate score and color just once\n const score = useMemo(() => {\n if (colorByPercentDifferenceData) {\n return country.externalPercentChange !== null\n ? country.externalPercentChange\n : null\n }\n return country[scoreKey]\n }, [country, scoreKey, colorByPercentDifferenceData])\n\n const scoreColor = useMemo(\n () =>\n colorByPercentDifferenceData\n ? percentChangeColorScale(score)\n : gradient(score),\n [colorByPercentDifferenceData, score],\n )\n\n // Calculate factorIndexLabel based on scoreKey\n const factorIndexLabel = useMemo(() => {\n const scoreKeyMatch = scoreKey.match(/^[0-9]\\.[0-9]/)\n if (scoreKey.indexOf(\"Factor \") === 0) {\n return scoreKey.split(\":\")[0]\n } else if (scoreKeyMatch) {\n return `Subfactor ${scoreKeyMatch[0]}`\n }\n return \"Index\"\n }, [scoreKey])\n\n useEffect(() => {\n if (props.tooltipMessage === null) return\n\n const showTimeout = setTimeout(() => setIsVisible(true), 100) // Delay show by 0.1s\n const clickInstructionsTimeout = setTimeout(\n () => setClickInstructionsVisible(true),\n 250,\n ) // Show click instructions after 0.25s\n\n return () => {\n clearTimeout(showTimeout)\n clearTimeout(clickInstructionsTimeout)\n setIsVisible(false)\n }\n }, [props.tooltipMessage])\n\n const hideTooltip = () => setIsVisible(false) // Simplified hideTooltip with no fade-out logic, as CSS handles it\n\n // Precompute the position and flip logic\n const _x = x + 12\n const _y = y - 60 + windowScroll.y\n const flipX = _x > window.innerWidth - wrapperMeasure.width\n const flipY = _y > window.innerHeight - wrapperMeasure.height\n\n // Tooltip style\n const tooltipStyle = {\n left: _x + (flipX ? -20 : 0),\n top: _y + (flipY ? -20 : 0),\n transform: `translate(${flipX ? \"-100%\" : \"0\"}, ${flipY ? \"-100%\" : \"0\"})`,\n opacity: isVisible ? 1 : 0, // Controlled by CSS transition for fade-in/out\n transition: \"opacity 0.2s cubic-bezier(0.77, 0, 0.175, 1)\", // Smooth fade with EaseInOutQuart effect\n }\n\n // Precompute ranking icons for optimizations\n const previousYearData = useMemo(() => {\n const selectedYearIndex = years.indexOf(`${selectedYear}`)\n if (selectedYearIndex === 0) return null\n\n const previousYear = years[selectedYearIndex - 1]\n return DataLoader.dataByYear[previousYear].countries.find(\n (c) => c.Country === country.Country,\n )\n }, [selectedYear, country])\n\n const icons = useMemo(() => {\n let overallCOTIcon = null,\n globalRankCOTIcon = null,\n regionalRankCOTIcon = null,\n incomeRankCOTIcon = null\n\n if (previousYearData) {\n const previousYearScore = previousYearData[scoreKey]\n const globalRankIndexedByLastYearsCountriesOnly =\n country[`${scoreKey}_Rank_Global_lastYear`]\n const regionRankIndexedByLastYearsCountriesOnly =\n country[`${scoreKey}_Rank_Region_lastYear`]\n const incomeRankIndexedByLastYearsCountriesOnly =\n country[`${scoreKey}_Rank_Income Group_lastYear`]\n\n if (score > previousYearScore)\n overallCOTIcon = \"\"\n else if (score < previousYearScore)\n overallCOTIcon = \"\"\n\n if (\n previousYearData[`${scoreKey}_Rank_Global`] <\n globalRankIndexedByLastYearsCountriesOnly\n )\n globalRankCOTIcon = (\n \"\"\n )\n else if (\n previousYearData[`${scoreKey}_Rank_Global`] >\n globalRankIndexedByLastYearsCountriesOnly\n )\n globalRankCOTIcon = \"\"\n\n if (\n previousYearData[`${scoreKey}_Rank_Region`] <\n regionRankIndexedByLastYearsCountriesOnly\n )\n regionalRankCOTIcon = (\n \"\"\n )\n else if (\n previousYearData[`${scoreKey}_Rank_Region`] >\n regionRankIndexedByLastYearsCountriesOnly\n )\n regionalRankCOTIcon = (\n \"\"\n )\n\n if (\n previousYearData[`${scoreKey}_Rank_Income Group`] <\n incomeRankIndexedByLastYearsCountriesOnly\n )\n incomeRankCOTIcon = (\n \"\"\n )\n else if (\n previousYearData[`${scoreKey}_Rank_Income Group`] >\n incomeRankIndexedByLastYearsCountriesOnly\n )\n incomeRankCOTIcon = \"\"\n }\n\n return {\n overallCOTIcon,\n globalRankCOTIcon,\n regionalRankCOTIcon,\n incomeRankCOTIcon,\n }\n }, [previousYearData, score, scoreKey, country])\n\n const scaleBarWidthToUse = inSmallMode\n ? scaleBarWidthSmallMode\n : scaleBarWidth\n\n return isVisible && score !== null && mapCountryData\n ? createPortal(\n
\n
\n
{country.Country}
\n
\n
\n \n \n \n {gradientColors.map((color) => (\n \n ))}\n \n \n \n \n \n \n \n \n \n \n 0.0\n \n \n 1.0\n \n \n \n
\n \n
\n
\n Region{\" \"}\n {country.Region}\n
\n
\n Income Group{\" \"}\n \n {country[\"Income Group\"]}\n \n
\n
\n \n Global ranking\n \n \n {country[`${scoreKey}_Rank_Global`]} /{\" \"}\n {country.Count_Global} {icons.globalRankCOTIcon}\n \n
\n
\n \n Regional Ranking\n \n \n {country[`${scoreKey}_Rank_Region`]} /{\" \"}\n {country.Count_Region} {icons.regionalRankCOTIcon}\n \n
\n
\n \n Income Ranking\n \n \n {country[`${scoreKey}_Rank_Income Group`]} /{\" \"}\n {country[\"Count_Income Group\"]}{\" \"}\n {icons.incomeRankCOTIcon}\n \n
\n
\n
\n
\n
\n
\n {colorByPercentDifferenceData ? (\n
{score}%
\n ) : (\n \n {score.toFixed(2)} {icons.overallCOTIcon}\n \n )}\n
\n
\n {colorByPercentDifferenceData ? (\n \n Overall score\n
\n changes\n
\n ) : (\n \n {factorIndexLabel} Score\n
\n {selectedYear}\n
\n )}\n
\n
\n
\n {props.showHistoricalPlot && (\n
\n
\n \n
\n
\n )}\n
\n
\n Details\n
\n
\n Close\n
\n
\n
\n {clickInstructionsVisible && (\n \n Click for {country.Country} Insights\n
\n )}\n ,\n tooltipEle,\n )\n : null\n}\n\nTooltip.defaultProps = {\n closeTooltip: () => {},\n gotoDetails: () => {},\n}\n","import React, { useState, useEffect } from \"react\"\n\nimport Tooltip from \"../Tooltip/\"\nimport \"./MapRenderer.scss\"\n\nexport default function MapRenderer(props) {\n const { width, height, translate, scale } = props\n const [hoveredCountry, setHoveredCountry] = useState(null)\n const hoverCountry = (country) => {\n return (event) => {\n if (!props.tooltipEnabled) {\n return\n }\n if (!country) {\n setHoveredCountry(country)\n return\n }\n let x = 0\n let y = 0\n if (\"pageX\" in event) {\n x = event.pageX\n y = event.pageY\n }\n if (event.touches) {\n event.preventDefault()\n event.stopPropagation()\n if (props.tooltipMessage == null) {\n props.gotoCountryPage(country.info.name)()\n return\n }\n }\n if (country.data) {\n const countryData = country.data.originalDatum || country.data\n const scoreKey = country.data.scoreKey || \"overall\"\n setHoveredCountry({ country: countryData, x, y, scoreKey })\n } else {\n }\n }\n }\n\n useEffect(() => {\n const hideTooltip = () => setHoveredCountry(null)\n window.addEventListener(\"scroll\", hideTooltip)\n return function cleanup() {\n window.removeEventListener(\"scroll\", hideTooltip)\n }\n }, [])\n\n return (\n \n \n {props.countryOpacity > 0 ? (\n \n {props.paths\n .sort((a, b) => {\n return props.strokedCountries.length\n ? (props.strokedCountries.includes(a.id) ? 1 : -1) -\n (props.strokedCountries.includes(b.id) ? 1 : -1)\n : 0\n })\n .map((c) => {\n const customStroke = props.strokedCountries.includes(c.id)\n const stroke = customStroke\n ? props.customStroke.color\n : props.defaultStroke\n const strokeWidth = customStroke\n ? props.customStroke.width\n : props.defaultStrokeWidth\n const fill = props.colorByData\n ? props.colorByPercentDifferenceData\n ? c.percentDifferenceColor\n : c.color\n : props.defaultFill\n const active =\n c.info &&\n !(\n props.colorByPercentDifferenceData &&\n c.percentDifferenceColor === \"rgb(51, 51, 51)\"\n )\n const onClick = active\n ? props.gotoCountryPage(c.info.name)\n : () => {}\n const opacity = c.data.opacity ? c.data.opacity : null\n return (\n \n )\n })}\n \n ) : null}\n {props.labelOpacity > 0 ? (\n \n {props.paths\n .filter((c) => props.selectedLabels.includes(c.id) && c.info)\n .map((c) => {\n const line3Label = props.showPercentDifferenceLabel\n ? `${\n c.overall_percentDifference > 0 ? \"+\" : \"\"\n }${c.overall_percentDifference.toFixed(2)}%`\n : `${c.rank} / ${c.count}`\n return (\n \n {c.value.toFixed(2)}\n {c.info.name.toUpperCase()}\n {line3Label}\n \n )\n })}\n \n ) : null}\n \n {hoveredCountry ? (\n \n ) : null}\n \n )\n}\n\nMapRenderer.defaultProps = {\n width: 1280,\n height: 640,\n translate: [640, 320],\n scale: 1,\n tooltipEnabled: false,\n countryOpacity: 0,\n pointOpacity: 0,\n labelOpacity: 0,\n paths: [],\n selectedLabels: [],\n strokedCountries: [],\n customStroke: { color: \"#333\", width: 1 },\n defaultStroke: \"white\",\n defaultStrokeWidth: 0.5,\n colorByData: false,\n defaultFill: \"#ffffff\",\n tooltipMessage: \"\",\n gotoCountryPage: () => {},\n showPercentDifferenceLabel: false,\n}\n","import { geoPath, geoMercator } from \"d3-geo\"\nimport { deviation } from \"d3-array\"\n\nfunction filterGeometry(geometry, filterByDeviation = false) {\n const target = Object.assign({}, geometry)\n if (target.geometry) {\n if (target.geometry.type === \"MultiPolygon\") {\n const { coordinates } = target.geometry\n const innerCoordinates = coordinates\n .map((c) => c[0])\n .sort((a, b) => b.length - a.length)\n const coordinateFilter =\n filterByDeviation && innerCoordinates.length > 1\n ? target.id === \"036\" // special case for Australia / Tasmania\n ? (c, i) => i < 2\n : (c) =>\n c.length >=\n Math.floor(deviation(innerCoordinates.map((c) => c.length)))\n : (c, i) => i < 1\n const filteredCoordinates = innerCoordinates.filter(coordinateFilter)\n target.geometry = {\n type: \"Polygon\",\n coordinates: filteredCoordinates,\n }\n }\n }\n return target\n}\n\nexport function getCenter(path, geometry) {\n const target = filterGeometry(geometry)\n const [x, y] = path.centroid(target)\n return { x, y }\n}\n\nconst maxGeometry = {\n type: \"Feature\",\n geometry: {\n type: \"Polygon\",\n coordinates: [\n [\n [-180, 72], // top left\n [180, 72], // top right\n [180, -58.49227331726442], // bottom right\n [-180, -58.49227331726442], // bottom left\n ],\n ],\n },\n} // approx continent bounds excluding the artic\n\nexport function getBounds(path, geometry) {\n const maxBounds = path.bounds(maxGeometry)\n const bounds = path.bounds(geometry),\n dx = bounds[1][0] - bounds[0][0],\n y1 = Math.max(bounds[0][1], maxBounds[0][1]),\n dy = bounds[1][1] - y1,\n x = (bounds[0][0] + bounds[1][0]) / 2,\n y = (y1 + bounds[1][1]) / 2\n return { dx, dy, x, y }\n}\n\nexport function scaleProjection(geometry, width, height) {\n const projection = geoMercator()\n .scale(1000)\n .rotate([-11, 0])\n .translate([width / 2, height / 2])\n const path = geoPath().projection(projection)\n if (!geometry) {\n return {\n projection,\n path,\n scale: 1,\n translate: [0, 0],\n x: 0,\n y: 0,\n dx: 100,\n dy: 100,\n }\n }\n const target =\n geometry.features.length > 1\n ? geometry\n : filterGeometry(geometry.features[0], true)\n let { dx, dy, x, y } = getBounds(path, target)\n let scale = 0.9 / Math.max(dx / width, dy / height) || 1\n const allHighRes =\n geometry.features.length === 1 &&\n geometry.features[0].properties.highResolution\n if (allHighRes) {\n dx *= 2\n dy *= 2\n scale *= 2\n }\n\n const translate = [width / 2 - scale * x, height / 2 - scale * y]\n return { projection, path, scale, translate, x, y, dx, dy }\n}\n","export default __webpack_public_path__ + \"static/media/globe.fadeee5c.svg\";","import React, { useEffect, useState, useMemo } from \"react\"\nimport { interpolateZoom } from \"d3-interpolate\"\nimport { easeQuadInOut } from \"d3-ease\"\nimport { Spring } from \"react-spring/renderprops\"\n\nimport MapRenderer from \"./MapRenderer\"\nimport { getCenter, scaleProjection } from \"../Map/scaleProjection.js\"\nimport { getCountryByCode } from \"../utils/countryLookup.js\"\nimport gradient from \"../utils/gradient\"\nimport memoize from \"lodash/memoize\"\nimport cloneDeep from \"lodash/cloneDeep\"\nimport debounce from \"lodash/debounce\"\nimport \"./styles.scss\"\nimport globeIcon from \"../images/globe.svg\"\nimport DataLoader from \"../DataLoader\"\n\nconst standaloneWorld = {}\n\nexport function updateTransform(\n width,\n height,\n selectedRegion,\n geography = DataLoader.worldMap,\n) {\n if (selectedRegion.length) {\n const target = {\n type: \"FeatureCollection\",\n features: selectedRegion\n .map(\n (c) => geography.features.find((f) => f.id === c.toString()) || null,\n )\n .filter((c) => c !== null),\n }\n return scaleProjection(target, width, height)\n }\n return scaleProjection(geography, width, height)\n}\n\nexport function updatePaths(transform, _features, mapId) {\n let features =\n _features || (DataLoader.worldMap ? DataLoader.worldMap.features : null)\n if (!features) {\n return []\n }\n return features.map((country) => {\n if (!country.paths) {\n country.paths = {}\n }\n // country.path = transform.path(country);\n country.paths[mapId] = transform.path(country)\n country.center = getCenter(transform.path, country)\n return country\n })\n}\n\nfunction calculateNewPaths(width, height, selectedRegion, geography, mapId) {\n const transform = updateTransform(width, height, selectedRegion, geography)\n const paths = updatePaths(transform, geography.features, mapId)\n return [paths, transform]\n}\n\nconst memoizedNewPaths = memoize(\n calculateNewPaths,\n function (width, height, selectedRegion, geography, mapId) {\n const regionIds = selectedRegion.join(\",\")\n const geoIds = geography.features.map((d) => d.id).join(\",\")\n return `${width}-${height}-${regionIds}-${geoIds}-${mapId}`\n },\n)\n\nfunction assignData(paths, data, defaultFill) {\n return paths.map((p) => {\n p.info = getCountryByCode(p.properties.WB_A3) || false\n p.data = false\n p.color = defaultFill\n\n if (p.info) {\n const countryData = data.find((c) => c.code === p.info.code)\n if (countryData) {\n p.data = countryData\n p.value = p.data.value\n p.color = gradient(p.value)\n if (p.data.overrideFill) {\n p.color = p.data.overrideFill\n }\n } else {\n //console.log(`no data for ${p.info.name}`);\n }\n }\n\n return p\n })\n}\n\nlet measured = false\nconst initTransform = { from: [], to: [] }\nconst transformState = {}\n\nfunction matchTransform(id) {\n transformState[id].from = measured ? transformState[id].to.slice() : []\n}\n\nexport function lerp(start, end, time) {\n return start * (1 - time) + end * time\n}\n\nexport default function Map(props) {\n const [mapSize, setMapSize] = useState({\n width: props.width,\n height: props.height,\n })\n useEffect(() => {\n function _measure() {\n let nextWidth = props.width,\n nextHeight = props.height\n if (props.parent) {\n const parentBounds = props.parent.current.getBoundingClientRect()\n nextWidth = parentBounds.width\n nextHeight = nextWidth * 0.5\n }\n measured = true\n setMapSize({ width: nextWidth, height: nextHeight })\n }\n _measure()\n const debouncedMeasure = debounce(_measure, 100, {\n leading: true,\n trailing: true,\n })\n window.addEventListener(\"resize\", debouncedMeasure)\n return function cleanup() {\n window.removeEventListener(\"resize\", debouncedMeasure)\n }\n }, [props.parent, props.width, props.height])\n\n if (!standaloneWorld[props.id]) {\n standaloneWorld[props.id] = cloneDeep(DataLoader.worldMap)\n standaloneWorld[props.id].all_features = cloneDeep(\n standaloneWorld[props.id].features,\n )\n }\n\n const targetGeography = standaloneWorld[props.id]\n targetGeography.features = useMemo(\n () =>\n targetGeography.all_features.filter((d) =>\n props.visibleCountries.length === 0\n ? true\n : props.visibleCountries.includes(d.id),\n ),\n [props.visibleCountries, targetGeography.all_features],\n )\n\n const { width, height } = mapSize\n\n const [updatedPaths, transform] = memoizedNewPaths(\n width,\n height,\n props.selectedRegion,\n targetGeography,\n props.id,\n )\n\n const paths = assignData(\n updatedPaths,\n props.data,\n props.defaultFill,\n props.colorByPercentDifferenceData,\n )\n let map = null\n if (!props.animate) {\n const { translate, scale } = transform\n map = (\n \n )\n } else {\n const useWidth = transform.dx / width > transform.dy / height\n if (!transformState[props.id]) {\n transformState[props.id] = Object.assign({}, initTransform)\n }\n transformState[props.id].to = [\n transform.x,\n transform.y,\n useWidth ? transform.dx : transform.dy,\n useWidth ? width : height,\n ]\n if (!transformState[props.id].from.length) {\n matchTransform(props.id)\n }\n const fromTransform = transformState[props.id].from.length\n ? transformState[props.id].from\n : transformState[props.id].to\n const interpolator = interpolateZoom(\n fromTransform,\n transformState[props.id].to,\n )\n\n map = interpolator ? (\n matchTransform(props.id)}\n onRest={() => matchTransform(props.id)}\n >\n {({ t }) => {\n const view = interpolator(t)\n const size = lerp(fromTransform[3], transformState[props.id].to[3], t)\n const scale = 0.9 * (size / view[2])\n const translate = [\n width / 2 - view[0] * scale,\n height / 2 - view[1] * scale,\n ]\n return (\n \n )\n }}\n \n ) : null\n }\n\n const clickGlobeIcon = () => {\n props.gotoCountryPage(\"\")()\n }\n let globeButton = null\n if (props.allowZoomOut && props.selectedRegion.length) {\n const targetWidth = width - 20\n const targetHeight = height - 10\n const scaledWidth = width * props.mapScale\n const scaledHeight = height * props.mapScale\n const translateX = (targetWidth - scaledWidth) / 2 //- 10\n const translateY = targetHeight - scaledHeight // - 10\n const globeButtonStyle = {\n transform: `scale(${\n 1 / props.mapScale\n }) translate(${-translateX}px, ${translateY}px)`,\n }\n globeButton = (\n \n \"Zoom{\" \"}\n \n )\n }\n return (\n
\n {map}\n {globeButton}\n
\n )\n}\n\nMap.defaultProps = {\n id: \"defaultMap\",\n animate: false,\n width: 1280,\n height: 640,\n stroke: \"white\",\n customStroke: { color: \"#333\", width: 1 },\n defaultFill: \"#f0f0f0\",\n selectedRegion: [],\n visibleCountries: [],\n strokedCountries: [],\n data: [],\n gotoCountryPage: () => {},\n tooltipEnabled: true,\n allowZoomOut: false,\n showPercentDifferenceLabel: false,\n}\n","import React from \"react\"\nimport { format } from \"d3-format\"\nimport { scaleLinear } from \"d3-scale\"\nimport { extent } from \"d3-array\"\n\nimport gradient from \"../utils/gradient\"\n\nimport \"./styles.scss\"\n\nconst formatter = format(\".2f\")\n\nfunction getXScale(ticks, width) {\n const padding = {\n left: width * 0.1875,\n right: width * 0.225,\n }\n const xScale = scaleLinear()\n .domain(extent(ticks))\n .range([padding.left, width - padding.right])\n return { xScale, padding }\n}\n\nfunction SVGGradient() {\n const domain = gradient.domain()\n return (\n \n {domain.map((d, i) => (\n \n ))}\n \n )\n}\nconst sideLabelY = 1\nfunction LegendContainer(props) {\n const { width, height, children, padding } = props\n return (\n \n \n Adherence to the Rule of Law\n \n \n \n Weaker\n \n \n Stronger\n \n {children}\n \n \n )\n}\n\nexport function RadiusLegend(props) {\n const { width, height, scale, rScale } = props\n const ticks = rScale.ticks(8)\n const { xScale, padding } = getXScale(ticks, width)\n\n return (\n \n {ticks.map((t, i) => (\n \n \n {i === 0 || i === ticks.length - 1 ? (\n \n {formatter(t)}\n \n ) : null}\n \n ))}\n \n )\n}\n\nexport function GradientLegend(props) {\n const { width, height } = props\n const ticks = [0, 0.25, 0.5, 0.75, 1]\n const { xScale, padding } = getXScale(ticks, width)\n\n return (\n \n \n \n \n \n {ticks.map((t, i) => (\n \n \n {formatter(t)}\n \n \n ))}\n \n )\n}\n\nexport function PercentChangeLegend(props) {\n const { width, height, percentChangeScale } = props\n // const ticks = [0, 0.25, 0.5, 0.75, 1];\n // const { xScale, padding } = getXScale(ticks, width);\n const ticks = [\n { value: -4, label: \"≤-4%\" },\n { value: -2, label: \"-4% – -2%\" },\n { value: 0, label: \"-2% – 0%\" },\n { value: 2, label: \"0% – 2%\" },\n { value: 4, label: \"2% – 4%\" },\n { value: 5, label: \"≥4%\" },\n ]\n\n const padding = {\n left: 65,\n right: 65,\n }\n\n const availWidth = width - padding.left - padding.right\n const tickWidth = availWidth / ticks.length\n const tickPadding = 5\n return (\n \n \n Overall rule of law score changes\n \n \n \n Declining\n \n \n Improving\n \n {ticks.map((t, i) => (\n \n \n \n {t.label}\n \n \n ))}\n \n \n )\n}\n","import React, { useEffect, useState, useMemo, useRef } from \"react\"\nimport { Link, useHistory } from \"react-router-dom\"\nimport { Helmet } from \"react-helmet\"\nimport debounce from \"lodash/debounce\"\nimport \"intersection-observer\"\nimport classnames from \"classnames\"\nimport DataLoader, { years } from \"../DataLoader\"\nimport { updatePaths, updateTransform } from \"../Map\"\nimport MapRenderer from \"../Map/MapRenderer\"\nimport { GradientLegend, PercentChangeLegend } from \"../Legends/\"\nimport gradient from \"../utils/gradient\"\nimport { getCountryByCode } from \"../utils/countryLookup.js\"\n\nimport \"./styles.scss\"\n\nconst emptyArray = []\n\nconst currentYear = years[years.length - 1]\nconst lastYear = years[years.length - 2]\n\nlet measured = false\nlet fromTransform, toTransform\nconst smallWidth = 768\nlet smallWidthMode = document.body.clientWidth < smallWidth\n\nconst padding = 46\n\nexport const percentChangeColorScale = (value) => {\n if (value === null) {\n return \"rgb(51, 51, 51)\"\n }\n if (value <= -4) {\n return \"#D12341\"\n } else if (value <= -2) {\n return \"#EB9727\"\n } else if (value <= 0) {\n return \"#F4CD2E\"\n } else if (value <= 2) {\n return \"#90D1EB\"\n } else if (value <= 4) {\n return \"#2879BD\"\n } else {\n return \"#2D3589\"\n }\n}\n\nconst colors = {\n background: \"#f2f2f2\",\n defaultFill: \"#ddd\",\n}\n\nfunction updateData(paths, year, priorYear, gradientScale) {\n const data = DataLoader.dataByYear[year].countries.map((c) => {\n return c\n })\n\n return paths.map((country) => {\n // country.info = getCountryById(country.id) || false;\n country.info = getCountryByCode(country.properties.WB_A3) || false\n country.data = false\n country.color = \"#333333\"\n country.percentDifferenceColor = \"#333333\"\n if (country.info) {\n const countryData = data.find(\n (c) => c[\"Country Code\"] === country.info.code,\n )\n if (countryData) {\n country.data = countryData\n country.value = country.data.overall\n country.rank = country.data.overall_Rank_Global\n country.count = country.data.Count_Global\n country.externalPercentChange = country.data.externalPercentChange\n country.color = gradientScale(country.value)\n country.percentDifferenceColor = percentChangeColorScale(\n country.externalPercentChange,\n )\n country.radius = padding / 2\n } else {\n //console.warn(`no data for ${country.properties.WB_A3} ???`)\n }\n }\n return country\n })\n}\n\nfunction matchTransform() {\n fromTransform = measured ? toTransform.slice() : null\n}\n\nlet overviewShownOnce = false\n\nexport default function Overview(props) {\n const navHeight = Math.floor(\n props.navRef.current.getBoundingClientRect().height || 80,\n )\n\n const history = useHistory()\n\n const [locationKey, setLocationKey] = useState()\n const legendContainer = useRef()\n const { location } = history\n useEffect(() => {\n if (location.key !== locationKey) {\n window.scrollTo(0, 0)\n setLocationKey(location.key)\n }\n }, [location, locationKey])\n\n const [metrics, setMetrics] = useState({\n width: document.body.clientWidth,\n height: window.innerHeight - navHeight,\n baseWidth: 1280,\n baseHeight: 800,\n activeWidth: 1280,\n activeHeight: 800,\n scale: 1,\n })\n\n const { baseWidth, baseHeight } = metrics\n const { setFade } = props\n\n useEffect(() => {\n function _measure() {\n const width = document.body.clientWidth\n let height = window.innerHeight - navHeight\n smallWidthMode = false\n if (width < smallWidth) {\n smallWidthMode = true\n height /= 2\n }\n\n const scale = Math.min(width / baseWidth, height / baseHeight)\n const activeWidth = width / scale\n const activeHeight = height / scale\n\n measured = true\n setMetrics({\n width,\n height,\n baseWidth,\n baseHeight,\n activeWidth,\n activeHeight,\n scale,\n })\n }\n\n _measure()\n\n const debouncedMeasure = debounce(_measure, 100, {\n leading: true,\n trailing: true,\n })\n window.addEventListener(\"resize\", debouncedMeasure)\n return function cleanup() {\n window.removeEventListener(\"resize\", debouncedMeasure)\n }\n }, [baseWidth, baseHeight, navHeight, history, setFade])\n\n const { width, height, activeWidth, activeHeight } = metrics\n\n const [colorByData, setColorByData] = useState(false)\n const slideData = useMemo(\n () => ({\n selectedRegion: emptyArray,\n colorByData,\n }),\n [colorByData],\n )\n const { selectedRegion = false } = slideData\n\n const [showModal, setShowModal] = useState(false)\n useEffect(() => {\n let timeoutId = null\n if (!colorByData) {\n timeoutId = setTimeout(\n () => {\n matchTransform()\n setColorByData(true)\n overviewShownOnce = true\n },\n overviewShownOnce ? 0 : 1000,\n )\n }\n return () => {\n if (timeoutId) {\n clearTimeout(timeoutId)\n }\n }\n }, [colorByData])\n useEffect(() => {\n let timeoutId = null\n if (colorByData && !showModal) {\n timeoutId = setTimeout(() => {\n setShowModal(true)\n }, 300)\n }\n return () => {\n clearTimeout(timeoutId)\n }\n }, [colorByData, showModal])\n const transform = useMemo(() => {\n return updateTransform(\n activeWidth,\n activeHeight - navHeight,\n selectedRegion,\n )\n }, [activeWidth, activeHeight, navHeight, selectedRegion])\n const useWidth = useMemo(\n () =>\n transform.dx / activeWidth > transform.dy / (activeHeight - navHeight),\n [transform, activeWidth, activeHeight, navHeight],\n )\n toTransform = [\n transform.x,\n transform.y,\n useWidth ? transform.dx : transform.dy,\n useWidth ? activeWidth : activeHeight - navHeight,\n ]\n fromTransform = measured\n ? fromTransform || toTransform.slice()\n : toTransform.slice()\n\n const updatedPaths = useMemo(() => updatePaths(transform), [transform])\n const paths = useMemo(\n () => updateData(updatedPaths, currentYear, lastYear, gradient),\n [updatedPaths],\n )\n\n const gradientLegendHeight = 44\n\n const [mapOpacity, setMapOpacity] = useState(0)\n\n useEffect(() => {\n let timeoutId = setTimeout(() => {\n setMapOpacity(1)\n }, 1000)\n\n return () => {\n clearTimeout(timeoutId)\n }\n }, [])\n\n return (\n
\n \n WJP Rule of Law Index\n \n \n
\n \n \n
\n \n
\n\n \n \n {slideData.colorByPercentDifferenceData ? (\n \n ) : (\n \n )}\n
\n
\n \n \n
\n
\n

The Global Rule of Law Recession Continues

\n
\n The 2024 WJP Rule of Law Index\n \n ®\n {\" \"}\n evaluates 142 countries and jurisdictions around the world. For\n the seventh year in a row, the rule of law has declined in most\n countries.\n
\n
\n Explore the data\n
\n \n \n )\n}\n","import React from \"react\"\nimport classnames from \"classnames\"\n\nimport \"./styles.scss\"\n\nexport default function InlineButtons(props) {\n const options = [...props.options].reverse()\n if (props.instruction) {\n options.unshift({ instruction: props.instruction })\n }\n return (\n \n {options.map((option) => {\n if (option.instruction) {\n return (\n
  • \n {props.instruction}\n
  • \n )\n }\n const label = option.label || option\n const value = option.value || option\n const onClick = option.onClick || (() => props.setValue(value))\n return (\n \n {label}\n \n )\n })}\n \n )\n}\n\nInlineButtons.defaultProps = {\n className: null,\n}\n","import React, { useState, useMemo, useRef, useEffect } from \"react\"\nimport \"./styles.scss\"\n\nimport DataLoader from \"../DataLoader\"\nimport AutoSuggest from \"react-autosuggest\"\nimport classnames from \"classnames\"\nimport useOnClickOutside from \"use-onclickoutside\"\n\nexport const unselectedCountryLabel = \"Global\"\n// Use your imagination to render suggestions.\nconst renderSuggestion = (suggestion) =>
    {suggestion.Country}
    \n\nconst startsWith = (word, prefix) => {\n const wordLower = word.toLowerCase()\n const prefixLower = prefix.toLowerCase()\n const prefixLength = prefixLower.length\n return wordLower.substr(0, prefixLength) === prefixLower\n}\n\nconst countrySortWithValue = (value) => {\n return (a, b) => {\n let aCountry = a.Country\n let bCountry = b.Country\n if (startsWith(aCountry, \"The \")) {\n aCountry = aCountry.slice(4)\n }\n if (startsWith(bCountry, \"The \")) {\n bCountry = bCountry.slice(4)\n }\n if (aCountry === unselectedCountryLabel) {\n return -1\n }\n if (bCountry === unselectedCountryLabel) {\n return 1\n }\n if (value !== \"\" && value !== null) {\n const aStartsWith = startsWith(aCountry, value)\n const bStartsWith = startsWith(bCountry, value)\n if (aStartsWith && !bStartsWith) {\n return -1\n }\n if (!aStartsWith && bStartsWith) {\n return 1\n }\n }\n\n if (aCountry > bCountry) {\n return 1\n }\n return -1\n }\n}\nexport default function CountrySelect(props) {\n const { value, selectedYear } = props\n\n const [selectOpen, setSelectOpen] = useState(false)\n const [currentTypedInputValue, setCurrentTypedInputValue] = useState(\"\")\n const [currentSuggestions, setCurrentSuggestions] = useState(null)\n const containerRef = useRef()\n const inputRef = useRef()\n\n useEffect(() => {\n if (selectOpen) {\n inputRef.current && inputRef.current.focus()\n setCurrentTypedInputValue(\"\")\n setCurrentSuggestions(null)\n }\n }, [selectOpen])\n\n const close = () => {\n setSelectOpen(false)\n clear()\n }\n useOnClickOutside(containerRef, close)\n\n const countries = useMemo(\n () => [\n { Country: unselectedCountryLabel },\n ...[...DataLoader.dataByYear[selectedYear].countries].sort(\n countrySortWithValue(\"\"),\n ),\n ],\n [selectedYear],\n )\n\n const onChangeTypeEntry = (event, { newValue }) => {\n setCurrentTypedInputValue(newValue)\n }\n\n const fetchSuggestions = ({ value }) => {\n const input = value.toLowerCase()\n const suggestions = countries\n .filter((country) => country.Country.toLowerCase().includes(input))\n .sort(countrySortWithValue(value))\n setCurrentSuggestions(suggestions)\n }\n\n const pickSelection = (event, { suggestion, suggestionValue }) => {\n close()\n props.onChange(suggestion)\n }\n\n const highlightSelection = ({ suggestion }) => props.onHighlight(suggestion)\n\n const toggleSelectOpen = (event) => {\n if (selectOpen) {\n close()\n } else {\n setSelectOpen(true)\n }\n }\n\n const clear = () => {\n inputRef.current && inputRef.current.focus()\n setCurrentTypedInputValue(\"\")\n setCurrentSuggestions(null)\n inputRef.current && inputRef.current.focus()\n }\n\n const onClearButton = () => {\n props.onClear()\n clear()\n }\n\n const renderInput = (props) => {\n const clearButton =\n props.value === \"\" ? null : (\n \n ×\n \n )\n return (\n
    \n \n {clearButton}\n
    \n )\n }\n const autoselect = selectOpen ? (\n country.Country}\n renderSuggestion={renderSuggestion}\n inputProps={{\n value: currentTypedInputValue,\n onChange: onChangeTypeEntry,\n }}\n alwaysRenderSuggestions={true}\n onSuggestionSelected={pickSelection}\n onSuggestionHighlighted={highlightSelection}\n renderInputComponent={renderInput}\n focusInputOnSuggestionClick={false}\n />\n ) : null\n return (\n \n
    \n {value === \"\" ? \"COUNTRY\" : value}\n
    \n {autoselect}\n \n )\n}\n\nCountrySelect.defaultProps = {\n onChange: () => {},\n onHighlight: () => {},\n onClear: () => {},\n}\n","import React, { useState, useMemo, useEffect, useCallback } from \"react\"\nimport { useParams, useHistory, useLocation } from \"react-router-dom\"\nimport getSelectionsFromParams from \"../utils/getSelectionsFromParams\"\nimport classnames from \"classnames\"\n\nimport Map from \"../Map/\"\nimport { getCountryByName } from \"../utils/countryLookup\"\nimport { GradientLegend } from \"../Legends/\"\nimport DataLoader, { years, factors } from \"../DataLoader\"\nimport \"./styles.scss\"\n// import FactorInfoIconTooltip from './FactorInfoIconTooltip'\nimport CountrySelect, { unselectedCountryLabel } from \"../CountrySelect/\"\nimport useDimensions from \"react-use-dimensions\"\nimport { useWindowScroll, useScrollbarWidth } from \"react-use\"\nimport classNames from \"classnames\"\nconst defaultEmptyRegionSelection = []\n\nconst mapStrokeOutline = { color: \"#333\", width: 1.5 }\nconst setOverrideMapVisibility = () => {}\n\nexport default function InsightsView(props) {\n const [mapRef, mapDimensions] = useDimensions()\n const params = useParams()\n const { selectedCountry, selectedYear, selectedFactor, unusedOpts } =\n getSelectionsFromParams(params)\n const history = useHistory()\n const location = useLocation()\n // const [hoveredOverFactor, setHoveredOverFactor] = useState(null)\n const { children, ...otherProps } = props\n const windowScroll = useWindowScroll()\n\n const updateUrlFromEvent = (property) => {\n return (event) => {\n updateUrl(property)(event.target.value)\n }\n }\n const updateUrl = useCallback(\n (property) => {\n return (newValue) => {\n const newUrlParams = {\n country: selectedCountry,\n year: selectedYear,\n factor: selectedFactor,\n }\n newUrlParams[property] = newValue\n if (property === \"country\" && newValue === unselectedCountryLabel) {\n newUrlParams[property] = \"\"\n }\n\n let baseUrl = null\n switch (true) {\n case !!location.pathname.match(\"/global\"):\n baseUrl = \"/global\"\n break\n case !!location.pathname.match(\"/country\"):\n baseUrl = \"/country\"\n break\n case !!location.pathname.match(\"/factors\"):\n baseUrl = \"/factors\"\n break\n default:\n console.warn(\"something went wrong\")\n break\n }\n if (!baseUrl) {\n console.warn(\"something went wrong\")\n return\n }\n let url = `${baseUrl}/${encodeURIComponent(newUrlParams.year)}`\n if (newUrlParams.country !== \"\") {\n url = `${url}/${encodeURIComponent(newUrlParams.country)}`\n }\n if (newUrlParams.factor !== \"\") {\n url = `${url}/${encodeURIComponent(newUrlParams.factor)}`\n }\n if (unusedOpts) {\n url = `${url}/${unusedOpts.join(\"/\")}`\n }\n history.push(url)\n }\n },\n [\n history,\n location,\n selectedCountry,\n selectedYear,\n selectedFactor,\n unusedOpts,\n ],\n )\n\n const gotoCountryPage = useCallback(\n (country) => {\n return () => {\n const newUrlParams = {\n country: country,\n year: selectedYear,\n factor: selectedFactor,\n }\n\n const baseUrl = \"/country\"\n let url = `${baseUrl}/${encodeURIComponent(newUrlParams.year)}`\n if (newUrlParams.country !== \"\") {\n url = `${url}/${encodeURIComponent(newUrlParams.country)}`\n }\n if (newUrlParams.factor !== \"\") {\n url = `${url}/${encodeURIComponent(newUrlParams.factor)}`\n }\n history.push(url)\n }\n },\n [selectedYear, selectedFactor, history],\n )\n\n const selectCountryFromMinimap = useCallback(\n (country) => {\n return () => {\n updateUrl(\"country\")(country)\n }\n },\n [updateUrl],\n )\n\n const updateCountryFromAutocomplete = (country) => {\n updateUrl(\"country\")(\n country.Country === unselectedCountryLabel ? \"\" : country.Country,\n )\n }\n const onGlobalInsights = !!location.pathname.match(\"/global\")\n const onCountryInsights = !!location.pathname.match(\"/country\")\n\n const [showGlobalInsightsInstructions, setShowGlobalInsightsInstructions] =\n useState(false)\n\n const [mainMapInteractable, setMainMapInteractable] = useState(false)\n\n useEffect(() => {\n let timeoutId = null\n if (onGlobalInsights && !showGlobalInsightsInstructions) {\n timeoutId = setTimeout(() => {\n setMainMapInteractable(true)\n }, 500)\n } else if (showGlobalInsightsInstructions) {\n setMainMapInteractable(false)\n }\n return () => {\n clearTimeout(timeoutId)\n }\n }, [onGlobalInsights, showGlobalInsightsInstructions])\n\n const toggleGlobalInsightsInstructions = useCallback(() => {\n setShowGlobalInsightsInstructions(!showGlobalInsightsInstructions)\n }, [showGlobalInsightsInstructions])\n\n const currentYearData = DataLoader.dataByYear[selectedYear]\n const factorKey = useMemo(() => {\n return selectedFactor === \"\"\n ? \"overall\"\n : currentYearData.aggregateFactorKeys.find((k) =>\n k.includes(selectedFactor),\n )\n }, [selectedFactor, currentYearData])\n\n const mapData = useMemo(\n () =>\n currentYearData.countries.map((c) => ({\n code: c[\"Country Code\"],\n value: c[factorKey],\n originalDatum: c,\n scoreKey: factorKey,\n })),\n [currentYearData, factorKey],\n )\n let selectedRegion = useMemo(() => {\n if (selectedCountry) {\n return getCountryByName(selectedCountry)\n ? [getCountryByName(selectedCountry).id]\n : defaultEmptyRegionSelection\n }\n return defaultEmptyRegionSelection\n }, [selectedCountry])\n const miniMapWidth = mapDimensions.width\n const headerHeight = 111\n const miniMapHeight = isNaN(miniMapWidth / 2) ? 0 : miniMapWidth / 2\n\n const sidebarMap = miniMapWidth ? (\n \n ) : null\n\n const scrollbarSize = useScrollbarWidth()\n\n const mapWidth = window.innerWidth - scrollbarSize\n const mobile = \"ontouchstart\" in window && mapWidth < 900\n\n const useSmallerMapHeight = location.pathname.match(\"/factors\") && !mobile\n const mapMaxHeight = window.innerHeight - headerHeight - 200\n\n const mapSizeBasedOnWidth = useSmallerMapHeight\n ? window.innerWidth / 4\n : window.innerWidth / 2\n const fullscreenMapHeight = Math.min(mapMaxHeight, mapSizeBasedOnWidth)\n\n useEffect(() => {\n if (selectedCountry && onGlobalInsights) {\n window.scrollTo(0, fullscreenMapHeight + 72) // 72 is WJP header height\n }\n }, [selectedCountry, onGlobalInsights, fullscreenMapHeight])\n\n const { fade, setFade } = props\n const { current } = mapRef\n\n useEffect(() => {\n if (fade && current) {\n setTimeout(() => setFade(false), 350)\n }\n }, [fade, setFade, current])\n\n const factorOptions = [\"\", ...factors]\n\n const yearsToUse =\n selectedCountry === \"\" || !DataLoader.yearsForCountries[selectedCountry]\n ? years\n : DataLoader.yearsForCountries[selectedCountry]\n\n const yearSelectOptions = yearsToUse.map((year) => (\n \n ))\n const factorSelectOptions = factorOptions.map((factor) => (\n \n ))\n\n const naturalMapScale = Math.pow(\n Math.max(0, (fullscreenMapHeight - windowScroll.y) / fullscreenMapHeight),\n 3,\n )\n let mapScale = naturalMapScale\n\n const mapHeight = fullscreenMapHeight * mapScale\n const showSelectCountryNotice = onCountryInsights && !selectedCountry\n const showMiniMap =\n mapHeight < miniMapHeight || (onCountryInsights && selectedCountry !== \"\")\n const displaySidebarMap =\n (onCountryInsights && selectedCountry !== \"\") || showMiniMap\n\n if (showMiniMap) {\n mapScale = 0\n }\n\n useEffect(() => {\n if (onGlobalInsights) {\n setShowGlobalInsightsInstructions(true)\n }\n }, [onGlobalInsights])\n\n useEffect(() => {\n const listItem = document.querySelector(\".globalInsightInstructionsText li\")\n if (listItem) {\n const listItemHeight = listItem.offsetHeight\n helpItem2Offset = listItemHeight + 10 // Dynamically adjust based on content height\n }\n }, [showGlobalInsightsInstructions])\n\n const fullscreenMap =\n (onCountryInsights && selectedCountry) ||\n (mobile && onGlobalInsights) ? null : (\n \n )\n\n const instructionsStyle = {\n transform: `translate(${mapWidth / 2}px, ${\n fullscreenMapHeight * 0.25\n }px) translate(-50%, -50%)`,\n opacity: showGlobalInsightsInstructions ? 1 : 0.5,\n }\n\n const [itemPositions, totalBoundingBox] = useMemo(() => {\n const items = [\n \".overviewInstructionsFactors\",\n \".overviewInstructionsHistorical\",\n \".overviewInstructionsFilters\",\n ]\n .map((selector) => document.querySelector(selector))\n .map((el) => (el ? el.getBoundingClientRect() : null))\n\n const boundingBox = items.reduce(\n (acc, item) => {\n if (!item) {\n return acc\n }\n return {\n left: Math.min(acc.left, item.left),\n right: Math.max(acc.right, item.right),\n top: Math.min(acc.top, item.top),\n bottom: Math.max(acc.bottom, item.bottom),\n }\n },\n {\n left: Infinity,\n right: -Infinity,\n top: Infinity,\n bottom: -Infinity,\n },\n )\n if (items.filter((d) => d).length === 0) {\n return [null, null]\n }\n return [items, boundingBox]\n }, [])\n\n let interactiveInstructionsStyle = {\n transform: `translate(${\n mapWidth / 2\n }px, ${fullscreenMapHeight}px) translateY(-1em) translate(-50%, -100%)`,\n opacity: showGlobalInsightsInstructions ? 1 : 0.5,\n }\n let helpItem2Offset = 40\n if (itemPositions) {\n const firstItemCenterX = itemPositions[0].left + itemPositions[0].width / 2\n interactiveInstructionsStyle.width =\n totalBoundingBox.right - totalBoundingBox.left + helpItem2Offset\n interactiveInstructionsStyle.transform = `translate(${firstItemCenterX}px, ${\n fullscreenMapHeight - 10\n }px) translateY(-100%) translateY(-1em)`\n }\n let innerInstructionsStyle = {}\n let innerInteractiveInstructionsStyle = {}\n\n if (!showGlobalInsightsInstructions) {\n const helpIconXOffset = 30\n const helpIconYOffset = 20\n instructionsStyle.transform += `translate(${\n mapWidth / 2 - helpIconXOffset\n }px, ${fullscreenMapHeight * 0.75 + helpIconYOffset}px) scale(0)`\n instructionsStyle.transform += `translate(${\n mapWidth / 2 - helpIconXOffset\n }px, 0px) scale(0)`\n innerInstructionsStyle = {\n transform: `translate(0, ${fullscreenMapHeight / 2 + helpIconYOffset}px)`,\n opacity: showGlobalInsightsInstructions ? 1 : 0,\n }\n\n interactiveInstructionsStyle.transform += `translate(${\n mapWidth / 2 - helpIconXOffset\n }px, ${helpIconYOffset}px) translateY(50%) scale(0)`\n interactiveInstructionsStyle.transform += `translate(${\n mapWidth / 2 - helpIconXOffset\n }px, 0px) scale(0)`\n innerInteractiveInstructionsStyle = {\n transform: `translate(0, ${helpIconYOffset}px)`,\n opacity: showGlobalInsightsInstructions ? 1 : 1,\n }\n }\n let gloalInsightsInstructionsPointerEvents = null\n if (!showGlobalInsightsInstructions && mainMapInteractable) {\n gloalInsightsInstructionsPointerEvents = \"none\"\n }\n if (!onGlobalInsights) {\n gloalInsightsInstructionsPointerEvents = \"none\"\n }\n if (mobile) {\n interactiveInstructionsStyle.display = \"none\"\n instructionsStyle.transform = null\n innerInstructionsStyle.transform = null\n if (!showGlobalInsightsInstructions) {\n instructionsStyle.marginTop = \"-100%\"\n }\n if (!onGlobalInsights) {\n instructionsStyle.display = \"none\"\n }\n }\n let globalInsightInstructions = (\n setShowGlobalInsightsInstructions(false)}\n style={{ pointerEvents: gloalInsightsInstructionsPointerEvents }}\n >\n
    \n
    \n
    ×
    \n
    \n {mobile ? \"Interactive\" : \"Country\"} Information\n
    \n
    \n {mobile\n ? \"To view by factor specific rankings select a factor above. To view historical and regional rankings click on any of the areas below.\"\n : \"Hover over any country on the map or the list below to view scores and rankings. To view country profiles, select the countries tab on the menu above.\"}\n
    \n
    \n
    \n \n
    \n {/*
    ×
    */}\n
    \n Interactive Information\n
    \n
    \n
      \n
    • View rankings by specific factors.
    • \n
    • View historical rankings since 2015.
    • \n
    • View regional or income-based rankings.
    • \n
    \n
    \n
    \n \n \n )\n return (\n
    \n
    \n
    \n \n \n
    \n
    \n \n {factorSelectOptions}\n \n
    \n
    \n \n
    \n
    \n \n \n {fullscreenMap}\n
    \n {globalInsightInstructions}\n \n {showSelectCountryNotice ? (\n
    \n Please select a country to view insights\n
    \n ) : (\n
    \n
    \n \n {sidebarMap}\n
    \n \n {factorOptions.map((factor, factorIndex) => {\n const selected = factor === selectedFactor\n const label =\n factorIndex === 0\n ? \"Overall Index Score\"\n : `${factorIndex} | ${factor}`\n const instructions =\n factorIndex === 0 ? (\n
    \n Explore by Issue/Factor\n
    \n ) : null\n const arrow = selected ? : null\n return (\n \n updateUrl(\"factor\")(factor)}\n >\n {label}\n
    \n {arrow}\n {instructions}\n \n )\n })}\n \n \n
    \n
    \n {React.cloneElement(children, {\n headerHeight: naturalMapScale === 0 ? headerHeight : null,\n toggleGlobalInsightsInstructions,\n selectedCountry,\n selectedYear,\n selectedFactor,\n unusedOpts,\n updateUrl,\n setOverrideMapVisibility,\n gotoCountryPage,\n ...otherProps,\n })}\n
    \n
    \n \n )}\n \n )\n}\n","export default __webpack_public_path__ + \"static/media/Factor1.aca3178a.svg\";","import Factor1 from \"./Factor1.svg\"\nimport Factor2 from \"./Factor2.svg\"\nimport Factor3 from \"./Factor3.svg\"\nimport Factor4 from \"./Factor4.svg\"\nimport Factor5 from \"./Factor5.svg\"\nimport Factor6 from \"./Factor6.svg\"\nimport Factor7 from \"./Factor7.svg\"\nimport Factor8 from \"./Factor8.svg\"\nimport Factor1_grey from \"./Factor1_grey.svg\"\nimport Factor2_grey from \"./Factor2_grey.svg\"\nimport Factor3_grey from \"./Factor3_grey.svg\"\nimport Factor4_grey from \"./Factor4_grey.svg\"\nimport Factor5_grey from \"./Factor5_grey.svg\"\nimport Factor6_grey from \"./Factor6_grey.svg\"\nimport Factor7_grey from \"./Factor7_grey.svg\"\nimport Factor8_grey from \"./Factor8_grey.svg\"\n\nexport const factorImages = {\n 1: Factor1,\n 2: Factor2,\n 3: Factor3,\n 4: Factor4,\n 5: Factor5,\n 6: Factor6,\n 7: Factor7,\n 8: Factor8,\n\n \"1_grey\": Factor1_grey,\n \"2_grey\": Factor2_grey,\n \"3_grey\": Factor3_grey,\n \"4_grey\": Factor4_grey,\n \"5_grey\": Factor5_grey,\n \"6_grey\": Factor6_grey,\n \"7_grey\": Factor7_grey,\n \"8_grey\": Factor8_grey,\n}\n","export default __webpack_public_path__ + \"static/media/Factor2.81da2243.svg\";","export default __webpack_public_path__ + \"static/media/Factor3.f2be0de7.svg\";","export default __webpack_public_path__ + \"static/media/Factor4.075a63c2.svg\";","export default __webpack_public_path__ + \"static/media/Factor5.579905a5.svg\";","export default __webpack_public_path__ + \"static/media/Factor6.82eddd21.svg\";","export default __webpack_public_path__ + \"static/media/Factor7.a7a29298.svg\";","export default __webpack_public_path__ + \"static/media/Factor8.e0d93db7.svg\";","export default __webpack_public_path__ + \"static/media/Factor1_grey.1ee6369d.svg\";","export default __webpack_public_path__ + \"static/media/Factor2_grey.ac8dcf02.svg\";","export default __webpack_public_path__ + \"static/media/Factor3_grey.143b751c.svg\";","export default __webpack_public_path__ + \"static/media/Factor4_grey.68b54ab9.svg\";","export default __webpack_public_path__ + \"static/media/Factor5_grey.96cf0883.svg\";","export default __webpack_public_path__ + \"static/media/Factor6_grey.655db4f5.svg\";","export default __webpack_public_path__ + \"static/media/Factor7_grey.d38b7b5d.svg\";","export default __webpack_public_path__ + \"static/media/Factor8_grey.2f60edc5.svg\";","import React, { useState } from \"react\"\n\nimport useDimensions from \"react-use-dimensions\"\nimport \"./styles.scss\"\nimport DataLoader from \"../DataLoader\"\nimport { scaleLinear } from \"d3-scale\"\nimport gradient from \"../utils/gradient\"\nimport { animated, useTransition } from \"react-spring\"\nimport useIsInViewport from \"use-is-in-viewport\"\nimport Tooltip from \"../Tooltip/\"\nimport useDetectPrint from \"use-detect-print\"\n\nconst printFullWidth = 700\n\nconst minGraphHeight = 140\nfunction CountryFactorBarGraph(props) {\n const [tooltipData, setTooltipData] = useState()\n const { selectedCountry, selectedYear, countryData, scoreKey, title } = props\n const [ref, containerDimensions] = useDimensions()\n const [isInViewPort, wrappedRef] = useIsInViewport({ target: ref })\n const isPrinting = useDetectPrint()\n\n const margins = {\n top: 30,\n left: 60,\n right: 20,\n bottom: 20,\n }\n if (!props.axis) {\n margins.left = 10\n margins.right = margins.left\n margins.bottom = margins.left / 2\n }\n let graphContents = null\n let containerHeight = 0\n\n const hoverCountry = (country) => {\n return (event) => {\n if (!country) {\n return setTooltipData(null)\n }\n let x = 0\n let y = 0\n if (\"clientX\" in event) {\n x = event.clientX\n y = event.clientY\n }\n if (event.touches) {\n event.preventDefault()\n event.stopPropagation()\n }\n setTooltipData({ country, x, y })\n }\n }\n let containerWidth = containerDimensions.width || 400\n\n if (isPrinting) {\n containerWidth = printFullWidth\n }\n let width = containerWidth - margins.left - margins.right\n containerHeight = Math.max(containerWidth / 5, minGraphHeight)\n let height = containerHeight - margins.top - margins.bottom\n\n const countriesSortedByScore = [\n ...DataLoader.dataByYear[selectedYear].countries,\n ]\n const countriesSortedAlpha = [\n ...DataLoader.dataByYear[selectedYear].countries,\n ]\n\n countriesSortedAlpha.sort((a, b) => (a.Country > b.Country ? 1 : -1))\n countriesSortedByScore.sort((a, b) => a[scoreKey] - b[scoreKey])\n\n const yScale = scaleLinear().domain([0, 1]).range([0, height])\n\n const xScale = scaleLinear()\n .domain([0, countriesSortedAlpha.length - 1])\n .range([0, width])\n\n const barWidth = xScale(0.9)\n\n let selectedValues = null\n\n const getBarDimensions = (country) => {\n const countryScoreIndex = countriesSortedByScore.findIndex(\n (d) => d.Country === country.Country,\n )\n const score = country[scoreKey]\n const x = xScale(countryScoreIndex)\n const barHeight = yScale(score.toFixed(2))\n const y = height - barHeight\n let fill = gradient(score)\n const countryIsSelected = country.Country === selectedCountry\n if (countryIsSelected) {\n selectedValues = { x, score, y, transform: `translate(${x}, ${y})` }\n fill = \"black\"\n }\n if (props.rankAttribute !== \"Global\" && !countryIsSelected) {\n fill =\n country[props.rankAttribute] !== countryData[props.rankAttribute]\n ? \"#EBEBEB\"\n : fill\n }\n return { x, y, height: barHeight, fill }\n }\n\n const transitions = useTransition(\n containerDimensions.width ? countriesSortedAlpha : [],\n (d) => d.Country,\n {\n enter: getBarDimensions,\n update: getBarDimensions,\n immediate: !isInViewPort,\n },\n )\n\n const bars = transitions.map((data, countryIndex) => {\n if (data.state === \"leave\") {\n return null\n }\n const country = data.item\n const springProps = data.props\n const { x, y, height, fill } = springProps\n return (\n \n \n \n )\n })\n\n const yTicksValues = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]\n const majorTickSize = 20\n const minorTickSize = majorTickSize / 2\n\n const selectedValueTransition = useTransition(selectedValues, null, {\n enter: selectedValues,\n update: selectedValues,\n immediate: !isInViewPort,\n })\n const yTicks = (\n \n {yTicksValues.map((tick, tickIndex) => {\n const tickSize = tickIndex % 2 === 0 ? majorTickSize : minorTickSize\n const y = height - yScale(tick) + 0.5\n const label =\n tickIndex === 0 || tickIndex === yTicksValues.length - 1 ? (\n \n {tick.toFixed(1)}\n \n ) : null\n return (\n \n \n {label}\n \n )\n })}\n \n \n SCORE\n \n \n )\n const selectedCountryScoreIndex =\n selectedValues !== null\n ? countriesSortedByScore.findIndex(\n (d) => d.Country === countryData.Country,\n )\n : -1\n const selectedCountryScorePercentage =\n selectedCountryScoreIndex / countriesSortedByScore.length\n const countryLabelTextAnchor =\n selectedCountryScorePercentage < 0.25\n ? \"start\"\n : selectedCountryScorePercentage < 0.75\n ? \"middle\"\n : \"end\"\n const countryLabelTextOffset =\n countryLabelTextAnchor === \"start\"\n ? -barWidth / 2\n : countryLabelTextAnchor === \"end\"\n ? barWidth / 2\n : 0\n const selectedValueIndicator = selectedValueTransition.map((transition) => {\n if (!transition.item || transition.state === \"leave\") return null\n\n return (\n \n \n \n {selectedCountry.toUpperCase()},{\" \"}\n {countryData[`${scoreKey}_Rank_${props.rankAttribute}`]} /{\" \"}\n {countryData[`Count_${props.rankAttribute}`]}\n \n \n )\n })\n graphContents = (\n \n {bars}\n \n {title}\n \n {props.axis ? (\n \n {yTicks}\n \n \n {countriesSortedAlpha.length}\n \n \n 1\n \n \n RANK\n \n \n ) : null}\n {selectedValueIndicator}\n \n )\n\n return (\n
    \n \n \n \n \n \n \n\n {graphContents}\n \n {tooltipData ? (\n \n ) : null}\n
    \n )\n}\n\nCountryFactorBarGraph.defaultProps = {\n rankAttribute: \"Global\",\n axis: true,\n}\n\nexport default React.memo(CountryFactorBarGraph)\n","import React, { useRef, useEffect } from \"react\"\n\nimport InsightsView from \"../InsightsView/\"\nimport DataLoader, { factors } from \"../DataLoader\"\nimport { factorImages } from \"../images/factor_icons/factorImages\"\nimport CountryFactorBarGraph from \"../CountryFactorBarGraph\"\nimport useDimensions from \"react-use-dimensions\"\nimport { useSmallWidthMode } from \"../utils/smallWidthMode\"\nimport classnames from \"classnames\"\nimport ReactMarkdown from \"react-markdown\"\nimport \"./styles.scss\"\nimport { Helmet } from \"react-helmet\"\nexport const factorHeaderLabels = [\n [\"GLOBAL\", \"RANK\"], // hmm should this change if a Region is selected??\n [\"Government\", \"Powers\"],\n [\"Absence of\", \"Corruption\"],\n [\"Open\", \"Government\"],\n [\"Fundamental\", \"Rights\"],\n [\"Order and\", \"Security\"],\n [\"Regulatory\", \"Enforcement\"],\n [\"Civil\", \"Justice\"],\n [\"Criminal\", \"Justice\"],\n [\"OVERALL\", \"SCORE\"],\n]\n\nfunction Factors(props) {\n const [containerRef, , containerNode] = useDimensions()\n const factorGraphRef = useRef()\n const inSmallWidthMode = useSmallWidthMode()\n\n const {\n selectedFactor,\n selectedYear,\n selectedCountry,\n setOverrideMapVisibility,\n } = props\n const factorSelected = selectedFactor !== \"\"\n\n const cardFactorIndex = factors.indexOf(selectedFactor)\n const factorNumber = cardFactorIndex + 1\n const countryData = DataLoader.dataByYear[selectedYear].countries.find(\n (country) => country.Country === selectedCountry,\n )\n\n const { aggregateFactorKeys } = DataLoader.dataByYear[selectedYear]\n\n const factorsToDisplay = factorSelected\n ? DataLoader.dataByYear[selectedYear].questionKeys.filter(\n (questionKey) => questionKey[0] === `${cardFactorIndex + 1}`,\n )\n : DataLoader.dataByYear[selectedYear].aggregateFactorKeys\n\n const factorDisplay = factorsToDisplay.map((subfactor, subfactorIndex) => {\n let subfactorKey = subfactor.split(\" \")[0]\n subfactorKey =\n subfactorKey[subfactorKey.length - 1] === \".\"\n ? subfactorKey.substr(0, subfactorKey.length - 1)\n : subfactorKey\n const textKey = `${\n factorSelected ? `Sub-Factor ${subfactorKey}` : subfactor.split(\":\")[0]\n } Description`\n const subfactorText = DataLoader.getCopy(textKey)\n return (\n
    \n
    {subfactor}
    \n
    \n \n
    \n \n
    \n )\n })\n const nextFactorValue = factors[cardFactorIndex + 1]\n const nextFactorLabel =\n cardFactorIndex === factors.length - 1\n ? null\n : factorHeaderLabels[cardFactorIndex + 2].join(\" \")\n const nextFactorButton = nextFactorLabel ? (\n props.updateUrl(\"factor\")(nextFactorValue)}\n className=\"nextFactor\"\n >\n {nextFactorLabel}\n \n \n ) : null\n\n const factorKey = factorSelected\n ? aggregateFactorKeys.find((k) => k.includes(props.selectedFactor))\n : \"overall\"\n const factorTitle = factorSelected\n ? selectedFactor\n : \"WJP Rule of Law Index Factors\"\n\n useEffect(() => {\n const cachedRef = factorGraphRef.current\n const observer = new IntersectionObserver(\n ([e]) => setOverrideMapVisibility(e.intersectionRatio < 0.99),\n { threshold: [0.99] },\n )\n\n observer.observe(cachedRef)\n\n return function () {\n observer.unobserve(cachedRef)\n }\n }, [setOverrideMapVisibility])\n useEffect(() => {\n if (containerNode) {\n const scrollDomNode = inSmallWidthMode\n ? document.documentElement\n : containerNode\n scrollDomNode.scrollTo({\n top: 0,\n behavior: \"smooth\",\n })\n }\n }, [selectedFactor, containerNode, inSmallWidthMode])\n\n const scrollHeight = props.headerHeight\n ? window.innerHeight - props.headerHeight\n : null\n const factorText = factorSelected\n ? DataLoader.getCopy(`Factor ${factorNumber} Description`)\n : DataLoader.getCopy(\"Overview Description\")\n return (\n
    \n \n \n WJP Rule of Law Index | {factorSelected ? factorTitle : \"Factors\"}{\" \"}\n \n \n \n \n
    \n \n
    \n
    \n {factorTitle}\n
    \n
    \n
    \n {factorSelected ? (\n \n ) : null}\n \n {factorSelected\n ? factorTitle\n : \"Explore rankings by factor components\"}\n
    \n \n
    \n
    \n {factorDisplay}\n {nextFactorButton}\n
    \n
    \n \n \n )\n}\n\nexport default function FactorsControls(props) {\n return (\n \n \n \n )\n}\n","const labels = {\n \"Hong Kong SAR, China\": \"Hong Kong, China\",\n \"St. Vincent and the Grenadines\": \"St. Vincent and G...\",\n \"Bosnia and Herzegovina\": \"Bosnia and Herz...\",\n}\n\nexport default function getShortCountryLabel(country) {\n return labels[country] ? labels[country] : country\n}\n","import React, { useRef, useEffect } from \"react\"\nimport DataLoader, { factors } from \"../DataLoader\"\n\nimport gradient from \"../utils/gradient\"\n\nimport \"./GlobalInsightsTable.scss\"\nimport { globalInsightsConstants } from \"./\"\nimport { useTransition, animated } from \"react-spring\"\n\nimport { factorHeaderLabels } from \"../Factors/\"\nimport { useMediumWidthMode } from \"../utils/smallWidthMode\"\nimport getShortCountryLabel from \"../utils/getShortCountryLabel\"\n\nexport default function GlobalInsightsTable(props) {\n const {\n selectedYear,\n selectedFactor,\n containerDimensions,\n selectedFilterIncome,\n selectedFilterRegion,\n selectedSortOrder,\n selectedCountry,\n headerHeight,\n } = props\n let countries = [...DataLoader.dataByYear[selectedYear].countries]\n\n if (selectedFilterIncome !== \"\") {\n countries = countries.filter(\n (country) => country[\"Income Group\"] === selectedFilterIncome,\n )\n }\n if (selectedFilterRegion !== \"\") {\n countries = countries.filter(\n (country) => country.Region === selectedFilterRegion,\n )\n }\n const inSmallWidthMode = useMediumWidthMode()\n const selectedCountryRef = useRef()\n useEffect(() => {\n if (\n selectedCountry !== \"\" &&\n selectedCountryRef.current &&\n props.containerRef &&\n headerHeight\n ) {\n const scrollDomNode = inSmallWidthMode\n ? document.documentElement\n : props.containerRef\n const scrollOffset =\n selectedCountryRef.current.getBoundingClientRect().y +\n scrollDomNode.scrollTop -\n 220 // 220 is about the size of the combined headers\n scrollDomNode.scrollTo({\n top: scrollOffset,\n behavior: \"smooth\",\n })\n }\n }, [selectedCountry, props.containerRef, inSmallWidthMode, headerHeight])\n\n let scrollToCountryNeeded = useRef(false)\n useEffect(() => {\n scrollToCountryNeeded.current = true\n }, [selectedFactor, selectedYear])\n\n const factorSelected = selectedFactor !== \"\"\n const factorIndex = factorSelected ? factors.indexOf(selectedFactor) : -1\n\n const { rowHeight, labelRankPadding, sidePadding, barHeight } =\n globalInsightsConstants\n\n const svgHeight = countries.length * rowHeight\n const sidePaddingToUse = inSmallWidthMode ? labelRankPadding : sidePadding\n const svgWidth =\n (containerDimensions.width ? containerDimensions.width : 300) -\n sidePaddingToUse\n\n const sortScoreKey = factorSelected\n ? `Factor ${factorIndex + 1}: ${selectedFactor}`\n : \"overall\"\n\n countries.sort((a, b) => {\n return b[sortScoreKey] - a[sortScoreKey]\n })\n countries.forEach((country, countryIndex) => {\n country.sortedRank = countryIndex\n })\n\n countries.sort((a, b) => {\n if (selectedSortOrder === \"alphabetical\") {\n const aCountryMinusThe = a.Country.replace(\"The \", \"\")\n const bCountryMinusThe = b.Country.replace(\"The \", \"\")\n if (aCountryMinusThe > bCountryMinusThe) {\n return 1\n }\n return -1\n }\n return b[sortScoreKey] - a[sortScoreKey]\n })\n\n const labelWidth = Math.max(\n svgWidth * globalInsightsConstants.labelWidthPercentage,\n globalInsightsConstants.minLabelWidth,\n )\n const fullBarWidth = svgWidth - labelWidth\n\n const allFactors = [\"rank\", ...factors, \"overall\"]\n const factorWidth = fullBarWidth / allFactors.length\n const boxPadding = 1\n\n const getTransitionValues = (country) => {\n const countryIndex = countries.findIndex((d) => d === country)\n return { y: countryIndex * rowHeight }\n }\n\n const totalTransitions = countries.length\n let numberTransitionsCompleted = 0\n const transitions = useTransition(countries, (d) => d.Country, {\n enter: getTransitionValues,\n update: getTransitionValues,\n onRest: () => {\n numberTransitionsCompleted++\n if (numberTransitionsCompleted === totalTransitions) {\n if (scrollToCountryNeeded.current) {\n scrollToCountryNeeded.current = false\n if (\n selectedCountry !== \"\" &&\n selectedCountryRef.current &&\n props.containerRef\n ) {\n const scrollOffset =\n selectedCountryRef.current.getBoundingClientRect().y +\n props.containerRef.scrollTop -\n 220 // 220 is about the size of the combined headers\n props.containerRef.scrollTo({\n top: scrollOffset,\n behavior: \"smooth\",\n })\n }\n }\n }\n },\n })\n\n const countryGroups = transitions.map((transition) => {\n if (transition.state === \"leave\") {\n return null\n }\n const country = transition.item\n const countryIndex = countries.findIndex((d) => d === country)\n const { y } = transition.props\n const textY = barHeight * 0.75\n const bgRect =\n countryIndex % 2 === 0 ? (\n \n ) : null\n const topMargins = (rowHeight - barHeight) / 2\n\n const selected = country.Country === selectedCountry\n const countryLabelWeight = selected ? \"900\" : null\n const countryOpacity = selectedCountry !== \"\" ? (selected ? 1 : 0.8) : 1\n const countryTextStyle = {\n fontWeight: countryLabelWeight,\n cursor: \"pointer\",\n }\n const factorBoxes = allFactors.map((factor, factorIndex) => {\n let rect = null\n let label = null\n const rankLabel = inSmallWidthMode\n ? `${country.sortedRank + 1}`\n : `${country.sortedRank + 1} / ${countries.length}`\n if (factorIndex !== 0) {\n const factorKey =\n factor !== \"overall\" ? `Factor ${factorIndex}: ${factor}` : \"overall\"\n const score = country[factorKey]\n const fill = gradient(score)\n rect = (\n \n )\n label = (\n \n {score.toFixed(2)}\n \n )\n } else {\n label = (\n \n {rankLabel}\n \n )\n }\n const x = factorIndex * factorWidth + labelWidth\n return (\n \n {rect}\n {label}\n \n )\n })\n return (\n `translate(0, ${y})`)}\n opacity={countryOpacity}\n ref={country.Country === selectedCountry ? selectedCountryRef : null}\n >\n {bgRect}\n \n props.updateUrl(\"country\")(country.Country)}\n x={labelWidth - labelRankPadding}\n y={textY}\n style={countryTextStyle}\n >\n {inSmallWidthMode\n ? getShortCountryLabel(country.Country)\n : country.Country}\n \n {factorBoxes}\n \n \n )\n })\n\n const headerLabelsOnOneLine = window.innerWidth < 460\n\n const tableHeaderHeight = inSmallWidthMode\n ? headerLabelsOnOneLine\n ? 110\n : 70\n : 36\n const headerTop = inSmallWidthMode\n ? document.querySelector(\".Nav\").getBoundingClientRect().height\n : null\n const primary = \"#482D8B\"\n const selectFactor = (factor, factorIndex) => {\n return () => {\n let factorToSet =\n factorIndex === 0 || factorIndex === allFactors.length - 1 ? \"\" : factor\n props.updateUrl(\"factor\")(factorToSet)\n }\n }\n const headers = allFactors.map((factor, factorIndex) => {\n const x = labelWidth + factorIndex * factorWidth\n const selected = factorSelected\n ? factor === selectedFactor\n : factorIndex === 0 || factorIndex === allFactors.length - 1\n const textFill = selected ? \"#fff\" : primary\n const backgroundColor = selected ? primary : \"#fff\"\n let labelValues = factorHeaderLabels[factorIndex]\n if (factorIndex === 0) {\n if (selectedFilterIncome !== \"\") {\n labelValues = [\"INCOME\", \"RANK\"]\n }\n if (selectedFilterRegion !== \"\") {\n labelValues = [\"REGIONAL\", \"RANK\"]\n }\n }\n const singleRowFactorLabels = [labelValues.join(\" \")]\n const labelsToUse = headerLabelsOnOneLine\n ? singleRowFactorLabels\n : labelValues\n const labels = labelsToUse.map((label, labelIndex) => {\n let y = 2 + 14 * (labelIndex + 1)\n let x = factorWidth / 2\n if (inSmallWidthMode && !headerLabelsOnOneLine) {\n if (labelIndex === 1) {\n y -= 14\n x += 14\n }\n }\n let rotate = \"\"\n let fontSize = 12\n if (window.innerWidth < 1350) {\n fontSize = 10\n }\n if (inSmallWidthMode) {\n rotate = `rotate(-90) translate(${\n headerLabelsOnOneLine\n ? `-${3.9 * fontSize}, ${0.2 * fontSize}`\n : `-${2 * fontSize}, -${0.5 * fontSize}`\n })`\n } else if (window.innerWidth < 1350) {\n rotate = `translate(0, -${0.2 * fontSize})`\n }\n const transform = `translate(${x}, ${y}) ${rotate}`\n return (\n \n {label}\n \n )\n })\n return (\n \n \n {labels}\n \n )\n })\n return (\n
    \n
    \n \n {headers}\n \n
    \n \n {countryGroups}\n \n
    \n )\n}\n","import React, { useState, useRef, useEffect } from \"react\"\nimport DataLoader, { factors, years } from \"../DataLoader\"\n\nimport gradient from \"../utils/gradient\"\nimport \"./GlobalInsightsHistorical.scss\"\nimport { globalInsightsConstants } from \"./\"\nimport { scaleSqrt } from \"d3-scale\"\nimport Tooltip from \"../Tooltip/\"\nimport { useTransition, animated } from \"react-spring\"\nimport { useSmallWidthMode } from \"../utils/smallWidthMode\"\nimport getShortCountryLabel from \"../utils/getShortCountryLabel\"\n\nexport default function GlobalInsightsHistorical(props) {\n const [tooltipData, setTooltipData] = useState(null)\n\n const {\n selectedYear,\n selectedFactor,\n containerDimensions,\n selectedFilterIncome,\n selectedFilterRegion,\n selectedCountry,\n headerHeight,\n } = props\n const selectedCountryRef = useRef()\n const inSmallWidthMode = useSmallWidthMode()\n useEffect(() => {\n if (\n selectedCountry !== \"\" &&\n selectedCountryRef.current &&\n props.containerRef &&\n headerHeight\n ) {\n const scrollDomNode = inSmallWidthMode\n ? document.documentElement\n : props.containerRef\n const scrollOffset =\n selectedCountryRef.current.getBoundingClientRect().y +\n scrollDomNode.scrollTop -\n 210 // 210 is about the size of the combined headers\n scrollDomNode.scrollTo({\n top: scrollOffset,\n behavior: \"smooth\",\n })\n }\n }, [selectedCountry, props.containerRef, inSmallWidthMode, headerHeight])\n\n let scrollToCountryNeeded = useRef(false)\n useEffect(() => {\n scrollToCountryNeeded.current = true\n }, [selectedFactor, selectedYear])\n\n // always grab the last year, as we want to show all countries\n let countries = [...DataLoader.dataByYear[selectedYear].countries]\n\n // since income & regions vary from year to year, these values might not make sense for the countries selected above\n if (selectedFilterIncome !== \"\") {\n countries = countries.filter(\n (country) => country[\"Income Group\"] === selectedFilterIncome,\n )\n }\n if (selectedFilterRegion !== \"\") {\n countries = countries.filter(\n (country) => country.Region === selectedFilterRegion,\n )\n }\n countries = countries.map((country) => {\n return { Country: country.Country }\n })\n\n const factorSelected = selectedFactor !== \"\"\n const factorIndex = factorSelected ? factors.indexOf(selectedFactor) : -1\n\n const {\n rowHeight,\n labelRankPadding,\n sidePadding,\n barHeight,\n labelRankWidth,\n } = globalInsightsConstants\n\n const sidePaddingToUse = inSmallWidthMode ? labelRankPadding : sidePadding\n\n const svgHeight = countries.length * rowHeight\n const svgWidth =\n (containerDimensions.width ? containerDimensions.width : 300) -\n (inSmallWidthMode ? 0 : 32)\n\n const scoreKey = factorSelected\n ? `Factor ${factorIndex + 1}: ${selectedFactor}`\n : \"overall\"\n const selectedYearIndex = years.indexOf(selectedYear)\n const yearsToUse = years.slice(0, selectedYearIndex + 1)\n countries.forEach((country) => {\n years.forEach((year) => {\n const countryDatum = DataLoader.dataByYear[year].countries.find(\n (d) => d.Country === country.Country,\n )\n if (countryDatum) {\n country[year] = countryDatum\n }\n })\n })\n years.forEach((year) => {\n countries.sort((a, b) => {\n const bValue = b[year] ? b[year][scoreKey] : null\n const aValue = a[year] ? a[year][scoreKey] : null\n\n if (!aValue && !bValue) {\n return 0 //perhaps do an alphabetic comparison? nah we don't really care cause we don't display em anyway\n } else if (!aValue) {\n return 1\n } else if (!bValue) {\n return -1\n }\n return bValue - aValue\n })\n countries.forEach((country, countryIndex) => {\n country[`rank_${year}`] = countryIndex\n })\n })\n\n countries.sort((a, b) => {\n return a[`rank_${selectedYear}`] - b[`rank_${selectedYear}`]\n })\n\n const labelWidth = Math.max(\n svgWidth * globalInsightsConstants.labelWidthPercentage,\n globalInsightsConstants.minLabelWidth,\n )\n const fullBarWidth = svgWidth - labelWidth\n\n const yearWidth = (fullBarWidth - sidePaddingToUse) / yearsToUse.length\n const radiusScale = scaleSqrt().domain([0, 1]).range([2, 10])\n\n const countPerYear = {}\n years.forEach((year) => {\n countPerYear[year] = 0\n countries.forEach((country) => {\n const score = country[year]\n if (!score) {\n return\n }\n countPerYear[year]++\n })\n })\n\n const hoverCountry = (country, year, showTooltip = true) => {\n return (event) => {\n if (!country) {\n return setTooltipData(null)\n }\n\n let x = 0\n let y = 0\n if (\"clientX\" in event) {\n x = event.clientX\n y = event.clientY\n }\n if (event.touches) {\n event.preventDefault()\n event.stopPropagation()\n }\n setTooltipData({\n country: country[year],\n year,\n x,\n y,\n showTooltip,\n showHistoricalPlot: true,\n })\n }\n }\n\n const getTransitionValues = (country) => {\n const countryIndex = countries.findIndex((d) => d === country)\n\n const result = { y: countryIndex * rowHeight }\n const countryPoints = []\n const yearsWithData = {}\n yearsToUse.forEach((year, yearIndex) => {\n if (!country[year]) {\n return null\n }\n const score = country[year][scoreKey]\n if (!score) {\n return null\n }\n const x = yearWidth * yearIndex + yearWidth * 0.5 + sidePaddingToUse\n const yearRank = country[`rank_${year}`]\n\n // we can either position circles relative to the number of countries in that year\n // or always having a fixed height per row. varies if you want to have a large gap at the bottom\n // or have years line up across the entire graph\n\n // fixed row height\n const cy = yearRank * rowHeight + rowHeight * 0.5\n\n // variable row height depending on number of countries in each year\n // const cy = yearRank / countPerYear[year] * svgHeight + rowHeight * 0.5\n result[`cx-${year}`] = x\n result[`cy-${year}`] = cy\n yearsWithData[year] = true\n countryPoints.push([x, cy])\n })\n years.forEach((year, yearIndex) => {\n if (yearsWithData[year]) {\n return\n }\n let tries = 0\n let stop = true\n let xy = null\n let distance = Number.MAX_SAFE_INTEGER\n while (tries < years.length && stop) {\n const yearIndexToTry = tries\n const yearToTry = years[yearIndexToTry]\n let potentialDistance = Math.abs(yearIndexToTry - yearIndex)\n if (yearsWithData[yearToTry] && potentialDistance < distance) {\n potentialDistance = distance\n xy = [result[`cx-${yearToTry}`], result[`cy-${yearToTry}`]]\n }\n tries++\n }\n if (!xy) {\n console.warn(\"something went wrong\")\n debugger\n }\n countryPoints.push(xy)\n result[`cx-${year}`] = xy[0]\n result[`cy-${year}`] = xy[1]\n })\n const countryLine = countryPoints.map((point) => point.join(\",\")).join(\" \")\n result.countryLine = countryLine\n if (countryLine.includes(\"NaN\")) {\n debugger\n }\n // console.log(result)\n return result\n }\n\n const totalTransitions = countries.length\n let numberTransitionsCompleted = 0\n\n const transitions = useTransition(countries, (d) => d.Country, {\n enter: getTransitionValues,\n update: getTransitionValues,\n onRest: () => {\n numberTransitionsCompleted++\n if (numberTransitionsCompleted === totalTransitions) {\n if (scrollToCountryNeeded.current) {\n scrollToCountryNeeded.current = false\n if (\n selectedCountry !== \"\" &&\n selectedCountryRef.current &&\n props.containerRef\n ) {\n const scrollOffset =\n selectedCountryRef.current.getBoundingClientRect().y +\n props.containerRef.scrollTop -\n 210 // 210 is about the size of the combined headers\n props.containerRef.scrollTo({\n top: scrollOffset,\n behavior: \"smooth\",\n })\n }\n }\n }\n },\n })\n\n const countryGroups = transitions.map((transition) => {\n if (transition.state === \"leave\") {\n return null\n }\n const country = transition.item\n const countryIndex = countries.findIndex((d) => d === country)\n\n const { y } = transition.props\n const textY = barHeight * 0.75\n const topMargins = (rowHeight - barHeight) / 2\n const yearsCircles = yearsToUse.map((year, yearIndex) => {\n if (!country[year]) {\n return null\n }\n const score = country[year][scoreKey]\n if (!score) {\n return null\n }\n const x = transition.props[`cx-${year}`]\n const y = transition.props[`cy-${year}`]\n\n const fill = gradient(score)\n const r = radiusScale(score)\n return (\n \n \n \n )\n })\n\n const countryLabelWeight =\n country.Country === selectedCountry ||\n (tooltipData !== null && tooltipData.country.Country === country.Country)\n ? \"900\"\n : null\n const countryTextStyle = {\n fontWeight: countryLabelWeight,\n cursor: \"pointer\",\n }\n\n let opacity = null\n // let strokeWidth = null\n if (selectedCountry !== \"\") {\n opacity = country.Country === selectedCountry ? opacity : 0.3\n // strokeWidth = country.Country === selectedCountry ? 2 : strokeWidth\n }\n if (tooltipData !== null) {\n opacity = tooltipData.country.Country === country.Country ? null : 0.2\n // strokeWidth = tooltipData.country.Country === country.Country ? 2 : strokeWidth\n }\n\n return (\n \n `translate(0, ${y + topMargins})`)}\n >\n props.updateUrl(\"country\")(country.Country)}\n x={fullBarWidth + labelRankPadding * 2 + labelRankWidth}\n y={textY}\n style={countryTextStyle}\n >\n {country.Country}\n \n props.updateUrl(\"country\")(country.Country)}\n x={fullBarWidth + labelRankPadding}\n y={textY}\n style={countryTextStyle}\n >\n {countryIndex + 1}\n \n props.updateUrl(\"country\")(country.Country)}\n x={fullBarWidth + labelRankPadding}\n y={textY}\n style={countryTextStyle}\n >\n {countryIndex + 1} {getShortCountryLabel(country.Country)}\n \n \n {/* */}\n {yearsCircles}\n \n )\n })\n\n const historicalHeaderHeight = 24\n const headers = yearsToUse.map((year, yearIndex) => {\n const x = yearIndex * yearWidth + sidePaddingToUse\n\n return (\n \n \n \n {year}\n \n {year === selectedYear ? (\n \n ) : null}\n \n )\n })\n const backgroundRectRowCount = 10\n const numberOfBackgroundRects = Math.ceil(\n countries.length / backgroundRectRowCount,\n )\n const backgroundRects = []\n for (let i = 0; i <= numberOfBackgroundRects; i++) {\n backgroundRects.push(\n ,\n )\n }\n const headerTop = inSmallWidthMode\n ? document.querySelector(\".Nav\").getBoundingClientRect().height\n : null\n\n return (\n
    \n
    \n Countries Scored by {factorSelected ? selectedFactor : \"Overall Score\"}\n
    \n
    \n \n {headers}\n \n
    \n \n \n \n \n \n \n \n {backgroundRects}\n {countryGroups}\n \n \n {tooltipData && tooltipData.showTooltip ? (\n \n ) : null}\n
    \n )\n}\n","import React, { useState, useEffect, useRef } from \"react\"\nimport DataLoader, { factors } from \"../DataLoader\"\n\nimport { scaleLinear } from \"d3-scale\"\nimport gradient from \"../utils/gradient\"\n\nimport \"./GlobalInsightsRanking.scss\"\nimport { globalInsightsConstants } from \"./\"\nimport Tooltip from \"../Tooltip/\"\nimport { useTransition, animated } from \"react-spring\"\nimport { useSmallWidthMode } from \"../utils/smallWidthMode\"\nimport getShortCountryLabel from \"../utils/getShortCountryLabel\"\n\nexport default function GlobalInsightsTable(props) {\n const {\n selectedYear,\n selectedFactor,\n containerDimensions,\n selectedFilterIncome,\n selectedFilterRegion,\n selectedCountry,\n headerHeight,\n } = props\n const [tooltipData, setTooltipData] = useState()\n const selectedCountryRef = useRef()\n const inSmallWidthMode = useSmallWidthMode()\n useEffect(() => {\n if (\n selectedCountry !== \"\" &&\n selectedCountryRef.current &&\n props.containerRef &&\n headerHeight\n ) {\n const scrollDomNode = inSmallWidthMode\n ? document.documentElement\n : props.containerRef\n const scrollOffset =\n selectedCountryRef.current.getBoundingClientRect().y +\n scrollDomNode.scrollTop -\n 185 // 185 is about the size of the combined headers\n scrollDomNode.scrollTo({\n top: scrollOffset,\n behavior: \"smooth\",\n })\n }\n }, [selectedCountry, props.containerRef, inSmallWidthMode, headerHeight])\n\n let scrollToCountryNeeded = useRef(false)\n useEffect(() => {\n scrollToCountryNeeded.current = true\n }, [selectedFactor, selectedYear])\n\n let countries = [...DataLoader.dataByYear[selectedYear].countries]\n\n if (selectedFilterIncome !== \"\") {\n countries = countries.filter(\n (country) => country[\"Income Group\"] === selectedFilterIncome,\n )\n }\n if (selectedFilterRegion !== \"\") {\n countries = countries.filter(\n (country) => country.Region === selectedFilterRegion,\n )\n }\n\n if (props.overrideRegionFilter) {\n countries = countries.filter(props.overrideRegionFilter)\n }\n\n const factorSelected = selectedFactor !== \"\"\n const factorIndex = factorSelected ? factors.indexOf(selectedFactor) : -1\n\n const {\n rowHeight,\n labelRankPadding,\n labelRankWidth,\n sidePadding,\n barHeight,\n } = globalInsightsConstants\n\n const svgHeight = countries.length * rowHeight\n const sidePaddingToUse = inSmallWidthMode ? labelRankPadding : sidePadding\n const svgWidth =\n (containerDimensions.width ? containerDimensions.width : 300) -\n sidePaddingToUse\n const scoreKey = factorSelected\n ? `Factor ${factorIndex + 1}: ${selectedFactor}`\n : \"overall\"\n const sortedCountries = [...countries]\n sortedCountries.sort((a, b) => {\n // if (selectedSortOrder === 'alphabetical') {\n // if (a.Country > b.Country) {\n // return 1\n // }\n // return -1\n // }\n return b[scoreKey] - a[scoreKey]\n })\n const countryIndicies = {}\n sortedCountries.forEach((country, index) => {\n countryIndicies[country.Country] = index\n })\n\n const maxValue = sortedCountries[0][scoreKey]\n\n const labelWidth = Math.max(\n svgWidth * globalInsightsConstants.labelWidthPercentage,\n globalInsightsConstants.minLabelWidth,\n )\n const valueLabelWidth = 30 + globalInsightsConstants.labelRankPadding * 2\n const fullBarWidth = svgWidth - labelWidth - valueLabelWidth\n\n const xScale = scaleLinear().domain([0, maxValue]).range([0, fullBarWidth])\n const hoverCountry = (country) => {\n return (event) => {\n if (!country) {\n return setTooltipData(null)\n }\n let x = 0\n let y = 0\n if (\"clientX\" in event) {\n x = event.clientX\n y = event.clientY\n }\n if (event.touches) {\n event.preventDefault()\n event.stopPropagation()\n }\n setTooltipData({ country, x, y })\n }\n }\n\n const getSpringValues = (country) => {\n const score = country[scoreKey]\n const fill = gradient(score)\n const width = xScale(score.toFixed(2))\n const y = countryIndicies[country.Country] * rowHeight\n\n return {\n score,\n fill,\n width,\n y,\n }\n }\n const totalTransitions = countries.length\n let numberTransitionsCompleted = 0\n const transitions = useTransition(countries, (d) => d.Country, {\n enter: getSpringValues,\n update: getSpringValues,\n onRest: () => {\n numberTransitionsCompleted++\n if (numberTransitionsCompleted === totalTransitions) {\n if (scrollToCountryNeeded.current) {\n scrollToCountryNeeded.current = false\n if (\n selectedCountry !== \"\" &&\n selectedCountryRef.current &&\n props.containerRef\n ) {\n const scrollOffset =\n selectedCountryRef.current.getBoundingClientRect().y +\n props.containerRef.scrollTop -\n 185 // 185 is about the size of the combined headers\n props.containerRef.scrollTo({\n top: scrollOffset,\n behavior: \"smooth\",\n })\n }\n }\n }\n },\n })\n\n const countryGroups = transitions.map((transition, countryIndex) => {\n if (transition.state === \"leave\") {\n return null\n }\n const country = transition.item\n const { score, fill, width, y } = transition.props\n\n const textY = barHeight * 0.75\n const bgRect =\n countryIndicies[country.Country] % 2 === 0 ? (\n \n ) : null\n const topMargins = (rowHeight - barHeight) / 2\n const countryLabelWeight =\n country.Country === selectedCountry ? \"900\" : null\n const countryOpacity =\n selectedCountry !== \"\"\n ? selectedCountry === country.Country\n ? 1\n : 0.8\n : 1\n const countryTextStyle = {\n fontWeight: countryLabelWeight,\n cursor: \"pointer\",\n }\n let countryLabel = country.Country\n if (props.labelSubstitutions && props.labelSubstitutions[countryLabel]) {\n countryLabel = props.labelSubstitutions[countryLabel]\n }\n return (\n `translate(0, ${y})`)}\n opacity={countryOpacity}\n ref={selectedCountry === country.Country ? selectedCountryRef : null}\n >\n {bgRect}\n \n \n props.updateUrl(\"country\")(country.Country)}\n x={labelWidth - labelRankPadding}\n y={textY}\n style={countryTextStyle}\n >\n {countryIndicies[country.Country] + 1}\n \n props.updateUrl(\"country\")(country.Country)}\n x={labelWidth - labelRankPadding * 2 - labelRankWidth}\n y={textY}\n style={countryTextStyle}\n >\n {countryLabel}\n \n props.updateUrl(\"country\")(country.Country)}\n x={labelWidth - labelRankPadding}\n y={textY}\n style={countryTextStyle}\n >\n {getShortCountryLabel(country.Country)}{\" \"}\n {countryIndicies[country.Country] + 1}\n \n\n width + labelWidth + labelRankPadding,\n )}\n y={textY}\n style={{ textAnchor: \"start\", ...countryTextStyle }}\n >\n {score.interpolate((score) => score.toFixed(2))}\n \n \n \n )\n })\n\n return (\n
    \n
    \n Countries Scored by {factorSelected ? selectedFactor : \"Overall Score\"}\n
    \n \n {countryGroups}\n \n {tooltipData ? (\n \n ) : null}\n
    \n )\n}\n","export default __webpack_public_path__ + \"static/media/lightbulb-icon.612e07cd.svg\";","import React, { useState, useRef, useEffect, useLayoutEffect } from \"react\"\nimport { useHistory } from \"react-router-dom\"\nimport useDimensions from \"react-use-dimensions\"\nimport InlineButtons from \"../InlineButtons/\"\nimport \"./styles.scss\"\nimport DataLoader from \"../DataLoader\"\nimport GlobalInsightsTable from \"./GlobalInsightsTable\"\nimport GlobalInsightsHistorical from \"./GlobalInsightsHistorical\"\nimport GlobalInsightsRanking from \"./GlobalInsightsRanking\"\nimport { Helmet } from \"react-helmet\"\nimport helpIcon from \"../images/lightbulb-icon.svg\"\nimport { useMemo } from \"react\"\n\nexport default function GlobalInsights(props) {\n const {\n selectedCountry,\n selectedYear,\n selectedFactor,\n unusedOpts,\n setOverrideMapVisibility,\n toggleGlobalInsightsInstructions,\n } = props\n const history = useHistory()\n const [selectedFilterRegion, setFilterRegion] = useState(\"\")\n const [selectedFilterIncome, setFilterIncome] = useState(\"\")\n const [selectedSortOrder, setSortOrder] = useState(\"ranking\")\n const [containerRef, containerDimensions, containerNode] = useDimensions()\n const [mouseOverFilter, setMouseOverFilter] = useState(null)\n const controlsRef = useRef()\n\n useLayoutEffect(() => {\n if (selectedCountry) {\n return\n }\n window.scrollTo({ top: 0 })\n setTimeout(() => {\n window.scrollTo({ top: 0 })\n }, 200)\n }, [selectedCountry])\n\n const selectView = (view) => {\n return () => {\n const newUrlParams = {\n country: selectedCountry,\n year: selectedYear,\n factor: selectedFactor,\n }\n\n const baseUrl = \"/global\"\n let url = `${baseUrl}/${encodeURIComponent(newUrlParams.year)}`\n if (newUrlParams.country !== \"\") {\n url = `${url}/${encodeURIComponent(newUrlParams.country)}`\n }\n if (newUrlParams.factor !== \"\") {\n url = `${url}/${encodeURIComponent(newUrlParams.factor)}`\n }\n url = `${url}/${view}`\n history.push(url)\n }\n }\n\n const globalInsightButtons = [\n {\n label: \"Table\",\n onClick: selectView(\"table\"),\n value: \"table\",\n view: GlobalInsightsTable,\n },\n {\n label: \"Historical\",\n onClick: selectView(\"historical\"),\n value: \"historical\",\n view: GlobalInsightsHistorical,\n className: \"overviewInstructionsHistorical\",\n },\n {\n label: \"Ranking\",\n onClick: selectView(\"ranking\"),\n value: \"ranking\",\n view: GlobalInsightsRanking,\n },\n ]\n\n let view = globalInsightButtons[2]\n\n if (unusedOpts[0]) {\n const matchingButton = globalInsightButtons.filter(\n (d) => d.value === unusedOpts[0],\n )\n if (matchingButton.length) {\n view = matchingButton[0]\n }\n }\n\n const updateFromSelect = (setter) => {\n return (event) => {\n if (setter === setFilterIncome) {\n setFilterRegion(\"\")\n }\n if (setter === setFilterRegion) {\n setFilterIncome(\"\")\n }\n setter(event.target.value)\n }\n }\n\n const hoverFilter = (filter) => {\n return () => {\n setMouseOverFilter(filter)\n }\n }\n\n const regionValues = useMemo(() => {\n return DataLoader.dataByYear[selectedYear].groups.Region.map((d) => d[0])\n }, [selectedYear])\n\n const regionOptions = useMemo(() => {\n return regionValues.sort().map((d) => (\n \n ))\n }, [regionValues])\n\n // go with hardcoded income values now that they are consistent, avoids need to sort\n const incomeValues = [\"Low\", \"Lower-middle\", \"Upper-middle\", \"High\"]\n const incomeOptions = incomeValues.map((d) => (\n \n ))\n if (\n selectedFilterRegion !== \"\" &&\n !regionValues.includes(selectedFilterRegion)\n ) {\n setFilterRegion(\"\")\n }\n if (\n selectedFilterIncome !== \"\" &&\n !incomeValues.includes(selectedFilterIncome)\n ) {\n setFilterIncome(\"\")\n }\n\n const scrollHeight = props.headerHeight\n ? window.innerHeight - props.headerHeight\n : null\n\n useEffect(() => {\n const cachedRef = controlsRef.current\n const observer = new IntersectionObserver(\n ([e]) => setOverrideMapVisibility(e.intersectionRatio < 0.99),\n { threshold: [0.99] },\n )\n\n observer.observe(cachedRef)\n\n return function () {\n observer.unobserve(cachedRef)\n }\n }, [setOverrideMapVisibility])\n\n let regionFilterOpacity = null\n let incomeFilterOpacity = null\n if (mouseOverFilter === null) {\n // set solely based on which filter is selected\n regionFilterOpacity = selectedFilterIncome !== \"\" ? 0.5 : null\n incomeFilterOpacity = selectedFilterRegion !== \"\" ? 0.5 : null\n } else {\n // set solely based on which filter mouse is over\n regionFilterOpacity = mouseOverFilter === \"region\" ? null : 0.5\n incomeFilterOpacity = mouseOverFilter === \"income\" ? null : 0.5\n }\n\n const showSortSelect = view.label === \"Table\"\n const sortStyle = {\n opacity: showSortSelect ? 1 : 0,\n pointerEvents: showSortSelect ? null : \"none\",\n display: showSortSelect ? null : \"none\",\n maxWidth: \"11em\",\n }\n\n const toggleHelp = () => {\n toggleGlobalInsightsInstructions()\n }\n return (\n
    \n \n WJP Rule of Law Index | Global Insights\n \n \n \n
    \n \n
    \n Filter By:\n \n \n {regionOptions}\n \n or\n \n \n {incomeOptions}\n \n \n \n \n \n
    \n \n
    \n \n
    \n \n )\n}\n","import React, { useEffect, useState } from \"react\"\nimport GlobalInsights from \"./GlobalInsights\"\nimport InsightsView from \"../InsightsView\"\n\nexport const globalInsightsConstants = {\n rowHeight: 24,\n labelRankPadding: 5,\n labelRankWidth: 28,\n sidePadding: 32,\n labelWidthPercentage: 0.3,\n fullBarWidthPercentage: 0.7,\n barHeight: 24 * 0.8,\n minLabelWidth: 140,\n}\n\nexport default function GlobalInsightsControls(props) {\n\n const [loaded, setLoaded] = useState(false)\n\n useEffect(() => {\n setTimeout(() => {\n setLoaded(true)\n }, 200)\n }, [])\n\n if(!loaded) {\n return null\n }\n\n return (\n \n \n \n )\n}\n","import React from \"react\"\nimport { createPortal } from \"react-dom\"\n\nimport \"./styles.scss\"\n\nlet tooltipEle = null\nexport default function Tooltip(props) {\n const { country, x, y, scoreKey } = props\n if (!tooltipEle) {\n tooltipEle = document.querySelector(\"#tooltip\")\n if (!tooltipEle) {\n console.warn(\"tooltip element not found?\")\n }\n }\n\n const score = country[scoreKey]\n\n const tooltipStyle = {\n left: x,\n top: y,\n transform: `translate(-50%, -100%)`,\n }\n\n return createPortal(\n
    \n {country.Country} {score.toFixed(2)}\n
    ,\n tooltipEle,\n )\n}\n","import React, { useState } from \"react\"\n\nimport useDimensions from \"react-use-dimensions\"\nimport \"./styles.scss\"\nimport DataLoader from \"../DataLoader\"\nimport { scaleLinear } from \"d3-scale\"\nimport { gradientColors } from \"../utils/gradient\"\nimport CountryFactorFillGraphTooltip from \"./CountryFactorFillGraphTooltip\"\nimport { useSpring, animated, useTransition } from \"react-spring\"\nimport useDetectPrint from \"use-detect-print\"\nimport { useSmallWidthMode } from \"../utils/smallWidthMode\"\n\nconst printFullWidth = 700\nconst printHalfWidth = printFullWidth - 245\n\nexport default function CountryFactorFillGraph(props) {\n const [tooltipData, setTooltipData] = useState(null)\n const { selectedCountry, selectedYear, scoreKey, countryData } = props\n\n const [ref, containerDimensions] = useDimensions()\n const margins = {\n top: 40,\n left: 30,\n right: 30,\n bottom: 10,\n }\n const containerHeight = 80\n const isPrinting = useDetectPrint()\n const inSmallWidthMode = useSmallWidthMode()\n\n let graphContents = null\n //let defs = null\n const [selectedValues, setSelectedValues] = useSpring(() => ({\n from: { x: 0, score: 0 },\n to: { x: 0, score: 0 },\n }))\n const countries = DataLoader.dataByYear[selectedYear].countries\n\n let containerWidth = containerDimensions.width || 400\n if (isPrinting) {\n if (props.printStyle === \"fullWidth\") {\n containerWidth = printFullWidth\n } else if (props.printStyle === \"halfWidth\") {\n containerWidth = printHalfWidth\n }\n }\n let width = containerWidth - margins.left - margins.right\n let height = containerHeight - margins.top - margins.bottom\n\n const xScale = scaleLinear().domain([0, 1]).range([0, width])\n\n const getTrianglePositions = (country) => {\n const score = country[scoreKey]\n const x = xScale(score)\n const selected = country.Country === selectedCountry\n const hovered = tooltipData ? country === tooltipData.country : false\n const opacity = selected || hovered ? 1 : inSmallWidthMode ? 0.05 : 0.1\n const fill = hovered ? \"#482D8B\" : \"#000000\"\n\n if (selected) {\n setSelectedValues({ x, score })\n }\n return { x, opacity, fill }\n }\n const triangleTransitions = useTransition(\n containerDimensions.width ? countries : [],\n (d) => d.Country,\n {\n enter: getTrianglePositions,\n update: getTrianglePositions,\n },\n )\n\n const groups = [\n {\n attribute: \"Region\",\n label: inSmallWidthMode ? \"Reg. Avg\" : \"Regional Avg\",\n value: DataLoader.dataByYear[selectedYear].groupAverages.Region.find(\n (groupValue) => groupValue.group === countryData.Region,\n )[scoreKey],\n },\n {\n attribute: \"Global\",\n label: \"Global Avg\",\n value: DataLoader.dataByYear[selectedYear].groupAverages.global[scoreKey],\n },\n ].sort((a, b) => a.value - b.value)\n\n const getGroupPositions = (group) => {\n const value = group.value\n const x = xScale(value)\n return { x, value }\n }\n const groupTransitions = useTransition(\n containerDimensions.width ? groups : [],\n (d) => d.attribute,\n {\n enter: getGroupPositions,\n update: getGroupPositions,\n },\n )\n\n const hoverCountry = (country, _x, _y) => {\n return (event) => {\n if (inSmallWidthMode) {\n return setTooltipData(null)\n }\n if (!country) {\n return setTooltipData(null)\n }\n\n let x = event.pageX\n const targetPosition = event.target.getBoundingClientRect()\n let y = targetPosition.y - 1\n setTooltipData({ country, x, y })\n }\n }\n\n const barHeight = 20\n const miniBarHeight = barHeight * 0.2\n const triangles = triangleTransitions.map((transition, countryIndex) => {\n if (transition.state === \"leave\") {\n return null\n }\n const country = transition.item\n const { x, fill, opacity } = transition.props\n return (\n `translate(${x}, 0)`)}\n y={margins.top}\n onMouseOver={hoverCountry(country, x, 0)}\n onMouseMove={hoverCountry(country, x, 0)}\n onMouseOut={hoverCountry(null)}\n >\n \n \n )\n })\n\n const groupLines = groupTransitions.map((item, groupIndex) => {\n const group = item.item\n const { x, value } = item.props\n const textX = groupIndex === 0 ? -5 : 5\n const textAnchor = groupIndex === 0 ? \"end\" : \"start\"\n return (\n `translate(${n}, 0)`)}\n >\n \n \n {value.interpolate(\n (v) => `${group.label.toUpperCase()} ${v.toFixed(2)}`,\n )}\n \n \n )\n })\n\n const gradientId = `fillGraphGradient-${(\n (Math.random() * 0xffffff) <<\n 0\n ).toString(16)}`\n graphContents = (\n \n {triangles}\n \n \n \n Math.max(0, width - x))}\n height={barHeight - miniBarHeight}\n y={miniBarHeight}\n fill=\"#ebebeb\"\n />\n \n \n 0.0\n \n \n 1.0\n \n \n {selectedValues.score.interpolate(\n (n) => `${selectedCountry.toUpperCase()} ${n.toFixed(2)}`,\n )}\n \n {groupLines}\n \n )\n\n return (\n
    \n \n \n \n {gradientColors.map((color) => (\n \n ))}\n \n \n {graphContents}\n \n {tooltipData ? (\n \n ) : null}\n
    \n )\n}\n","export default __webpack_public_path__ + \"static/media/arrow-down-dark.5e6b6155.svg\";","export default __webpack_public_path__ + \"static/media/arrow-up-dark.27f8bda8.svg\";","import React from \"react\"\n\nimport gradient from \"../utils/gradient\"\n\nimport \"./CountryCardOverall.scss\"\nimport DataLoader, { years } from \"../DataLoader\"\nimport CountryFactorFillGraph from \"../CountryFactorFillGraph/\"\nimport { factorImages } from \"../images/factor_icons/factorImages\"\n//import HistoricalBubbleGraph from \"../HistoricalBubbleGraph/\"\nimport arrowDown from \"../images/arrow-down.svg\"\nimport arrowUp from \"../images/arrow-up.svg\"\nimport arrowDownDark from \"../images/arrow-down-dark.svg\"\nimport arrowUpDark from \"../images/arrow-up-dark.svg\"\nimport { animated, useSpring } from \"react-spring\"\n\nexport default function CountryCardOverall(props) {\n const {\n selectedCountry,\n selectedYear,\n selectedFactor,\n factorIndex,\n factorSelected,\n countryData,\n scoreKey,\n } = props\n const yearIndex = years.indexOf(selectedYear)\n const title = factorSelected ? (\n \n {\" \"}\n {factorIndex + 1} | {selectedFactor} for {selectedCountry}, {selectedYear}\n \n ) : (\n `${selectedCountry} Overall Score, ${selectedYear}`\n )\n\n const overallTitle = `${\n factorSelected ? `Factor ${factorIndex + 1}` : \"Overall\"\n } Score`\n\n const score = countryData[scoreKey]\n const overallColor = gradient(score)\n\n const globalRank = countryData[`${scoreKey}_Rank_Global`]\n const regionRank = countryData[`${scoreKey}_Rank_Region`]\n const incomeRank = countryData[`${scoreKey}_Rank_Income Group`]\n\n const globalDemoninator = countryData.Count_Global\n const regionDemoninator = countryData.Count_Region\n const incomeDenominator = countryData[\"Count_Income Group\"]\n let rankChange = 0\n let scoreChange = 0\n let overallCOTIcon = null\n let globalRankCOTIcon = null\n let regionalRankCOTIcon = null\n let incomeRankCOTIcon = null\n let hasPreviousYearData = false\n\n let rankChangeIcon = null\n let scoreChangeIcon = null\n if (yearIndex !== 0) {\n const previousYear = years[yearIndex - 1]\n const previousYearData = DataLoader.dataByYear[previousYear].countries.find(\n (country) => country.Country === selectedCountry,\n )\n if (previousYearData) {\n hasPreviousYearData = true\n\n const previousYearScore = previousYearData[scoreKey]\n scoreChange = score - previousYearScore\n\n if (scoreChange > 0) {\n overallCOTIcon = \"\"\n scoreChangeIcon = (\n \"\"\n )\n } else if (scoreChange < 0) {\n overallCOTIcon = \"\"\n scoreChangeIcon = (\n \"\"\n )\n }\n\n const globalRankIndexedByLastYearsCountriesOnly =\n countryData[`${scoreKey}_Rank_Global_lastYear`]\n const regionRankIndexedByLastYearsCountriesOnly =\n countryData[`${scoreKey}_Rank_Region_lastYear`]\n const incomeRankIndexedByLastYearsCountriesOnly =\n countryData[`${scoreKey}_Rank_Income Group_lastYear`]\n\n const previousYearGlobalRank = previousYearData[`${scoreKey}_Rank_Global`]\n const previousYearRegionRank = previousYearData[`${scoreKey}_Rank_Region`]\n const previousYearIncomeRank =\n previousYearData[`${scoreKey}_Rank_Income Group`]\n\n rankChange =\n previousYearGlobalRank - globalRankIndexedByLastYearsCountriesOnly\n rankChangeIcon =\n rankChange === 0 ? null : (\n \n )\n if (previousYearGlobalRank < globalRankIndexedByLastYearsCountriesOnly) {\n globalRankCOTIcon = (\n \"\"\n )\n } else if (\n previousYearGlobalRank > globalRankIndexedByLastYearsCountriesOnly\n ) {\n globalRankCOTIcon = (\n \"\"\n )\n }\n if (previousYearRegionRank < regionRankIndexedByLastYearsCountriesOnly) {\n regionalRankCOTIcon = (\n \"\"\n )\n } else if (\n previousYearRegionRank > regionRankIndexedByLastYearsCountriesOnly\n ) {\n regionalRankCOTIcon = (\n \"\"\n )\n }\n if (previousYearIncomeRank < incomeRankIndexedByLastYearsCountriesOnly) {\n incomeRankCOTIcon = (\n \"\"\n )\n } else if (\n previousYearIncomeRank > incomeRankIndexedByLastYearsCountriesOnly\n ) {\n incomeRankCOTIcon = (\n \"\"\n )\n }\n }\n }\n if (!score) {\n debugger\n }\n\n const [values, setValues] = useSpring(() => ({\n score: 0,\n globalRank: 0,\n globalDemoninator: 0,\n regionRank: 0,\n regionDemoninator: 0,\n incomeRank: 0,\n incomeDenominator: 0,\n rankChange: 0,\n scoreChange: 0,\n }))\n\n setValues({\n score,\n globalRank,\n globalDemoninator,\n regionRank,\n regionDemoninator,\n incomeRank,\n incomeDenominator,\n rankChange,\n scoreChange,\n })\n\n return (\n
    \n
    \n \n {title}\n
    \n\n
    \n
    \n
    {overallTitle}
    \n
    \n \n {values.score.interpolate((s) => s.toFixed(2))}\n \n {overallCOTIcon}\n
    \n
    \n
    \n
    Global Rank
    \n
    \n \n {values.globalRank.interpolate(Math.round)}\n \n /\n \n {values.globalDemoninator.interpolate(Math.round)}\n {\" \"}\n {globalRankCOTIcon}\n
    \n
    \n
    \n
    Regional Rank
    \n
    \n \n {values.regionRank.interpolate(Math.round)}\n \n /\n \n {values.regionDemoninator.interpolate(Math.round)}\n {\" \"}\n {\n //regionalRankCOTIcon\n }\n
    \n
    \n
    \n
    Income Rank
    \n
    \n \n {values.incomeRank.interpolate(Math.round)}\n {\" \"}\n /\n \n {values.incomeDenominator.interpolate(Math.round)}\n {\" \"}\n {\n //incomeRankCOTIcon\n }\n
    \n
    \n
    \n
    Rank Change
    \n
    \n \n {values.rankChange.interpolate((c) =>\n hasPreviousYearData\n ? c === 0\n ? \"0\"\n : c > 0\n ? `+${Math.round(c)}`\n : Math.round(c)\n : \"-\",\n )}\n {\" \"}\n {rankChangeIcon}\n
    \n
    \n
    \n
    Score Change
    \n
    \n \n {values.scoreChange.interpolate((c) => {\n const valueSignless = Math.abs(c).toFixed(2)\n const valueWithSign = c > 0 ? `+${c.toFixed(2)}` : c.toFixed(2)\n const value =\n valueSignless === \"0.00\" ? valueSignless : valueWithSign\n return hasPreviousYearData ? (c === 0 ? \"0.00\" : value) : \"-\"\n })}\n {\" \"}\n {scoreChangeIcon}\n
    \n
    \n
    \n
    Arrows signify year-to-year change
    \n
    \n
    \n
    \n \n
    \n
    \n )\n}\n","import React, { useState } from \"react\"\nimport ordinal from \"ordinal\"\n\nimport \"./CountryCardRanks.scss\"\nimport InlineButtons from \"../InlineButtons\"\nimport CountryFactorBarGraph from \"../CountryFactorBarGraph/\"\n\nexport default function CountryCardRanks(props) {\n const [selectedRankAttribute, setRankAttribute] = useState(\"Global\")\n const {\n selectedCountry,\n selectedYear,\n selectedFactor,\n factorSelected,\n countryData,\n scoreKey,\n } = props\n\n const rank = ordinal(countryData[`${scoreKey}_Rank_Global`])\n const rankCount = countryData.Count_Global\n const title = `${selectedCountry} Ranked ${rank} Across ${rankCount} Countries, ${selectedYear}`\n const graphTitle = factorSelected ? selectedFactor : \"Overall Score\"\n return (\n \n )\n}\n","import React from \"react\"\n\nimport useDimensions from \"react-use-dimensions\"\nimport \"./styles.scss\"\nimport { scaleLinear } from \"d3-scale\"\nimport { gradientColors } from \"../utils/gradient\"\nimport { useSpring, animated } from \"react-spring\"\n\nimport useDetectPrint from \"use-detect-print\"\nconst printFullWidth = 700\nconst printHalfWidth = printFullWidth - 245\n\nexport default function SingleFillGraph(props) {\n const [ref, containerDimensions] = useDimensions()\n const margins = {\n top: 2,\n left: 30 + props.leftMargin,\n right: 30,\n bottom: 2,\n }\n const containerHeight = 26\n\n let graphContents = null\n let defs = null\n const isPrinting = useDetectPrint()\n const [spring, set] = useSpring(() => ({ value: 0, x: 0 }))\n\n let containerWidth = containerDimensions.width || 400\n if (isPrinting) {\n containerWidth = printHalfWidth\n }\n let width = containerWidth - margins.left - margins.right\n const xScale = scaleLinear().domain([0, 1]).range([0, width])\n\n set({ value: props.value, x: xScale(props.value.toFixed(2)) })\n\n const barHeight = 20\n\n const { x, value } = spring\n const maskId = `singleFillGraphMaskId-${(\n (Math.random() * 0xffffff) <<\n 0\n ).toString(16)}`\n\n graphContents = (\n \n \n \n \n \n {props.leftAxisLabel}\n \n \n {props.rightAxisLabel}\n \n \n {value.interpolate((n) => n.toFixed(2))}\n \n \n )\n\n defs = (\n \n \n \n \n \n )\n return (\n
    \n \n \n \n {gradientColors.map((color) => (\n \n ))}\n \n {defs}\n \n {graphContents}\n \n
    \n )\n}\n\nSingleFillGraph.defaultProps = {\n leftMargin: 0,\n}\n","import React, { useState } from \"react\"\n\nimport InlineButtons from \"../InlineButtons/\"\n\nimport \"./CountryCardFactors.scss\"\nimport DataLoader, { years } from \"../DataLoader\"\nimport gradient from \"../utils/gradient\"\nimport CountryFactorFillGraph from \"../CountryFactorFillGraph/\"\nimport isEqual from \"lodash/isEqual\"\nimport SingleFillGraph from \"../SingleFillGraph\"\nimport { factorImages } from \"../images/factor_icons/factorImages\"\nimport classnames from \"classnames\"\n\nimport arrowDown from \"../images/arrow-down.svg\"\nimport arrowUp from \"../images/arrow-up.svg\"\nimport { animated, useSprings } from \"react-spring\"\n\nexport default function CountryCardFactors(props) {\n const [previousFactors, setPreviousFactors] = useState(false)\n const [factorSort, setFactorSort] = useState(\"alphabetical\")\n const [factorsExpanded, setFactorsExpanded] = useState([])\n\n const {\n selectedCountry,\n selectedYear,\n countryData,\n factorSelected,\n selectedFactor,\n factorIndex,\n } = props\n\n const yearIndex = years.indexOf(selectedYear)\n\n const factors = factorSelected\n ? DataLoader.dataByYear[selectedYear].questionKeys.filter(\n (questionKey) => questionKey[0] === `${factorIndex + 1}`,\n )\n : DataLoader.dataByYear[selectedYear].aggregateFactorKeys\n\n if (!isEqual(factors, previousFactors)) {\n setPreviousFactors(factors)\n setFactorsExpanded(factorSelected ? [] : factors.map((d) => false))\n }\n\n const sortOptions = [\n { value: \"value\", label: `${factorSelected ? \"Sub-\" : \"\"}Factor Score` },\n {\n value: \"alphabetical\",\n label: `${factorSelected ? \"Sub-\" : \"\"}Factors 1-${factors.length}`,\n },\n ]\n\n // const collapseAll = () => {\n // setFactorsExpanded(factorsExpanded.map(d => false))\n // }\n // const expandAll = () => {\n // setFactorsExpanded(factorsExpanded.map(d => true))\n // }\n\n // const subfactorOptions = [\n // { label: 'Collapse All', onClick: collapseAll, value: 'allCollapsed' },\n // { label: 'Expand All', onClick: expandAll, value: 'allExpanded' },\n // ]\n\n const title = factorSelected ? (\n \n \n Factor {factorIndex + 1} |{\" \"}\n {selectedFactor} Sub-factors for {selectedCountry}, {selectedYear}\n \n ) : (\n `Behind the Numbers: Factor Scores for ${selectedCountry}, ${selectedYear}`\n )\n\n const factorsSorted = [...factors] // maybe actually do a sort here?\n if (factorSort === \"value\") {\n factorsSorted.sort((a, b) => {\n return countryData[b] - countryData[a]\n })\n }\n const [factorSprings, setFactorValues] = useSprings(\n factorsSorted.length,\n () => ({\n score: 0,\n regionalRank: 0,\n incomeRank: 0,\n globalRank: 0,\n regionalRankCount: 0,\n incomeRankCount: 0,\n globalRankCount: 0,\n }),\n )\n\n setFactorValues((factorIndex) => {\n const factor = factorsSorted[factorIndex]\n const score = countryData[factor]\n const regionalRank = countryData[`${factor}_Rank_Region`]\n const incomeRank = countryData[`${factor}_Rank_Income Group`]\n const globalRank = countryData[`${factor}_Rank_Global`]\n const regionalRankCount = countryData.Count_Region\n const incomeRankCount = countryData[\"Count_Income Group\"]\n const globalRankCount = countryData.Count_Global\n\n return {\n score,\n regionalRank,\n incomeRank,\n globalRank,\n regionalRankCount,\n incomeRankCount,\n globalRankCount,\n }\n })\n\n const factorDivs = factorsSorted.map((factor, factorIndex) => {\n const {\n score,\n regionalRank,\n incomeRank,\n globalRank,\n regionalRankCount,\n incomeRankCount,\n globalRankCount,\n } = factorSprings[factorIndex]\n const factorParts = factor.split(\" \")\n const factorName = factorParts.slice(factorSelected ? 1 : 2).join(\" \")\n const cardFactorIndex = factors.indexOf(factor)\n const title = factorSelected\n ? `${factorParts[0]} | ${factorName}`\n : `Factor ${cardFactorIndex + 1} | ${factorName}`\n const factorNumber = factorSelected\n ? factorParts[0][0]\n : cardFactorIndex + 1\n const color = gradient(countryData[factor])\n\n let expandCollapseButton = null\n\n let scoreCOTIcon = null\n if (yearIndex !== 0) {\n const previousYear = years[yearIndex - 1]\n const previousYearData = DataLoader.dataByYear[\n previousYear\n ].countries.find((country) => country.Country === selectedCountry)\n if (previousYearData) {\n const previousYearScore = previousYearData[factor]\n if (previousYearScore > score) {\n scoreCOTIcon = \"\"\n } else if (previousYearScore < score) {\n scoreCOTIcon = \"\"\n }\n }\n }\n\n let gotoFactorPageCallback = () => {}\n if (!factorSelected) {\n // const expandCollapseFactor = (factorIndex) => {\n // return () => {\n // const newFactors = [...factorsExpanded]\n // newFactors[cardFactorIndex] = !newFactors[cardFactorIndex]\n // setFactorsExpanded(newFactors)\n // }\n // }\n gotoFactorPageCallback = () => props.updateUrl(\"factor\")(factorName)\n expandCollapseButton = (\n
    \n More Info\n
    \n )\n }\n\n let subfactors = null\n if (!factorSelected && factorsExpanded[cardFactorIndex]) {\n const subfactorQuestions = DataLoader.dataByYear[\n selectedYear\n ].questionKeys.filter(\n (questionKey) => questionKey[0] === `${cardFactorIndex + 1}`,\n )\n\n subfactors = subfactorQuestions.map((subfactor, subfactorIndex) => {\n const score = countryData[subfactor]\n return (\n
    \n
    {subfactor}
    \n
    \n \n
    \n
    \n )\n })\n }\n return (\n
    \n
    \n \n \n {title}\n \n {expandCollapseButton}\n
    \n
    \n
    \n
    \n \n {score.interpolate((n) => n.toFixed(2))}\n \n {scoreCOTIcon}\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    Global Rank\n \n {globalRank.interpolate(Math.round)}\n \n {\" / \"}\n \n {globalRankCount.interpolate(Math.round)}\n \n
    Regional Rank\n \n {regionalRank.interpolate(Math.round)}\n \n {\" / \"}\n \n {regionalRankCount.interpolate(Math.round)}\n \n
    Income Rank\n \n {incomeRank.interpolate(Math.round)}\n \n {\" / \"}\n \n {incomeRankCount.interpolate(Math.round)}\n \n
    \n
    \n
    \n \n
    \n
    \n {subfactors}\n
    \n )\n })\n\n // const countNumFactorsExpanded = factorsExpanded.reduce((previous, current) => previous + (current ? 1 : 0) , 0)\n // const subFactorExpansionState = countNumFactorsExpanded === 0 ? 'allCollapsed' : (countNumFactorsExpanded === factorsExpanded.length ? 'allExpanded' : '')\n return (\n
    \n
    \n \n {title}\n
    \n \n {\n // factorSelected ? null :\n // \n }\n
    \n
    \n\n {factorDivs}\n
    \n )\n}\n","import React from \"react\"\nimport \"./CountryCardCOT.scss\"\nimport DataLoader, { years } from \"../DataLoader\"\nimport HistoricalBubbleGraph from \"../HistoricalBubbleGraph/\"\nimport { useSmallWidthMode } from \"../utils/smallWidthMode\"\nimport { factorImages } from \"../images/factor_icons/factorImages\"\n\nexport default function CountryCardCOT(props) {\n const {\n selectedCountry,\n selectedFactor,\n factorIndex,\n factorSelected,\n //scoreKey,\n } = props\n const inSmallWidthMode = useSmallWidthMode()\n const historicalData = years\n .map((year) => {\n const countryDatum = DataLoader.dataByYear[year].countries.find(\n (country) => country.Country === selectedCountry,\n )\n return {\n year,\n data: countryDatum,\n }\n })\n .filter((datum) => datum.data)\n\n const minMaxYear = [\n historicalData[0].year,\n historicalData[historicalData.length - 1].year,\n ]\n const yearSpan = minMaxYear.join(\" - \")\n\n const title = factorSelected ? (\n \n \n Factor {factorIndex + 1} |{\" \"}\n {selectedFactor} for {selectedCountry}, {yearSpan}\n \n ) : (\n `${selectedCountry} Overall Rule of Law Score Over Time, ${yearSpan}`\n )\n\n //const graphLeftMargin = inSmallWidthMode ? 60 : 0\n let cotText = null\n if (minMaxYear[0] === minMaxYear[1]) {\n cotText = (\n \n {selectedCountry} was added to the WJP Rule of Law Index in{\" \"}\n {minMaxYear[1]}. Historical trends not yet available.\n \n )\n } else {\n const scoreLabel = factorSelected ? selectedFactor : \"overall rule of law\"\n cotText = `${selectedCountry} scores for ${scoreLabel} from ${minMaxYear[0]} to ${minMaxYear[1]}. (Use the left menu to explore other scores.)`\n }\n return (\n
    \n
    \n \n {title}\n
    \n\n
    \n
    {cotText}
    \n
    \n \n
    \n
    \n
    \n )\n}\n","import React, { useEffect, useMemo, useRef } from \"react\"\nimport InsightsView from \"../InsightsView/\"\n\nimport \"./styles.scss\"\nimport { factors } from \"../DataLoader\"\nimport CountryCardOverall from \"./CountryCardOverall\"\nimport CountryCardRanks from \"./CountryCardRanks\"\nimport CountryCardFactors from \"./CountryCardFactors\"\nimport CountryCardCOT from \"./CountryCardCOT\"\nimport DataLoader from \"../DataLoader\"\nimport { factorImages } from \"../images/factor_icons/factorImages\"\nimport useDimensions from \"react-use-dimensions\"\nimport Map from \"../Map\"\nimport { useSmallWidthMode } from \"../utils/smallWidthMode\"\nimport ReactMarkdown from \"react-markdown\"\nimport { Helmet } from \"react-helmet\"\nconst links = [\"Overall\", \"Change Over Time\", \"Rank\", \"Sub-Factors\"]\nfunction CountryInsights(props) {\n const [scrollyRef, scrollyContainerDimensions, scrollNode] = useDimensions()\n const [defaultMapRef, defaultMapDimensions] = useDimensions()\n const { selectedCountry, selectedYear, selectedFactor } = props\n useEffect(() => {\n window.scrollTo(0, 0)\n }, [])\n const inSmallWidthMode = useSmallWidthMode()\n const factorSelected = selectedFactor !== \"\"\n const factorIndex = factorSelected ? factors.indexOf(selectedFactor) : -1\n\n const selectedFactorScoreKey = factorSelected\n ? `Factor ${factorIndex + 1}: ${selectedFactor}`\n : \"overall\"\n\n const countryData = DataLoader.dataByYear[selectedYear].countries.find(\n (country) => country.Country === selectedCountry,\n )\n\n const currentYearData = DataLoader.dataByYear[selectedYear]\n const mapData = useMemo(\n () =>\n currentYearData.countries.map((c) => ({\n code: c[\"Country Code\"],\n value: c[selectedFactorScoreKey],\n originalDatum: c,\n scoreKey: selectedFactorScoreKey,\n })),\n [currentYearData, selectedFactorScoreKey],\n )\n\n const previousSelectedFactor = useRef()\n useEffect(() => {\n if (previousSelectedFactor.current !== selectedFactor) {\n const scrollDomNode = inSmallWidthMode\n ? document.documentElement\n : scrollNode\n if (scrollDomNode) {\n scrollDomNode.scrollTo({\n top: 0,\n behavior: \"smooth\",\n })\n }\n }\n previousSelectedFactor.current = selectedFactor\n }, [selectedFactor, inSmallWidthMode, scrollNode])\n\n if (!countryData) {\n let message = \"Please select a country to view insights\"\n if (selectedCountry !== \"\") {\n message = `No data exists for ${selectedCountry} in ${selectedYear}, try selecting a different country or year.`\n }\n const selectCountry = (country) => {\n return () => {\n props.updateUrl(\"country\")(country)\n }\n }\n let mapWidth = defaultMapDimensions.width\n let map = null\n if (mapWidth) {\n const mapHeight = inSmallWidthMode ? mapWidth / 2 : 400\n map = (\n \n )\n }\n return (\n
    \n \n WJP Rule of Law Index | Country Insights\n \n \n
    {message}
    \n
    \n {map}\n
    \n
    \n )\n }\n const scrollHeight =\n window.innerHeight -\n (scrollyContainerDimensions.y ? scrollyContainerDimensions.y : 0)\n if (isNaN(scrollHeight)) {\n debugger\n }\n\n const scrollIntoView = (link) => {\n return (event) => {\n document\n .querySelector(`a[name=${link}]`)\n .scrollIntoView({ behavior: \"smooth\" })\n event.preventDefault()\n }\n }\n\n let factorDescription = null\n if (factorSelected) {\n const textKey = `Factor ${factorIndex + 1} Description`\n factorDescription = DataLoader.getCopy(textKey)\n }\n\n return (\n
    \n \n \n WJP Rule of Law Index |{\" \"}\n {selectedCountry ? selectedCountry : \"Country\"} Insights\n \n \n \n \n
    \n
    Region
    \n
    {countryData.Region}
    \n
    \n
    \n {inSmallWidthMode ? \"Income\" : \"Income Group\"}\n
    \n
    {countryData[\"Income Group\"]}
    \n
    \n
    \n {links.map((link) => {\n const linkAnchor = link.toLowerCase().replace(/ /g, \"\")\n return (\n \n {link}\n \n \n \"\n width=\"32\"\n height=\"32\"\n fill=\"none\"\n >\n \n \n )\n })}\n
    \n \n {factorSelected ? (\n
    \n
    \n \n {selectedFactor}\n
    \n
    \n \n
    \n
    \n ) : null}\n\n \n \n \n \n {/* \n
    \n {resources.map(resource => {\n return {resource.text}\n })}\n
    \n
    */}\n
    \n \n )\n}\n\nexport default function CountryInsightsControls(props) {\n return (\n \n \n \n )\n}\n","import React from \"react\"\nexport default function DownArrow(props) {\n const color = props.color || \"#fff\"\n return (\n \n \n \n \n )\n}\n","import React from \"react\"\n\nimport \"./InsightsHeader.scss\"\nimport DownArrow from \"../DownArrow\"\n\nexport default function InsightsHeader(props) {\n const { backgroundImage, title, links, color } = props\n return (\n \n
    {title}
    \n
    \n {links.map((link) => {\n return (\n \n {link.text} \n \n )\n })}\n
    \n \n )\n}\n","export default __webpack_public_path__ + \"static/media/aboutBackground.ba007c47.png\";","export default __webpack_public_path__ + \"static/media/about_slideshow1_slide1.c2d1af57.png\";","export default __webpack_public_path__ + \"static/media/21-OCT_Slide-1_02.21fecf9a.jpg\";","export default __webpack_public_path__ + \"static/media/21-OCT_Slide-1_03.9e04f680.jpg\";","export default __webpack_public_path__ + \"static/media/about_slideshow1_slide3.775d659a.png\";","export default __webpack_public_path__ + \"static/media/21-OCT_Slide-1_05.614c755c.jpg\";","export default __webpack_public_path__ + \"static/media/21-OCT_Slide-1_06.84bff98b.jpg\";","export default __webpack_public_path__ + \"static/media/21-OCT_Slide-2_01.61aedcbd.jpg\";","export default __webpack_public_path__ + \"static/media/21-OCT_Slide-2_02.8748ddf2.png\";","export default __webpack_public_path__ + \"static/media/21-OCT_Slide-2_03.be42cbc2.jpg\";","export default __webpack_public_path__ + \"static/media/21-OCT_Slide-2_04.9fa08a0b.jpg\";","export default __webpack_public_path__ + \"static/media/21-OCT_Slide-2_05.b071341c.png\";","export default __webpack_public_path__ + \"static/media/21-OCT_Slide-2_06.bf903882.jpg\";","export default __webpack_public_path__ + \"static/media/21-OCT_Slide-2_07.d3a011b4.png\";","export default __webpack_public_path__ + \"static/media/whoUsesSlide00.89dd736c.jpg\";","export default __webpack_public_path__ + \"static/media/whoUsesSlide01.dd45bace.jpg\";","export default __webpack_public_path__ + \"static/media/whoUsesSlide02.c2fc4e1f.jpg\";","export default __webpack_public_path__ + \"static/media/whoUsesSlide03.6ce045cf.jpg\";","export default __webpack_public_path__ + \"static/media/whoUsesSlide04.c8b440ec.jpg\";","export default __webpack_public_path__ + \"static/media/whoUsesSlide05.88676309.jpg\";","import React, { useState, useLayoutEffect } from \"react\"\n\nimport \"./styles.scss\"\nimport InsightsHeader from \"../Insights/InsightsHeader\"\nimport aboutBackgroundImage from \"../images/aboutBackground.png\"\n\nimport slide0Image from \"../images/slideshow/about_slideshow1_slide1.png\"\nimport slide1Image from \"../images/slideshow/21-OCT_Slide-1_02.jpg\"\nimport slide2Image from \"../images/slideshow/21-OCT_Slide-1_03.jpg\"\nimport slide3Image from \"../images/slideshow/about_slideshow1_slide3.png\"\nimport slide4Image from \"../images/slideshow/21-OCT_Slide-1_05.jpg\"\nimport slide5Image from \"../images/slideshow/21-OCT_Slide-1_06.jpg\"\n\nimport secondSlide0Image from \"../images/slideshow/21-OCT_Slide-2_01.jpg\"\nimport secondSlide1Image from \"../images/slideshow/21-OCT_Slide-2_02.png\"\nimport secondSlide2Image from \"../images/slideshow/21-OCT_Slide-2_03.jpg\"\nimport secondSlide3Image from \"../images/slideshow/21-OCT_Slide-2_04.jpg\"\nimport secondSlide4Image from \"../images/slideshow/21-OCT_Slide-2_05.png\"\nimport secondSlide5Image from \"../images/slideshow/21-OCT_Slide-2_06.jpg\"\nimport secondSlide6Image from \"../images/slideshow/21-OCT_Slide-2_07.png\"\n\n//images for Who Uses WJP\nimport whoUsesSlide0Image from \"../images/slideshow/whoUsesSlide00.jpg\"\nimport whoUsesSlide1Image from \"../images/slideshow/whoUsesSlide01.jpg\"\nimport whoUsesSlide2Image from \"../images/slideshow/whoUsesSlide02.jpg\"\nimport whoUsesSlide3Image from \"../images/slideshow/whoUsesSlide03.jpg\"\nimport whoUsesSlide4Image from \"../images/slideshow/whoUsesSlide04.jpg\"\nimport whoUsesSlide5Image from \"../images/slideshow/whoUsesSlide05.jpg\"\n\nimport DataLoader from \"../DataLoader\"\nimport { group } from \"d3-array\"\nimport { Helmet } from \"react-helmet\"\nimport { Link } from \"react-router-dom\"\nimport classNames from \"classnames\"\nconst factorColors = {\n \"Constraints on Government Powers\": \"#227B3A\",\n \"Absence of Corruption\": \"#6AAD50\",\n \"Open Government\": \"#2AAA9F\",\n \"Fundamental Rights\": \"#1E72BE\",\n \"Regulatory Enforcement\": \"#4B2795\",\n \"Criminal Justice\": \"#FF651F\",\n \"Civil Justice\": \"#A12224\",\n \"Order and Security\": \"#2A268F\",\n}\nconst slides1 = [\n {\n title: \"The WJP Rule of Law Index at a glance\",\n description: (\n <>\n Learn about the{\" \"}\n \n WJP Rule of Law Index\n \n ®\n \n {\" \"}\n and how it measures human rights, access to justice, corruption and\n authoritarianism worldwide.\n \n ),\n image: slide0Image,\n // noStretch: true,\n },\n {\n title: \"The foundation for opportunity and peace.\",\n description: (\n <>\n A positive correlation has been found between rule of law and economic\n development, health, education, and security.\n
    \n
    \n Effective rule of law reduces corruption, combats poverty and disease,\n and protects people from injustices large and small. It is the\n foundation for communities of justice, equality, opportunity, and\n peace—underpinning development, accountability, democracy, and respect\n for fundamental rights.\n \n ),\n image: slide1Image,\n },\n {\n title: \"To improve the rule of law, we first need to measure it. \",\n longestTitle: true,\n longestDescription: true,\n description: (\n <>\n The{\" \"}\n \n WJP Rule of Law Index\n \n ®\n \n {\" \"}\n provides citizens, governments, policymakers, donors, businesses, media,\n academics, and civil society organizations with a uniquely comparative\n analysis of how well countries adhere to universal rule of law\n principles.\n
    \n
    \n By offering detailed information on an annual basis, the Index has\n become an indispensable tool to identify areas for improvement, develop\n policies for positive social change, and track their subsequent\n progress.\n \n ),\n image: slide2Image,\n },\n {\n title: \"Collecting original data since 2008.\",\n description: (\n <>\n First piloted in Argentina, Australia, Colombia, Spain, Sweden and the\n United States, the WJP Rule of Law Index now includes 142\n countries and jurisdictions.\n \n ),\n image: slide3Image,\n // noStretch: true,\n },\n {\n title: \"Everyone is a stakeholder.\",\n description: (\n <>\n Traditionally, the rule of law has been viewed as the domain of lawyers\n and judges. But everyday issues of safety, rights, access to justice,\n and governance affect us all.\n
    \n
    \n This is why the Index relies on first-hand accounts from more than\n 214,000 households and 3,500 experts to measure how the rule of law is\n experienced and perceived in practical, everyday situations.\n \n ),\n image: slide4Image,\n },\n {\n title: \"A comprehensive approach.\",\n description: (\n <>\n The Index is the world’s most comprehensive dataset of its kind and the\n only one to rely principally on primary data.\n
    \n
    \n It evaluates and ranks countries across key rule of law indicators,\n including checks on government powers, corruption and transparency,\n fundamental and equal rights, open government, civic engagement,\n security, business regulation, and the functioning of regulatory,\n criminal, and civil justice systems.\n \n ),\n image: slide5Image,\n },\n]\n\nconst slides2 = [\n {\n title: \"How we measure\",\n description: (\n <>\n The{\" \"}\n \n WJP Rule of Law Index\n \n ®\n \n {\" \"}\n is built upon an original conceptual framework developed by our\n researchers, in consultation with academics, practitioners, and\n community leaders around the world.\n
    \n
    \n Understand our method and evaluation process.\n \n ),\n image: secondSlide0Image,\n },\n\n {\n title: \"Questionnaires\",\n description:\n \"A set of five questionnaires is administered to experts and the general public. These are translated into several languages and adapted to reflect commonly used terms and expressions.\",\n image: secondSlide1Image,\n },\n {\n title: \"Codification\",\n description: (\n <>\n WJP collects and maps the data onto 44 rule of law indicators. Scores\n for each of these subfactors are globally comparable.\n
    \n
    \n Final scores are constructed using a five-step process.\n \n ),\n image: secondSlide2Image,\n },\n {\n title: \"Testing\",\n description:\n \"The data is subjected to a series of tests to identify possible biases and errors. For example, all subfactors are cross-checked against more than 60 third-party sources, including quantitative data and qualitative assessments drawn from local and international organizations.\",\n image: secondSlide3Image,\n },\n {\n title: \"External Review\",\n longestTitle: true,\n description:\n \" To assess the statistical reliability of our results, we invited the Econometrics and Applied Statistics Unit of the European Commission’s Joint Research Centre to perform a sensitivity analysis.\",\n image: secondSlide4Image,\n },\n {\n title: \"Proofing\",\n description:\n \"To illustrate whether the rule of law in a country has significantly changed over the course of the past year, a measure of change over time is produced based on the annual difference in the country-level factor scores, the standard errors of these scores (estimated from a set of 100 bootstrap samples), and the results of the corresponding t-tests.\",\n longestDescription: true,\n image: secondSlide5Image,\n },\n {\n title: \"Presentation\",\n description:\n \"Data is organized into country profiles, tables, and figures to facilitate their presentation and interpretation. You can access the full report, key insights, and historical datasets in the download button on the top right.\",\n image: secondSlide6Image,\n },\n]\n\n//Who uses WJP Index slideshow\nconst slidesWhoUsesIndex = [\n {\n title: \"Who uses the WJP Rule of Law Index\",\n description: (\n <>\n As the world's leading source of original, independent rule of law data,\n the{\" \"}\n \n WJP Rule of Law Index\n \n ®\n \n {\" \"}\n is an invaluable tool for advancing rule of law reforms, global\n development, and business investment around the globe.\n
    \n
    \n Find out who uses our data.\n \n ),\n image: whoUsesSlide0Image,\n },\n\n {\n title: \"Helping governments track progress\",\n description: (\n <>\n Governments around the world use the{\" \"}\n \n WJP Rule of Law Index®\n {\" \"}\n to benchmark and track the progress on critical rule of law reform\n efforts. The Index helps national institutions and policymakers advance\n justice, human rights, open government, and anti-corruption\n strategies—and monitor global goals, including Sustainable Development\n Goal 16.\n
    \n
    \n Governments that use our Index include the European Union, Honduras,\n India, Kazakhstan, Kosovo, Mexico, Philippines, Thailand, United States,\n and Uzbekistan.\n \n ),\n image: whoUsesSlide1Image,\n },\n {\n title: \"Trustworthy data for policy development\",\n description:\n \"Major international organizations use the Index to inform their global development policies and regional investment strategies, The World Bank, OECD, the IMF, the U.S. State Department, the European Commission, the Millennium Challenge Corporation, and the United Nations Development Programme are among those that leverage WJP data.\",\n image: whoUsesSlide2Image,\n },\n {\n title: \"Inspiring change big or small\",\n longestTitle: true,\n description: (\n <>\n Civil society organizations big and small turn to the Index data to\n identify weaknesses, advocate for change, and monitor rule of law\n performance across 44 subfactors. WJP's original, independent data helps\n shape Transparency International's Corruption Perceptions Index,\n the Chandler Institute of Governance's{\" \"}\n Chandler Good Government Index, the World Bank's{\" \"}\n Worldwide Governance Indicators (WGI), and the Mo Ibrahim\n Foundation's Ibrahim Index of African Governance.\n \n ),\n image: whoUsesSlide3Image,\n },\n {\n title: \"Evaluating risk and business sustainability\",\n description: (\n <>\n Gathering and analyzing original rule of law data since 2008, the{\" \"}\n \n WJP Rule of Law Index®\n {\" \"}\n offers objective business climate benchmarks over time, in 142 countries\n and jurisdictions.\n
    \n
    \n Private sector users such as Moody's, Standard and Poor's, Microsoft,\n UBS, JP Morgan, Hewlett-Packard Enterprise, Eurasia Group, LexisNexis,\n and the U.S. Chamber of Commerce leverage the Index to evaluate\n investment opportunities, global supply chains, business sustainability,\n legal and political risk, democracy, human rights, and corruption.\n \n ),\n longestDescription: true,\n image: whoUsesSlide4Image,\n },\n {\n title: \"Informing research and reporting\",\n description:\n \"The Index's rigorous methodology and broad reach make it a reliable source for researchers and journalists around the world. Index data has been cited in more than 2,000 academic papers and by media outlets in over 190 countries, elevating understanding of critical rule of law issues and holding leaders to account. In the last two years, the Index was featured in more than 9,000 news articles around the world.\",\n image: whoUsesSlide5Image,\n },\n]\n\nconst pastLinks = {\n 2023: \"https://worldjusticeproject.org/sites/default/files/documents/WJPIndex2023.pdf\",\n 2022: \"https://worldjusticeproject.org/sites/default/files/documents/WJPIndex2022.pdf\",\n 2021: \"https://worldjusticeproject.org/sites/default/files/documents/Index-2021.pdf\",\n 2020: \"https://worldjusticeproject.org/sites/default/files/documents/Index-2020-English.pdf\",\n 2019: \"https://worldjusticeproject.org/sites/default/files/documents/ROLI-2019-Reduced.pdf\",\n \"2017-18\":\n \"https://worldjusticeproject.org/sites/default/files/documents/WJP-ROLI-2018-June-Online-Edition_0.pdf\",\n 2016: \"https://worldjusticeproject.org/sites/default/files/documents/RoLI_Final-Digital_0.pdf\",\n 2015: \"https://worldjusticeproject.org/sites/default/files/documents/roli_2015_0.pdf\",\n 2014: \"https://worldjusticeproject.org/sites/default/files/documents/RuleofLawIndex2014.pdf\",\n\n \"2012-13\":\n \"https://worldjusticeproject.org/sites/default/files/documents/WJP_Index_Report_2012.pdf\",\n 2011: \"https://worldjusticeproject.org/sites/default/files/documents/WJP_Rule_of_Law_Index_2011_Report.pdf\",\n 2010: \"https://worldjusticeproject.org/sites/default/files/documents/WJP_Rule_of_Law_Index_2010_Report.pdf\",\n 2009: \"https://worldjusticeproject.org/sites/default/files/documents/WJP_Rule_of_Law_Index_2009_Report.pdf\",\n 2008: \"https://worldjusticeproject.org/sites/default/files/documents/WJP_Rule_of_Law_Index_2008_Report_.pdf\",\n}\nconst nonCoveredYears = [\"2008\", \"2009\", \"2010\", \"2011\", \"2012-13\", \"2014\"]\n\nconst Next = (props) => {\n const style = {}\n if (props.disabled) {\n style.opacity = 0.2\n style.pointerEvents = \"none\"\n }\n return (\n \n \n \n \n )\n}\n\nconst Previous = (props) => {\n return (\n \n \n \n \n )\n}\n\nfunction Arrow(props) {\n return (\n \n \n \n )\n}\n\nfunction Slideshow(props) {\n const { slides, navlink } = props\n const [currentSlide, setCurrentSlide] = useState(0)\n const nextSlide = (e) => {\n if (currentSlide < slides.length - 1) {\n setCurrentSlide(currentSlide + 1)\n }\n e.preventDefault()\n e.stopPropagation()\n }\n const showStartButton = currentSlide === 0\n const fontSize = 16\n\n const maxContentWidth = Math.min(\n window.innerWidth - fontSize * 2,\n fontSize * 58,\n )\n const buttons = showStartButton ? (\n \n ) : (\n
    \n {\n setCurrentSlide(currentSlide - 1)\n\n e.preventDefault()\n e.stopPropagation()\n }}\n />\n \n
    \n )\n const imageSize = Math.round(\n (window.innerWidth < 900 ? 1 : window.innerWidth > 1090 ? 0.68 : 0.65) *\n maxContentWidth,\n )\n const imageContainerSize = slides.length * imageSize\n const activeSlide = slides[currentSlide]\n const translation = `translateX(-${currentSlide * imageSize}px)`\n const progress = showStartButton ? null : (\n
    \n
    \n {`${currentSlide}`.padStart(2, \"0\")} /{\" \"}\n {`${slides.length - 1}`.padStart(2, \"0\")}\n
    \n
    \n
    \n )\n const slideContentStyle = {\n // height: props.height,\n }\n const longestDescription = slides.find(\n (d) => d.longestDescription,\n ).description\n const longestTitle = slides.find((d) => d.longestTitle).title\n return (\n <>\n {navlink ? : null}\n
    \n
    \n {progress}\n
    \n
    {activeSlide.title}
    \n
    {longestTitle}
    \n
    \n
    \n
    {activeSlide.description}
    \n
    {longestDescription}
    \n
    \n {buttons}\n
    \n
    \n {/*
    */}\n \n {/*
    */}\n {slides.map((slide, index) => {\n return (\n \n // {slide.title}\n )\n })}\n
    \n
    \n {/*
    \n {slides.map((slide, index) => {\n return (\n
    setCurrentSlide(index)} />\n )\n })}\n
    */}\n
    \n \n )\n}\n\nexport default function About(props) {\n const years = [...Object.keys(DataLoader.dataByYear), ...nonCoveredYears]\n years.sort().reverse()\n const maxYear = Math.max(\n ...years.map((year) => +year).filter((d) => !isNaN(d)),\n )\n const factors = DataLoader.dataByYear[maxYear].aggregateFactorKeys\n const subfactors = Array.from(\n group(DataLoader.dataByYear[maxYear].questionKeys, (d) => d[0]),\n )\n\n useLayoutEffect(() => {\n let scroller = () => {\n if (window.location.hash) {\n const element = document.querySelector(window.location.hash)\n if (element) {\n element.scrollIntoView({ behavior: \"smooth\" })\n }\n } else {\n window.scrollTo({ top: 0 })\n }\n }\n setTimeout(() => {\n scroller()\n }, 500)\n }, [])\n\n const logDownload = (label) => () => {\n if (window.gtag) {\n window.gtag(\"event\", \"download\", {\n event_category: \"download\",\n event_label: label,\n })\n }\n }\n return (\n
    \n \n WJP Rule of Law Index | About\n \n \n \n The world’s leading source for{\" \"}\n \n original, independent data\n {\" \"}\n on the rule of law.\n \n }\n backgroundImage={aboutBackgroundImage}\n links={[\n { text: \"The Index at a glance\", url: \"#ataglance\" },\n { text: \"What we measure\", url: \"#whatwemeasure\" },\n { text: \"How we measure\", url: \"#howwemeasure\" },\n { text: \"Who uses the Index\", url: \"#whousesindex\" },\n { text: \"Contact\", url: \"#contact\" },\n { text: \"Past reports\", url: \"#reports\" },\n ]}\n color=\"#400099\"\n />\n
    \n \n
    \n
    \n For more information\n
    \n
    \n \n Watch Video\n \n \n See Our Rule of Law Definition\n \n \n Download Report\n \n \n Read Press Release\n \n
    \n
    \n
    \n \n What we measure\n
    \n {/*
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent ac magna ultrices, ultrices urna eu, molestie quam. Aliquam pulvinar egestas cursus.
    */}\n
    \n {factors.map((factor, factorIndex) => {\n const factorName = factor.split(\": \")[1]\n const factorSubfactors = subfactors.find(\n (group) => group[0] === `${factorIndex + 1}`,\n )\n const color = factorColors[factorName]\n return (\n
    \n \n {factorName}\n \n\n
    \n {factorSubfactors[1].map((subfactor, subfactorIndex) => {\n return (\n
    \n {subfactor.split(\" \").slice(1).join(\" \")}\n
    \n )\n })}\n
    \n
    \n )\n })}\n
    \n \n Informal Justice*\n
    \n
    \n
    \n Informal justice is timely and effective\n
    \n
    \n Informal justice is impartial and free of improper influence\n
    \n
    \n Informal justice respects and protects fundamental rights\n
    \n
    \n
    \n
    \n
    \n * Informal Justice is not included in the{\" \"}\n \n WJP Rule of Law Index®\n \n . While WJP has devoted significant effort to collecting data on\n informal justice in a dozen countries, the complexities of these\n systems and the difficulties of measuring their fairness and\n effectiveness in a manner that is both systematic and comparable\n across countries, make assessments extraordinarily challenging.\n
    \n \n
    \n For more information consult\n
    \n
    \n \n Full Methodology\n \n \n Measuring The Rule of Law Paper\n \n \n Statistical Audit\n \n \n Variable Map\n \n \n Questionnaires\n \n
    \n \n
    \n
    \n \n \n
    \n
    \n
    Contact
    \n
    \n We understand that you might have questions regarding our data and\n methodology. If you are interested in using our data,\n collaborating, or want to speak with one of our experts, please\n feel free to reach out.{\" \"}\n
    \n
    \n
    \n
    \n Media inquiries\n \n press@worldjusticeproject.org\n \n
    \n
    \n Research and collaboration inquiries\n \n wjp@worldjusticeproject.org\n \n
    \n
    \n
    \n
    \n
    \n
    \n \n
    Past reports
    \n {/* All that are available here */}\n The{\" \"}\n \n WJP Rule of Law Index\n \n ®\n \n {\" \"}\n was first piloted in 2008. Since then it has evolved, expanding to\n include over 142 countries. You can consult our previous editions\n here.\n
    \n {years\n .filter((d) => +d !== +maxYear)\n .map((year) => {\n const yearLink = pastLinks[year]\n return (\n \n \n \n )\n })}\n
    \n
    \n
    \n
    \n )\n}\n","export default __webpack_public_path__ + \"static/media/insightsBackground.8e16dfaf.png\";","export default __webpack_public_path__ + \"static/media/graph-global-decline.9763b1fc.png\";","export default __webpack_public_path__ + \"static/media/map-global-decline.dd3b6274.png\";","export default __webpack_public_path__ + \"static/media/legend.c60b1f95.svg\";","export default __webpack_public_path__ + \"static/media/piechart-access-to-justice.dc94f40e.png\";","export default __webpack_public_path__ + \"static/media/map-access-to-justice.3e620a41.png\";","export default __webpack_public_path__ + \"static/media/global-decline-piechart.30026dcc.png\";","export default __webpack_public_path__ + \"static/media/map-global-score-2024.bacf76e2.png\";","export default __webpack_public_path__ + \"static/media/long-term-trend-graph.f49a58c6.png\";","export default __webpack_public_path__ + \"static/media/lineGraphLegend.2897a4b7.svg\";","export default __webpack_public_path__ + \"static/media/electionsChart.1b1fd6f7.png\";","import React, { useLayoutEffect } from \"react\"\n\nimport \"./styles.scss\"\nimport InsightsHeader from \"./InsightsHeader\"\nimport insightsBackground from \"../images/insightsBackground.png\"\nimport { Helmet } from \"react-helmet\"\n\nimport graphGlobalDecline from \"./images/graph-global-decline.png\"\nimport mapGlobalDecline from \"./images/map-global-decline.png\"\nimport legend from \"./images/legend.svg\"\n\nimport pieChartAccessToJustice from \"./images/piechart-access-to-justice.png\"\nimport globalScoreAccess from \"./images/map-access-to-justice.png\"\n\nimport pieChartHumanRightsInTrouble from \"./images/global-decline-piechart.png\"\nimport globalScoreRights from \"./images/map-global-score-2024.png\"\n\nimport longTermTrendGraph from \"./images/long-term-trend-graph.png\"\nimport lineGraphLegend from \"./images/lineGraphLegend.svg\"\n\nimport electionsChart from \"./images/electionsChart.png\"\n\nfunction Insight(props) {\n // const { title, text, image, legend, number, name, imageStyle} = props\n const { url, text, content } = props\n\n return (\n
    \n \n
    {text}
    \n
    {content}
    \n {}\n
    \n )\n}\n\nconst insights = [\n {\n text: \"Global Decline in Rule of Law\",\n url: \"#global-decline\",\n content: (\n
    \n
    \n Between 2023 and 2024, rule of law weakened in a majority of\n countries.\n
    \n
    \n The WJP Rule of Law Index overall score fell in 57% of\n countries and improved in 43%. On average, the overall score declined\n by 0.2%.\n
    \n \n \"Global\n \"legend\"\n
    \n
    \n
    \n Percentage Change in Overall Rule of Law Index Scores (2023 - 2024)\n
    \n
    \n ),\n },\n {\n text: \"Weakening Constraints on Government Powers\",\n url: \"#weak-constraints\",\n content: (\n
    \n
    \n Limits on government power eroded in a majority of countries in the\n last year.\n
    \n
    \n Global authoritarian trends continue, with checks on government powers\n declining in 59% of countries between 2023 and 2024. Around the world,\n executive power is less likely to be constrained by civil society and\n the media, legislatures, courts, and elections.\n
    \n \n \n \"legend\"\n
    \n Percentage Change in Constraints on Government Powers (Factor 1)\n Scores (2023 - 2024)\n
    \n
    \n ),\n },\n {\n text: \"Human Rights in Trouble\",\n url: \"#human-rights-in-trouble\",\n content: (\n
    \n
    \n Over 5.4 billion people live in countries where human\n
    \n rights declined in the last year.\n
    \n
    \n Between 2023 and 2024, people lost fundamental rights in 63% of\n countries. Freedom of expression, freedom of assembly, and privacy\n rights have receded, while discrimination has gotten worse.\n
    \n \n \n \"legend\"\n
    \n Percentage Change in Fundamental Rights (Factor 4) Scores (2023 -\n 2024)\n
    \n
    \n ),\n },\n {\n text: \"Long-Term Trend\",\n url: \"#long-term-trend\",\n content: (\n
    \n
    \n The global rule of law recession continues but is slowing down.\n
    \n
    \n Initially driven by a global rise in authoritarianism, annual rule of\n law declines became more widespread during the COVID-19 pandemic. The\n global downturn continues, but overall scores are falling in a smaller\n majority of countries.\n
    \n \n \n
    \n Percentage of Countries that Improved and Declined in Overall Score\n Since 2015\n
    \n
    \n ),\n },\n {\n text: \"Elections and the Rule of Law\",\n url: \"#elections-and-the-rule-of-law\",\n content: (\n
    \n
    \n Where rule of law is stronger, people are often voting for change.\n
    \n
    \n The ruling party stayed in power in most of the 41 countries that held\n national elections between June 2023 and May 2024. But these countries\n also tended to have lower rule of law, less democratic oversight, and\n weaker electoral systems. Among countries with higher rule of law,\n people voted for change more often than not.\n
    \n \n
    \n Rule of Law Performance in Countries that Held Elections in 2023-2024\n
    \n
    \n ),\n },\n]\n\nexport default function Insights(props) {\n useLayoutEffect(() => {\n let scroller = () => {\n if (window.location.hash) {\n const element = document.querySelector(window.location.hash)\n if (element) {\n element.scrollIntoView({ behavior: \"smooth\" })\n }\n } else {\n window.scrollTo({ top: 0 })\n }\n }\n setTimeout(() => {\n scroller()\n }, 500)\n }, [])\n const logInsights = () => {\n if (window.gtag) {\n window.gtag(\"event\", \"download\", {\n event_category: \"download\",\n event_label: \"Insights\",\n })\n }\n }\n return (\n
    \n \n WJP Rule of Law Index | Insights\n \n \n \n \n The rule of law has declined globally for\n
    the 7th year in a row.\n
    \n \n }\n backgroundImage={insightsBackground}\n links={insights}\n color=\"#fff\"\n />\n
    \n {insights.map((item, index) => {\n return \n })}\n
    \n \n
    \n
    Unlock all the Rule of Law Insights 2024
    \n \n Download Insights\n \n
    \n
    \n \n Read Press Release\n \n
    \n
    \n
    \n )\n}\n","import Overview from \"./Overview\"\nimport GlobalInsights from \"./GlobalInsights/\"\nimport CountryInsights from \"./CountryInsights/\"\nimport Factors from \"./Factors/\"\nimport About from \"./About/\"\nimport Insights from \"./Insights/\"\n\nexport const routes = [\n { url: \"/\", route: \"/\", text: \"Overview\", component: Overview, hide: true },\n {\n url: \"/global\",\n route: \"/global/:opt1?/:opt2?/:opt3?/:opt4?\",\n text: \"Rankings\",\n component: GlobalInsights,\n hasInsights: true,\n },\n {\n url: \"/country\",\n route: \"/country/:opt1?/:opt2?/:opt3?\",\n text: \"Countries\",\n component: CountryInsights,\n hasInsights: true,\n },\n {\n url: \"/factors\",\n route: \"/factors/:opt1?/:opt2?/:opt3?\",\n text: \"Factors\",\n component: Factors,\n hasInsights: true,\n },\n {\n url: \"/insights\",\n route: \"/insights\",\n text: \"Insights\",\n component: Insights,\n hasInsights: false,\n },\n {\n url: \"/about\",\n route: \"/about\",\n text: \"About\",\n component: About,\n hasInsights: false,\n },\n]\n\nexport const routesReversed = routes.slice().reverse()\n","export default __webpack_public_path__ + \"static/media/fbShare.035d0ba4.svg\";","export default __webpack_public_path__ + \"static/media/twitterShare.790bfe21.svg\";","export default __webpack_public_path__ + \"static/media/emailShare.7890f2b2.svg\";","export default __webpack_public_path__ + \"static/media/linkedinShare.016dfac8.svg\";","export default __webpack_public_path__ + \"static/media/linkShare.ba545a11.svg\";","import React, { useEffect, useState } from \"react\"\nimport classnames from \"classnames\"\nimport facebook from \"../images/share/fbShare.svg\"\nimport twitter from \"../images/share/twitterShare.svg\"\nimport email from \"../images/share/emailShare.svg\"\nimport linkedin from \"../images/share/linkedinShare.svg\"\nimport linkShare from \"../images/share/linkShare.svg\"\n\nimport \"./styles.scss\"\nimport useOnClickOutside from \"use-onclickoutside\"\nimport { useParams } from \"react-router-dom\"\nimport getSelectionsFromParams from \"../utils/getSelectionsFromParams\"\nimport DataLoader from \"../DataLoader\"\nimport classNames from \"classnames\"\nfunction share(site, selections) {\n return () => {\n let url = null\n if (typeof document !== \"undefined\") {\n url = encodeURIComponent(document.location)\n } else {\n return\n }\n // console.log(url)\n let description = \"WJP Rule of Law Index\"\n if (selections) {\n const years = Object.keys(DataLoader.dataByYear).sort()\n const latestYear = years[years.length - 1]\n const countryData = DataLoader.dataByYear[latestYear].countries\n // console.log(years, latestYear, countryData)\n // console.log('selections', selections)\n if (\n selections.selectedCountry &&\n selections.selectedFactor &&\n url.includes(encodeURIComponent(\"/factors/\"))\n ) {\n // const country = countryData.find(c => c.Country === selections.selectedCountry)\n url = `${document.location.origin}${\n process.env.PUBLIC_URL\n }/s/share/Factor-${encodeURIComponent(\n selections.selectedCountry.replace(/ /g, \"_\"),\n )}-${encodeURIComponent(\n selections.selectedFactor.replace(/ /g, \"_\"),\n )}-2024.html`\n } else if (\n selections.selectedCountry &&\n url.includes(encodeURIComponent(\"/country/\"))\n ) {\n const country = countryData.find(\n (c) => c.Country === selections.selectedCountry,\n )\n url = `${document.location.origin}${\n process.env.PUBLIC_URL\n }/s/share/Ranking-${encodeURIComponent(\n selections.selectedCountry.replace(/ /g, \"_\"),\n )}-2024.html`\n description += ` ${country.Country} ranks ${country[\"overall_Rank_Global\"]} out of ${countryData.length} countries on Rule of Law`\n } else if (\n selections.selectedCountry &&\n url.includes(encodeURIComponent(\"/factors/\")) &&\n !selections.selectedFactor\n ) {\n // const country = countryData.find(c => c.Country === selections.selectedCountry)\n url = `${document.location.origin}${\n process.env.PUBLIC_URL\n }/s/share/FactorOverall-${encodeURIComponent(\n selections.selectedCountry.replace(/ /g, \"_\"),\n )}-2024.html`\n }\n }\n // console.log(DataLoader)\n if (url) {\n let link = null\n switch (site) {\n case \"facebook\":\n link = `https://www.facebook.com/sharer.php?u=${url}`\n\n if (window.gtag) {\n window.gtag(\"event\", \"share\", {\n event_category: \"share\",\n event_label: \"facebook\",\n })\n }\n break\n case \"twitter\":\n link = `https://twitter.com/intent/tweet?url=${url}&text=${description}`\n\n if (window.gtag) {\n window.gtag(\"event\", \"share\", {\n event_category: \"share\",\n event_label: \"twitter\",\n })\n }\n break\n case \"email\":\n link = `mailto:?subject=${description}&body=${url}`\n\n if (window.gtag) {\n window.gtag(\"event\", \"share\", {\n event_category: \"share\",\n event_label: \"email\",\n })\n }\n break\n case \"linkedin\":\n link = `https://www.linkedin.com/sharing/share-offsite/?url=${url}`\n\n if (window.gtag) {\n window.gtag(\"event\", \"share\", {\n event_category: \"share\",\n event_label: \"linkedin\",\n })\n }\n break\n case \"link\":\n // copy link to clipboard\n if (typeof document !== \"undefined\") {\n const el = document.createElement(\"textarea\")\n el.value = decodeURIComponent(url)\n document.body.appendChild(el)\n el.select()\n document.execCommand(\"copy\")\n document.body.removeChild(el)\n }\n\n if (window.gtag) {\n window.gtag(\"event\", \"share\", {\n event_category: \"share\",\n event_label: \"link\",\n })\n }\n break\n default:\n alert(`sharing via ${site} not yet implemented`)\n break\n }\n if (link !== null) {\n window.open(link)\n }\n }\n }\n}\nexport default function ShareButtons(props) {\n const { wrapperRef } = props\n useOnClickOutside(wrapperRef, props.toggle)\n const params = useParams()\n const selections = getSelectionsFromParams(params)\n // console.log(selections)\n const [copiedToClipboard, setCopiedToClipboard] = useState(false)\n const copyToClipboard = () => {\n share(\"link\", selections)()\n setCopiedToClipboard(true)\n }\n useEffect(() => {\n if (copiedToClipboard) {\n setTimeout(() => {\n setCopiedToClipboard(false)\n }, 2000)\n }\n }, [copiedToClipboard])\n return (\n <>\n \n
    \n \n \n \n \n \n
    \n \n link copied to clipboard\n \n \n \n )\n}\n","export default __webpack_public_path__ + \"static/media/pdfIcon.517962a7.svg\";","export default __webpack_public_path__ + \"static/media/csvIcon.5883af12.svg\";","import React from \"react\"\nimport classnames from \"classnames\"\n\nimport \"./styles.scss\"\nimport useOnClickOutside from \"use-onclickoutside\"\nimport { useParams } from \"react-router-dom\"\nimport getSelectionsFromParams from \"../utils/getSelectionsFromParams\"\nimport DataLoader from \"../DataLoader\"\nimport pdfIcon from \"../images/pdfIcon.svg\"\nimport csvIcon from \"../images/csvIcon.svg\"\nimport { csvFormat } from \"d3-dsv\"\nconst globalLinks = [\n {\n name: \"Full Report\",\n type: \"pdf\",\n link: `${process.env.PUBLIC_URL}/downloads/WJPIndex2024.pdf`,\n },\n {\n name: \"Insights\",\n type: \"pdf\",\n link: `${process.env.PUBLIC_URL}/downloads/WJPInsights2024.pdf`,\n },\n {\n name: \"Dataset\",\n type: \"csv\",\n link: `${process.env.PUBLIC_URL}/downloads/2024_wjp_rule_of_law_index_HISTORICAL_DATA_FILE.xlsx`,\n },\n {\n name: \"Methodology\",\n type: \"pdf\",\n link: `${process.env.PUBLIC_URL}/downloads/Index-Methodology-2024.pdf`,\n },\n {\n name: \"Variable Map\",\n type: \"pdf\",\n link: `${process.env.PUBLIC_URL}/downloads/ROLIndex2024_Table_of_Variables.pdf`,\n },\n]\nexport default function DownloadMenu(props) {\n const { showCountryDownloads, wrapperRef } = props\n useOnClickOutside(wrapperRef, props.toggle)\n const params = useParams()\n const selections = getSelectionsFromParams(params)\n // console.log(selections)\n const linker = ({ name, type, link, onClick, eventLabel }, index) => {\n const click = (e) => {\n if (onClick) {\n onClick(e)\n }\n if (window.gtag) {\n window.gtag(\"event\", \"download\", {\n event_category: \"download\",\n event_label: eventLabel || name,\n })\n }\n }\n return (\n \n {type}\n {name}\n \n )\n }\n let countrySpecificContent = null\n const downloadDataset = (e) => {\n e.preventDefault()\n e.stopPropagation()\n\n // console.log(DataLoader)\n\n const data = []\n const years = Object.keys(DataLoader.dataByYear).sort()\n let yearsWithData = []\n years.forEach((year) => {\n const countryData = DataLoader.dataByYear[year].countries.find(\n (c) => c.Country === selections.selectedCountry,\n )\n if (countryData) {\n yearsWithData.push(year)\n const transposeCountryData = Object.keys(countryData)\n .map((key) => [key, countryData[key]])\n .filter(\n (d) =>\n !d[0].includes(\"_Rank_\") &&\n d[0].indexOf(\"Count_\") !== 0 &&\n d[0].indexOf(\"overall\") !== 0 &&\n d[0] !== \"externalPercentChange\",\n )\n // console.log(transposeCountryData)\n const keyMatcher = (_key1, _key2) => {\n let key1 = _key1.toLowerCase().trim()\n let key2 = _key2.toLowerCase().trim()\n\n if (key1 === key2) return true\n\n const subfactorRE = /^([0-9]\\.[0-9])/\n const key1Match = key1.match(subfactorRE)\n const key2Match = key2.match(subfactorRE)\n\n if (key1Match && key2Match) {\n const key1SubfactorKey = key1Match[1]\n const key2SubfactorKey = key2Match[1]\n // console.log(key1SubfactorKey, key2SubfactorKey)\n if (key1SubfactorKey === key2SubfactorKey) return true\n }\n\n return false\n }\n transposeCountryData.forEach(([key, value]) => {\n if (!data.find((d) => keyMatcher(d.key, key))) {\n data.push({ key: key.trim() })\n }\n const dataPoint = data.find((d) => keyMatcher(d.key, key))\n dataPoint[year] = value\n })\n }\n })\n yearsWithData.sort()\n // console.log(data)\n const csv = csvFormat(data, [\"key\", ...yearsWithData])\n const blob = new Blob([csv], { type: \"text/csv;charset=utf-8;\" })\n const url = URL.createObjectURL(blob)\n const link = document.createElement(\"a\")\n link.setAttribute(\"href\", url)\n link.setAttribute(\"download\", `${selections.selectedCountry}.csv`)\n link.style.visibility = \"hidden\"\n document.body.appendChild(link)\n link.click()\n document.body.removeChild(link)\n }\n if (showCountryDownloads) {\n const pdfUrl = `${process.env.PUBLIC_URL}/s/pdfs/${\n selections.selectedYear\n }-${encodeURIComponent(showCountryDownloads)}.pdf`\n countrySpecificContent = (\n
    \n

    {showCountryDownloads} Downloads

    \n {[\n {\n name: \"Country Profile\",\n type: \"pdf\",\n link: pdfUrl,\n eventLabel: `${showCountryDownloads} Country Profile`,\n },\n {\n name: \"Country Dataset\",\n type: \"csv\",\n link: \"#\",\n onClick: downloadDataset,\n eventLabel: `${showCountryDownloads} Country Dataset`,\n },\n ].map(linker)}\n
    \n )\n }\n return (\n
    \n {globalLinks.map(linker)}\n {countrySpecificContent}\n
    \n )\n}\n","import React, { useEffect, useRef, useState } from \"react\"\nimport { Link, useParams } from \"react-router-dom\"\nimport classnames from \"classnames\"\n\nimport getSelectionsFromParams from \"../utils/getSelectionsFromParams\"\nimport { routes } from \"../routes\"\nimport { useSmallWidthMode } from \"../utils/smallWidthMode\"\nimport ShareMenu from \"../ShareButtons/\"\nimport \"./styles.scss\"\nimport classNames from \"classnames\"\nimport DownloadMenu from \"../DownloadMenu\"\n// let firstNavigation = true;\nexport default function Nav(props) {\n const params = useParams()\n const [modalOpen, setModalOpen] = useState(false)\n const [shareMenuOpen, setShareMenuOpen] = useState(false)\n const [downloadMenuOpen, setDownloadMenuOpen] = useState(false)\n const { selectedYear, selectedCountry, selectedFactor } =\n getSelectionsFromParams(params)\n const page = params.page || \"/\"\n const { opt1, opt2, opt3, opt4 } = params\n\n useEffect(() => {\n // if (firstNavigation) {\n // firstNavigation = false\n // return\n // }\n setTimeout(() => {\n // use timeout to ensure title & location are updated\n let page_location = window.location.toString()\n\n if (page_location.charAt(page_location.length - 1) !== \"/\") {\n page_location = page_location + \"/\"\n }\n\n window.gtag(\"event\", \"page_view\", {\n page_title: document.title,\n page_location: page_location,\n })\n }, 300)\n }, [page, opt1, opt2, opt3, opt4])\n\n const activeRoute = routes.find((r) => r.url.includes(page))\n const isSmallWidthMode = useSmallWidthMode()\n const toggleMenuModal = () => {\n setModalOpen(!modalOpen)\n }\n const closeModal = () => {\n setModalOpen(false)\n }\n if (!isSmallWidthMode && modalOpen) {\n closeModal()\n }\n const links = routes.map((link) => {\n if (link.hide) {\n return null\n }\n let url = link.url\n const match = link.url === activeRoute.url\n\n if (link.hasInsights) {\n url = `${url}/${encodeURIComponent(selectedYear)}`\n if (selectedCountry !== \"\") {\n url = `${url}/${encodeURIComponent(selectedCountry)}`\n }\n if (selectedFactor !== \"\") {\n url = `${url}/${encodeURIComponent(selectedFactor)}`\n }\n }\n const noSpace = !link.text.includes(\" \")\n return (\n \n {link.text}\n \n )\n })\n const toggleShareMenu = () => {\n setShareMenuOpen(!shareMenuOpen)\n }\n const toggleDownloadMenu = () => {\n setDownloadMenuOpen(!downloadMenuOpen)\n }\n const countrySpecificPage = params.page === \"country\" && selectedCountry\n const downloadButtonLabel = countrySpecificPage ? \"Downloads\" : \"Download\"\n const shareButtonWrapperRef = useRef()\n const downloadButtonWrapperRef = useRef()\n return (\n \n
    \n
    \n
    \n
    \n \n WJP Rule of Law Index{\" \"}\n \n ®\n \n \n
    \n\n
    {links}
    \n {/*
    WJP Rule of Law Index {'>'} {activeRoute.text}
    */}\n
    \n
    \n
    \n {activeRoute.hide ? \"\" : activeRoute.text}\n
    \n \n \n \n \n \n
    \n \n \n \n \n\n Share\n \n {shareMenuOpen ? (\n \n ) : null}\n
    \n \n \n {downloadButtonLabel}\n \n \n \n \n \n \n \n \n \n \n \n \n \n {downloadMenuOpen ? (\n \n ) : null}\n
    \n
    \n
    \n \n \n
    \n )\n}\n","import React, { useEffect, useState, useRef } from \"react\"\nimport { BrowserRouter as Router, Switch, Route } from \"react-router-dom\"\n\nimport Nav from \"./Nav/\"\nimport DataLoader from \"./DataLoader\"\nimport { routesReversed } from \"./routes\"\n\nimport \"./App.scss\"\n\nfunction App() {\n const [isLoading, setIsLoading] = useState(true)\n useEffect(() => {\n DataLoader.load().finally(() => {\n setIsLoading(false)\n })\n }, [])\n\n const [fade, setFade] = useState(false)\n const updateFade = (bool) => setFade(bool)\n\n const navRef = useRef(null)\n const path = process.env.PUBLIC_URL.replace(/^https?:\\/\\/[^/]+\\/?/, \"\")\n const basename = path[0] === \"/\" ? path : `/${path}`\n return (\n
    \n \n \n
    \n )\n}\n\nexport default App\n","import { createRoot } from \"react-dom/client\"\nimport App from \"./App\"\nimport \"./index.scss\"\n\nconst container = document.getElementById(\"root\")\nconst root = createRoot(container)\nroot.render()\n"],"sourceRoot":""}