(function ($) { // Constants const datasetInfo = { "femicides/rai": "This dataset consists of news reports and metadata about femicides (i.e., murders in which the perpetrator, often a partner or ex-partner, kills a woman because of her gender) perpetrated in Italy between 2015-2017. The dataset has been compiled by the research unit of national public broadcaster RAI in collaboration with a team of sociologists. The news reports come from a variety of national and regional news outlets. Because of the rich set of available metadata (only a small part of which is, as of now, available in this tool), newspaper reports that report the same femicide can be linked, allowing for investigating how one and the same event is framed in different news reports, and how framing changes over time.", "femicides/olv": "This dataset consists of news reports and metadata about femicides (i.e., murders in which the perpetrator, often a partner or ex-partner, kills a woman because of her gender) perpetrated in Italy between 2012-2019. The dataset consists of a set of case summaries and metadata (see https://27esimaora.corriere.it/la-strage-delle-donne/) compiled by journalists of Corriere della Sera, a major national newspaper, and a set of newspaper articles from several national newspapers mentioning these cases (automatically matched based on victim names).", "migration/pavia": "This dataset consists of immigration-related news articles in Italy published between 2013-2021, collected by the Osservatorio di Pavia media research organization (https://www.osservatorio.it/) ", "crashes/thecrashes": "This dataset consists of news articles in Dutch-language news outlets (mostly regional Dutch and Belgian newspapers) describing traffic crashes, together with metadata about the events. This dataset is developed by researchers at the University of Amsterdam, in with journalists at The Correspondent, and is publically available at https://nl.roaddanger.org/." }; const datasetFrameInfo = { "femicides/rai": "For investigating the conceptualization of femicides in the media, we have created three clusters of frames. The most important one, 'murder', comprises frames that describe the act of murder itself in various degrees of agentivity (KILLING implies an active agent, DEATH and DEAD_OR_ALIVE describe the death of the victim, and CATASTROPHE and EVENT present the murders as abstract events or tragedies).", "femicides/olv": "For investigating the conceptualization of femicides in the media, we have created three clusters of frames. The most important one, 'murder', comprises frames that describe the act of murder itself in various degrees of agentivity (KILLING implies an active agent, DEATH and DEAD_OR_ALIVE describe the death of the victim, and CATASTROPHE and EVENT present the murders as abstract events or tragedies).", "migration/pavia": "Several clusters of frames were created, reflecting different aspects of media coverage on migration, including the depiction of migrants as quantities ('a tsunami of migrants'), political aspects of migration, and integration of migrants into society.", "crashes/thecrashes": "We defined a single cluster of frames that conceptualize several salient properties of traffic crashes, both from an agent/cause-centered perspective (KILLING, CAUSE_HARM) and from a non-agentive perspective (EVENT, EXPERIENCE_BODILY_HARM)" }; /* === GLOBAL OBJECTS === */ /* --- global data/parameters --- */ // active dataset & model let activeDataset = "femicides/olv"; // should be one of: "femicides/rai", "femicides/olv", "crashes/thecrashes", "migration/pavia" let activeLomeModel = "lome_0shot"; // should be one of: "lome_0shot", "lome_evalita_plus_fn", "lome_zs-tgt_ev-frm" // list of relevant frames let relevantFrameCluster = "ALL"; let relevantFrames = {}; // list of active filters let activeEventFilters = []; let activeDocumentFilters = []; // set of filters listed in the table let tableFilters = new Set(); /* --- global jQuery objects --- */ // div for writing the output const $framesOut = $("#frames-out"); // list of relevant frames (buttons) const $frameList = $("#frame-list"); // list of possible documents const $documentList = $("#document-list"); // statistics table rows const $tableModalRows = $("#table-modal-rows"); // Which filters apply to which datasets? const filtersToDatasets = { "#doc-filter-days-after": ["rai", "olv", "thecrashes"], "#doc-filter-provider": ["rai", "olv", "thecrashes", "pavia"], "#doc-filter-politics-unipv": ["rai"], "#doc-filter-politics-tc": ["rai"], "#doc-filter-politics-agg": ["rai"], "#doc-filter-politics-sc": ["pavia"], "#doc-filter-religion-sc": ["pavia"], "#doc-filter-type": ["rai"], "#doc-filter-area": ["rai", "thecrashes"], "#doc-filter-country": ["thecrashes"], "#doc-filter-province": ["thecrashes"], "#doc-filter-content-type": ["thecrashes"], "#doc-filter-medium-type": ["thecrashes"], "#doc-filter-owner": ["thecrashes"], "#ev-filter-event-cat": ["rai"], "#ev-filter-region": ["rai", "olv"], "#ev-filter-semloc": ["rai"], "#ev-filter-vict-age": ["rai", "olv"], "#ev-filter-vict-nat": ["rai"], "#ev-filter-injured-total": ["thecrashes"], "#ev-filter-injured-child": ["thecrashes"], "#ev-filter-injured-pedestrian": ["thecrashes"], "#ev-filter-injured-cyclist": ["thecrashes"], "#ev-filter-injured-cyclistpedestrian": ["thecrashes"], "#ev-filter-injured-vehicle": ["thecrashes"], "#ev-filter-dead-total": ["thecrashes"], "#ev-filter-dead-child": ["thecrashes"], "#ev-filter-dead-pedestrian": ["thecrashes"], "#ev-filter-dead-cyclist": ["thecrashes"], "#ev-filter-dead-cyclistpedestrian": ["thecrashes"], "#ev-filter-dead-vehicle": ["thecrashes"], "#ev-filter-deadinjured-total": ["thecrashes"], "#ev-filter-deadinjured-child": ["thecrashes"], "#ev-filter-deadinjured-pedestrian": ["thecrashes"], "#ev-filter-deadinjured-cyclist": ["thecrashes"], "#ev-filter-deadinjured-cyclistpedestrian": ["thecrashes"], "#ev-filter-deadinjured-vehicle": ["thecrashes"], "#ev-filter-imbalanced": ["thecrashes"], "#ev-filter-att-nat": ["rai"], "#ev-filter-vict-occ": ["rai"], "#ev-filter-att-occ": ["rai"] } /* === FUNCTIONS: GETTING DATA FROM THE FLASK API === */ /* --- static data for feeding the option menus --- */ function getPossibleConstructions() { const $constructionSampleList = $("#construction-sample-list, #construction-freq-select"); $constructionSampleList.empty(); $constructionSampleList.append($("