{"version":3,"sources":["utils.js","calculation.js","chart.js","searchControl.js","ControlsForm.js","ContextMenu.js","utils/hooks/handleOutsideClick.js","utils/filter.js","App.js","utils/chart.js","serviceWorker.js","index.js"],"names":["mediaType","enableValues","mediaName","locationOptions","label","value","getKeyByValue","object","Object","keys","find","key","dynamicSort","property","sortOrder","substr","a","b","localeCompare","sourceToExclude","cleanArticles","articles","sources","filter","article","includes","moniker_name","forEach","record","source","bias_total","bias_count","reliability_total","reliability_count","bias","reliability","dict","wBias","wReliability","sourceLocation","map","ownership","entries","bias_mean","reliability_mean","sourceBlockList","push","countries","states","cities","usa_states","sort","reach","wrap","text","width","each","word","d3","this","words","split","reverse","line","lineNumber","dy","parseFloat","attr","tspan","append","pop","join","node","getComputedTextLength","xTranslate","transform","baseVal","matrix","e","yTranslate","height","margin","top","bottom","right","left","xDomain","xLabels","xLabelsPoints","yDomain","yLabels","yLabelsPoints","xGridDomain","yGridDomain","fontFamily","fontColor","Chart","customMargin","handleOpenContextMenu","sourceReach","lastTransform","k","x","y","zoomed","bind","plotData","defineProperty","freeze","createRoot","createScales","createDefs","createContainers","createSegments","createTitles","createToolTips","createZoomButtons","createZoom","zoomContainer","call","zoom","displayArticles","transition","duration","type","newK","Math","min","max","scaleTo","el","selectAll","remove","zx","rescaleX","interpolate","zy","rescaleY","gArticles","gSourceReach","lower","gSources","d","logoWidth","logoHeight","gSegmentGreen","gSegmentYellow","gSegmentOrange","gSegmentRed","segmentContainer","ceil","gx","xAxis","gy","yAxis","gxDesc","xAxisDesc","gyDesc","yAxisDesc","gGrid","grid","that","data","length","color","on","articleTooltip","raise","hoverArticle","window","open","url","image_path","sourceTooltip","sourceReachCicleHighlight","sourceArticleHighlight","sourceReachCicleUnHighlight","style","about_url","pageY","pageX","preventDefault","scaleReach","maxReach","domain","range","defs","zoomButtonContainer","gxContainer","gyContainer","dataContainer","process","copyrightContainer","Date","getFullYear","then","documentElement","select","scaleExtent","extent","translateExtent","toolTipSource","toolTipArticle","clickZoom","g","tickValues","tickSize","tickPadding","tickFormat","i","enter","update","exit","toolTip","toFixed","String","mediatype","reachCircle","SOURCE_DATA","defaultData","moment","format","localStorage","getItem","setItem","JSON","stringify","oldData","parse","oldYear","oldMonth","oldDay","oldSearches","currStamp","Option","Select","ControlsForm","props","formRef","React","createRef","showDrawer","setState","visible","onClose","onSourcesChange","current","setFieldsValue","allSources","queryString","location","search","version","yearLimit","monthLimit","dayLimit","listLength","slist","every","val","item","Set","canAccess","tf","setModalVisible","onFinish","onLocationChange","target","countrySelection","stateSelection","locationState","locationCountry","locationCountryChange","locationStateChange","ownershipChange","formSubmit","getFieldsValue","onReset","citySelection","resetFields","chartReset","state","defaultFormValues","rangeReliability","rangeBias","slice","alert","prevProps","removedSources","getFieldValue","removedSource","chartLoading","mediaTypeOptions","disabled","formSources","ref","name","layout","className","initialValues","Item","colon","rules","required","mode","placeholder","listHeight","onChange","allowClear","o","Group","options","marks","title","placement","size","onClick","FilterOutlined","htmlType","UndoOutlined","bodyStyle","paddingBottom","forceRender","gutter","span","valuePropName","checkedChildren","CheckOutlined","unCheckedChildren","CloseOutlined","optionType","buttonStyle","showSearch","Component","ContextMenu","handler","show","onRemove","wrapperRef","useRef","useEffect","handleClickOutside","event","contains","document","addEventListener","removeEventListener","id","getIncludedExcludedSources","defaultSources","selectedSources","includedSources","excludedSources","withExcluded","formValues","filteredMedia","utils","coverage","Array","isArray","country","antIcon","LoadingOutlined","fontSize","spin","App","callAPI","aam_member_id","API_ENDPOINT","axios","get","chart","handleClickContextMenu","create","console","log","showContextMenu","selectedSource","handleCloseContextMenu","handleRemoveSource","drawChart","handleResetRemovedSources","isLoading","dimensions","showGeneralModal","rangeAudience","values","includedArticles","includedSourceNames","ChartUtils","reset","includedSourcesName","excludedSourcesName","includedContentPieces","excludedContentPieces","bias_label","reliability_label","unshift","includedSourcesBlob","Blob","excludedSourcesBlob","includedContentPiecesBlob","excludedContentPiecesBlob","zip","JSZip","file","generateAsync","content","FileSaver","saveAs","toString","replace","ob","download","dataExport","canvas","createElement","body","appendChild","ctx","getContext","fillStyle","fillRect","svg","serializer","XMLSerializer","svgStr","serializeToString","canvg","fromString","anonymousCrossOrigin","ignoreClear","v","render","lnk","toLocaleString","href","toDataURL","click","modal_id","paddingTop","resetRemovedSources","icon","DownloadOutlined","handleClickDownload","loading","indicator","spinning","onCancel","footer","portalId","formId","onSubmit","onReady","form","Boolean","hostname","match","ReactDOM","getElementById","navigator","serviceWorker","ready","registration","unregister","catch","error","message"],"mappings":"wXAEIA,EAAY,CAAC,EAAE,EAAE,GACjBC,EAAe,CAAC,EAAE,EAAE,EAAE,GAEtBC,EAAY,CACd,qBAAsB,EACtB,aAAc,EACd,kBAAmB,GAGfC,EAAkB,CACtB,CACEC,MAAO,QACPC,MAAO,SAET,CACED,MAAO,WACPC,MAAO,YAET,CACED,MAAO,gBACPC,MAAO,kBAuBX,SAASC,EAAcC,EAAQF,GAC7B,OAAOG,OAAOC,KAAKF,GAAQG,MAAK,SAAAC,GAAG,OAAIJ,EAAOI,KAASN,KAGzD,SAASO,EAAYC,GACnB,IAAIC,EAAY,EAOhB,MALoB,MAAhBD,EAAS,KACXC,GAAa,EACbD,EAAWA,EAASE,OAAO,IAGtB,SAAUC,EAAEC,GACjB,OAAkB,IAAfH,EACMG,EAAEJ,GAAUK,cAAcF,EAAEH,IAG5BG,EAAEH,GAAUK,cAAcD,EAAEJ,K,qBC3DnCM,EAAkB,GAoEtB,SAASC,EAAcC,GACrB,IAAIC,EAAU,IAEdD,EAAWA,EAASE,QAClB,SAACC,GAAD,OAAcL,EAAgBM,SAASD,EAAQE,kBAGxCC,SAAQ,SAACC,GAChB,IAAIC,EAASP,EAAQM,EAAM,cACtBC,IACHA,EAAS,CACPC,WAAY,EACZC,WAAY,EACZC,kBAAmB,EACnBC,kBAAmB,IAIvB,IAxEgBC,EAZKC,ED8DPC,ECsBRC,GAvEH,IADaH,EAwESN,EAAM,OAvEfM,GAAQ,EACjB,GACG,IAAMA,GAAQA,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S,kBAAM,EAAKgI,oBAAoB,UACxCC,QAAS/D,EACTzF,UAAWF,EANX,qBAYF,eAAC,KAAD,CACAsB,MAAM,6DACNrJ,MAAM,WACNsJ,UAAU,QAHV,SAKE,eAAC,KAAD,CACEC,KAAK,QACL+H,KAAM,eAACC,GAAA,EAAD,IACNjJ,UAAU,iBACVkB,QAAS,kBAAM,EAAKgI,oBAAoB,SACxCC,QAAS/D,EACTzF,UAAWF,EANb,SAQE,mDAKV,uBAAKO,UAAU,eAAf,UACE,eAAC,KAAD,CAAMoJ,UAAWrF,GAASsF,UAAWpY,KAAK8N,MAAMU,eAChD,sBAAKO,UAAU,iBAAf,SACE,eAAC,GAAD,CACEsC,KAAMrR,KAAK8N,MAAM+F,gBACjBpI,QAASzL,KAAK+T,uBACdzC,SAAUtR,KAAKgU,0BAKrB,eAAC,KAAD,CACEpU,MAAO,IACP4L,QAASxL,KAAK8N,MAAMuG,iBACpBgE,SAAU,kBAAM,EAAKxL,gBAAgB,iBAAgB,IACrDyL,OAAQ,KAJV,SAME,eAAC,IAAD,CACAC,SAAUnQ,UACVoQ,OAAQpQ,uCACRqQ,SAAU,kBAAM9E,QAAQC,IAAI,YAC5B8E,QAAS,SAACC,GAAD,OAAUhF,QAAQC,IAAI,gBAC/BsE,QAAS,8D,GAlPL9M,IAAM8F,WENJ0H,QACW,cAA7B9R,OAAOiF,SAAS8M,UAEe,UAA7B/R,OAAOiF,SAAS8M,UAEhB/R,OAAOiF,SAAS8M,SAASC,MACvB,2DCZNC,IAASzB,OAAO,eAAC,GAAD,IAASzF,SAASmH,eAAe,SD6H3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrB3Q,MAAK,SAAA4Q,GACJA,EAAaC,gBAEdC,OAAM,SAAAC,GACL5F,QAAQ4F,MAAMA,EAAMC,c","file":"static/js/main.de6ba549.chunk.js","sourcesContent":["import queryString from 'query-string';\r\n\r\nvar mediaType = [2,3,4];\r\nvar enableValues = [0,1,1,1];\r\n\r\nvar mediaName = {\r\n \"Website / Articles\": 2,\r\n \"TV / Video\": 3,\r\n \"Podcast / Audio\": 4\r\n}\r\n\r\nconst locationOptions = [\r\n {\r\n label: 'Local',\r\n value: 'Local',\r\n },\r\n {\r\n label: 'National',\r\n value: 'National',\r\n },\r\n {\r\n label: 'International',\r\n value: 'International',\r\n },\r\n];\r\n\r\nfunction aamMember(){\r\n let member_id = queryString.parse(window.location.search)['member_id'];\r\n return member_id;\r\n}\r\n\r\nfunction downloadParameter(){\r\n if(queryString.parse(window.location.search)['download'] === \"1\"){\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\nfunction unlimitedSearchParameter(){\r\n if(queryString.parse(window.location.search)['unlimitedSearch'] === \"1\"){\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\nfunction getKeyByValue(object, value) {\r\n return Object.keys(object).find(key => object[key] === value);\r\n}\r\n\r\nfunction dynamicSort(property) {\r\n var sortOrder = 1;\r\n\r\n if (property[0] === \"-\") {\r\n sortOrder = -1;\r\n property = property.substr(1);\r\n }\r\n\r\n return function (a,b) {\r\n if(sortOrder === -1){\r\n return b[property].localeCompare(a[property]);\r\n }\r\n else{\r\n return a[property].localeCompare(b[property]);\r\n }\r\n }\r\n}\r\n\r\nfunction dict2array(dict) {\r\n return Object.keys(dict).map((key) => dict[key]);\r\n}\r\n\r\nfunction availableStates(countryList, sources){\r\n if (countryList) {\r\n // let countryids = countryList.map(Number);\r\n let cleanSources = sources.filter((source) => countryList.includes(source.location.country.name));\r\n let filteredStates = {};\r\n cleanSources.forEach((source) => {\r\n if (source['location']['state']['id']){\r\n if (getKeyByValue(filteredStates,source['location']['state']['name']) in filteredStates){}\r\n else{filteredStates[source['location']['state']['id']] = source['location']['state']['name']}\r\n }\r\n });\r\n return filteredStates;\r\n }\r\n else {\r\n return {}\r\n }\r\n}\r\n\r\nfunction availableCities(stateList, sources){\r\n if (stateList){\r\n // let stateids = stateList.map(Number);\r\n let cleanSources = sources.filter((source) => stateList.includes(source.location.state.name));\r\n let filteredCities = {};\r\n cleanSources.forEach((source) => {\r\n if (source['location']['city']['id']){\r\n if(getKeyByValue(filteredCities,source['location']['city']['name']) in filteredCities){}\r\n else{filteredCities[source['location']['city']['id']] = source['location']['city']['name']}\r\n }\r\n });\r\n return filteredCities;\r\n }\r\n else {\r\n return {}\r\n }\r\n}\r\n\r\nexport { aamMember, downloadParameter, unlimitedSearchParameter, mediaName, mediaType, enableValues, locationOptions, getKeyByValue, dynamicSort, dict2array, availableStates, availableCities };","import * as d3 from \"d3\";\r\nimport { dict2array, getKeyByValue } from \"./utils\";\r\n\r\nconst sourceToExclude = [];\r\n\r\nfunction reliabilityWeight(reliability) {\r\n if (reliability >= 24) {\r\n return 1;\r\n } else if (reliability >= 16) {\r\n return 4;\r\n } else if (reliability >= 8) {\r\n return 8;\r\n } else {\r\n return 16;\r\n }\r\n }\r\n \r\n function biasWeight(bias) {\r\n if (-6 <= bias && bias <= 6) {\r\n return 1;\r\n } else if (-18 <= bias && bias <= 18) {\r\n return 4;\r\n } else if (-30 <= bias && bias <= 30) {\r\n return 8;\r\n } else {\r\n return 16;\r\n }\r\n }\r\n\r\n function biasLabel(bias){\r\n if(-6 <= bias && bias <= 6){\r\n return \"Middle\";\r\n } else if (-18 <= bias && bias < -6){\r\n return \"Skews Left\";\r\n } else if (-30 <= bias && bias < -18){\r\n return \"Hyper-Partisan Left\";\r\n } else if (-42 <= bias && bias < -30){\r\n return \"Most Extreme Left\";\r\n } else if (6 < bias && bias < 18){\r\n return \"Skews Right\";\r\n } else if (18 <= bias && bias < 30){\r\n return \"Hyper-Partisan Right\";\r\n } else if (30 <= bias && bias < 42){\r\n return \"Most Extreme Right\";\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n function reliabilityLabel(reliability){\r\n if(0 <= reliability && reliability <= 8){\r\n return \"Unreliable; Inaccurate\";\r\n } else if (8 < reliability && reliability <= 16){\r\n return \"Unreliable; Misleading\";\r\n } else if (16 < reliability && reliability <= 24){\r\n return \"Unreliable; Problematic\";\r\n } else if (24 < reliability && reliability <= 32){\r\n return \"Mixed Reliability/Opinion OR Other Issues\";\r\n } else if (32 < reliability && reliability <= 40){\r\n return \"Generally Reliable/Analysis OR Other Issues\";\r\n } else if (40 < reliability && reliability <= 48){\r\n return \"Reliable; Analysis/Fact Reporting\";\r\n } else if (48 < reliability && reliability <= 56){\r\n return \"Reliable; Fact Reporting\";\r\n } else if (reliability > 56) {\r\n return \"Reliable; Original Fact Reporting\";\r\n } else {\r\n return null;\r\n }\r\n }\r\n \r\n function cleanArticles(articles) {\r\n var sources = {};\r\n \r\n articles = articles.filter(\r\n (article) => !sourceToExclude.includes(article.moniker_name)\r\n );\r\n \r\n articles.forEach((record) => {\r\n let source = sources[record[\"moniker_name\"]];\r\n if (!source) {\r\n source = {\r\n bias_total: 0,\r\n bias_count: 0,\r\n reliability_total: 0,\r\n reliability_count: 0,\r\n };\r\n }\r\n \r\n const wBias = biasWeight(record[\"bias\"]);\r\n const wReliability = reliabilityWeight(record[\"reliability\"]);\r\n let sourceLocation = {};\r\n \r\n source[\"domain\"] = record[\"main_url\"];\r\n source[\"about_url\"] = record[\"about_url\"];\r\n source[\"moniker_name\"] = record[\"moniker_name\"];\r\n source[\"image_path\"] = record[\"image_path\"];\r\n source[\"mediatype\"] = record[\"mediatype\"];\r\n sourceLocation[\"country\"] = {'id': record[\"country_id\"],'name': record[\"country_name\"]};\r\n sourceLocation[\"state\"] = {'id': record[\"state_id\"],'name': record[\"state_name\"]};\r\n sourceLocation[\"city\"] = {'id': record[\"city_id\"],'name': record[\"city_name\"]};\r\n source[\"location\"] = sourceLocation;\r\n source[\"ownership\"] = dict2array(record[\"ownership\"]);\r\n source[\"bias_total\"] += record[\"bias\"] * wBias;\r\n source[\"bias_count\"] += wBias;\r\n source[\"reliability_total\"] += record[\"reliability\"] * wReliability;\r\n source[\"reliability_count\"] += wReliability;\r\n sources[record[\"moniker_name\"]] = source;\r\n });\r\n\r\n // create owners list from content pieces\r\n let ownership = {}\r\n articles.forEach((record) => {\r\n for ( let [key, value] of Object.entries(record['ownership']) ){\r\n if (!(key in ownership)) ownership[key] = value\r\n }\r\n });\r\n \r\n sources = Object.keys(sources).map((key) => {\r\n return {\r\n ...sources[key],\r\n bias_mean: sources[key][\"bias_total\"] / sources[key][\"bias_count\"],\r\n reliability_mean:\r\n sources[key][\"reliability_total\"] / sources[key][\"reliability_count\"],\r\n };\r\n });\r\n\r\n // supress sources and it's content-pieces if reliability is below 24\r\n let sourceBlockList = []; // prepare block list\r\n sources.forEach((source)=>{\r\n if (source.reliability_mean < 24){\r\n sourceBlockList.push(source.moniker_name);\r\n }\r\n });\r\n \r\n // apply that block list\r\n sources = sources.filter((source) => !sourceBlockList.includes(source.moniker_name));\r\n articles = articles.filter((article) => !sourceBlockList.includes(article.moniker_name));\r\n\r\n // add label based on score/value\r\n sources.forEach((source) => {\r\n source[\"bias_label\"] = biasLabel(source[\"bias_mean\"]);\r\n source[\"reliability_label\"] = reliabilityLabel(source[\"reliability_mean\"]);\r\n });\r\n\r\n \r\n // Calculate International, National and Local coverage for source\r\n sources.forEach((source) => {\r\n \r\n if(source['location']['country']['id'] !== 233){\r\n source['coverage'] = \"International\";\r\n }\r\n\r\n else if(source['location']['country']['id'] === 233 && (source['location']['state']['id'] === null) && (source['location']['city']['id'] === null) ){\r\n source['coverage'] = \"National\";\r\n }\r\n\r\n else if(source['location']['country']['id'] === 233 && (source['location']['state']['id'] !== null)){\r\n source['coverage'] = \"Local\";\r\n }\r\n });\r\n\r\n let countries = {};\r\n let states = {};\r\n let cities = {};\r\n let usa_states = {};\r\n\r\n sources.forEach(source => {\r\n if (source['location']['country']['id']){\r\n if (getKeyByValue(countries,source['location']['country']['name']) in countries){}\r\n else{countries[source['location']['country']['id']] = source['location']['country']['name']}\r\n }\r\n\r\n if (source['location']['state']['id']){\r\n if (getKeyByValue(states,source['location']['state']['name']) in states){}\r\n else{states[source['location']['state']['id']] = source['location']['state']['name']}\r\n }\r\n\r\n if (source['location']['state']['id'] && source['location']['country']['id'] === 233){\r\n if (getKeyByValue(usa_states,source['location']['state']['name']) in usa_states){}\r\n else{usa_states[source['location']['state']['id']] = source['location']['state']['name']}\r\n }\r\n\r\n if (source['location']['city']['id']){\r\n if (getKeyByValue(cities,source['location']['city']['name']) in cities){}\r\n else{cities[source['location']['city']['id']] = source['location']['city']['name']}\r\n }\r\n });\r\n \r\n // sort source list by reach value\r\n sources.sort((a, b) => a.reach - b.reach);\r\n \r\n return { articles, sources, countries, states, usa_states, cities, ownership };\r\n }\r\n \r\n function wrap(text, width) {\r\n text.each(function () {\r\n var text = d3.select(this),\r\n words = text.text().split(/\\s+/).reverse(),\r\n word,\r\n line = [],\r\n lineNumber = 0,\r\n lineHeight = 15, // ems\r\n y = 0,\r\n dy = parseFloat(text.attr(\"dy\")),\r\n tspan = text\r\n .text(null)\r\n .append(\"tspan\")\r\n .attr(\"x\", 0)\r\n .attr(\"y\", y)\r\n .attr(\"dy\", dy)\r\n .attr(\"dx\", 0);\r\n \r\n while ((word = words.pop())) {\r\n line.push(word);\r\n tspan.text(line.join(\" \"));\r\n if (tspan.node().getComputedTextLength() > width) {\r\n line.pop();\r\n tspan.text(line.join(\" \"));\r\n line = [word];\r\n tspan = text\r\n .append(\"tspan\")\r\n .attr(\"x\", 0)\r\n .attr(\"y\", y)\r\n .attr(\"dy\", ++lineNumber * lineHeight + dy)\r\n .attr(\"dx\", 0)\r\n .text(word);\r\n }\r\n }\r\n \r\n if (lineNumber > 0) {\r\n const xTranslate = text.node().transform.baseVal[0].matrix.e;\r\n const yTranslate = ((lineNumber - 1) * lineHeight) / 2;\r\n text.attr(\"transform\", `translate(${xTranslate}, -${yTranslate})`);\r\n }\r\n });\r\n }\r\n \r\n function formatNumber(number) {\r\n let nums = number.replace(/,/g, \"\");\r\n if (!nums) return;\r\n return parseInt(nums).toLocaleString();\r\n }\r\n\r\n export { cleanArticles, wrap, formatNumber };","import * as d3 from \"d3\";\r\nimport { wrap } from \"./calculation\";\r\nimport { mediaName, getKeyByValue } from \"./utils\";\r\n\r\nconst MEDIAICONS_URL = \"/mediaicons\";\r\nconst width = 1200;\r\nconst height = 725;\r\n\r\nconst margin = {\r\n top: 40,\r\n bottom: 90,\r\n right: 150,\r\n left: 170\r\n};\r\n\r\nconst xDomain = [-42, -30, -18, -6, 0, 6, 18, 30, 42];\r\nconst xLabels = [\r\n \"Most Extreme Left\",\r\n \"Hyper-Partisan Left\",\r\n \"Skews Left\",\r\n \"Middle or Balanced Bias\",\r\n \"Skews Right\",\r\n \"Hyper-Partisan Right\",\r\n \"Most Extreme Right\",\r\n];\r\nconst xLabelsPoints = [-36, -24, -12, 0, 12, 24, 36];\r\n\r\nconst yDomain = [0, 8, 16, 24, 32, 40, 48, 56, 64];\r\nconst yLabels = [\r\n \"Contains Inaccurate / Fabricated Info\",\r\n \"Contains Misleading Info\",\r\n \"Selective or Incomplete Story / Unfair Persuasion / Propaganda\",\r\n \"Opinion or High Variation in Reliability\",\r\n \"Analysis or High Variation in Reliability\",\r\n \"Complex Analysis or Mix of Fact Reporting and Analysis\",\r\n \"Fact Reporting\",\r\n \"Original Fact Reporting\",\r\n];\r\nconst yLabelsPoints = [4, 12, 20, 28, 36, 44, 52, 60];\r\n\r\nconst xGridDomain = [-30, -18, -6, 0, 6, 18, 30];\r\nconst yGridDomain = [8, 16, 24, 32, 40, 48, 56];\r\n\r\nconst logoHeight = 50;\r\nconst logoWidth = 50;\r\n\r\nconst fontFamily = `\"Nunito Sans\", -apple-system, system-ui, BlinkMacSystemFont,\r\nSegoe UI, Roboto, Helvetica Neue, Arial, sans-serif`;\r\nconst fontColor = \"#2e2e2e\";\r\nclass Chart {\r\n constructor(articles, sources, customMargin, handleOpenContextMenu) {\r\n this.sourceReach = false;\r\n this.lastTransform = { k: 1, x: 0, y: 0 };\r\n this.articles = articles;\r\n this.sources = sources;\r\n this.x = null;\r\n this.y = null;\r\n this.zoomed = this.zoomed.bind(this);\r\n this.plotData = this.plotData.bind(this);\r\n this.customMargin = customMargin;\r\n this.handleOpenContextMenu = handleOpenContextMenu;\r\n if(this.customMargin){\r\n Object.defineProperty(margin,\"right\",{value: 20});\r\n }\r\n\r\n Object.freeze(margin);\r\n }\r\n\r\n create() {\r\n this.createRoot();\r\n this.createScales();\r\n this.createDefs();\r\n this.createContainers();\r\n if(!this.customMargin){\r\n this.createSegments();\r\n }\r\n this.createTitles();\r\n this.createToolTips();\r\n this.createZoomButtons();\r\n this.createZoom();\r\n this.plotData();\r\n this.zoomContainer.call(this.zoom.transform, d3.zoomIdentity);\r\n }\r\n\r\n update(articles, sources, sourceReach, displayArticles) {\r\n this.displayArticles = displayArticles;\r\n this.sourceReach = sourceReach;\r\n this.articles = articles;\r\n this.sources = sources;\r\n this.plotData();\r\n }\r\n\r\n reset() {\r\n this.zoomContainer\r\n .transition()\r\n .duration(750)\r\n .call(this.zoom.transform, d3.zoomIdentity);\r\n }\r\n\r\n clickZoom(type) {\r\n const newK =\r\n type === \"plus\"\r\n ? Math.min(50, this.lastTransform.k + 2)\r\n : Math.max(1, this.lastTransform.k - 2);\r\n\r\n this.zoomContainer.transition().duration(300).call(this.zoom.scaleTo, newK);\r\n }\r\n\r\n destroy() {\r\n d3.select(this.el).selectAll(\"svg\").remove();\r\n }\r\n\r\n zoomed() {\r\n const transform = d3.event.transform;\r\n const zx = transform.rescaleX(this.x).interpolate(d3.interpolateRound);\r\n const zy = transform.rescaleY(this.y).interpolate(d3.interpolateRound);\r\n\r\n this.gArticles\r\n .attr(\"transform\", transform)\r\n .attr(\"stroke-width\", 5 / transform.k);\r\n\r\n if (this.sourceReach) {\r\n this.gSourceReach.attr(\"transform\", transform).lower();\r\n if (transform.k !== this.lastTransform.k) {\r\n d3.selectAll(\".sourceReach\").attr(\"stroke-width\", 1 / transform.k);\r\n }\r\n }\r\n\r\n this.gSources.attr(\"transform\", transform);\r\n if (transform.k !== this.lastTransform.k) {\r\n d3.selectAll(\".sourceAverage\")\r\n .attr(\"width\", logoWidth / transform.k)\r\n .attr(\"height\", logoHeight / transform.k)\r\n .attr(\r\n \"x\",\r\n (d) => this.x(d.bias_mean) - logoWidth / 2 / transform.k\r\n )\r\n .attr(\r\n \"y\",\r\n (d) => this.y(d.reliability_mean) - logoHeight / 2 / transform.k\r\n );\r\n }\r\n if(!this.customMargin){\r\n this.gSegmentGreen.attr(\"transform\", transform);\r\n this.gSegmentYellow.attr(\"transform\", transform);\r\n this.gSegmentOrange.attr(\"transform\", transform);\r\n this.gSegmentRed.attr(\"transform\", transform);\r\n }\r\n \r\n if (transform.k !== this.lastTransform.k) {\r\n this.segmentContainer.attr(\r\n \"style\",\r\n `stroke-width: ${Math.ceil(3 / transform.k)}`\r\n );\r\n }\r\n\r\n this.gx.call(xAxis, zx);\r\n this.gy.call(yAxis, zy);\r\n\r\n this.gxDesc.call(xAxisDesc, zx);\r\n this.gyDesc.call(yAxisDesc, zy);\r\n\r\n this.gGrid.call(grid, zx, zy);\r\n\r\n this.lastTransform = transform;\r\n }\r\n\r\n plotData() {\r\n // articles\r\n // if(this.displayArticles){\r\n const that = this;\r\n this.gArticles\r\n .selectAll(\".sourceArticle\")\r\n .data(this.articles)\r\n .join(\"path\")\r\n .attr(\"class\", \"sourceArticle\")\r\n .attr(\"moniker_name\", (d) => `${d.moniker_name}`)\r\n .attr(\"d\", (d) => `M${this.x(d.bias)},${this.y(d.reliability)}h0`)\r\n .attr(\"stroke\", (d) => {\r\n if (this.sources.length < 10) {\r\n return this.color(d.moniker_name);\r\n } else {\r\n return \"gainsboro\";\r\n }\r\n })\r\n .on(\"mouseover\", function (d) {\r\n articleTooltip(d3.event, d);\r\n d3.select(this).attr(\"stroke\", \"black\");\r\n d3.select(this).raise();\r\n })\r\n .on(\"mousemove\", (d) => articleTooltip(d3.event, d))\r\n .on(\"mouseout\", (d) => this.hoverArticle(d))\r\n .on(\"click\", (d) => window.open(d.url, \"_blank\"));\r\n // }else{\r\n // this.gArticles.selectAll(\".sourceArticle\").remove();\r\n // }\r\n\r\n // sources\r\n this.gSources\r\n .selectAll(\".sourceAverage\")\r\n .data(this.sources)\r\n .join(\"image\")\r\n .attr(\"class\", \"sourceAverage\")\r\n .attr(\r\n \"x\",\r\n (d) => this.x(d.bias_mean) - logoWidth / 2 / this.lastTransform.k\r\n )\r\n .attr(\r\n \"y\",\r\n (d) =>\r\n this.y(d.reliability_mean) - logoHeight / 2 / this.lastTransform.k\r\n )\r\n .attr(\"width\", logoWidth / this.lastTransform.k)\r\n .attr(\"height\", logoHeight / this.lastTransform.k)\r\n .attr(\"href\", function (d) {\r\n if (d.image_path) {\r\n return `${MEDIAICONS_URL}/${d.image_path}`;\r\n }\r\n })\r\n .on(\"mouseover\", function (d) {\r\n sourceTooltip(d3.event, d);\r\n sourceReachCicleHighlight(d3.event, d);\r\n d3.select(\".chartContainer\").attr(\"class\", \"chartContainer has-cursor\");\r\n })\r\n .on(\"mousemove\", (d) => {\r\n sourceTooltip(d3.event, d);\r\n sourceReachCicleHighlight(d3.event, d);\r\n sourceArticleHighlight(d3.event, d);\r\n })\r\n .on(\"mouseout\", function (source) {\r\n d3.selectAll(\".sourceArticle\")\r\n .filter(function (d) {\r\n return d.moniker_name === source.moniker_name;\r\n })\r\n .attr(\"stroke\", (d) => {\r\n return \"gainsboro\";\r\n });\r\n sourceReachCicleUnHighlight(source);\r\n d3.select(\".svg-tooltip.toolTipSource\").style(\"visibility\", \"hidden\");\r\n d3.select(\".chartContainer\").attr(\"class\", \"chartContainer no-cursor\");\r\n })\r\n .on(\"click\", function (d) {\r\n if (d.about_url) {\r\n return window.open(`${d.about_url}`, \"_blank\");\r\n }\r\n })\r\n .on(\"contextmenu\", function(data) {\r\n that.handleOpenContextMenu(data);\r\n d3.select(\"#chart-context-menu\")\r\n .style(\"position\", \"absolute\")\r\n .style(\"display\", \"block\")\r\n .style(\"top\", d3.event.pageY + \"px\")\r\n .style(\"left\", d3.event.pageX + \"px\");\r\n d3.event.preventDefault();\r\n d3.select(\".svg-tooltip.toolTipSource\").style(\"visibility\", \"hidden\");\r\n d3.select(\".chartContainer\").attr(\"class\", \"chartContainer no-cursor\");\r\n });\r\n\r\n // reach\r\n if (this.sourceReach) {\r\n this.gSourceReach\r\n .selectAll(\".sourceReach\")\r\n .data(this.sources.filter((source) => source.reach))\r\n .join(\"circle\")\r\n .attr(\"class\", \"sourceReach\")\r\n .attr(\"source-reach\", (d) => d.moniker_name)\r\n .attr(\"cx\", (d) => this.x(d.bias_mean))\r\n .attr(\"cy\", (d) => this.y(d.reliability_mean))\r\n .attr(\"r\", (d) => this.scaleReach(Math.min(d.reach, this.maxReach)))\r\n .attr(\"opacity\", 0.9)\r\n .attr(\"stroke\", \"#323232\")\r\n .attr(\"stroke-dasharray\", \"2 1\")\r\n .attr(\"fill\", \"#ededed\");\r\n\r\n this.gSourceReach.attr(\"transform\", this.lastTransform).lower();\r\n d3.selectAll(\".sourceReach\").attr(\r\n \"stroke-width\",\r\n 1 / this.lastTransform.k\r\n );\r\n } else {\r\n this.gSourceReach.selectAll(\".sourceReach\").remove();\r\n }\r\n }\r\n\r\n createRoot() {\r\n this.el = d3\r\n .select(\"div.chartContainer\")\r\n .append(\"svg\")\r\n .attr(\"viewBox\", [0, 0, width, height])\r\n .attr(\"class\", \"chartSVG\")\r\n .style(\"fill\", \"white\");\r\n }\r\n\r\n createScales() {\r\n this.color = d3\r\n .scaleOrdinal()\r\n .domain(this.sources.map((d) => d.moniker_name).sort())\r\n .range(d3.schemeTableau10);\r\n\r\n this.x = d3\r\n .scaleLinear()\r\n .domain([-42, 42])\r\n .range([margin.left, width - margin.right]);\r\n\r\n this.y = d3\r\n .scaleLinear()\r\n .domain([0, 64])\r\n .range([height - margin.bottom, margin.top]);\r\n }\r\n\r\n createDefs() {\r\n const defs = this.el.append(\"defs\");\r\n\r\n defs\r\n .append(\"clipPath\")\r\n .attr(\"id\", \"clipData\")\r\n .append(\"rect\")\r\n .attr(\"x\", margin.left)\r\n .attr(\"y\", margin.top)\r\n .attr(\"width\", width - margin.left - margin.right)\r\n .attr(\"height\", height - margin.top - margin.bottom);\r\n\r\n defs\r\n .append(\"clipPath\")\r\n .attr(\"id\", \"clipXAxis\")\r\n .append(\"rect\")\r\n .attr(\"x\", margin.left - 15)\r\n .attr(\"y\", 0)\r\n .attr(\"width\", width - margin.left - margin.right + 30)\r\n .attr(\"height\", height)\r\n .attr(\"style\", \"fill: transparent; stroke-width: 1; stroke: rgb(0,0,0)\");\r\n\r\n defs\r\n .append(\"clipPath\")\r\n .attr(\"id\", \"clipYAxis\")\r\n .append(\"rect\")\r\n .attr(\"x\", 0)\r\n .attr(\"y\", margin.top - 5)\r\n .attr(\"width\", width)\r\n .attr(\"height\", height - margin.top - margin.bottom + 10)\r\n .attr(\"style\", \"fill: transparent; stroke-width: 1; stroke: rgb(0,0,0)\");\r\n }\r\n\r\n createContainers() {\r\n this.zoomContainer = this.el.append(\"g\").attr(\"class\", \"zoomableArea\");\r\n this.zoomContainer\r\n .append(\"rect\")\r\n .attr(\"x\", margin.left)\r\n .attr(\"y\", margin.top)\r\n .attr(\"width\", width - margin.left - margin.right)\r\n .attr(\"height\", height - margin.top - margin.bottom)\r\n .attr(\r\n \"style\",\r\n \"fill:transparent; stroke-width: 1; stroke: rgba(0, 0, 0);\"\r\n );\r\n\r\n this.segmentContainer = this.zoomContainer\r\n .append(\"g\")\r\n .attr(\"style\", \"stroke-width: 3\")\r\n .attr(\"clip-path\", \"url(#clipData)\");\r\n\r\n this.zoomButtonContainer = this.zoomContainer\r\n .append(\"g\")\r\n .attr(\"class\", \"zoomRefContainer\")\r\n .attr(\"clip-path\", \"url(#clipData)\");\r\n\r\n this.gGrid = this.zoomContainer\r\n .append(\"g\")\r\n .attr(\"clip-path\", \"url(#clipData)\");\r\n const gxContainer = this.zoomContainer\r\n .append(\"g\")\r\n .attr(\"clip-path\", \"url(#clipXAxis)\");\r\n const gyContainer = this.zoomContainer\r\n .append(\"g\")\r\n .attr(\"clip-path\", \"url(#clipYAxis)\");\r\n\r\n this.gx = gxContainer.append(\"g\").attr(\r\n \"style\",\r\n `\r\n color: ${fontColor};\r\n font-family: ${fontFamily};\r\n font-size: 12px;\r\n `\r\n );\r\n this.gy = gyContainer.append(\"g\").attr(\r\n \"style\",\r\n `\r\n color: ${fontColor};\r\n font-family: ${fontFamily};\r\n font-size: 12px;\r\n `\r\n );\r\n\r\n this.gxDesc = gxContainer.append(\"g\").attr(\r\n \"style\",\r\n `\r\n color: ${fontColor};\r\n font-family: ${fontFamily};\r\n font-size: 12px;\r\n `\r\n );\r\n this.gyDesc = gyContainer.append(\"g\").attr(\r\n \"style\",\r\n `\r\n color: ${fontColor};\r\n font-family: ${fontFamily};\r\n font-size: 12px;\r\n `\r\n );\r\n\r\n this.dataContainer = this.zoomContainer\r\n .append(\"g\")\r\n .attr(\"clip-path\", \"url(#clipData)\");\r\n this.gArticles = this.dataContainer\r\n .append(\"g\")\r\n .attr(\"stroke-linecap\", \"round\");\r\n\r\n this.gSourceReach = this.dataContainer.append(\"g\");\r\n this.gSources = this.dataContainer.append(\"g\");\r\n }\r\n\r\n createSegments() {\r\n // green\r\n this.gSegmentGreen = this.segmentContainer\r\n .append(\"rect\")\r\n .attr(\"clip-path\", \"url(#clipData)\")\r\n .attr(\"x\", this.x(-16.5))\r\n .attr(\"y\", this.y(63))\r\n .attr(\"height\", this.y(40) - this.y(63))\r\n .attr(\"width\", this.x(16.5) - this.x(-16.5))\r\n .attr(\"rx\", 10)\r\n .attr(\"ry\", 10)\r\n .attr(\"style\", \"fill:none; stroke:#27AE60; opacity:0.5;\")\r\n .attr(\"stroke-dasharray\", \"4\");\r\n\r\n // yellow\r\n this.gSegmentYellow = this.segmentContainer\r\n .append(\"rect\")\r\n .attr(\"x\", this.x(-22))\r\n .attr(\"y\", this.y(46))\r\n .attr(\"height\", this.y(24) - this.y(46))\r\n .attr(\"width\", this.x(22) - this.x(-22))\r\n .attr(\"rx\", 10)\r\n .attr(\"ry\", 10)\r\n .attr(\"style\", \"fill:none; stroke:#F1C40F; opacity:0.5;\")\r\n .attr(\"stroke-dasharray\", \"4 2 1\");\r\n\r\n // orange\r\n this.gSegmentOrange = this.segmentContainer\r\n .append(\"polyline\")\r\n .attr(\r\n \"points\",\r\n `\r\n ${this.x(-41.5)},${this.y(46)}\r\n ${this.x(-41.5)},${this.y(16)},\r\n ${this.x(41.5)},${this.y(16)},\r\n ${this.x(41.5)},${this.y(46)},\r\n ${this.x(22)},${this.y(46)},\r\n ${this.x(22)},${this.y(24)},\r\n ${this.x(-22)},${this.y(24)},\r\n ${this.x(-22)},${this.y(46)},\r\n ${this.x(-41.5)},${this.y(46)}\r\n `\r\n )\r\n .attr(\"style\", \"fill:none; stroke:#E67E22; opacity:0.5;\")\r\n .attr(\"stroke-dasharray\", \"4 1 1\");\r\n\r\n // red\r\n this.gSegmentRed = this.segmentContainer\r\n .append(\"rect\")\r\n .attr(\"x\", this.x(-41.5))\r\n .attr(\"y\", this.y(16))\r\n .attr(\"height\", this.y(0.5) - this.y(16))\r\n .attr(\"width\", this.x(41.5) - this.x(-41.5))\r\n .attr(\"rx\", 10)\r\n .attr(\"ry\", 10)\r\n .attr(\"style\", \"fill:none; stroke:#E74C3C;opacity:0.5;\")\r\n .attr(\"stroke-dasharray\", \"4 2 2\");\r\n }\r\n\r\n createTitles() {\r\n // xAxisTitle\r\n this.el\r\n .append(\"image\")\r\n .attr(\"width\", width - margin.left - margin.right)\r\n .attr(\"height\", 30)\r\n .attr(\"x\", margin.left)\r\n .attr(\"y\", height - margin.bottom / 1.5)\r\n .attr(\"href\", `${process.env.PUBLIC_URL}/images/xAxisTitle.png`);\r\n\r\n // Add copyright\r\n this.copyrightContainer = this.el\r\n .append(\"g\")\r\n .append(\"text\")\r\n .attr(\"width\", width - margin.left - margin.right)\r\n .attr(\"height\", 30)\r\n .attr(\"x\", width / 2)\r\n .attr(\"y\", height - margin.bottom / 24)\r\n .attr(\"xml:space\", \"preserve\")\r\n .attr(\r\n \"style\",\r\n `\r\n fill: ${fontColor};\r\n font-family: ${fontFamily};\r\n font-size: 10px;\r\n text-anchor: middle;\r\n `\r\n );\r\n\r\n this.copyrightContainer\r\n .append(\"tspan\")\r\n .text(`Media Bias Chart® Licensed Copy. Copyright © `);\r\n \r\n this.copyrightContainer\r\n .append(\"tspan\")\r\n .text(`Ad Fontes Media, Inc`)\r\n .attr(\"dx\", \"4px\")\r\n .attr(\r\n \"style\",\r\n `fill: #1890ff; cursor: pointer; text-decoration: underline`\r\n )\r\n .on(\"click\", () =>\r\n window.open(\"https://www.adfontesmedia.com/\", \"_blank\")\r\n );\r\n \r\n this.copyrightContainer\r\n .append(\"tspan\")\r\n .attr(\"dx\", \"4px\")\r\n .text(`${new Date().getFullYear()}.`);\r\n \r\n this.copyrightContainer\r\n .append(\"tspan\")\r\n .attr(\"dx\", \"4px\")\r\n .text(`Ratings and data are not audited by AAM.`);\r\n\r\n // yAxisTitle\r\n this.el\r\n .append(\"image\")\r\n .attr(\"width\", 30)\r\n .attr(\"height\", height - margin.bottom - margin.top)\r\n .attr(\"x\", (margin.left * 2) / 3 - 5)\r\n .attr(\"y\", margin.top)\r\n .attr(\"href\", `${process.env.PUBLIC_URL}/images/yAxisTitle.png`);\r\n\r\n // Add typeKey\r\n if(!this.customMargin){\r\n d3.xml(`${process.env.PUBLIC_URL}/images/typeKey.svg`).then((data) => {\r\n this.el.node().append(data.documentElement);\r\n this.el\r\n .select(\"#typeKey\")\r\n .attr(\"viewBox\", \"0,0,210,520\")\r\n .attr(\"x\", width - margin.right - 30)\r\n .attr(\"y\", margin.top / 2)\r\n .attr(\"width\", 210)\r\n .attr(\"height\", 320);\r\n });\r\n }\r\n }\r\n\r\n createZoom() {\r\n this.zoom = d3\r\n .zoom()\r\n .scaleExtent([1, 50])\r\n .extent([\r\n [margin.left, margin.top],\r\n [width - margin.right, height - margin.bottom],\r\n ])\r\n .translateExtent([\r\n [margin.left, margin.top],\r\n [width - margin.right, height - margin.bottom],\r\n ]);\r\n\r\n this.zoomContainer.call(this.zoom.on(\"zoom\", this.zoomed));\r\n }\r\n\r\n createToolTips() {\r\n this.toolTipSource = d3\r\n .select(\".chartContainer\")\r\n .append(\"div\")\r\n .attr(\"class\", \"svg-tooltip toolTipSource\");\r\n this.toolTipSource.append(\"div\").attr(\"class\", \"toolTipSource\");\r\n this.toolTipSource.append(\"div\").attr(\"class\", \"toolTipDomain\");\r\n this.toolTipSource.append(\"div\").attr(\"class\", \"toolTipQuality\");\r\n this.toolTipSource.append(\"div\").attr(\"class\", \"toolTipBias\");\r\n this.toolTipSource.append(\"div\").attr(\"class\", \"toolTipReach\");\r\n this.toolTipSource.append(\"div\").attr(\"class\", \"toolTipMediaType\");\r\n\r\n this.toolTipArticle = d3\r\n .select(\".chartContainer\")\r\n .append(\"div\")\r\n .attr(\"class\", \"svg-tooltip toolTipArticle\");\r\n this.toolTipArticle.append(\"div\").attr(\"class\", \"toolTipSource\");\r\n this.toolTipArticle.append(\"div\").attr(\"class\", \"toolTipDomain\");\r\n this.toolTipArticle.append(\"div\").attr(\"class\", \"toolTipQuality\");\r\n this.toolTipArticle.append(\"div\").attr(\"class\", \"toolTipBias\");\r\n this.toolTipArticle.append(\"div\").attr(\"class\", \"toolTipReach\");\r\n }\r\n\r\n hoverArticle(article) {\r\n d3.select(\".svg-tooltip.toolTipArticle\").style(\"visibility\", \"hidden\");\r\n d3.selectAll(\".sourceArticle\")\r\n .filter(function (d) {\r\n return d.moniker_name === article.moniker_name;\r\n })\r\n .attr(\"stroke\", (d) => {\r\n if (this.sources.length < 10) {\r\n return this.color(d.moniker_name);\r\n } else {\r\n return \"gainsboro\";\r\n }\r\n });\r\n }\r\n\r\n createZoomButtons() {\r\n d3.xml(`${process.env.PUBLIC_URL}/images/zoomButtons.svg`).then((data) => {\r\n this.zoomButtonContainer.node().append(data.documentElement);\r\n this.el\r\n .select(\"#zoomButtons\")\r\n .attr(\"class\", \"zoomRef\")\r\n .attr(\"x\", width - margin.right - 30)\r\n .attr(\"y\", margin.top / 2 + 10)\r\n .attr(\"width\", 50)\r\n .attr(\"height\", 100);\r\n\r\n this.zoomButtonContainer\r\n .select(\".zoomPlus\")\r\n .on(\"click\", () => this.clickZoom(\"plus\"));\r\n\r\n this.zoomButtonContainer\r\n .select(\".zoomMinus\")\r\n .on(\"click\", () => this.clickZoom(\"minus\"));\r\n });\r\n }\r\n}\r\n\r\n// Define xAxis\r\nconst xAxis = (g, x) => {\r\n g.attr(\"transform\", `translate(0, ${height - margin.bottom})`).call(\r\n d3\r\n .axisBottom(x)\r\n .tickValues(xDomain)\r\n .tickSize(0)\r\n .tickPadding(10)\r\n .tickFormat(d3.format(\".1f\"))\r\n );\r\n};\r\n\r\n// Define yAxis\r\nconst yAxis = (g, y) =>\r\n g\r\n .attr(\"transform\", `translate(${margin.left}, 0)`)\r\n .call(\r\n d3\r\n .axisLeft(y)\r\n .tickValues(yDomain)\r\n .tickSize(0)\r\n .tickPadding(10)\r\n .tickFormat(d3.format(\".1f\"))\r\n );\r\n\r\n// Define xAxisDesc\r\nconst xAxisDesc = (g, x) =>\r\n g\r\n .attr(\"transform\", `translate(0, ${margin.top})`)\r\n .call(\r\n d3\r\n .axisBottom(x)\r\n .tickValues(xLabelsPoints)\r\n .tickSize(0)\r\n .tickPadding(10)\r\n .tickFormat((d, i) => xLabels[i])\r\n )\r\n .selectAll(\".tick text\")\r\n .attr(\"transform\", `translate(0,-${margin.top - 10})`);\r\n\r\n// Define xAxisDesc\r\nconst yAxisDesc = (g, y) =>\r\n g\r\n .attr(\"transform\", `translate(${margin.left}, 0)`)\r\n .call(\r\n d3\r\n .axisLeft(y)\r\n .tickValues(yLabelsPoints)\r\n .tickSize(0)\r\n .tickPadding(10)\r\n .tickFormat((d, i) => yLabels[i])\r\n )\r\n .selectAll(\".tick text\")\r\n .attr(\"transform\", `translate(-${margin.left * (2 / 3)},0)`)\r\n .attr(\"style\", \"text-anchor: middle; \")\r\n .call(wrap, 100);\r\n\r\n// Define grid\r\nconst grid = (g, x, y) =>\r\n g\r\n .attr(\"stroke\", \"currentColor\")\r\n .attr(\"stroke-opacity\", 0.1)\r\n .call((g) =>\r\n g\r\n .selectAll(\".x\")\r\n .data(xGridDomain)\r\n .join(\r\n (enter) => enter.append(\"line\").attr(\"class\", \"x\"),\r\n (update) => update,\r\n (exit) => exit.remove()\r\n )\r\n .attr(\"x1\", (d) => 0.5 + x(d))\r\n .attr(\"x2\", (d) => 0.5 + x(d))\r\n .attr(\"y1\", margin.top)\r\n .attr(\"y2\", height - margin.bottom)\r\n .attr(\"stroke-opacity\", (d) => (d === 0 ? 0.3 : 0.1))\r\n )\r\n .call((g) =>\r\n g\r\n .selectAll(\".y\")\r\n .data(yGridDomain)\r\n .join(\r\n (enter) => enter.append(\"line\").attr(\"class\", \"y\"),\r\n (update) => update,\r\n (exit) => exit.remove()\r\n )\r\n .attr(\"y1\", (d) => 0.5 + y(d))\r\n .attr(\"y2\", (d) => 0.5 + y(d))\r\n .attr(\"x1\", margin.left)\r\n .attr(\"x2\", width - margin.right)\r\n );\r\n\r\nconst sourceTooltip = (e, d) => {\r\n let toolTip = d3.select(\".svg-tooltip.toolTipSource\");\r\n toolTip\r\n .style(\"position\", \"absolute\")\r\n .style(\"visibility\", \"visible\")\r\n .style(\"top\", d3.event.pageY - 10 + \"px\")\r\n .style(\"left\", d3.event.pageX + 10 + \"px\");\r\n\r\n toolTip.select(\".toolTipSource\").text(`Name: ${d.moniker_name}`);\r\n toolTip.select(\".toolTipDomain\").text(`Domain: ${d.domain}`);\r\n toolTip.select(\".toolTipQuality\").text(`Reliability: ${d.reliability_mean.toFixed(2)}`);\r\n toolTip.select(\".toolTipBias\").text(`Bias: ${d.bias_mean.toFixed(2)}`);\r\n toolTip.select(\".toolTipMediaType\").text(`Media Type: ${String(getKeyByValue(mediaName,d.mediatype))}`);\r\n};\r\n\r\nconst sourceArticleHighlight = (e, source) => {\r\n d3.selectAll(\".sourceArticle\")\r\n .filter(function (d) {\r\n return d.moniker_name === source.moniker_name;\r\n })\r\n .attr(\"stroke\", (d) => {\r\n return \"green\";\r\n });\r\n}\r\n\r\nconst articleTooltip = (e, d) => {\r\n let toolTip = d3.select(\".svg-tooltip.toolTipArticle\");\r\n toolTip\r\n .style(\"position\", \"absolute\")\r\n .style(\"visibility\", \"visible\")\r\n .style(\"top\", d3.event.pageY - 10 + \"px\")\r\n .style(\"left\", d3.event.pageX + 10 + \"px\");\r\n\r\n toolTip.select(\".toolTipSource\").text(`Name: ${d.moniker_name}`);\r\n toolTip.select(\".toolTipDomain\").text(`Domain: ${d.domain}`);\r\n toolTip\r\n .select(\".toolTipQuality\")\r\n .text(`Reliability: ${d.reliability.toFixed(2)}`);\r\n toolTip.select(\".toolTipBias\").text(`Bias: ${d.bias.toFixed(2)}`);\r\n toolTip.select(\".toolTipReach\").text(`Content Url: ${d.url}`);\r\n};\r\n\r\nconst sourceReachCicleHighlight = (e, d) => {\r\n let reachCircle = d3.selectAll(`circle[source-reach=\"${d.moniker_name}\"]`);\r\n d3.selectAll(\".sourceReach\").sort(function(a, b) {\r\n if(a.moniker_name === d.moniker_name) {\r\n return 1;\r\n }\r\n return a.reach > b.reach ? -1: 1;\r\n })\r\n reachCircle\r\n .attr(\"fill\", \"#969696\")\r\n};\r\n\r\nconst sourceReachCicleUnHighlight = (d) => {\r\n let reachCircle = d3.selectAll(`circle[source-reach=\"${d.moniker_name}\"]`);\r\n reachCircle\r\n .attr(\"fill\", \"#ededed\")\r\n};\r\n\r\nexport { Chart, height, width };\r\n","import moment from 'moment';\r\nconst SOURCE_DATA = 'source_data';\r\nvar defaultData = {\r\n 'stamp' : moment().format('YYYYMMDD'),\r\n 'year' : 0,\r\n 'month' : 0,\r\n 'day' : 0,\r\n 'searches' : []\r\n}\r\n\r\n// set defaultData if not found in localstorage\r\nif(localStorage.getItem(SOURCE_DATA) === null){\r\n localStorage.setItem(SOURCE_DATA,JSON.stringify(defaultData));\r\n}\r\n\r\n// set old values from localstorage\r\nvar oldData = JSON.parse(localStorage.getItem(SOURCE_DATA));\r\nvar oldYear = oldData['year'];\r\nvar oldMonth = oldData['month'];\r\nvar oldDay = oldData['day'];\r\nvar oldSearches = oldData['searches'];\r\n\r\n// get current timestamp when request is made\r\nconst currStamp = moment().format('YYYYMMDD');\r\n\r\n// function to check whether user can view source list\r\nexport function canAccess(value,version){\r\n\r\n if(oldData['stamp'] === currStamp){\r\n\r\n var yearLimit, monthLimit, dayLimit, listLength;\r\n\r\n if (version === \"free\"){\r\n yearLimit = 50;\r\n monthLimit = 20;\r\n dayLimit = 5;\r\n listLength = false;\r\n }\r\n\r\n else if (version === \"plus\"){\r\n yearLimit = 100;\r\n monthLimit = 40;\r\n dayLimit = 15;\r\n listLength = true;\r\n }\r\n\r\n else if (version === \"paid\"){\r\n yearLimit = 500;\r\n monthLimit = 200;\r\n dayLimit = 75;\r\n listLength = true;\r\n }\r\n\r\n if (oldYear < yearLimit && oldMonth < monthLimit && oldDay < dayLimit && (oldSearches.length < 5 || listLength)){\r\n \r\n var slist;\r\n if (value.every(val => oldSearches.includes(val))){\r\n slist = oldSearches.filter(item => value.includes(item));\r\n defaultData['searches'] = oldSearches;\r\n }\r\n else {\r\n oldSearches = [...new Set([...oldSearches , ...value])];\r\n slist = value;\r\n defaultData['searches'] = oldSearches;\r\n oldDay += 1; oldMonth += 1; oldYear += 1;\r\n }\r\n\r\n defaultData['day'] = oldDay; defaultData['month'] = oldMonth; defaultData['year'] = oldYear;\r\n localStorage.setItem(SOURCE_DATA,JSON.stringify(defaultData));\r\n return [true, slist];\r\n }\r\n\r\n else {\r\n let slist = oldSearches.filter(item => value.includes(item));\r\n if (slist.length >= dayLimit || slist.length < value.length){\r\n return [false, slist];\r\n }\r\n else return [true, slist];\r\n }\r\n }\r\n\r\n else if(oldData['stamp'] < currStamp){\r\n return [false, value];\r\n }\r\n\r\n else {\r\n return [false, []]\r\n }\r\n}\r\n\r\n// function to reset timestamp with correct values in localStorage\r\nexport function needReset(){\r\n\r\n if (oldData['stamp'] < currStamp){\r\n if (currStamp.slice(0,4) > oldData['stamp'].slice(0,4)){\r\n oldData['stamp'] = currStamp;\r\n oldSearches = []; oldYear = 0; oldMonth = 0; oldDay= 0;\r\n localStorage.setItem(SOURCE_DATA,JSON.stringify(defaultData));\r\n }\r\n\r\n else if (currStamp.slice(4,6) > oldData['stamp'].slice(4,6)){\r\n oldData['stamp'] = currStamp;\r\n oldSearches = []; oldMonth = 0; oldDay= 0;\r\n defaultData['year'] = oldData['year'];\r\n localStorage.setItem(SOURCE_DATA,JSON.stringify(defaultData));\r\n }\r\n\r\n else if (currStamp.slice(6,8) > oldData['stamp'].slice(6,8)){\r\n oldData['stamp'] = currStamp;\r\n oldSearches = []; oldDay= 0;\r\n defaultData['month'] = oldData['month'];\r\n defaultData['year'] = oldData['year'];\r\n localStorage.setItem(SOURCE_DATA,JSON.stringify(defaultData));\r\n }\r\n }\r\n\r\n else if (oldData['stamp'] > currStamp){\r\n alert(\"This incident has been reported. Please pay for membership.\");\r\n }\r\n}","import React from \"react\";\r\nimport { Form, Button, Select, Radio, Switch, Slider, Drawer, Col, Row, Checkbox, Tooltip} from \"antd\";\r\nimport { CloseOutlined, CheckOutlined, FilterOutlined, UndoOutlined } from \"@ant-design/icons\";\r\nimport { mediaType, enableValues, locationOptions, dynamicSort, unlimitedSearchParameter } from \"./utils\";\r\nimport \"./ControlsForm.less\";\r\nimport { canAccess, needReset } from \"./searchControl.js\";\r\n\r\nconst { Option } = Select;\r\nclass ControlsForm extends React.Component {\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n this.state ={\r\n visible: false,\r\n defaultFormValues: {\r\n allSources: true,\r\n displayArticles: true,\r\n sources: [],\r\n location: null,\r\n countrySelection: false,\r\n stateSelection: false,\r\n locationCountry: [],\r\n locationState:[],\r\n rangeReliability: [0, 64],\r\n rangeBias: [-42, 42],\r\n mediaType: mediaType,\r\n ownership: null,\r\n }\r\n }\r\n }\r\n\r\n componentDidMount(){\r\n needReset();\r\n }\r\n\r\n formRef = React.createRef();\r\n \r\n showDrawer = () => {\r\n this.setState({\r\n visible: true,\r\n });\r\n };\r\n\r\n onClose = () => {\r\n this.setState({\r\n visible: false,\r\n });\r\n };\r\n\r\n onSourcesChange = (value) => {\r\n if (value) {\r\n this.formRef.current.setFieldsValue({\r\n allSources: false,\r\n displayArticles: true\r\n });\r\n \r\n if (!unlimitedSearchParameter()){\r\n let [tf, slist] = canAccess(value,\"free\");\r\n this.formRef.current.setFieldsValue({\r\n sources: slist,\r\n });\r\n if(!tf){\r\n this.props.setModalVisible(\"general_modal\",true);\r\n }\r\n }\r\n }\r\n this.onFinish();\r\n };\r\n\r\n onLocationChange = ({ target: { value } }) => {\r\n if (value) {\r\n this.formRef.current.setFieldsValue({\r\n allSources: false,\r\n displayArticles: true,\r\n ownership: null\r\n });\r\n }\r\n\r\n if (value === \"International\"){\r\n this.setState({countrySelection: true, stateSelection: false});\r\n this.formRef.current.setFieldsValue({locationState: []});\r\n }\r\n else if (value === \"Local\"){\r\n this.setState({countrySelection: false, stateSelection: true});\r\n this.formRef.current.setFieldsValue({locationCountry: []});\r\n }\r\n else {\r\n this.setState({countrySelection: false, stateSelection: false});\r\n this.formRef.current.setFieldsValue({locationCountry: [], locationState: []});\r\n }\r\n\r\n this.onFinish();\r\n };\r\n\r\n locationCountryChange = () => this.onFinish();\r\n\r\n locationStateChange = () => this.onFinish();\r\n\r\n ownershipChange = (value) => {\r\n if (value) {\r\n this.formRef.current.setFieldsValue({\r\n allSources: false,\r\n displayArticles: true,\r\n location: null,\r\n locationCountry: [],\r\n locationState: []\r\n });\r\n this.setState({countrySelection: false, stateSelection: false});\r\n }\r\n this.onFinish();\r\n };\r\n\r\n onFinish = () => {\r\n this.props.formSubmit(this.formRef.current.getFieldsValue());\r\n };\r\n\r\n onReset = () => {\r\n this.setState({countrySelection: false, stateSelection: false, citySelection: false});\r\n this.formRef.current.resetFields();\r\n this.props.chartReset();\r\n this.onFinish();\r\n };\r\n\r\n componentDidUpdate(prevProps) {\r\n if(prevProps.removedSources.length !== this.props.removedSources.length\r\n || prevProps.sources.length !== this.props.sources.length\r\n ) {\r\n this.formRef.current.setFieldsValue({\r\n sources: this.formRef.current.getFieldValue(\"sources\").filter(\r\n (source) => !this.props.removedSources.find(\r\n removedSource => removedSource.moniker_name === source\r\n )\r\n )\r\n })\r\n this.onFinish();\r\n }\r\n }\r\n\r\n render() {\r\n\r\n const { sources, countries, states, chartLoading, ownership } = this.props;\r\n\r\n var mediaTypeOptions = [\r\n {label: 'Website / Articles', value: 2, disabled: !enableValues[1]},\r\n {label: 'TV / Video', value: 3, disabled: !enableValues[2]},\r\n {label: 'Podcast / Audio', value: 4, disabled: !enableValues[3]},\r\n ];\r\n\r\n let formSources = [];\r\n\r\n if (this.formRef.current) {\r\n formSources = this.formRef.current.getFieldValue(\"sources\");\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n {sources\r\n .filter((o) => !formSources.includes(o.moniker_name))\r\n .filter(\r\n (source) => !this.props.removedSources.find(\r\n removedSource => removedSource.moniker_name === source.moniker_name\r\n )\r\n )\r\n .sort(dynamicSort(\"moniker_name\"))\r\n .map((source) => (\r\n \r\n ))\r\n }\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n Filters\r\n \r\n \r\n\r\n \r\n Reset\r\n \r\n\r\n \r\n \r\n \r\n \r\n }\r\n unCheckedChildren={}\r\n onChange={this.onFinish}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {this.state.countrySelection ? \r\n \r\n \r\n \r\n { countries ? \r\n Object.entries(countries).map(([key,value]) => (\r\n \r\n ))\r\n : \r\n }\r\n \r\n \r\n \r\n : null }\r\n {this.state.stateSelection ? \r\n \r\n \r\n \r\n { states ? \r\n Object.entries(states).map(([key,value]) => (\r\n \r\n ))\r\n : \r\n }\r\n \r\n \r\n \r\n : null }\r\n \r\n \r\n \r\n \r\n \r\n { ownership ? \r\n Object.entries(ownership).map(([key,value]) => (\r\n \r\n ))\r\n : \r\n }\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default ControlsForm;\r\n","import { useRef } from 'react';\r\nimport { Menu } from 'antd'\r\n\r\nimport { useOutsideClick } from './utils/hooks/handleOutsideClick';\r\nimport './ContextMenu.less';\r\n\r\n\r\nconst ContextMenu = ({ show, onClose, onRemove }) => {\r\n const wrapperRef = useRef(null);\r\n useOutsideClick(wrapperRef, onClose);\r\n\r\n const handleRemove = (e) => {\r\n onRemove();\r\n onClose();\r\n }\r\n\r\n if (!show) {\r\n return null;\r\n }\r\n\r\n return (\r\n
\r\n \r\n Remove\r\n Close\r\n \r\n
\r\n )\r\n}\r\n\r\nexport default ContextMenu;","import { useEffect } from \"react\";\r\n\r\nexport function useOutsideClick(ref, handler) {\r\n useEffect(() => {\r\n function handleClickOutside(event) {\r\n if (ref.current && !ref.current.contains(event.target)) {\r\n handler();\r\n }\r\n }\r\n // Bind the event listener\r\n document.addEventListener(\"mousedown\", handleClickOutside);\r\n return () => {\r\n // Unbind the event listener on clean up\r\n document.removeEventListener(\"mousedown\", handleClickOutside);\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [ref]);\r\n}","import * as utils from '../utils';\r\n\r\nexport const getIncludedExcludedSources = (state, withExcluded = false) => {\r\n\r\n const { formValues, sources } = state;\r\n const { rangeBias, rangeReliability, mediaType, locationCountry } = formValues;\r\n\r\n let defaultSources, selectedSources;\r\n let includedSources, excludedSources;\r\n\r\n\r\n if (mediaType?.length) {\r\n let filteredMedia = utils.mediaType.filter((type) => mediaType.includes(type));\r\n selectedSources = sources.filter((source) => filteredMedia.includes(source.mediatype));\r\n } else {\r\n selectedSources = [];\r\n }\r\n\r\n defaultSources = selectedSources;\r\n includedSources = defaultSources ;\r\n\r\n if (formValues.sources.length > 0) {\r\n includedSources = selectedSources\r\n .filter(\r\n (source) => formValues.sources.includes(source.moniker_name)\r\n );\r\n }\r\n\r\n if (formValues.ownership !== null){\r\n includedSources = selectedSources.filter((source) => source.ownership.includes(formValues.ownership));\r\n }\r\n\r\n if (formValues.location !== null) {\r\n includedSources = defaultSources.filter((source) =>\r\n formValues.location === source.coverage);\r\n }\r\n\r\n //filter country selection if available\r\n if (Array.isArray(locationCountry) && locationCountry.length && formValues.location === \"International\"){\r\n includedSources = defaultSources.filter((source) =>\r\n formValues.locationCountry.includes(source.location.country.name)\r\n );\r\n }\r\n\r\n //filter country selection if available\r\n if(Array.isArray(formValues.locationState) && formValues.locationState.length && formValues.location === \"Local\"){\r\n includedSources = defaultSources.filter((source) =>\r\n formValues.locationState.includes(source.location.state.name)\r\n );\r\n }\r\n\r\n if (\r\n (rangeReliability[0] !== 0 || rangeReliability[1] !== 64) ||\r\n (rangeBias[0] !== -42 || rangeBias[1] !== 42)\r\n ) {\r\n\r\n includedSources = includedSources\r\n .filter(\r\n (source) => source.reliability_mean >= rangeReliability[0] && \r\n source.reliability_mean <= rangeReliability[1]\r\n )\r\n .filter(\r\n (source) => source.bias_mean >= rangeBias[0] &&\r\n source.bias_mean <= rangeBias[1]\r\n );\r\n }\r\n\r\n includedSources = includedSources\r\n .filter(\r\n (source) => !state.removedSources.find(\r\n removedSource => removedSource.moniker_name === source.moniker_name\r\n )\r\n )\r\n if(!withExcluded) {\r\n return { includedSources };\r\n }\r\n\r\n excludedSources = defaultSources\r\n .filter(\r\n (el) => !includedSources.includes(el)\r\n );\r\n return { includedSources, excludedSources };\r\n}\r\n","import React from \"react\";\r\nimport axios from \"axios\";\r\nimport HubspotForm from 'react-hubspot-form'\r\nimport * as d3 from \"d3\";\r\nimport * as canvg from \"canvg\";\r\nimport * as utils from \"./utils\";\r\nimport { cleanArticles } from \"./calculation\";\r\nimport \"./App.less\";\r\nimport { Chart, width, height } from \"./chart\";\r\nimport ControlsForm from \"./ControlsForm\";\r\n\r\nimport { mediaType } from \"./utils\";\r\nimport { Button, Tooltip, Spin, Modal } from \"antd\";\r\nimport { DownloadOutlined, LoadingOutlined } from '@ant-design/icons';\r\nimport ContextMenu from \"./ContextMenu\";\r\nimport * as ChartUtils from './utils/chart';\r\n\r\nconst antIcon = ;\r\nclass App extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n isLoading: false,\r\n dimensions: { top: 0, left: 0 },\r\n showGeneralModal: false,\r\n chartLoading: false,\r\n sources: [],\r\n articles: [],\r\n showContextMenu: false,\r\n selectedSource: null,\r\n removedSources: [],\r\n formValues: {\r\n allSources: true,\r\n displayArticles: true,\r\n sourceReach: false,\r\n sources: [],\r\n countries: [],\r\n states: [],\r\n rangeReliability: [0, 64],\r\n rangeBias: [-42, 42],\r\n rangeAudience:[0,268325000],\r\n mediaType: mediaType\r\n }\r\n };\r\n }\r\n\r\n callAPI = async () => {\r\n \r\n let aam_member_id = utils.aamMember();\r\n\r\n try {\r\n\r\n let API_ENDPOINT = \"/api_aam/0/\"\r\n if (aam_member_id){\r\n API_ENDPOINT = \"/api_aam/\" + String(aam_member_id) + \"/\"\r\n }\r\n const { data } = await axios.get(API_ENDPOINT);\r\n const { articles, sources, countries, usa_states, ownership } = cleanArticles(data);\r\n \r\n // deleting country 233: United States of America\r\n delete countries['233'];\r\n \r\n this.setState({chartLoading: true, sources: sources, articles: articles, countries: countries, states: usa_states, ownership: ownership});\r\n this.chart = new Chart(articles, sources, true, this.handleClickContextMenu);\r\n this.chart.create();\r\n }\r\n catch (err) {\r\n console.log(\"Data Error! : \",err);\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n this.callAPI();\r\n }\r\n\r\n formSubmit(values) {\r\n this.setState(\r\n {\r\n formValues: values,\r\n },\r\n () => this.drawChart()\r\n );\r\n }\r\n\r\n drawChart() {\r\n ChartUtils.draw(this.chart, this.state);\r\n }\r\n\r\n chartReset() {\r\n this.setState({ removedSources: []});\r\n this.chart.reset();\r\n }\r\n\r\n dataExport() {\r\n ChartUtils.exportFilteredSources(this.state);\r\n }\r\n\r\n handleClickContextMenu = (data) => {\r\n this.setState({\r\n showContextMenu: true,\r\n selectedSource: data,\r\n });\r\n }\r\n\r\n handleCloseContextMenu = () => {\r\n this.setState({ showContextMenu: false });\r\n }\r\n\r\n handleRemoveSource = () => {\r\n this.setState({\r\n removedSources: [...this.state.removedSources, this.state.selectedSource],\r\n },\r\n this.drawChart);\r\n }\r\n\r\n handleResetRemovedSources = () => {\r\n this.setState({\r\n removedSources: [],\r\n });\r\n }\r\n\r\n handleClickDownload(ob) {\r\n if(utils.downloadParameter()){\r\n if(ob === \"image\"){\r\n this.download();\r\n }\r\n else if(ob === \"data\"){\r\n this.dataExport();\r\n }\r\n }\r\n else{\r\n this.setModalVisible(\"general_modal\",true);\r\n }\r\n }\r\n\r\n handleZoom(type) {\r\n this.chart.clickZoom(type);\r\n }\r\n\r\n async download() {\r\n this.setState({ isLoading: true });\r\n\r\n var canvas = document.createElement(\"canvas\");\r\n canvas.style = \"display: none\";\r\n canvas.width = width * 2;\r\n canvas.height = height * 2;\r\n document.body.appendChild(canvas);\r\n let ctx = canvas.getContext(\"2d\");\r\n ctx.fillStyle = \"#fff\";\r\n ctx.fillRect(0, 0, canvas.width, canvas.height);\r\n\r\n let svg = d3.select(\".chart\").node(),\r\n serializer = new XMLSerializer(),\r\n svgStr = serializer.serializeToString(svg);\r\n\r\n let v = await canvg.Canvg.fromString(ctx, svgStr, {\r\n anonymousCrossOrigin: true,\r\n ignoreClear: true,\r\n });\r\n await v.render();\r\n\r\n var lnk = document.createElement(\"a\");\r\n lnk.download = `chart_${new Date().toLocaleString()}.png`;\r\n lnk.href = canvas.toDataURL(\"image/png;base64\");\r\n lnk.click();\r\n\r\n canvas.remove();\r\n this.setState({ isLoading: false });\r\n\r\n }\r\n\r\n setModalVisible(modal_id, value) {\r\n if (modal_id === \"general_modal\"){\r\n this.setState({showGeneralModal: value});\r\n }\r\n }\r\n\r\n render() {\r\n const { chartLoading, isLoading, sources, countries, states, articles, removedSources, ownership } = this.state;\r\n return (\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
Controls
\r\n
\r\n \r\n \r\n \r\n }\r\n className=\"downloadButton\"\r\n onClick={() => this.handleClickDownload(\"image\")}\r\n loading={isLoading}\r\n disabled={!chartLoading}\r\n >\r\n Image\r\n \r\n \r\n \r\n \r\n }\r\n className=\"downloadButton\"\r\n onClick={() => this.handleClickDownload(\"data\")}\r\n loading={isLoading}\r\n disabled={!chartLoading}\r\n >\r\n Data\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n\r\n this.setModalVisible(\"general_modal\",false)}\r\n footer={null}\r\n >\r\n console.log('Submit!')}\r\n onReady={(form) => console.log('Form ready!')}\r\n loading={
Loading...
}\r\n />\r\n {/*
*/}\r\n \r\n\r\n
\r\n
\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default App;\r\n","import FileSaver from \"file-saver\";\r\nimport JSZip from \"jszip\";\r\nimport * as utils from '../utils';\r\n\r\nimport { getIncludedExcludedSources } from \"./filter\";\r\n\r\nexport const draw = (chart, state) => {\r\n if (!chart) {\r\n return;\r\n }\r\n const { formValues, articles } = state;\r\n const { sourceReach, displayArticles } = formValues;\r\n let includedArticles;\r\n const { includedSources } = getIncludedExcludedSources(state, false);\r\n const includedSourceNames = includedSources.map((source) => source.moniker_name);\r\n\r\n // Article select\r\n if (!displayArticles) {\r\n includedArticles = [];\r\n }\r\n else {\r\n includedArticles = articles\r\n .filter(\r\n (article) => includedSourceNames.includes(article.moniker_name)\r\n );\r\n }\r\n chart.update(includedArticles, includedSources, sourceReach, displayArticles);\r\n}\r\n\r\nexport const exportFilteredSources = (state) => {\r\n const { articles } = state;\r\n\r\n let includedSourcesName, excludedSourcesName;\r\n let includedContentPieces, excludedContentPieces;\r\n let { includedSources, excludedSources } = getIncludedExcludedSources(state, true);\r\n includedSourcesName = includedSources\r\n .map(\r\n (source) => source.moniker_name\r\n );\r\n\r\n excludedSourcesName = excludedSources\r\n .map(\r\n (source) => source.moniker_name\r\n );\r\n\r\n includedContentPieces = articles\r\n .filter(\r\n (article) => includedSourcesName.includes(article.moniker_name)\r\n );\r\n\r\n excludedContentPieces = articles\r\n .filter(\r\n (article) => excludedSourcesName.includes(article.moniker_name)\r\n );\r\n\r\n\r\n // create final list of required columns for source csv\r\n includedSources = includedSources\r\n .map(({moniker_name, domain, bias_mean, reliability_mean, bias_label,reliability_label, mediatype, coverage, location}) =>\r\n `\\n\"${moniker_name}\",${domain},${bias_mean.toFixed(2)},${reliability_mean.toFixed(2)},${bias_label},${reliability_label},${utils.getKeyByValue(utils.mediaName,mediatype)},${coverage},${location.country.name},${location.state.name}`\r\n );\r\n\r\n excludedSources = excludedSources\r\n .map(({moniker_name, domain, bias_mean, reliability_mean, bias_label,reliability_label, mediatype, coverage, location}) =>\r\n `\\n\"${moniker_name}\",${domain},${bias_mean.toFixed(2)},${reliability_mean.toFixed(2)},${bias_label},${reliability_label},${utils.getKeyByValue(utils.mediaName,mediatype)},${coverage},${location.country.name},${location.state.name}`);\r\n\r\n includedContentPieces = includedContentPieces.map(({moniker_name, url, bias, reliability}) => {\r\n return `\\n\"${moniker_name}\",\"${url}\",${bias},${reliability}`;\r\n });\r\n excludedContentPieces = excludedContentPieces.map(({moniker_name, url, bias, reliability}) => {\r\n return `\\n\"${moniker_name}\",\"${url}\",${bias},${reliability}`;\r\n });\r\n\r\n // add content heading\r\n includedContentPieces.unshift(\"source,url,bias,reliability\");\r\n excludedContentPieces.unshift(\"source,url,bias,reliability\");\r\n\r\n includedSources.unshift(\"source,domain,bias,reliability,bias label,reliability label,media type,location,country,state\");\r\n excludedSources.unshift(\"source,domain,bias,reliability,bias label,reliability label,media type,location,country,state\");\r\n \r\n // create blob of csv from arrays\r\n const includedSourcesBlob = new Blob([includedSources], {type: 'text/csv'});\r\n const excludedSourcesBlob = new Blob([excludedSources], {type: 'text/csv'});\r\n const includedContentPiecesBlob = new Blob([includedContentPieces], {type: 'text/csv'});\r\n const excludedContentPiecesBlob = new Blob([excludedContentPieces], {type: 'text/csv'});\r\n\r\n // zip all blobs into single zip blob\r\n let zip = new JSZip();\r\n zip.file(\"Included_Sources.csv\",includedSourcesBlob);\r\n zip.file(\"Excluded_Sources.csv\",excludedSourcesBlob);\r\n zip.file(\"Included_Content_Pieces.csv\",includedContentPiecesBlob);\r\n zip.file(\"Excluded_Content_Pieces.csv\",excludedContentPiecesBlob);\r\n\r\n zip.generateAsync({type: \"blob\"}).then((content) => {\r\n FileSaver.saveAs(content, `Chart_Data_Export_${new Date().toString().replace(/ /gi, \"_\")}.zip`);\r\n })\r\n}","// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://bit.ly/CRA-PWA\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.0/8 are considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\nexport function register(config) {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n console.log(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl, config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then(registration => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.log(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch(error => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl, config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl, {\r\n headers: { 'Service-Worker': 'script' },\r\n })\r\n .then(response => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (\r\n response.status === 404 ||\r\n (contentType != null && contentType.indexOf('javascript') === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then(registration => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready\r\n .then(registration => {\r\n registration.unregister();\r\n })\r\n .catch(error => {\r\n console.error(error.message);\r\n });\r\n }\r\n}\r\n","import React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport \"./index.less\";\r\nimport App from \"./App\";\r\nimport * as serviceWorker from \"./serviceWorker\";\r\n\r\nReactDOM.render(, document.getElementById(\"root\"));\r\n\r\n// If you want your app to work offline and load faster, you can change\r\n// unregister() to register() below. Note this comes with some pitfalls.\r\n// Learn more about service workers: https://bit.ly/CRA-PWA\r\nserviceWorker.unregister();\r\n"],"sourceRoot":""}