diff --git a/src/components/CibTable.svelte b/src/components/CibTable.svelte new file mode 100644 index 0000000..4bebcf8 --- /dev/null +++ b/src/components/CibTable.svelte @@ -0,0 +1,95 @@ + + +
+ + + + {#each cibColumnHeaders as { id, name } (id)} + + {/each} + + + + {#each cibTableFields as field (field.id)} + + {#each cibColumnHeaders as { id, type } (id)} + + {/each} + + {/each} + +
{name}
+ {#if (type === 'platformName')} + + {:else if (type === 'fieldName')} + {field[type]} + {:else if (data[field[type]] !== undefined)} + {commaFormat(data[field[type]])} + {/if} +
+
+ {#if (data.budgetTotalUsd && data.budgetTotalUsd > 0)} +

The Facebook activities required a budget of USD {commaFormat(data.budgetTotalUsd)}.

+ {/if} +
+
+ + diff --git a/src/components/EventTooltip.svelte b/src/components/EventTooltip.svelte index 20261eb..3f72341 100644 --- a/src/components/EventTooltip.svelte +++ b/src/components/EventTooltip.svelte @@ -22,6 +22,7 @@ import ScoreQuestions from './ScoreQuestions.svelte'; import ImpactStrip from './ImpactStrip.svelte'; import PolarizationLegend from './PolarizationLegend.svelte'; + import CibTable from './CibTable.svelte'; import Share from './Share.svelte'; const offset = { @@ -207,6 +208,12 @@

Description

{@html highlight($tooltip.tp.shortDescription)}

+ {#if ($tooltip.tp.cib.hasCib)} +
+

Removed content

+ +
+ {/if} {#if (!($tooltip.tp.tags.length === 1 && $tooltip.tp.tags[0] === 'unspecified'))}

Tags

diff --git a/src/components/TopVisualContent.svelte b/src/components/TopVisualContent.svelte index d69e722..091ef7e 100644 --- a/src/components/TopVisualContent.svelte +++ b/src/components/TopVisualContent.svelte @@ -5,7 +5,9 @@ contextData, sourceFilter, attributionScoreFilter, - selectAllFilters } from '../stores/filters'; + selectAllFilters, + highlightPolarization, + highlightCib } from '../stores/filters'; import { format, timeFormat } from 'd3'; import { drawWrapper } from '../stores/elements'; import { copytooltipable } from '../actions/copytooltipable'; @@ -19,6 +21,8 @@ function handleApplyFilter(id) { selectAllFilters(); contextData.unselectAll(); + $highlightPolarization = false; + $highlightCib = false; switch (id) { case 0: disinformantNationFilter.selectOne('China'); diff --git a/src/components/Visualization.svelte b/src/components/Visualization.svelte index 36b5871..cd84056 100644 --- a/src/components/Visualization.svelte +++ b/src/components/Visualization.svelte @@ -153,7 +153,6 @@ $: setScales(data, $width, $minDim, $maxDim, $panelHeight, $margin); $: if (data) { - console.log(data.filter((d) => d.cib.hasCib)); // calculate scaled data points const scaledData = data.map((d) => ({ ...d, diff --git a/src/inputs/cib.js b/src/inputs/cib.js new file mode 100644 index 0000000..89292bc --- /dev/null +++ b/src/inputs/cib.js @@ -0,0 +1,51 @@ +export const cibTableFields = [ + { + number: 'accountsTotalFb', + followers: null, + platformName: 'Facebook', + fieldName: 'Accounts' + }, + { + number: 'pagesTotalFb', + followers: 'pagesFollowersTotalFb', + platformName: 'Facebook', + fieldName: 'Pages' + }, + { + number: 'groupsTotalFb', + followers: 'groupsFollowersTotalFb', + platformName: 'Facebook', + fieldName: 'Groups' + }, + { + number: 'eventsTotal', + followers: null, + platformName: 'Facebook', + fieldName: 'Events' + }, + { + number: 'accountsTotalIg', + followers: 'followersTotalIg', + platformName: 'Instagram', + fieldName: 'Accounts' + } +].map((d, i) => ({id: i, ...d})); + +export const cibColumnHeaders = [ + { + name: '', + type: 'platformName' + }, + { + name: '', + type: 'fieldName' + }, + { + name: 'Entities', + type: 'number' + }, + { + name: 'Followers', + type: 'followers' + } +].map((d, i) => ({id: i, ...d}));