{"version":3,"sources":["MapChart.js","App.js","index.js"],"names":["geoUrl","worldMap","MapChart","setTooltipContent","data-tip","projectionConfig","rotate","scale","stroke","strokeWidth","geography","geographies","map","geo","onMouseEnter","num","properties","NAME","POP_EST","CONTINENT","Math","round","onClick","fetch","then","response","json","jsonData","window","open","posts","category","cid","name","catch","error","style","default","fill","outline","hover","pressed","rsmKey","memo","App","useState","content","setContent","document","addEventListener","ReactDOM","render","getElementById","StrictMode"],"mappings":"w/wIAWMA,EAASC,EAYTC,EAAW,SAAC,GAA2B,IAAzBC,EAAwB,EAAxBA,kBAClB,OACE,mCACE,cAAC,gBAAD,CAAeC,WAAS,6BAA6BC,iBAAkB,CAAEC,OAAQ,EAAE,GAAI,EAAG,GAAIC,MAAO,KAArG,SACE,eAAC,gBAAD,WACE,cAAC,YAAD,CAAWC,OAAO,YAClB,cAAC,cAAD,CACEA,OAAO,UACPC,YAAa,GACbC,UAAWV,EAHb,SAIG,qBAAGW,YACUC,KAAI,SAAAC,GAAG,OACjB,cAAC,YAAD,CAEEH,UAAWG,EACXC,aAAc,WAAO,IAzBvBC,EAyBsB,EACmBF,EAAIG,WAAjCC,EADU,EACVA,KAAMC,EADI,EACJA,QAASC,EADL,EACKA,UACvBhB,EAAkB,GAAD,OAAIc,EAAJ,oBA3BrBF,EA2B2CG,EA1BrDH,EAAM,IACDK,KAAKC,MAAMN,EAAM,KAAa,GAAK,KACjCA,EAAM,IACRK,KAAKC,MAAMN,EAAM,KAAU,GAAK,IAEhCK,KAAKC,MAAMN,EAAM,KAAO,GAAK,KAqBH,cAAoCI,KAEvDG,QAAS,WAAO,IACNL,EAASJ,EAAIG,WAAbC,KACRM,MAAM,6CAA+CN,EAAO,mBACzDO,MAAK,SAAAC,GAAQ,OAAIA,EAASC,UAC1BF,MAAK,SAACG,GAGLC,OAAOC,KAAK,sCAAwCF,EAASG,MAAM,GAAGC,SAASC,IAAM,IAAML,EAASG,MAAM,GAAGC,SAASE,KAAM,cAE7HC,OAAM,SAACC,GAENP,OAAOC,KAAK,yCAA2CZ,EAAO,kBAAmB,eAMvFmB,MAAO,CACLC,QAAS,CACPC,KAAM,UACNC,QAAS,SAEXC,MAAO,CACLF,KAAM,UACNC,QAAS,QAEXE,QAAS,CACPH,KAAM,UACNC,QAAS,UAlCR1B,EAAI6B,sBAiDZC,iBAAKzC,GC7Ed0C,EAAM,WAAO,IAAD,EACcC,mBAAS,IADvB,mBACTC,EADS,KACAC,EADA,KAEhB,OACE,gCACE,cAAC,EAAD,CAAU5C,kBAAmB4C,IAC7B,cAAC,IAAD,UAAeD,QAMrBE,SAASC,iBAAiB,oBAAoB,WAC5CC,IAASC,OAAO,cAAC,EAAD,IAASH,SAASI,eAAe,YAGpCR,QClBfM,IAASC,OACP,cAAC,IAAME,WAAP,UACE,cAAC,EAAD,MAEFL,SAASI,eAAe,W","file":"static/js/main.46be2218.chunk.js","sourcesContent":["import React, { memo } from \"react\";\nimport worldMap from './world-110m.json';\n\nimport {\n ZoomableGroup,\n ComposableMap,\n Geographies,\n Geography,\n Graticule\n} from \"react-simple-maps\";\n\nconst geoUrl = worldMap;\n\nconst rounded = num => {\n if (num > 1000000000) {\n return Math.round(num / 100000000) / 10 + \"Bn\";\n } else if (num > 1000000) {\n return Math.round(num / 100000) / 10 + \"M\";\n } else {\n return Math.round(num / 100) / 10 + \"K\";\n }\n};\n\nconst MapChart = ({ setTooltipContent }) => {\n return (\n <>\n \n \n \n \n {({ geographies }) =>\n geographies.map(geo => (\n {\n const { NAME, POP_EST, CONTINENT } = geo.properties;\n setTooltipContent(`${NAME} — ${rounded(POP_EST)} - ${CONTINENT}`);\n }}\n onClick={() => {\n const { NAME } = geo.properties;\n fetch(\"https://discussplaces.com/api/search?term=\" + NAME + \"&in=titlesposts\")\n .then(response => response.json())\n .then((jsonData) => {\n // jsonData is parsed json object received from url\n // console.log(jsonData.posts[0].category.name);\n window.open(\"https://discussplaces.com/category/\" + jsonData.posts[0].category.cid + \"/\" + jsonData.posts[0].category.name, '_parent');\n })\n .catch((error) => {\n // handle your errors here\n window.open(\"https://discussplaces.com/search?term=\" + NAME + \"&in=titlesposts\", '_parent');\n //console.error(error)\n })\n //\n }}\n\n style={{\n default: {\n fill: \"#F299C0\",\n outline: \"black\"\n },\n hover: {\n fill: \"#6595DA\",\n outline: \"none\"\n },\n pressed: {\n fill: \"#E34025\",\n outline: \"none\"\n }\n }}\n />\n ))\n }\n \n \n \n \n );\n};\n\n\n\nexport default memo(MapChart);\n","import './App.css';\n\nimport React, { useState } from \"react\";\nimport ReactDOM from \"react-dom\"\nimport ReactTooltip from \"react-tooltip\";\nimport MapChart from \"./MapChart\";\n// url to a valid topojson file\n\nconst App = () => {\n const [content, setContent] = useState(\"\");\n return (\n
\n \n {content}\n
\n );\n}\n\n\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n ReactDOM.render(, document.getElementById(\"root\"))\n})\n\nexport default App;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n"],"sourceRoot":""}