{"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","$show_data_labels_format","show_data_labels_format","$padding_right","padding_right","$padding_left","padding_left","$padding_bottom","padding_bottom","$bar_line_height","bar_line_height","$tooltip_show_currency","tooltip_show_currency","$tooltip_show_label","tooltip_show_label","$tooltip_show_current_label","tooltip_show_current_label","$tooltip_overite_label","tooltip_overite_label","$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","$step_size","step_size","$label_max_width","label_max_width","$y_axis_fix_width","y_axis_fix_width","$min_rotation","min_rotation","$x_begin_at_zero","x_begin_at_zero","$y_thousand_seperator","y_thousand_seperator","$tooltip_label_index_value_index","tooltip_label_index_value_index","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","$chart_value_styling","display","color","align","anchor","font","weight","size","family","formatter","context","$formatted_value","dataset","getContext","labels","datasets","options","responsive","elements","line","tension","maintainAspectRatio","layout","padding","right","bottom","tooltips","mode","callbacks","tooltipItem","dataLabel","datasetIndex","join","$current_label","toLocaleString","toFixed","position","boxWidth","fontSize","fontFamily","filter","$item","$chartdata","stopPropagation","scales","xAxes","stacked","gridLines","ticks","fontColor","beginAtZero","maxRotation","minRotation","autoSkip","callback","values","$suffix","$divider","$largest","max","apply","scaleLabel","labelString","fontStyle","yAxes","barThickness","afterFit","scaleInstance","stepSize","plugins","datalabels","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","$counter","$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","$engagement_highlight_column","$impact_highlight_column","$approach_highlight_column","$value_formatted","$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,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GAAA,EAAA,IAAAI,EAAA,MAAAA,GAAAJ,GAAA,EAAA,IAAAK,GAAA,GAAAC,OAAA,uBAAAN,EAAA,IAAA,MAAAK,GAAAE,KAAA,mBAAAF,EAAA,GAAAG,GAAAX,EAAAG,IAAAS,WAAAb,GAAAI,GAAA,GAAAU,KAAAF,EAAAC,QAAA,SAAAd,GAAA,GAAAE,GAAAD,EAAAI,GAAA,GAAAL,EAAA,OAAAI,GAAAF,GAAAF,IAAAa,EAAAA,EAAAC,QAAAd,EAAAC,EAAAC,EAAAC,GAAA,MAAAD,GAAAG,GAAAS,QAAA,IAAA,GAAAL,GAAA,kBAAAD,UAAAA,QAAAH,EAAA,EAAAA,EAAAF,EAAAa,OAAAX,IAAAD,EAAAD,EAAAE,GAAA,OAAAD,GAAA,MAAAJ,OAAAiB,GAAA,SAAAT,EAAAU,EAAAJ,GCAA,YAGA,IAAAK,GAAA,WACAC,EAAA,4BAAAC,MAAA,SAAAC,GACAA,EAAAC,iBACAH,EAAAI,MAAAC,QAAA,oBAAAC,YAAA,cAIAR,GAAAJ,QAAAK,OCGMQ,GAAG,SAASnB,EAAQU,EAAOJ,GCbjC,YAGA,IAAAc,GAAA,WACAR,EAAA,cAAAS,SAAA,SAAAC,GACA,OAAAA,GACAV,EAAA,uBAAAW,Y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AA,kCACA+c,EAAA/c,EAAA,kCACAoB,EAAApB,EAAA,oCACAsE,EAAAtE,EAAA,0CACAW,EAAAX,EAAA,sDACAyC,EAAAzC,EAAA,8CACAkE,EAAAlE,EAAA,sCACA2B,EAAA3B,EAAA,qDAIAgC,QAAAkD,qBAGAtE,EAAA,WACA,GAAA0E,GACA,GAAA+R,GACA,GAAAmB,GACA,GAAAI,GACA,GAAAsB,GAEA,GAAA9Y,GACA,GAAAT,GACA,GAAAuD,GACA,GAAAvC,GACA,GAAAc,GACA,GAAA6B,GAEA,GAAA+W,GACA,GAAA8B,GACA,GAAA3B,GACA,GAAAE,GACA,GAAAW,GACA,GAAAM,GACA,GAAAE,GACA,GAAAE,OnBi7EGW,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 // console.log($id);\n setTimeout(function(){\n $(\"html, body\").animate({ scrollTop: $('#' + $id).offset().top - 300 }, 1000);\n }, 300)\n $(\"html, body\").animate({ scrollTop: $('#' + $id).offset().top - 300 }, 1000);\n\n // if($id === \"use-of-the-ei-national-report\") {\n // $(\"html, body\").animate({ scrollTop: $('#' + $id).offset().top - 300 }, 1000);\n // setTimeout(function(){\n // $(\"html, body\").animate({ scrollTop: $('#' + $id).offset().top - 300 }, 1000);\n // }, 300)\n // } else {\n // $(\"html, body\").animate({ scrollTop: $('#' + $id).offset().top - 300 }, 1000);\n // }\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 $show_data_labels_format = typeof $configuration.show_data_labels_format === 'undefined' ? false : $configuration.show_data_labels_format; // 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 $padding_bottom = typeof $configuration.padding_bottom === 'undefined' ? 0 : $configuration.padding_bottom; //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_label = typeof $configuration.tooltip_show_label === 'undefined' ? false : $configuration.tooltip_show_label; //Show currency in tooltip\r\n var $tooltip_show_current_label = typeof $configuration.tooltip_show_current_label === 'undefined' ? false : $configuration.tooltip_show_current_label; //Show currency in tooltip\r\n var $tooltip_overite_label = typeof $configuration.tooltip_overite_label === 'undefined' ? false : $configuration.tooltip_overite_label; //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 var $step_size = typeof $configuration.step_size === 'undefined' ? false : $configuration.step_size; // Done for gender chart, always have positive values\r\n var $label_max_width = typeof $configuration.label_max_width === 'undefined' ? 50 : $configuration.label_max_width; // Done for gender chart, always have positive values\r\n var $y_axis_fix_width = typeof $configuration.y_axis_fix_width === 'undefined' ? false : $configuration.y_axis_fix_width; // Done for gender chart, always have positive values\r\n var $min_rotation = typeof $configuration.min_rotation === 'undefined' ? 0 : $configuration.min_rotation; // Rotation of x axis label\r\n var $x_begin_at_zero = typeof $configuration.x_begin_at_zero === 'undefined' ? false : $configuration.x_begin_at_zero; // Rotation of x axis label\r\n var $y_thousand_seperator = typeof $configuration.y_thousand_seperator === 'undefined' ? false : $configuration.y_thousand_seperator; // Rotation of x axis label\r\n var $tooltip_label_index_value_index = typeof $configuration.tooltip_label_index_value_index === 'undefined' ? false : $configuration.tooltip_label_index_value_index; // Stacked doughnut chart to pick the correct label\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\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 $y_axis_fix_width = false;\r\n $label_max_width = 15;\r\n }\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 = $label_max_width; // 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 // if ($type == 'doughnut') {\r\n // $show_data_labels = true;\r\n // $show_data_labels_format = true;\r\n // }\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 // if($type == 'doughnut') {\r\n // // console.log($value);\r\n // }\r\n\r\n $($value).each(function ($key, $number) {\r\n\r\n\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\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 $value.length > 1 && $type == 'doughnut' ? $color_index = $index : '';\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\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\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 // console.log($chart_height, $configuration.bar_line_height, $bar_line_height, $labels.length);\r\n // console.log($configuration.bar_line_height, $bar_line_height, $labels.length);\r\n\r\n }\r\n\r\n\r\n if (!$chart_stack && $type === 'horizontalBar') {\r\n $bar_line_height = $configuration.bar_line_height;\r\n\r\n }\r\n\r\n if (window.innerWidth < 700 && $type === 'horizontalBar') {\r\n $bar_line_height = 15\r\n }\r\n\r\n // console.log($bar_line_height);\r\n\r\n\r\n if ($show_data_labels_format) {\r\n var $chart_value_styling = {\r\n display: $show_data_labels,\r\n color: '#FFFFFF',\r\n align: 'center',\r\n offset: 0,\r\n anchor: 'center',\r\n font: {\r\n weight: 'bold',\r\n size: '13',\r\n family: 'Cabin'\r\n },\r\n formatter: function (value, context) {\r\n var $formatted_value = [context.dataset.label, value + '%']\r\n return $formatted_value;\r\n }\r\n\r\n }\r\n } else {\r\n var $chart_value_styling = {\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 // 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: $padding_bottom\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 var $current_label = data.labels[tooltipItem.datasetIndex];\r\n\r\n $tooltip_label_index_value_index ? $current_label = data.labels[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_label ? value = $tooltip_show_label + \": \" + value : '';\r\n $tooltip_show_current_label ? value = $current_label + \": \" + 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 $tooltip_overite_label ? 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\") || data.datasets.length === 1 && $type === \"bar\") {\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' && $item['text'] !== null) {\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 beginAtZero: $x_begin_at_zero,\r\n maxRotation: 90,\r\n minRotation: $min_rotation,\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 // $tooltip_show_label ? value = $tooltip_show_label + \": \" + 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 afterFit: function (scaleInstance) {\r\n if ($y_axis_fix_width) {\r\n scaleInstance.width = $y_axis_fix_width; // sets the width to 100px\r\n }\r\n },\r\n ticks: {\r\n fontSize: $label_font_size,\r\n fontColor: '#021A2B',\r\n stepSize: $step_size,\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 } else {\r\n if ($y_thousand_seperator) {\r\n value = value.toLocaleString();\r\n }\r\n }\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: $chart_value_styling\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 var $counter = 0;\r\n\r\n // Go through all the header cell\r\n $($header).each(function ($index, $value) {\r\n $counter++;\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 var $counter = 0;\r\n\r\n // Go through each cell and add\r\n $($row).each(function ($index, $cell) {\r\n $counter++;\r\n\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 var $counter = 0;\r\n // Go through each footer cell\r\n $($footer).each(function ($index, $value) {\r\n\r\n $counter++;\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], 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 var $engagement_highlight_column = [];\r\n var $impact_highlight_column = [];\r\n var $approach_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 $value.indexOf('Engagement') > -1 ? $engagement_highlight_column.push($index) : '';\r\n $value.indexOf('Impact') > -1 ? $impact_highlight_column.push($index) : '';\r\n $value.indexOf('Approach') > -1 ? $approach_highlight_column.push($index) : '';\r\n // console.log($value.replace(/ /g,\"_\"));\r\n\r\n // var $forcode = $value.substring(0, 2);\r\n var $forcode = $value.replace(/ /g, \"_\");\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\r\n // Format the value to show on different line\r\n var $value_formatted = $value ? \"\" + $value.split('-')[0] + \"\" + $value.split('-')[1] + \"\" : '';\r\n\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 $disciplines.push({ code: $value.replace(/ /g, \"_\"), label: $value })\r\n\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 $engagement_highlight_column.indexOf($index) !== -1 ? $cell_class += \" highlight_engagement\" : ''; // If cell marked to highlight\r\n $impact_highlight_column.indexOf($index) !== -1 ? $cell_class += \" highlight_impact\" : ''; // If cell marked to highlight\r\n $approach_highlight_column.indexOf($index) !== -1 ? $cell_class += \" highlight_approach\" : ''; // 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_formatted + \"
    \" + $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 // console.log($(this).val().replace(/_/g,\" \"));\r\n\r\n // $value += $(this).val() + \"|\";\r\n $value += $(this).val().replace(/_/g, \" \") + \"|\";\r\n $counter++;\r\n $selected.push($(this).val().replace(/_/g, \" \"));\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().replace(/-/g, \"_\");\r\n // console.log($forFromURL.replace(/-/g, \"_\"));\r\n setTimeout(function () {\r\n $(\".buttons.widget-container .list li.table_group_\" + $table_counter + \" input\").each(function () {\r\n // console.log('input value: ', $(this).val().toLowerCase());\r\n // console.log('input value formatted: ', $(this).val().toLowerCase().replace(/,/g, \"\").replace(/-/g, \"\").replace(/__/g, \"_\"));\r\n // console.log('forcode:', $forFromURL);\r\n // console.log(\"----\");\r\n\r\n\r\n if ($(this).val().toLowerCase().replace(/,/g, \"\").replace(/-/g, \"\").replace(/__/g, \"_\").indexOf($forFromURL) > -1) {\r\n $(this).prop('checked', true);\r\n $(this).change();\r\n }\r\n })\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'];\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 // console.log($id);\n setTimeout(function(){\n $(\"html, body\").animate({ scrollTop: $('#' + $id).offset().top - 300 }, 1000);\n }, 300)\n $(\"html, body\").animate({ scrollTop: $('#' + $id).offset().top - 300 }, 1000);\n\n // if($id === \"use-of-the-ei-national-report\") {\n // $(\"html, body\").animate({ scrollTop: $('#' + $id).offset().top - 300 }, 1000);\n // setTimeout(function(){\n // $(\"html, body\").animate({ scrollTop: $('#' + $id).offset().top - 300 }, 1000);\n // }, 300)\n // } else {\n // $(\"html, body\").animate({ scrollTop: $('#' + $id).offset().top - 300 }, 1000);\n // }\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 $show_data_labels_format = typeof $configuration.show_data_labels_format === 'undefined' ? false : $configuration.show_data_labels_format; // 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 $padding_bottom = typeof $configuration.padding_bottom === 'undefined' ? 0 : $configuration.padding_bottom; //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_label = typeof $configuration.tooltip_show_label === 'undefined' ? false : $configuration.tooltip_show_label; //Show currency in tooltip\r\n var $tooltip_show_current_label = typeof $configuration.tooltip_show_current_label === 'undefined' ? false : $configuration.tooltip_show_current_label; //Show currency in tooltip\r\n var $tooltip_overite_label = typeof $configuration.tooltip_overite_label === 'undefined' ? false : $configuration.tooltip_overite_label; //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 var $step_size = typeof $configuration.step_size === 'undefined' ? false : $configuration.step_size; // Done for gender chart, always have positive values\r\n var $label_max_width = typeof $configuration.label_max_width === 'undefined' ? 50 : $configuration.label_max_width; // Done for gender chart, always have positive values\r\n var $y_axis_fix_width = typeof $configuration.y_axis_fix_width === 'undefined' ? false : $configuration.y_axis_fix_width; // Done for gender chart, always have positive values\r\n var $min_rotation = typeof $configuration.min_rotation === 'undefined' ? 0 : $configuration.min_rotation; // Rotation of x axis label\r\n var $x_begin_at_zero = typeof $configuration.x_begin_at_zero === 'undefined' ? false : $configuration.x_begin_at_zero; // Rotation of x axis label\r\n var $y_thousand_seperator = typeof $configuration.y_thousand_seperator === 'undefined' ? false : $configuration.y_thousand_seperator; // Rotation of x axis label\r\n var $tooltip_label_index_value_index = typeof $configuration.tooltip_label_index_value_index === 'undefined' ? false : $configuration.tooltip_label_index_value_index; // Stacked doughnut chart to pick the correct label\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\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 $y_axis_fix_width = false;\r\n $label_max_width = 15;\r\n }\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 = $label_max_width; // 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 // if ($type == 'doughnut') {\r\n // $show_data_labels = true;\r\n // $show_data_labels_format = true;\r\n // }\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 // if($type == 'doughnut') {\r\n // // console.log($value);\r\n // }\r\n\r\n $($value).each(function ($key, $number) {\r\n\r\n\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\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 $value.length > 1 && $type == 'doughnut' ? $color_index = $index : '';\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\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\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 // console.log($chart_height, $configuration.bar_line_height, $bar_line_height, $labels.length);\r\n // console.log($configuration.bar_line_height, $bar_line_height, $labels.length);\r\n\r\n }\r\n\r\n\r\n if (!$chart_stack && $type === 'horizontalBar') {\r\n $bar_line_height = $configuration.bar_line_height;\r\n\r\n }\r\n\r\n if (window.innerWidth < 700 && $type === 'horizontalBar') {\r\n $bar_line_height = 15\r\n }\r\n\r\n // console.log($bar_line_height);\r\n\r\n\r\n if ($show_data_labels_format) {\r\n var $chart_value_styling = {\r\n display: $show_data_labels,\r\n color: '#FFFFFF',\r\n align: 'center',\r\n offset: 0,\r\n anchor: 'center',\r\n font: {\r\n weight: 'bold',\r\n size: '13',\r\n family: 'Cabin'\r\n },\r\n formatter: function (value, context) {\r\n var $formatted_value = [context.dataset.label, value + '%']\r\n return $formatted_value;\r\n }\r\n\r\n }\r\n } else {\r\n var $chart_value_styling = {\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 // 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: $padding_bottom\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 var $current_label = data.labels[tooltipItem.datasetIndex];\r\n\r\n $tooltip_label_index_value_index ? $current_label = data.labels[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_label ? value = $tooltip_show_label + \": \" + value : '';\r\n $tooltip_show_current_label ? value = $current_label + \": \" + 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 $tooltip_overite_label ? 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\") || data.datasets.length === 1 && $type === \"bar\") {\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' && $item['text'] !== null) {\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 beginAtZero: $x_begin_at_zero,\r\n maxRotation: 90,\r\n minRotation: $min_rotation,\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 // $tooltip_show_label ? value = $tooltip_show_label + \": \" + 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 afterFit: function (scaleInstance) {\r\n if ($y_axis_fix_width) {\r\n scaleInstance.width = $y_axis_fix_width; // sets the width to 100px\r\n }\r\n },\r\n ticks: {\r\n fontSize: $label_font_size,\r\n fontColor: '#021A2B',\r\n stepSize: $step_size,\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 } else {\r\n if ($y_thousand_seperator) {\r\n value = value.toLocaleString();\r\n }\r\n }\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: $chart_value_styling\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 var $counter = 0;\r\n\r\n // Go through all the header cell\r\n $($header).each(function ($index, $value) {\r\n $counter++;\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 var $counter = 0;\r\n\r\n // Go through each cell and add\r\n $($row).each(function ($index, $cell) {\r\n $counter++;\r\n\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 var $counter = 0;\r\n // Go through each footer cell\r\n $($footer).each(function ($index, $value) {\r\n\r\n $counter++;\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], 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 var $engagement_highlight_column = [];\r\n var $impact_highlight_column = [];\r\n var $approach_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 $value.indexOf('Engagement') > -1 ? $engagement_highlight_column.push($index) : '';\r\n $value.indexOf('Impact') > -1 ? $impact_highlight_column.push($index) : '';\r\n $value.indexOf('Approach') > -1 ? $approach_highlight_column.push($index) : '';\r\n // console.log($value.replace(/ /g,\"_\"));\r\n\r\n // var $forcode = $value.substring(0, 2);\r\n var $forcode = $value.replace(/ /g, \"_\");\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\r\n // Format the value to show on different line\r\n var $value_formatted = $value ? \"\" + $value.split('-')[0] + \"\" + $value.split('-')[1] + \"\" : '';\r\n\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 $disciplines.push({ code: $value.replace(/ /g, \"_\"), label: $value })\r\n\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 $engagement_highlight_column.indexOf($index) !== -1 ? $cell_class += \" highlight_engagement\" : ''; // If cell marked to highlight\r\n $impact_highlight_column.indexOf($index) !== -1 ? $cell_class += \" highlight_impact\" : ''; // If cell marked to highlight\r\n $approach_highlight_column.indexOf($index) !== -1 ? $cell_class += \" highlight_approach\" : ''; // 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_formatted + \"
    \" + $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 // console.log($(this).val().replace(/_/g,\" \"));\r\n\r\n // $value += $(this).val() + \"|\";\r\n $value += $(this).val().replace(/_/g, \" \") + \"|\";\r\n $counter++;\r\n $selected.push($(this).val().replace(/_/g, \" \"));\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().replace(/-/g, \"_\");\r\n // console.log($forFromURL.replace(/-/g, \"_\"));\r\n setTimeout(function () {\r\n $(\".buttons.widget-container .list li.table_group_\" + $table_counter + \" input\").each(function () {\r\n // console.log('input value: ', $(this).val().toLowerCase());\r\n // console.log('input value formatted: ', $(this).val().toLowerCase().replace(/,/g, \"\").replace(/-/g, \"\").replace(/__/g, \"_\"));\r\n // console.log('forcode:', $forFromURL);\r\n // console.log(\"----\");\r\n\r\n\r\n if ($(this).val().toLowerCase().replace(/,/g, \"\").replace(/-/g, \"\").replace(/__/g, \"_\").indexOf($forFromURL) > -1) {\r\n $(this).prop('checked', true);\r\n $(this).change();\r\n }\r\n })\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'];\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/"}