{"version":3,"sources":["src/_scripts/node_modules/browser-pack/_prelude.js","src/_scripts/src/_modules/common/collapsible-box/collapsible-box.js","src/_scripts/main.js","src/_scripts/src/_modules/common/header/header.js","src/_scripts/src/_modules/common/main-navigation/main-navigation.js","src/_scripts/src/_modules/common/page-scroll/page-scroll.js","src/_scripts/src/_modules/common/tab-box/tab-box.js","src/_scripts/src/_modules/common/title-bar/title-bar.js","src/_scripts/src/_modules/data/chartblock/chartblock.js","src/_scripts/src/_modules/data/table/table.js","src/_scripts/src/_modules/data/table/table.section1.js","src/_scripts/src/_modules/data/table/table.section4.js","src/_scripts/src/_modules/data/table/table.section5.js","src/_scripts/src/_modules/home/header/header.js","src/_scripts/src/_modules/home/slide1/slide1.js","src/_scripts/src/_modules/home/slide2/slide2.js","src/_scripts/src/_modules/home/slide3/slide3.js","src/_scripts/src/_modules/home/slide4/slide4.js","src/_scripts/src/_modules/home/slide5/slide5.js","src/_scripts/src/_modules/home/slider/slider.js","src/_scripts/src/_modules/home/slides/slides.js","src/_scripts/src/_scripts/main.js"],"names":["r","e","n","t","o","i","f","c","require","u","a","Error","code","p","exports","call","length","1","module","CollapsibleBox","$","click","$event","preventDefault","this","closest","toggleClass","2","CommonHeader","waypoint","$direction","removeClass","addClass","offset","3","MainNavigation","nanoScroller","on","hasClass","$height_substractor","window","innerWidth","siblings","html","$level2_height","height","setTimeout","$level3_height","4","PageScroll","getUrlParam","parameter","defaultvalue","urlparameter","location","href","indexOf","getUrlVars","getUrlBookmark","url","$id","substring","vars","replace","m","key","value","animate","scrollTop","top","console","log","attr","5","TabBox","find","data","6","TitleBar","$url","encodeURIComponent","origin","pathname","text","print","width","left","screen","open","7","charts_collection","dataset_collection","labels_collection","original_labels","Chartblock","makeid","possible","charAt","Math","floor","random","formatLabel","str","maxwidth","$y_axis_leading_zero","toString","sections","words","split","temp","forEach","item","index","concat","push","colorCodes","$color_codes","$legend_box_width","$legend_padding","$legend_font_size","each","$header","$container","original","Chart","defaults","global","legend","onClick","$chart_reference","$configuration","$type","type","$x_axis","x_axis","$x_axis_label_show","x_axis_label","$x_axis_label_text","$y_axis_label_show","y_axis_label","$y_axis_label_text","$y_axis","y_axis","y_axis_leading_zero","$y_axis_suffix","y_axis_suffix","$y_axis_is_year","y_axis_is_year","$y_raw","y_raw","$x_axis_is_year","x_axis_is_year","$x_axis_no_percentage","x_axis_no_percentage","$x_gridlines","x_gridlines","$y_gridlines","y_gridlines","$legend","$legend_position","legend_position","$single_color","single_color","$label_font_size","label_font_size","$show_data_labels","show_data_labels","$padding_right","padding_right","$padding_left","padding_left","$bar_line_height","bar_line_height","$tooltip_show_currency","tooltip_show_currency","$tooltip_show_percentage","tooltip_show_percentage","$tooltip_hide_value","tooltip_hide_value","$tooltip_number_format","tooltip_number_format","$tooltip_decimal","tooltip_decimal","$disable_filter","disable_filter","$chart_stack","chart_stack","$external_filter","external_filter","$max_initial_dataset","max_initial_dataset","$groupped_first_col","groupped_first_col","$special_mix_chart","special_mix_chart","$always_show_value","always_show_value","$always_show_positive","always_show_positive","Papa","parse","download","dynamicTyping","skipEmptyLines","complete","$json","header","shift","$dataset","$groups","$labels","$labels_groupped","$labels_total_line","$max_width","$index","$value","$group","$label","$key","$number","Number","$color_index","label","backgroundColor","borderColor","parseFloat","group","$formatted_label","constructor","Array","$dataset_clone","$data","$chart_height","css","parseInt","getContext","labels","datasets","options","responsive","elements","line","tension","maintainAspectRatio","layout","padding","right","bottom","tooltips","mode","callbacks","tooltipItem","dataLabel","datasetIndex","join","toLocaleString","toFixed","display","position","boxWidth","fontSize","fontFamily","filter","$item","$chartdata","stopPropagation","scales","xAxes","stacked","gridLines","ticks","fontColor","autoSkip","callback","values","$suffix","$divider","$largest","max","apply","scaleLabel","labelString","fontStyle","yAxes","barThickness","plugins","datalabels","color","align","anchor","font","weight","size","family","formatter","context","animation","onComplete","$image_print","toBase64Image","remove","append","$filter_html","$legend_html","$checked","hidden","$dataset_ref","$color","$data_value","$data_label","$label_text","before","after","change","getDatasetMeta","val","substr","slice","update","$this_chart_reference","$selected_groups","$raw_value","$list_of_selected_labels_index","$list_of_selected_labels","$label_index","$label_group","$filtered_dataset","$filtered_data","$data_label_index","$bar_thickness","$number_of_ticks_on_y","resize","error","$err","$file","$inputElem","$reason","$textfile","lastIndexOf","$error_message","ajax","done","replaceWith","fail","$error","hasOwnProperty","8","Table","$footer","$table_css_class","style","$decimal_places","decimal_places","raw_value","footer","pop","$html","$row","undefined","minimumFractionDigits","$cell","$columnsDefs","targets","visible","DataTable","9","TableSection1","$forgroup_class","$row_class","10","TableSection4","$table_counter","$tables","$forgroup_filter","$column_filters","$total_columns_index","$cell_class","toLowerCase","$forgroup","$forgroup_label","searchable","extend","background","backgroundClassName","buttons","container","appendTo","$table_target","search","draw","11","Tablesection5","getForFromURL","$vars","$forcode","$institutions","$disciplines","$highlight_column","$counter","$selected","$datatable","columns","every","adjust","$forFromURL","prop","12","Header","innerHeight","13","Slide1","14","Slide2","$counters","CountUp","useEasing","useGrouping","separator","decimal","prefix","suffix","start","15","Slide3","duration","lazy","easing","reset","16","Slide4","17","Slide5","18","Slider","$top","stop","19","Slides","onbeforeprint","event","document","body","scrollHeight","20","../_modules/common/collapsible-box/collapsible-box","../_modules/common/header/header","../_modules/common/main-navigation/main-navigation","../_modules/common/page-scroll/page-scroll","../_modules/common/tab-box/tab-box","../_modules/common/title-bar/title-bar","../_modules/data/chartblock/chartblock","../_modules/data/table/table","../_modules/data/table/table.section1","../_modules/data/table/table.section4","../_modules/data/table/table.section5","../_modules/home/header/header","../_modules/home/slide1/slide1","../_modules/home/slide2/slide2","../_modules/home/slide3/slide3","../_modules/home/slide4/slide4","../_modules/home/slide5/slide5","../_modules/home/slider/slider","../_modules/home/slides/slides"],"mappings":"CAAA,WAAA,QAAAA,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAA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,GAAAT,GACA,GAAAuD,GACA,GAAAvC,GACA,GAAAc,GACA,GAAA6B,GAEA,GAAAyU,GACA,GAAA8B,GACA,GAAA3B,GACA,GAAAE,GACA,GAAAW,GACA,GAAAM,GACA,GAAAE,GACA,GAAAE,OnB2xEGW,qDAAqD,EAAEC,mCAAmC,EAAEC,qDAAqD,EAAEC,6CAA6C,EAAEC,qCAAqC,EAAEC,yCAAyC,EAAEC,yCAAyC,EAAEC,+BAA+B,EAAEC,wCAAwC,EAAEC,wCAAwC,GAAGC,wCAAwC,GAAGC,iCAAiC,GAAGC,iCAAiC,GAAGC,iCAAiC,GAAGC,iCAAiC,GAAGC,iCAAiC,GAAGC,iCAAiC,GAAGC,iCAAiC,GAAGC,iCAAiC,UAAU","file":"scripts/main.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i 1600 ? 140 : 90;\r\n\r\n // Activate the sub menu and add the content\r\n if ($(this).siblings('.sub-menu').hasClass('sub-menu-2')) {\r\n if ($(this).siblings('.sub-menu').html().length > 0) {\r\n $('.main-navigation .level2').html($(this).siblings('.sub-menu').html()).addClass('active');\r\n } else {\r\n// $('.main-navigation .level2').html('

No Sub items

').addClass('active');\r\n }\r\n\r\n var $level2_height = $('.main-navigation .level2.active').height() - $('.main-navigation .level2.active h3').height() - $('.main-navigation .level2.active button').height() - $('.main-navigation .level2.active .overview-title').height() - $height_substractor;\r\n $(\".main-navigation .level2 .nano\").height($level2_height);\r\n $(\".main-navigation .level2 .nano\").nanoScroller();\r\n\r\n } else {\r\n if ($(this).siblings('.sub-menu').html().length > 0) {\r\n $('.main-navigation .level3').html($(this).siblings('.sub-menu').html()).addClass('active');\r\n } else {\r\n// $('.main-navigation .level3').html('

No Sub items

').addClass('active');\r\n }\r\n setTimeout(function () {\r\n var $level3_height = $('.main-navigation .level2.active').height() - $('.main-navigation .level2.active h3').height() - $('.main-navigation .level2.active button').height() - $('.main-navigation .level2.active .overview-title').height() - $height_substractor;\r\n $(\".main-navigation .level3 .nano\").height($level3_height);\r\n $(\".main-navigation .level3 .nano\").nanoScroller();\r\n }, 400);\r\n }\r\n\r\n });\r\n\r\n};\r\n\r\nmodule.exports = MainNavigation;\r\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\n// Constructor\nvar PageScroll = function () {\n if ($('main.introduction').length > 0) {\n var $id = getUrlParam('id', 'none');\n if ($('#' + $id).length) {\n $(\"html, body\").animate({ scrollTop: $('#' + $id).offset().top - 300 }, 1000);\n }\n }\n if ($('main.appendix').length > 0) {\n console.log('appendix');\n $(\"html, body\").animate({ scrollTop: 0 }, 0); // Scroll page to top\n setTimeout(function () {\n if ($id = getUrlBookmark()) {\n $('a[name=' + $id + ']').length ? $(\"html, body\").animate({ scrollTop: $('a[name=' + $id + ']').offset().top - 300 }, 1000) : '';\n }\n }, 100);\n\n\n $('main.appendix .text-block a[href^=\"#\"]').click(function ($event) {\n $event.preventDefault();\n var url = $(this).attr('href')\n var $id = url.substring(url.indexOf(\"#\") + 1);\n $('a[name=' + $id + ']').length ? $(\"html, body\").animate({ scrollTop: $('a[name=' + $id + ']').offset().top - 300 }, 1000) : '';\n });\n }\n\n function getUrlParam(parameter, defaultvalue) {\n var urlparameter = defaultvalue;\n if (window.location.href.indexOf(parameter) > -1) {\n urlparameter = getUrlVars()[parameter];\n }\n return urlparameter;\n }\n\n function getUrlBookmark() {\n var url = window.location.href;\n if (url.indexOf('#') > -1) {\n var $id = url.substring(url.indexOf(\"#\") + 1);\n return $id;\n }\n return false;\n }\n\n function getUrlVars() {\n var vars = {};\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {\n vars[key] = value;\n });\n return vars;\n }\n};\n\nmodule.exports = PageScroll;\n\n},{}],5:[function(require,module,exports){\n'use strict';\r\n\r\n// Constructor\r\nvar TabBox = function () {\r\n $('.tab-box .switch button').click(function ($event) {\r\n $event.preventDefault();\r\n $(this).closest('.tab-box').find('.tab-container').removeClass('active');\r\n $(this).closest('.tab-box').find('.switch button').removeClass('active');\r\n $(this).closest('.tab-box').find('.' + $(this).data('target')).addClass('active');\r\n $(this).addClass('active');\r\n\r\n $(this).closest('.collapsible-box').addClass('expanded'); // Makes it easier to just click the tab and it expands the box\r\n });\r\n};\r\n\r\nmodule.exports = TabBox;\r\n\n},{}],6:[function(require,module,exports){\n'use strict';\r\n\r\n// Constructor\r\nvar TitleBar = function () {\r\n\r\n var $url;\r\n\r\n $('.share-page a').click(function () {\r\n\r\n console.log(encodeURIComponent(window.location.origin + window.location.pathname));\r\n\r\n if ($(this).hasClass('facebook')) {\r\n $url = 'https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(window.location.origin + window.location.pathname);\r\n } else if ($(this).hasClass('twitter')) {\r\n $url = 'https://twitter.com/intent/tweet?url=' + encodeURIComponent(window.location.origin + window.location.pathname) + '&text=' + $('.title-bar h2').text();\r\n } else if ($(this).hasClass('print')) {\r\n window.print();\r\n return true;\r\n } else if ($(this).hasClass('email')) {\r\n $url = 'mailto:?subject=' + $('.title-bar h2').text() + '&body=' + window.location.origin + window.location.pathname;\r\n }\r\n\r\n var height = 300;\r\n var width = 500;\r\n var left = (screen.width / 2) - (width / 2);\r\n var top = (screen.height / 2) - (height / 2);\r\n\r\n window.open($url, \"\", \"menubar=no, toolbar=no, resizable=yes, scrollbars=yes, width=\" + width + \", height=\" + height + \", top=\" + top + \", left=\" + left);\r\n return true;\r\n })\r\n};\r\n\r\nmodule.exports = TitleBar;\r\n\n},{}],7:[function(require,module,exports){\n/* global Papa, $charts_collection */\r\n\r\n'use strict';\r\n\r\nwindow.charts_collection = {};\r\nwindow.dataset_collection = {};\r\nwindow.labels_collection = {};\r\nwindow.original_labels = {};\r\n\r\n// Constructor\r\nvar Chartblock = function () {\r\n var $legend_box_width = 20;\r\n var $legend_padding = 18;\r\n var $legend_font_size = 16;\r\n\r\n // Go through each chart element on the page\r\n $('.csv-chart').each(function () {\r\n var $header; // The header row\r\n var $container = $(this);\r\n var original = Chart.defaults.global.legend.onClick; // We keep the original legend onclick\r\n var $chart_reference = $container.data('reference') ? $container.data('reference') : 'no-ref-' + makeid();\r\n var $configuration = $container.data('configuration'); // The configuration object from the data attribute\r\n var $type = $configuration.type ? $configuration.type : 'horizontalBar'; // Type of chart\r\n var $x_axis = typeof $configuration.x_axis === 'undefined' ? true : $configuration.x_axis; // Show x axis and gridlines\r\n var $x_axis_label_show = typeof $configuration.x_axis_label === 'undefined' ? false : true; // Show x axis label\r\n var $x_axis_label_text = typeof $configuration.x_axis_label === 'undefined' ? false : $configuration.x_axis_label; // Show x axis label\r\n var $y_axis_label_show = typeof $configuration.y_axis_label === 'undefined' ? false : true; // Show y axis label\r\n var $y_axis_label_text = typeof $configuration.y_axis_label === 'undefined' ? false : $configuration.y_axis_label; // Show y axis label\r\n var $y_axis = typeof $configuration.y_axis === 'undefined' ? true : $configuration.y_axis; // Show y axis and gridlines\r\n var $y_axis_leading_zero = typeof $configuration.y_axis_leading_zero === 'undefined' ? false : $configuration.y_axis_leading_zero; // Show y axis and gridlines\r\n var $y_axis_suffix = typeof $configuration.y_axis_suffix === 'undefined' ? false : $configuration.y_axis_suffix; // Suffix like %\r\n var $y_axis_is_year = typeof $configuration.y_axis_is_year === 'undefined' ? false : $configuration.y_axis_is_year; // No number format for years\r\n var $y_raw = typeof $configuration.y_raw === 'undefined' ? false : $configuration.y_raw; // No number format \r\n var $x_axis_is_year = typeof $configuration.x_axis_is_year === 'undefined' ? false : $configuration.x_axis_is_year; // No number format for years\r\n var $x_axis_no_percentage = typeof $configuration.x_axis_no_percentage === 'undefined' ? false : $configuration.x_axis_no_percentage; // Prevent adding % sign at the end\r\n var $x_gridlines = typeof $configuration.x_gridlines === 'undefined' ? true : $configuration.x_gridlines; // Show gridlines\r\n var $y_gridlines = typeof $configuration.y_gridlines === 'undefined' ? true : $configuration.y_gridlines; // Show gridlines\r\n var $legend = typeof $configuration.legend === 'undefined' ? true : $configuration.legend; // Show or hide legend\r\n var $legend_position = typeof $configuration.legend_position === 'undefined' ? 'right' : $configuration.legend_position; // Show or hide legend\r\n var $single_color = typeof $configuration.single_color === 'undefined' ? false : $configuration.single_color; // Force a single color on chart\r\n var $label_font_size = typeof $configuration.label_font_size === 'undefined' ? 12 : $configuration.label_font_size; // Size of axis labels\r\n var $show_data_labels = typeof $configuration.show_data_labels === 'undefined' ? false : $configuration.show_data_labels; // The label end of charts\r\n var $padding_right = typeof $configuration.padding_right === 'undefined' ? 0 : $configuration.padding_right; //Add padding to the cavas\r\n var $padding_left = typeof $configuration.padding_left === 'undefined' ? 0 : $configuration.padding_left; //Add padding to the cavas\r\n var $bar_line_height = typeof $configuration.bar_line_height === 'undefined' ? 35 : $configuration.bar_line_height; //Add padding to the cavas\r\n var $tooltip_show_currency = typeof $configuration.tooltip_show_currency === 'undefined' ? false : $configuration.tooltip_show_currency; //Show currency in tooltip\r\n var $tooltip_show_percentage = typeof $configuration.tooltip_show_percentage === 'undefined' ? false : $configuration.tooltip_show_percentage; //Show currency in tooltip\r\n var $tooltip_hide_value = typeof $configuration.tooltip_hide_value === 'undefined' ? false : $configuration.tooltip_hide_value; //Hide the tooltip value only show label\r\n var $tooltip_number_format = typeof $configuration.tooltip_number_format === 'undefined' ? false : $configuration.tooltip_number_format; //Add thousand seperators\r\n var $tooltip_decimal = typeof $configuration.tooltip_decimal === 'undefined' ? false : $configuration.tooltip_decimal; //Add thousand seperators\r\n var $disable_filter = typeof $configuration.disable_filter === 'undefined' ? false : $configuration.disable_filter; //Disable clicking on legend\r\n var $chart_stack = typeof $configuration.chart_stack === 'undefined' ? true : $configuration.chart_stack; //If not defined charts are stacked by default\r\n var $external_filter = typeof $configuration.external_filter === 'undefined' ? false : $configuration.external_filter; //If not defined charts are stacked by default\r\n var $max_initial_dataset = typeof $configuration.max_initial_dataset === 'undefined' ? false : $configuration.max_initial_dataset; //How many datasets to show on initial load\r\n var $groupped_first_col = typeof $configuration.groupped_first_col === 'undefined' ? false : $configuration.groupped_first_col; // Change how the dataset is constructed\r\n var $special_mix_chart = typeof $configuration.special_mix_chart === 'undefined' ? false : $configuration.special_mix_chart; // Change how the dataset is constructed\r\n var $always_show_value = typeof $configuration.always_show_value === 'undefined' ? false : $configuration.always_show_value; // Change how the dataset is constructed\r\n var $always_show_positive = typeof $configuration.always_show_positive === 'undefined' ? false : $configuration.always_show_positive; // Done for gender chart, always have positive values\r\n\r\n // Pulls the CSV data in json\r\n Papa.parse($configuration.url, {\r\n download: true,\r\n dynamicTyping: true,\r\n skipEmptyLines: true,\r\n complete: function ($json) {\r\n\r\n // Process the data\r\n $configuration.header ? $header = $json.data.shift() : '';\r\n $configuration.header ? $header.shift() : '';\r\n $groupped_first_col ? $header.shift() : ''; // If we are using the first col on header row to group the data then skip one more col\r\n\r\n // Color palettes\r\n var $color_codes = colorCodes();\r\n\r\n // Create the dataset and add the colors and labels\r\n var $dataset = [];\r\n var $groups = {};\r\n var $labels = [];\r\n var $labels_groupped = [];\r\n var $labels_total_line = 0;\r\n var $max_width = 15; // Max width of label\r\n $type === 'doughnut' ? $max_width = 1000 : ''; // On dougnut do not split the labels messing up the legend\r\n $external_filter ? $legend = false : ''; // If external_filter is set then disable the legend on the canvas\r\n\r\n // console.log($json.data);\r\n\r\n\r\n // Rearrange the dataset\r\n $.each($json.data, function ($index, $value) {\r\n var $group = $groupped_first_col ? $value.shift() : 'Not groupped';\r\n var $label = $value.shift();\r\n $groups[$group.replace(/[^A-Z0-9]/ig, \"_\")] = $group // Collect the groups\r\n\r\n $($value).each(function ($key, $number) {\r\n // If this is a multi dataset or single dataset chart \r\n\r\n // Make sure the values are numbers, we ignore %\r\n if (typeof $number === 'string' && $number.indexOf(\"%\") === -1) {\r\n $number = Number($number.replace(/,\\s?/g, \"\"));\r\n }\r\n\r\n var $color_index = $value.length > 1 ? $key : $index; // Define which color to pick\r\n\r\n // If not a doughnut and has only 1 dataset set the color to same index\r\n $value.length === 1 && $type !== 'doughnut' ? $color_index = 1 : '';\r\n $value.length === 1 && $type !== 'doughnut' && !$always_show_value ? $tooltip_hide_value = true : '';\r\n\r\n $dataset[$key] ? '' : $dataset[$key] = { label: '', data: [], backgroundColor: [], borderColor: [] };\r\n $dataset[$key][\"label\"] = formatLabel($header[$key], $max_width, false);\r\n $dataset[$key][\"data\"].push(parseFloat($number));\r\n $max_initial_dataset && $key > $max_initial_dataset ? $dataset[$key][\"hidden\"] = true : ''; // If there is a max number of initial datasets to show\r\n\r\n\r\n // If this is a line chart, then no background color\r\n if ($type === 'line') {\r\n $dataset[$key][\"borderColor\"] = $single_color ? $single_color : $color_codes[$color_index];\r\n $dataset[$key][\"backgroundColor\"] = 'rgba(255, 255, 255, 0)';\r\n } else {\r\n $dataset[$key][\"backgroundColor\"].push($single_color ? $single_color : $color_codes[$color_index]);\r\n }\r\n\r\n if ($special_mix_chart) {\r\n if ($header[$key] === 'Patent Family') {\r\n $dataset[$key][\"type\"] = 'line';\r\n $dataset[$key][\"showLine\"] = false;\r\n $dataset[$key][\"pointBorderWidth\"] = 5;\r\n // $dataset[$key][\"pointBackgroundColor\"] = $single_color ? $single_color : $color_codes[$color_index];\r\n $dataset[$key][\"borderColor\"] = $single_color ? $single_color : $color_codes[$color_index];\r\n $dataset[$key][\"pointBackgroundColor\"] = '#50E3C2';\r\n $dataset[$key][\"borderColor\"] = '#50E3C2';\r\n $dataset[$key][\"pointRadius\"] = 4;\r\n $dataset[$key][\"backgroundColor\"] = ['rgba(0,0,0,0)'];\r\n }\r\n }\r\n });\r\n\r\n // The first column in the row is the label for the dataset\r\n $labels.push(formatLabel($label, $max_width, $y_axis_leading_zero));\r\n\r\n if ($groupped_first_col) {\r\n $labels_groupped.push({ group: $group, label: formatLabel($label, $max_width, $y_axis_leading_zero) });\r\n }\r\n\r\n // Add the size of the label array back\r\n var $formatted_label = formatLabel($label, $max_width, $y_axis_leading_zero);\r\n if ($formatted_label && $formatted_label.constructor === Array) {\r\n $labels_total_line = $labels_total_line + $formatted_label.length;\r\n } else {\r\n $labels_total_line = $labels_total_line + 1;\r\n }\r\n });\r\n\r\n\r\n\r\n // Clone the dataset\r\n var $dataset_clone = [];\r\n $($dataset).each(function ($index, $data) {\r\n $dataset_clone.push({ data: $data.data });\r\n });\r\n\r\n\r\n // If we have groupped dataset or dataset filter then we store the original dataset to global and work with it\r\n $groupped_first_col ? window.dataset_collection[$chart_reference] = $dataset_clone : '';\r\n $groupped_first_col ? window.labels_collection[$chart_reference] = $labels_groupped : '';\r\n $groupped_first_col ? window.original_labels[$chart_reference] = $labels : '';\r\n\r\n\r\n\r\n // If browser width < 900px reposition the legend and change padding \r\n if (window.innerWidth < 700) {\r\n $legend_position = 'bottom';\r\n $legend_padding = 15;\r\n $legend_font_size = 13;\r\n }\r\n\r\n var $chart_height = $labels_total_line * 45;\r\n $chart_height < 600 ? $chart_height = $labels_total_line * 65 : '';\r\n $chart_height < 300 ? $chart_height = 300 : ''; // Make sure the chart is min 300\r\n\r\n // If this is not a Doughnut or Line chart type\r\n if ($type !== 'doughnut' && $type !== 'line' && $type !== 'bar') {\r\n $container.closest('.chart-container').css('height', $chart_height); // Adjust the canvas height\r\n (parseInt($chart_height / $labels.length) - 50) < 35 ? $bar_line_height = 35 : $bar_line_height = (parseInt($chart_height / $labels.length) - 50); // Set the actual bars\r\n $bar_line_height > 60 ? $bar_line_height = 60 : ''; // Cap the bar height to max 60\r\n $dataset.length === 1 ? $legend = false : ''; // If there is only 1 dataset then hide the legend \r\n }\r\n\r\n // Draw the chart\r\n window.charts_collection[$chart_reference] = new Chart($container[0].getContext('2d'), {\r\n type: $type,\r\n data: {\r\n labels: $labels,\r\n datasets: $dataset\r\n },\r\n options: {\r\n responsive: true,\r\n elements: {\r\n line: {\r\n tension: 0, // disables bezier curves\r\n }\r\n },\r\n maintainAspectRatio: false,\r\n layout: {\r\n padding: {\r\n left: $padding_left,\r\n right: $padding_right,\r\n top: 20,\r\n bottom: 20\r\n }\r\n },\r\n tooltips: {\r\n mode: 'single',\r\n callbacks: {\r\n // this callback is used to create the tooltip label\r\n label: function (tooltipItem, data) {\r\n\r\n // console.log('tooltipItem', tooltipItem);\r\n // console.log('data', data);\r\n\r\n // get the data label and data value to display\r\n // var dataLabel;\r\n // if (data.datasets.length > 1) {\r\n // } else {\r\n\r\n // }\r\n var dataLabel =\r\n data.datasets.length > 1 ?\r\n (data.datasets[tooltipItem.datasetIndex].label[0] ?\r\n data.datasets[tooltipItem.datasetIndex].label.join(' ')\r\n : data.datasets[tooltipItem.datasetIndex].label)\r\n : (data.labels[tooltipItem.index][0] ?\r\n data.labels[tooltipItem.index].join(' ')\r\n : data.labels[tooltipItem.index]);\r\n\r\n // add the currency symbol $ to the label\r\n var value = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];\r\n\r\n // Format the value\r\n if ($x_axis_is_year) {\r\n $tooltip_number_format ? value = value.toLocaleString() : '';\r\n } else {\r\n $always_show_positive && value < 0 ? value = value * -1 : '';\r\n $tooltip_decimal ? value = Number(value).toFixed($tooltip_decimal) : '';\r\n $tooltip_number_format ? value = value.toLocaleString() : '';\r\n $tooltip_show_currency ? value = '$ ' + value : '';\r\n $tooltip_show_percentage ? value = value + '%' : '';\r\n }\r\n\r\n // If forced to hide value\r\n $tooltip_hide_value ? '' : dataLabel += ': ' + value;\r\n\r\n // If there is 1 dataset and we are on bar chart\r\n if (data.datasets.length === 1 && $type === \"horizontalBar\") {\r\n return value\r\n } else {\r\n // return the text to display on the tooltip\r\n return dataLabel;\r\n }\r\n }\r\n }\r\n },\r\n legend: {\r\n display: $legend,\r\n position: $legend_position,\r\n labels: {\r\n boxWidth: $legend_box_width,\r\n padding: $legend_padding,\r\n fontSize: $legend_font_size,\r\n fontFamily: 'Cabin',\r\n filter: function ($item, $chartdata) {\r\n if (typeof $item['text'] === 'object') {\r\n $item['text'] = $item['text'].join(' '); // Remove the comma from the legend label\r\n }\r\n return $item;\r\n }\r\n },\r\n\r\n onClick: function ($event, $item) {\r\n if ($disable_filter) {\r\n $event.stopPropagation();\r\n } else {\r\n original.call(this, $event, $item);\r\n }\r\n }\r\n },\r\n scales: {\r\n xAxes: [{\r\n display: $x_axis,\r\n stacked: $chart_stack,\r\n gridLines: {\r\n display: $x_gridlines\r\n },\r\n ticks: {\r\n fontSize: $label_font_size,\r\n fontColor: '#021A2B',\r\n fontFamily: 'Cabin',\r\n autoSkip: false,\r\n callback: function (value, index, values) {\r\n\r\n // Check the largest value in the ticks. To know what devider to use\r\n var $suffix = ' k';\r\n var $divider = 0;\r\n\r\n value[0] ? value = value.join(' ') : ''; // Remove commas on x-axis #89139\r\n\r\n if ($x_axis_is_year) {\r\n // Do not format the ticks\r\n } else {\r\n var $largest = Math.max.apply(Math, values);\r\n if ($largest >= 1000000) {\r\n $suffix = ' m';\r\n $divider = 1000000;\r\n } else if ($largest >= 1000) {\r\n $suffix = ' k';\r\n $divider = 1000;\r\n }\r\n\r\n $always_show_positive && value < 0 ? value = value * -1 : '';\r\n\r\n if ($divider > 0) {\r\n value = value / $divider;\r\n value = value.toLocaleString() + $suffix;\r\n } else {\r\n $tooltip_number_format ? value = value.toLocaleString() : '';\r\n }\r\n\r\n $tooltip_show_percentage && !$x_axis_no_percentage ? value = value + '%' : '';\r\n $tooltip_show_currency ? value = '$ ' + value : '';\r\n }\r\n\r\n return value;\r\n }\r\n },\r\n scaleLabel: {\r\n display: $x_axis_label_show,\r\n labelString: $x_axis_label_text,\r\n padding: 20,\r\n fontSize: 18,\r\n fontColor: '#000',\r\n fontFamily: 'Cabin',\r\n fontStyle: 'bold'\r\n }\r\n }],\r\n yAxes: [{\r\n display: $y_axis,\r\n barThickness: $bar_line_height,\r\n stacked: $chart_stack,\r\n gridLines: {\r\n display: $y_gridlines\r\n },\r\n ticks: {\r\n fontSize: $label_font_size,\r\n fontColor: '#021A2B',\r\n fontFamily: 'Cabin',\r\n callback: function (value, index, values) {\r\n\r\n // Check the largest value in the ticks. To know what devider to use\r\n var $suffix = ' k';\r\n var $divider = 0;\r\n\r\n if ($y_axis_is_year || $y_raw) {\r\n // Do not format the ticks\r\n } else {\r\n\r\n var $largest = Math.max.apply(Math, values);\r\n if ($largest > 2300) {\r\n if ($largest >= 1000000) {\r\n $suffix = ' m';\r\n $divider = 1000000;\r\n } else if ($largest >= 1000) {\r\n $suffix = ' k';\r\n $divider = 1000;\r\n }\r\n\r\n if ($divider > 0) {\r\n value = value / $divider;\r\n value = value.toLocaleString() + $suffix;\r\n }\r\n }\r\n }\r\n\r\n\r\n if ($y_axis_suffix) {\r\n // Do not format the ticks\r\n value = value + $y_axis_suffix;\r\n }\r\n\r\n return value;\r\n }\r\n },\r\n scaleLabel: {\r\n display: $y_axis_label_show,\r\n labelString: $y_axis_label_text,\r\n padding: 20,\r\n fontSize: 18,\r\n fontColor: '#000',\r\n fontFamily: 'Cabin',\r\n fontStyle: 'bold'\r\n }\r\n }]\r\n },\r\n plugins: {\r\n datalabels: {\r\n display: $show_data_labels,\r\n color: '#005792',\r\n align: 'right',\r\n offset: 20,\r\n anchor: 'end',\r\n font: {\r\n weight: 'bold',\r\n size: '22',\r\n family: 'Cabin'\r\n },\r\n formatter: function (value, context) {\r\n return value + '%';\r\n }\r\n\r\n }\r\n },\r\n animation: {\r\n onComplete: function () {\r\n // Get the base64 for print\r\n var $image_print = this.toBase64Image();\r\n $container.closest('.chart-container').find('.chart-print').remove();\r\n $container.closest('.chart-container').append('');\r\n }\r\n }\r\n }\r\n\r\n });\r\n\r\n\r\n // If external_filter is set then disable the legend and add filter box on top;\r\n if ($external_filter) {\r\n var $filter_html = '';\r\n var $legend_html = '';\r\n // Go through each dataset and build the list of options\r\n $(window.charts_collection[$chart_reference].data.datasets).each(function ($index, $data) {\r\n var $checked = !$data.hidden ? 'checked' : '';\r\n var $dataset_ref = $chart_reference + \"_\" + $index; // Create a reference based on the chart reference and index\r\n var $color = $type === 'line' ? $data['borderColor'] : $data['backgroundColor'][0];\r\n var $data_value = $data[\"label\"][0] ? $data[\"label\"][0] : $data[\"label\"];\r\n var $data_label = $data[\"label\"][0] ? $data[\"label\"].join(' ') : $data[\"label\"];\r\n // console.log($data);\r\n $filter_html +=\r\n \"
  • \" +\r\n \"\" +\r\n \"\" +\r\n \"
  • \";\r\n\r\n if ($checked === 'checked') {\r\n $legend_html += \"
  • \";\r\n }\r\n });\r\n var $label_text = $max_initial_dataset ? '...' : 'All';\r\n $filter_html = \"
    \" +\r\n \"
    \" +\r\n \"
    View FoR
    \" +\r\n \"
    \";\r\n\r\n $legend_html = \"\";\r\n\r\n $container.closest('.chart-container').before($filter_html);\r\n $container.closest('.chart-container').after($legend_html);\r\n\r\n // Bind the change action to the filter checkboxes\r\n $(\".dropdown.widget-container .list li.table_group_\" + $chart_reference + \" input\").change(function () {\r\n\r\n // When a checkbox is ticked go through the list and build the search filter\r\n var $value = '';\r\n var $legend_html = \"\";\r\n var $chart_target = $(this).data('chart-target');\r\n\r\n // Disable all the datasets and enable only the active one\r\n $(window.charts_collection[$chart_reference].data.datasets).each(function ($index, $value) {\r\n window.charts_collection[$chart_reference].getDatasetMeta($index).hidden = true;\r\n });\r\n\r\n // Go through the ticked checkbox and collect the data & Enable the ticked datasets\r\n $(this).closest('.dropdown.widget-container').find(\"input:checked\").each(function () {\r\n $value += ($(this).val().length > 4 ? $(this).val().substr(0, 2) : $(this).val()) + \"|\"\r\n window.charts_collection[$chart_reference].getDatasetMeta($(this).data('dataset-index')).hidden = false;\r\n\r\n $legend_html += \"
  • \";\r\n })\r\n\r\n\r\n // After collecting all the values check if there is anything to filter\r\n if ($value) {\r\n // If there a value ticked then we show only the ticked ones\r\n $(this).closest('.widget-container').find('.selected span').html($value.slice(0, -1).replace(/\\|/g, \", \"));\r\n } else {\r\n // If no checkbox is ticked then show everything\r\n $(this).closest('.widget-container').find('.selected span').html('All');\r\n $(window.charts_collection[$chart_reference].data.datasets).each(function ($index, $value) {\r\n window.charts_collection[$chart_reference].getDatasetMeta($index).hidden = false;\r\n });\r\n }\r\n\r\n // Apply to chart\r\n window.charts_collection[$chart_reference].update();\r\n\r\n\r\n // Go through all the selected and build the legend list again\r\n $(this).closest('.chart').find('.legend_html').html($legend_html);\r\n\r\n });\r\n\r\n // Bind action to expand the filter list\r\n $('.chart_filter_' + $chart_reference + ' .widget-container button').click(function ($event) {\r\n $event.stopPropagation()\r\n !$(this).closest('.collapsible-box').hasClass('expanded') ? $(this).closest('.collapsible-box').find('.toggle').click() : '';\r\n $(this).siblings('.list').toggleClass('active');\r\n $(this).toggleClass('active');\r\n })\r\n\r\n // Clicking on the open filer dropdown. Stop propagation\r\n $('.chart_filter_' + $chart_reference + ' .widget-container .list').click(function ($event) {\r\n $event.stopPropagation();\r\n });\r\n\r\n }\r\n\r\n // If there are groups on the chart\r\n if ($groupped_first_col) {\r\n\r\n var $filter_html = '';\r\n var $this_chart_reference = $chart_reference + '_cohort';\r\n var $label_text = 'View Cohorts';\r\n\r\n // Go through each dataset and build the list of options\r\n $.each($groups, function ($index, $data) {\r\n // console.log($index);\r\n var $dataset_ref = $this_chart_reference + \"_\" + $index + \"_groups\"; // Create a reference based on the chart reference and index\r\n var $data_value = $data;\r\n\r\n $filter_html +=\r\n \"
  • \" +\r\n \"\" +\r\n \"\" +\r\n \"
  • \";\r\n });\r\n\r\n $filter_html = \"
    \" +\r\n \"
    \" +\r\n \"
    \" + $label_text + \"
    \" +\r\n \"
    \";\r\n\r\n $container.closest('.chart-container').before($filter_html);\r\n\r\n // Bind the change action to the filter checkboxes\r\n $(\".dropdown.widget-container .list li.table_group_\" + $this_chart_reference + \" input\").change(function () {\r\n\r\n // When a checkbox is ticked go through the list and build the search filter\r\n var $value = '';\r\n var $chart_target = $(this).data('chart-target');\r\n var $selected_groups = [];\r\n\r\n\r\n // // Go through the ticked checkbox and collect the data & Enable the ticked datasets\r\n $(this).closest('.dropdown.widget-container').find(\"input:checked\").each(function () {\r\n var $raw_value = $(this).val();\r\n switch ($raw_value) {\r\n case 'Group of Eight (Go8)':\r\n $raw_value = 'Go8';\r\n break;\r\n case 'Australian Technology Network (ATN)':\r\n $raw_value = 'ATN';\r\n break;\r\n case 'Innovative Research Universities (IRU)':\r\n $raw_value = 'IRU';\r\n break;\r\n case 'Regional Universities Network (RUN)':\r\n $raw_value = 'RUN';\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n $value += $raw_value + \"|\"\r\n\r\n // Make a list of selected items\r\n $selected_groups.push($(this).val())\r\n })\r\n\r\n // console.log('Window chart', window.charts_collection[$chart_reference]);\r\n // console.log('Window dataset', window.dataset_collection[$chart_reference]);\r\n // console.log('Window labels', window.labels_collection[$chart_reference]);\r\n // console.log('Selected groups', $selected_groups);\r\n\r\n\r\n\r\n // Reset the chart to it's original state\r\n window.charts_collection[$chart_reference].data.labels = window.original_labels[$chart_reference];\r\n\r\n $(window.charts_collection[$chart_reference].data.datasets).each(function ($index, $data) {\r\n window.charts_collection[$chart_reference].data.datasets[$index].data = window.dataset_collection[$chart_reference][$index].data\r\n })\r\n // window.charts_collection[$chart_reference].data.datasets = window.dataset_collection[$chart_reference];\r\n\r\n // After collecting all the values check if there is anything to filter\r\n if ($value) {\r\n // If there a value ticked then we show only the ticked ones\r\n $(this).closest('.widget-container').find('.selected span').html($value.slice(0, -1).replace(/\\|/g, \", \"));\r\n // window.charts_collection[$chart_reference].data.labels = window.charts_collection[$chart_reference].data.labels.pop();\r\n\r\n // Rebuild the list of labels and collect the index \r\n var $list_of_selected_labels_index = [];\r\n var $list_of_selected_labels = [];\r\n $(window.labels_collection[$chart_reference]).each(function ($label_index, $value) {\r\n var $label_group = $value.group;\r\n\r\n if ($selected_groups.indexOf($label_group) > -1) {\r\n $list_of_selected_labels.push($value.label);\r\n $list_of_selected_labels_index.push($label_index);\r\n }\r\n });\r\n\r\n // console.log('$list_of_selected_labels', $list_of_selected_labels);\r\n // console.log('$list_of_selected_labels_index', $list_of_selected_labels_index);\r\n\r\n\r\n // Go through each dataset and exclude the ones that are not part of selected labels based on index\r\n // var $original_datasets = window.dataset_collection[$chart_reference];\r\n var $filtered_dataset = [];\r\n\r\n $(window.charts_collection[$chart_reference].data.datasets).each(function ($index, $dataset) {\r\n var $filtered_data = [];\r\n $($dataset.data).each(function ($data_label_index, $data) {\r\n if ($list_of_selected_labels_index.indexOf($data_label_index) > -1) {\r\n $filtered_data.push($data);\r\n }\r\n });\r\n $dataset['data'] = $filtered_data;\r\n $filtered_dataset.push($dataset);\r\n // var $filtered_dataset_index = $filtered_dataset.push($dataset);\r\n // console.log($filtered_dataset_index -1);\r\n // $filtered_dataset[$filtered_dataset_index -1].data = $filtered_data;\r\n })\r\n\r\n // console.log('Filtered dataset', $filtered_dataset);\r\n\r\n // Update the chart label and dataset\r\n window.charts_collection[$chart_reference].data.labels = $list_of_selected_labels;\r\n window.charts_collection[$chart_reference].data.datasets = $filtered_dataset;\r\n\r\n } else {\r\n // If no checkbox is ticked then show everything\r\n $(this).closest('.widget-container').find('.selected span').html('All');\r\n\r\n }\r\n\r\n\r\n // Compute the new chart height\r\n var $bar_thickness = window.charts_collection[$chart_reference].options.scales.yAxes[0].barThickness;\r\n var $number_of_ticks_on_y = window.charts_collection[$chart_reference].data.labels.length;\r\n var $chart_height = ($bar_thickness + 45) * $number_of_ticks_on_y;\r\n $(this).closest('.chart').find('.chart-container').css('height', $chart_height); // Adjust the canvas height\r\n\r\n // // Apply to chart\r\n window.charts_collection[$chart_reference].resize();\r\n window.charts_collection[$chart_reference].update();\r\n });\r\n\r\n // Bind action to expand the filter list\r\n $('.chart_filter_' + $this_chart_reference + ' .widget-container button').click(function ($event) {\r\n $event.stopPropagation()\r\n !$(this).closest('.collapsible-box').hasClass('expanded') ? $(this).closest('.collapsible-box').find('.toggle').click() : '';\r\n $(this).siblings('.list').toggleClass('active');\r\n $(this).toggleClass('active');\r\n })\r\n\r\n // Clicking on the open filer dropdown. Stop propagation\r\n $('.chart_filter_' + $this_chart_reference + ' .widget-container .list').click(function ($event) {\r\n $event.stopPropagation();\r\n });\r\n }\r\n\r\n\r\n },\r\n error: function ($err, $file, $inputElem, $reason) {\r\n console.log('Full error', $err);\r\n console.log('Error message', $err['message']);\r\n $container.closest('.chart-container').css('height', 'auto');\r\n $container.closest('.collapsible-box').addClass('no-data');\r\n if ($err['message'] === 'Not Found' || $err['message'] === '') {\r\n var $textfile = $configuration.url.substr(0, $configuration.url.lastIndexOf(\"/\") + 1) + 'no.chart.footnote.txt'; // remove everything after the last backslash\r\n var $error_message = \"Data not found\";\r\n $.ajax({\r\n url: $textfile\r\n }).done(function ($data) {\r\n $data ? $error_message = $data : '';\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n }).fail(function ($error) {\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n });\r\n }\r\n }\r\n });\r\n });\r\n\r\n // Clicking on body to close the filters\r\n $('body').click(function () {\r\n $('.widget-container .selected').removeClass('active');\r\n $('.widget-container .list').removeClass('active');\r\n })\r\n\r\n $(window).resize(function () {\r\n if (window.innerWidth < 700) {\r\n for (var key in window.charts_collection) {\r\n if (window.charts_collection.hasOwnProperty(key)) {\r\n window.charts_collection[key].options.legend.position = \"bottom\";\r\n window.charts_collection[key].options.legend.labels = {\r\n boxWidth: 20,\r\n padding: 15,\r\n fontSize: 13,\r\n fontFamily: 'Cabin'\r\n };\r\n }\r\n }\r\n }\r\n if (window.innerWidth > 700) {\r\n for (var key in window.charts_collection) {\r\n if (window.charts_collection.hasOwnProperty(key)) {\r\n window.charts_collection[key].options.legend.position = \"right\";\r\n window.charts_collection[key].options.legend.labels = {\r\n boxWidth: $legend_box_width,\r\n padding: $legend_padding,\r\n fontSize: $legend_font_size,\r\n fontFamily: 'Cabin'\r\n };\r\n }\r\n }\r\n }\r\n });\r\n\r\n function makeid() {\r\n var text = \"\";\r\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n\r\n for (var i = 0; i < 5; i++)\r\n text += possible.charAt(Math.floor(Math.random() * possible.length));\r\n\r\n return text;\r\n }\r\n\r\n function formatLabel(str, maxwidth, $y_axis_leading_zero) {\r\n\r\n if (str && $y_axis_leading_zero && str.toString().length < 4) {\r\n str = '0' + str.toString();\r\n }\r\n\r\n if (typeof str === 'string') {\r\n var sections = [];\r\n var words = str.split(\" \");\r\n var temp = \"\";\r\n\r\n words.forEach(function (item, index) {\r\n if (temp.length > 0) {\r\n var concat = temp + ' ' + item;\r\n\r\n if (concat.length > maxwidth) {\r\n sections.push(temp);\r\n temp = \"\";\r\n } else {\r\n if (index === (words.length - 1)) {\r\n sections.push(concat);\r\n return;\r\n } else {\r\n temp = concat;\r\n return;\r\n }\r\n }\r\n }\r\n\r\n if (index === (words.length - 1)) {\r\n sections.push(item);\r\n return;\r\n }\r\n\r\n if (item.length < maxwidth) {\r\n temp = item;\r\n } else {\r\n sections.push(item);\r\n }\r\n\r\n });\r\n\r\n return sections;\r\n } else {\r\n return str;\r\n }\r\n }\r\n\r\n function colorCodes() {\r\n var $color_codes = [];\r\n $color_codes[0] = 'rgba(11,28,42,1)';\r\n $color_codes[1] = 'rgba(60,123,191,1)';\r\n $color_codes[2] = 'rgba(96,43,83,1)';\r\n $color_codes[3] = 'rgba(65,129,108,1)';\r\n $color_codes[4] = 'rgba(120,80,138,1)';\r\n $color_codes[5] = 'rgba(0,129,138,1)';\r\n $color_codes[6] = 'rgba(13,102,108,1)';\r\n $color_codes[7] = 'rgba(75,65,129,1)';\r\n $color_codes[8] = 'rgb(15,178,53)';\r\n $color_codes[9] = 'rgb(172,208,81)';\r\n $color_codes[10] = 'rgb(32,17,61)';\r\n $color_codes[11] = 'rgb(118,144,51)';\r\n $color_codes[12] = 'rgb(66,104,138)';\r\n $color_codes[13] = 'rgb(245,166,35)';\r\n $color_codes[14] = 'rgb(67,88,14)';\r\n $color_codes[15] = 'rgb(147,57,68)';\r\n $color_codes[16] = 'rgb(201,84,190)';\r\n $color_codes[17] = 'rgb(121,22,132)';\r\n $color_codes[18] = 'rgb(98,123,106)';\r\n $color_codes[19] = 'rgb(80,215,227)';\r\n $color_codes[20] = 'rgb(154,60,42)';\r\n $color_codes[21] = 'rgb(58,133,99)';\r\n $color_codes[22] = 'rgb(139,87,42)';\r\n $color_codes[23] = 'rgb(86,81,144)';\r\n $color_codes[24] = 'rgb(126,211,33)';\r\n $color_codes[25] = 'rgb(224,16,77)';\r\n $color_codes[26] = 'rgb(144,19,254)';\r\n $color_codes[27] = 'rgb(194,125,11)';\r\n $color_codes[28] = 'rgb(173,162,89)';\r\n $color_codes[29] = 'rgb(133,200,185)';\r\n $color_codes[30] = 'rgb(53,97,3)';\r\n return $color_codes;\r\n }\r\n};\r\n\r\nmodule.exports = Chartblock;\r\n\n},{}],8:[function(require,module,exports){\n/* global Papa */\r\n\r\n'use strict';\r\n\r\n// Constructor\r\nvar Table = function () {\r\n\r\n $('.csv-table').each(function () {\r\n var $header; // The header row\r\n var $footer; // The footer row\r\n var $container = $(this);\r\n var $configuration = $container.data('configuration'); // The configuration object from the data attribute\r\n var $table_css_class = $configuration.style ? $configuration.style : '';\r\n var $decimal_places = typeof $configuration.decimal_places === 'undefined' ? false : $configuration.decimal_places; //Decimal places to show\r\n var $raw_value = typeof $configuration.raw_value === 'undefined' ? false : $configuration.raw_value; //Decimal places to show\r\n\r\n // console.log($table_css_class);\r\n\r\n // Pulls the CSV data in json\r\n Papa.parse($configuration.url, {\r\n download: true,\r\n dynamicTyping: false,\r\n skipEmptyLines: true,\r\n complete: function ($json) {\r\n\r\n\r\n // Process the data\r\n $configuration.header ? $header = $json.data.shift() : '';\r\n $configuration.footer ? $footer = $json.data.pop() : '';\r\n\r\n // Output the HTML structure for the table\r\n var $html = \"\";\r\n $html += '';\r\n if ($configuration.header) {\r\n $html += '';\r\n $($header).each(function ($index, $value) {\r\n $html += '';\r\n });\r\n $html += '';\r\n }\r\n if ($json.data) {\r\n $html += '';\r\n $($json.data).each(function ($index, $row) {\r\n\r\n // Special case #87586\r\n if ($row.length === 2) {\r\n if ($row[0] === 'Patents' && $row[1] !== '-') {\r\n $row[1] = Number(parseFloat(Number($row[1].replace(/,\\s?/g, \"\"))).toFixed(1)).toLocaleString(undefined, { minimumFractionDigits: 1 });\r\n }\r\n if ($row[0] === 'FTEs' && $row[1] !== '-') {\r\n $row[1] = Number(parseFloat(Number($row[1].replace(/,\\s?/g, \"\"))).toFixed(1)).toLocaleString(undefined, { minimumFractionDigits: 1 });\r\n }\r\n if ($row[0] === 'Research outputs' && $row[1] !== '-') {\r\n $row[1] = Number(parseFloat(Number($row[1].replace(/,\\s?/g, \"\"))).toFixed(1)).toLocaleString(undefined, { minimumFractionDigits: 1 });\r\n }\r\n }\r\n\r\n $html += '';\r\n $($row).each(function ($index, $cell) {\r\n if ($raw_value) {\r\n // Do nothing\r\n } else {\r\n if ($decimal_places && $index !== 0 && $cell !== '-' && $cell !== '–') {\r\n $cell = Number(parseFloat(Number($cell.replace(/,\\s?/g, \"\"))).toFixed($decimal_places)).toLocaleString(undefined, { minimumFractionDigits: $decimal_places });\r\n }\r\n }\r\n $html += '';\r\n });\r\n $html += '';\r\n });\r\n $html += '';\r\n }\r\n if ($configuration.footer) {\r\n $html += '';\r\n $($footer).each(function ($index, $value) {\r\n if ($raw_value) {\r\n // Do nothing\r\n } else {\r\n if ($decimal_places && $index !== 0 && $value !== '-' && $value !== '–') {\r\n $value = parseFloat(Number($value.replace(/,\\s?/g, \"\"))).toFixed($decimal_places).toLocaleString();\r\n }\r\n }\r\n $html += '';\r\n });\r\n $html += '';\r\n }\r\n $html += '
    ' + $value + '
    ' + $cell + '
    ' + $value + '
    ';\r\n\r\n $container.html($html);\r\n\r\n\r\n // Make the dataTable\r\n var $columnsDefs;\r\n\r\n // Show only 8 columns on the display\r\n if ($header.length > 8 && $configuration['limit_cols_to_8']) {\r\n $columnsDefs = [\r\n {\r\n \"targets\": [1, 2, 3, 4, 5, 6, 7, 8], // We can make this a configuration\r\n \"visible\": true\r\n },\r\n {\r\n \"targets\": ['_all'],\r\n \"visible\": false\r\n }\r\n ];\r\n $configuration['columnDefs'] = $columnsDefs;\r\n }\r\n\r\n\r\n if ($configuration['stick_left_col'] && window.innerWidth > 1200) {\r\n // $configuration['fixedColumns'] = {leftColumns: 1};\r\n // $configuration['scrollX'] = true;\r\n }\r\n if (window.innerWidth <= 1200) {\r\n // $configuration['scrollX'] = true;\r\n }\r\n\r\n // $container.find('table').DataTable($configuration);\r\n if (!$configuration['nodatatable']) {\r\n $container.find('table').DataTable($configuration);\r\n }\r\n },\r\n error: function ($err, $file, $inputElem, $reason) {\r\n $container.closest('.collapsible-box').addClass('no-data');\r\n if ($err['message'] === 'Not Found' || $err['message'] === '') {\r\n var $textfile = $configuration.url.substr(0, $configuration.url.lastIndexOf(\"/\") + 1) + 'no.table.footnote.txt'; // remove everything after the last backslash\r\n var $error_message = \"Data not found\";\r\n $.ajax({\r\n url: $textfile\r\n }).done(function ($data) {\r\n $data ? $error_message = $data : '';\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n }).fail(function ($error) {\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n });\r\n }\r\n }\r\n });\r\n });\r\n};\r\n\r\nmodule.exports = Table;\r\n\n},{}],9:[function(require,module,exports){\n/* global Papa */\r\n\r\n'use strict';\r\n\r\n// Constructor\r\nvar TableSection1 = function () {\r\n\r\n $('.csv-table-section1').each(function () {\r\n var $header; // The header row\r\n var $footer; // The footer row\r\n var $container = $(this);\r\n var $configuration = $container.data('configuration'); // The configuration object from the data attribute\r\n var $table_css_class = $configuration.style ? $configuration.style : '';\r\n var $decimal_places = typeof $configuration.decimal_places === 'undefined' ? false : $configuration.decimal_places; //Decimal places to show\r\n var $raw_value = typeof $configuration.raw_value === 'undefined' ? false : $configuration.raw_value; //Decimal places to show\r\n\r\n // console.log($table_css_class);\r\n\r\n // Pulls the CSV data in json\r\n Papa.parse($configuration.url, {\r\n download: true,\r\n dynamicTyping: false,\r\n skipEmptyLines: true,\r\n complete: function ($json) {\r\n\r\n // Process the data\r\n $configuration.header ? $header = $json.data.shift() : '';\r\n $configuration.footer ? $footer = $json.data.pop() : '';\r\n\r\n // Output the HTML structure for the table\r\n var $html = \"\";\r\n $html += '';\r\n if ($configuration.header) {\r\n $html += '';\r\n $($header).each(function ($index, $value) {\r\n $html += '';\r\n });\r\n $html += '';\r\n }\r\n if ($json.data) {\r\n $html += '';\r\n\r\n\r\n var $forgroup_class = \"\";\r\n\r\n $($json.data).each(function ($index, $row) {\r\n var $row_class = '';\r\n\r\n // If the first col is empty we highlight the row as heading\r\n $row[0].length < 1 ? $row_class = \" heading-row \" : '';\r\n\r\n // Special case #87586\r\n if ($row.length === 2) {\r\n if ($row[0] === 'Patents' && $row[1] !== '-') {\r\n $row[1] = parseFloat(Number($row[1].replace(/,\\s?/g, \"\"))).toFixed(1).toLocaleString();\r\n }\r\n if ($row[0] === 'FTEs' && $row[1] !== '-') {\r\n $row[1] = parseFloat(Number($row[1].replace(/,\\s?/g, \"\"))).toFixed(1).toLocaleString();\r\n }\r\n if ($row[0] === 'Research outputs' && $row[1] !== '-') {\r\n $row[1] = parseFloat(Number($row[1].replace(/,\\s?/g, \"\"))).toFixed(1).toLocaleString();\r\n }\r\n }\r\n\r\n // If on table \"Research outputs across ERA rounds\" then add the class\r\n if ($configuration['tableheadertitle'] === 'Research outputs across ERA rounds') {\r\n if ($index === 0 || $index === 5) {\r\n $row_class = 'heading-row';\r\n }\r\n }\r\n\r\n \r\n\r\n $html += '';\r\n $($row).each(function ($index, $cell) {\r\n\r\n if ($raw_value) {\r\n $html += '';\r\n } else {\r\n // If defined to have decimal places\r\n if ($decimal_places && $decimal_places !== 0 && $index !== 0 && $cell !== '' && $cell !== '-' && $cell !== '–') {\r\n $cell = Number(parseFloat(Number($cell.replace(/,\\s?/g, \"\"))).toFixed($decimal_places)).toLocaleString(undefined, { minimumFractionDigits: $decimal_places });\r\n }\r\n\r\n // If no decimal places still need thousand seperators\r\n if ($decimal_places === 0 && $index !== 0 && $cell !== '' && $cell !== '-' && $cell !== '–') {\r\n $cell = Number(parseFloat(Number($cell.replace(/,\\s?/g, \"\"))).toFixed(0)).toLocaleString(undefined, { minimumFractionDigits: 0 });\r\n }\r\n\r\n $html += '';\r\n }\r\n });\r\n $html += '';\r\n });\r\n $html += '';\r\n }\r\n if ($configuration.footer) {\r\n $html += '';\r\n $($footer).each(function ($index, $value) {\r\n if ($raw_value) {\r\n $html += '';\r\n } else {\r\n if ($decimal_places && $index !== 0 && $value !== '-' && $value !== '–') {\r\n $value = Number(parseFloat(Number($value.replace(/,\\s?/g, \"\"))).toFixed($decimal_places)).toLocaleString(undefined, { minimumFractionDigits: $decimal_places });\r\n }\r\n $html += '';\r\n }\r\n });\r\n $html += '';\r\n }\r\n $html += '
    ' + $value + '
    ' + $cell + '' + $cell + '
    ' + $cell + '' + $value + '
    ';\r\n\r\n $container.html($html);\r\n\r\n\r\n // Make the dataTable\r\n var $columnsDefs;\r\n\r\n // Show only 8 columns on the display\r\n if ($header && $header.length > 8 && $configuration['limit_cols_to_8']) {\r\n $columnsDefs = [\r\n {\r\n \"targets\": [1, 2, 3, 4, 5, 6, 7, 8], // We can make this a configuration\r\n \"visible\": true\r\n },\r\n {\r\n \"targets\": ['_all'],\r\n \"visible\": false\r\n }\r\n ];\r\n $configuration['columnDefs'] = $columnsDefs;\r\n }\r\n\r\n\r\n if ($configuration['stick_left_col'] && window.innerWidth > 1200) {\r\n // $configuration['fixedColumns'] = {leftColumns: 1};\r\n // $configuration['scrollX'] = true;\r\n }\r\n if (window.innerWidth <= 1200) {\r\n // $configuration['scrollX'] = true;\r\n }\r\n\r\n if (!$configuration['nodatatable']) {\r\n $container.find('table').DataTable($configuration);\r\n }\r\n },\r\n error: function ($err, $file, $inputElem, $reason) {\r\n $container.closest('.collapsible-box').addClass('no-data');\r\n if ($err['message'] === 'Not Found' || $err['message'] === '') {\r\n var $textfile = $configuration.url.substr(0, $configuration.url.lastIndexOf(\"/\") + 1) + 'no.table.footnote.txt'; // remove everything after the last backslash\r\n var $error_message = \"Data not found\";\r\n $.ajax({\r\n url: $textfile\r\n }).done(function ($data) {\r\n $data ? $error_message = $data : '';\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n }).fail(function ($error) {\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n });\r\n }\r\n }\r\n });\r\n });\r\n};\r\n\r\nmodule.exports = TableSection1;\r\n\n},{}],10:[function(require,module,exports){\n/* global Papa */\r\n\r\n\"use strict\";\r\n\r\n// Constructor\r\nvar TableSection4 = function () {\r\n var $table_counter = 0;\r\n var $tables = [];\r\n $(\".csv-table-section4\").each(function () {\r\n var $header; // The header row\r\n var $footer; // The footer row\r\n var $container = $(this);\r\n var $configuration = $container.data(\"configuration\"); // The configuration object from the data attribute\r\n var $table_css_class = $configuration.style ? $configuration.style : \"\";\r\n // var $decimal_places = typeof $configuration.decimal_places === \"undefined\" ? false : $configuration.decimal_places; //Decimal places to show\r\n var $decimal_places = $configuration['show_all_columns'] ? false : 1; //Decimal places to show\r\n var $forgroup_filter = [];\r\n var $column_filters = [];\r\n var $total_columns_index = [];\r\n var $raw_value = typeof $configuration.raw_value === 'undefined' ? false : $configuration.raw_value; //Decimal places to show\r\n\r\n // Pulls the CSV data in json\r\n Papa.parse($configuration.url, {\r\n download: true,\r\n dynamicTyping: false,\r\n skipEmptyLines: true,\r\n complete: function ($json) {\r\n\r\n // Increment the table counter to use for IDs etc\r\n $table_counter++;\r\n\r\n // Process the data\r\n $configuration.header ? ($header = $json.data.shift()) : \"\";\r\n $configuration.footer ? ($footer = $json.data.pop()) : \"\";\r\n\r\n // Output the HTML structure for the table\r\n var $html = \"\";\r\n $html += '';\r\n\r\n // Add the header\r\n if ($configuration.header) {\r\n // Start the header column\r\n $html += \"\";\r\n // Addind the group column\r\n $html += \"\";\r\n\r\n // Go through all the header cell\r\n $($header).each(function ($index, $value) {\r\n var $cell_class = \"\";\r\n // Add class to second col to align text\r\n $index === 1 ? $cell_class = \"left_align\" : '';\r\n // Add the class and cell value for the header\r\n $html += \"\";\r\n // If this is a total cell add to array to make background darker\r\n $value.toLowerCase().indexOf('total') !== -1 ? $total_columns_index.push($index) : '';\r\n\r\n $column_filters.push({ index: $index + 1, label: $value });\r\n });\r\n\r\n\r\n $html += \"\";\r\n }\r\n\r\n // Addthe body\r\n if ($json.data) {\r\n $html += \"\";\r\n\r\n var $forgroup = \"\";\r\n var $forgroup_label = \"\";\r\n var $forgroup_class = \"\";\r\n $($json.data).each(function ($index, $row) {\r\n\r\n // If the FoR code is one or 3 numbers long add the Zero prefix\r\n $row[0].length < 2 || $row[0].length === 3 ? $row[0] = \"0\" + $row[0] : '';\r\n\r\n // Get the Parent FORCode to group the rows\r\n if ($row[0].length < 3) {\r\n $forgroup = $row[0];\r\n $forgroup_label = $row[1];\r\n $forgroup_class = \"group_header\";\r\n $forgroup_filter.push({ code: $forgroup, label: $forgroup_label });\r\n } else {\r\n $forgroup_class = \"\";\r\n }\r\n\r\n // Add the group class to the row if it is the first item\r\n $html += '';\r\n\r\n // Add the first cell as the FoR group\r\n $html += \"\";\r\n\r\n // Go through each cell and add\r\n $($row).each(function ($index, $cell) {\r\n var $cell_class = \"\";\r\n\r\n if ($raw_value) {\r\n // Do nothing\r\n } else {\r\n // Make sure the value in the cell is 1 decimal place and thousand seperated\r\n if ($decimal_places && $index !== 0 && $index !== 1 && $cell !== \"-\") {\r\n $cell = parseFloat(Number($cell.replace(/,\\s?/g, \"\"))).toFixed($decimal_places).toLocaleString();\r\n $cell = Number($cell).toLocaleString() // Not sure why we need this\r\n }\r\n }\r\n\r\n // Make sure the second column containing the FoR name is left aligned\r\n $index === 1 ? $cell_class = \"left_align\" : '';\r\n\r\n // If the cell is part of the total cell array mark it to change the background color\r\n $total_columns_index.indexOf($index) !== -1 ? $cell_class = \"total_cell\" : '';\r\n\r\n // Add the cell data and class\r\n $html += \"\";\r\n });\r\n\r\n $html += \"\";\r\n });\r\n $html += \"\";\r\n }\r\n\r\n // Add the footer\r\n if ($configuration.footer) {\r\n\r\n // Start of footer\r\n $html += \"\";\r\n // Add a blank column for the total\r\n $html += \"\";\r\n\r\n // Go through each footer cell\r\n $($footer).each(function ($index, $value) {\r\n // Make sure the value is 1 decimal place and has thousand seperator\r\n\r\n if ($raw_value) {\r\n // Do nothing\r\n } else {\r\n if ($decimal_places && $index !== 0 && $index !== 1 && $value !== \"-\") {\r\n $value = parseFloat(Number($value.replace(/,\\s?/g, \"\"))).toFixed($decimal_places).toLocaleString();\r\n $value = Number($value).toLocaleString() // Not sure why we need this\r\n }\r\n }\r\n // Add the value\r\n $html += \"\";\r\n });\r\n\r\n // Close the footer\r\n $html += \"\";\r\n }\r\n\r\n // Close the table\r\n $html += \"
    forgroup\" + $value + \"
    \" + $forgroup + \"\" + $cell + \"
    \" + $value + \"
    \";\r\n\r\n // Add the table on the page\r\n $container.html($html);\r\n\r\n\r\n\r\n // Create the filters for FoR group\r\n var $filter_html = \"\";\r\n\r\n // Go through the filter array\r\n $($forgroup_filter).each(function ($index, $data) {\r\n\r\n // Add the filter markup\r\n $filter_html +=\r\n \"
  • \" +\r\n \"\" +\r\n \"\" +\r\n \"
  • \";\r\n });\r\n\r\n // Add the FoR filter\r\n $container.closest('.section4-tables').find(\".dropdown.widget-container .list\").html($filter_html);\r\n\r\n\r\n\r\n // Make the dataTable\r\n var $columnsDefs;\r\n\r\n\r\n\r\n // Show only 8 columns on the display\r\n $columnsDefs = [\r\n {\r\n targets: 0,\r\n searchable: true,\r\n visible: false\r\n },\r\n {\r\n // targets: [0, 1, 2, 3, 4, $header.length - 1, $header.length], // We can make this a configuration\r\n targets: [\"_all\"], // We can make this a configuration\r\n visible: true\r\n },\r\n {\r\n targets: [\"_all\"],\r\n searchable: false,\r\n visible: false\r\n }\r\n ];\r\n\r\n // console.log($columnsDefs);\r\n\r\n $configuration[\"show_all_columns\"] ? $columnsDefs[1] = { targets: [1, 2, 3], visible: true } : '';\r\n\r\n $configuration[\"columnDefs\"] = $columnsDefs;\r\n\r\n // Configuration for buttons to filter columns \r\n $configuration[\"buttons\"] = [\r\n {\r\n extend: \"colvis\",\r\n text: \"Columns to display\",\r\n background: true,\r\n backgroundClassName: 'fancy-table-button-background'\r\n }\r\n ];\r\n\r\n // Make the table a Datatable\r\n $tables['table_' + $table_counter] = $container.find(\"table\").DataTable($configuration);\r\n\r\n // Add the column filter buttons\r\n // console.log($tables['table_' + $table_counter].buttons().container().html());\r\n // var $button_html = $tables['table_' + $table_counter].buttons().container().html();\r\n // $container.closest(\".table\").find(\".buttons\").append($button_html);\r\n\r\n $tables['table_' + $table_counter].buttons().container().appendTo($container.closest(\".table\").find(\".buttons\"));\r\n\r\n\r\n\r\n // Bind the change action to the filter checkboxes\r\n $(\".dropdown.widget-container .list li.table_group_\" + $table_counter + \" input\").change(function () {\r\n\r\n // When a checkbox is ticked go through the list and build the search filter\r\n var $value = '';\r\n var $table_target = $(this).data('table-target');\r\n\r\n $(this).closest('.dropdown.widget-container').find(\"input:checked\").each(function () {\r\n $value += $(this).val() + \"|\"\r\n })\r\n\r\n // console.log($value);\r\n\r\n // After collecting all the values check if there is anything to filter\r\n if ($value) {\r\n // Use a regex to filter the full value\r\n // console.log($table_target);\r\n // console.log($tables['table_' + $table_target]);\r\n $tables['table_' + $table_target].search(\"^\\\\s*(\" + $value + \")\\\\s*$\", true, false, true).draw();\r\n $(this).closest('.widget-container').find('.selected span').html($value.slice(0, -1).replace(/\\|/g, \", \"));\r\n\r\n } else {\r\n // If no checkbox is ticked then show everything\r\n $tables['table_' + $table_target].search('').draw();\r\n $(this).closest('.widget-container').find('.selected span').html('All');\r\n }\r\n\r\n });\r\n\r\n },\r\n error: function ($err, $file, $inputElem, $reason) {\r\n\r\n $container.closest(\".collapsible-box\").addClass(\"no-data\");\r\n if ($err[\"message\"] === \"Not Found\" || $err[\"message\"] === \"\") {\r\n var $textfile = $configuration.url.substr(0, $configuration.url.lastIndexOf(\"/\") + 1) + \"no.table.footnote.txt\"; // remove everything after the last backslash\r\n var $error_message = \"Data not found\";\r\n $.ajax({\r\n url: $textfile\r\n })\r\n .done(function ($data) {\r\n $data ? ($error_message = $data) : \"\";\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n })\r\n .fail(function ($error) {\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n });\r\n }\r\n }\r\n });\r\n });\r\n\r\n // Make sure there is no empty table\r\n $('body').on('click', \".column-filter-buttons.widget-container button.buttons-columnVisibility\", function ($event) {\r\n if ($(this).closest('.column-filter-buttons').find('.buttons-columnVisibility.active').length === 0) {\r\n $(this).closest('.column-filter-buttons').find('.buttons-columnVisibility').each(function () {\r\n if ($(this).data('cv-idx') !== 0) {\r\n $(this).addClass('auto-clicked');\r\n $(this).click();\r\n }\r\n })\r\n }\r\n });\r\n $('body').on('click', \".column-filter-buttons.widget-container button.buttons-colvis\", function ($event) {\r\n // $event.preventDefault();\r\n // $event.stopPropagation();\r\n // var $button = $(this);\r\n\r\n // if ($button.hasClass('clicked')) {\r\n\r\n // setTimeout(function () {\r\n // $button.closest('.column-filter-buttons').find('.dt-button-collection').hide();\r\n // $button.removeClass('clicked')\r\n // console.log('clicked');\r\n // }, 100);\r\n // } else {\r\n // $button.addClass('clicked')\r\n // }\r\n });\r\n $('body').on('touchstart', \".fancy-table-button-background\", function ($event) {\r\n $('.fancy-table-button-background').click();\r\n });\r\n\r\n // Bind the expland action for FoR filters\r\n $('.widget-container button').click(function ($event) {\r\n $event.stopPropagation()\r\n $(this).siblings('.list').toggleClass('active');\r\n $(this).toggleClass('active');\r\n })\r\n\r\n // Clicking on body to close the filters\r\n $('body').click(function () {\r\n $('.widget-container .selected').removeClass('active');\r\n $('.widget-container .list').removeClass('active');\r\n })\r\n\r\n // Clicking on the open filer dropdown. Stop propagation\r\n $('.widget-container .list').click(function ($event) {\r\n $event.stopPropagation();\r\n });\r\n};\r\n\r\nmodule.exports = TableSection4;\r\n\n},{}],11:[function(require,module,exports){\n/* global Papa */\r\n\r\n\"use strict\";\r\n\r\n// Constructor\r\nvar Tablesection5 = function () {\r\n var $table_counter = 0;\r\n var $tables = [];\r\n $(\".csv-table-section5\").each(function () {\r\n var $header; // The header row\r\n var $footer; // The footer row\r\n var $container = $(this);\r\n var $configuration = $container.data(\"configuration\"); // The configuration object from the data attribute\r\n var $table_css_class = $configuration.style ? $configuration.style : \"\";\r\n // var $decimal_places = typeof $configuration.decimal_places === \"undefined\" ? false : $configuration.decimal_places; //Decimal places to show\r\n var $decimal_places = 0; //Decimal places to show\r\n var $forgroup_filter = [];\r\n var $institutions = [];\r\n var $disciplines = [];\r\n var $column_filters = [];\r\n var $total_columns_index = [];\r\n\r\n // Pulls the CSV data in json\r\n Papa.parse($configuration.url, {\r\n download: true,\r\n dynamicTyping: false,\r\n skipEmptyLines: true,\r\n complete: function ($json) {\r\n\r\n // Increment the table counter to use for IDs etc\r\n $table_counter++;\r\n\r\n // Process the data\r\n $configuration.header ? ($header = $json.data.shift()) : \"\";\r\n $configuration.footer ? ($footer = $json.data.pop()) : \"\";\r\n\r\n // Output the HTML structure for the table\r\n var $html = \"\";\r\n var $highlight_column = [];\r\n $html += '';\r\n\r\n // Add the header\r\n if ($configuration.header) {\r\n // Start the header column\r\n $html += \"\";\r\n // Addind the group column\r\n // $html += \"\";\r\n\r\n // Go through all the header cell\r\n\r\n $($header).each(function ($index, $value) {\r\n // console.log($value.substr(0, $value.indexOf(' ')));\r\n $value.substr(0, $value.indexOf(' ')).length === 2 ? $highlight_column.push($index) : ''; // If column is 2 digit mark to highlight\r\n\r\n var $forcode = $value.substring(0, 2);\r\n var $cell_class = \"\";\r\n // Add class to second col to align text\r\n $index === 1 ? $cell_class = \"left_align\" : '';\r\n // Add the class and cell value for the header\r\n $html += \"\";\r\n // If this is a total cell add to array to make background darker\r\n $value.toLowerCase().indexOf('total') !== -1 ? $total_columns_index.push($index) : '';\r\n\r\n $column_filters.push({ index: $index + 1, label: $value });\r\n // console.log($value.substr(0, $value.indexOf(' ')))\r\n\r\n if ($value.substr(0, $value.indexOf(' ')).length === 2) {\r\n $disciplines.push({ code: $value.substr(0, $value.indexOf(' ')), label: $value.substr($value.indexOf(' ') + 1) })\r\n }\r\n });\r\n\r\n // console.log($disciplines);\r\n\r\n $html += \"\";\r\n }\r\n\r\n // console.log($highlight_column);\r\n // Addthe body\r\n if ($json.data) {\r\n $html += \"\";\r\n\r\n var $forgroup = \"\";\r\n var $forgroup_label = \"\";\r\n var $forgroup_class = \"\";\r\n $($json.data).each(function ($index, $row) {\r\n\r\n // If the FoR code is one or 3 numbers long add the Zero prefix\r\n $row[0].length < 2 || $row[0].length === 3 ? $row[0] = \"0\" + $row[0] : '';\r\n\r\n $institutions.push({ label: $row[0] });\r\n\r\n // Add the group class to the row if it is the first item\r\n $html += '';\r\n\r\n // Go through each cell and add\r\n $($row).each(function ($index, $cell) {\r\n var $cell_class = \"\";\r\n\r\n // Make sure the value in the cell is 1 decimal place and thousand seperated\r\n if ($decimal_places && $index !== 0 && $index !== 1 && $cell !== \"-\" && $cell !== \"n/a\") {\r\n $cell = parseFloat(Number($cell.replace(/,\\s?/g, \"\"))).toFixed($decimal_places).toLocaleString();\r\n $cell = Number($cell).toLocaleString() // Not sure why we need this\r\n }\r\n\r\n // Make sure the second column containing the FoR name is left aligned\r\n // $index === 1 ? $cell_class = \"left_align\" : '';\r\n\r\n // If cell is N/A add a class to fade\r\n $cell === 'n/a' ? $cell_class += \"fade\" : '';\r\n\r\n // If cell is marked to highlight\r\n $highlight_column.indexOf($index) !== -1 ? $cell_class += \" highlight\" : ''; // If cell marked to highlight\r\n\r\n // If the cell is part of the total cell array mark it to change the background color\r\n $total_columns_index.indexOf($index) !== -1 ? $cell_class += \"total_cell\" : '';\r\n\r\n // Add the cell data and class\r\n $html += \"\";\r\n });\r\n\r\n $html += \"\";\r\n });\r\n $html += \"\";\r\n }\r\n\r\n // Add the footer\r\n if ($configuration.footer) {\r\n\r\n // Start of footer\r\n $html += \"\";\r\n // Add a blank column for the total\r\n // $html += \"\";\r\n\r\n // Go through each footer cell\r\n $($footer).each(function ($index, $value) {\r\n // Make sure the value is 1 decimal place and has thousand seperator\r\n if ($decimal_places && $index !== 0 && $index !== 1 && $value !== \"-\") {\r\n $value = parseFloat(Number($value.replace(/,\\s?/g, \"\"))).toFixed($decimal_places).toLocaleString();\r\n $value = Number($value).toLocaleString() // Not sure why we need this\r\n }\r\n // Add the value\r\n $html += \"\";\r\n });\r\n\r\n // Close the footer\r\n $html += \"\";\r\n }\r\n\r\n // Close the table\r\n $html += \"
    forgroup\" + $value + \"
    \" + $cell + \"
    \" + $value + \"
    \";\r\n\r\n // Add the table on the page\r\n $container.html($html);\r\n\r\n\r\n\r\n // Create the filters for FoR group\r\n var $filter_html = \"\";\r\n\r\n // Go through the filter array\r\n $($disciplines).each(function ($index, $data) {\r\n\r\n // Add the filter markup\r\n $filter_html +=\r\n \"
  • \" +\r\n \"\" +\r\n \"\" +\r\n \"
  • \";\r\n });\r\n\r\n // Add the FoR filter\r\n $container.closest('.section5-tables').find(\".buttons.widget-container .list\").html($filter_html);\r\n\r\n\r\n // Create the filters for FoR group\r\n var $filter_html = \"\";\r\n\r\n // Go through the filter array\r\n $($institutions).each(function ($index, $data) {\r\n\r\n // Add the filter markup\r\n $filter_html +=\r\n \"
  • \" +\r\n \"\" +\r\n \"\" +\r\n \"
  • \";\r\n });\r\n\r\n // Add the FoR filter\r\n $container.closest('.section5-tables').find(\".dropdown.widget-container .list\").html($filter_html);\r\n\r\n\r\n\r\n\r\n // Make the dataTable\r\n var $columnsDefs;\r\n\r\n // Show only 8 columns on the display\r\n $columnsDefs = [\r\n {\r\n targets: 0,\r\n searchable: true,\r\n visible: true\r\n },\r\n {\r\n // targets: [0, 1, $header.length - 1, $header.length], // We can make this a configuration\r\n targets: [\"_all\"],\r\n visible: true\r\n },\r\n {\r\n targets: [\"_all\"],\r\n searchable: false,\r\n visible: false\r\n }\r\n ];\r\n $configuration[\"columnDefs\"] = $columnsDefs;\r\n\r\n // Make the table a Datatable\r\n $tables['table_' + $table_counter] = $container.find(\"table\").DataTable($configuration);\r\n\r\n\r\n var $visible = [];\r\n var $hidden = [];\r\n var $datatable = $tables['table_' + $table_counter];\r\n\r\n // Bind the change action to the filter checkboxes\r\n $(\".dropdown.widget-container .list li.table_group_\" + $table_counter + \" input\").change(function () {\r\n\r\n // When a checkbox is ticked go through the list and build the search filter\r\n var $value = '';\r\n var $table_target = $(this).data('table-target');\r\n var $counter = 0;\r\n\r\n $(this).closest('.dropdown.widget-container').find(\"input:checked\").each(function () {\r\n $value += $(this).val() + \"|\";\r\n $counter++;\r\n })\r\n\r\n // console.log($value);\r\n\r\n // After collecting all the values check if there is anything to filter\r\n if ($value) {\r\n // Use a regex to filter the full value\r\n // console.log($table_target);\r\n // console.log($tables['table_' + $table_target]);\r\n $tables['table_' + $table_target].search(\"^\\\\s*(\" + $value + \")\\\\s*$\", true, false, true).draw();\r\n $(this).closest('.widget-container').find('.selected span').html($counter);\r\n\r\n } else {\r\n // If no checkbox is ticked then show everything\r\n $tables['table_' + $table_target].search('').draw();\r\n $(this).closest('.widget-container').find('.selected span').html('All');\r\n }\r\n\r\n });\r\n\r\n\r\n // Bind the change action to the filter checkboxes\r\n $(\".buttons.widget-container .list li.table_group_\" + $table_counter + \" input\").change(function () {\r\n\r\n // When a checkbox is ticked go through the list and build the search filter\r\n var $value = '';\r\n var $table_target = $(this).data('table-target');\r\n var $counter = 0;\r\n var $selected = [];\r\n var $datatable = $tables['table_' + $table_target];\r\n\r\n\r\n $(this).closest('.buttons.widget-container').find(\"input:checked\").each(function () {\r\n $value += $(this).val() + \"|\";\r\n $counter++;\r\n $selected.push(parseInt($(this).val()));\r\n })\r\n\r\n // console.log($selected);\r\n\r\n // After collecting all the values check if there is anything to filter\r\n if ($value) {\r\n // Use a regex to filter the full value\r\n $(this).closest('.widget-container').find('.selected span').html($value.slice(0, -1).replace(/\\|/g, \", \"));\r\n\r\n // Go through the columns and check if the for is in it the selected array\r\n $datatable.columns().every(function ($index) {\r\n var $forcode = $(this.header()).data('forcode');\r\n\r\n if ($index > 0) {\r\n // console.log('For code from header',$forcode);\r\n\r\n if ($selected.indexOf($forcode) > -1 || $selected.indexOf(Number($forcode)) > -1) {\r\n this.visible(true, false);\r\n } else {\r\n this.visible(false, false);\r\n }\r\n }\r\n });\r\n $datatable.columns.adjust().draw(false)\r\n\r\n } else {\r\n $(this).closest('.widget-container').find('.selected span').html('All');\r\n $datatable.columns().visible(true);\r\n }\r\n\r\n $datatable.columns.adjust().draw(false)\r\n });\r\n\r\n\r\n // On page load check if there is a FOR code in the url, if there is then tick the box in the \r\n // filter dropdown and filter the table\r\n if (getForFromURL()) {\r\n var $forFromURL = getForFromURL();\r\n setTimeout(function () {\r\n $(\".buttons.widget-container .list li.table_group_\" + $table_counter + \" input[value='\" + $forFromURL + \"']\").prop('checked', true);\r\n $(\".buttons.widget-container .list li.table_group_\" + $table_counter + \" input[value='\" + $forFromURL + \"']\").change();\r\n }, 200);\r\n }\r\n\r\n },\r\n error: function ($err, $file, $inputElem, $reason) {\r\n\r\n $container.closest(\".collapsible-box\").addClass(\"no-data\");\r\n if ($err[\"message\"] === \"Not Found\" || $err[\"message\"] === \"\") {\r\n var $textfile = $configuration.url.substr(0, $configuration.url.lastIndexOf(\"/\") + 1) + \"no.table.footnote.txt\"; // remove everything after the last backslash\r\n var $error_message = \"Data not found\";\r\n $.ajax({\r\n url: $textfile\r\n })\r\n .done(function ($data) {\r\n $data ? ($error_message = $data) : \"\";\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n })\r\n .fail(function ($error) {\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n });\r\n }\r\n }\r\n });\r\n });\r\n\r\n function getForFromURL() {\r\n var $vars = {};\r\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {\r\n $vars[key] = value;\r\n });\r\n if ($vars['for']) {\r\n var $forcode = $vars['for'].substring(0, 2);\r\n return $forcode;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Tablesection5;\r\n\n},{}],12:[function(require,module,exports){\n'use strict';\r\n\r\n// Constructor\r\nvar Header = function () {\r\n $('.slide2').waypoint(function ($direction) {\r\n if ($direction === 'up') {\r\n $('.home .header').removeClass('shrink');\r\n } else {\r\n $('.home .header').addClass('shrink');\r\n }\r\n }, {\r\n offset: $('.slide1').height() / window.innerHeight * 100 * 0.87 + '%'\r\n });\r\n\r\n $('.slide2').waypoint(function ($direction) {\r\n if ($direction === 'up') {\r\n $('.home .menu-trigger').removeClass('dark');\r\n } else {\r\n $('.home .menu-trigger').addClass('dark');\r\n }\r\n }, {\r\n offset: '10%'\r\n });\r\n $('.slide5').waypoint(function ($direction) {\r\n if ($direction === 'up') {\r\n $('.home .menu-trigger').addClass('dark');\r\n } else {\r\n $('.home .menu-trigger').removeClass('dark');\r\n }\r\n }, {\r\n offset: '10%'\r\n });\r\n};\r\n\r\nmodule.exports = Header;\r\n\n},{}],13:[function(require,module,exports){\n'use strict';\r\n\r\n// Constructor\r\nvar Slide1 = function () {\r\n $('.slide1').waypoint(function () {\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide1').addClass('active');\r\n $('.slide1 .leaf').addClass('active');\r\n \r\n }, {\r\n offset: '0%'\r\n }); \r\n};\r\n\r\nmodule.exports = Slide1;\r\n\n},{}],14:[function(require,module,exports){\n'use strict';\r\n\r\n// Constructor\r\nvar Slide2 = function () {\r\n var $counters = {};\r\n\r\n // Create the counter objects\r\n $('.slide2 .number').each(function () {\r\n $counters[$(this).data('name')] = new CountUp($(this)[0], 0, $(this).data('end'), $(this).data('decimal'), 2.5, {\r\n useEasing: true,\r\n useGrouping: true,\r\n separator: ',',\r\n decimal: '.',\r\n prefix: $(this).data('prefix') ? $(this).data('prefix') : '',\r\n suffix: $(this).data('suffix') ? $(this).data('suffix') : ''\r\n });\r\n\r\n// $(this).html('0');\r\n });\r\n\r\n // When hitting the slide animate the numbers\r\n $('.slide2').waypoint(function () {\r\n $('.slide2 .number').each(function () {\r\n if (!$counters[$(this).data('name')].error) {\r\n $counters[$(this).data('name')].start();\r\n } else {\r\n console.error($counters[$(this).data('name')].error);\r\n }\r\n\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide2').addClass('active');\r\n $('.slide2 .right').addClass('active');\r\n });\r\n }, {\r\n offset: '25%'\r\n });\r\n\r\n $('.slide2').waypoint(function () {\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide1').addClass('active');\r\n }, {\r\n offset: '99%'\r\n });\r\n\r\n\r\n};\r\n\r\nmodule.exports = Slide2;\r\n\n},{}],15:[function(require,module,exports){\n'use strict';\r\n\r\n// Constructor\r\nvar Slide3 = function () {\r\n $('.slide3').waypoint(function () {\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide3').addClass('active');\r\n\r\n // Activate the chart\r\n setTimeout(function () {\r\n if (window.charts_collection['home-chart']) {\r\n window.charts_collection['home-chart'].update({\r\n duration: 800,\r\n lazy: false,\r\n easing: 'easeOutBounce'\r\n });\r\n }\r\n }, 300);\r\n }, {\r\n offset: '5%'\r\n });\r\n\r\n $('.slide3').waypoint(function () {\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide2').addClass('active');\r\n $('.slide3').addClass('active');\r\n }, {\r\n offset: '99%'\r\n });\r\n\r\n\r\n // If on home page then draw the chart only when canvas in focus\r\n if ($('main.home').length > 0) {\r\n setTimeout(function () {\r\n if (window.charts_collection['home-chart']) {\r\n window.charts_collection['home-chart'].reset();\r\n }\r\n }, 100);\r\n }\r\n};\r\n\r\nmodule.exports = Slide3;\r\n\n},{}],16:[function(require,module,exports){\n'use strict';\r\n\r\n// Constructor\r\nvar Slide4 = function () {\r\n $('.slide4').waypoint(function () {\r\n $('.slide4 .canvas').addClass('active');\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide4').addClass('active');\r\n\r\n }, {\r\n offset: '25%'\r\n });\r\n\r\n $('.slide4').waypoint(function () {\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide3').addClass('active');\r\n }, {\r\n offset: '99%'\r\n });\r\n};\r\n\r\nmodule.exports = Slide4;\r\n\n},{}],17:[function(require,module,exports){\n'use strict';\r\n\r\n// Constructor\r\nvar Slide5 = function () {\r\n $('.slide5').waypoint(function () {\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide5').addClass('active');\r\n $('.slide5 .leaf').addClass('active');\r\n }, {\r\n offset: '5%'\r\n });\r\n\r\n $('.slide5').waypoint(function () {\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide4').addClass('active');\r\n }, {\r\n offset: '99%'\r\n });\r\n};\r\n\r\nmodule.exports = Slide5;\r\n\n},{}],18:[function(require,module,exports){\n'use strict';\r\n\r\n// Constructor\r\nvar Slider = function () {\r\n $('.slides .links a, .slider button').click(function ($event) {\r\n $event.preventDefault();\r\n var $top = $(\".slides.\" + $(this).data('slide')).offset().top ? $(\".slides.\" + $(this).data('slide')).offset().top : 0;\r\n $(\"html, body\").stop().animate({scrollTop: $top}, 500, 'swing', function () {\r\n // Waypoint triggers the actions\r\n });\r\n });\r\n};\r\n\r\nmodule.exports = Slider;\r\n\n},{}],19:[function(require,module,exports){\n'use strict';\r\n\r\n// Constructor\r\nvar Slides = function () {\r\n// this.name = 'slides';\r\n// console.log('%s module', this.name);\r\n\r\n if ($('main.home').length > 0) {\r\n window.onbeforeprint = function (event) {\r\n\r\n $(\"html, body\").stop().animate({scrollTop: document.body.scrollHeight}, 10, 'swing', function () {\r\n\r\n $(\"html, body\").stop().animate({scrollTop: (document.body.scrollHeight * -1)}, 10, 'swing', function () {\r\n // Waypoint triggers the actions\r\n });\r\n });\r\n };\r\n }\r\n\r\n// var mediaQueryList = window.matchMedia('print');\r\n// mediaQueryList.addListener(function (mql) {\r\n// if (mql.matches) {\r\n// console.log('webkit equivalent of onbeforeprint');\r\n//// window.scrollTo(0, document.body.scrollHeight);\r\n// $('.slide2 .right').addClass('active');\r\n//\r\n//\r\n// }\r\n// });\r\n\r\n\r\n\r\n};\r\n\r\nmodule.exports = Slides;\r\n\n},{}],20:[function(require,module,exports){\n// Main javascript entry point\r\n// Should handle bootstrapping/starting application\r\n\r\n'use strict';\r\n\r\nvar Chartblock = require('../_modules/data/chartblock/chartblock');\r\nvar Table = require('../_modules/data/table/table');\r\nvar TableSection1 = require('../_modules/data/table/table.section1');\r\nvar TableSection4 = require('../_modules/data/table/table.section4');\r\nvar Tablesection5 = require('../_modules/data/table/table.section5');\r\n\r\nvar Header = require('../_modules/home/header/header');\r\nvar Slides = require('../_modules/home/slides/slides');\r\nvar Slide1 = require('../_modules/home/slide1/slide1');\r\nvar Slide2 = require('../_modules/home/slide2/slide2');\r\nvar Slide3 = require('../_modules/home/slide3/slide3');\r\nvar Slide4 = require('../_modules/home/slide4/slide4');\r\nvar Slide5 = require('../_modules/home/slide5/slide5');\r\nvar Slider = require('../_modules/home/slider/slider');\r\nvar CommonHeader = require('../_modules/common/header/header');\r\nvar TitleBar = require('../_modules/common/title-bar/title-bar');\r\nvar CollapsibleBox = require('../_modules/common/collapsible-box/collapsible-box');\r\nvar PageScroll = require('../_modules/common/page-scroll/page-scroll');\r\nvar TabBox = require('../_modules/common/tab-box/tab-box');\r\nvar MainNavigation = require('../_modules/common/main-navigation/main-navigation');\r\n\r\n\r\n// Reset the chart array\r\nwindow.charts_collection = [];\r\n\r\n\r\n$(function() {\r\n new Chartblock();\r\n new Table();\r\n new TableSection1();\r\n new TableSection4();\r\n new Tablesection5();\r\n \r\n new CommonHeader();\r\n new CollapsibleBox();\r\n new TabBox();\r\n new MainNavigation();\r\n new PageScroll();\r\n new TitleBar();\r\n \r\n new Header();\r\n new Slides();\r\n new Slide1();\r\n new Slide2();\r\n new Slide3();\r\n new Slide4();\r\n new Slide5();\r\n new Slider();\r\n});\r\n\n},{\"../_modules/common/collapsible-box/collapsible-box\":1,\"../_modules/common/header/header\":2,\"../_modules/common/main-navigation/main-navigation\":3,\"../_modules/common/page-scroll/page-scroll\":4,\"../_modules/common/tab-box/tab-box\":5,\"../_modules/common/title-bar/title-bar\":6,\"../_modules/data/chartblock/chartblock\":7,\"../_modules/data/table/table\":8,\"../_modules/data/table/table.section1\":9,\"../_modules/data/table/table.section4\":10,\"../_modules/data/table/table.section5\":11,\"../_modules/home/header/header\":12,\"../_modules/home/slide1/slide1\":13,\"../_modules/home/slide2/slide2\":14,\"../_modules/home/slide3/slide3\":15,\"../_modules/home/slide4/slide4\":16,\"../_modules/home/slide5/slide5\":17,\"../_modules/home/slider/slider\":18,\"../_modules/home/slides/slides\":19}]},{},[20])\n\n","'use strict';\r\n\r\n// Constructor\r\nvar CommonHeader = function () {\r\n $('.title-bar').waypoint(function ($direction) {\r\n if ($direction === 'up') {\r\n $('.inner-page .header').removeClass('stuck');\r\n $('body').removeClass('stuck');\r\n } else {\r\n $('.inner-page .header').addClass('stuck');\r\n $('body').addClass('stuck');\r\n }\r\n }, {\r\n offset: '90px'\r\n });\r\n \r\n};\r\n\r\nmodule.exports = CommonHeader;\r\n","'use strict';\r\n\r\n// Constructor\r\nvar MainNavigation = function () {\r\n// $(\".nano\").nanoScroller();\r\n\r\n $('.menu-trigger, .start-exploring-report').click(function ($event) {\r\n $event.preventDefault();\r\n $('.main-navigation .level1').addClass('active');\r\n $('.main-navigation-overlay').addClass('active');\r\n $(\".nano\").nanoScroller();\r\n $('body').addClass('locked');\r\n });\r\n\r\n $('.close-menu, .main-navigation-overlay').click(function () {\r\n $('.main-navigation .level1').removeClass('active');\r\n $('.main-navigation .level2').removeClass('active');\r\n $('.main-navigation .level3').removeClass('active');\r\n $('.main-navigation .parent').removeClass('active');\r\n $('.main-navigation-overlay').removeClass('active');\r\n $('body').removeClass('locked');\r\n });\r\n\r\n $('body').on('click', '.close-menu-3', function () {\r\n $('.main-navigation .level3').removeClass('active');\r\n });\r\n\r\n $('body').on('click', '.close-menu-2', function () {\r\n $('.main-navigation .level2').removeClass('active');\r\n });\r\n\r\n $('body').on('click', '.main-navigation .parent', function ($event) {\r\n $event.preventDefault();\r\n\r\n\r\n\r\n\r\n // If it was coming from level 1 then close the sub links\r\n if ($(this).closest('.level').hasClass('level1')) {\r\n $('.main-navigation .level2').removeClass('active');\r\n $('.main-navigation .level3').removeClass('active');\r\n\r\n // Remove the active class from the level 1 links\r\n $('.main-navigation .level1 .parent').removeClass('active');\r\n }\r\n\r\n // If it was coming from level 2 then close the sub links\r\n if ($(this).closest('.level').hasClass('level2')) {\r\n // Remove the active class from the level 1 links\r\n $('.main-navigation .level2 .parent').removeClass('active');\r\n }\r\n\r\n // Add active class to current level 1 link\r\n $(this).addClass('active');\r\n\r\n\r\n // Computes the nanoscroller height\r\n var $height_substractor = window.innerWidth > 1600 ? 140 : 90;\r\n\r\n // Activate the sub menu and add the content\r\n if ($(this).siblings('.sub-menu').hasClass('sub-menu-2')) {\r\n if ($(this).siblings('.sub-menu').html().length > 0) {\r\n $('.main-navigation .level2').html($(this).siblings('.sub-menu').html()).addClass('active');\r\n } else {\r\n// $('.main-navigation .level2').html('

    No Sub items

    ').addClass('active');\r\n }\r\n\r\n var $level2_height = $('.main-navigation .level2.active').height() - $('.main-navigation .level2.active h3').height() - $('.main-navigation .level2.active button').height() - $('.main-navigation .level2.active .overview-title').height() - $height_substractor;\r\n $(\".main-navigation .level2 .nano\").height($level2_height);\r\n $(\".main-navigation .level2 .nano\").nanoScroller();\r\n\r\n } else {\r\n if ($(this).siblings('.sub-menu').html().length > 0) {\r\n $('.main-navigation .level3').html($(this).siblings('.sub-menu').html()).addClass('active');\r\n } else {\r\n// $('.main-navigation .level3').html('

    No Sub items

    ').addClass('active');\r\n }\r\n setTimeout(function () {\r\n var $level3_height = $('.main-navigation .level2.active').height() - $('.main-navigation .level2.active h3').height() - $('.main-navigation .level2.active button').height() - $('.main-navigation .level2.active .overview-title').height() - $height_substractor;\r\n $(\".main-navigation .level3 .nano\").height($level3_height);\r\n $(\".main-navigation .level3 .nano\").nanoScroller();\r\n }, 400);\r\n }\r\n\r\n });\r\n\r\n};\r\n\r\nmodule.exports = MainNavigation;\r\n","'use strict';\n\n// Constructor\nvar PageScroll = function () {\n if ($('main.introduction').length > 0) {\n var $id = getUrlParam('id', 'none');\n if ($('#' + $id).length) {\n $(\"html, body\").animate({ scrollTop: $('#' + $id).offset().top - 300 }, 1000);\n }\n }\n if ($('main.appendix').length > 0) {\n console.log('appendix');\n $(\"html, body\").animate({ scrollTop: 0 }, 0); // Scroll page to top\n setTimeout(function () {\n if ($id = getUrlBookmark()) {\n $('a[name=' + $id + ']').length ? $(\"html, body\").animate({ scrollTop: $('a[name=' + $id + ']').offset().top - 300 }, 1000) : '';\n }\n }, 100);\n\n\n $('main.appendix .text-block a[href^=\"#\"]').click(function ($event) {\n $event.preventDefault();\n var url = $(this).attr('href')\n var $id = url.substring(url.indexOf(\"#\") + 1);\n $('a[name=' + $id + ']').length ? $(\"html, body\").animate({ scrollTop: $('a[name=' + $id + ']').offset().top - 300 }, 1000) : '';\n });\n }\n\n function getUrlParam(parameter, defaultvalue) {\n var urlparameter = defaultvalue;\n if (window.location.href.indexOf(parameter) > -1) {\n urlparameter = getUrlVars()[parameter];\n }\n return urlparameter;\n }\n\n function getUrlBookmark() {\n var url = window.location.href;\n if (url.indexOf('#') > -1) {\n var $id = url.substring(url.indexOf(\"#\") + 1);\n return $id;\n }\n return false;\n }\n\n function getUrlVars() {\n var vars = {};\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {\n vars[key] = value;\n });\n return vars;\n }\n};\n\nmodule.exports = PageScroll;\n","'use strict';\r\n\r\n// Constructor\r\nvar TabBox = function () {\r\n $('.tab-box .switch button').click(function ($event) {\r\n $event.preventDefault();\r\n $(this).closest('.tab-box').find('.tab-container').removeClass('active');\r\n $(this).closest('.tab-box').find('.switch button').removeClass('active');\r\n $(this).closest('.tab-box').find('.' + $(this).data('target')).addClass('active');\r\n $(this).addClass('active');\r\n\r\n $(this).closest('.collapsible-box').addClass('expanded'); // Makes it easier to just click the tab and it expands the box\r\n });\r\n};\r\n\r\nmodule.exports = TabBox;\r\n","'use strict';\r\n\r\n// Constructor\r\nvar TitleBar = function () {\r\n\r\n var $url;\r\n\r\n $('.share-page a').click(function () {\r\n\r\n console.log(encodeURIComponent(window.location.origin + window.location.pathname));\r\n\r\n if ($(this).hasClass('facebook')) {\r\n $url = 'https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(window.location.origin + window.location.pathname);\r\n } else if ($(this).hasClass('twitter')) {\r\n $url = 'https://twitter.com/intent/tweet?url=' + encodeURIComponent(window.location.origin + window.location.pathname) + '&text=' + $('.title-bar h2').text();\r\n } else if ($(this).hasClass('print')) {\r\n window.print();\r\n return true;\r\n } else if ($(this).hasClass('email')) {\r\n $url = 'mailto:?subject=' + $('.title-bar h2').text() + '&body=' + window.location.origin + window.location.pathname;\r\n }\r\n\r\n var height = 300;\r\n var width = 500;\r\n var left = (screen.width / 2) - (width / 2);\r\n var top = (screen.height / 2) - (height / 2);\r\n\r\n window.open($url, \"\", \"menubar=no, toolbar=no, resizable=yes, scrollbars=yes, width=\" + width + \", height=\" + height + \", top=\" + top + \", left=\" + left);\r\n return true;\r\n })\r\n};\r\n\r\nmodule.exports = TitleBar;\r\n","/* global Papa, $charts_collection */\r\n\r\n'use strict';\r\n\r\nwindow.charts_collection = {};\r\nwindow.dataset_collection = {};\r\nwindow.labels_collection = {};\r\nwindow.original_labels = {};\r\n\r\n// Constructor\r\nvar Chartblock = function () {\r\n var $legend_box_width = 20;\r\n var $legend_padding = 18;\r\n var $legend_font_size = 16;\r\n\r\n // Go through each chart element on the page\r\n $('.csv-chart').each(function () {\r\n var $header; // The header row\r\n var $container = $(this);\r\n var original = Chart.defaults.global.legend.onClick; // We keep the original legend onclick\r\n var $chart_reference = $container.data('reference') ? $container.data('reference') : 'no-ref-' + makeid();\r\n var $configuration = $container.data('configuration'); // The configuration object from the data attribute\r\n var $type = $configuration.type ? $configuration.type : 'horizontalBar'; // Type of chart\r\n var $x_axis = typeof $configuration.x_axis === 'undefined' ? true : $configuration.x_axis; // Show x axis and gridlines\r\n var $x_axis_label_show = typeof $configuration.x_axis_label === 'undefined' ? false : true; // Show x axis label\r\n var $x_axis_label_text = typeof $configuration.x_axis_label === 'undefined' ? false : $configuration.x_axis_label; // Show x axis label\r\n var $y_axis_label_show = typeof $configuration.y_axis_label === 'undefined' ? false : true; // Show y axis label\r\n var $y_axis_label_text = typeof $configuration.y_axis_label === 'undefined' ? false : $configuration.y_axis_label; // Show y axis label\r\n var $y_axis = typeof $configuration.y_axis === 'undefined' ? true : $configuration.y_axis; // Show y axis and gridlines\r\n var $y_axis_leading_zero = typeof $configuration.y_axis_leading_zero === 'undefined' ? false : $configuration.y_axis_leading_zero; // Show y axis and gridlines\r\n var $y_axis_suffix = typeof $configuration.y_axis_suffix === 'undefined' ? false : $configuration.y_axis_suffix; // Suffix like %\r\n var $y_axis_is_year = typeof $configuration.y_axis_is_year === 'undefined' ? false : $configuration.y_axis_is_year; // No number format for years\r\n var $y_raw = typeof $configuration.y_raw === 'undefined' ? false : $configuration.y_raw; // No number format \r\n var $x_axis_is_year = typeof $configuration.x_axis_is_year === 'undefined' ? false : $configuration.x_axis_is_year; // No number format for years\r\n var $x_axis_no_percentage = typeof $configuration.x_axis_no_percentage === 'undefined' ? false : $configuration.x_axis_no_percentage; // Prevent adding % sign at the end\r\n var $x_gridlines = typeof $configuration.x_gridlines === 'undefined' ? true : $configuration.x_gridlines; // Show gridlines\r\n var $y_gridlines = typeof $configuration.y_gridlines === 'undefined' ? true : $configuration.y_gridlines; // Show gridlines\r\n var $legend = typeof $configuration.legend === 'undefined' ? true : $configuration.legend; // Show or hide legend\r\n var $legend_position = typeof $configuration.legend_position === 'undefined' ? 'right' : $configuration.legend_position; // Show or hide legend\r\n var $single_color = typeof $configuration.single_color === 'undefined' ? false : $configuration.single_color; // Force a single color on chart\r\n var $label_font_size = typeof $configuration.label_font_size === 'undefined' ? 12 : $configuration.label_font_size; // Size of axis labels\r\n var $show_data_labels = typeof $configuration.show_data_labels === 'undefined' ? false : $configuration.show_data_labels; // The label end of charts\r\n var $padding_right = typeof $configuration.padding_right === 'undefined' ? 0 : $configuration.padding_right; //Add padding to the cavas\r\n var $padding_left = typeof $configuration.padding_left === 'undefined' ? 0 : $configuration.padding_left; //Add padding to the cavas\r\n var $bar_line_height = typeof $configuration.bar_line_height === 'undefined' ? 35 : $configuration.bar_line_height; //Add padding to the cavas\r\n var $tooltip_show_currency = typeof $configuration.tooltip_show_currency === 'undefined' ? false : $configuration.tooltip_show_currency; //Show currency in tooltip\r\n var $tooltip_show_percentage = typeof $configuration.tooltip_show_percentage === 'undefined' ? false : $configuration.tooltip_show_percentage; //Show currency in tooltip\r\n var $tooltip_hide_value = typeof $configuration.tooltip_hide_value === 'undefined' ? false : $configuration.tooltip_hide_value; //Hide the tooltip value only show label\r\n var $tooltip_number_format = typeof $configuration.tooltip_number_format === 'undefined' ? false : $configuration.tooltip_number_format; //Add thousand seperators\r\n var $tooltip_decimal = typeof $configuration.tooltip_decimal === 'undefined' ? false : $configuration.tooltip_decimal; //Add thousand seperators\r\n var $disable_filter = typeof $configuration.disable_filter === 'undefined' ? false : $configuration.disable_filter; //Disable clicking on legend\r\n var $chart_stack = typeof $configuration.chart_stack === 'undefined' ? true : $configuration.chart_stack; //If not defined charts are stacked by default\r\n var $external_filter = typeof $configuration.external_filter === 'undefined' ? false : $configuration.external_filter; //If not defined charts are stacked by default\r\n var $max_initial_dataset = typeof $configuration.max_initial_dataset === 'undefined' ? false : $configuration.max_initial_dataset; //How many datasets to show on initial load\r\n var $groupped_first_col = typeof $configuration.groupped_first_col === 'undefined' ? false : $configuration.groupped_first_col; // Change how the dataset is constructed\r\n var $special_mix_chart = typeof $configuration.special_mix_chart === 'undefined' ? false : $configuration.special_mix_chart; // Change how the dataset is constructed\r\n var $always_show_value = typeof $configuration.always_show_value === 'undefined' ? false : $configuration.always_show_value; // Change how the dataset is constructed\r\n var $always_show_positive = typeof $configuration.always_show_positive === 'undefined' ? false : $configuration.always_show_positive; // Done for gender chart, always have positive values\r\n\r\n // Pulls the CSV data in json\r\n Papa.parse($configuration.url, {\r\n download: true,\r\n dynamicTyping: true,\r\n skipEmptyLines: true,\r\n complete: function ($json) {\r\n\r\n // Process the data\r\n $configuration.header ? $header = $json.data.shift() : '';\r\n $configuration.header ? $header.shift() : '';\r\n $groupped_first_col ? $header.shift() : ''; // If we are using the first col on header row to group the data then skip one more col\r\n\r\n // Color palettes\r\n var $color_codes = colorCodes();\r\n\r\n // Create the dataset and add the colors and labels\r\n var $dataset = [];\r\n var $groups = {};\r\n var $labels = [];\r\n var $labels_groupped = [];\r\n var $labels_total_line = 0;\r\n var $max_width = 15; // Max width of label\r\n $type === 'doughnut' ? $max_width = 1000 : ''; // On dougnut do not split the labels messing up the legend\r\n $external_filter ? $legend = false : ''; // If external_filter is set then disable the legend on the canvas\r\n\r\n // console.log($json.data);\r\n\r\n\r\n // Rearrange the dataset\r\n $.each($json.data, function ($index, $value) {\r\n var $group = $groupped_first_col ? $value.shift() : 'Not groupped';\r\n var $label = $value.shift();\r\n $groups[$group.replace(/[^A-Z0-9]/ig, \"_\")] = $group // Collect the groups\r\n\r\n $($value).each(function ($key, $number) {\r\n // If this is a multi dataset or single dataset chart \r\n\r\n // Make sure the values are numbers, we ignore %\r\n if (typeof $number === 'string' && $number.indexOf(\"%\") === -1) {\r\n $number = Number($number.replace(/,\\s?/g, \"\"));\r\n }\r\n\r\n var $color_index = $value.length > 1 ? $key : $index; // Define which color to pick\r\n\r\n // If not a doughnut and has only 1 dataset set the color to same index\r\n $value.length === 1 && $type !== 'doughnut' ? $color_index = 1 : '';\r\n $value.length === 1 && $type !== 'doughnut' && !$always_show_value ? $tooltip_hide_value = true : '';\r\n\r\n $dataset[$key] ? '' : $dataset[$key] = { label: '', data: [], backgroundColor: [], borderColor: [] };\r\n $dataset[$key][\"label\"] = formatLabel($header[$key], $max_width, false);\r\n $dataset[$key][\"data\"].push(parseFloat($number));\r\n $max_initial_dataset && $key > $max_initial_dataset ? $dataset[$key][\"hidden\"] = true : ''; // If there is a max number of initial datasets to show\r\n\r\n\r\n // If this is a line chart, then no background color\r\n if ($type === 'line') {\r\n $dataset[$key][\"borderColor\"] = $single_color ? $single_color : $color_codes[$color_index];\r\n $dataset[$key][\"backgroundColor\"] = 'rgba(255, 255, 255, 0)';\r\n } else {\r\n $dataset[$key][\"backgroundColor\"].push($single_color ? $single_color : $color_codes[$color_index]);\r\n }\r\n\r\n if ($special_mix_chart) {\r\n if ($header[$key] === 'Patent Family') {\r\n $dataset[$key][\"type\"] = 'line';\r\n $dataset[$key][\"showLine\"] = false;\r\n $dataset[$key][\"pointBorderWidth\"] = 5;\r\n // $dataset[$key][\"pointBackgroundColor\"] = $single_color ? $single_color : $color_codes[$color_index];\r\n $dataset[$key][\"borderColor\"] = $single_color ? $single_color : $color_codes[$color_index];\r\n $dataset[$key][\"pointBackgroundColor\"] = '#50E3C2';\r\n $dataset[$key][\"borderColor\"] = '#50E3C2';\r\n $dataset[$key][\"pointRadius\"] = 4;\r\n $dataset[$key][\"backgroundColor\"] = ['rgba(0,0,0,0)'];\r\n }\r\n }\r\n });\r\n\r\n // The first column in the row is the label for the dataset\r\n $labels.push(formatLabel($label, $max_width, $y_axis_leading_zero));\r\n\r\n if ($groupped_first_col) {\r\n $labels_groupped.push({ group: $group, label: formatLabel($label, $max_width, $y_axis_leading_zero) });\r\n }\r\n\r\n // Add the size of the label array back\r\n var $formatted_label = formatLabel($label, $max_width, $y_axis_leading_zero);\r\n if ($formatted_label && $formatted_label.constructor === Array) {\r\n $labels_total_line = $labels_total_line + $formatted_label.length;\r\n } else {\r\n $labels_total_line = $labels_total_line + 1;\r\n }\r\n });\r\n\r\n\r\n\r\n // Clone the dataset\r\n var $dataset_clone = [];\r\n $($dataset).each(function ($index, $data) {\r\n $dataset_clone.push({ data: $data.data });\r\n });\r\n\r\n\r\n // If we have groupped dataset or dataset filter then we store the original dataset to global and work with it\r\n $groupped_first_col ? window.dataset_collection[$chart_reference] = $dataset_clone : '';\r\n $groupped_first_col ? window.labels_collection[$chart_reference] = $labels_groupped : '';\r\n $groupped_first_col ? window.original_labels[$chart_reference] = $labels : '';\r\n\r\n\r\n\r\n // If browser width < 900px reposition the legend and change padding \r\n if (window.innerWidth < 700) {\r\n $legend_position = 'bottom';\r\n $legend_padding = 15;\r\n $legend_font_size = 13;\r\n }\r\n\r\n var $chart_height = $labels_total_line * 45;\r\n $chart_height < 600 ? $chart_height = $labels_total_line * 65 : '';\r\n $chart_height < 300 ? $chart_height = 300 : ''; // Make sure the chart is min 300\r\n\r\n // If this is not a Doughnut or Line chart type\r\n if ($type !== 'doughnut' && $type !== 'line' && $type !== 'bar') {\r\n $container.closest('.chart-container').css('height', $chart_height); // Adjust the canvas height\r\n (parseInt($chart_height / $labels.length) - 50) < 35 ? $bar_line_height = 35 : $bar_line_height = (parseInt($chart_height / $labels.length) - 50); // Set the actual bars\r\n $bar_line_height > 60 ? $bar_line_height = 60 : ''; // Cap the bar height to max 60\r\n $dataset.length === 1 ? $legend = false : ''; // If there is only 1 dataset then hide the legend \r\n }\r\n\r\n // Draw the chart\r\n window.charts_collection[$chart_reference] = new Chart($container[0].getContext('2d'), {\r\n type: $type,\r\n data: {\r\n labels: $labels,\r\n datasets: $dataset\r\n },\r\n options: {\r\n responsive: true,\r\n elements: {\r\n line: {\r\n tension: 0, // disables bezier curves\r\n }\r\n },\r\n maintainAspectRatio: false,\r\n layout: {\r\n padding: {\r\n left: $padding_left,\r\n right: $padding_right,\r\n top: 20,\r\n bottom: 20\r\n }\r\n },\r\n tooltips: {\r\n mode: 'single',\r\n callbacks: {\r\n // this callback is used to create the tooltip label\r\n label: function (tooltipItem, data) {\r\n\r\n // console.log('tooltipItem', tooltipItem);\r\n // console.log('data', data);\r\n\r\n // get the data label and data value to display\r\n // var dataLabel;\r\n // if (data.datasets.length > 1) {\r\n // } else {\r\n\r\n // }\r\n var dataLabel =\r\n data.datasets.length > 1 ?\r\n (data.datasets[tooltipItem.datasetIndex].label[0] ?\r\n data.datasets[tooltipItem.datasetIndex].label.join(' ')\r\n : data.datasets[tooltipItem.datasetIndex].label)\r\n : (data.labels[tooltipItem.index][0] ?\r\n data.labels[tooltipItem.index].join(' ')\r\n : data.labels[tooltipItem.index]);\r\n\r\n // add the currency symbol $ to the label\r\n var value = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];\r\n\r\n // Format the value\r\n if ($x_axis_is_year) {\r\n $tooltip_number_format ? value = value.toLocaleString() : '';\r\n } else {\r\n $always_show_positive && value < 0 ? value = value * -1 : '';\r\n $tooltip_decimal ? value = Number(value).toFixed($tooltip_decimal) : '';\r\n $tooltip_number_format ? value = value.toLocaleString() : '';\r\n $tooltip_show_currency ? value = '$ ' + value : '';\r\n $tooltip_show_percentage ? value = value + '%' : '';\r\n }\r\n\r\n // If forced to hide value\r\n $tooltip_hide_value ? '' : dataLabel += ': ' + value;\r\n\r\n // If there is 1 dataset and we are on bar chart\r\n if (data.datasets.length === 1 && $type === \"horizontalBar\") {\r\n return value\r\n } else {\r\n // return the text to display on the tooltip\r\n return dataLabel;\r\n }\r\n }\r\n }\r\n },\r\n legend: {\r\n display: $legend,\r\n position: $legend_position,\r\n labels: {\r\n boxWidth: $legend_box_width,\r\n padding: $legend_padding,\r\n fontSize: $legend_font_size,\r\n fontFamily: 'Cabin',\r\n filter: function ($item, $chartdata) {\r\n if (typeof $item['text'] === 'object') {\r\n $item['text'] = $item['text'].join(' '); // Remove the comma from the legend label\r\n }\r\n return $item;\r\n }\r\n },\r\n\r\n onClick: function ($event, $item) {\r\n if ($disable_filter) {\r\n $event.stopPropagation();\r\n } else {\r\n original.call(this, $event, $item);\r\n }\r\n }\r\n },\r\n scales: {\r\n xAxes: [{\r\n display: $x_axis,\r\n stacked: $chart_stack,\r\n gridLines: {\r\n display: $x_gridlines\r\n },\r\n ticks: {\r\n fontSize: $label_font_size,\r\n fontColor: '#021A2B',\r\n fontFamily: 'Cabin',\r\n autoSkip: false,\r\n callback: function (value, index, values) {\r\n\r\n // Check the largest value in the ticks. To know what devider to use\r\n var $suffix = ' k';\r\n var $divider = 0;\r\n\r\n value[0] ? value = value.join(' ') : ''; // Remove commas on x-axis #89139\r\n\r\n if ($x_axis_is_year) {\r\n // Do not format the ticks\r\n } else {\r\n var $largest = Math.max.apply(Math, values);\r\n if ($largest >= 1000000) {\r\n $suffix = ' m';\r\n $divider = 1000000;\r\n } else if ($largest >= 1000) {\r\n $suffix = ' k';\r\n $divider = 1000;\r\n }\r\n\r\n $always_show_positive && value < 0 ? value = value * -1 : '';\r\n\r\n if ($divider > 0) {\r\n value = value / $divider;\r\n value = value.toLocaleString() + $suffix;\r\n } else {\r\n $tooltip_number_format ? value = value.toLocaleString() : '';\r\n }\r\n\r\n $tooltip_show_percentage && !$x_axis_no_percentage ? value = value + '%' : '';\r\n $tooltip_show_currency ? value = '$ ' + value : '';\r\n }\r\n\r\n return value;\r\n }\r\n },\r\n scaleLabel: {\r\n display: $x_axis_label_show,\r\n labelString: $x_axis_label_text,\r\n padding: 20,\r\n fontSize: 18,\r\n fontColor: '#000',\r\n fontFamily: 'Cabin',\r\n fontStyle: 'bold'\r\n }\r\n }],\r\n yAxes: [{\r\n display: $y_axis,\r\n barThickness: $bar_line_height,\r\n stacked: $chart_stack,\r\n gridLines: {\r\n display: $y_gridlines\r\n },\r\n ticks: {\r\n fontSize: $label_font_size,\r\n fontColor: '#021A2B',\r\n fontFamily: 'Cabin',\r\n callback: function (value, index, values) {\r\n\r\n // Check the largest value in the ticks. To know what devider to use\r\n var $suffix = ' k';\r\n var $divider = 0;\r\n\r\n if ($y_axis_is_year || $y_raw) {\r\n // Do not format the ticks\r\n } else {\r\n\r\n var $largest = Math.max.apply(Math, values);\r\n if ($largest > 2300) {\r\n if ($largest >= 1000000) {\r\n $suffix = ' m';\r\n $divider = 1000000;\r\n } else if ($largest >= 1000) {\r\n $suffix = ' k';\r\n $divider = 1000;\r\n }\r\n\r\n if ($divider > 0) {\r\n value = value / $divider;\r\n value = value.toLocaleString() + $suffix;\r\n }\r\n }\r\n }\r\n\r\n\r\n if ($y_axis_suffix) {\r\n // Do not format the ticks\r\n value = value + $y_axis_suffix;\r\n }\r\n\r\n return value;\r\n }\r\n },\r\n scaleLabel: {\r\n display: $y_axis_label_show,\r\n labelString: $y_axis_label_text,\r\n padding: 20,\r\n fontSize: 18,\r\n fontColor: '#000',\r\n fontFamily: 'Cabin',\r\n fontStyle: 'bold'\r\n }\r\n }]\r\n },\r\n plugins: {\r\n datalabels: {\r\n display: $show_data_labels,\r\n color: '#005792',\r\n align: 'right',\r\n offset: 20,\r\n anchor: 'end',\r\n font: {\r\n weight: 'bold',\r\n size: '22',\r\n family: 'Cabin'\r\n },\r\n formatter: function (value, context) {\r\n return value + '%';\r\n }\r\n\r\n }\r\n },\r\n animation: {\r\n onComplete: function () {\r\n // Get the base64 for print\r\n var $image_print = this.toBase64Image();\r\n $container.closest('.chart-container').find('.chart-print').remove();\r\n $container.closest('.chart-container').append('');\r\n }\r\n }\r\n }\r\n\r\n });\r\n\r\n\r\n // If external_filter is set then disable the legend and add filter box on top;\r\n if ($external_filter) {\r\n var $filter_html = '';\r\n var $legend_html = '';\r\n // Go through each dataset and build the list of options\r\n $(window.charts_collection[$chart_reference].data.datasets).each(function ($index, $data) {\r\n var $checked = !$data.hidden ? 'checked' : '';\r\n var $dataset_ref = $chart_reference + \"_\" + $index; // Create a reference based on the chart reference and index\r\n var $color = $type === 'line' ? $data['borderColor'] : $data['backgroundColor'][0];\r\n var $data_value = $data[\"label\"][0] ? $data[\"label\"][0] : $data[\"label\"];\r\n var $data_label = $data[\"label\"][0] ? $data[\"label\"].join(' ') : $data[\"label\"];\r\n // console.log($data);\r\n $filter_html +=\r\n \"
  • \" +\r\n \"\" +\r\n \"\" +\r\n \"
  • \";\r\n\r\n if ($checked === 'checked') {\r\n $legend_html += \"
  • \";\r\n }\r\n });\r\n var $label_text = $max_initial_dataset ? '...' : 'All';\r\n $filter_html = \"
    \" +\r\n \"
    \" +\r\n \"
    View FoR
    \" +\r\n \"
    \";\r\n\r\n $legend_html = \"\";\r\n\r\n $container.closest('.chart-container').before($filter_html);\r\n $container.closest('.chart-container').after($legend_html);\r\n\r\n // Bind the change action to the filter checkboxes\r\n $(\".dropdown.widget-container .list li.table_group_\" + $chart_reference + \" input\").change(function () {\r\n\r\n // When a checkbox is ticked go through the list and build the search filter\r\n var $value = '';\r\n var $legend_html = \"\";\r\n var $chart_target = $(this).data('chart-target');\r\n\r\n // Disable all the datasets and enable only the active one\r\n $(window.charts_collection[$chart_reference].data.datasets).each(function ($index, $value) {\r\n window.charts_collection[$chart_reference].getDatasetMeta($index).hidden = true;\r\n });\r\n\r\n // Go through the ticked checkbox and collect the data & Enable the ticked datasets\r\n $(this).closest('.dropdown.widget-container').find(\"input:checked\").each(function () {\r\n $value += ($(this).val().length > 4 ? $(this).val().substr(0, 2) : $(this).val()) + \"|\"\r\n window.charts_collection[$chart_reference].getDatasetMeta($(this).data('dataset-index')).hidden = false;\r\n\r\n $legend_html += \"
  • \";\r\n })\r\n\r\n\r\n // After collecting all the values check if there is anything to filter\r\n if ($value) {\r\n // If there a value ticked then we show only the ticked ones\r\n $(this).closest('.widget-container').find('.selected span').html($value.slice(0, -1).replace(/\\|/g, \", \"));\r\n } else {\r\n // If no checkbox is ticked then show everything\r\n $(this).closest('.widget-container').find('.selected span').html('All');\r\n $(window.charts_collection[$chart_reference].data.datasets).each(function ($index, $value) {\r\n window.charts_collection[$chart_reference].getDatasetMeta($index).hidden = false;\r\n });\r\n }\r\n\r\n // Apply to chart\r\n window.charts_collection[$chart_reference].update();\r\n\r\n\r\n // Go through all the selected and build the legend list again\r\n $(this).closest('.chart').find('.legend_html').html($legend_html);\r\n\r\n });\r\n\r\n // Bind action to expand the filter list\r\n $('.chart_filter_' + $chart_reference + ' .widget-container button').click(function ($event) {\r\n $event.stopPropagation()\r\n !$(this).closest('.collapsible-box').hasClass('expanded') ? $(this).closest('.collapsible-box').find('.toggle').click() : '';\r\n $(this).siblings('.list').toggleClass('active');\r\n $(this).toggleClass('active');\r\n })\r\n\r\n // Clicking on the open filer dropdown. Stop propagation\r\n $('.chart_filter_' + $chart_reference + ' .widget-container .list').click(function ($event) {\r\n $event.stopPropagation();\r\n });\r\n\r\n }\r\n\r\n // If there are groups on the chart\r\n if ($groupped_first_col) {\r\n\r\n var $filter_html = '';\r\n var $this_chart_reference = $chart_reference + '_cohort';\r\n var $label_text = 'View Cohorts';\r\n\r\n // Go through each dataset and build the list of options\r\n $.each($groups, function ($index, $data) {\r\n // console.log($index);\r\n var $dataset_ref = $this_chart_reference + \"_\" + $index + \"_groups\"; // Create a reference based on the chart reference and index\r\n var $data_value = $data;\r\n\r\n $filter_html +=\r\n \"
  • \" +\r\n \"\" +\r\n \"\" +\r\n \"
  • \";\r\n });\r\n\r\n $filter_html = \"
    \" +\r\n \"
    \" +\r\n \"
    \" + $label_text + \"
    \" +\r\n \"
    \";\r\n\r\n $container.closest('.chart-container').before($filter_html);\r\n\r\n // Bind the change action to the filter checkboxes\r\n $(\".dropdown.widget-container .list li.table_group_\" + $this_chart_reference + \" input\").change(function () {\r\n\r\n // When a checkbox is ticked go through the list and build the search filter\r\n var $value = '';\r\n var $chart_target = $(this).data('chart-target');\r\n var $selected_groups = [];\r\n\r\n\r\n // // Go through the ticked checkbox and collect the data & Enable the ticked datasets\r\n $(this).closest('.dropdown.widget-container').find(\"input:checked\").each(function () {\r\n var $raw_value = $(this).val();\r\n switch ($raw_value) {\r\n case 'Group of Eight (Go8)':\r\n $raw_value = 'Go8';\r\n break;\r\n case 'Australian Technology Network (ATN)':\r\n $raw_value = 'ATN';\r\n break;\r\n case 'Innovative Research Universities (IRU)':\r\n $raw_value = 'IRU';\r\n break;\r\n case 'Regional Universities Network (RUN)':\r\n $raw_value = 'RUN';\r\n break;\r\n\r\n default:\r\n break;\r\n }\r\n $value += $raw_value + \"|\"\r\n\r\n // Make a list of selected items\r\n $selected_groups.push($(this).val())\r\n })\r\n\r\n // console.log('Window chart', window.charts_collection[$chart_reference]);\r\n // console.log('Window dataset', window.dataset_collection[$chart_reference]);\r\n // console.log('Window labels', window.labels_collection[$chart_reference]);\r\n // console.log('Selected groups', $selected_groups);\r\n\r\n\r\n\r\n // Reset the chart to it's original state\r\n window.charts_collection[$chart_reference].data.labels = window.original_labels[$chart_reference];\r\n\r\n $(window.charts_collection[$chart_reference].data.datasets).each(function ($index, $data) {\r\n window.charts_collection[$chart_reference].data.datasets[$index].data = window.dataset_collection[$chart_reference][$index].data\r\n })\r\n // window.charts_collection[$chart_reference].data.datasets = window.dataset_collection[$chart_reference];\r\n\r\n // After collecting all the values check if there is anything to filter\r\n if ($value) {\r\n // If there a value ticked then we show only the ticked ones\r\n $(this).closest('.widget-container').find('.selected span').html($value.slice(0, -1).replace(/\\|/g, \", \"));\r\n // window.charts_collection[$chart_reference].data.labels = window.charts_collection[$chart_reference].data.labels.pop();\r\n\r\n // Rebuild the list of labels and collect the index \r\n var $list_of_selected_labels_index = [];\r\n var $list_of_selected_labels = [];\r\n $(window.labels_collection[$chart_reference]).each(function ($label_index, $value) {\r\n var $label_group = $value.group;\r\n\r\n if ($selected_groups.indexOf($label_group) > -1) {\r\n $list_of_selected_labels.push($value.label);\r\n $list_of_selected_labels_index.push($label_index);\r\n }\r\n });\r\n\r\n // console.log('$list_of_selected_labels', $list_of_selected_labels);\r\n // console.log('$list_of_selected_labels_index', $list_of_selected_labels_index);\r\n\r\n\r\n // Go through each dataset and exclude the ones that are not part of selected labels based on index\r\n // var $original_datasets = window.dataset_collection[$chart_reference];\r\n var $filtered_dataset = [];\r\n\r\n $(window.charts_collection[$chart_reference].data.datasets).each(function ($index, $dataset) {\r\n var $filtered_data = [];\r\n $($dataset.data).each(function ($data_label_index, $data) {\r\n if ($list_of_selected_labels_index.indexOf($data_label_index) > -1) {\r\n $filtered_data.push($data);\r\n }\r\n });\r\n $dataset['data'] = $filtered_data;\r\n $filtered_dataset.push($dataset);\r\n // var $filtered_dataset_index = $filtered_dataset.push($dataset);\r\n // console.log($filtered_dataset_index -1);\r\n // $filtered_dataset[$filtered_dataset_index -1].data = $filtered_data;\r\n })\r\n\r\n // console.log('Filtered dataset', $filtered_dataset);\r\n\r\n // Update the chart label and dataset\r\n window.charts_collection[$chart_reference].data.labels = $list_of_selected_labels;\r\n window.charts_collection[$chart_reference].data.datasets = $filtered_dataset;\r\n\r\n } else {\r\n // If no checkbox is ticked then show everything\r\n $(this).closest('.widget-container').find('.selected span').html('All');\r\n\r\n }\r\n\r\n\r\n // Compute the new chart height\r\n var $bar_thickness = window.charts_collection[$chart_reference].options.scales.yAxes[0].barThickness;\r\n var $number_of_ticks_on_y = window.charts_collection[$chart_reference].data.labels.length;\r\n var $chart_height = ($bar_thickness + 45) * $number_of_ticks_on_y;\r\n $(this).closest('.chart').find('.chart-container').css('height', $chart_height); // Adjust the canvas height\r\n\r\n // // Apply to chart\r\n window.charts_collection[$chart_reference].resize();\r\n window.charts_collection[$chart_reference].update();\r\n });\r\n\r\n // Bind action to expand the filter list\r\n $('.chart_filter_' + $this_chart_reference + ' .widget-container button').click(function ($event) {\r\n $event.stopPropagation()\r\n !$(this).closest('.collapsible-box').hasClass('expanded') ? $(this).closest('.collapsible-box').find('.toggle').click() : '';\r\n $(this).siblings('.list').toggleClass('active');\r\n $(this).toggleClass('active');\r\n })\r\n\r\n // Clicking on the open filer dropdown. Stop propagation\r\n $('.chart_filter_' + $this_chart_reference + ' .widget-container .list').click(function ($event) {\r\n $event.stopPropagation();\r\n });\r\n }\r\n\r\n\r\n },\r\n error: function ($err, $file, $inputElem, $reason) {\r\n console.log('Full error', $err);\r\n console.log('Error message', $err['message']);\r\n $container.closest('.chart-container').css('height', 'auto');\r\n $container.closest('.collapsible-box').addClass('no-data');\r\n if ($err['message'] === 'Not Found' || $err['message'] === '') {\r\n var $textfile = $configuration.url.substr(0, $configuration.url.lastIndexOf(\"/\") + 1) + 'no.chart.footnote.txt'; // remove everything after the last backslash\r\n var $error_message = \"Data not found\";\r\n $.ajax({\r\n url: $textfile\r\n }).done(function ($data) {\r\n $data ? $error_message = $data : '';\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n }).fail(function ($error) {\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n });\r\n }\r\n }\r\n });\r\n });\r\n\r\n // Clicking on body to close the filters\r\n $('body').click(function () {\r\n $('.widget-container .selected').removeClass('active');\r\n $('.widget-container .list').removeClass('active');\r\n })\r\n\r\n $(window).resize(function () {\r\n if (window.innerWidth < 700) {\r\n for (var key in window.charts_collection) {\r\n if (window.charts_collection.hasOwnProperty(key)) {\r\n window.charts_collection[key].options.legend.position = \"bottom\";\r\n window.charts_collection[key].options.legend.labels = {\r\n boxWidth: 20,\r\n padding: 15,\r\n fontSize: 13,\r\n fontFamily: 'Cabin'\r\n };\r\n }\r\n }\r\n }\r\n if (window.innerWidth > 700) {\r\n for (var key in window.charts_collection) {\r\n if (window.charts_collection.hasOwnProperty(key)) {\r\n window.charts_collection[key].options.legend.position = \"right\";\r\n window.charts_collection[key].options.legend.labels = {\r\n boxWidth: $legend_box_width,\r\n padding: $legend_padding,\r\n fontSize: $legend_font_size,\r\n fontFamily: 'Cabin'\r\n };\r\n }\r\n }\r\n }\r\n });\r\n\r\n function makeid() {\r\n var text = \"\";\r\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n\r\n for (var i = 0; i < 5; i++)\r\n text += possible.charAt(Math.floor(Math.random() * possible.length));\r\n\r\n return text;\r\n }\r\n\r\n function formatLabel(str, maxwidth, $y_axis_leading_zero) {\r\n\r\n if (str && $y_axis_leading_zero && str.toString().length < 4) {\r\n str = '0' + str.toString();\r\n }\r\n\r\n if (typeof str === 'string') {\r\n var sections = [];\r\n var words = str.split(\" \");\r\n var temp = \"\";\r\n\r\n words.forEach(function (item, index) {\r\n if (temp.length > 0) {\r\n var concat = temp + ' ' + item;\r\n\r\n if (concat.length > maxwidth) {\r\n sections.push(temp);\r\n temp = \"\";\r\n } else {\r\n if (index === (words.length - 1)) {\r\n sections.push(concat);\r\n return;\r\n } else {\r\n temp = concat;\r\n return;\r\n }\r\n }\r\n }\r\n\r\n if (index === (words.length - 1)) {\r\n sections.push(item);\r\n return;\r\n }\r\n\r\n if (item.length < maxwidth) {\r\n temp = item;\r\n } else {\r\n sections.push(item);\r\n }\r\n\r\n });\r\n\r\n return sections;\r\n } else {\r\n return str;\r\n }\r\n }\r\n\r\n function colorCodes() {\r\n var $color_codes = [];\r\n $color_codes[0] = 'rgba(11,28,42,1)';\r\n $color_codes[1] = 'rgba(60,123,191,1)';\r\n $color_codes[2] = 'rgba(96,43,83,1)';\r\n $color_codes[3] = 'rgba(65,129,108,1)';\r\n $color_codes[4] = 'rgba(120,80,138,1)';\r\n $color_codes[5] = 'rgba(0,129,138,1)';\r\n $color_codes[6] = 'rgba(13,102,108,1)';\r\n $color_codes[7] = 'rgba(75,65,129,1)';\r\n $color_codes[8] = 'rgb(15,178,53)';\r\n $color_codes[9] = 'rgb(172,208,81)';\r\n $color_codes[10] = 'rgb(32,17,61)';\r\n $color_codes[11] = 'rgb(118,144,51)';\r\n $color_codes[12] = 'rgb(66,104,138)';\r\n $color_codes[13] = 'rgb(245,166,35)';\r\n $color_codes[14] = 'rgb(67,88,14)';\r\n $color_codes[15] = 'rgb(147,57,68)';\r\n $color_codes[16] = 'rgb(201,84,190)';\r\n $color_codes[17] = 'rgb(121,22,132)';\r\n $color_codes[18] = 'rgb(98,123,106)';\r\n $color_codes[19] = 'rgb(80,215,227)';\r\n $color_codes[20] = 'rgb(154,60,42)';\r\n $color_codes[21] = 'rgb(58,133,99)';\r\n $color_codes[22] = 'rgb(139,87,42)';\r\n $color_codes[23] = 'rgb(86,81,144)';\r\n $color_codes[24] = 'rgb(126,211,33)';\r\n $color_codes[25] = 'rgb(224,16,77)';\r\n $color_codes[26] = 'rgb(144,19,254)';\r\n $color_codes[27] = 'rgb(194,125,11)';\r\n $color_codes[28] = 'rgb(173,162,89)';\r\n $color_codes[29] = 'rgb(133,200,185)';\r\n $color_codes[30] = 'rgb(53,97,3)';\r\n return $color_codes;\r\n }\r\n};\r\n\r\nmodule.exports = Chartblock;\r\n","/* global Papa */\r\n\r\n'use strict';\r\n\r\n// Constructor\r\nvar Table = function () {\r\n\r\n $('.csv-table').each(function () {\r\n var $header; // The header row\r\n var $footer; // The footer row\r\n var $container = $(this);\r\n var $configuration = $container.data('configuration'); // The configuration object from the data attribute\r\n var $table_css_class = $configuration.style ? $configuration.style : '';\r\n var $decimal_places = typeof $configuration.decimal_places === 'undefined' ? false : $configuration.decimal_places; //Decimal places to show\r\n var $raw_value = typeof $configuration.raw_value === 'undefined' ? false : $configuration.raw_value; //Decimal places to show\r\n\r\n // console.log($table_css_class);\r\n\r\n // Pulls the CSV data in json\r\n Papa.parse($configuration.url, {\r\n download: true,\r\n dynamicTyping: false,\r\n skipEmptyLines: true,\r\n complete: function ($json) {\r\n\r\n\r\n // Process the data\r\n $configuration.header ? $header = $json.data.shift() : '';\r\n $configuration.footer ? $footer = $json.data.pop() : '';\r\n\r\n // Output the HTML structure for the table\r\n var $html = \"\";\r\n $html += '';\r\n if ($configuration.header) {\r\n $html += '';\r\n $($header).each(function ($index, $value) {\r\n $html += '';\r\n });\r\n $html += '';\r\n }\r\n if ($json.data) {\r\n $html += '';\r\n $($json.data).each(function ($index, $row) {\r\n\r\n // Special case #87586\r\n if ($row.length === 2) {\r\n if ($row[0] === 'Patents' && $row[1] !== '-') {\r\n $row[1] = Number(parseFloat(Number($row[1].replace(/,\\s?/g, \"\"))).toFixed(1)).toLocaleString(undefined, { minimumFractionDigits: 1 });\r\n }\r\n if ($row[0] === 'FTEs' && $row[1] !== '-') {\r\n $row[1] = Number(parseFloat(Number($row[1].replace(/,\\s?/g, \"\"))).toFixed(1)).toLocaleString(undefined, { minimumFractionDigits: 1 });\r\n }\r\n if ($row[0] === 'Research outputs' && $row[1] !== '-') {\r\n $row[1] = Number(parseFloat(Number($row[1].replace(/,\\s?/g, \"\"))).toFixed(1)).toLocaleString(undefined, { minimumFractionDigits: 1 });\r\n }\r\n }\r\n\r\n $html += '';\r\n $($row).each(function ($index, $cell) {\r\n if ($raw_value) {\r\n // Do nothing\r\n } else {\r\n if ($decimal_places && $index !== 0 && $cell !== '-' && $cell !== '–') {\r\n $cell = Number(parseFloat(Number($cell.replace(/,\\s?/g, \"\"))).toFixed($decimal_places)).toLocaleString(undefined, { minimumFractionDigits: $decimal_places });\r\n }\r\n }\r\n $html += '';\r\n });\r\n $html += '';\r\n });\r\n $html += '';\r\n }\r\n if ($configuration.footer) {\r\n $html += '';\r\n $($footer).each(function ($index, $value) {\r\n if ($raw_value) {\r\n // Do nothing\r\n } else {\r\n if ($decimal_places && $index !== 0 && $value !== '-' && $value !== '–') {\r\n $value = parseFloat(Number($value.replace(/,\\s?/g, \"\"))).toFixed($decimal_places).toLocaleString();\r\n }\r\n }\r\n $html += '';\r\n });\r\n $html += '';\r\n }\r\n $html += '
    ' + $value + '
    ' + $cell + '
    ' + $value + '
    ';\r\n\r\n $container.html($html);\r\n\r\n\r\n // Make the dataTable\r\n var $columnsDefs;\r\n\r\n // Show only 8 columns on the display\r\n if ($header.length > 8 && $configuration['limit_cols_to_8']) {\r\n $columnsDefs = [\r\n {\r\n \"targets\": [1, 2, 3, 4, 5, 6, 7, 8], // We can make this a configuration\r\n \"visible\": true\r\n },\r\n {\r\n \"targets\": ['_all'],\r\n \"visible\": false\r\n }\r\n ];\r\n $configuration['columnDefs'] = $columnsDefs;\r\n }\r\n\r\n\r\n if ($configuration['stick_left_col'] && window.innerWidth > 1200) {\r\n // $configuration['fixedColumns'] = {leftColumns: 1};\r\n // $configuration['scrollX'] = true;\r\n }\r\n if (window.innerWidth <= 1200) {\r\n // $configuration['scrollX'] = true;\r\n }\r\n\r\n // $container.find('table').DataTable($configuration);\r\n if (!$configuration['nodatatable']) {\r\n $container.find('table').DataTable($configuration);\r\n }\r\n },\r\n error: function ($err, $file, $inputElem, $reason) {\r\n $container.closest('.collapsible-box').addClass('no-data');\r\n if ($err['message'] === 'Not Found' || $err['message'] === '') {\r\n var $textfile = $configuration.url.substr(0, $configuration.url.lastIndexOf(\"/\") + 1) + 'no.table.footnote.txt'; // remove everything after the last backslash\r\n var $error_message = \"Data not found\";\r\n $.ajax({\r\n url: $textfile\r\n }).done(function ($data) {\r\n $data ? $error_message = $data : '';\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n }).fail(function ($error) {\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n });\r\n }\r\n }\r\n });\r\n });\r\n};\r\n\r\nmodule.exports = Table;\r\n","/* global Papa */\r\n\r\n'use strict';\r\n\r\n// Constructor\r\nvar TableSection1 = function () {\r\n\r\n $('.csv-table-section1').each(function () {\r\n var $header; // The header row\r\n var $footer; // The footer row\r\n var $container = $(this);\r\n var $configuration = $container.data('configuration'); // The configuration object from the data attribute\r\n var $table_css_class = $configuration.style ? $configuration.style : '';\r\n var $decimal_places = typeof $configuration.decimal_places === 'undefined' ? false : $configuration.decimal_places; //Decimal places to show\r\n var $raw_value = typeof $configuration.raw_value === 'undefined' ? false : $configuration.raw_value; //Decimal places to show\r\n\r\n // console.log($table_css_class);\r\n\r\n // Pulls the CSV data in json\r\n Papa.parse($configuration.url, {\r\n download: true,\r\n dynamicTyping: false,\r\n skipEmptyLines: true,\r\n complete: function ($json) {\r\n\r\n // Process the data\r\n $configuration.header ? $header = $json.data.shift() : '';\r\n $configuration.footer ? $footer = $json.data.pop() : '';\r\n\r\n // Output the HTML structure for the table\r\n var $html = \"\";\r\n $html += '';\r\n if ($configuration.header) {\r\n $html += '';\r\n $($header).each(function ($index, $value) {\r\n $html += '';\r\n });\r\n $html += '';\r\n }\r\n if ($json.data) {\r\n $html += '';\r\n\r\n\r\n var $forgroup_class = \"\";\r\n\r\n $($json.data).each(function ($index, $row) {\r\n var $row_class = '';\r\n\r\n // If the first col is empty we highlight the row as heading\r\n $row[0].length < 1 ? $row_class = \" heading-row \" : '';\r\n\r\n // Special case #87586\r\n if ($row.length === 2) {\r\n if ($row[0] === 'Patents' && $row[1] !== '-') {\r\n $row[1] = parseFloat(Number($row[1].replace(/,\\s?/g, \"\"))).toFixed(1).toLocaleString();\r\n }\r\n if ($row[0] === 'FTEs' && $row[1] !== '-') {\r\n $row[1] = parseFloat(Number($row[1].replace(/,\\s?/g, \"\"))).toFixed(1).toLocaleString();\r\n }\r\n if ($row[0] === 'Research outputs' && $row[1] !== '-') {\r\n $row[1] = parseFloat(Number($row[1].replace(/,\\s?/g, \"\"))).toFixed(1).toLocaleString();\r\n }\r\n }\r\n\r\n // If on table \"Research outputs across ERA rounds\" then add the class\r\n if ($configuration['tableheadertitle'] === 'Research outputs across ERA rounds') {\r\n if ($index === 0 || $index === 5) {\r\n $row_class = 'heading-row';\r\n }\r\n }\r\n\r\n \r\n\r\n $html += '';\r\n $($row).each(function ($index, $cell) {\r\n\r\n if ($raw_value) {\r\n $html += '';\r\n } else {\r\n // If defined to have decimal places\r\n if ($decimal_places && $decimal_places !== 0 && $index !== 0 && $cell !== '' && $cell !== '-' && $cell !== '–') {\r\n $cell = Number(parseFloat(Number($cell.replace(/,\\s?/g, \"\"))).toFixed($decimal_places)).toLocaleString(undefined, { minimumFractionDigits: $decimal_places });\r\n }\r\n\r\n // If no decimal places still need thousand seperators\r\n if ($decimal_places === 0 && $index !== 0 && $cell !== '' && $cell !== '-' && $cell !== '–') {\r\n $cell = Number(parseFloat(Number($cell.replace(/,\\s?/g, \"\"))).toFixed(0)).toLocaleString(undefined, { minimumFractionDigits: 0 });\r\n }\r\n\r\n $html += '';\r\n }\r\n });\r\n $html += '';\r\n });\r\n $html += '';\r\n }\r\n if ($configuration.footer) {\r\n $html += '';\r\n $($footer).each(function ($index, $value) {\r\n if ($raw_value) {\r\n $html += '';\r\n } else {\r\n if ($decimal_places && $index !== 0 && $value !== '-' && $value !== '–') {\r\n $value = Number(parseFloat(Number($value.replace(/,\\s?/g, \"\"))).toFixed($decimal_places)).toLocaleString(undefined, { minimumFractionDigits: $decimal_places });\r\n }\r\n $html += '';\r\n }\r\n });\r\n $html += '';\r\n }\r\n $html += '
    ' + $value + '
    ' + $cell + '' + $cell + '
    ' + $cell + '' + $value + '
    ';\r\n\r\n $container.html($html);\r\n\r\n\r\n // Make the dataTable\r\n var $columnsDefs;\r\n\r\n // Show only 8 columns on the display\r\n if ($header && $header.length > 8 && $configuration['limit_cols_to_8']) {\r\n $columnsDefs = [\r\n {\r\n \"targets\": [1, 2, 3, 4, 5, 6, 7, 8], // We can make this a configuration\r\n \"visible\": true\r\n },\r\n {\r\n \"targets\": ['_all'],\r\n \"visible\": false\r\n }\r\n ];\r\n $configuration['columnDefs'] = $columnsDefs;\r\n }\r\n\r\n\r\n if ($configuration['stick_left_col'] && window.innerWidth > 1200) {\r\n // $configuration['fixedColumns'] = {leftColumns: 1};\r\n // $configuration['scrollX'] = true;\r\n }\r\n if (window.innerWidth <= 1200) {\r\n // $configuration['scrollX'] = true;\r\n }\r\n\r\n if (!$configuration['nodatatable']) {\r\n $container.find('table').DataTable($configuration);\r\n }\r\n },\r\n error: function ($err, $file, $inputElem, $reason) {\r\n $container.closest('.collapsible-box').addClass('no-data');\r\n if ($err['message'] === 'Not Found' || $err['message'] === '') {\r\n var $textfile = $configuration.url.substr(0, $configuration.url.lastIndexOf(\"/\") + 1) + 'no.table.footnote.txt'; // remove everything after the last backslash\r\n var $error_message = \"Data not found\";\r\n $.ajax({\r\n url: $textfile\r\n }).done(function ($data) {\r\n $data ? $error_message = $data : '';\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n }).fail(function ($error) {\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n });\r\n }\r\n }\r\n });\r\n });\r\n};\r\n\r\nmodule.exports = TableSection1;\r\n","/* global Papa */\r\n\r\n\"use strict\";\r\n\r\n// Constructor\r\nvar TableSection4 = function () {\r\n var $table_counter = 0;\r\n var $tables = [];\r\n $(\".csv-table-section4\").each(function () {\r\n var $header; // The header row\r\n var $footer; // The footer row\r\n var $container = $(this);\r\n var $configuration = $container.data(\"configuration\"); // The configuration object from the data attribute\r\n var $table_css_class = $configuration.style ? $configuration.style : \"\";\r\n // var $decimal_places = typeof $configuration.decimal_places === \"undefined\" ? false : $configuration.decimal_places; //Decimal places to show\r\n var $decimal_places = $configuration['show_all_columns'] ? false : 1; //Decimal places to show\r\n var $forgroup_filter = [];\r\n var $column_filters = [];\r\n var $total_columns_index = [];\r\n var $raw_value = typeof $configuration.raw_value === 'undefined' ? false : $configuration.raw_value; //Decimal places to show\r\n\r\n // Pulls the CSV data in json\r\n Papa.parse($configuration.url, {\r\n download: true,\r\n dynamicTyping: false,\r\n skipEmptyLines: true,\r\n complete: function ($json) {\r\n\r\n // Increment the table counter to use for IDs etc\r\n $table_counter++;\r\n\r\n // Process the data\r\n $configuration.header ? ($header = $json.data.shift()) : \"\";\r\n $configuration.footer ? ($footer = $json.data.pop()) : \"\";\r\n\r\n // Output the HTML structure for the table\r\n var $html = \"\";\r\n $html += '';\r\n\r\n // Add the header\r\n if ($configuration.header) {\r\n // Start the header column\r\n $html += \"\";\r\n // Addind the group column\r\n $html += \"\";\r\n\r\n // Go through all the header cell\r\n $($header).each(function ($index, $value) {\r\n var $cell_class = \"\";\r\n // Add class to second col to align text\r\n $index === 1 ? $cell_class = \"left_align\" : '';\r\n // Add the class and cell value for the header\r\n $html += \"\";\r\n // If this is a total cell add to array to make background darker\r\n $value.toLowerCase().indexOf('total') !== -1 ? $total_columns_index.push($index) : '';\r\n\r\n $column_filters.push({ index: $index + 1, label: $value });\r\n });\r\n\r\n\r\n $html += \"\";\r\n }\r\n\r\n // Addthe body\r\n if ($json.data) {\r\n $html += \"\";\r\n\r\n var $forgroup = \"\";\r\n var $forgroup_label = \"\";\r\n var $forgroup_class = \"\";\r\n $($json.data).each(function ($index, $row) {\r\n\r\n // If the FoR code is one or 3 numbers long add the Zero prefix\r\n $row[0].length < 2 || $row[0].length === 3 ? $row[0] = \"0\" + $row[0] : '';\r\n\r\n // Get the Parent FORCode to group the rows\r\n if ($row[0].length < 3) {\r\n $forgroup = $row[0];\r\n $forgroup_label = $row[1];\r\n $forgroup_class = \"group_header\";\r\n $forgroup_filter.push({ code: $forgroup, label: $forgroup_label });\r\n } else {\r\n $forgroup_class = \"\";\r\n }\r\n\r\n // Add the group class to the row if it is the first item\r\n $html += '';\r\n\r\n // Add the first cell as the FoR group\r\n $html += \"\";\r\n\r\n // Go through each cell and add\r\n $($row).each(function ($index, $cell) {\r\n var $cell_class = \"\";\r\n\r\n if ($raw_value) {\r\n // Do nothing\r\n } else {\r\n // Make sure the value in the cell is 1 decimal place and thousand seperated\r\n if ($decimal_places && $index !== 0 && $index !== 1 && $cell !== \"-\") {\r\n $cell = parseFloat(Number($cell.replace(/,\\s?/g, \"\"))).toFixed($decimal_places).toLocaleString();\r\n $cell = Number($cell).toLocaleString() // Not sure why we need this\r\n }\r\n }\r\n\r\n // Make sure the second column containing the FoR name is left aligned\r\n $index === 1 ? $cell_class = \"left_align\" : '';\r\n\r\n // If the cell is part of the total cell array mark it to change the background color\r\n $total_columns_index.indexOf($index) !== -1 ? $cell_class = \"total_cell\" : '';\r\n\r\n // Add the cell data and class\r\n $html += \"\";\r\n });\r\n\r\n $html += \"\";\r\n });\r\n $html += \"\";\r\n }\r\n\r\n // Add the footer\r\n if ($configuration.footer) {\r\n\r\n // Start of footer\r\n $html += \"\";\r\n // Add a blank column for the total\r\n $html += \"\";\r\n\r\n // Go through each footer cell\r\n $($footer).each(function ($index, $value) {\r\n // Make sure the value is 1 decimal place and has thousand seperator\r\n\r\n if ($raw_value) {\r\n // Do nothing\r\n } else {\r\n if ($decimal_places && $index !== 0 && $index !== 1 && $value !== \"-\") {\r\n $value = parseFloat(Number($value.replace(/,\\s?/g, \"\"))).toFixed($decimal_places).toLocaleString();\r\n $value = Number($value).toLocaleString() // Not sure why we need this\r\n }\r\n }\r\n // Add the value\r\n $html += \"\";\r\n });\r\n\r\n // Close the footer\r\n $html += \"\";\r\n }\r\n\r\n // Close the table\r\n $html += \"
    forgroup\" + $value + \"
    \" + $forgroup + \"\" + $cell + \"
    \" + $value + \"
    \";\r\n\r\n // Add the table on the page\r\n $container.html($html);\r\n\r\n\r\n\r\n // Create the filters for FoR group\r\n var $filter_html = \"\";\r\n\r\n // Go through the filter array\r\n $($forgroup_filter).each(function ($index, $data) {\r\n\r\n // Add the filter markup\r\n $filter_html +=\r\n \"
  • \" +\r\n \"\" +\r\n \"\" +\r\n \"
  • \";\r\n });\r\n\r\n // Add the FoR filter\r\n $container.closest('.section4-tables').find(\".dropdown.widget-container .list\").html($filter_html);\r\n\r\n\r\n\r\n // Make the dataTable\r\n var $columnsDefs;\r\n\r\n\r\n\r\n // Show only 8 columns on the display\r\n $columnsDefs = [\r\n {\r\n targets: 0,\r\n searchable: true,\r\n visible: false\r\n },\r\n {\r\n // targets: [0, 1, 2, 3, 4, $header.length - 1, $header.length], // We can make this a configuration\r\n targets: [\"_all\"], // We can make this a configuration\r\n visible: true\r\n },\r\n {\r\n targets: [\"_all\"],\r\n searchable: false,\r\n visible: false\r\n }\r\n ];\r\n\r\n // console.log($columnsDefs);\r\n\r\n $configuration[\"show_all_columns\"] ? $columnsDefs[1] = { targets: [1, 2, 3], visible: true } : '';\r\n\r\n $configuration[\"columnDefs\"] = $columnsDefs;\r\n\r\n // Configuration for buttons to filter columns \r\n $configuration[\"buttons\"] = [\r\n {\r\n extend: \"colvis\",\r\n text: \"Columns to display\",\r\n background: true,\r\n backgroundClassName: 'fancy-table-button-background'\r\n }\r\n ];\r\n\r\n // Make the table a Datatable\r\n $tables['table_' + $table_counter] = $container.find(\"table\").DataTable($configuration);\r\n\r\n // Add the column filter buttons\r\n // console.log($tables['table_' + $table_counter].buttons().container().html());\r\n // var $button_html = $tables['table_' + $table_counter].buttons().container().html();\r\n // $container.closest(\".table\").find(\".buttons\").append($button_html);\r\n\r\n $tables['table_' + $table_counter].buttons().container().appendTo($container.closest(\".table\").find(\".buttons\"));\r\n\r\n\r\n\r\n // Bind the change action to the filter checkboxes\r\n $(\".dropdown.widget-container .list li.table_group_\" + $table_counter + \" input\").change(function () {\r\n\r\n // When a checkbox is ticked go through the list and build the search filter\r\n var $value = '';\r\n var $table_target = $(this).data('table-target');\r\n\r\n $(this).closest('.dropdown.widget-container').find(\"input:checked\").each(function () {\r\n $value += $(this).val() + \"|\"\r\n })\r\n\r\n // console.log($value);\r\n\r\n // After collecting all the values check if there is anything to filter\r\n if ($value) {\r\n // Use a regex to filter the full value\r\n // console.log($table_target);\r\n // console.log($tables['table_' + $table_target]);\r\n $tables['table_' + $table_target].search(\"^\\\\s*(\" + $value + \")\\\\s*$\", true, false, true).draw();\r\n $(this).closest('.widget-container').find('.selected span').html($value.slice(0, -1).replace(/\\|/g, \", \"));\r\n\r\n } else {\r\n // If no checkbox is ticked then show everything\r\n $tables['table_' + $table_target].search('').draw();\r\n $(this).closest('.widget-container').find('.selected span').html('All');\r\n }\r\n\r\n });\r\n\r\n },\r\n error: function ($err, $file, $inputElem, $reason) {\r\n\r\n $container.closest(\".collapsible-box\").addClass(\"no-data\");\r\n if ($err[\"message\"] === \"Not Found\" || $err[\"message\"] === \"\") {\r\n var $textfile = $configuration.url.substr(0, $configuration.url.lastIndexOf(\"/\") + 1) + \"no.table.footnote.txt\"; // remove everything after the last backslash\r\n var $error_message = \"Data not found\";\r\n $.ajax({\r\n url: $textfile\r\n })\r\n .done(function ($data) {\r\n $data ? ($error_message = $data) : \"\";\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n })\r\n .fail(function ($error) {\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n });\r\n }\r\n }\r\n });\r\n });\r\n\r\n // Make sure there is no empty table\r\n $('body').on('click', \".column-filter-buttons.widget-container button.buttons-columnVisibility\", function ($event) {\r\n if ($(this).closest('.column-filter-buttons').find('.buttons-columnVisibility.active').length === 0) {\r\n $(this).closest('.column-filter-buttons').find('.buttons-columnVisibility').each(function () {\r\n if ($(this).data('cv-idx') !== 0) {\r\n $(this).addClass('auto-clicked');\r\n $(this).click();\r\n }\r\n })\r\n }\r\n });\r\n $('body').on('click', \".column-filter-buttons.widget-container button.buttons-colvis\", function ($event) {\r\n // $event.preventDefault();\r\n // $event.stopPropagation();\r\n // var $button = $(this);\r\n\r\n // if ($button.hasClass('clicked')) {\r\n\r\n // setTimeout(function () {\r\n // $button.closest('.column-filter-buttons').find('.dt-button-collection').hide();\r\n // $button.removeClass('clicked')\r\n // console.log('clicked');\r\n // }, 100);\r\n // } else {\r\n // $button.addClass('clicked')\r\n // }\r\n });\r\n $('body').on('touchstart', \".fancy-table-button-background\", function ($event) {\r\n $('.fancy-table-button-background').click();\r\n });\r\n\r\n // Bind the expland action for FoR filters\r\n $('.widget-container button').click(function ($event) {\r\n $event.stopPropagation()\r\n $(this).siblings('.list').toggleClass('active');\r\n $(this).toggleClass('active');\r\n })\r\n\r\n // Clicking on body to close the filters\r\n $('body').click(function () {\r\n $('.widget-container .selected').removeClass('active');\r\n $('.widget-container .list').removeClass('active');\r\n })\r\n\r\n // Clicking on the open filer dropdown. Stop propagation\r\n $('.widget-container .list').click(function ($event) {\r\n $event.stopPropagation();\r\n });\r\n};\r\n\r\nmodule.exports = TableSection4;\r\n","/* global Papa */\r\n\r\n\"use strict\";\r\n\r\n// Constructor\r\nvar Tablesection5 = function () {\r\n var $table_counter = 0;\r\n var $tables = [];\r\n $(\".csv-table-section5\").each(function () {\r\n var $header; // The header row\r\n var $footer; // The footer row\r\n var $container = $(this);\r\n var $configuration = $container.data(\"configuration\"); // The configuration object from the data attribute\r\n var $table_css_class = $configuration.style ? $configuration.style : \"\";\r\n // var $decimal_places = typeof $configuration.decimal_places === \"undefined\" ? false : $configuration.decimal_places; //Decimal places to show\r\n var $decimal_places = 0; //Decimal places to show\r\n var $forgroup_filter = [];\r\n var $institutions = [];\r\n var $disciplines = [];\r\n var $column_filters = [];\r\n var $total_columns_index = [];\r\n\r\n // Pulls the CSV data in json\r\n Papa.parse($configuration.url, {\r\n download: true,\r\n dynamicTyping: false,\r\n skipEmptyLines: true,\r\n complete: function ($json) {\r\n\r\n // Increment the table counter to use for IDs etc\r\n $table_counter++;\r\n\r\n // Process the data\r\n $configuration.header ? ($header = $json.data.shift()) : \"\";\r\n $configuration.footer ? ($footer = $json.data.pop()) : \"\";\r\n\r\n // Output the HTML structure for the table\r\n var $html = \"\";\r\n var $highlight_column = [];\r\n $html += '';\r\n\r\n // Add the header\r\n if ($configuration.header) {\r\n // Start the header column\r\n $html += \"\";\r\n // Addind the group column\r\n // $html += \"\";\r\n\r\n // Go through all the header cell\r\n\r\n $($header).each(function ($index, $value) {\r\n // console.log($value.substr(0, $value.indexOf(' ')));\r\n $value.substr(0, $value.indexOf(' ')).length === 2 ? $highlight_column.push($index) : ''; // If column is 2 digit mark to highlight\r\n\r\n var $forcode = $value.substring(0, 2);\r\n var $cell_class = \"\";\r\n // Add class to second col to align text\r\n $index === 1 ? $cell_class = \"left_align\" : '';\r\n // Add the class and cell value for the header\r\n $html += \"\";\r\n // If this is a total cell add to array to make background darker\r\n $value.toLowerCase().indexOf('total') !== -1 ? $total_columns_index.push($index) : '';\r\n\r\n $column_filters.push({ index: $index + 1, label: $value });\r\n // console.log($value.substr(0, $value.indexOf(' ')))\r\n\r\n if ($value.substr(0, $value.indexOf(' ')).length === 2) {\r\n $disciplines.push({ code: $value.substr(0, $value.indexOf(' ')), label: $value.substr($value.indexOf(' ') + 1) })\r\n }\r\n });\r\n\r\n // console.log($disciplines);\r\n\r\n $html += \"\";\r\n }\r\n\r\n // console.log($highlight_column);\r\n // Addthe body\r\n if ($json.data) {\r\n $html += \"\";\r\n\r\n var $forgroup = \"\";\r\n var $forgroup_label = \"\";\r\n var $forgroup_class = \"\";\r\n $($json.data).each(function ($index, $row) {\r\n\r\n // If the FoR code is one or 3 numbers long add the Zero prefix\r\n $row[0].length < 2 || $row[0].length === 3 ? $row[0] = \"0\" + $row[0] : '';\r\n\r\n $institutions.push({ label: $row[0] });\r\n\r\n // Add the group class to the row if it is the first item\r\n $html += '';\r\n\r\n // Go through each cell and add\r\n $($row).each(function ($index, $cell) {\r\n var $cell_class = \"\";\r\n\r\n // Make sure the value in the cell is 1 decimal place and thousand seperated\r\n if ($decimal_places && $index !== 0 && $index !== 1 && $cell !== \"-\" && $cell !== \"n/a\") {\r\n $cell = parseFloat(Number($cell.replace(/,\\s?/g, \"\"))).toFixed($decimal_places).toLocaleString();\r\n $cell = Number($cell).toLocaleString() // Not sure why we need this\r\n }\r\n\r\n // Make sure the second column containing the FoR name is left aligned\r\n // $index === 1 ? $cell_class = \"left_align\" : '';\r\n\r\n // If cell is N/A add a class to fade\r\n $cell === 'n/a' ? $cell_class += \"fade\" : '';\r\n\r\n // If cell is marked to highlight\r\n $highlight_column.indexOf($index) !== -1 ? $cell_class += \" highlight\" : ''; // If cell marked to highlight\r\n\r\n // If the cell is part of the total cell array mark it to change the background color\r\n $total_columns_index.indexOf($index) !== -1 ? $cell_class += \"total_cell\" : '';\r\n\r\n // Add the cell data and class\r\n $html += \"\";\r\n });\r\n\r\n $html += \"\";\r\n });\r\n $html += \"\";\r\n }\r\n\r\n // Add the footer\r\n if ($configuration.footer) {\r\n\r\n // Start of footer\r\n $html += \"\";\r\n // Add a blank column for the total\r\n // $html += \"\";\r\n\r\n // Go through each footer cell\r\n $($footer).each(function ($index, $value) {\r\n // Make sure the value is 1 decimal place and has thousand seperator\r\n if ($decimal_places && $index !== 0 && $index !== 1 && $value !== \"-\") {\r\n $value = parseFloat(Number($value.replace(/,\\s?/g, \"\"))).toFixed($decimal_places).toLocaleString();\r\n $value = Number($value).toLocaleString() // Not sure why we need this\r\n }\r\n // Add the value\r\n $html += \"\";\r\n });\r\n\r\n // Close the footer\r\n $html += \"\";\r\n }\r\n\r\n // Close the table\r\n $html += \"
    forgroup\" + $value + \"
    \" + $cell + \"
    \" + $value + \"
    \";\r\n\r\n // Add the table on the page\r\n $container.html($html);\r\n\r\n\r\n\r\n // Create the filters for FoR group\r\n var $filter_html = \"\";\r\n\r\n // Go through the filter array\r\n $($disciplines).each(function ($index, $data) {\r\n\r\n // Add the filter markup\r\n $filter_html +=\r\n \"
  • \" +\r\n \"\" +\r\n \"\" +\r\n \"
  • \";\r\n });\r\n\r\n // Add the FoR filter\r\n $container.closest('.section5-tables').find(\".buttons.widget-container .list\").html($filter_html);\r\n\r\n\r\n // Create the filters for FoR group\r\n var $filter_html = \"\";\r\n\r\n // Go through the filter array\r\n $($institutions).each(function ($index, $data) {\r\n\r\n // Add the filter markup\r\n $filter_html +=\r\n \"
  • \" +\r\n \"\" +\r\n \"\" +\r\n \"
  • \";\r\n });\r\n\r\n // Add the FoR filter\r\n $container.closest('.section5-tables').find(\".dropdown.widget-container .list\").html($filter_html);\r\n\r\n\r\n\r\n\r\n // Make the dataTable\r\n var $columnsDefs;\r\n\r\n // Show only 8 columns on the display\r\n $columnsDefs = [\r\n {\r\n targets: 0,\r\n searchable: true,\r\n visible: true\r\n },\r\n {\r\n // targets: [0, 1, $header.length - 1, $header.length], // We can make this a configuration\r\n targets: [\"_all\"],\r\n visible: true\r\n },\r\n {\r\n targets: [\"_all\"],\r\n searchable: false,\r\n visible: false\r\n }\r\n ];\r\n $configuration[\"columnDefs\"] = $columnsDefs;\r\n\r\n // Make the table a Datatable\r\n $tables['table_' + $table_counter] = $container.find(\"table\").DataTable($configuration);\r\n\r\n\r\n var $visible = [];\r\n var $hidden = [];\r\n var $datatable = $tables['table_' + $table_counter];\r\n\r\n // Bind the change action to the filter checkboxes\r\n $(\".dropdown.widget-container .list li.table_group_\" + $table_counter + \" input\").change(function () {\r\n\r\n // When a checkbox is ticked go through the list and build the search filter\r\n var $value = '';\r\n var $table_target = $(this).data('table-target');\r\n var $counter = 0;\r\n\r\n $(this).closest('.dropdown.widget-container').find(\"input:checked\").each(function () {\r\n $value += $(this).val() + \"|\";\r\n $counter++;\r\n })\r\n\r\n // console.log($value);\r\n\r\n // After collecting all the values check if there is anything to filter\r\n if ($value) {\r\n // Use a regex to filter the full value\r\n // console.log($table_target);\r\n // console.log($tables['table_' + $table_target]);\r\n $tables['table_' + $table_target].search(\"^\\\\s*(\" + $value + \")\\\\s*$\", true, false, true).draw();\r\n $(this).closest('.widget-container').find('.selected span').html($counter);\r\n\r\n } else {\r\n // If no checkbox is ticked then show everything\r\n $tables['table_' + $table_target].search('').draw();\r\n $(this).closest('.widget-container').find('.selected span').html('All');\r\n }\r\n\r\n });\r\n\r\n\r\n // Bind the change action to the filter checkboxes\r\n $(\".buttons.widget-container .list li.table_group_\" + $table_counter + \" input\").change(function () {\r\n\r\n // When a checkbox is ticked go through the list and build the search filter\r\n var $value = '';\r\n var $table_target = $(this).data('table-target');\r\n var $counter = 0;\r\n var $selected = [];\r\n var $datatable = $tables['table_' + $table_target];\r\n\r\n\r\n $(this).closest('.buttons.widget-container').find(\"input:checked\").each(function () {\r\n $value += $(this).val() + \"|\";\r\n $counter++;\r\n $selected.push(parseInt($(this).val()));\r\n })\r\n\r\n // console.log($selected);\r\n\r\n // After collecting all the values check if there is anything to filter\r\n if ($value) {\r\n // Use a regex to filter the full value\r\n $(this).closest('.widget-container').find('.selected span').html($value.slice(0, -1).replace(/\\|/g, \", \"));\r\n\r\n // Go through the columns and check if the for is in it the selected array\r\n $datatable.columns().every(function ($index) {\r\n var $forcode = $(this.header()).data('forcode');\r\n\r\n if ($index > 0) {\r\n // console.log('For code from header',$forcode);\r\n\r\n if ($selected.indexOf($forcode) > -1 || $selected.indexOf(Number($forcode)) > -1) {\r\n this.visible(true, false);\r\n } else {\r\n this.visible(false, false);\r\n }\r\n }\r\n });\r\n $datatable.columns.adjust().draw(false)\r\n\r\n } else {\r\n $(this).closest('.widget-container').find('.selected span').html('All');\r\n $datatable.columns().visible(true);\r\n }\r\n\r\n $datatable.columns.adjust().draw(false)\r\n });\r\n\r\n\r\n // On page load check if there is a FOR code in the url, if there is then tick the box in the \r\n // filter dropdown and filter the table\r\n if (getForFromURL()) {\r\n var $forFromURL = getForFromURL();\r\n setTimeout(function () {\r\n $(\".buttons.widget-container .list li.table_group_\" + $table_counter + \" input[value='\" + $forFromURL + \"']\").prop('checked', true);\r\n $(\".buttons.widget-container .list li.table_group_\" + $table_counter + \" input[value='\" + $forFromURL + \"']\").change();\r\n }, 200);\r\n }\r\n\r\n },\r\n error: function ($err, $file, $inputElem, $reason) {\r\n\r\n $container.closest(\".collapsible-box\").addClass(\"no-data\");\r\n if ($err[\"message\"] === \"Not Found\" || $err[\"message\"] === \"\") {\r\n var $textfile = $configuration.url.substr(0, $configuration.url.lastIndexOf(\"/\") + 1) + \"no.table.footnote.txt\"; // remove everything after the last backslash\r\n var $error_message = \"Data not found\";\r\n $.ajax({\r\n url: $textfile\r\n })\r\n .done(function ($data) {\r\n $data ? ($error_message = $data) : \"\";\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n })\r\n .fail(function ($error) {\r\n $container.replaceWith(\"
    \" + $error_message + \"
    \");\r\n });\r\n }\r\n }\r\n });\r\n });\r\n\r\n function getForFromURL() {\r\n var $vars = {};\r\n var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {\r\n $vars[key] = value;\r\n });\r\n if ($vars['for']) {\r\n var $forcode = $vars['for'].substring(0, 2);\r\n return $forcode;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Tablesection5;\r\n","'use strict';\r\n\r\n// Constructor\r\nvar Header = function () {\r\n $('.slide2').waypoint(function ($direction) {\r\n if ($direction === 'up') {\r\n $('.home .header').removeClass('shrink');\r\n } else {\r\n $('.home .header').addClass('shrink');\r\n }\r\n }, {\r\n offset: $('.slide1').height() / window.innerHeight * 100 * 0.87 + '%'\r\n });\r\n\r\n $('.slide2').waypoint(function ($direction) {\r\n if ($direction === 'up') {\r\n $('.home .menu-trigger').removeClass('dark');\r\n } else {\r\n $('.home .menu-trigger').addClass('dark');\r\n }\r\n }, {\r\n offset: '10%'\r\n });\r\n $('.slide5').waypoint(function ($direction) {\r\n if ($direction === 'up') {\r\n $('.home .menu-trigger').addClass('dark');\r\n } else {\r\n $('.home .menu-trigger').removeClass('dark');\r\n }\r\n }, {\r\n offset: '10%'\r\n });\r\n};\r\n\r\nmodule.exports = Header;\r\n","'use strict';\r\n\r\n// Constructor\r\nvar Slide1 = function () {\r\n $('.slide1').waypoint(function () {\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide1').addClass('active');\r\n $('.slide1 .leaf').addClass('active');\r\n \r\n }, {\r\n offset: '0%'\r\n }); \r\n};\r\n\r\nmodule.exports = Slide1;\r\n","'use strict';\r\n\r\n// Constructor\r\nvar Slide2 = function () {\r\n var $counters = {};\r\n\r\n // Create the counter objects\r\n $('.slide2 .number').each(function () {\r\n $counters[$(this).data('name')] = new CountUp($(this)[0], 0, $(this).data('end'), $(this).data('decimal'), 2.5, {\r\n useEasing: true,\r\n useGrouping: true,\r\n separator: ',',\r\n decimal: '.',\r\n prefix: $(this).data('prefix') ? $(this).data('prefix') : '',\r\n suffix: $(this).data('suffix') ? $(this).data('suffix') : ''\r\n });\r\n\r\n// $(this).html('0');\r\n });\r\n\r\n // When hitting the slide animate the numbers\r\n $('.slide2').waypoint(function () {\r\n $('.slide2 .number').each(function () {\r\n if (!$counters[$(this).data('name')].error) {\r\n $counters[$(this).data('name')].start();\r\n } else {\r\n console.error($counters[$(this).data('name')].error);\r\n }\r\n\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide2').addClass('active');\r\n $('.slide2 .right').addClass('active');\r\n });\r\n }, {\r\n offset: '25%'\r\n });\r\n\r\n $('.slide2').waypoint(function () {\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide1').addClass('active');\r\n }, {\r\n offset: '99%'\r\n });\r\n\r\n\r\n};\r\n\r\nmodule.exports = Slide2;\r\n","'use strict';\r\n\r\n// Constructor\r\nvar Slide3 = function () {\r\n $('.slide3').waypoint(function () {\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide3').addClass('active');\r\n\r\n // Activate the chart\r\n setTimeout(function () {\r\n if (window.charts_collection['home-chart']) {\r\n window.charts_collection['home-chart'].update({\r\n duration: 800,\r\n lazy: false,\r\n easing: 'easeOutBounce'\r\n });\r\n }\r\n }, 300);\r\n }, {\r\n offset: '5%'\r\n });\r\n\r\n $('.slide3').waypoint(function () {\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide2').addClass('active');\r\n $('.slide3').addClass('active');\r\n }, {\r\n offset: '99%'\r\n });\r\n\r\n\r\n // If on home page then draw the chart only when canvas in focus\r\n if ($('main.home').length > 0) {\r\n setTimeout(function () {\r\n if (window.charts_collection['home-chart']) {\r\n window.charts_collection['home-chart'].reset();\r\n }\r\n }, 100);\r\n }\r\n};\r\n\r\nmodule.exports = Slide3;\r\n","'use strict';\r\n\r\n// Constructor\r\nvar Slide4 = function () {\r\n $('.slide4').waypoint(function () {\r\n $('.slide4 .canvas').addClass('active');\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide4').addClass('active');\r\n\r\n }, {\r\n offset: '25%'\r\n });\r\n\r\n $('.slide4').waypoint(function () {\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide3').addClass('active');\r\n }, {\r\n offset: '99%'\r\n });\r\n};\r\n\r\nmodule.exports = Slide4;\r\n","'use strict';\r\n\r\n// Constructor\r\nvar Slide5 = function () {\r\n $('.slide5').waypoint(function () {\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide5').addClass('active');\r\n $('.slide5 .leaf').addClass('active');\r\n }, {\r\n offset: '5%'\r\n });\r\n\r\n $('.slide5').waypoint(function () {\r\n $('.slider button').removeClass('active');\r\n $('.slider .button_slide4').addClass('active');\r\n }, {\r\n offset: '99%'\r\n });\r\n};\r\n\r\nmodule.exports = Slide5;\r\n","'use strict';\r\n\r\n// Constructor\r\nvar Slider = function () {\r\n $('.slides .links a, .slider button').click(function ($event) {\r\n $event.preventDefault();\r\n var $top = $(\".slides.\" + $(this).data('slide')).offset().top ? $(\".slides.\" + $(this).data('slide')).offset().top : 0;\r\n $(\"html, body\").stop().animate({scrollTop: $top}, 500, 'swing', function () {\r\n // Waypoint triggers the actions\r\n });\r\n });\r\n};\r\n\r\nmodule.exports = Slider;\r\n","'use strict';\r\n\r\n// Constructor\r\nvar Slides = function () {\r\n// this.name = 'slides';\r\n// console.log('%s module', this.name);\r\n\r\n if ($('main.home').length > 0) {\r\n window.onbeforeprint = function (event) {\r\n\r\n $(\"html, body\").stop().animate({scrollTop: document.body.scrollHeight}, 10, 'swing', function () {\r\n\r\n $(\"html, body\").stop().animate({scrollTop: (document.body.scrollHeight * -1)}, 10, 'swing', function () {\r\n // Waypoint triggers the actions\r\n });\r\n });\r\n };\r\n }\r\n\r\n// var mediaQueryList = window.matchMedia('print');\r\n// mediaQueryList.addListener(function (mql) {\r\n// if (mql.matches) {\r\n// console.log('webkit equivalent of onbeforeprint');\r\n//// window.scrollTo(0, document.body.scrollHeight);\r\n// $('.slide2 .right').addClass('active');\r\n//\r\n//\r\n// }\r\n// });\r\n\r\n\r\n\r\n};\r\n\r\nmodule.exports = Slides;\r\n","// Main javascript entry point\r\n// Should handle bootstrapping/starting application\r\n\r\n'use strict';\r\n\r\nvar Chartblock = require('../_modules/data/chartblock/chartblock');\r\nvar Table = require('../_modules/data/table/table');\r\nvar TableSection1 = require('../_modules/data/table/table.section1');\r\nvar TableSection4 = require('../_modules/data/table/table.section4');\r\nvar Tablesection5 = require('../_modules/data/table/table.section5');\r\n\r\nvar Header = require('../_modules/home/header/header');\r\nvar Slides = require('../_modules/home/slides/slides');\r\nvar Slide1 = require('../_modules/home/slide1/slide1');\r\nvar Slide2 = require('../_modules/home/slide2/slide2');\r\nvar Slide3 = require('../_modules/home/slide3/slide3');\r\nvar Slide4 = require('../_modules/home/slide4/slide4');\r\nvar Slide5 = require('../_modules/home/slide5/slide5');\r\nvar Slider = require('../_modules/home/slider/slider');\r\nvar CommonHeader = require('../_modules/common/header/header');\r\nvar TitleBar = require('../_modules/common/title-bar/title-bar');\r\nvar CollapsibleBox = require('../_modules/common/collapsible-box/collapsible-box');\r\nvar PageScroll = require('../_modules/common/page-scroll/page-scroll');\r\nvar TabBox = require('../_modules/common/tab-box/tab-box');\r\nvar MainNavigation = require('../_modules/common/main-navigation/main-navigation');\r\n\r\n\r\n// Reset the chart array\r\nwindow.charts_collection = [];\r\n\r\n\r\n$(function() {\r\n new Chartblock();\r\n new Table();\r\n new TableSection1();\r\n new TableSection4();\r\n new Tablesection5();\r\n \r\n new CommonHeader();\r\n new CollapsibleBox();\r\n new TabBox();\r\n new MainNavigation();\r\n new PageScroll();\r\n new TitleBar();\r\n \r\n new Header();\r\n new Slides();\r\n new Slide1();\r\n new Slide2();\r\n new Slide3();\r\n new Slide4();\r\n new Slide5();\r\n new Slider();\r\n});\r\n"],"sourceRoot":"/source/"}