Skip to content

Instantly share code, notes, and snippets.

@eddiejessup
Last active April 27, 2018 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eddiejessup/a780d3a204bb6abd0bfd8918edaa1eb7 to your computer and use it in GitHub Desktop.
Save eddiejessup/a780d3a204bb6abd0bfd8918edaa1eb7 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# UK Government spending\n",
"\n",
"Let's investigate what the UK government spends its money on."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Introduction\n",
"\n",
"At [ukpublicspending.co.uk](www.ukpublicspending.co.uk), someone called Christopher Chantrill has compiled an impressively detailed set of data to do with the finances of the UK government. This includes data on revenue, debt, interest payments and spending, in some cases back to 1692.\n",
"\n",
"The data on the website is impressive, but the web design and visualization are ugly. Let's get some of that data, and make some analyses that are more pleasant, and easier to understand."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from enum import Enum\n",
"from io import StringIO\n",
"import json\n",
"\n",
"import requests\n",
"from bs4 import BeautifulSoup\n",
"import pandas as pd\n",
"\n",
"\n",
"class UnitType(Enum):\n",
" \"\"\"Little convenience to remember URL argument to set units.\"\"\"\n",
"\n",
" billion = 'b'\n",
" percent_gdp = 'p'\n",
"\n",
" \n",
"uk_pub_spend_url_template = 'http://www.ukpublicspending.co.uk/year_download_{}UK{}n_16{}c1n'\n",
"\n",
"def year_to_data(year, unit_type=UnitType.billion):\n",
" url = uk_pub_spend_url_template.format(year, unit_type.value, unit_type.value)\n",
" html_doc = requests.get(url).content\n",
" soup = BeautifulSoup(html_doc, 'html.parser')\n",
" # Get the part of the page with the data as tab-separated values.\n",
" s = soup.find(attrs={'name': 'text1'}).contents[0]\n",
"\n",
" # Massage the data into a form that can be parsed by Pandas.\n",
" lns = s.split('\\n')\n",
" lns = lns[4:15]\n",
" s = '\\n'.join(lns)\n",
"\n",
" dt = pd.read_csv(StringIO(s), sep='\\t', thousands=',')\n",
" dt.loc[:, 'Year'] = year\n",
" dt.rename(columns={'Unnamed: 0': 'Sector'}, inplace=True)\n",
" return dt\n",
"\n",
"years_of_interest = list(range(1990, 2018))\n",
"\n",
"dts = [year_to_data(year) for year in years_of_interest]\n",
"d = pd.concat(dts).loc[:, ('Sector', 'Total', 'Year')]\n",
"d.sort_values(['Year', 'Sector'], inplace=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The reported numbers are not adjusted for inflation, so I used an API at [statbureau.org](https://www.statbureau.org) to grab inflation figures; the values I report are all adjusted for inflation."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"def year_to_inflation_value(year):\n",
" # Inflation-adjust £1000, to keep a reasonable amount of numerical accuracy, since\n",
" # the values are rounded to the nearest penny.\n",
" factor = 1000.0\n",
" response = requests.get(\n",
" 'https://www.statbureau.org/calculate-inflation-value-json',\n",
" params={'country': 'united-kingdom',\n",
" 'amount': factor,\n",
" 'start': '{}-01-01'.format(years_of_interest[-1]),\n",
" 'end': '{}-01-01'.format(year)})\n",
" price_raw = response.content.decode()\n",
" price_raw = price_raw.replace(' ', '').replace('£', '').replace('\"', '')\n",
" price = float(price_raw)\n",
" price /= factor\n",
" return price\n",
"\n",
"year_data = pd.DataFrame({'Year': d.Year.unique()})\n",
"year_data.loc[:, 'inflation_price'] = year_data.Year.apply(year_to_inflation_value)\n",
"d = pd.merge(d, year_data, on='Year')\n",
"d.loc[:, 'Total_adj'] = d.Total * d.inflation_price"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Spending by sector in 2015\n",
"\n",
"2015 has been and gone, so let's see what got spent. Although it's exciting to see figures in the distant past, I'm going to stick to figure in the past few decades. Since 1983, the data I use comes ultimately from the [Public Expenditure Statistical Analyses]((https://www.gov.uk/government/statistics/public-expenditure-statistical-analyses-2016) (PESA), carried out by the UK treasury. However, the categorization is not one used by them; instead, it's processed by Christopher into these categories shown below."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"I'm going to make my charts using bokeh, a fantastic, new-ish plotting library designed to output interactive visualizations for viewing in the browser. Its high-level 'charts' API is a joy to use, and I thoroughly recommend it. Matplotlib had its day, but I really think Bokeh is now a viable successor. I haven't tried as hard as I might otherwise, to set sensible axis limits, legend locations and font sizes, because the interactivity makes this less of a burden: just pan and zoom about!\n",
"\n",
"I think this interactivity becoming the norm, as well as being good for usability, would also be good for openness and reproducibility: from my time in academia I know many times when, even if only half-consciously, people have framed their plots to better support their position."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": []
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
"(function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
"\n",
" var force = \"1\";\n",
"\n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
"\n",
"\n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_timeout = Date.now() + 5000;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
"\n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
"\n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" Bokeh.$(\"#\").text(\"BokehJS successfully loaded.\");\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
"\n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
"\n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };\n",
"\n",
" var js_urls = ['https://cdn.pydata.org/bokeh/release/bokeh-0.12.3.min.js', 'https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.3.min.js'];\n",
"\n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.set_log_level(\"info\");\n",
" },\n",
" \n",
" function(Bokeh) {\n",
" \n",
" Bokeh.$(\"#630617fa-f90a-477f-a58b-a937a906838d\").text(\"BokehJS is loading...\");\n",
" },\n",
" function(Bokeh) {\n",
" console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.12.3.min.css\");\n",
" Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.12.3.min.css\");\n",
" console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.3.min.css\");\n",
" Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.12.3.min.css\");\n",
" }\n",
" ];\n",
"\n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (!force) {\n",
" var cell = $(\"#\").parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
"\n",
" }\n",
"\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
"}(this));"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from bokeh.plotting import figure, show\n",
"from bokeh.io import output_notebook\n",
"from bokeh.charts import Bar, Scatter, defaults, Line\n",
"from bokeh.charts.attributes import CatAttr\n",
"from bokeh.palettes import brewer\n",
"\n",
"# Bokeh comes bundled with [colorbrewer](colorbrewer2.org) palettes, which I like.\n",
"palette = brewer['Set3'][12]\n",
"# We can output interactive plots right in the Jupyter notebook.\n",
"output_notebook(hide_banner=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Anyway, here's the breakdown,"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"plotdiv\" id=\"6fec69c8-4e13-45c6-a5c1-1d8ed10c9d48\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = \"\";\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_timeout = Date.now() + 0;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
" \n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
" \n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" Bokeh.$(\"#6fec69c8-4e13-45c6-a5c1-1d8ed10c9d48\").text(\"BokehJS successfully loaded.\");\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
" \n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
" \n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"6fec69c8-4e13-45c6-a5c1-1d8ed10c9d48\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid '6fec69c8-4e13-45c6-a5c1-1d8ed10c9d48' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
" \n",
" var js_urls = [];\n",
" \n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.$(function() {\n",
" var docs_json = {\"1e64f688-7075-4aa2-8c6e-d04e96732d11\":{\"roots\":{\"references\":[{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"55f1103a-640d-4c81-990e-edc7d7e295ed\",\"type\":\"Rect\"},{\"attributes\":{\"data_source\":{\"id\":\"2a0adcfe-c686-4df4-8e13-83bed9b7ff8a\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2dda8f62-7237-45f0-9dc4-03d3223b1885\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"ba6c674c-f545-4f65-8cc9-cc77a5d45bc4\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"ee4035eb-07df-4f07-8b11-6c72e559549d\",\"type\":\"PanTool\"},{\"id\":\"0c5971ab-3e5e-46d8-a030-a2bf879b12a9\",\"type\":\"WheelZoomTool\"},{\"id\":\"77c2742f-c2b8-466c-8322-8e8fcbac91b8\",\"type\":\"BoxZoomTool\"},{\"id\":\"7ab51e32-a5b7-423e-b597-5a0e33f7c4e0\",\"type\":\"SaveTool\"},{\"id\":\"aa2bf99a-cd7b-4453-a2e9-a85d2f6ad6af\",\"type\":\"ResetTool\"},{\"id\":\"3e85dda3-2b8d-4bdd-999e-e342634f49fe\",\"type\":\"HelpTool\"}]},\"id\":\"d03d9ca2-081c-40f4-97fa-ccf8d190b162\",\"type\":\"Toolbar\"},{\"attributes\":{\"plot\":{\"id\":\"9bf06858-64a9-4511-889f-c14e3f6233c3\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"0c5971ab-3e5e-46d8-a030-a2bf879b12a9\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"8e173531-033f-45da-8597-fe5fa20f8d0f\",\"type\":\"Rect\"},{\"attributes\":{\"axis_label\":\"Sector\",\"formatter\":{\"id\":\"941fd8c2-3b80-4f4c-9bce-8a016097ba1a\",\"type\":\"CategoricalTickFormatter\"},\"major_label_orientation\":0.7853981633974483,\"plot\":{\"id\":\"9bf06858-64a9-4511-889f-c14e3f6233c3\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"a7faf781-2763-4987-957e-6483c4a4afce\",\"type\":\"CategoricalTicker\"}},\"id\":\"9480e64d-6fb2-4881-9211-bfec6d83db0e\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"e848bbd5-7795-450e-a750-a79b3cbc818c\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"d34ca441-dea4-4d1e-8f7e-271df66bcd2b\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"15f18b64-445b-4507-85bc-99983d5ee156\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"end\":159.01861710000003},\"id\":\"567c7cc7-febd-4f64-9424-450e2a8e626d\",\"type\":\"Range1d\"},{\"attributes\":{},\"id\":\"941fd8c2-3b80-4f4c-9bce-8a016097ba1a\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"Sector\":[\"Transport\"],\"chart_index\":[{\"Sector\":\"Transport\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[20.523097000000003],\"label\":[{\"Sector\":\"Transport\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Transport\"],\"y\":[10.261548500000002]}},\"id\":\"b49bbd13-c475-41b8-9b1c-9d52a7a2767e\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"b49bbd13-c475-41b8-9b1c-9d52a7a2767e\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"8e173531-033f-45da-8597-fe5fa20f8d0f\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"678c5a14-0dcb-4363-b98d-ac2423331e1d\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"688e62ed-a1de-4669-88c4-0601cbf4e05c\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"55f1103a-640d-4c81-990e-edc7d7e295ed\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"4bd8b786-b70d-4633-af7f-87a5af0208df\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"d34ca441-dea4-4d1e-8f7e-271df66bcd2b\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"66d6ff35-b88f-4870-8741-6b6b10b55dcf\",\"type\":\"Rect\"},{\"attributes\":{},\"id\":\"76df4522-ebf8-4dc9-815d-df09ba3c01de\",\"type\":\"ToolEvents\"},{\"attributes\":{\"below\":[{\"id\":\"9480e64d-6fb2-4881-9211-bfec6d83db0e\",\"type\":\"CategoricalAxis\"}],\"left\":[{\"id\":\"0b5db5e9-0b86-4362-966e-09f1f6d612ef\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"35f9b8dc-43fc-4b8a-8a36-aecf5da4b1e9\",\"type\":\"BoxAnnotation\"},{\"id\":\"f3898095-b58e-4ac9-af2d-56f81e546737\",\"type\":\"GlyphRenderer\"},{\"id\":\"4bd8b786-b70d-4633-af7f-87a5af0208df\",\"type\":\"GlyphRenderer\"},{\"id\":\"15f18b64-445b-4507-85bc-99983d5ee156\",\"type\":\"GlyphRenderer\"},{\"id\":\"ba6c674c-f545-4f65-8cc9-cc77a5d45bc4\",\"type\":\"GlyphRenderer\"},{\"id\":\"9c4652de-9e74-4eb1-b847-07ccc7127fe5\",\"type\":\"GlyphRenderer\"},{\"id\":\"643c3e2f-16bf-43f5-89e2-d3f4a464764a\",\"type\":\"GlyphRenderer\"},{\"id\":\"1e33bcb5-09fd-4861-bd9e-d47d0a23676a\",\"type\":\"GlyphRenderer\"},{\"id\":\"17ac3bc3-8db9-4d6f-988a-87f35a23dd2a\",\"type\":\"GlyphRenderer\"},{\"id\":\"678c5a14-0dcb-4363-b98d-ac2423331e1d\",\"type\":\"GlyphRenderer\"},{\"id\":\"07859517-2256-43d2-b417-919a496a8256\",\"type\":\"GlyphRenderer\"},{\"id\":\"9480e64d-6fb2-4881-9211-bfec6d83db0e\",\"type\":\"CategoricalAxis\"},{\"id\":\"0b5db5e9-0b86-4362-966e-09f1f6d612ef\",\"type\":\"LinearAxis\"},{\"id\":\"3929b026-4810-4ac9-beef-164ad6f4fd15\",\"type\":\"Grid\"}],\"title\":{\"id\":\"fd935e50-9e54-402e-b977-d625d0ffe499\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"76df4522-ebf8-4dc9-815d-df09ba3c01de\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"d03d9ca2-081c-40f4-97fa-ccf8d190b162\",\"type\":\"Toolbar\"},\"x_mapper_type\":\"auto\",\"x_range\":{\"id\":\"50098a65-b386-4a13-aa6a-87d96edb2319\",\"type\":\"FactorRange\"},\"y_mapper_type\":\"auto\",\"y_range\":{\"id\":\"567c7cc7-febd-4f64-9424-450e2a8e626d\",\"type\":\"Range1d\"}},\"id\":\"9bf06858-64a9-4511-889f-c14e3f6233c3\",\"subtype\":\"Chart\",\"type\":\"Plot\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"e56a2e36-fd90-42a3-8b1e-89bd4864b27a\",\"type\":\"Rect\"},{\"attributes\":{},\"id\":\"a7faf781-2763-4987-957e-6483c4a4afce\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"8fb70cfc-d3a3-4b5a-9984-20e72bf85391\",\"type\":\"Rect\"},{\"attributes\":{\"data_source\":{\"id\":\"213b4ff9-adb3-49b5-94f8-c6c5e8b568c6\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"d0267b1e-fa85-40bd-81b0-528ba6fdace4\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"1e33bcb5-09fd-4861-bd9e-d47d0a23676a\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"8d5fcd10-23d8-4fd6-948d-5242bf7b79d4\",\"type\":\"Rect\"},{\"attributes\":{},\"id\":\"f3d20272-3999-496a-be7c-804cdae083e7\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"Sector\":[\"Welfare\"],\"chart_index\":[{\"Sector\":\"Welfare\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[115.353959],\"label\":[{\"Sector\":\"Welfare\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Welfare\"],\"y\":[57.6769795]}},\"id\":\"2a0adcfe-c686-4df4-8e13-83bed9b7ff8a\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2dda8f62-7237-45f0-9dc4-03d3223b1885\",\"type\":\"Rect\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"35f9b8dc-43fc-4b8a-8a36-aecf5da4b1e9\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"plot\":{\"id\":\"9bf06858-64a9-4511-889f-c14e3f6233c3\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"3e85dda3-2b8d-4bdd-999e-e342634f49fe\",\"type\":\"HelpTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"Sector\":[\"Defence\"],\"chart_index\":[{\"Sector\":\"Defence\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[45.69674800000001],\"label\":[{\"Sector\":\"Defence\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Defence\"],\"y\":[22.848374000000003]}},\"id\":\"213b4ff9-adb3-49b5-94f8-c6c5e8b568c6\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":null,\"text\":\"UK government spending by sector in 2015\"},\"id\":\"fd935e50-9e54-402e-b977-d625d0ffe499\",\"type\":\"Title\"},{\"attributes\":{\"plot\":{\"id\":\"9bf06858-64a9-4511-889f-c14e3f6233c3\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"aa2bf99a-cd7b-4453-a2e9-a85d2f6ad6af\",\"type\":\"ResetTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"Sector\":[\"Education\"],\"chart_index\":[{\"Sector\":\"Education\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[86.742942],\"label\":[{\"Sector\":\"Education\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Education\"],\"y\":[43.371471]}},\"id\":\"00eec345-f605-42c9-a657-72a88a1ebb42\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"Sector\":[\"Health Care\"],\"chart_index\":[{\"Sector\":\"Health Care\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[135.573759],\"label\":[{\"Sector\":\"Health Care\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Health Care\"],\"y\":[67.7868795]}},\"id\":\"688e62ed-a1de-4669-88c4-0601cbf4e05c\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"factors\":[\"Pensions\",\"Health Care\",\"Other Spending\",\"Welfare\",\"Education\",\"Interest\",\"Defence\",\"Protection\",\"Transport\",\"General Government\"]},\"id\":\"50098a65-b386-4a13-aa6a-87d96edb2319\",\"type\":\"FactorRange\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"Sector\":[\"Other Spending\"],\"chart_index\":[{\"Sector\":\"Other Spending\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[118.791325],\"label\":[{\"Sector\":\"Other Spending\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Other Spending\"],\"y\":[59.3956625]}},\"id\":\"e848bbd5-7795-450e-a750-a79b3cbc818c\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2964107c-6b31-41a4-999f-06ff6ed107fb\",\"type\":\"Rect\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"Sector\":[\"Pensions\"],\"chart_index\":[{\"Sector\":\"Pensions\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[151.44630200000003],\"label\":[{\"Sector\":\"Pensions\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Pensions\"],\"y\":[75.72315100000002]}},\"id\":\"31aa04bb-4942-47fa-b792-40562c1426d8\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"overlay\":{\"id\":\"35f9b8dc-43fc-4b8a-8a36-aecf5da4b1e9\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"9bf06858-64a9-4511-889f-c14e3f6233c3\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"77c2742f-c2b8-466c-8322-8e8fcbac91b8\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"Sector\":[\"Interest\"],\"chart_index\":[{\"Sector\":\"Interest\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[46.50554],\"label\":[{\"Sector\":\"Interest\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Interest\"],\"y\":[23.25277]}},\"id\":\"2abe1c89-608b-4199-9f00-383d161e590f\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"62587460-4710-4619-8c8a-7ed7b33254ed\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":{\"id\":\"9bf06858-64a9-4511-889f-c14e3f6233c3\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"7ab51e32-a5b7-423e-b597-5a0e33f7c4e0\",\"type\":\"SaveTool\"},{\"attributes\":{\"data_source\":{\"id\":\"31aa04bb-4942-47fa-b792-40562c1426d8\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"66d6ff35-b88f-4870-8741-6b6b10b55dcf\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"f3898095-b58e-4ac9-af2d-56f81e546737\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"6896231d-1cec-44cd-b018-a7b18530acf8\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"8fb70cfc-d3a3-4b5a-9984-20e72bf85391\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"17ac3bc3-8db9-4d6f-988a-87f35a23dd2a\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":{\"id\":\"9bf06858-64a9-4511-889f-c14e3f6233c3\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"ee4035eb-07df-4f07-8b11-6c72e559549d\",\"type\":\"PanTool\"},{\"attributes\":{\"data_source\":{\"id\":\"2abe1c89-608b-4199-9f00-383d161e590f\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2964107c-6b31-41a4-999f-06ff6ed107fb\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"643c3e2f-16bf-43f5-89e2-d3f4a464764a\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis_label\":\"Spending / inflation-adjusted billions of pounds\",\"formatter\":{\"id\":\"62587460-4710-4619-8c8a-7ed7b33254ed\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"9bf06858-64a9-4511-889f-c14e3f6233c3\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"f3d20272-3999-496a-be7c-804cdae083e7\",\"type\":\"BasicTicker\"}},\"id\":\"0b5db5e9-0b86-4362-966e-09f1f6d612ef\",\"type\":\"LinearAxis\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"d0267b1e-fa85-40bd-81b0-528ba6fdace4\",\"type\":\"Rect\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"Sector\":[\"General Government\"],\"chart_index\":[{\"Sector\":\"General Government\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[13.749464],\"label\":[{\"Sector\":\"General Government\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"General Government\"],\"y\":[6.874732]}},\"id\":\"0e2e2d85-ed60-4f00-a38d-15b84dc92c85\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"0e2e2d85-ed60-4f00-a38d-15b84dc92c85\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"e56a2e36-fd90-42a3-8b1e-89bd4864b27a\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"07859517-2256-43d2-b417-919a496a8256\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"00eec345-f605-42c9-a657-72a88a1ebb42\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"8d5fcd10-23d8-4fd6-948d-5242bf7b79d4\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"9c4652de-9e74-4eb1-b847-07ccc7127fe5\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"Sector\":[\"Protection\"],\"chart_index\":[{\"Sector\":\"Protection\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[30.026403000000002],\"label\":[{\"Sector\":\"Protection\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Protection\"],\"y\":[15.013201500000001]}},\"id\":\"6896231d-1cec-44cd-b018-a7b18530acf8\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"9bf06858-64a9-4511-889f-c14e3f6233c3\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"f3d20272-3999-496a-be7c-804cdae083e7\",\"type\":\"BasicTicker\"}},\"id\":\"3929b026-4810-4ac9-beef-164ad6f4fd15\",\"type\":\"Grid\"}],\"root_ids\":[\"9bf06858-64a9-4511-889f-c14e3f6233c3\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.3\"}};\n",
" var render_items = [{\"docid\":\"1e64f688-7075-4aa2-8c6e-d04e96732d11\",\"elementid\":\"6fec69c8-4e13-45c6-a5c1-1d8ed10c9d48\",\"modelid\":\"9bf06858-64a9-4511-889f-c14e3f6233c3\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (!force) {\n",
" var cell = $(\"#6fec69c8-4e13-45c6-a5c1-1d8ed10c9d48\").parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
" \n",
" }\n",
" \n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
" }(this));\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"label_tot_adj = 'Spending / inflation-adjusted billions of pounds'\n",
"label_tot = 'Spending / raw billions of pounds'\n",
"label_tot_gdp = 'Spending / percentage of year\\'s GDP'\n",
"label = CatAttr(df=d, columns='Sector', sort=False)\n",
"\n",
"show(Bar(d[d.Year == 2015].sort_values('Total_adj', ascending=False),\n",
" label=label, values='Total_adj', legend=False, palette=palette,\n",
" ylabel=label_tot_adj, title='UK government spending by sector in 2015'))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"I was surprised by how much is spent on pensions; health-care was less of a surprise. That 'other spending' is a bit frustrating; I'll come back to that later. Let's see how these spendings have changed over time."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Spending trends, by sector"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"plotdiv\" id=\"20415d53-799b-4a23-a8fb-808df2390f89\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = \"\";\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_timeout = Date.now() + 0;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
" \n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
" \n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" Bokeh.$(\"#20415d53-799b-4a23-a8fb-808df2390f89\").text(\"BokehJS successfully loaded.\");\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
" \n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
" \n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"20415d53-799b-4a23-a8fb-808df2390f89\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid '20415d53-799b-4a23-a8fb-808df2390f89' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
" \n",
" var js_urls = [];\n",
" \n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.$(function() {\n",
" var docs_json = {\"b7ba3109-3937-4025-b61a-0a41d44d434e\":{\"roots\":{\"references\":[{\"attributes\":{\"data_source\":{\"id\":\"d4d9c325-1da6-4225-aff6-436259ec7daf\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"c9125602-0da8-489b-99be-64243e9af5c3\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"6b8bc01f-a51e-477b-b42c-c94e76a8d665\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"label\":{\"value\":\"Education\"},\"renderers\":[{\"id\":\"47142ed0-b64d-49e4-8099-94968df01899\",\"type\":\"GlyphRenderer\"}]},\"id\":\"6925c4ea-90c4-4081-9648-dc2e3322bafa\",\"type\":\"LegendItem\"},{\"attributes\":{\"plot\":{\"id\":\"09ea8779-b779-4c7b-bc40-4996db435d07\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"afcefb6c-cd7d-4d31-a015-716748fbeaf9\",\"type\":\"ResetTool\"},{\"attributes\":{\"callback\":null,\"end\":2019.7,\"start\":1987.3},\"id\":\"13724d15-df43-4bbf-9e99-0be85e475af8\",\"type\":\"Range1d\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\"],\"chart_index\":[{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[69.55127100000001,75.81201,77.87156399999999,86.46858,92.59708800000001,92.153133,94.800888,93.774128,88.88994,77.379903,82.381854,79.770827,80.960144,88.14596999999999,98.27792,101.98422000000001,104.66342399999999,103.938295,110.222912,117.77118500000002,127.30499999999999,124.50273,125.56852,121.31613000000002,115.526022,115.353959,113.912713,113.1]}},\"id\":\"c4a147da-6919-409a-8522-490852180fdb\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"overlay\":{\"id\":\"cd5718d2-8b47-4dfb-bef8-9c48043d0a13\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"09ea8779-b779-4c7b-bc40-4996db435d07\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"49db06a9-c663-4fc2-880a-be080c721246\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\"],\"chart_index\":[{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[13.076397000000002,12.34149,8.050014000000001,8.486730999999999,7.8207,8.279982,7.4412,7.134988,8.15898,12.68523,13.660612,12.027836999999998,15.727055,15.476009999999999,16.069768,18.566358,20.907032,20.912136,20.605831999999996,18.938080000000003,18.285,16.533785,14.791546000000002,13.894326000000001,13.615204,13.749464,14.226477,15.3]}},\"id\":\"2be9aed1-d62e-4416-b427-c2720bc1cfad\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"09ea8779-b779-4c7b-bc40-4996db435d07\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3597cb8b-3ddf-4384-8c5c-5248ecfb1786\",\"type\":\"BasicTicker\"}},\"id\":\"2cbbe85c-6683-4ad7-8a52-6db2423e7c1e\",\"type\":\"Grid\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"cd5718d2-8b47-4dfb-bef8-9c48043d0a13\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"data_source\":{\"id\":\"00ada839-5c14-443b-a058-b71961d96ce8\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"0e3b94c9-cb9a-4a26-a945-1b479227d381\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"47142ed0-b64d-49e4-8099-94968df01899\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"label\":{\"value\":\"Pensions\"},\"renderers\":[{\"id\":\"3e14d405-7e58-40e5-acaa-fd7c0f310272\",\"type\":\"GlyphRenderer\"}]},\"id\":\"3fab858e-60b7-4103-a36d-556f35ca8ea7\",\"type\":\"LegendItem\"},{\"attributes\":{\"data_source\":{\"id\":\"43019b5a-bdcf-4b8c-8957-a73d861676bb\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"cc9b2f0c-8d78-44ae-b447-fdee6c527ca2\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"8b90f793-67fe-4d1e-87c7-1be5919cbf45\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":null,\"text\":\"Spending trends, by sector\"},\"id\":\"4ccf2c9c-0f31-4885-9701-fa809495d113\",\"type\":\"Title\"},{\"attributes\":{\"line_color\":{\"value\":\"#8dd3c7\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"d03074f7-92f6-49e3-ac03-1a054f6eecbf\",\"type\":\"Line\"},{\"attributes\":{\"line_color\":{\"value\":\"#fdb462\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"1db755c3-aa96-4e09-876c-832dbc394c70\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\"],\"chart_index\":[{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[12.886884,14.633481,15.278598,12.169652,8.289942,11.193309,6.994728,6.843763999999999,11.88062,11.980495,12.266672,12.719091999999998,15.453541000000001,19.916952,21.647704,20.91984,21.80488,24.770922999999996,24.99524,24.856230000000004,26.45,23.857475,20.644316,19.182465,19.406746000000002,20.523097000000003,26.535911,28.3]}},\"id\":\"d4d9c325-1da6-4225-aff6-436259ec7daf\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":{\"value\":\"#b3de69\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"08729174-23d2-47a1-bddb-c0a3d52d0e11\",\"type\":\"Line\"},{\"attributes\":{\"label\":{\"value\":\"Interest\"},\"renderers\":[{\"id\":\"8b90f793-67fe-4d1e-87c7-1be5919cbf45\",\"type\":\"GlyphRenderer\"}]},\"id\":\"780067d4-a270-4942-a6f9-b626846feb79\",\"type\":\"LegendItem\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\"],\"chart_index\":[{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[46.62019800000001,46.721354999999996,48.135798,52.361529000000004,53.806416,55.353213,54.32076,54.31327599999999,55.96774,57.224482,59.521238000000004,64.14846399999999,69.882827,73.611978,81.01288,85.117599,89.400008,90.86820999999999,95.957336,98.24129000000002,101.77499999999999,101.53297500000001,92.04811000000001,87.306138,86.669918,86.742942,84.75348,85.2]}},\"id\":\"00ada839-5c14-443b-a058-b71961d96ce8\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":{\"value\":\"#bc80bd\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"5ef1bd71-f450-4687-ab26-a366bb961fb5\",\"type\":\"Line\"},{\"attributes\":{\"items\":[{\"id\":\"7be9a7ad-1329-4787-acdd-e91f0346a37a\",\"type\":\"LegendItem\"},{\"id\":\"6925c4ea-90c4-4081-9648-dc2e3322bafa\",\"type\":\"LegendItem\"},{\"id\":\"c1e7023b-ef14-4f32-bbac-ead3ee0611f6\",\"type\":\"LegendItem\"},{\"id\":\"78ff69c3-4e21-4d94-8f70-af108b09ff53\",\"type\":\"LegendItem\"},{\"id\":\"780067d4-a270-4942-a6f9-b626846feb79\",\"type\":\"LegendItem\"},{\"id\":\"22565460-0dfb-4946-bdac-dd0296fdf397\",\"type\":\"LegendItem\"},{\"id\":\"3fab858e-60b7-4103-a36d-556f35ca8ea7\",\"type\":\"LegendItem\"},{\"id\":\"67bbfcda-e144-42b5-9573-adab6de8f484\",\"type\":\"LegendItem\"},{\"id\":\"448056ea-91f1-4989-b297-710af654ba7e\",\"type\":\"LegendItem\"},{\"id\":\"fb9347a4-f0b9-46b8-b610-a6a1c02c52c7\",\"type\":\"LegendItem\"}],\"location\":\"top_left\",\"plot\":{\"id\":\"09ea8779-b779-4c7b-bc40-4996db435d07\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"8a78e8a9-50e4-4d09-acfd-2dc41c68dc6f\",\"type\":\"Legend\"},{\"attributes\":{\"label\":{\"value\":\"Protection\"},\"renderers\":[{\"id\":\"a62ff728-ba73-42d6-aaa2-e494e3f8b4f5\",\"type\":\"GlyphRenderer\"}]},\"id\":\"67bbfcda-e144-42b5-9573-adab6de8f484\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"bb7a550f-5725-4e4b-94fa-02d3b2506694\",\"type\":\"ToolEvents\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\"],\"chart_index\":[{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[46.430685000000004,48.484424999999995,51.257232,56.04445,57.873180000000005,62.099864999999994,59.083128,60.13775599999999,61.69334,66.24509,69.139424,75.07029299999999,81.91744299999999,89.087988,99.473192,108.390921,114.924544,117.879719,124.73234399999998,128.66058100000004,134.435,132.93607,129.080182,128.88542700000002,131.478164,135.573759,139.94413899999998,142.7]}},\"id\":\"5ce7200c-f7b2-4a4c-9d07-bee4f11c5c9e\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"below\":[{\"id\":\"ba06a5c4-e1c2-436e-b1c8-ce009d679871\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"86dab9ca-86b7-4787-a05e-661fa36b9d62\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"cd5718d2-8b47-4dfb-bef8-9c48043d0a13\",\"type\":\"BoxAnnotation\"},{\"id\":\"08c4c64d-796d-4aea-8a4c-5eb03b41b9c5\",\"type\":\"GlyphRenderer\"},{\"id\":\"47142ed0-b64d-49e4-8099-94968df01899\",\"type\":\"GlyphRenderer\"},{\"id\":\"dbd7348a-9198-4075-9647-aeb02a1b4f39\",\"type\":\"GlyphRenderer\"},{\"id\":\"22d9557c-2141-4f78-88e3-56ccb6213fed\",\"type\":\"GlyphRenderer\"},{\"id\":\"8b90f793-67fe-4d1e-87c7-1be5919cbf45\",\"type\":\"GlyphRenderer\"},{\"id\":\"fc11f973-54aa-4c1e-83c1-8f61737ef2d3\",\"type\":\"GlyphRenderer\"},{\"id\":\"3e14d405-7e58-40e5-acaa-fd7c0f310272\",\"type\":\"GlyphRenderer\"},{\"id\":\"a62ff728-ba73-42d6-aaa2-e494e3f8b4f5\",\"type\":\"GlyphRenderer\"},{\"id\":\"6b8bc01f-a51e-477b-b42c-c94e76a8d665\",\"type\":\"GlyphRenderer\"},{\"id\":\"fcd95a0a-869e-4977-b286-4b863acff888\",\"type\":\"GlyphRenderer\"},{\"id\":\"8a78e8a9-50e4-4d09-acfd-2dc41c68dc6f\",\"type\":\"Legend\"},{\"id\":\"ba06a5c4-e1c2-436e-b1c8-ce009d679871\",\"type\":\"LinearAxis\"},{\"id\":\"86dab9ca-86b7-4787-a05e-661fa36b9d62\",\"type\":\"LinearAxis\"},{\"id\":\"bb2ec682-3e55-42a1-9ddb-81afc8a12af8\",\"type\":\"Grid\"},{\"id\":\"2cbbe85c-6683-4ad7-8a52-6db2423e7c1e\",\"type\":\"Grid\"}],\"title\":{\"id\":\"4ccf2c9c-0f31-4885-9701-fa809495d113\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"bb7a550f-5725-4e4b-94fa-02d3b2506694\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"bbaf85f5-a00a-434a-bc51-1456de44b0ab\",\"type\":\"Toolbar\"},\"x_mapper_type\":\"auto\",\"x_range\":{\"id\":\"13724d15-df43-4bbf-9e99-0be85e475af8\",\"type\":\"Range1d\"},\"y_mapper_type\":\"auto\",\"y_range\":{\"id\":\"8ce2da50-2d5a-46af-83fe-7ce26b79a97b\",\"type\":\"Range1d\"}},\"id\":\"09ea8779-b779-4c7b-bc40-4996db435d07\",\"subtype\":\"Chart\",\"type\":\"Plot\"},{\"attributes\":{\"label\":{\"value\":\"Welfare\"},\"renderers\":[{\"id\":\"fcd95a0a-869e-4977-b286-4b863acff888\",\"type\":\"GlyphRenderer\"}]},\"id\":\"fb9347a4-f0b9-46b8-b610-a6a1c02c52c7\",\"type\":\"LegendItem\"},{\"attributes\":{\"label\":{\"value\":\"Transport\"},\"renderers\":[{\"id\":\"6b8bc01f-a51e-477b-b42c-c94e76a8d665\",\"type\":\"GlyphRenderer\"}]},\"id\":\"448056ea-91f1-4989-b297-710af654ba7e\",\"type\":\"LegendItem\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\"],\"chart_index\":[{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[35.628444,32.793102,27.600048,34.107051,32.534112,41.39991,44.796024,46.013391999999996,42.51258,41.297471,35.266682,36.498264,30.633567999999997,28.529687999999997,29.8818,31.772007000000002,33.605168,34.978037,37.431895999999995,37.047619000000005,35.305,52.37548,53.526242,51.222366,49.990152,46.50554,46.109929,48.5]}},\"id\":\"43019b5a-bdcf-4b8c-8957-a73d861676bb\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"09ea8779-b779-4c7b-bc40-4996db435d07\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2e327390-6b7f-474b-a1b2-76e7d62f2b34\",\"type\":\"BasicTicker\"}},\"id\":\"bb2ec682-3e55-42a1-9ddb-81afc8a12af8\",\"type\":\"Grid\"},{\"attributes\":{\"line_color\":{\"value\":\"#fb8072\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"5446fb88-c463-45bf-9ac1-6b156116e671\",\"type\":\"Line\"},{\"attributes\":{\"plot\":{\"id\":\"09ea8779-b779-4c7b-bc40-4996db435d07\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"4b25c33d-762b-4663-86bd-ef9394e81f45\",\"type\":\"HelpTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\"],\"chart_index\":[{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[45.48312000000001,47.602889999999995,46.164366,55.243815,64.59898199999999,63.47986199999999,67.566096,71.93232799999998,74.57594,87.105246,91.581858,101.476234,107.08073099999999,107.524626,108.63694399999999,112.96713600000001,115.309336,116.883903,120.46486399999999,128.42385500000003,133.85999999999999,135.266335,137.912544,144.335088,145.29658,151.44630200000003,156.08765899999997,156.9]}},\"id\":\"ec4f2439-9099-4326-8fa9-c680d3f0bbda\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"end\":171.9056236,\"start\":-8.161859600000003},\"id\":\"8ce2da50-2d5a-46af-83fe-7ce26b79a97b\",\"type\":\"Range1d\"},{\"attributes\":{\"data_source\":{\"id\":\"4162448f-9124-4c67-a603-d3fe2d555591\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"d03074f7-92f6-49e3-ac03-1a054f6eecbf\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"08c4c64d-796d-4aea-8a4c-5eb03b41b9c5\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"ec4f2439-9099-4326-8fa9-c680d3f0bbda\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"08729174-23d2-47a1-bddb-c0a3d52d0e11\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"3e14d405-7e58-40e5-acaa-fd7c0f310272\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis_label\":\"Spending / inflation-adjusted billions of pounds\",\"formatter\":{\"id\":\"3396e346-8240-4070-b16c-fce0b279b71a\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"09ea8779-b779-4c7b-bc40-4996db435d07\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3597cb8b-3ddf-4384-8c5c-5248ecfb1786\",\"type\":\"BasicTicker\"}},\"id\":\"86dab9ca-86b7-4787-a05e-661fa36b9d62\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\"],\"chart_index\":[{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[44.156529000000006,43.018907999999996,42.71436,42.113401,40.667640000000006,39.253248,36.759527999999996,36.548612,34.926159999999996,37.632849,38.751532,41.33704899999999,38.702231,40.3722,43.02979199999999,43.670166,45.148928000000005,45.558582,46.698423999999996,48.528830000000006,48.989999999999995,49.823285,46.928574000000005,43.445691000000004,44.70664,45.69674800000001,45.20185599999999,45.6]}},\"id\":\"4162448f-9124-4c67-a603-d3fe2d555591\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":{\"value\":\"#80b1d3\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"cc9b2f0c-8d78-44ae-b447-fdee6c527ca2\",\"type\":\"Line\"},{\"attributes\":{\"plot\":{\"id\":\"09ea8779-b779-4c7b-bc40-4996db435d07\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"70fe0646-b38c-45e6-92dd-15634ca3623a\",\"type\":\"SaveTool\"},{\"attributes\":{\"line_color\":{\"value\":\"#fccde5\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"c6fa09af-c9f2-4edc-8d56-4fa418afdf7f\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"3396e346-8240-4070-b16c-fce0b279b71a\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"3597cb8b-3ddf-4384-8c5c-5248ecfb1786\",\"type\":\"BasicTicker\"},{\"attributes\":{\"label\":{\"value\":\"Other Spending\"},\"renderers\":[{\"id\":\"fc11f973-54aa-4c1e-83c1-8f61737ef2d3\",\"type\":\"GlyphRenderer\"}]},\"id\":\"22565460-0dfb-4946-bdac-dd0296fdf397\",\"type\":\"LegendItem\"},{\"attributes\":{\"data_source\":{\"id\":\"6b7d30e4-e50d-4f68-85e8-969e4a13166d\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1db755c3-aa96-4e09-876c-832dbc394c70\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"fc11f973-54aa-4c1e-83c1-8f61737ef2d3\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"2be9aed1-d62e-4416-b427-c2720bc1cfad\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"c5608df5-7303-460d-a6ff-88580736b90c\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"dbd7348a-9198-4075-9647-aeb02a1b4f39\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"5ce7200c-f7b2-4a4c-9d07-bee4f11c5c9e\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"5446fb88-c463-45bf-9ac1-6b156116e671\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"22d9557c-2141-4f78-88e3-56ccb6213fed\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2e327390-6b7f-474b-a1b2-76e7d62f2b34\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"09ea8779-b779-4c7b-bc40-4996db435d07\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"d7fc74b0-f8b9-482e-8c42-6db9756ede7f\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"line_color\":{\"value\":\"#ffffb3\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"0e3b94c9-cb9a-4a26-a945-1b479227d381\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"e437f6eb-ae63-48ae-895a-f7446c5a5e39\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"c6fa09af-c9f2-4edc-8d56-4fa418afdf7f\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"a62ff728-ba73-42d6-aaa2-e494e3f8b4f5\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"label\":{\"value\":\"Health Care\"},\"renderers\":[{\"id\":\"22d9557c-2141-4f78-88e3-56ccb6213fed\",\"type\":\"GlyphRenderer\"}]},\"id\":\"78ff69c3-4e21-4d94-8f70-af108b09ff53\",\"type\":\"LegendItem\"},{\"attributes\":{\"axis_label\":\"Year\",\"formatter\":{\"id\":\"8c071852-4704-4d08-815c-0c131a13dac2\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"09ea8779-b779-4c7b-bc40-4996db435d07\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2e327390-6b7f-474b-a1b2-76e7d62f2b34\",\"type\":\"BasicTicker\"}},\"id\":\"ba06a5c4-e1c2-436e-b1c8-ce009d679871\",\"type\":\"LinearAxis\"},{\"attributes\":{\"line_color\":{\"value\":\"#d9d9d9\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"c9125602-0da8-489b-99be-64243e9af5c3\",\"type\":\"Line\"},{\"attributes\":{\"label\":{\"value\":\"General Government\"},\"renderers\":[{\"id\":\"dbd7348a-9198-4075-9647-aeb02a1b4f39\",\"type\":\"GlyphRenderer\"}]},\"id\":\"c1e7023b-ef14-4f32-bbac-ead3ee0611f6\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"8c071852-4704-4d08-815c-0c131a13dac2\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":{\"id\":\"09ea8779-b779-4c7b-bc40-4996db435d07\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"a2ef12ba-1c7d-42ab-b15b-337f083db01a\",\"type\":\"PanTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\"],\"chart_index\":[{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[19.330326,20.275305,21.35718,22.738034,23.149272000000003,23.613281999999998,23.514192,21.259351999999996,24.190659999999998,25.229512999999997,25.509102,27.926702,31.317352999999997,32.566908,34.795696,37.263465000000004,37.581352,37.716530999999996,38.40732,40.125057000000005,39.214999999999996,36.84038,33.946066,32.454657000000005,30.075376000000002,30.026403000000002,30.168202999999995,29.4]}},\"id\":\"e437f6eb-ae63-48ae-895a-f7446c5a5e39\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\"],\"chart_index\":[{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[53.63217900000001,52.715793,48.628656,34.587432,45.829302000000006,41.553243,54.469584000000005,50.23613999999999,53.6775,51.163760999999994,46.139414,54.194392,60.309837,70.516776,71.71632,82.37187,88.117368,90.37030199999998,90.470576,107.59196700000003,108.56,118.95448,112.69242600000001,125.048934,120.50471599999999,118.791325,110.07862699999998,117.6]}},\"id\":\"6b7d30e4-e50d-4f68-85e8-969e4a13166d\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"label\":{\"value\":\"Defence\"},\"renderers\":[{\"id\":\"08c4c64d-796d-4aea-8a4c-5eb03b41b9c5\",\"type\":\"GlyphRenderer\"}]},\"id\":\"7be9a7ad-1329-4787-acdd-e91f0346a37a\",\"type\":\"LegendItem\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"a2ef12ba-1c7d-42ab-b15b-337f083db01a\",\"type\":\"PanTool\"},{\"id\":\"d7fc74b0-f8b9-482e-8c42-6db9756ede7f\",\"type\":\"WheelZoomTool\"},{\"id\":\"49db06a9-c663-4fc2-880a-be080c721246\",\"type\":\"BoxZoomTool\"},{\"id\":\"70fe0646-b38c-45e6-92dd-15634ca3623a\",\"type\":\"SaveTool\"},{\"id\":\"afcefb6c-cd7d-4d31-a015-716748fbeaf9\",\"type\":\"ResetTool\"},{\"id\":\"4b25c33d-762b-4663-86bd-ef9394e81f45\",\"type\":\"HelpTool\"}]},\"id\":\"bbaf85f5-a00a-434a-bc51-1456de44b0ab\",\"type\":\"Toolbar\"},{\"attributes\":{\"data_source\":{\"id\":\"c4a147da-6919-409a-8522-490852180fdb\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"5ef1bd71-f450-4687-ab26-a366bb961fb5\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"fcd95a0a-869e-4977-b286-4b863acff888\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_color\":{\"value\":\"#bebada\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"c5608df5-7303-460d-a6ff-88580736b90c\",\"type\":\"Line\"}],\"root_ids\":[\"09ea8779-b779-4c7b-bc40-4996db435d07\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.3\"}};\n",
" var render_items = [{\"docid\":\"b7ba3109-3937-4025-b61a-0a41d44d434e\",\"elementid\":\"20415d53-799b-4a23-a8fb-808df2390f89\",\"modelid\":\"09ea8779-b779-4c7b-bc40-4996db435d07\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (!force) {\n",
" var cell = $(\"#20415d53-799b-4a23-a8fb-808df2390f89\").parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
" \n",
" }\n",
" \n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
" }(this));\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"show(Line(d, x='Year', y='Total_adj', color='Sector',\n",
" legend='top_left', palette=palette,\n",
" ylabel=label_tot_adj, title='Spending trends, by sector'))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Looks like spending on pensions is increasing inexorably. The sectors that seem to show short-term effects, whether from government policy or world events, are welfare, education and interest payments.\n",
"\n",
"However it's hard to compare these raw numbers over time when the total is also changing, even when adusting for inflation. There are two effects shown here, total spending, and its distribution, which it would be nice to decouple. Let's get total spending out of the way, then we can feel comfortable normalizing by that to show its distribution."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Trends in overall spending"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"plotdiv\" id=\"b755768c-08b3-436a-8478-c8efa7e60f7f\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = \"\";\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_timeout = Date.now() + 0;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
" \n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
" \n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" Bokeh.$(\"#b755768c-08b3-436a-8478-c8efa7e60f7f\").text(\"BokehJS successfully loaded.\");\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
" \n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
" \n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"b755768c-08b3-436a-8478-c8efa7e60f7f\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'b755768c-08b3-436a-8478-c8efa7e60f7f' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
" \n",
" var js_urls = [];\n",
" \n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.$(function() {\n",
" var docs_json = {\"33deadfe-6236-4336-af1c-eb9fef635662\":{\"roots\":{\"references\":[{\"attributes\":{\"plot\":{\"id\":\"0ea0429f-e45c-4a0c-b960-98eedcf4716d\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"46d9a608-ef47-4e0e-baaf-8993e839503b\",\"type\":\"BasicTicker\"}},\"id\":\"fd7aad7f-5d70-4587-b52c-774a07dac51f\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"f9dcb526-097e-4c51-b0d7-02d8ef8e3c09\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"17464a0d-a6fd-4d0e-a788-607e800a5957\",\"type\":\"BasicTicker\"},{\"attributes\":{\"label\":{\"value\":\"Raw\"},\"renderers\":[{\"id\":\"2181bb22-4515-4804-9972-f4a6cfb35e03\",\"type\":\"GlyphRenderer\"}]},\"id\":\"0c780751-caf8-4137-bcd4-2eeb305111cc\",\"type\":\"LegendItem\"},{\"attributes\":{\"plot\":null,\"text\":\"Trend in spending\"},\"id\":\"b6e1a440-d7fd-4cfc-88d2-63c5d25015a1\",\"type\":\"Title\"},{\"attributes\":{\"plot\":{\"id\":\"0ea0429f-e45c-4a0c-b960-98eedcf4716d\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"593e6111-6ba4-4fea-9e4b-63f43051a0a9\",\"type\":\"PanTool\"},{\"attributes\":{\"plot\":{\"id\":\"0ea0429f-e45c-4a0c-b960-98eedcf4716d\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"095796b7-090c-440c-9881-6cc84d11a12d\",\"type\":\"HelpTool\"},{\"attributes\":{\"axis_label\":\"Spending / billions of pounds\",\"formatter\":{\"id\":\"f9dcb526-097e-4c51-b0d7-02d8ef8e3c09\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"0ea0429f-e45c-4a0c-b960-98eedcf4716d\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"17464a0d-a6fd-4d0e-a788-607e800a5957\",\"type\":\"BasicTicker\"}},\"id\":\"bf1a5255-69c7-4ca6-9d98-fdb91568c491\",\"type\":\"LinearAxis\"},{\"attributes\":{\"label\":{\"value\":\"Inflation-adjusted\"},\"renderers\":[{\"id\":\"978de90f-6388-417d-9aee-5d4b3eebe8d9\",\"type\":\"GlyphRenderer\"}]},\"id\":\"307bb5d9-00ee-4e1c-9ec6-810da9d7384c\",\"type\":\"LegendItem\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"695e3d31-5ef8-48b4-8b5f-0b390015557b\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"46d9a608-ef47-4e0e-baaf-8993e839503b\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"0ea0429f-e45c-4a0c-b960-98eedcf4716d\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"e872f632-af1d-48b0-83b4-d0ec371e07a4\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"bd286e25-1499-40dc-96d0-0aa4c9f14b45\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"line_color\":{\"value\":\"#ffffb3\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"6426116a-5da4-4135-a98c-06908fa1b5ef\",\"type\":\"Line\"},{\"attributes\":{\"plot\":{\"id\":\"0ea0429f-e45c-4a0c-b960-98eedcf4716d\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"64edff5a-e374-4ce8-a354-dc6c07fa9133\",\"type\":\"ResetTool\"},{\"attributes\":{\"overlay\":{\"id\":\"695e3d31-5ef8-48b4-8b5f-0b390015557b\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"0ea0429f-e45c-4a0c-b960-98eedcf4716d\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"58c340a7-0242-43ff-9e38-46944312dfd4\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"chart_index\":[{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"},{\"series\":\"Raw\"}],\"series\":[\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\",\"Raw\"],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[204.10000000000002,223.70000000000002,235.6,252.49999999999997,273.1,285.90000000000003,302.2,307.79999999999995,318.90000000000003,331.99999999999994,340.20000000000005,365.40000000000003,389.0,420.4,455.2,491.80000000000007,523.5,549.3999999999999,582.3,633.8,673.2,714.3000000000001,720.9,739.8,745.3000000000001,756.1,760.1999999999998,782.5999999999999]}},\"id\":\"4245aa1b-0850-490a-893a-495ae0cc4242\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"0ea0429f-e45c-4a0c-b960-98eedcf4716d\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"17464a0d-a6fd-4d0e-a788-607e800a5957\",\"type\":\"BasicTicker\"}},\"id\":\"e27c650d-4846-46ff-a070-5c45639b73cf\",\"type\":\"Grid\"},{\"attributes\":{\"items\":[{\"id\":\"307bb5d9-00ee-4e1c-9ec6-810da9d7384c\",\"type\":\"LegendItem\"},{\"id\":\"0c780751-caf8-4137-bcd4-2eeb305111cc\",\"type\":\"LegendItem\"}],\"location\":\"top_left\",\"plot\":{\"id\":\"0ea0429f-e45c-4a0c-b960-98eedcf4716d\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"0ec3ff3c-7159-4922-bd56-980f0f51fbea\",\"type\":\"Legend\"},{\"attributes\":{},\"id\":\"5fc4cd50-ecbf-4477-a25d-5c289d21d0fc\",\"type\":\"ToolEvents\"},{\"attributes\":{\"callback\":null,\"end\":851.4752945,\"start\":145.2477005},\"id\":\"fec9c849-2c9f-4a4c-85bd-9e92a7c4e518\",\"type\":\"Range1d\"},{\"attributes\":{\"axis_label\":\"Year\",\"formatter\":{\"id\":\"bd286e25-1499-40dc-96d0-0aa4c9f14b45\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"0ea0429f-e45c-4a0c-b960-98eedcf4716d\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"46d9a608-ef47-4e0e-baaf-8993e839503b\",\"type\":\"BasicTicker\"}},\"id\":\"3e7ca547-6bf0-40de-b519-53da64fbdfd4\",\"type\":\"LinearAxis\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"593e6111-6ba4-4fea-9e4b-63f43051a0a9\",\"type\":\"PanTool\"},{\"id\":\"e872f632-af1d-48b0-83b4-d0ec371e07a4\",\"type\":\"WheelZoomTool\"},{\"id\":\"58c340a7-0242-43ff-9e38-46944312dfd4\",\"type\":\"BoxZoomTool\"},{\"id\":\"473c385a-65d2-4571-af09-b2987b34d14c\",\"type\":\"SaveTool\"},{\"id\":\"64edff5a-e374-4ce8-a354-dc6c07fa9133\",\"type\":\"ResetTool\"},{\"id\":\"095796b7-090c-440c-9881-6cc84d11a12d\",\"type\":\"HelpTool\"}]},\"id\":\"2e5be51d-aa64-4f6d-a87c-bf3b6d51479a\",\"type\":\"Toolbar\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"chart_index\":[{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"},{\"series\":\"Inflation-adjusted\"}],\"series\":[\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\",\"Inflation-adjusted\"],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[386.7960330000001,394.398759,387.05781599999995,404.32067500000005,427.16663400000004,438.379047,449.746128,448.19373599999994,456.47346000000005,467.94404,474.218388,505.16915399999993,531.98473,565.749096,604.5420159999999,643.0235820000001,671.46204,683.8766380000001,709.9867439999999,750.1846940000001,774.1800000000001,792.6229950000001,767.1385260000001,767.0912220000001,757.269518,764.4095390000001,767.0189939999998,782.5999999999999]}},\"id\":\"2a55694b-d553-4f57-836c-3006400db035\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"end\":2019.7,\"start\":1987.3},\"id\":\"92e834b5-eb3b-470f-8f11-282c89a8ccd2\",\"type\":\"Range1d\"},{\"attributes\":{\"line_color\":{\"value\":\"#8dd3c7\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"56bf4e75-7111-424f-b327-8844a49cf9cd\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"2a55694b-d553-4f57-836c-3006400db035\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"56bf4e75-7111-424f-b327-8844a49cf9cd\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"978de90f-6388-417d-9aee-5d4b3eebe8d9\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":{\"id\":\"0ea0429f-e45c-4a0c-b960-98eedcf4716d\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"473c385a-65d2-4571-af09-b2987b34d14c\",\"type\":\"SaveTool\"},{\"attributes\":{\"data_source\":{\"id\":\"4245aa1b-0850-490a-893a-495ae0cc4242\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"6426116a-5da4-4135-a98c-06908fa1b5ef\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"2181bb22-4515-4804-9972-f4a6cfb35e03\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"below\":[{\"id\":\"3e7ca547-6bf0-40de-b519-53da64fbdfd4\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"bf1a5255-69c7-4ca6-9d98-fdb91568c491\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"695e3d31-5ef8-48b4-8b5f-0b390015557b\",\"type\":\"BoxAnnotation\"},{\"id\":\"978de90f-6388-417d-9aee-5d4b3eebe8d9\",\"type\":\"GlyphRenderer\"},{\"id\":\"2181bb22-4515-4804-9972-f4a6cfb35e03\",\"type\":\"GlyphRenderer\"},{\"id\":\"0ec3ff3c-7159-4922-bd56-980f0f51fbea\",\"type\":\"Legend\"},{\"id\":\"3e7ca547-6bf0-40de-b519-53da64fbdfd4\",\"type\":\"LinearAxis\"},{\"id\":\"bf1a5255-69c7-4ca6-9d98-fdb91568c491\",\"type\":\"LinearAxis\"},{\"id\":\"fd7aad7f-5d70-4587-b52c-774a07dac51f\",\"type\":\"Grid\"},{\"id\":\"e27c650d-4846-46ff-a070-5c45639b73cf\",\"type\":\"Grid\"}],\"title\":{\"id\":\"b6e1a440-d7fd-4cfc-88d2-63c5d25015a1\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"5fc4cd50-ecbf-4477-a25d-5c289d21d0fc\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"2e5be51d-aa64-4f6d-a87c-bf3b6d51479a\",\"type\":\"Toolbar\"},\"x_mapper_type\":\"auto\",\"x_range\":{\"id\":\"92e834b5-eb3b-470f-8f11-282c89a8ccd2\",\"type\":\"Range1d\"},\"y_mapper_type\":\"auto\",\"y_range\":{\"id\":\"fec9c849-2c9f-4a4c-85bd-9e92a7c4e518\",\"type\":\"Range1d\"}},\"id\":\"0ea0429f-e45c-4a0c-b960-98eedcf4716d\",\"subtype\":\"Chart\",\"type\":\"Plot\"}],\"root_ids\":[\"0ea0429f-e45c-4a0c-b960-98eedcf4716d\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.3\"}};\n",
" var render_items = [{\"docid\":\"33deadfe-6236-4336-af1c-eb9fef635662\",\"elementid\":\"b755768c-08b3-436a-8478-c8efa7e60f7f\",\"modelid\":\"0ea0429f-e45c-4a0c-b960-98eedcf4716d\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (!force) {\n",
" var cell = $(\"#b755768c-08b3-436a-8478-c8efa7e60f7f\").parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
" \n",
" }\n",
" \n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
" }(this));\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"d_tot = d.groupby('Year').agg({'Total_adj': sum, 'Total': sum}).rename(\n",
" columns={'Total_adj': 'Inflation-adjusted', 'Total': 'Raw'})\n",
"d_tot = pd.merge(d_tot, year_data, left_index=True, right_on='Year')\n",
"show(Line(d_tot, x='Year', y=['Inflation-adjusted', 'Raw'],\n",
" legend='top_left', palette=palette, ylabel='Spending / billions of pounds',\n",
" title='Trend in spending'))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"On the adjusted line there is a sharp change from 2011 to 2012. Even ignoring inflation, there is a clear change in the raw total in that year, and inspecting the inflation factor does not show extreme changes in inflation (until around 2014, which looks to my eye like a distinct story)."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"plotdiv\" id=\"ef4e9461-dd33-436a-9526-982267047266\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = \"\";\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_timeout = Date.now() + 0;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
" \n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
" \n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" Bokeh.$(\"#ef4e9461-dd33-436a-9526-982267047266\").text(\"BokehJS successfully loaded.\");\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
" \n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
" \n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"ef4e9461-dd33-436a-9526-982267047266\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'ef4e9461-dd33-436a-9526-982267047266' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
" \n",
" var js_urls = [];\n",
" \n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.$(function() {\n",
" var docs_json = {\"0631851e-173d-4188-97ab-786c4c55e9ca\":{\"roots\":{\"references\":[{\"attributes\":{\"axis_label\":\"Pounds stirling\",\"formatter\":{\"id\":\"2fa9a45f-358f-47aa-8e88-ea68a48a4e42\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"4aebcb60-6868-4ad7-8291-93c66ef4e568\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"b77799d2-26c8-4884-aec0-eb56167acebe\",\"type\":\"BasicTicker\"}},\"id\":\"004f2f40-f257-4980-8ea1-e7eb6345771d\",\"type\":\"LinearAxis\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"517ad54c-be65-4274-b0b7-535148662cdf\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"plot\":{\"id\":\"4aebcb60-6868-4ad7-8291-93c66ef4e568\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"e02f7e9b-e68d-4d04-8b9a-d304de56fff9\",\"type\":\"HelpTool\"},{\"attributes\":{\"plot\":{\"id\":\"4aebcb60-6868-4ad7-8291-93c66ef4e568\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"c11bb03e-2bea-42ee-b400-e581abe14538\",\"type\":\"BasicTicker\"}},\"id\":\"052a783a-0b4b-4656-b36a-6284e76edc04\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"c11bb03e-2bea-42ee-b400-e581abe14538\",\"type\":\"BasicTicker\"},{\"attributes\":{\"below\":[{\"id\":\"b3592559-495f-45b7-9c9d-28dbbe5ec9c4\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"004f2f40-f257-4980-8ea1-e7eb6345771d\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"517ad54c-be65-4274-b0b7-535148662cdf\",\"type\":\"BoxAnnotation\"},{\"id\":\"6eb5706a-a5db-4d9e-b68a-67a1218377d4\",\"type\":\"GlyphRenderer\"},{\"id\":\"4af8d5b9-ca88-4e49-9137-2ec76a9213f8\",\"type\":\"Legend\"},{\"id\":\"b3592559-495f-45b7-9c9d-28dbbe5ec9c4\",\"type\":\"LinearAxis\"},{\"id\":\"004f2f40-f257-4980-8ea1-e7eb6345771d\",\"type\":\"LinearAxis\"},{\"id\":\"052a783a-0b4b-4656-b36a-6284e76edc04\",\"type\":\"Grid\"},{\"id\":\"69605f95-9ca6-4758-8496-9f4b6b4344fb\",\"type\":\"Grid\"}],\"title\":{\"id\":\"eebbfcd7-4059-4e63-a0d6-2795e7f9529a\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"e50e0810-f277-45f8-b2a2-8ebf1841efc9\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"562cece5-cb02-4f8f-8eb8-8819ef54af44\",\"type\":\"Toolbar\"},\"x_mapper_type\":\"auto\",\"x_range\":{\"id\":\"32b713f6-4472-4ddb-b8bb-26812bdb4b0a\",\"type\":\"Range1d\"},\"y_mapper_type\":\"auto\",\"y_range\":{\"id\":\"e7213daf-962a-4fe8-b984-88806d710bb5\",\"type\":\"Range1d\"}},\"id\":\"4aebcb60-6868-4ad7-8291-93c66ef4e568\",\"subtype\":\"Chart\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"39c554af-8fd0-4a45-b5ea-1d833aed8c46\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":null,\"text\":\"Effective value of one 2016 pound stirling in other years\"},\"id\":\"eebbfcd7-4059-4e63-a0d6-2795e7f9529a\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"chart_index\":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[1.8951300000000002,1.76307,1.64286,1.60127,1.56414,1.5333299999999999,1.48824,1.4561199999999999,1.4314,1.40947,1.39394,1.38251,1.36757,1.34574,1.32808,1.30749,1.28264,1.24477,1.21928,1.1836300000000002,1.15,1.10965,1.06414,1.03689,1.01606,1.01099,1.00897,1.0]}},\"id\":\"e7ea4eaa-3e02-4a21-aee0-09b353a7de9c\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"overlay\":{\"id\":\"517ad54c-be65-4274-b0b7-535148662cdf\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"4aebcb60-6868-4ad7-8291-93c66ef4e568\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"42de489e-1a5f-4c02-887b-6acea97c802c\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"plot\":{\"id\":\"4aebcb60-6868-4ad7-8291-93c66ef4e568\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"0d690056-5a14-4ce1-8949-5f7399ff629f\",\"type\":\"SaveTool\"},{\"attributes\":{\"callback\":null,\"end\":2019.7,\"start\":1987.3},\"id\":\"32b713f6-4472-4ddb-b8bb-26812bdb4b0a\",\"type\":\"Range1d\"},{\"attributes\":{\"axis_label\":\"Year\",\"formatter\":{\"id\":\"39c554af-8fd0-4a45-b5ea-1d833aed8c46\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"4aebcb60-6868-4ad7-8291-93c66ef4e568\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"c11bb03e-2bea-42ee-b400-e581abe14538\",\"type\":\"BasicTicker\"}},\"id\":\"b3592559-495f-45b7-9c9d-28dbbe5ec9c4\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null,\"end\":1.9846430000000002,\"start\":0.9104869999999999},\"id\":\"e7213daf-962a-4fe8-b984-88806d710bb5\",\"type\":\"Range1d\"},{\"attributes\":{\"line_color\":{\"value\":\"#f22c40\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"c7a107ec-3167-4dc6-bcb8-6b7e2f026a85\",\"type\":\"Line\"},{\"attributes\":{\"plot\":{\"id\":\"4aebcb60-6868-4ad7-8291-93c66ef4e568\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"b5a776c4-becd-4801-97d2-a8d869636f89\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"2fa9a45f-358f-47aa-8e88-ea68a48a4e42\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":{\"id\":\"4aebcb60-6868-4ad7-8291-93c66ef4e568\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"22c92ade-c3d8-45bf-a2e5-6e481cf7dd8c\",\"type\":\"PanTool\"},{\"attributes\":{\"plot\":{\"id\":\"4aebcb60-6868-4ad7-8291-93c66ef4e568\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"36312f46-0b14-4d04-b46a-9140bf45eb95\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"4aebcb60-6868-4ad7-8291-93c66ef4e568\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"b77799d2-26c8-4884-aec0-eb56167acebe\",\"type\":\"BasicTicker\"}},\"id\":\"69605f95-9ca6-4758-8496-9f4b6b4344fb\",\"type\":\"Grid\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"22c92ade-c3d8-45bf-a2e5-6e481cf7dd8c\",\"type\":\"PanTool\"},{\"id\":\"36312f46-0b14-4d04-b46a-9140bf45eb95\",\"type\":\"WheelZoomTool\"},{\"id\":\"42de489e-1a5f-4c02-887b-6acea97c802c\",\"type\":\"BoxZoomTool\"},{\"id\":\"0d690056-5a14-4ce1-8949-5f7399ff629f\",\"type\":\"SaveTool\"},{\"id\":\"b5a776c4-becd-4801-97d2-a8d869636f89\",\"type\":\"ResetTool\"},{\"id\":\"e02f7e9b-e68d-4d04-8b9a-d304de56fff9\",\"type\":\"HelpTool\"}]},\"id\":\"562cece5-cb02-4f8f-8eb8-8819ef54af44\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"b77799d2-26c8-4884-aec0-eb56167acebe\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data_source\":{\"id\":\"e7ea4eaa-3e02-4a21-aee0-09b353a7de9c\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"c7a107ec-3167-4dc6-bcb8-6b7e2f026a85\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"6eb5706a-a5db-4d9e-b68a-67a1218377d4\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"e50e0810-f277-45f8-b2a2-8ebf1841efc9\",\"type\":\"ToolEvents\"},{\"attributes\":{\"location\":\"top_left\",\"plot\":{\"id\":\"4aebcb60-6868-4ad7-8291-93c66ef4e568\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"4af8d5b9-ca88-4e49-9137-2ec76a9213f8\",\"type\":\"Legend\"}],\"root_ids\":[\"4aebcb60-6868-4ad7-8291-93c66ef4e568\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.3\"}};\n",
" var render_items = [{\"docid\":\"0631851e-173d-4188-97ab-786c4c55e9ca\",\"elementid\":\"ef4e9461-dd33-436a-9526-982267047266\",\"modelid\":\"4aebcb60-6868-4ad7-8291-93c66ef4e568\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (!force) {\n",
" var cell = $(\"#ef4e9461-dd33-436a-9526-982267047266\").parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
" \n",
" }\n",
" \n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
" }(this));\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"show(Line(d_tot, x='Year', y='inflation_price',\n",
" palette=palette,\n",
" title='Effective value of one 2016 pound stirling in other years',\n",
" ylabel='Pounds stirling'))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"I'm interested in what was cut to bring about this reduction in spending from 2011 to 2012, so let's look at the change year-to-year in each sector."
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"def sector_diff(group):\n",
" pct_diffs = 100 * group.sort_values('Year').Total_adj.pct_change()\n",
" abs_diffs = group.sort_values('Year').Total_adj.diff()\n",
" new_group = group.merge(abs_diffs.to_frame('Total_adj_abs_change'),\n",
" left_index=True, right_index=True)\n",
" new_group = new_group.merge(pct_diffs.to_frame('Total_adj_pct_change'),\n",
" left_index=True, right_index=True)\n",
" return new_group\n",
"d_with_diffs = d.groupby(d.Sector).apply(sector_diff)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Spending in 2012 / billions of pounds</th>\n",
" <th>Absolute change from 2011 / billions of pounds</th>\n",
" <th>Percentage change from 2011</th>\n",
" </tr>\n",
" <tr>\n",
" <th>Sector</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Education</th>\n",
" <td>92</td>\n",
" <td>-9</td>\n",
" <td>-9</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Other Spending</th>\n",
" <td>112</td>\n",
" <td>-6</td>\n",
" <td>-5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Health Care</th>\n",
" <td>129</td>\n",
" <td>-3</td>\n",
" <td>-2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Transport</th>\n",
" <td>20</td>\n",
" <td>-3</td>\n",
" <td>-13</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Defence</th>\n",
" <td>46</td>\n",
" <td>-2</td>\n",
" <td>-5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Protection</th>\n",
" <td>33</td>\n",
" <td>-2</td>\n",
" <td>-7</td>\n",
" </tr>\n",
" <tr>\n",
" <th>General Government</th>\n",
" <td>14</td>\n",
" <td>-1</td>\n",
" <td>-10</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Welfare</th>\n",
" <td>125</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Interest</th>\n",
" <td>53</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pensions</th>\n",
" <td>137</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Spending in 2012 / billions of pounds \\\n",
"Sector \n",
"Education 92 \n",
"Other Spending 112 \n",
"Health Care 129 \n",
"Transport 20 \n",
"Defence 46 \n",
"Protection 33 \n",
"General Government 14 \n",
"Welfare 125 \n",
"Interest 53 \n",
"Pensions 137 \n",
"\n",
" Absolute change from 2011 / billions of pounds \\\n",
"Sector \n",
"Education -9 \n",
"Other Spending -6 \n",
"Health Care -3 \n",
"Transport -3 \n",
"Defence -2 \n",
"Protection -2 \n",
"General Government -1 \n",
"Welfare 1 \n",
"Interest 1 \n",
"Pensions 2 \n",
"\n",
" Percentage change from 2011 \n",
"Sector \n",
"Education -9 \n",
"Other Spending -5 \n",
"Health Care -2 \n",
"Transport -13 \n",
"Defence -5 \n",
"Protection -7 \n",
"General Government -10 \n",
"Welfare 0 \n",
"Interest 2 \n",
"Pensions 1 "
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d_2012 = d_with_diffs[d_with_diffs.Year == 2012]\n",
"d_2012 = d_2012.sort_values('Total_adj_abs_change').set_index('Sector')\n",
"d_2012 = d_2012.loc[:, ('Total_adj', 'Total_adj_abs_change', 'Total_adj_pct_change')]\n",
"d_2012 = d_2012.rename(\n",
" columns={'Total_adj': 'Spending in 2012 / billions of pounds',\n",
" 'Total_adj_pct_change': 'Percentage change from 2011',\n",
" 'Total_adj_abs_change': 'Absolute change from 2011 / billions of pounds'})\n",
"d_2012.astype(int)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"It seems like the biggest decrease in spending was in Education, and (frustratingly) 'Other spending'. From the sectors' own perspectives, the hardest hit were Transport, 'General Government' and Education."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Spending distribution trends"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now let's look at how the government has split up its spending, while accounting for the fact that absolute spending amounts have changed. This might highlight government priorities."
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"def sector_pct(year_group):\n",
" year_pct = (100 * year_group.Total_adj.to_frame('Total_adj_pct')\n",
" / year_group.Total_adj.sum())\n",
" new_group = year_group.merge(year_pct, left_index=True, right_index=True)\n",
" return new_group\n",
"d_with_pcts = d.groupby(d.Year).apply(sector_pct)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"plotdiv\" id=\"14178ecf-e9dd-47a2-b890-8b23d96c821e\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = \"\";\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_timeout = Date.now() + 0;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
" \n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
" \n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" Bokeh.$(\"#14178ecf-e9dd-47a2-b890-8b23d96c821e\").text(\"BokehJS successfully loaded.\");\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
" \n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
" \n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"14178ecf-e9dd-47a2-b890-8b23d96c821e\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid '14178ecf-e9dd-47a2-b890-8b23d96c821e' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
" \n",
" var js_urls = [];\n",
" \n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.$(function() {\n",
" var docs_json = {\"a7402247-02e9-430b-8c5a-afa32268b63d\":{\"roots\":{\"references\":[{\"attributes\":{\"label\":{\"value\":\"Protection\"},\"renderers\":[{\"id\":\"35f1490e-d73d-4b1d-b6e1-1f1f2773e63f\",\"type\":\"GlyphRenderer\"}]},\"id\":\"b6651870-5587-494f-8241-2206b24dcd00\",\"type\":\"LegendItem\"},{\"attributes\":{\"line_color\":{\"value\":\"#d9d9d9\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"10c5ef8c-885c-4a0b-92f6-cd3742d9d1d7\",\"type\":\"Line\"},{\"attributes\":{\"axis_label\":\"Percentage of year's total spending\",\"formatter\":{\"id\":\"27364037-72ef-4eb0-88d5-5ff4a8297c7f\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"e57c051d-efe3-478d-a9ed-bf1931a951bf\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"4e7a0f94-b7f2-4f96-ad6e-674636fe8121\",\"type\":\"BasicTicker\"}},\"id\":\"63735381-06fc-4e64-95fb-5edf4a212429\",\"type\":\"LinearAxis\"},{\"attributes\":{\"plot\":{\"id\":\"e57c051d-efe3-478d-a9ed-bf1931a951bf\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"d43761c0-835d-4e01-919c-4f392443d1d6\",\"type\":\"HelpTool\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"cf5fb662-cabc-410f-b7e1-38cb0780207d\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\"],\"chart_index\":[{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[17.981381675649192,19.222172552525706,20.118845500848895,21.386138613861384,21.677041376785063,21.021336131514513,21.078755790866975,20.92267706302794,19.473189087488237,16.53614457831325,17.372134038800706,15.790914066776136,15.218508997429305,15.580399619410088,16.256590509666083,15.860105734038227,15.587392550143269,15.19839825263924,15.524643654473643,15.698958662038498,16.44385026737968,15.707685846283072,16.36842835344708,15.81508515815085,15.255601771098886,15.090596481946829,14.85135490660353,14.451827242524917]}},\"id\":\"639e8491-5b56-4545-a435-30e50c54f64b\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"b572a88c-59d8-4655-b4d4-4bfc018e658a\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"7dec1677-e2e9-4a3e-81c3-1719f5ec43ee\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"5fea413f-02e5-47db-8549-c15c6291e166\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"below\":[{\"id\":\"a9e9ecc4-9d78-4e53-b3dc-cd268bbfc39b\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"63735381-06fc-4e64-95fb-5edf4a212429\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"cf5fb662-cabc-410f-b7e1-38cb0780207d\",\"type\":\"BoxAnnotation\"},{\"id\":\"c2fead30-456e-45a1-a54d-d411e5e29f40\",\"type\":\"GlyphRenderer\"},{\"id\":\"17145c06-25ea-44fa-80e9-70c9f42fd7a6\",\"type\":\"GlyphRenderer\"},{\"id\":\"5fea413f-02e5-47db-8549-c15c6291e166\",\"type\":\"GlyphRenderer\"},{\"id\":\"efe18d6b-94c0-4441-b37e-0f0130e5140e\",\"type\":\"GlyphRenderer\"},{\"id\":\"0ab36672-3059-4705-b935-cd5b59d5d6b6\",\"type\":\"GlyphRenderer\"},{\"id\":\"bd221670-a814-4070-8372-3020336196f6\",\"type\":\"GlyphRenderer\"},{\"id\":\"35ce7d69-34c0-4a18-93ba-3cce9a12f796\",\"type\":\"GlyphRenderer\"},{\"id\":\"35f1490e-d73d-4b1d-b6e1-1f1f2773e63f\",\"type\":\"GlyphRenderer\"},{\"id\":\"b4aafa0f-a682-4835-92bd-755df94cd7fe\",\"type\":\"GlyphRenderer\"},{\"id\":\"2d07d7df-322c-4f8f-8b52-6aa550a5eb8b\",\"type\":\"GlyphRenderer\"},{\"id\":\"4fa25d7b-7e1d-48fd-a2a4-782047e24bff\",\"type\":\"Legend\"},{\"id\":\"a9e9ecc4-9d78-4e53-b3dc-cd268bbfc39b\",\"type\":\"LinearAxis\"},{\"id\":\"63735381-06fc-4e64-95fb-5edf4a212429\",\"type\":\"LinearAxis\"},{\"id\":\"c9beaced-1544-4db0-a2e1-ff30a3fc4551\",\"type\":\"Grid\"},{\"id\":\"0a539958-90e6-4749-b32d-881b0681af84\",\"type\":\"Grid\"}],\"title\":{\"id\":\"093026f3-8542-4c72-b664-0ec1815ecf64\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"ce455031-bd9f-4078-9d35-55c194624c6e\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"4ae0f22f-3629-405d-a948-c33e020ad6de\",\"type\":\"Toolbar\"},\"x_mapper_type\":\"auto\",\"x_range\":{\"id\":\"abbccea3-c2c2-4fc6-bd70-ed4c9db1ba68\",\"type\":\"Range1d\"},\"y_mapper_type\":\"auto\",\"y_range\":{\"id\":\"8c1181f0-e9bf-49ed-966f-b13b4ddefd59\",\"type\":\"Range1d\"}},\"id\":\"e57c051d-efe3-478d-a9ed-bf1931a951bf\",\"subtype\":\"Chart\",\"type\":\"Plot\"},{\"attributes\":{\"axis_label\":\"Year\",\"formatter\":{\"id\":\"8a37bd92-3603-4220-86fc-35e22c871eec\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"e57c051d-efe3-478d-a9ed-bf1931a951bf\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"c2e399e3-0d31-40f7-bd36-59115f286bd8\",\"type\":\"BasicTicker\"}},\"id\":\"a9e9ecc4-9d78-4e53-b3dc-cd268bbfc39b\",\"type\":\"LinearAxis\"},{\"attributes\":{\"line_color\":{\"value\":\"#fccde5\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"18f720b9-88fd-4da6-8768-bb1ad9394b76\",\"type\":\"Line\"},{\"attributes\":{\"line_color\":{\"value\":\"#b3de69\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"98110a03-816e-4646-8f8c-f6f41f4b0f93\",\"type\":\"Line\"},{\"attributes\":{\"plot\":{\"id\":\"e57c051d-efe3-478d-a9ed-bf1931a951bf\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"c2e399e3-0d31-40f7-bd36-59115f286bd8\",\"type\":\"BasicTicker\"}},\"id\":\"c9beaced-1544-4db0-a2e1-ff30a3fc4551\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"4e7a0f94-b7f2-4f96-ad6e-674636fe8121\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data_source\":{\"id\":\"f64be340-1cee-4d2f-b416-2ce936067a7b\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"bce19690-6049-4745-9fca-67dfed316417\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"efe18d6b-94c0-4441-b37e-0f0130e5140e\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"8a37bd92-3603-4220-86fc-35e22c871eec\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\"],\"chart_index\":[{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[12.052915237628614,11.846222619579793,12.43633276740238,12.95049504950495,12.596118637861588,12.626792584819865,12.078093977498346,12.118258609486677,12.260896832862967,12.228915662650602,12.551440329218108,12.698412698412696,13.136246786632391,13.01141769743102,13.400702987697718,13.23708824725498,13.314231136580709,13.28722242446305,13.515370084149067,13.09561375828337,13.146167557932264,12.809743805123897,11.998890276043834,11.381454447147878,11.445055682275594,11.347705329982805,11.049723756906081,10.886787630973677]}},\"id\":\"b50b7702-8799-40d1-ab71-313e5905f6f6\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"label\":{\"value\":\"Pensions\"},\"renderers\":[{\"id\":\"35ce7d69-34c0-4a18-93ba-3cce9a12f796\",\"type\":\"GlyphRenderer\"}]},\"id\":\"f40825be-f25f-47ff-8271-8ae51a46a7db\",\"type\":\"LegendItem\"},{\"attributes\":{\"plot\":{\"id\":\"e57c051d-efe3-478d-a9ed-bf1931a951bf\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"819134ef-134d-44d4-8fac-5dd901975255\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"data_source\":{\"id\":\"f111102a-adf1-401e-9811-64750bdc0381\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"98110a03-816e-4646-8f8c-f6f41f4b0f93\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"35ce7d69-34c0-4a18-93ba-3cce9a12f796\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"ce455031-bd9f-4078-9d35-55c194624c6e\",\"type\":\"ToolEvents\"},{\"attributes\":{\"plot\":{\"id\":\"e57c051d-efe3-478d-a9ed-bf1931a951bf\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"7c8d99ed-685f-4328-8e69-e8133b67b3cd\",\"type\":\"PanTool\"},{\"attributes\":{\"line_color\":{\"value\":\"#ffffb3\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"348b94a0-d208-449b-b8a9-856dc543e603\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\"],\"chart_index\":[{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[3.3317001469867704,3.7103263299061244,3.947368421052632,3.009900990099009,1.940681069205419,2.553340328786289,1.5552614162806089,1.5269655620532812,2.6026967701473818,2.560240963855421,2.5867136978248086,2.517788724685276,2.904884318766067,3.520456707897241,3.580843585237259,3.2533550223668155,3.2473734479465146,3.622133236257735,3.5205220676627174,3.313348059324708,3.4165181224004755,3.0099398012039758,2.691080593702316,2.5006758583400917,2.562726418891722,2.684830048935326,3.4596158905551175,3.616151290569895]}},\"id\":\"ea6908f7-fefc-47e0-902c-70c728a40a5e\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"e57c051d-efe3-478d-a9ed-bf1931a951bf\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"4e7a0f94-b7f2-4f96-ad6e-674636fe8121\",\"type\":\"BasicTicker\"}},\"id\":\"0a539958-90e6-4749-b32d-881b0681af84\",\"type\":\"Grid\"},{\"attributes\":{\"items\":[{\"id\":\"fd29124f-859d-4cf6-a395-946612282e02\",\"type\":\"LegendItem\"},{\"id\":\"a6f1401c-94ab-43e3-961e-2c1da5f694f2\",\"type\":\"LegendItem\"},{\"id\":\"da287411-e1e1-42a9-a80a-283d3358315e\",\"type\":\"LegendItem\"},{\"id\":\"779f40f0-c809-4de9-9c14-0a6098408003\",\"type\":\"LegendItem\"},{\"id\":\"c912cf7d-d7b1-40b8-8e40-0baa3d22bcea\",\"type\":\"LegendItem\"},{\"id\":\"81dc2bfa-db3d-40eb-9553-e14bf3e75283\",\"type\":\"LegendItem\"},{\"id\":\"f40825be-f25f-47ff-8271-8ae51a46a7db\",\"type\":\"LegendItem\"},{\"id\":\"b6651870-5587-494f-8241-2206b24dcd00\",\"type\":\"LegendItem\"},{\"id\":\"fde5b003-ebb5-4385-be49-c0dbdf1dbbe6\",\"type\":\"LegendItem\"},{\"id\":\"14dfc014-73bd-474b-8af5-d930c31553e1\",\"type\":\"LegendItem\"}],\"location\":\"bottom_left\",\"plot\":{\"id\":\"e57c051d-efe3-478d-a9ed-bf1931a951bf\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"4fa25d7b-7e1d-48fd-a2a4-782047e24bff\",\"type\":\"Legend\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\"],\"chart_index\":[{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[12.003919647231747,12.293249888243182,13.242784380305606,13.86138613861386,13.548150860490662,14.165792235047217,13.13699536730642,13.41780376868096,13.515208529319533,14.156626506024095,14.57965902410347,14.860426929392446,15.398457583547556,15.74690770694577,16.45430579964851,16.856445709638063,17.115568290353394,17.236985802693845,17.5682637815559,17.150520668980754,17.364824717765895,16.771664566708665,16.826189485365514,16.801838334685048,17.36213605259627,17.73574923951858,18.245198631938965,18.234091489905442]}},\"id\":\"f64be340-1cee-4d2f-b416-2ce936067a7b\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":{\"value\":\"#fdb462\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"a6fbf66d-6f2d-46c9-bf93-ce84c59204fb\",\"type\":\"Line\"},{\"attributes\":{\"line_color\":{\"value\":\"#bc80bd\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"20adf585-7fcb-426d-8634-798d5398b609\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\"],\"chart_index\":[{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[4.997550220480155,5.1408135896289675,5.517826825127335,5.6237623762376225,5.419260344196266,5.386498775795732,5.2283256121773665,4.743339831059128,5.299466917529005,5.39156626506024,5.379188712522045,5.528188286808977,5.886889460154241,5.756422454804948,5.755711775043937,5.795038633590891,5.596943648519581,5.5151073898798675,5.409582689335395,5.348690438624171,5.065359477124183,4.647907041859163,4.425024275211541,4.230873208975399,3.9715550784918827,3.928051844994048,3.933175480136806,3.7567084078711983]}},\"id\":\"57adb190-1711-407b-bd1e-49c51d1b8610\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"b50b7702-8799-40d1-ab71-313e5905f6f6\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"348b94a0-d208-449b-b8a9-856dc543e603\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"17145c06-25ea-44fa-80e9-70c9f42fd7a6\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"label\":{\"value\":\"Health Care\"},\"renderers\":[{\"id\":\"efe18d6b-94c0-4441-b37e-0f0130e5140e\",\"type\":\"GlyphRenderer\"}]},\"id\":\"779f40f0-c809-4de9-9c14-0a6098408003\",\"type\":\"LegendItem\"},{\"attributes\":{},\"id\":\"c2e399e3-0d31-40f7-bd36-59115f286bd8\",\"type\":\"BasicTicker\"},{\"attributes\":{\"label\":{\"value\":\"Transport\"},\"renderers\":[{\"id\":\"b4aafa0f-a682-4835-92bd-755df94cd7fe\",\"type\":\"GlyphRenderer\"}]},\"id\":\"fde5b003-ebb5-4385-be49-c0dbdf1dbbe6\",\"type\":\"LegendItem\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\"],\"chart_index\":[{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[11.758941695247428,12.069736253911488,11.926994906621394,13.663366336633661,15.122665690223359,14.480587618048267,15.023163467902052,16.04938271604938,16.337409846346816,18.614457831325296,19.31216931216931,20.087575259989055,20.128534704370175,19.00570884871551,17.9701230228471,17.568117120780805,17.172874880611275,17.091372406261375,16.967199038296414,17.11896497317766,17.29055258467023,17.06565868682626,17.977528089887638,18.81589618815896,19.186904602173623,19.812194154212406,20.349907918968693,20.048556095067724]}},\"id\":\"f111102a-adf1-401e-9811-64750bdc0381\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":{\"value\":\"#80b1d3\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"fc776dab-21cb-40b2-ae36-7fdbc1ace7b8\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"ea6908f7-fefc-47e0-902c-70c728a40a5e\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"10c5ef8c-885c-4a0b-92f6-cd3742d9d1d7\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"b4aafa0f-a682-4835-92bd-755df94cd7fe\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"label\":{\"value\":\"Other Spending\"},\"renderers\":[{\"id\":\"bd221670-a814-4070-8372-3020336196f6\",\"type\":\"GlyphRenderer\"}]},\"id\":\"81dc2bfa-db3d-40eb-9553-e14bf3e75283\",\"type\":\"LegendItem\"},{\"attributes\":{\"data_source\":{\"id\":\"639e8491-5b56-4545-a435-30e50c54f64b\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"20adf585-7fcb-426d-8634-798d5398b609\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"2d07d7df-322c-4f8f-8b52-6aa550a5eb8b\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"end\":2019.7,\"start\":1987.3},\"id\":\"abbccea3-c2c2-4fc6-bd70-ed4c9db1ba68\",\"type\":\"Range1d\"},{\"attributes\":{\"label\":{\"value\":\"Welfare\"},\"renderers\":[{\"id\":\"2d07d7df-322c-4f8f-8b52-6aa550a5eb8b\",\"type\":\"GlyphRenderer\"}]},\"id\":\"14dfc014-73bd-474b-8af5-d930c31553e1\",\"type\":\"LegendItem\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"7c8d99ed-685f-4328-8e69-e8133b67b3cd\",\"type\":\"PanTool\"},{\"id\":\"819134ef-134d-44d4-8fac-5dd901975255\",\"type\":\"WheelZoomTool\"},{\"id\":\"ab8a280e-8c7f-4ae7-9537-0b8086f728a5\",\"type\":\"BoxZoomTool\"},{\"id\":\"ac2a1829-2562-4693-a97a-23e893e18e77\",\"type\":\"SaveTool\"},{\"id\":\"35be95b7-22c3-43ea-bdbd-9d5e8a4c8f89\",\"type\":\"ResetTool\"},{\"id\":\"d43761c0-835d-4e01-919c-4f392443d1d6\",\"type\":\"HelpTool\"}]},\"id\":\"4ae0f22f-3629-405d-a948-c33e020ad6de\",\"type\":\"Toolbar\"},{\"attributes\":{\"label\":{\"value\":\"Defence\"},\"renderers\":[{\"id\":\"c2fead30-456e-45a1-a54d-d411e5e29f40\",\"type\":\"GlyphRenderer\"}]},\"id\":\"fd29124f-859d-4cf6-a395-946612282e02\",\"type\":\"LegendItem\"},{\"attributes\":{\"label\":{\"value\":\"Interest\"},\"renderers\":[{\"id\":\"0ab36672-3059-4705-b935-cd5b59d5d6b6\",\"type\":\"GlyphRenderer\"}]},\"id\":\"c912cf7d-d7b1-40b8-8e40-0baa3d22bcea\",\"type\":\"LegendItem\"},{\"attributes\":{\"overlay\":{\"id\":\"cf5fb662-cabc-410f-b7e1-38cb0780207d\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"e57c051d-efe3-478d-a9ed-bf1931a951bf\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"ab8a280e-8c7f-4ae7-9537-0b8086f728a5\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"line_color\":{\"value\":\"#8dd3c7\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"43e34174-5c21-4c1f-b8c4-4e9d2c2b52b0\",\"type\":\"Line\"},{\"attributes\":{\"line_color\":{\"value\":\"#fb8072\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"bce19690-6049-4745-9fca-67dfed316417\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\"],\"chart_index\":[{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[11.415972562469378,10.907465355386677,11.03565365025467,10.415841584158416,9.520322226290736,8.954179783140958,8.173395102581072,8.15464587394412,7.651301348385072,8.042168674698795,8.171663727219283,8.182813355227148,7.275064267352184,7.1360608943863,7.117750439367312,6.791378609190727,6.723973256924548,6.661812886785585,6.577365619096686,6.468917639633953,6.327985739750445,6.2858742825143485,6.117353308364545,5.663692889970262,5.90366295451496,5.978045232112154,5.893186003683241,5.826731408126757]}},\"id\":\"5b96c52e-905f-4487-9533-a0c5021e12ae\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"e57c051d-efe3-478d-a9ed-bf1931a951bf\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"ac2a1829-2562-4693-a97a-23e893e18e77\",\"type\":\"SaveTool\"},{\"attributes\":{\"line_color\":{\"value\":\"#bebada\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"7dec1677-e2e9-4a3e-81c3-1719f5ec43ee\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"27364037-72ef-4eb0-88d5-5ff4a8297c7f\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":{\"id\":\"e57c051d-efe3-478d-a9ed-bf1931a951bf\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"35be95b7-22c3-43ea-bdbd-9d5e8a4c8f89\",\"type\":\"ResetTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\"],\"chart_index\":[{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[9.211170994610484,8.314707197139025,7.130730050933788,8.435643564356434,7.616257781032588,9.443861490031479,9.9602911978822,10.266406757634826,9.313264346190026,8.825301204819278,7.436801881246326,7.22495894909688,5.758354755784061,5.042816365366318,4.9428822495606335,4.941032940219602,5.004775549188158,5.114670549690571,5.272196462304655,4.938466393183969,4.5603089720736785,6.607867842643148,6.97738937439312,6.677480400108136,6.601368576412184,6.083851342415024,6.011575901078666,6.197291081012011]}},\"id\":\"cbdd6b6b-eff1-43f0-be3d-f0e513da8e0c\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"5b96c52e-905f-4487-9533-a0c5021e12ae\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"43e34174-5c21-4c1f-b8c4-4e9d2c2b52b0\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"c2fead30-456e-45a1-a54d-d411e5e29f40\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"label\":{\"value\":\"Education\"},\"renderers\":[{\"id\":\"17145c06-25ea-44fa-80e9-70c9f42fd7a6\",\"type\":\"GlyphRenderer\"}]},\"id\":\"a6f1401c-94ab-43e3-961e-2c1da5f694f2\",\"type\":\"LegendItem\"},{\"attributes\":{\"plot\":null,\"text\":\"Distribution of spending by sector\"},\"id\":\"093026f3-8542-4c72-b664-0ec1815ecf64\",\"type\":\"Title\"},{\"attributes\":{\"data_source\":{\"id\":\"cbdd6b6b-eff1-43f0-be3d-f0e513da8e0c\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"fc776dab-21cb-40b2-ae36-7fdbc1ace7b8\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"0ab36672-3059-4705-b935-cd5b59d5d6b6\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\"],\"chart_index\":[{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[13.865752082312591,13.366115333035314,12.563667232597625,8.554455445544553,10.728670816550714,9.478838754809374,12.111184645929848,11.208576998050681,11.759172154280337,10.933734939759034,9.729570840681953,10.727969348659004,11.336760925449871,12.464319695528069,11.86291739894552,12.810085400569337,13.123209169054444,13.21441572624681,12.742572557101154,14.342063742505522,14.022578728461083,15.00769984600308,14.689970869746151,16.30170316301703,15.91305514557896,15.540272450734028,14.351486450933965,15.026833631484793]}},\"id\":\"8c3cff85-bcaa-4fa3-92ba-1c46cf01bffc\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"label\":{\"value\":\"General Government\"},\"renderers\":[{\"id\":\"5fea413f-02e5-47db-8549-c15c6291e166\",\"type\":\"GlyphRenderer\"}]},\"id\":\"da287411-e1e1-42a9-a80a-283d3358315e\",\"type\":\"LegendItem\"},{\"attributes\":{\"callback\":null,\"end\":23.69204895825824,\"start\":-0.4880420194198971},\"id\":\"8c1181f0-e9bf-49ed-966f-b13b4ddefd59\",\"type\":\"Range1d\"},{\"attributes\":{\"data_source\":{\"id\":\"8c3cff85-bcaa-4fa3-92ba-1c46cf01bffc\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"a6fbf66d-6f2d-46c9-bf93-ce84c59204fb\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"bd221670-a814-4070-8372-3020336196f6\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\"],\"chart_index\":[{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[3.3806957373836353,3.1291908806437196,2.079796264855688,2.099009900990098,1.830831197363603,1.8887722980062958,1.6545334215751157,1.5919428200129953,1.787394167450611,2.710843373493976,2.880658436213992,2.3809523809523805,2.956298200514139,2.735490009514748,2.6581722319859407,2.887352582350549,3.1136580706781283,3.0578813250819072,2.9022840460243864,2.5244556642473963,2.3618538324420677,2.0859582808343835,1.928145373838258,1.8113003514463366,1.79793371796592,1.7987038751487896,1.8547750591949492,1.9550217224635829]}},\"id\":\"b572a88c-59d8-4655-b4d4-4bfc018e658a\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"57adb190-1711-407b-bd1e-49c51d1b8610\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"18f720b9-88fd-4da6-8768-bb1ad9394b76\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"35f1490e-d73d-4b1d-b6e1-1f1f2773e63f\",\"type\":\"GlyphRenderer\"}],\"root_ids\":[\"e57c051d-efe3-478d-a9ed-bf1931a951bf\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.3\"}};\n",
" var render_items = [{\"docid\":\"a7402247-02e9-430b-8c5a-afa32268b63d\",\"elementid\":\"14178ecf-e9dd-47a2-b890-8b23d96c821e\",\"modelid\":\"e57c051d-efe3-478d-a9ed-bf1931a951bf\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (!force) {\n",
" var cell = $(\"#14178ecf-e9dd-47a2-b890-8b23d96c821e\").parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
" \n",
" }\n",
" \n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
" }(this));\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"show(Line(d_with_pcts, x='Year', y='Total_adj_pct', color='Sector',\n",
" legend='bottom_left', palette=palette,\n",
" ylabel='Percentage of year\\'s total spending',\n",
" title='Distribution of spending by sector'))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"From this perspective, it's possible to see that defense has a long-term decline in priority; it's also interesting to note that interest payments were becoming gradually less of an issue until 2003.\n",
"\n",
"The winners in terms of government priority appear to be health-care, along with 'Other spending'."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Accounting for the size of the economy\n",
"\n",
"Along with inflation, there is another adjustment that should be made to these numbers. Government spending will naturally scale with the size of the economy. In one obvious sense, spending should be expected to increase if the country's population increases; in perhaps a slightly less obvious sense, spending should also be expected to increase if the typical person is more productive: some of their extra money will be worth spending on government services like health-care.\n",
"\n",
"Both of these are captured (albeit imperfectly) by the country's Gross Domestic Product (GDP), which roughly scales with the number and productivity of people in the country. So let's revisit some of these charts, but showing the fraction of the country's product that is spent. Within a given year, the GDP is just a constant number, like £1 billion; the analysis is only changed when comparing different years.\n",
"\n",
"As a silly example to illustrate that this is accounting for something on top of just inflation, if an economy were to double in size in one year, prices need not necessarily also double; however, we would still expect government spending to significantly increase simply because the economy has grown, and so we want to normalize for this fact."
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"dts_gdp = [year_to_data(year, unit_type=UnitType.percent_gdp)\n",
" for year in years_of_interest]\n",
"d_gdp = pd.concat(dts_gdp).loc[:, ('Sector', 'Total', 'Year')]\n",
"d = pd.merge(d, d_gdp, on=['Year', 'Sector'], suffixes=('', '_gdp'))"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"plotdiv\" id=\"f86e1d8c-fe3a-4bec-b8a3-605dfbbf7a1b\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = \"\";\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_timeout = Date.now() + 0;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
" \n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
" \n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" Bokeh.$(\"#f86e1d8c-fe3a-4bec-b8a3-605dfbbf7a1b\").text(\"BokehJS successfully loaded.\");\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
" \n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
" \n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"f86e1d8c-fe3a-4bec-b8a3-605dfbbf7a1b\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'f86e1d8c-fe3a-4bec-b8a3-605dfbbf7a1b' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
" \n",
" var js_urls = [];\n",
" \n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.$(function() {\n",
" var docs_json = {\"5446041b-307b-4231-aabd-9b2d06c168e5\":{\"roots\":{\"references\":[{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"db57dedb-1919-45e3-a107-293b896284d7\",\"type\":\"PanTool\"},{\"id\":\"e473d6df-5396-4368-9986-da261a656b39\",\"type\":\"WheelZoomTool\"},{\"id\":\"c17e7e2c-5c66-4e9d-b70f-ba094ccd2f9c\",\"type\":\"BoxZoomTool\"},{\"id\":\"fe61d11b-2f32-403b-a46d-642919d2c08e\",\"type\":\"SaveTool\"},{\"id\":\"2d3bbc9e-9457-4222-9311-85613e95b307\",\"type\":\"ResetTool\"},{\"id\":\"d3861ddd-ec07-42d9-817c-2e6c7c1626a8\",\"type\":\"HelpTool\"}]},\"id\":\"3c7a3891-9cd4-4252-ac71-cd1498dbad46\",\"type\":\"Toolbar\"},{\"attributes\":{\"label\":{\"value\":\"Interest\"},\"renderers\":[{\"id\":\"bf18634f-f652-4f19-a9c1-e5faa2c683b6\",\"type\":\"GlyphRenderer\"}]},\"id\":\"9a384f82-f6a2-4bf2-b1be-cd4bb6df592c\",\"type\":\"LegendItem\"},{\"attributes\":{\"data_source\":{\"id\":\"357e9d83-5c93-4bab-b7ae-610ae2979cde\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"e27482f9-3e71-4cfc-bf9c-7d7acf4c3c52\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"d255b64a-f115-4012-98de-40d345748752\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":{\"id\":\"d6b1001a-0426-4b50-ba16-500c0c7f0593\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"d3861ddd-ec07-42d9-817c-2e6c7c1626a8\",\"type\":\"HelpTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\",\"General Government\"],\"chart_index\":[{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"},{\"Sector\":\"General Government\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[1.21,1.17,0.79,0.8,0.72,0.74,0.65,0.59,0.65,0.97,1.01,0.85,1.07,1.01,1.0,1.13,1.22,1.2,1.18,1.15,1.06,0.95,0.85,0.8,0.77,0.74,0.75,0.79]}},\"id\":\"3c52b2e4-c19e-4bf9-9af4-62679206e0d9\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"f8a36eea-38fc-4479-a3f9-1f1e6acff5f4\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"d6b1001a-0426-4b50-ba16-500c0c7f0593\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"fe61d11b-2f32-403b-a46d-642919d2c08e\",\"type\":\"SaveTool\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"d6b1001a-0426-4b50-ba16-500c0c7f0593\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"12dad9ef-8b03-4a15-bf4f-ee7d6a94bd16\",\"type\":\"BasicTicker\"}},\"id\":\"213a3cb0-632b-4815-96ce-743973489435\",\"type\":\"Grid\"},{\"attributes\":{\"plot\":{\"id\":\"d6b1001a-0426-4b50-ba16-500c0c7f0593\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"f8a36eea-38fc-4479-a3f9-1f1e6acff5f4\",\"type\":\"BasicTicker\"}},\"id\":\"64c63ddf-7452-4e7a-b166-5ab2ffd3d108\",\"type\":\"Grid\"},{\"attributes\":{\"line_color\":{\"value\":\"#80b1d3\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"d7d75ff6-8954-4a12-942a-d4d2b75ab8d5\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"61a9b235-7f54-4cae-b191-2bd9b44151ef\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"93491033-c486-4362-867d-84576ce1d8eb\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"c9eafb7a-8aaa-4d33-8c21-2c64832d77de\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"label\":{\"value\":\"Education\"},\"renderers\":[{\"id\":\"4839b5b1-cab7-43b6-b268-286735c21a11\",\"type\":\"GlyphRenderer\"}]},\"id\":\"b9bc28ed-9eca-463c-bc65-f8d9ad8905b6\",\"type\":\"LegendItem\"},{\"attributes\":{\"label\":{\"value\":\"Defence\"},\"renderers\":[{\"id\":\"c9eafb7a-8aaa-4d33-8c21-2c64832d77de\",\"type\":\"GlyphRenderer\"}]},\"id\":\"d4169f20-ff67-4a13-9c17-56098981d6d8\",\"type\":\"LegendItem\"},{\"attributes\":{\"axis_label\":\"Spending / percentage of year's GDP\",\"formatter\":{\"id\":\"c6a62150-1d6c-4334-8ce7-6eb4ea525b12\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"d6b1001a-0426-4b50-ba16-500c0c7f0593\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"12dad9ef-8b03-4a15-bf4f-ee7d6a94bd16\",\"type\":\"BasicTicker\"}},\"id\":\"058903ad-02b5-4b40-9478-6083a17117a9\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"3c52b2e4-c19e-4bf9-9af4-62679206e0d9\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"330fd1ae-f25b-4ced-bf76-1826ccfa2bcc\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"ce1a74c2-3d66-4dba-a908-9fb06076af9d\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"items\":[{\"id\":\"d4169f20-ff67-4a13-9c17-56098981d6d8\",\"type\":\"LegendItem\"},{\"id\":\"b9bc28ed-9eca-463c-bc65-f8d9ad8905b6\",\"type\":\"LegendItem\"},{\"id\":\"05354bcb-9abb-4290-b3f1-0222587c470b\",\"type\":\"LegendItem\"},{\"id\":\"1c602c0e-46e1-42ce-b18e-bb1ca196faaf\",\"type\":\"LegendItem\"},{\"id\":\"9a384f82-f6a2-4bf2-b1be-cd4bb6df592c\",\"type\":\"LegendItem\"},{\"id\":\"b7c4927b-cd3a-43df-b195-c90873b71bc4\",\"type\":\"LegendItem\"},{\"id\":\"493554fc-73c8-4594-b335-ebee52f7e31a\",\"type\":\"LegendItem\"},{\"id\":\"89dd73a6-4ace-48be-bc75-a7b50b411c6a\",\"type\":\"LegendItem\"},{\"id\":\"db13360e-8906-43c2-a4ea-5280a382e867\",\"type\":\"LegendItem\"},{\"id\":\"d86ee927-716f-4739-8fe8-8f416f66e24b\",\"type\":\"LegendItem\"}],\"location\":\"top_left\",\"plot\":{\"id\":\"d6b1001a-0426-4b50-ba16-500c0c7f0593\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"bfc6fd8e-e392-4f3f-9e15-09df1a50d4ac\",\"type\":\"Legend\"},{\"attributes\":{},\"id\":\"c6a62150-1d6c-4334-8ce7-6eb4ea525b12\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"a66f774c-f5cf-448d-9a26-be9541493394\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"65e84068-9141-4070-aba5-e2582fed956f\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"c866d2ab-9aa9-461d-9e78-89525dd68ee4\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\",\"Education\"],\"chart_index\":[{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"},{\"Sector\":\"Education\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[4.31,4.43,4.71,5.0,4.97,4.92,4.67,4.49,4.45,4.37,4.37,4.55,4.75,4.8,5.08,5.19,5.25,5.19,5.49,5.95,5.9,5.81,5.31,5.02,4.86,4.68,4.48,4.39]}},\"id\":\"30e4616e-4fbe-4320-b1f8-c21b5c62dc22\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"label\":{\"value\":\"Health Care\"},\"renderers\":[{\"id\":\"094129bc-49e1-4eca-9ea2-eca4d7f01afd\",\"type\":\"GlyphRenderer\"}]},\"id\":\"1c602c0e-46e1-42ce-b18e-bb1ca196faaf\",\"type\":\"LegendItem\"},{\"attributes\":{\"plot\":null,\"text\":\"Spending by sector, normalized by GDP\"},\"id\":\"b0abdd90-96ff-421f-ad7c-8f88e4a235aa\",\"type\":\"Title\"},{\"attributes\":{\"label\":{\"value\":\"Transport\"},\"renderers\":[{\"id\":\"c866d2ab-9aa9-461d-9e78-89525dd68ee4\",\"type\":\"GlyphRenderer\"}]},\"id\":\"db13360e-8906-43c2-a4ea-5280a382e867\",\"type\":\"LegendItem\"},{\"attributes\":{\"line_color\":{\"value\":\"#ffffb3\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"f56be7fc-aa60-4f4e-8aad-fe9e8ef4d07b\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"end\":2019.7,\"start\":1987.3},\"id\":\"3f21511f-cd7b-4547-99e8-2cfe953076d1\",\"type\":\"Range1d\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\",\"Protection\"],\"chart_index\":[{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"},{\"Sector\":\"Protection\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[1.79,1.92,2.09,2.18,2.14,2.1,2.02,1.76,1.92,1.93,1.88,1.98,2.13,2.13,2.18,2.27,2.21,2.15,2.19,2.43,2.27,2.11,1.96,1.86,1.69,1.62,1.59,1.51]}},\"id\":\"0e78a3c5-b71a-4e9d-89da-8f4b7c96c1d3\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":{\"value\":\"#b3de69\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"e27482f9-3e71-4cfc-bf9c-7d7acf4c3c52\",\"type\":\"Line\"},{\"attributes\":{\"line_color\":{\"value\":\"#fb8072\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"769d0145-0792-4ed7-8233-b1ac53385367\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"b6e9051b-f8b4-43ca-8c4e-7065a83e01e6\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"358193f7-2815-4960-abe2-f00fb0a8c5a2\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"c7ce7a8c-3d2b-4394-b49c-535e4d395ab0\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":{\"id\":\"d6b1001a-0426-4b50-ba16-500c0c7f0593\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"db57dedb-1919-45e3-a107-293b896284d7\",\"type\":\"PanTool\"},{\"attributes\":{\"callback\":null,\"end\":9.348,\"start\":-0.2280000000000001},\"id\":\"4b246214-9827-48d4-9974-86aed78f57bd\",\"type\":\"Range1d\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"7791feda-ffa8-470e-b8c2-062bbe1ff004\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"data_source\":{\"id\":\"fa36328c-e892-4170-86da-74bd3dc82713\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"769d0145-0792-4ed7-8233-b1ac53385367\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"094129bc-49e1-4eca-9ea2-eca4d7f01afd\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3f80aaf0-be52-4ffc-8126-5ad41d7157f6\",\"type\":\"ToolEvents\"},{\"attributes\":{},\"id\":\"12dad9ef-8b03-4a15-bf4f-ee7d6a94bd16\",\"type\":\"BasicTicker\"},{\"attributes\":{\"data_source\":{\"id\":\"0e78a3c5-b71a-4e9d-89da-8f4b7c96c1d3\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"c78b14b8-a402-40e4-9e31-ba4289491b7b\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"0c8b9cca-c53d-4f25-9c48-d03d2c50066a\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"below\":[{\"id\":\"cb364ef2-7472-4e11-8230-b4048797245d\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"058903ad-02b5-4b40-9478-6083a17117a9\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"7791feda-ffa8-470e-b8c2-062bbe1ff004\",\"type\":\"BoxAnnotation\"},{\"id\":\"c9eafb7a-8aaa-4d33-8c21-2c64832d77de\",\"type\":\"GlyphRenderer\"},{\"id\":\"4839b5b1-cab7-43b6-b268-286735c21a11\",\"type\":\"GlyphRenderer\"},{\"id\":\"ce1a74c2-3d66-4dba-a908-9fb06076af9d\",\"type\":\"GlyphRenderer\"},{\"id\":\"094129bc-49e1-4eca-9ea2-eca4d7f01afd\",\"type\":\"GlyphRenderer\"},{\"id\":\"bf18634f-f652-4f19-a9c1-e5faa2c683b6\",\"type\":\"GlyphRenderer\"},{\"id\":\"c7ce7a8c-3d2b-4394-b49c-535e4d395ab0\",\"type\":\"GlyphRenderer\"},{\"id\":\"d255b64a-f115-4012-98de-40d345748752\",\"type\":\"GlyphRenderer\"},{\"id\":\"0c8b9cca-c53d-4f25-9c48-d03d2c50066a\",\"type\":\"GlyphRenderer\"},{\"id\":\"c866d2ab-9aa9-461d-9e78-89525dd68ee4\",\"type\":\"GlyphRenderer\"},{\"id\":\"275ab3bb-cb9e-4905-8ad1-c558a4c07bf8\",\"type\":\"GlyphRenderer\"},{\"id\":\"bfc6fd8e-e392-4f3f-9e15-09df1a50d4ac\",\"type\":\"Legend\"},{\"id\":\"cb364ef2-7472-4e11-8230-b4048797245d\",\"type\":\"LinearAxis\"},{\"id\":\"058903ad-02b5-4b40-9478-6083a17117a9\",\"type\":\"LinearAxis\"},{\"id\":\"64c63ddf-7452-4e7a-b166-5ab2ffd3d108\",\"type\":\"Grid\"},{\"id\":\"213a3cb0-632b-4815-96ce-743973489435\",\"type\":\"Grid\"}],\"title\":{\"id\":\"b0abdd90-96ff-421f-ad7c-8f88e4a235aa\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"3f80aaf0-be52-4ffc-8126-5ad41d7157f6\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"3c7a3891-9cd4-4252-ac71-cd1498dbad46\",\"type\":\"Toolbar\"},\"x_mapper_type\":\"auto\",\"x_range\":{\"id\":\"3f21511f-cd7b-4547-99e8-2cfe953076d1\",\"type\":\"Range1d\"},\"y_mapper_type\":\"auto\",\"y_range\":{\"id\":\"4b246214-9827-48d4-9974-86aed78f57bd\",\"type\":\"Range1d\"}},\"id\":\"d6b1001a-0426-4b50-ba16-500c0c7f0593\",\"subtype\":\"Chart\",\"type\":\"Plot\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\",\"Welfare\"],\"chart_index\":[{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"},{\"Sector\":\"Welfare\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[6.43,7.18,7.62,8.25,8.55,8.2,8.14,7.76,7.06,5.91,6.05,5.65,5.51,5.75,6.15,6.22,6.14,5.94,6.3,7.14,7.38,7.12,7.25,6.97,6.48,6.23,6.02,5.82]}},\"id\":\"be3e38d2-7666-443e-8f13-c81f827710b4\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\",\"Defence\"],\"chart_index\":[{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"},{\"Sector\":\"Defence\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[4.09,4.08,4.18,4.02,3.76,3.49,3.16,3.02,2.77,2.88,2.85,2.92,2.64,2.63,2.7,2.66,2.65,2.6,2.67,2.94,2.84,2.85,2.71,2.5,2.51,2.47,2.39,2.35]}},\"id\":\"61a9b235-7f54-4cae-b191-2bd9b44151ef\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\",\"Health Care\"],\"chart_index\":[{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"},{\"Sector\":\"Health Care\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[4.3,4.59,5.02,5.35,5.34,5.52,5.07,4.98,4.91,5.06,5.08,5.32,5.57,5.81,6.23,6.61,6.74,6.74,7.14,7.8,7.79,7.61,7.44,7.41,7.37,7.31,7.4,7.34]}},\"id\":\"fa36328c-e892-4170-86da-74bd3dc82713\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"a1be6d50-41b7-4490-8219-a40ac5ce3d32\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"d7d75ff6-8954-4a12-942a-d4d2b75ab8d5\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"bf18634f-f652-4f19-a9c1-e5faa2c683b6\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"overlay\":{\"id\":\"7791feda-ffa8-470e-b8c2-062bbe1ff004\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"d6b1001a-0426-4b50-ba16-500c0c7f0593\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"c17e7e2c-5c66-4e9d-b70f-ba094ccd2f9c\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"label\":{\"value\":\"Other Spending\"},\"renderers\":[{\"id\":\"c7ce7a8c-3d2b-4394-b49c-535e4d395ab0\",\"type\":\"GlyphRenderer\"}]},\"id\":\"b7c4927b-cd3a-43df-b195-c90873b71bc4\",\"type\":\"LegendItem\"},{\"attributes\":{\"line_color\":{\"value\":\"#8dd3c7\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"93491033-c486-4362-867d-84576ce1d8eb\",\"type\":\"Line\"},{\"attributes\":{\"line_color\":{\"value\":\"#bebada\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"330fd1ae-f25b-4ced-bf76-1826ccfa2bcc\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"2558f7f0-e7f7-4a4e-be7f-9617064ede28\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"be3e38d2-7666-443e-8f13-c81f827710b4\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"fb32390b-1da6-4329-8d7b-451a5e50e6fc\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"275ab3bb-cb9e-4905-8ad1-c558a4c07bf8\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\",\"Interest\"],\"chart_index\":[{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"},{\"Sector\":\"Interest\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[3.3,3.11,2.7,3.25,3.0,3.68,3.85,3.8,3.37,3.15,2.59,2.58,2.08,1.86,1.87,1.94,1.98,2.0,2.14,2.25,2.04,3.0,3.09,2.94,2.8,2.51,2.44,2.5]}},\"id\":\"a1be6d50-41b7-4490-8219-a40ac5ce3d32\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\",\"Pensions\"],\"chart_index\":[{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"},{\"Sector\":\"Pensions\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[4.2,4.5,4.52,5.28,5.96,5.64,5.81,5.96,5.92,6.66,6.73,7.18,7.28,7.01,6.8,6.88,6.76,6.68,6.89,7.79,7.76,7.74,7.96,8.3,8.14,8.18,8.25,8.07]}},\"id\":\"357e9d83-5c93-4bab-b7ae-610ae2979cde\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\",\"Transport\"],\"chart_index\":[{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"},{\"Sector\":\"Transport\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[1.19,1.39,1.49,1.16,0.77,0.99,0.61,0.57,0.95,0.91,0.9,0.9,1.05,1.3,1.35,1.28,1.28,1.41,1.43,1.5,1.53,1.36,1.19,1.1,1.09,1.11,1.4,1.45]}},\"id\":\"a66f774c-f5cf-448d-9a26-be9541493394\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"Sector\":[\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\",\"Other Spending\"],\"chart_index\":[{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"},{\"Sector\":\"Other Spending\"}],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[4.96,4.99,4.76,3.3,4.23,3.7,4.68,4.16,4.27,3.91,3.39,3.84,4.1,4.6,4.49,5.03,5.17,5.17,5.18,6.52,6.29,6.8,6.5,7.19,6.75,6.41,5.82,6.05]}},\"id\":\"b6e9051b-f8b4-43ca-8c4e-7065a83e01e6\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"line_color\":{\"value\":\"#fccde5\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"c78b14b8-a402-40e4-9e31-ba4289491b7b\",\"type\":\"Line\"},{\"attributes\":{\"label\":{\"value\":\"Pensions\"},\"renderers\":[{\"id\":\"d255b64a-f115-4012-98de-40d345748752\",\"type\":\"GlyphRenderer\"}]},\"id\":\"493554fc-73c8-4594-b335-ebee52f7e31a\",\"type\":\"LegendItem\"},{\"attributes\":{\"plot\":{\"id\":\"d6b1001a-0426-4b50-ba16-500c0c7f0593\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"e473d6df-5396-4368-9986-da261a656b39\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"label\":{\"value\":\"General Government\"},\"renderers\":[{\"id\":\"ce1a74c2-3d66-4dba-a908-9fb06076af9d\",\"type\":\"GlyphRenderer\"}]},\"id\":\"05354bcb-9abb-4290-b3f1-0222587c470b\",\"type\":\"LegendItem\"},{\"attributes\":{\"label\":{\"value\":\"Welfare\"},\"renderers\":[{\"id\":\"275ab3bb-cb9e-4905-8ad1-c558a4c07bf8\",\"type\":\"GlyphRenderer\"}]},\"id\":\"d86ee927-716f-4739-8fe8-8f416f66e24b\",\"type\":\"LegendItem\"},{\"attributes\":{\"plot\":{\"id\":\"d6b1001a-0426-4b50-ba16-500c0c7f0593\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"2d3bbc9e-9457-4222-9311-85613e95b307\",\"type\":\"ResetTool\"},{\"attributes\":{\"line_color\":{\"value\":\"#d9d9d9\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"65e84068-9141-4070-aba5-e2582fed956f\",\"type\":\"Line\"},{\"attributes\":{\"line_color\":{\"value\":\"#fdb462\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"358193f7-2815-4960-abe2-f00fb0a8c5a2\",\"type\":\"Line\"},{\"attributes\":{\"label\":{\"value\":\"Protection\"},\"renderers\":[{\"id\":\"0c8b9cca-c53d-4f25-9c48-d03d2c50066a\",\"type\":\"GlyphRenderer\"}]},\"id\":\"89dd73a6-4ace-48be-bc75-a7b50b411c6a\",\"type\":\"LegendItem\"},{\"attributes\":{\"data_source\":{\"id\":\"30e4616e-4fbe-4320-b1f8-c21b5c62dc22\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"f56be7fc-aa60-4f4e-8aad-fe9e8ef4d07b\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"4839b5b1-cab7-43b6-b268-286735c21a11\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis_label\":\"Year\",\"formatter\":{\"id\":\"2558f7f0-e7f7-4a4e-be7f-9617064ede28\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"d6b1001a-0426-4b50-ba16-500c0c7f0593\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"f8a36eea-38fc-4479-a3f9-1f1e6acff5f4\",\"type\":\"BasicTicker\"}},\"id\":\"cb364ef2-7472-4e11-8230-b4048797245d\",\"type\":\"LinearAxis\"},{\"attributes\":{\"line_color\":{\"value\":\"#bc80bd\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"fb32390b-1da6-4329-8d7b-451a5e50e6fc\",\"type\":\"Line\"}],\"root_ids\":[\"d6b1001a-0426-4b50-ba16-500c0c7f0593\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.3\"}};\n",
" var render_items = [{\"docid\":\"5446041b-307b-4231-aabd-9b2d06c168e5\",\"elementid\":\"f86e1d8c-fe3a-4bec-b8a3-605dfbbf7a1b\",\"modelid\":\"d6b1001a-0426-4b50-ba16-500c0c7f0593\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (!force) {\n",
" var cell = $(\"#f86e1d8c-fe3a-4bec-b8a3-605dfbbf7a1b\").parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
" \n",
" }\n",
" \n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
" }(this));\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"show(Line(d, x='Year', y='Total_gdp', color='Sector',\n",
" legend='top_left', palette=palette,\n",
" ylabel=label_tot_gdp,\n",
" title='Spending by sector, normalized by GDP'))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This shows much the same story as the distribution of spending above, apart from a few interesting details since 2010, where increasing GDP has made some apparent increases less marked. The increase in spending on pensions looks much less dramatic, and spending on healthcare is in fact *decreasing* in this representation."
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"plotdiv\" id=\"e02e2f46-1c56-4cfc-896b-83997380aa40\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = \"\";\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_timeout = Date.now() + 0;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
" \n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
" \n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" Bokeh.$(\"#e02e2f46-1c56-4cfc-896b-83997380aa40\").text(\"BokehJS successfully loaded.\");\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
" \n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
" \n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"e02e2f46-1c56-4cfc-896b-83997380aa40\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'e02e2f46-1c56-4cfc-896b-83997380aa40' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
" \n",
" var js_urls = [];\n",
" \n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.$(function() {\n",
" var docs_json = {\"3d0cf97d-95a5-4e11-8c6a-0530ca7623c6\":{\"roots\":{\"references\":[{\"attributes\":{\"axis_label\":\"Spending / percentage of year's GDP\",\"formatter\":{\"id\":\"c779d10a-0f73-4f9c-92d4-16b253e2bee0\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"21b7f080-6346-4f37-8d61-5599fc530fce\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"75832c11-e7bd-4189-a1de-7269ff9fe585\",\"type\":\"BasicTicker\"}},\"id\":\"0cc1dc23-1a0d-4a28-aef8-65a928260dec\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"9db8abb1-ba1c-40da-b5b2-fc7edcb4a95c\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"53f9d4ef-b0a7-46e4-b5ca-e914196d5558\",\"type\":\"PanTool\"},{\"id\":\"c659fbba-7311-4577-8d80-67b5c7e75e49\",\"type\":\"WheelZoomTool\"},{\"id\":\"54efd377-f46f-4fc9-9afd-f17b2ac255d3\",\"type\":\"BoxZoomTool\"},{\"id\":\"339e6073-6f3b-42cc-b104-581c63e90699\",\"type\":\"SaveTool\"},{\"id\":\"1727eb95-a513-4dba-a6a4-2d141ae76b07\",\"type\":\"ResetTool\"},{\"id\":\"91d90beb-ec93-46b8-8937-54f673913684\",\"type\":\"HelpTool\"}]},\"id\":\"7a369fce-334b-492f-9ae5-87ffad35aadb\",\"type\":\"Toolbar\"},{\"attributes\":{\"line_color\":{\"value\":\"#8dd3c7\"},\"line_width\":{\"value\":2},\"x\":{\"field\":\"x_values\"},\"y\":{\"field\":\"y_values\"}},\"id\":\"f0c24e06-870f-4078-b5a7-823c04826092\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"c779d10a-0f73-4f9c-92d4-16b253e2bee0\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":null,\"text\":\"Trend in spending, normalized by GDP\"},\"id\":\"ffeb3108-a33b-4b4e-96fa-a9e7d67e6932\",\"type\":\"Title\"},{\"attributes\":{\"overlay\":{\"id\":\"5cb9e569-2dcb-4db7-90b3-538239b8b5bb\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"21b7f080-6346-4f37-8d61-5599fc530fce\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"54efd377-f46f-4fc9-9afd-f17b2ac255d3\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"axis_label\":\"index\",\"formatter\":{\"id\":\"9db8abb1-ba1c-40da-b5b2-fc7edcb4a95c\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"21b7f080-6346-4f37-8d61-5599fc530fce\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"ec9201e9-3266-430d-acab-9341b7629e07\",\"type\":\"BasicTicker\"}},\"id\":\"a3c7cd67-54ec-4dfc-b62b-3c606e15cb02\",\"type\":\"LinearAxis\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"5cb9e569-2dcb-4db7-90b3-538239b8b5bb\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"plot\":{\"id\":\"21b7f080-6346-4f37-8d61-5599fc530fce\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"ec9201e9-3266-430d-acab-9341b7629e07\",\"type\":\"BasicTicker\"}},\"id\":\"d36497f9-d219-4d0c-bc56-1f898c7f482a\",\"type\":\"Grid\"},{\"attributes\":{\"data_source\":{\"id\":\"334807bd-c5ef-4809-a840-73bc93166166\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"f0c24e06-870f-4078-b5a7-823c04826092\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"69ab8537-c899-4a56-8c22-a14e8baf165b\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":{\"id\":\"21b7f080-6346-4f37-8d61-5599fc530fce\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"91d90beb-ec93-46b8-8937-54f673913684\",\"type\":\"HelpTool\"},{\"attributes\":{\"callback\":null,\"end\":46.532,\"start\":33.788},\"id\":\"f2d2bf45-fdde-47cc-b835-b375127cb46a\",\"type\":\"Range1d\"},{\"attributes\":{\"plot\":{\"id\":\"21b7f080-6346-4f37-8d61-5599fc530fce\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"339e6073-6f3b-42cc-b104-581c63e90699\",\"type\":\"SaveTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"x_values\",\"y_values\"],\"data\":{\"chart_index\":[{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"},{\"series\":\"Total_gdp\"}],\"series\":[\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\",\"Total_gdp\"],\"x_values\":[1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017],\"y_values\":[35.78,37.36,37.879999999999995,38.59,39.44,38.980000000000004,38.66,37.09,36.27,35.75,34.849999999999994,35.769999999999996,36.18,36.9,37.85000000000001,39.21,39.4,39.07999999999999,40.61,45.47,44.86000000000001,45.349999999999994,44.26,44.09,42.46000000000001,41.25999999999999,40.540000000000006,40.27]}},\"id\":\"334807bd-c5ef-4809-a840-73bc93166166\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"ec9201e9-3266-430d-acab-9341b7629e07\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"75832c11-e7bd-4189-a1de-7269ff9fe585\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"21b7f080-6346-4f37-8d61-5599fc530fce\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"53f9d4ef-b0a7-46e4-b5ca-e914196d5558\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"01b7b458-cfa4-4dbd-9862-96d1834041b7\",\"type\":\"ToolEvents\"},{\"attributes\":{\"callback\":null,\"end\":2019.7,\"start\":1987.3},\"id\":\"ddda5c90-0348-4d13-b4fb-59be1dc493be\",\"type\":\"Range1d\"},{\"attributes\":{\"below\":[{\"id\":\"a3c7cd67-54ec-4dfc-b62b-3c606e15cb02\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"0cc1dc23-1a0d-4a28-aef8-65a928260dec\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"5cb9e569-2dcb-4db7-90b3-538239b8b5bb\",\"type\":\"BoxAnnotation\"},{\"id\":\"69ab8537-c899-4a56-8c22-a14e8baf165b\",\"type\":\"GlyphRenderer\"},{\"id\":\"a3c7cd67-54ec-4dfc-b62b-3c606e15cb02\",\"type\":\"LinearAxis\"},{\"id\":\"0cc1dc23-1a0d-4a28-aef8-65a928260dec\",\"type\":\"LinearAxis\"},{\"id\":\"d36497f9-d219-4d0c-bc56-1f898c7f482a\",\"type\":\"Grid\"},{\"id\":\"de1011a1-35fd-4ca2-a784-68b6f3c77dab\",\"type\":\"Grid\"}],\"title\":{\"id\":\"ffeb3108-a33b-4b4e-96fa-a9e7d67e6932\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"01b7b458-cfa4-4dbd-9862-96d1834041b7\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"7a369fce-334b-492f-9ae5-87ffad35aadb\",\"type\":\"Toolbar\"},\"x_mapper_type\":\"auto\",\"x_range\":{\"id\":\"ddda5c90-0348-4d13-b4fb-59be1dc493be\",\"type\":\"Range1d\"},\"y_mapper_type\":\"auto\",\"y_range\":{\"id\":\"f2d2bf45-fdde-47cc-b835-b375127cb46a\",\"type\":\"Range1d\"}},\"id\":\"21b7f080-6346-4f37-8d61-5599fc530fce\",\"subtype\":\"Chart\",\"type\":\"Plot\"},{\"attributes\":{\"plot\":{\"id\":\"21b7f080-6346-4f37-8d61-5599fc530fce\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"1727eb95-a513-4dba-a6a4-2d141ae76b07\",\"type\":\"ResetTool\"},{\"attributes\":{\"plot\":{\"id\":\"21b7f080-6346-4f37-8d61-5599fc530fce\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"c659fbba-7311-4577-8d80-67b5c7e75e49\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"21b7f080-6346-4f37-8d61-5599fc530fce\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"75832c11-e7bd-4189-a1de-7269ff9fe585\",\"type\":\"BasicTicker\"}},\"id\":\"de1011a1-35fd-4ca2-a784-68b6f3c77dab\",\"type\":\"Grid\"}],\"root_ids\":[\"21b7f080-6346-4f37-8d61-5599fc530fce\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.3\"}};\n",
" var render_items = [{\"docid\":\"3d0cf97d-95a5-4e11-8c6a-0530ca7623c6\",\"elementid\":\"e02e2f46-1c56-4cfc-896b-83997380aa40\",\"modelid\":\"21b7f080-6346-4f37-8d61-5599fc530fce\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (!force) {\n",
" var cell = $(\"#e02e2f46-1c56-4cfc-896b-83997380aa40\").parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
" \n",
" }\n",
" \n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
" }(this));\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"d_tot_gdp = d.groupby('Year').Total_gdp.sum()\n",
"show(Line(d_tot_gdp, legend=False, ylabel=label_tot_gdp,\n",
" title='Trend in spending, normalized by GDP',\n",
" palette=palette))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In this representation, the story of total government spending changes completely. The increase in inflation-adjusted spending since 2014 looks to be a result of increasing GDP, and in fact has been continually decreasing since 2011. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Getting more granular data: to the source\n",
"\n",
"As good as Christopher's data is, I'd like to minimise the number of steps between the data source and my analysis.\n",
"The original data is kindly provided categorised according to the one designed by the United Nations (UN), the 'Classification of the Functions of Government' (COFOG). Sticking to this system, unaware as it may be of the exact makeup of the British government, will allow me in future to compare with other countries, and is robust to changes in department structures.\n",
"\n",
"So let's grab the Excel table from PESA, and parse it into a format suitable for analysis. The code below is very hacky and not at all beautiful, because the table itself does not communicate well with machines."
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from io import BytesIO\n",
"\n",
"pesa_url = 'https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/539471/PESA_2016_Chapter_5_tables.xlsx'\n",
"pesa_response = requests.get(pesa_url)\n",
"# This BytesIO class lets me make a byte-string look like a file stream,\n",
"# which is what Pandas expects.\n",
"d_pesa = pd.read_excel(BytesIO(pesa_response.content),\n",
" sheetname='5.2', index_col=None, skiprows=4)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# Remove pointless empty first column.\n",
"d_pesa = d_pesa.drop('Unnamed: 0', axis=1)\n",
"# Drop a silly row beneath year indicator.\n",
"d_pesa = d_pesa.drop(0)\n",
"# Give Section column a meaningful name.\n",
"d_pesa = d_pesa.rename(columns={'Unnamed: 1': 'Section'})\n",
"# Rename year columns from start-end, to just starting year.\n",
"for c in d_pesa.columns[1:]:\n",
" d_pesa.rename(columns={c: int(c.split('-')[0])}, inplace=True)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import re\n",
"\n",
"def strip_notes(s):\n",
" m = re.search(' \\([0-9]+\\)', s)\n",
" if m is not None:\n",
" s = s[:m.start()]\n",
" return s\n",
"\n",
"# Parse out function-level names and numbers from section dividers.\n",
"is_function_head = ((d_pesa.Section.str.contains(r'^[0-9]+\\. ') == True) &\n",
" ~(d_pesa.Section.str.contains('continued') == True))\n",
"def get_first(x):\n",
" function_name = ' '.join(x[1:])\n",
" function_name = strip_notes(function_name)\n",
" return pd.Series({'function_nr': int(x[0][:-1]),\n",
" 'function_name': function_name})\n",
"function_names = d_pesa.Section[is_function_head].str.split(' ').apply(get_first)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Unpivot each year as one column, into one column indicating the year.\n",
"d_pesa_melt = pd.melt(d_pesa, id_vars=['Section'],\n",
" var_name='Year', value_name='Amount')\n",
"d_pesa_melt.loc[:, 'Year'] = d_pesa_melt.Year.astype(int)"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# This is a bag of poo because of the government's poo data.\n",
"# The health sub-function rows are not labelled with COFOG categories,\n",
"# so match them with these, insensitive of case.\n",
"cofog_map = {\n",
" 'medical services': [7, 3],\n",
" 'health services': [7, 4],\n",
" 'medical research': [7, 5],\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Get sub-function level amount rows, where the actual amounts are.\n",
"is_sub_function = d_pesa_melt.Section.str.contains(r'^[0-9]+\\.[0-9]+ ') == True\n",
"# Account for bad health rows.\n",
"for k in cofog_map:\n",
" is_sub_function |= d_pesa_melt.Section.str.contains(k, case=False) == True\n",
"d_pesa_body = d_pesa_melt.loc[is_sub_function]"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/ejm/.virtualenvs/foley_env/lib/python3.5/site-packages/pandas/core/indexing.py:296: SettingWithCopyWarning: \n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
" self.obj[key] = _infer_fill_value(value)\n",
"/Users/ejm/.virtualenvs/foley_env/lib/python3.5/site-packages/pandas/core/indexing.py:476: SettingWithCopyWarning: \n",
"A value is trying to be set on a copy of a slice from a DataFrame.\n",
"Try using .loc[row_indexer,col_indexer] = value instead\n",
"\n",
"See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy\n",
" self.obj[item] = s\n"
]
}
],
"source": [
"def get_cofog_entry(s):\n",
" for k in cofog_map:\n",
" if k in s.lower():\n",
" return cofog_map[k]\n",
" \n",
"\n",
"# Parse the function and sub-function numbers from the 'x.y ' section start,\n",
"# and sub-function name from remainder.\n",
"def section_to_function_nr(s):\n",
" cofog_entry = get_cofog_entry(s)\n",
" if cofog_entry is not None:\n",
" return cofog_entry[0]\n",
" else:\n",
" return int(s.split('.')[0])\n",
"\n",
"\n",
"def section_to_sub_function_nr(s):\n",
" cofog_entry = get_cofog_entry(s)\n",
" if cofog_entry is not None:\n",
" return cofog_entry[1]\n",
" else:\n",
" s_cofog = s.split(' ')[0]\n",
" return int(s_cofog.split('.')[1])\n",
"\n",
"def section_to_sub_function_name(s):\n",
" cofog_entry = get_cofog_entry(s)\n",
" if cofog_entry is not None:\n",
" return s\n",
" else:\n",
" name = ' '.join(s.split(' ')[1:])\n",
" name = strip_notes(name)\n",
" return name\n",
"\n",
"d_pesa_body.loc[:, 'function_nr'] = d_pesa_body.Section.apply(section_to_function_nr)\n",
"d_pesa_body.loc[:, 'sub_function_nr'] = d_pesa_body.Section.apply(section_to_sub_function_nr)\n",
"d_pesa_body.loc[:, 'sub_function_name'] = d_pesa_body.Section.apply(section_to_sub_function_name)\n",
"\n",
"# Drop section column as its information is contained in other columns.\n",
"# And merge in function name information from earlier.\n",
"d_pesa_body = d_pesa_body.drop('Section', axis=1).merge(function_names,\n",
" on='function_nr')"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Replace '-' entries for zero with actual zero values, and then convert to float.\n",
"# I'd like to do this earlier, but only now can we trust the rows are fairly sane.\n",
"d_pesa_body.loc[d_pesa_body.Amount == '-', 'Amount'] = 0.0\n",
"d_pesa_body.Amount = d_pesa_body.Amount.astype(pd.np.float)\n",
"# Convert to billions, because that is enough detail for what we want.\n",
"d_pesa_body.loc[:, 'Amount'] /= 1000.0\n",
"\n",
"# Make later referencing easier.\n",
"dp = d_pesa_body"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To give you an idea of the COFOG top-level functions, here's a breakdown of 2015."
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"plotdiv\" id=\"4681f3d8-b42d-45af-9db8-ff14a1c83f7d\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = \"\";\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_timeout = Date.now() + 0;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
" \n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
" \n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" Bokeh.$(\"#4681f3d8-b42d-45af-9db8-ff14a1c83f7d\").text(\"BokehJS successfully loaded.\");\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
" \n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
" \n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"4681f3d8-b42d-45af-9db8-ff14a1c83f7d\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid '4681f3d8-b42d-45af-9db8-ff14a1c83f7d' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
" \n",
" var js_urls = [];\n",
" \n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.$(function() {\n",
" var docs_json = {\"9c71d41d-080b-4509-b2d5-0472d1a16ae5\":{\"roots\":{\"references\":[{\"attributes\":{\"data_source\":{\"id\":\"55b27d63-4bb2-4827-9d21-0aa55a1117d0\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"9e915e76-beef-4253-b6e6-3cbd1944c78f\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"3fb258e8-09ed-4b55-bf7f-64edeefcc78b\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"66cd0b6d-0443-47d7-8484-9662193cb9f0\",\"type\":\"Rect\"},{\"attributes\":{\"data_source\":{\"id\":\"8a7f0fdd-b4dc-404c-948b-6b665d2f6eca\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"d43473bf-84a2-4640-8252-4cfe9e719a66\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"90a4ebe0-bbcf-417b-a35e-a7fe68b0a338\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"factors\":[\"Defence\",\"Economic affairs\",\"Education\",\"Environment protection\",\"General public services\",\"Health\",\"Housing and community amenities\",\"Public order and safety\",\"Recreation, culture and religion\",\"Social protection\"]},\"id\":\"501cac68-2d2f-4d4d-96e3-c8462bf97911\",\"type\":\"FactorRange\"},{\"attributes\":{\"data_source\":{\"id\":\"184816ac-5ef9-420c-8f72-74a4907eacca\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"6ece1972-12cc-4f67-a5cd-3c5de6bbe187\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"9c109560-7e51-4817-a828-aca7c944786f\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"9b632eeb-56fe-4e4b-af42-cbc8b7eb50c5\",\"type\":\"Rect\"},{\"attributes\":{},\"id\":\"14822c46-1b47-481f-b453-cf7e5a994499\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"function_name\":\"Housing and community amenities\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"function_name\":[\"Housing and community amenities\"],\"height\":[10.014],\"label\":[{\"function_name\":\"Housing and community amenities\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Housing and community amenities\"],\"y\":[5.007]}},\"id\":\"55b27d63-4bb2-4827-9d21-0aa55a1117d0\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"1b7c7fdd-cbae-4e16-82e7-fa488815d2b6\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"f50985a1-f3b1-47f7-a699-fa0f86c9e85d\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"3211b940-3cb6-4456-b285-718001f3baa2\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":{\"id\":\"eb86398b-a746-43dd-980c-a7d2de2e7fd1\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"e1325fe4-32ec-4ea7-adfe-96829efce623\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"a6eb53e9-e5e9-4773-a311-cb6911dfb2e6\",\"type\":\"ToolEvents\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"f50985a1-f3b1-47f7-a699-fa0f86c9e85d\",\"type\":\"Rect\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"eb86398b-a746-43dd-980c-a7d2de2e7fd1\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"ac3197f3-e62e-46bd-8f97-7be4d125fca9\",\"type\":\"BasicTicker\"}},\"id\":\"e122392c-f89f-41dd-ab2a-c2fb6468ecc1\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"209f5bbd-5975-4434-8169-85cfde4eca25\",\"type\":\"Rect\"},{\"attributes\":{},\"id\":\"ac3197f3-e62e-46bd-8f97-7be4d125fca9\",\"type\":\"BasicTicker\"},{\"attributes\":{\"axis_label\":\"Government function\",\"formatter\":{\"id\":\"efb2fe0c-89b9-4245-b118-e4371af95d84\",\"type\":\"CategoricalTickFormatter\"},\"major_label_orientation\":0.7853981633974483,\"plot\":{\"id\":\"eb86398b-a746-43dd-980c-a7d2de2e7fd1\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"14822c46-1b47-481f-b453-cf7e5a994499\",\"type\":\"CategoricalTicker\"}},\"id\":\"929833e9-c74d-4375-8ea9-c4c92232ab7a\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"6ece1972-12cc-4f67-a5cd-3c5de6bbe187\",\"type\":\"Rect\"},{\"attributes\":{\"callback\":null,\"end\":277.3575},\"id\":\"1c0d6bbe-1e8a-470a-85ae-d9ccbafd9dd0\",\"type\":\"Range1d\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"function_name\":\"Defence\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"function_name\":[\"Defence\"],\"height\":[36.646],\"label\":[{\"function_name\":\"Defence\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Defence\"],\"y\":[18.323]}},\"id\":\"2d136b39-620f-4547-b256-0f9be04f3522\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"eb86398b-a746-43dd-980c-a7d2de2e7fd1\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"f7fed8a4-1349-4d50-87ca-272c4370094a\",\"type\":\"HelpTool\"},{\"attributes\":{\"data_source\":{\"id\":\"8897bef9-4da6-4ec0-8b66-3ff64c0f66a6\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"66cd0b6d-0443-47d7-8484-9662193cb9f0\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"88f03715-4b18-4a48-9d0c-2d094fce154f\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"b3792138-d8ba-45a9-988f-c5373f5537a3\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"917d2988-9c15-4784-a8d8-8c1b1d2d0b56\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"2aaf5c24-9565-4549-b3bc-1f35bbfcd21e\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"b4b08a66-05b6-46d7-a964-deed5ab85c59\",\"type\":\"PanTool\"},{\"id\":\"e1325fe4-32ec-4ea7-adfe-96829efce623\",\"type\":\"WheelZoomTool\"},{\"id\":\"c0fb2722-40f7-47a5-bc1e-cf7a1efe6001\",\"type\":\"BoxZoomTool\"},{\"id\":\"bbca1a82-aa08-4e1e-a145-e43a15b26619\",\"type\":\"SaveTool\"},{\"id\":\"3d37f55c-bc57-436a-9935-2d8f8a33c7ea\",\"type\":\"ResetTool\"},{\"id\":\"f7fed8a4-1349-4d50-87ca-272c4370094a\",\"type\":\"HelpTool\"}]},\"id\":\"e48f0f43-0620-4f59-add1-95c41a75e587\",\"type\":\"Toolbar\"},{\"attributes\":{\"data_source\":{\"id\":\"2d136b39-620f-4547-b256-0f9be04f3522\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"266002fa-a89e-488d-88b3-3bea9a7311a6\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"a5de8789-316b-4c63-be44-312e3c72ae96\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"9e915e76-beef-4253-b6e6-3cbd1944c78f\",\"type\":\"Rect\"},{\"attributes\":{\"plot\":null,\"text\":null},\"id\":\"9efdeba1-5c0d-4511-9b34-168f185c7fd9\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"function_name\":\"Economic affairs\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"function_name\":[\"Economic affairs\"],\"height\":[45.132],\"label\":[{\"function_name\":\"Economic affairs\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Economic affairs\"],\"y\":[22.566]}},\"id\":\"b3792138-d8ba-45a9-988f-c5373f5537a3\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"8c90b2e4-a9f8-47ea-9956-568a59b3f54e\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"209f5bbd-5975-4434-8169-85cfde4eca25\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"d66ccdff-a9f4-4506-952b-84edb8b7f611\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"c73e6bc7-ac8c-435d-a11f-705b2d53c053\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2cde5637-71d2-4b10-8d82-4a213c175c4a\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"45aa3a19-7b69-4ad7-87b4-998ba3033793\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"266002fa-a89e-488d-88b3-3bea9a7311a6\",\"type\":\"Rect\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"function_name\":\"Education\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"function_name\":[\"Education\"],\"height\":[84.02699999999999],\"label\":[{\"function_name\":\"Education\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Education\"],\"y\":[42.01349999999999]}},\"id\":\"184816ac-5ef9-420c-8f72-74a4907eacca\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"eb86398b-a746-43dd-980c-a7d2de2e7fd1\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"b4b08a66-05b6-46d7-a964-deed5ab85c59\",\"type\":\"PanTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"function_name\":\"Social protection\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"function_name\":[\"Social protection\"],\"height\":[264.15000000000003],\"label\":[{\"function_name\":\"Social protection\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Social protection\"],\"y\":[132.07500000000002]}},\"id\":\"8897bef9-4da6-4ec0-8b66-3ff64c0f66a6\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1b7ff661-9453-4276-875e-a66f07d1f6e4\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"function_name\":\"Public order and safety\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"function_name\":[\"Public order and safety\"],\"height\":[30.183],\"label\":[{\"function_name\":\"Public order and safety\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Public order and safety\"],\"y\":[15.0915]}},\"id\":\"b449a206-5fa7-43ff-a4c2-cf4adbc4b482\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"efb2fe0c-89b9-4245-b118-e4371af95d84\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2cde5637-71d2-4b10-8d82-4a213c175c4a\",\"type\":\"Rect\"},{\"attributes\":{\"plot\":{\"id\":\"eb86398b-a746-43dd-980c-a7d2de2e7fd1\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"bbca1a82-aa08-4e1e-a145-e43a15b26619\",\"type\":\"SaveTool\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"d43473bf-84a2-4640-8252-4cfe9e719a66\",\"type\":\"Rect\"},{\"attributes\":{},\"id\":\"5746c11c-3ebb-4e7a-823b-9e81ca1e20bd\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"b449a206-5fa7-43ff-a4c2-cf4adbc4b482\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"9b632eeb-56fe-4e4b-af42-cbc8b7eb50c5\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"0efa885c-c7f2-4818-9fdd-45feb0ce7901\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"below\":[{\"id\":\"929833e9-c74d-4375-8ea9-c4c92232ab7a\",\"type\":\"CategoricalAxis\"}],\"left\":[{\"id\":\"b2bbb1e9-831a-4bf6-84ef-7130d81d588a\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"1b7ff661-9453-4276-875e-a66f07d1f6e4\",\"type\":\"BoxAnnotation\"},{\"id\":\"45aa3a19-7b69-4ad7-87b4-998ba3033793\",\"type\":\"GlyphRenderer\"},{\"id\":\"a5de8789-316b-4c63-be44-312e3c72ae96\",\"type\":\"GlyphRenderer\"},{\"id\":\"0efa885c-c7f2-4818-9fdd-45feb0ce7901\",\"type\":\"GlyphRenderer\"},{\"id\":\"2aaf5c24-9565-4549-b3bc-1f35bbfcd21e\",\"type\":\"GlyphRenderer\"},{\"id\":\"d66ccdff-a9f4-4506-952b-84edb8b7f611\",\"type\":\"GlyphRenderer\"},{\"id\":\"3fb258e8-09ed-4b55-bf7f-64edeefcc78b\",\"type\":\"GlyphRenderer\"},{\"id\":\"90a4ebe0-bbcf-417b-a35e-a7fe68b0a338\",\"type\":\"GlyphRenderer\"},{\"id\":\"3211b940-3cb6-4456-b285-718001f3baa2\",\"type\":\"GlyphRenderer\"},{\"id\":\"9c109560-7e51-4817-a828-aca7c944786f\",\"type\":\"GlyphRenderer\"},{\"id\":\"88f03715-4b18-4a48-9d0c-2d094fce154f\",\"type\":\"GlyphRenderer\"},{\"id\":\"929833e9-c74d-4375-8ea9-c4c92232ab7a\",\"type\":\"CategoricalAxis\"},{\"id\":\"b2bbb1e9-831a-4bf6-84ef-7130d81d588a\",\"type\":\"LinearAxis\"},{\"id\":\"e122392c-f89f-41dd-ab2a-c2fb6468ecc1\",\"type\":\"Grid\"}],\"title\":{\"id\":\"9efdeba1-5c0d-4511-9b34-168f185c7fd9\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"a6eb53e9-e5e9-4773-a311-cb6911dfb2e6\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"e48f0f43-0620-4f59-add1-95c41a75e587\",\"type\":\"Toolbar\"},\"x_mapper_type\":\"auto\",\"x_range\":{\"id\":\"501cac68-2d2f-4d4d-96e3-c8462bf97911\",\"type\":\"FactorRange\"},\"y_mapper_type\":\"auto\",\"y_range\":{\"id\":\"1c0d6bbe-1e8a-470a-85ae-d9ccbafd9dd0\",\"type\":\"Range1d\"}},\"id\":\"eb86398b-a746-43dd-980c-a7d2de2e7fd1\",\"subtype\":\"Chart\",\"type\":\"Plot\"},{\"attributes\":{\"overlay\":{\"id\":\"1b7ff661-9453-4276-875e-a66f07d1f6e4\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"eb86398b-a746-43dd-980c-a7d2de2e7fd1\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"c0fb2722-40f7-47a5-bc1e-cf7a1efe6001\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"function_name\":\"Environment protection\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"function_name\":[\"Environment protection\"],\"height\":[11.608],\"label\":[{\"function_name\":\"Environment protection\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Environment protection\"],\"y\":[5.804]}},\"id\":\"8c90b2e4-a9f8-47ea-9956-568a59b3f54e\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"function_name\":\"General public services\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"function_name\":[\"General public services\"],\"height\":[58.708],\"label\":[{\"function_name\":\"General public services\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"General public services\"],\"y\":[29.354]}},\"id\":\"c73e6bc7-ac8c-435d-a11f-705b2d53c053\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"function_name\":\"Health\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"function_name\":[\"Health\"],\"height\":[138.705],\"label\":[{\"function_name\":\"Health\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Health\"],\"y\":[69.3525]}},\"id\":\"8a7f0fdd-b4dc-404c-948b-6b665d2f6eca\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"eb86398b-a746-43dd-980c-a7d2de2e7fd1\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"3d37f55c-bc57-436a-9935-2d8f8a33c7ea\",\"type\":\"ResetTool\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"917d2988-9c15-4784-a8d8-8c1b1d2d0b56\",\"type\":\"Rect\"},{\"attributes\":{\"axis_label\":\"Billions of pounds\",\"formatter\":{\"id\":\"5746c11c-3ebb-4e7a-823b-9e81ca1e20bd\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"eb86398b-a746-43dd-980c-a7d2de2e7fd1\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"ac3197f3-e62e-46bd-8f97-7be4d125fca9\",\"type\":\"BasicTicker\"}},\"id\":\"b2bbb1e9-831a-4bf6-84ef-7130d81d588a\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"function_name\":\"Recreation, culture and religion\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"function_name\":[\"Recreation, culture and religion\"],\"height\":[11.428],\"label\":[{\"function_name\":\"Recreation, culture and religion\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Recreation, culture and religion\"],\"y\":[5.714]}},\"id\":\"1b7c7fdd-cbae-4e16-82e7-fa488815d2b6\",\"type\":\"ColumnDataSource\"}],\"root_ids\":[\"eb86398b-a746-43dd-980c-a7d2de2e7fd1\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.3\"}};\n",
" var render_items = [{\"docid\":\"9c71d41d-080b-4509-b2d5-0472d1a16ae5\",\"elementid\":\"4681f3d8-b42d-45af-9db8-ff14a1c83f7d\",\"modelid\":\"eb86398b-a746-43dd-980c-a7d2de2e7fd1\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (!force) {\n",
" var cell = $(\"#4681f3d8-b42d-45af-9db8-ff14a1c83f7d\").parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
" \n",
" }\n",
" \n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
" }(this));\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"label_tot_alt = 'Billions of pounds'\n",
"\n",
"show(Bar(dp[dp.Year == 2015], label='function_name',\n",
" values='Amount', agg='sum', legend=False, palette=palette,\n",
" ylabel=label_tot_alt, xlabel='Government function'))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We can delve into so-called 'sub-functions'. Here are a few breakdowns. Be careful to note the axis limits: they aren't kept the same, as there are big variations in total spending, so remember that some breakdowns amount to small amounts, such as 'Recreation, culture and religion'."
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"plotdiv\" id=\"34af3c04-25e9-4e43-ab25-89e13369950f\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = \"\";\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_timeout = Date.now() + 0;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
" \n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
" \n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" Bokeh.$(\"#34af3c04-25e9-4e43-ab25-89e13369950f\").text(\"BokehJS successfully loaded.\");\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
" \n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
" \n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"34af3c04-25e9-4e43-ab25-89e13369950f\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid '34af3c04-25e9-4e43-ab25-89e13369950f' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
" \n",
" var js_urls = [];\n",
" \n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.$(function() {\n",
" var docs_json = {\"ed08e68a-5b67-431f-8c5d-5c6a56d23b4d\":{\"roots\":{\"references\":[{\"attributes\":{\"plot\":null,\"text\":\"General public services breakdown\"},\"id\":\"d48ddaec-ed0f-4a58-a0c4-6e24c76802b8\",\"type\":\"Title\"},{\"attributes\":{\"plot\":{\"id\":\"46449ade-85ea-46d7-afee-ef7bf60754b2\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"6d960ebc-9d52-4414-a4fd-94543d542210\",\"type\":\"SaveTool\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"91690fbc-d9ce-4f97-9d78-9bde22a4780a\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"981e70e8-46c9-49df-8fb0-948544762680\",\"type\":\"Rect\"},{\"attributes\":{\"overlay\":{\"id\":\"49d3b6ce-1862-4435-a6b9-7c64a723edd3\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"46449ade-85ea-46d7-afee-ef7bf60754b2\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"a825ee1c-aea9-4957-8e89-16208f7d3c32\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"data_source\":{\"id\":\"f99e9d3f-d8d5-4c3d-bac6-745d499f5f49\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"8278b49e-2e7c-41bf-81e5-7eaf0767bd99\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"adb9e346-edea-4957-8d0a-779092b346b4\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Public debt transactions\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[36.724],\"label\":[{\"sub_function_name\":\"Public debt transactions\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Public debt transactions\"],\"width\":[0.8],\"x\":[\"Public debt transactions\"],\"y\":[18.362]}},\"id\":\"e4a36dd5-5187-4c8f-9ee4-bd3026381f2a\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"factors\":[\"Basic research\",\"Executive and legislative organs, financial and fiscal affairs, external affairs\",\"Foreign economic aid\",\"General public services n.e.c.\",\"General services\",\"Public debt transactions\",\"R&D general public services\"]},\"id\":\"490115c6-c581-4a40-836f-379b7e22b62a\",\"type\":\"FactorRange\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"8278b49e-2e7c-41bf-81e5-7eaf0767bd99\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"55f1d33f-ebda-4521-8770-48ea09083448\",\"type\":\"Rect\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"General services\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[0.758],\"label\":[{\"sub_function_name\":\"General services\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"General services\"],\"width\":[0.8],\"x\":[\"General services\"],\"y\":[0.379]}},\"id\":\"0ecee859-21a4-429a-9e22-38d839cd8aea\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"929ebb9e-a2a7-4d39-a443-4ddd93f57e4c\",\"type\":\"PanTool\"},{\"id\":\"ca84527e-0bd1-498b-a40e-5ba162b1cac3\",\"type\":\"WheelZoomTool\"},{\"id\":\"a825ee1c-aea9-4957-8e89-16208f7d3c32\",\"type\":\"BoxZoomTool\"},{\"id\":\"6d960ebc-9d52-4414-a4fd-94543d542210\",\"type\":\"SaveTool\"},{\"id\":\"7b34b9dc-40eb-46ac-9b99-89ff3be46d72\",\"type\":\"ResetTool\"},{\"id\":\"e3da16dd-c189-4150-8a68-b13f91a2ef44\",\"type\":\"HelpTool\"}]},\"id\":\"8eeba454-a6b4-46c9-8be4-259caa58291b\",\"type\":\"Toolbar\"},{\"attributes\":{\"data_source\":{\"id\":\"6454ac9a-4274-48dc-8a90-f2602e47b217\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"91690fbc-d9ce-4f97-9d78-9bde22a4780a\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"f38c4a38-1a45-48ea-89fa-19ff00f9bb4b\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"9bf4cc13-5d88-428b-a565-4f5ba8c098ca\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"c1435b8b-8f76-4d3f-8a9b-7263f76fc8a0\",\"type\":\"Rect\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Basic research\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[0.0],\"label\":[{\"sub_function_name\":\"Basic research\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Basic research\"],\"width\":[0.8],\"x\":[\"Basic research\"],\"y\":[0.0]}},\"id\":\"6454ac9a-4274-48dc-8a90-f2602e47b217\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"end\":38.560199999999995},\"id\":\"0d4ef9af-aa9e-4b9d-9891-257b73d3a790\",\"type\":\"Range1d\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"General public services n.e.c.\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[2.535],\"label\":[{\"sub_function_name\":\"General public services n.e.c.\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"General public services n.e.c.\"],\"width\":[0.8],\"x\":[\"General public services n.e.c.\"],\"y\":[1.2675]}},\"id\":\"e98342ba-f8a2-4277-8446-166a51c389e9\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"e98342ba-f8a2-4277-8446-166a51c389e9\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"c1435b8b-8f76-4d3f-8a9b-7263f76fc8a0\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"15b5bd87-6081-48b2-a692-ed6c47921b51\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"7a5f08b2-aa56-4306-9553-06e30198428c\",\"type\":\"Rect\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"46449ade-85ea-46d7-afee-ef7bf60754b2\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"0531c379-97d0-4311-8d4c-c2b057f15761\",\"type\":\"BasicTicker\"}},\"id\":\"67a00111-8a64-4014-9565-032d547d1d7a\",\"type\":\"Grid\"},{\"attributes\":{\"plot\":{\"id\":\"46449ade-85ea-46d7-afee-ef7bf60754b2\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"ca84527e-0bd1-498b-a40e-5ba162b1cac3\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"axis_label\":\"Billions of pounds\",\"formatter\":{\"id\":\"1a91bb28-80af-4f21-af11-15560008a08b\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"46449ade-85ea-46d7-afee-ef7bf60754b2\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"0531c379-97d0-4311-8d4c-c2b057f15761\",\"type\":\"BasicTicker\"}},\"id\":\"c026a97b-533d-49a7-8afb-020f336da4e5\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"ad19770f-7516-4290-a49b-efcbe9b41071\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"9bf4cc13-5d88-428b-a565-4f5ba8c098ca\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"9be1a2ee-f6ff-4d58-b6e0-c1d384275115\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"1a91bb28-80af-4f21-af11-15560008a08b\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"49d3b6ce-1862-4435-a6b9-7c64a723edd3\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"data_source\":{\"id\":\"0ecee859-21a4-429a-9e22-38d839cd8aea\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"55f1d33f-ebda-4521-8770-48ea09083448\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"d9865588-27de-442e-bfd8-85fd48e71e16\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"df37c6cc-0448-42a6-9570-ba9d3d9e1f49\",\"type\":\"ToolEvents\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Foreign economic aid\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[8.173],\"label\":[{\"sub_function_name\":\"Foreign economic aid\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Foreign economic aid\"],\"width\":[0.8],\"x\":[\"Foreign economic aid\"],\"y\":[4.0865]}},\"id\":\"ad19770f-7516-4290-a49b-efcbe9b41071\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"below\":[{\"id\":\"c25521d3-eae5-4639-a61a-ee0be4707878\",\"type\":\"CategoricalAxis\"}],\"left\":[{\"id\":\"c026a97b-533d-49a7-8afb-020f336da4e5\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"49d3b6ce-1862-4435-a6b9-7c64a723edd3\",\"type\":\"BoxAnnotation\"},{\"id\":\"adb9e346-edea-4957-8d0a-779092b346b4\",\"type\":\"GlyphRenderer\"},{\"id\":\"9be1a2ee-f6ff-4d58-b6e0-c1d384275115\",\"type\":\"GlyphRenderer\"},{\"id\":\"d9865588-27de-442e-bfd8-85fd48e71e16\",\"type\":\"GlyphRenderer\"},{\"id\":\"f38c4a38-1a45-48ea-89fa-19ff00f9bb4b\",\"type\":\"GlyphRenderer\"},{\"id\":\"ee919a29-5cef-462f-901a-e06fda450120\",\"type\":\"GlyphRenderer\"},{\"id\":\"15b5bd87-6081-48b2-a692-ed6c47921b51\",\"type\":\"GlyphRenderer\"},{\"id\":\"f5376617-a314-46b9-8353-98e16ae2a1a6\",\"type\":\"GlyphRenderer\"},{\"id\":\"c25521d3-eae5-4639-a61a-ee0be4707878\",\"type\":\"CategoricalAxis\"},{\"id\":\"c026a97b-533d-49a7-8afb-020f336da4e5\",\"type\":\"LinearAxis\"},{\"id\":\"67a00111-8a64-4014-9565-032d547d1d7a\",\"type\":\"Grid\"}],\"title\":{\"id\":\"d48ddaec-ed0f-4a58-a0c4-6e24c76802b8\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"df37c6cc-0448-42a6-9570-ba9d3d9e1f49\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"8eeba454-a6b4-46c9-8be4-259caa58291b\",\"type\":\"Toolbar\"},\"x_mapper_type\":\"auto\",\"x_range\":{\"id\":\"490115c6-c581-4a40-836f-379b7e22b62a\",\"type\":\"FactorRange\"},\"y_mapper_type\":\"auto\",\"y_range\":{\"id\":\"0d4ef9af-aa9e-4b9d-9891-257b73d3a790\",\"type\":\"Range1d\"}},\"id\":\"46449ade-85ea-46d7-afee-ef7bf60754b2\",\"subtype\":\"Chart\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"bd35e690-c589-4020-a8db-efe6fbddc66c\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"R&D general public services\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[0.417],\"label\":[{\"sub_function_name\":\"R&D general public services\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"R&D general public services\"],\"width\":[0.8],\"x\":[\"R&D general public services\"],\"y\":[0.2085]}},\"id\":\"937ea490-a5b3-4406-ac0a-beeb946eab37\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"46449ade-85ea-46d7-afee-ef7bf60754b2\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"7b34b9dc-40eb-46ac-9b99-89ff3be46d72\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"344fb74a-4978-4c16-b94c-423463e96c1b\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"plot\":{\"id\":\"46449ade-85ea-46d7-afee-ef7bf60754b2\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"929ebb9e-a2a7-4d39-a443-4ddd93f57e4c\",\"type\":\"PanTool\"},{\"attributes\":{\"data_source\":{\"id\":\"e4a36dd5-5187-4c8f-9ee4-bd3026381f2a\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"981e70e8-46c9-49df-8fb0-948544762680\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"f5376617-a314-46b9-8353-98e16ae2a1a6\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis_label\":\"Government sub-function\",\"formatter\":{\"id\":\"bd35e690-c589-4020-a8db-efe6fbddc66c\",\"type\":\"CategoricalTickFormatter\"},\"major_label_orientation\":0.7853981633974483,\"plot\":{\"id\":\"46449ade-85ea-46d7-afee-ef7bf60754b2\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"344fb74a-4978-4c16-b94c-423463e96c1b\",\"type\":\"CategoricalTicker\"}},\"id\":\"c25521d3-eae5-4639-a61a-ee0be4707878\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Executive and legislative organs, financial and fiscal affairs, external affairs\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[10.101],\"label\":[{\"sub_function_name\":\"Executive and legislative organs, financial and fiscal affairs, external affairs\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Executive and legislative organs, financial and fiscal affairs, external affairs\"],\"width\":[0.8],\"x\":[\"Executive and legislative organs, financial and fiscal affairs, external affairs\"],\"y\":[5.0505]}},\"id\":\"f99e9d3f-d8d5-4c3d-bac6-745d499f5f49\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"46449ade-85ea-46d7-afee-ef7bf60754b2\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"e3da16dd-c189-4150-8a68-b13f91a2ef44\",\"type\":\"HelpTool\"},{\"attributes\":{\"data_source\":{\"id\":\"937ea490-a5b3-4406-ac0a-beeb946eab37\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"7a5f08b2-aa56-4306-9553-06e30198428c\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"ee919a29-5cef-462f-901a-e06fda450120\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"0531c379-97d0-4311-8d4c-c2b057f15761\",\"type\":\"BasicTicker\"}],\"root_ids\":[\"46449ade-85ea-46d7-afee-ef7bf60754b2\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.3\"}};\n",
" var render_items = [{\"docid\":\"ed08e68a-5b67-431f-8c5d-5c6a56d23b4d\",\"elementid\":\"34af3c04-25e9-4e43-ab25-89e13369950f\",\"modelid\":\"46449ade-85ea-46d7-afee-ef7bf60754b2\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (!force) {\n",
" var cell = $(\"#34af3c04-25e9-4e43-ab25-89e13369950f\").parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
" \n",
" }\n",
" \n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
" }(this));\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"plotdiv\" id=\"e00a773b-1926-4816-bfd7-a2b020e75f68\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = \"\";\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_timeout = Date.now() + 0;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
" \n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
" \n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" Bokeh.$(\"#e00a773b-1926-4816-bfd7-a2b020e75f68\").text(\"BokehJS successfully loaded.\");\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
" \n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
" \n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"e00a773b-1926-4816-bfd7-a2b020e75f68\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'e00a773b-1926-4816-bfd7-a2b020e75f68' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
" \n",
" var js_urls = [];\n",
" \n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.$(function() {\n",
" var docs_json = {\"7a1b12c1-4d1d-423b-b9ec-ce54c1e900ed\":{\"roots\":{\"references\":[{\"attributes\":{\"axis_label\":\"Billions of pounds\",\"formatter\":{\"id\":\"eefc6d51-b700-4d16-ba99-237638944ed4\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"516cbcc5-18c0-4472-b8af-c8bac838fae2\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3afcb62a-43e7-4330-a334-b56aaa660eab\",\"type\":\"BasicTicker\"}},\"id\":\"57836430-c550-4b82-9528-2154e13e06e8\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null,\"end\":17.477249999999998},\"id\":\"85fd732c-e964-46dc-83a1-d670e00cf58b\",\"type\":\"Range1d\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"46c08017-2288-4187-b67c-5ebca540e9c5\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"fe66886a-d1e3-42e1-8722-5561809361a0\",\"type\":\"Rect\"},{\"attributes\":{\"plot\":null,\"text\":\"Public order and safety breakdown\"},\"id\":\"fa4177cb-c1f6-4bf5-a222-40d73af24799\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"eb3fd7c3-9fd3-47b9-b976-a050fa645006\",\"type\":\"ToolEvents\"},{\"attributes\":{\"axis_label\":\"Government sub-function\",\"formatter\":{\"id\":\"9e20589a-fadd-43fe-9580-43ae3f60da48\",\"type\":\"CategoricalTickFormatter\"},\"major_label_orientation\":0.7853981633974483,\"plot\":{\"id\":\"516cbcc5-18c0-4472-b8af-c8bac838fae2\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"2b481030-cac2-47eb-9be6-7fe811bd4140\",\"type\":\"CategoricalTicker\"}},\"id\":\"8995f120-0cd9-4ca9-9c7f-dd56ce103857\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"14f848d9-effe-4009-9c8b-f63cb6d89bd0\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"edeec619-7b74-4480-a723-1c7732cea7e2\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"247ee2f0-7f7c-4185-aafc-f896ccd53d86\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":{\"id\":\"516cbcc5-18c0-4472-b8af-c8bac838fae2\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"61296a7a-46eb-4801-b559-2ace4dddeb4d\",\"type\":\"SaveTool\"},{\"attributes\":{\"data_source\":{\"id\":\"cad8c793-04d5-4ba5-9754-280c8480b965\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"fe66886a-d1e3-42e1-8722-5561809361a0\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"fb304904-9664-4835-97be-19f4934ac550\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Fire-protection services\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[2.821],\"label\":[{\"sub_function_name\":\"Fire-protection services\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Fire-protection services\"],\"width\":[0.8],\"x\":[\"Fire-protection services\"],\"y\":[1.4105]}},\"id\":\"fd4f8a69-eb0e-477b-aeb1-9ee491d13b4f\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4a8bc1c0-cf31-46c4-9e98-6d5e5b5c2303\",\"type\":\"Rect\"},{\"attributes\":{},\"id\":\"9e20589a-fadd-43fe-9580-43ae3f60da48\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"516cbcc5-18c0-4472-b8af-c8bac838fae2\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3afcb62a-43e7-4330-a334-b56aaa660eab\",\"type\":\"BasicTicker\"}},\"id\":\"fd409613-71bb-4f05-961b-a74032f26f2b\",\"type\":\"Grid\"},{\"attributes\":{\"overlay\":{\"id\":\"89fadcd7-0e7f-45dd-ac08-c34c6e062a4c\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"516cbcc5-18c0-4472-b8af-c8bac838fae2\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"98c37337-1198-4fe1-b811-1b82be2f94d3\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Police services\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[16.645],\"label\":[{\"sub_function_name\":\"Police services\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Police services\"],\"width\":[0.8],\"x\":[\"Police services\"],\"y\":[8.3225]}},\"id\":\"cad8c793-04d5-4ba5-9754-280c8480b965\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Prisons\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[4.092],\"label\":[{\"sub_function_name\":\"Prisons\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Prisons\"],\"width\":[0.8],\"x\":[\"Prisons\"],\"y\":[2.046]}},\"id\":\"2b64c040-d91b-467b-93a5-cff252116bd0\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"58cfd7e5-d2c0-4ec2-95a3-c5a41bf5a6eb\",\"type\":\"PanTool\"},{\"id\":\"9945ec0a-dc91-45a9-88d4-e21179c6791c\",\"type\":\"WheelZoomTool\"},{\"id\":\"98c37337-1198-4fe1-b811-1b82be2f94d3\",\"type\":\"BoxZoomTool\"},{\"id\":\"61296a7a-46eb-4801-b559-2ace4dddeb4d\",\"type\":\"SaveTool\"},{\"id\":\"8dd203c4-8925-48c7-be90-6b4c929e7115\",\"type\":\"ResetTool\"},{\"id\":\"31715254-a8a8-4aa1-9d2a-e9a1a65f478b\",\"type\":\"HelpTool\"}]},\"id\":\"d9e02511-8638-48c8-bdea-605469d5ed8f\",\"type\":\"Toolbar\"},{\"attributes\":{\"data_source\":{\"id\":\"fd4f8a69-eb0e-477b-aeb1-9ee491d13b4f\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"43373ce9-4cd4-44dc-bad1-0f861494ffd3\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"b298f4d6-f709-45e1-927e-c29b4fca1141\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"f9fe681e-9b2d-487e-a1c2-fb41d12872aa\",\"type\":\"Rect\"},{\"attributes\":{\"data_source\":{\"id\":\"cbaa5d24-c617-46f6-8c7b-2a75cb9af454\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"46c08017-2288-4187-b67c-5ebca540e9c5\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"e87330e3-184d-4276-9ba3-d15bfe0150f3\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":{\"id\":\"516cbcc5-18c0-4472-b8af-c8bac838fae2\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"9945ec0a-dc91-45a9-88d4-e21179c6791c\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"plot\":{\"id\":\"516cbcc5-18c0-4472-b8af-c8bac838fae2\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"8dd203c4-8925-48c7-be90-6b4c929e7115\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"3afcb62a-43e7-4330-a334-b56aaa660eab\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Public order and safety n.e.c.\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[0.872],\"label\":[{\"sub_function_name\":\"Public order and safety n.e.c.\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Public order and safety n.e.c.\"],\"width\":[0.8],\"x\":[\"Public order and safety n.e.c.\"],\"y\":[0.436]}},\"id\":\"b44f9f26-a141-46df-b2b6-780314e9ac78\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"eefc6d51-b700-4d16-ba99-237638944ed4\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"2b481030-cac2-47eb-9be6-7fe811bd4140\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"below\":[{\"id\":\"8995f120-0cd9-4ca9-9c7f-dd56ce103857\",\"type\":\"CategoricalAxis\"}],\"left\":[{\"id\":\"57836430-c550-4b82-9528-2154e13e06e8\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"89fadcd7-0e7f-45dd-ac08-c34c6e062a4c\",\"type\":\"BoxAnnotation\"},{\"id\":\"fb304904-9664-4835-97be-19f4934ac550\",\"type\":\"GlyphRenderer\"},{\"id\":\"b298f4d6-f709-45e1-927e-c29b4fca1141\",\"type\":\"GlyphRenderer\"},{\"id\":\"247ee2f0-7f7c-4185-aafc-f896ccd53d86\",\"type\":\"GlyphRenderer\"},{\"id\":\"d87121ed-5bf3-4c37-914e-d076fe60985a\",\"type\":\"GlyphRenderer\"},{\"id\":\"e87330e3-184d-4276-9ba3-d15bfe0150f3\",\"type\":\"GlyphRenderer\"},{\"id\":\"5ab260a0-c726-4a5f-b6a5-6c90e97347d9\",\"type\":\"GlyphRenderer\"},{\"id\":\"8995f120-0cd9-4ca9-9c7f-dd56ce103857\",\"type\":\"CategoricalAxis\"},{\"id\":\"57836430-c550-4b82-9528-2154e13e06e8\",\"type\":\"LinearAxis\"},{\"id\":\"fd409613-71bb-4f05-961b-a74032f26f2b\",\"type\":\"Grid\"}],\"title\":{\"id\":\"fa4177cb-c1f6-4bf5-a222-40d73af24799\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"eb3fd7c3-9fd3-47b9-b976-a050fa645006\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"d9e02511-8638-48c8-bdea-605469d5ed8f\",\"type\":\"Toolbar\"},\"x_mapper_type\":\"auto\",\"x_range\":{\"id\":\"71552964-7422-4bee-8d8e-b9df98942c7e\",\"type\":\"FactorRange\"},\"y_mapper_type\":\"auto\",\"y_range\":{\"id\":\"85fd732c-e964-46dc-83a1-d670e00cf58b\",\"type\":\"Range1d\"}},\"id\":\"516cbcc5-18c0-4472-b8af-c8bac838fae2\",\"subtype\":\"Chart\",\"type\":\"Plot\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"edeec619-7b74-4480-a723-1c7732cea7e2\",\"type\":\"Rect\"},{\"attributes\":{\"plot\":{\"id\":\"516cbcc5-18c0-4472-b8af-c8bac838fae2\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"31715254-a8a8-4aa1-9d2a-e9a1a65f478b\",\"type\":\"HelpTool\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"43373ce9-4cd4-44dc-bad1-0f861494ffd3\",\"type\":\"Rect\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"89fadcd7-0e7f-45dd-ac08-c34c6e062a4c\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"data_source\":{\"id\":\"2b64c040-d91b-467b-93a5-cff252116bd0\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"4a8bc1c0-cf31-46c4-9e98-6d5e5b5c2303\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"d87121ed-5bf3-4c37-914e-d076fe60985a\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"R&D public order and safety\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[0.062],\"label\":[{\"sub_function_name\":\"R&D public order and safety\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"R&D public order and safety\"],\"width\":[0.8],\"x\":[\"R&D public order and safety\"],\"y\":[0.031]}},\"id\":\"cbaa5d24-c617-46f6-8c7b-2a75cb9af454\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Law courts\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[5.691],\"label\":[{\"sub_function_name\":\"Law courts\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Law courts\"],\"width\":[0.8],\"x\":[\"Law courts\"],\"y\":[2.8455]}},\"id\":\"14f848d9-effe-4009-9c8b-f63cb6d89bd0\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"516cbcc5-18c0-4472-b8af-c8bac838fae2\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"58cfd7e5-d2c0-4ec2-95a3-c5a41bf5a6eb\",\"type\":\"PanTool\"},{\"attributes\":{\"data_source\":{\"id\":\"b44f9f26-a141-46df-b2b6-780314e9ac78\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"f9fe681e-9b2d-487e-a1c2-fb41d12872aa\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"5ab260a0-c726-4a5f-b6a5-6c90e97347d9\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"factors\":[\"Fire-protection services\",\"Law courts\",\"Police services\",\"Prisons\",\"Public order and safety n.e.c.\",\"R&D public order and safety\"]},\"id\":\"71552964-7422-4bee-8d8e-b9df98942c7e\",\"type\":\"FactorRange\"}],\"root_ids\":[\"516cbcc5-18c0-4472-b8af-c8bac838fae2\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.3\"}};\n",
" var render_items = [{\"docid\":\"7a1b12c1-4d1d-423b-b9ec-ce54c1e900ed\",\"elementid\":\"e00a773b-1926-4816-bfd7-a2b020e75f68\",\"modelid\":\"516cbcc5-18c0-4472-b8af-c8bac838fae2\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (!force) {\n",
" var cell = $(\"#e00a773b-1926-4816-bfd7-a2b020e75f68\").parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
" \n",
" }\n",
" \n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
" }(this));\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"plotdiv\" id=\"efcc2ffe-2993-43fe-a9f6-5e5fcca4cd76\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = \"\";\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_timeout = Date.now() + 0;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
" \n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
" \n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" Bokeh.$(\"#efcc2ffe-2993-43fe-a9f6-5e5fcca4cd76\").text(\"BokehJS successfully loaded.\");\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
" \n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
" \n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"efcc2ffe-2993-43fe-a9f6-5e5fcca4cd76\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'efcc2ffe-2993-43fe-a9f6-5e5fcca4cd76' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
" \n",
" var js_urls = [];\n",
" \n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.$(function() {\n",
" var docs_json = {\"9806b20c-7813-4ac7-9be9-4560b085e1b5\":{\"roots\":{\"references\":[{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"ad66c624-9408-41d5-8190-d0eab1553ff5\",\"type\":\"Rect\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Community development\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[2.423],\"label\":[{\"sub_function_name\":\"Community development\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Community development\"],\"width\":[0.8],\"x\":[\"Community development\"],\"y\":[1.2115]}},\"id\":\"e5804846-04dd-44d6-9902-481e8a1e5681\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1fc2e4a3-d46a-4487-a38c-06590f671e7a\",\"type\":\"Rect\"},{\"attributes\":{\"data_source\":{\"id\":\"5e3b326a-ed02-451d-8aa0-e70c4a029c5f\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"ad66c624-9408-41d5-8190-d0eab1553ff5\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"87797082-15a5-458c-8752-82341fc03735\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis_label\":\"Government sub-function\",\"formatter\":{\"id\":\"fcae5fc3-76b9-45bf-b07a-966ff225c591\",\"type\":\"CategoricalTickFormatter\"},\"major_label_orientation\":0.7853981633974483,\"plot\":{\"id\":\"4d6fc4c1-c154-4764-9b3b-7edcd428794f\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"98f5f6c1-2005-4afc-8023-421ca16d8aa6\",\"type\":\"CategoricalTicker\"}},\"id\":\"9ee3206e-a8ef-443c-bc46-8870ac49d288\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Street lighting\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[0.839],\"label\":[{\"sub_function_name\":\"Street lighting\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Street lighting\"],\"width\":[0.8],\"x\":[\"Street lighting\"],\"y\":[0.4195]}},\"id\":\"2f9686bb-fdd1-4ca1-9ef5-56bef3af4478\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"4d6fc4c1-c154-4764-9b3b-7edcd428794f\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"3dfadccb-e495-4c4b-98b5-50306691c8de\",\"type\":\"ResetTool\"},{\"attributes\":{\"data_source\":{\"id\":\"2538ef6c-61be-49a7-8e26-a509ee6ddb0c\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"a2d6812e-d029-401f-88a2-a79bc252682a\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"1184ee39-fb1a-4e3b-8e67-18ced6cae263\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"98f5f6c1-2005-4afc-8023-421ca16d8aa6\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"edb32933-65d9-4613-9c45-d75e3436bf8b\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null,\"end\":5.8506},\"id\":\"8a7d1bc2-7aa2-467b-b99b-a8699e680a3b\",\"type\":\"Range1d\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"R&D housing and community amenities\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[0.0],\"label\":[{\"sub_function_name\":\"R&D housing and community amenities\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"R&D housing and community amenities\"],\"width\":[0.8],\"x\":[\"R&D housing and community amenities\"],\"y\":[0.0]}},\"id\":\"5e3b326a-ed02-451d-8aa0-e70c4a029c5f\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"4d6fc4c1-c154-4764-9b3b-7edcd428794f\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"037878ac-3f60-4b7e-8e8c-bf708a46dfdb\",\"type\":\"PanTool\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"38b01120-0d34-435f-be0c-f7a53d39a961\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"a6508f99-f881-4dc3-b7ea-cc8247d1a3f2\",\"type\":\"Rect\"},{\"attributes\":{},\"id\":\"c1fb05f3-f327-41d2-b57a-62dd786a5704\",\"type\":\"ToolEvents\"},{\"attributes\":{\"axis_label\":\"Billions of pounds\",\"formatter\":{\"id\":\"425fe3bd-3592-4f7b-ae26-547a2197c8b0\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"4d6fc4c1-c154-4764-9b3b-7edcd428794f\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"edb32933-65d9-4613-9c45-d75e3436bf8b\",\"type\":\"BasicTicker\"}},\"id\":\"08df14de-2ccd-461a-9613-2288f01e2131\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Water supply\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[0.814],\"label\":[{\"sub_function_name\":\"Water supply\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Water supply\"],\"width\":[0.8],\"x\":[\"Water supply\"],\"y\":[0.407]}},\"id\":\"4ee1c662-02db-473f-b9b9-5f3b6340a56e\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"037878ac-3f60-4b7e-8e8c-bf708a46dfdb\",\"type\":\"PanTool\"},{\"id\":\"37280206-d423-4ad9-a0ac-9522ab4d4e37\",\"type\":\"WheelZoomTool\"},{\"id\":\"bda6cf39-1e37-4dba-8c0d-66d69f4bc80d\",\"type\":\"BoxZoomTool\"},{\"id\":\"c6cc5281-02c5-40f7-abd2-d14d550bac42\",\"type\":\"SaveTool\"},{\"id\":\"3dfadccb-e495-4c4b-98b5-50306691c8de\",\"type\":\"ResetTool\"},{\"id\":\"4600a0e5-0d9b-4191-8f8e-30c39b228fb8\",\"type\":\"HelpTool\"}]},\"id\":\"6b2dd3af-ce04-4d78-a41e-816e11962088\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"425fe3bd-3592-4f7b-ae26-547a2197c8b0\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Housing and community amenities n.e.c.\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[0.366],\"label\":[{\"sub_function_name\":\"Housing and community amenities n.e.c.\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Housing and community amenities n.e.c.\"],\"width\":[0.8],\"x\":[\"Housing and community amenities n.e.c.\"],\"y\":[0.183]}},\"id\":\"a1306084-d352-4661-8460-5a719e140084\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":null,\"text\":\"Housing and community amenities breakdown\"},\"id\":\"80e4a93c-e304-49e5-a4ea-528552b1a12a\",\"type\":\"Title\"},{\"attributes\":{\"data_source\":{\"id\":\"4ee1c662-02db-473f-b9b9-5f3b6340a56e\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1fc2e4a3-d46a-4487-a38c-06590f671e7a\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"d169838a-a751-489f-8a05-8b45fccb16a4\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":{\"id\":\"4d6fc4c1-c154-4764-9b3b-7edcd428794f\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"37280206-d423-4ad9-a0ac-9522ab4d4e37\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"fcae5fc3-76b9-45bf-b07a-966ff225c591\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"e5804846-04dd-44d6-9902-481e8a1e5681\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"a6508f99-f881-4dc3-b7ea-cc8247d1a3f2\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"3c2ee8fd-19b6-4160-9fe8-e4558798c83f\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"factors\":[\"Community development\",\"Housing and community amenities n.e.c.\",\"Housing development\",\"R&D housing and community amenities\",\"Street lighting\",\"Water supply\"]},\"id\":\"9fe692c0-0875-4e6f-9d1b-a53ce6652842\",\"type\":\"FactorRange\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Housing development\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[5.572],\"label\":[{\"sub_function_name\":\"Housing development\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Housing development\"],\"width\":[0.8],\"x\":[\"Housing development\"],\"y\":[2.786]}},\"id\":\"2538ef6c-61be-49a7-8e26-a509ee6ddb0c\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"2f9686bb-fdd1-4ca1-9ef5-56bef3af4478\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"b2eaa2fa-47b5-45d8-9393-4d1ad096b7aa\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"0aa1da55-0d29-4dba-9db2-83f97c59a8c6\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"4d6fc4c1-c154-4764-9b3b-7edcd428794f\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"edb32933-65d9-4613-9c45-d75e3436bf8b\",\"type\":\"BasicTicker\"}},\"id\":\"f19825ec-cb50-4d8c-81ef-a50b3299dc17\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"b2eaa2fa-47b5-45d8-9393-4d1ad096b7aa\",\"type\":\"Rect\"},{\"attributes\":{\"overlay\":{\"id\":\"9f6f5d6b-1fc2-4872-9aa7-53a3456e5e4a\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"4d6fc4c1-c154-4764-9b3b-7edcd428794f\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"bda6cf39-1e37-4dba-8c0d-66d69f4bc80d\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"plot\":{\"id\":\"4d6fc4c1-c154-4764-9b3b-7edcd428794f\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"c6cc5281-02c5-40f7-abd2-d14d550bac42\",\"type\":\"SaveTool\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"a2d6812e-d029-401f-88a2-a79bc252682a\",\"type\":\"Rect\"},{\"attributes\":{\"below\":[{\"id\":\"9ee3206e-a8ef-443c-bc46-8870ac49d288\",\"type\":\"CategoricalAxis\"}],\"left\":[{\"id\":\"08df14de-2ccd-461a-9613-2288f01e2131\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"9f6f5d6b-1fc2-4872-9aa7-53a3456e5e4a\",\"type\":\"BoxAnnotation\"},{\"id\":\"1184ee39-fb1a-4e3b-8e67-18ced6cae263\",\"type\":\"GlyphRenderer\"},{\"id\":\"3c2ee8fd-19b6-4160-9fe8-e4558798c83f\",\"type\":\"GlyphRenderer\"},{\"id\":\"d169838a-a751-489f-8a05-8b45fccb16a4\",\"type\":\"GlyphRenderer\"},{\"id\":\"0aa1da55-0d29-4dba-9db2-83f97c59a8c6\",\"type\":\"GlyphRenderer\"},{\"id\":\"87797082-15a5-458c-8752-82341fc03735\",\"type\":\"GlyphRenderer\"},{\"id\":\"f96db34e-d393-411e-842c-a0f6753ab20f\",\"type\":\"GlyphRenderer\"},{\"id\":\"9ee3206e-a8ef-443c-bc46-8870ac49d288\",\"type\":\"CategoricalAxis\"},{\"id\":\"08df14de-2ccd-461a-9613-2288f01e2131\",\"type\":\"LinearAxis\"},{\"id\":\"f19825ec-cb50-4d8c-81ef-a50b3299dc17\",\"type\":\"Grid\"}],\"title\":{\"id\":\"80e4a93c-e304-49e5-a4ea-528552b1a12a\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"c1fb05f3-f327-41d2-b57a-62dd786a5704\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"6b2dd3af-ce04-4d78-a41e-816e11962088\",\"type\":\"Toolbar\"},\"x_mapper_type\":\"auto\",\"x_range\":{\"id\":\"9fe692c0-0875-4e6f-9d1b-a53ce6652842\",\"type\":\"FactorRange\"},\"y_mapper_type\":\"auto\",\"y_range\":{\"id\":\"8a7d1bc2-7aa2-467b-b99b-a8699e680a3b\",\"type\":\"Range1d\"}},\"id\":\"4d6fc4c1-c154-4764-9b3b-7edcd428794f\",\"subtype\":\"Chart\",\"type\":\"Plot\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"9f6f5d6b-1fc2-4872-9aa7-53a3456e5e4a\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"plot\":{\"id\":\"4d6fc4c1-c154-4764-9b3b-7edcd428794f\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"4600a0e5-0d9b-4191-8f8e-30c39b228fb8\",\"type\":\"HelpTool\"},{\"attributes\":{\"data_source\":{\"id\":\"a1306084-d352-4661-8460-5a719e140084\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"38b01120-0d34-435f-be0c-f7a53d39a961\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"f96db34e-d393-411e-842c-a0f6753ab20f\",\"type\":\"GlyphRenderer\"}],\"root_ids\":[\"4d6fc4c1-c154-4764-9b3b-7edcd428794f\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.3\"}};\n",
" var render_items = [{\"docid\":\"9806b20c-7813-4ac7-9be9-4560b085e1b5\",\"elementid\":\"efcc2ffe-2993-43fe-a9f6-5e5fcca4cd76\",\"modelid\":\"4d6fc4c1-c154-4764-9b3b-7edcd428794f\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (!force) {\n",
" var cell = $(\"#efcc2ffe-2993-43fe-a9f6-5e5fcca4cd76\").parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
" \n",
" }\n",
" \n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
" }(this));\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"plotdiv\" id=\"1693b147-87e2-4343-ace8-3308cfe0ffe8\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = \"\";\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_timeout = Date.now() + 0;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
" \n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
" \n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" Bokeh.$(\"#1693b147-87e2-4343-ace8-3308cfe0ffe8\").text(\"BokehJS successfully loaded.\");\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
" \n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
" \n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"1693b147-87e2-4343-ace8-3308cfe0ffe8\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid '1693b147-87e2-4343-ace8-3308cfe0ffe8' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
" \n",
" var js_urls = [];\n",
" \n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.$(function() {\n",
" var docs_json = {\"f03a189b-163a-43b0-acb3-8a61b9eed0d2\":{\"roots\":{\"references\":[{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"41ade5b4-d89f-4cc4-9a68-9d29a60ae39e\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Religious and other community services\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[0.093],\"label\":[{\"sub_function_name\":\"Religious and other community services\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Religious and other community services\"],\"width\":[0.8],\"x\":[\"Religious and other community services\"],\"y\":[0.0465]}},\"id\":\"0f695cfe-d53a-4638-babf-3deaedb3a8c0\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"ba92f172-21d2-4a20-97d8-153d321cf15d\",\"type\":\"PanTool\"},{\"id\":\"9cc05e34-59be-41d4-865e-7b5059ee116c\",\"type\":\"WheelZoomTool\"},{\"id\":\"2542d6ce-a071-4664-99f5-6a327569fbee\",\"type\":\"BoxZoomTool\"},{\"id\":\"4c11cf12-2174-4bac-84a6-fc367fa8c88d\",\"type\":\"SaveTool\"},{\"id\":\"7a984bcb-e1a2-4657-bb1d-041326d04ff8\",\"type\":\"ResetTool\"},{\"id\":\"a5a74434-7ed9-4987-b510-339816d22a04\",\"type\":\"HelpTool\"}]},\"id\":\"30e7ff16-8916-4acf-9542-42ec1495b430\",\"type\":\"Toolbar\"},{\"attributes\":{\"data_source\":{\"id\":\"f51c4a6d-da1e-4709-b7c2-06666520cad9\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"f7ce69f4-59fe-4be4-8804-8818fdf6ddeb\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"ed4a03e6-07ae-4fbe-931a-5cb08d45e9b4\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"34e6ee2d-e5c4-4f2b-a696-d19091a376f7\",\"type\":\"Rect\"},{\"attributes\":{},\"id\":\"a0d525d6-3852-47ad-9a32-c8b9c75ad1ec\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"data_source\":{\"id\":\"0c6f75ba-fe5f-4018-b250-0c171ba7112f\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"8bedf432-5ebd-451c-aacb-317eca1f004d\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"e8dacf5f-e5f3-4d3f-bc0f-7c9c4c4aa289\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"8bedf432-5ebd-451c-aacb-317eca1f004d\",\"type\":\"Rect\"},{\"attributes\":{\"plot\":{\"id\":\"56e1d73a-1c6a-45b2-81e1-f249659d9de4\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"a5a74434-7ed9-4987-b510-339816d22a04\",\"type\":\"HelpTool\"},{\"attributes\":{\"below\":[{\"id\":\"40234d4d-34ce-49f5-be40-9eaf014d799b\",\"type\":\"CategoricalAxis\"}],\"left\":[{\"id\":\"09674c88-6261-4c30-a99c-de950a6293dd\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"41ade5b4-d89f-4cc4-9a68-9d29a60ae39e\",\"type\":\"BoxAnnotation\"},{\"id\":\"e8dacf5f-e5f3-4d3f-bc0f-7c9c4c4aa289\",\"type\":\"GlyphRenderer\"},{\"id\":\"6d41554f-d05e-45f3-a326-fe0cd955c7b9\",\"type\":\"GlyphRenderer\"},{\"id\":\"1d71eb3d-d437-4b82-ad5f-05cdc4ed5eb7\",\"type\":\"GlyphRenderer\"},{\"id\":\"4130ac49-4eb9-4ceb-a518-c01356dc293c\",\"type\":\"GlyphRenderer\"},{\"id\":\"ed4a03e6-07ae-4fbe-931a-5cb08d45e9b4\",\"type\":\"GlyphRenderer\"},{\"id\":\"c134847e-9243-4e39-8ee2-5a4576f835cf\",\"type\":\"GlyphRenderer\"},{\"id\":\"40234d4d-34ce-49f5-be40-9eaf014d799b\",\"type\":\"CategoricalAxis\"},{\"id\":\"09674c88-6261-4c30-a99c-de950a6293dd\",\"type\":\"LinearAxis\"},{\"id\":\"dd97ab34-1698-4a4e-a23d-d69ca2786ae2\",\"type\":\"Grid\"}],\"title\":{\"id\":\"089a7a99-83c6-49d0-b957-27291a0d3b78\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"e0311c62-8ad4-4771-ad6c-a68df4cf1383\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"30e7ff16-8916-4acf-9542-42ec1495b430\",\"type\":\"Toolbar\"},\"x_mapper_type\":\"auto\",\"x_range\":{\"id\":\"312ae053-2155-4de2-9eee-d683a948fb95\",\"type\":\"FactorRange\"},\"y_mapper_type\":\"auto\",\"y_range\":{\"id\":\"2063148b-a038-4547-a11a-204b5cda5e1f\",\"type\":\"Range1d\"}},\"id\":\"56e1d73a-1c6a-45b2-81e1-f249659d9de4\",\"subtype\":\"Chart\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"e1f8a3b0-8740-4ace-a565-a5b2298301b8\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"56e1d73a-1c6a-45b2-81e1-f249659d9de4\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"ba92f172-21d2-4a20-97d8-153d321cf15d\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"e2c52e8e-6459-4a50-abef-d977d3b77325\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"data_source\":{\"id\":\"4d9b0ab3-56ac-4b9b-a34a-d6be33721ac1\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"34e6ee2d-e5c4-4f2b-a696-d19091a376f7\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"c134847e-9243-4e39-8ee2-5a4576f835cf\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Recreation, culture and religion n.e.c.\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[0.063],\"label\":[{\"sub_function_name\":\"Recreation, culture and religion n.e.c.\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Recreation, culture and religion n.e.c.\"],\"width\":[0.8],\"x\":[\"Recreation, culture and religion n.e.c.\"],\"y\":[0.0315]}},\"id\":\"4d9b0ab3-56ac-4b9b-a34a-d6be33721ac1\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"56e1d73a-1c6a-45b2-81e1-f249659d9de4\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"4c11cf12-2174-4bac-84a6-fc367fa8c88d\",\"type\":\"SaveTool\"},{\"attributes\":{\"overlay\":{\"id\":\"41ade5b4-d89f-4cc4-9a68-9d29a60ae39e\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"56e1d73a-1c6a-45b2-81e1-f249659d9de4\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"2542d6ce-a071-4664-99f5-6a327569fbee\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"axis_label\":\"Billions of pounds\",\"formatter\":{\"id\":\"a0d525d6-3852-47ad-9a32-c8b9c75ad1ec\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"56e1d73a-1c6a-45b2-81e1-f249659d9de4\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"e1f8a3b0-8740-4ace-a565-a5b2298301b8\",\"type\":\"BasicTicker\"}},\"id\":\"09674c88-6261-4c30-a99c-de950a6293dd\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"dc35eb4a-05a8-4ca0-84c1-90e5aa5a37a8\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"19cae4d9-d065-4fd8-a976-1c9d20953a24\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"6d41554f-d05e-45f3-a326-fe0cd955c7b9\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"56e1d73a-1c6a-45b2-81e1-f249659d9de4\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"e1f8a3b0-8740-4ace-a565-a5b2298301b8\",\"type\":\"BasicTicker\"}},\"id\":\"dd97ab34-1698-4a4e-a23d-d69ca2786ae2\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"e0311c62-8ad4-4771-ad6c-a68df4cf1383\",\"type\":\"ToolEvents\"},{\"attributes\":{\"data_source\":{\"id\":\"0f695cfe-d53a-4638-babf-3deaedb3a8c0\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"6a9a75e6-fbcb-48b1-babe-7f61fd97270f\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"4130ac49-4eb9-4ceb-a518-c01356dc293c\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Recreational and sporting services\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[3.194],\"label\":[{\"sub_function_name\":\"Recreational and sporting services\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Recreational and sporting services\"],\"width\":[0.8],\"x\":[\"Recreational and sporting services\"],\"y\":[1.597]}},\"id\":\"0c6f75ba-fe5f-4018-b250-0c171ba7112f\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Broadcasting and publishing services\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[3.945],\"label\":[{\"sub_function_name\":\"Broadcasting and publishing services\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Broadcasting and publishing services\"],\"width\":[0.8],\"x\":[\"Broadcasting and publishing services\"],\"y\":[1.9725]}},\"id\":\"d616ab22-dcef-42ed-9a73-d8ea236d50ac\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"56e1d73a-1c6a-45b2-81e1-f249659d9de4\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"9cc05e34-59be-41d4-865e-7b5059ee116c\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"19cae4d9-d065-4fd8-a976-1c9d20953a24\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"f7ce69f4-59fe-4be4-8804-8818fdf6ddeb\",\"type\":\"Rect\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Cultural services\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[4.003],\"label\":[{\"sub_function_name\":\"Cultural services\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Cultural services\"],\"width\":[0.8],\"x\":[\"Cultural services\"],\"y\":[2.0015]}},\"id\":\"dc35eb4a-05a8-4ca0-84c1-90e5aa5a37a8\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"R&D recreation, culture and religion\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[0.13],\"label\":[{\"sub_function_name\":\"R&D recreation, culture and religion\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"R&D recreation, culture and religion\"],\"width\":[0.8],\"x\":[\"R&D recreation, culture and religion\"],\"y\":[0.065]}},\"id\":\"f51c4a6d-da1e-4709-b7c2-06666520cad9\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"d616ab22-dcef-42ed-9a73-d8ea236d50ac\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"96ea98fc-df14-4e55-ac64-991c491878b8\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"1d71eb3d-d437-4b82-ad5f-05cdc4ed5eb7\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"axis_label\":\"Government sub-function\",\"formatter\":{\"id\":\"48d997cc-dc7b-4728-b3ba-a7ae16deda73\",\"type\":\"CategoricalTickFormatter\"},\"major_label_orientation\":0.7853981633974483,\"plot\":{\"id\":\"56e1d73a-1c6a-45b2-81e1-f249659d9de4\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"e2c52e8e-6459-4a50-abef-d977d3b77325\",\"type\":\"CategoricalTicker\"}},\"id\":\"40234d4d-34ce-49f5-be40-9eaf014d799b\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"plot\":{\"id\":\"56e1d73a-1c6a-45b2-81e1-f249659d9de4\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"7a984bcb-e1a2-4657-bb1d-041326d04ff8\",\"type\":\"ResetTool\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"96ea98fc-df14-4e55-ac64-991c491878b8\",\"type\":\"Rect\"},{\"attributes\":{},\"id\":\"48d997cc-dc7b-4728-b3ba-a7ae16deda73\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"plot\":null,\"text\":\"Recreation, culture and religion breakdown\"},\"id\":\"089a7a99-83c6-49d0-b957-27291a0d3b78\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null,\"factors\":[\"Broadcasting and publishing services\",\"Cultural services\",\"R&D recreation, culture and religion\",\"Recreation, culture and religion n.e.c.\",\"Recreational and sporting services\",\"Religious and other community services\"]},\"id\":\"312ae053-2155-4de2-9eee-d683a948fb95\",\"type\":\"FactorRange\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"6a9a75e6-fbcb-48b1-babe-7f61fd97270f\",\"type\":\"Rect\"},{\"attributes\":{\"callback\":null,\"end\":4.20315},\"id\":\"2063148b-a038-4547-a11a-204b5cda5e1f\",\"type\":\"Range1d\"}],\"root_ids\":[\"56e1d73a-1c6a-45b2-81e1-f249659d9de4\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.3\"}};\n",
" var render_items = [{\"docid\":\"f03a189b-163a-43b0-acb3-8a61b9eed0d2\",\"elementid\":\"1693b147-87e2-4343-ace8-3308cfe0ffe8\",\"modelid\":\"56e1d73a-1c6a-45b2-81e1-f249659d9de4\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (!force) {\n",
" var cell = $(\"#1693b147-87e2-4343-ace8-3308cfe0ffe8\").parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
" \n",
" }\n",
" \n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
" }(this));\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"plotdiv\" id=\"6e8e4e61-97c4-4d4b-ba16-fcaa780a0f52\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = \"\";\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_timeout = Date.now() + 0;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
" \n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
" \n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" Bokeh.$(\"#6e8e4e61-97c4-4d4b-ba16-fcaa780a0f52\").text(\"BokehJS successfully loaded.\");\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
" \n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
" \n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"6e8e4e61-97c4-4d4b-ba16-fcaa780a0f52\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid '6e8e4e61-97c4-4d4b-ba16-fcaa780a0f52' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
" \n",
" var js_urls = [];\n",
" \n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.$(function() {\n",
" var docs_json = {\"8636a6ef-c202-4ac1-9d2f-be5ab0df492f\":{\"roots\":{\"references\":[{\"attributes\":{\"plot\":{\"id\":\"d8f8aee4-46e9-43dc-9435-ade92502fc60\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"9c9adc57-8cc9-4b02-b4b8-d668718c7bf1\",\"type\":\"SaveTool\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"64810a5f-0272-488e-985c-e5b0095c96d6\",\"type\":\"Rect\"},{\"attributes\":{},\"id\":\"d46eee28-6eca-4bff-bef3-42bcc0d6e7a0\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":null,\"text\":\"Education breakdown\"},\"id\":\"b6a7a652-e7c4-4f0f-bf95-4ac19f41fb9c\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Secondary education\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[38.193],\"label\":[{\"sub_function_name\":\"Secondary education\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Secondary education\"],\"width\":[0.8],\"x\":[\"Secondary education\"],\"y\":[19.0965]}},\"id\":\"899edf2e-69d4-4b8e-b99f-d47eef649763\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"below\":[{\"id\":\"df0b24fc-a3f0-4a5a-b784-41f4990f9acd\",\"type\":\"CategoricalAxis\"}],\"left\":[{\"id\":\"15324874-50c9-40af-95f6-e936c53ade91\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"d3f72f80-03ea-4e7c-a917-8cf08d3e45ac\",\"type\":\"BoxAnnotation\"},{\"id\":\"f60e86ca-5379-4f0f-a06c-aa24a53e6062\",\"type\":\"GlyphRenderer\"},{\"id\":\"ec3e4c65-3b6a-47af-b611-86113bd84892\",\"type\":\"GlyphRenderer\"},{\"id\":\"0203f9f8-291d-490a-8408-3dff36f1bef0\",\"type\":\"GlyphRenderer\"},{\"id\":\"ed394853-1864-4c9d-9881-6556b1c01629\",\"type\":\"GlyphRenderer\"},{\"id\":\"512735d3-e9e8-4573-9207-528577d90c55\",\"type\":\"GlyphRenderer\"},{\"id\":\"d4cd4334-4e16-4c06-8b7d-0514f92d306f\",\"type\":\"GlyphRenderer\"},{\"id\":\"d8214259-42ea-4a1b-a248-e7ea5432ff96\",\"type\":\"GlyphRenderer\"},{\"id\":\"263fe82a-f48e-48c9-aeae-4d479cce8760\",\"type\":\"GlyphRenderer\"},{\"id\":\"df0b24fc-a3f0-4a5a-b784-41f4990f9acd\",\"type\":\"CategoricalAxis\"},{\"id\":\"15324874-50c9-40af-95f6-e936c53ade91\",\"type\":\"LinearAxis\"},{\"id\":\"89e3b2d2-3f58-4995-9e07-6e1cfab8f7a7\",\"type\":\"Grid\"}],\"title\":{\"id\":\"b6a7a652-e7c4-4f0f-bf95-4ac19f41fb9c\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"483c45ad-2da1-4534-82ba-8e10af1e7b04\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"7d19147e-833c-40b6-bb77-82eee26616ca\",\"type\":\"Toolbar\"},\"x_mapper_type\":\"auto\",\"x_range\":{\"id\":\"91a67f1f-79b3-46b4-9030-f6b2225f98dc\",\"type\":\"FactorRange\"},\"y_mapper_type\":\"auto\",\"y_range\":{\"id\":\"208b80b8-e90e-426d-8fe5-79d23f1c906e\",\"type\":\"Range1d\"}},\"id\":\"d8f8aee4-46e9-43dc-9435-ade92502fc60\",\"subtype\":\"Chart\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"e991dd91-9c56-4328-84e2-5d2a10e35cd9\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"R&D education\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[1.577],\"label\":[{\"sub_function_name\":\"R&D education\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"R&D education\"],\"width\":[0.8],\"x\":[\"R&D education\"],\"y\":[0.7885]}},\"id\":\"f7069034-889b-4b94-bf72-c9a95018acaf\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"end\":40.10265},\"id\":\"208b80b8-e90e-426d-8fe5-79d23f1c906e\",\"type\":\"Range1d\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"dd332075-a0e8-4571-a949-fc6ad3e8f2c0\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"0ac15354-62e8-4571-b811-a943effe2b4f\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"c636a13b-b9f0-44dd-9126-99da48f1f586\",\"type\":\"Rect\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"d8f8aee4-46e9-43dc-9435-ade92502fc60\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3a0913de-3ecf-4049-9c15-9677285d1055\",\"type\":\"BasicTicker\"}},\"id\":\"89e3b2d2-3f58-4995-9e07-6e1cfab8f7a7\",\"type\":\"Grid\"},{\"attributes\":{\"overlay\":{\"id\":\"d3f72f80-03ea-4e7c-a917-8cf08d3e45ac\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"d8f8aee4-46e9-43dc-9435-ade92502fc60\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"df80fe37-8c42-4d96-86cc-fa2da34297e7\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"b5a6159d-55b9-4bd6-bf83-a734d52a23e8\",\"type\":\"PanTool\"},{\"id\":\"45645ab9-25e2-4cf9-9220-9958f40f0a18\",\"type\":\"WheelZoomTool\"},{\"id\":\"df80fe37-8c42-4d96-86cc-fa2da34297e7\",\"type\":\"BoxZoomTool\"},{\"id\":\"9c9adc57-8cc9-4b02-b4b8-d668718c7bf1\",\"type\":\"SaveTool\"},{\"id\":\"d38a59a7-a130-4ef8-8de6-277b77e5f14b\",\"type\":\"ResetTool\"},{\"id\":\"3c7ad878-28fa-40fd-9e00-0fa8bffe32e1\",\"type\":\"HelpTool\"}]},\"id\":\"7d19147e-833c-40b6-bb77-82eee26616ca\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"483c45ad-2da1-4534-82ba-8e10af1e7b04\",\"type\":\"ToolEvents\"},{\"attributes\":{\"data_source\":{\"id\":\"899edf2e-69d4-4b8e-b99f-d47eef649763\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"0ac15354-62e8-4571-b811-a943effe2b4f\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"ec3e4c65-3b6a-47af-b611-86113bd84892\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":{\"id\":\"d8f8aee4-46e9-43dc-9435-ade92502fc60\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"45645ab9-25e2-4cf9-9220-9958f40f0a18\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"data_source\":{\"id\":\"f7069034-889b-4b94-bf72-c9a95018acaf\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"42d86752-9bb5-4e35-84f3-87592d8c7bea\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"d8214259-42ea-4a1b-a248-e7ea5432ff96\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"4a7f64fe-ace6-44dc-b465-d10fc6e0aa05\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"fcc67434-6ce0-4902-bff4-5d473d1450da\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"f60e86ca-5379-4f0f-a06c-aa24a53e6062\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"485dacff-216b-46ae-8b82-07e9558bb0d8\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"dd332075-a0e8-4571-a949-fc6ad3e8f2c0\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"ed394853-1864-4c9d-9881-6556b1c01629\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Tertiary education\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[5.896],\"label\":[{\"sub_function_name\":\"Tertiary education\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Tertiary education\"],\"width\":[0.8],\"x\":[\"Tertiary education\"],\"y\":[2.948]}},\"id\":\"485dacff-216b-46ae-8b82-07e9558bb0d8\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"d8f8aee4-46e9-43dc-9435-ade92502fc60\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"b5a6159d-55b9-4bd6-bf83-a734d52a23e8\",\"type\":\"PanTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Subsidiary services to education\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[4.092],\"label\":[{\"sub_function_name\":\"Subsidiary services to education\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Subsidiary services to education\"],\"width\":[0.8],\"x\":[\"Subsidiary services to education\"],\"y\":[2.046]}},\"id\":\"5fea95b2-25e0-4571-b8de-27e4bbd649e2\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"axis_label\":\"Government sub-function\",\"formatter\":{\"id\":\"e991dd91-9c56-4328-84e2-5d2a10e35cd9\",\"type\":\"CategoricalTickFormatter\"},\"major_label_orientation\":0.7853981633974483,\"plot\":{\"id\":\"d8f8aee4-46e9-43dc-9435-ade92502fc60\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"25a705f3-739a-4a81-b00e-bd1ee53d981c\",\"type\":\"CategoricalTicker\"}},\"id\":\"df0b24fc-a3f0-4a5a-b784-41f4990f9acd\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"3a0913de-3ecf-4049-9c15-9677285d1055\",\"type\":\"BasicTicker\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Education n.e.c.\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[2.6],\"label\":[{\"sub_function_name\":\"Education n.e.c.\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Education n.e.c.\"],\"width\":[0.8],\"x\":[\"Education n.e.c.\"],\"y\":[1.3]}},\"id\":\"f3b767f3-64e6-41e3-b26b-4bff220cd62a\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Pre-primary and primary education\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[30.942],\"label\":[{\"sub_function_name\":\"Pre-primary and primary education\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Pre-primary and primary education\"],\"width\":[0.8],\"x\":[\"Pre-primary and primary education\"],\"y\":[15.471]}},\"id\":\"4a7f64fe-ace6-44dc-b465-d10fc6e0aa05\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"25a705f3-739a-4a81-b00e-bd1ee53d981c\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"callback\":null,\"factors\":[\"Education n.e.c.\",\"Education not definable by level\",\"Post-secondary non-tertiary education\",\"Pre-primary and primary education\",\"R&D education\",\"Secondary education\",\"Subsidiary services to education\",\"Tertiary education\"]},\"id\":\"91a67f1f-79b3-46b4-9030-f6b2225f98dc\",\"type\":\"FactorRange\"},{\"attributes\":{\"data_source\":{\"id\":\"90b1f010-bafc-4f18-9fb5-ba822e47a16d\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"c636a13b-b9f0-44dd-9126-99da48f1f586\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"0203f9f8-291d-490a-8408-3dff36f1bef0\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"d3f72f80-03ea-4e7c-a917-8cf08d3e45ac\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"axis_label\":\"Billions of pounds\",\"formatter\":{\"id\":\"d46eee28-6eca-4bff-bef3-42bcc0d6e7a0\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"d8f8aee4-46e9-43dc-9435-ade92502fc60\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"3a0913de-3ecf-4049-9c15-9677285d1055\",\"type\":\"BasicTicker\"}},\"id\":\"15324874-50c9-40af-95f6-e936c53ade91\",\"type\":\"LinearAxis\"},{\"attributes\":{\"data_source\":{\"id\":\"d1af2f09-883d-41e6-b6ba-4e235783e81b\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"64810a5f-0272-488e-985c-e5b0095c96d6\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"512735d3-e9e8-4573-9207-528577d90c55\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"fcc67434-6ce0-4902-bff4-5d473d1450da\",\"type\":\"Rect\"},{\"attributes\":{\"plot\":{\"id\":\"d8f8aee4-46e9-43dc-9435-ade92502fc60\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"3c7ad878-28fa-40fd-9e00-0fa8bffe32e1\",\"type\":\"HelpTool\"},{\"attributes\":{\"plot\":{\"id\":\"d8f8aee4-46e9-43dc-9435-ade92502fc60\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"d38a59a7-a130-4ef8-8de6-277b77e5f14b\",\"type\":\"ResetTool\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"e0fca57b-0dbd-4adb-b384-018f7d7f20d7\",\"type\":\"Rect\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Post-secondary non-tertiary education\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[0.091],\"label\":[{\"sub_function_name\":\"Post-secondary non-tertiary education\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Post-secondary non-tertiary education\"],\"width\":[0.8],\"x\":[\"Post-secondary non-tertiary education\"],\"y\":[0.0455]}},\"id\":\"90b1f010-bafc-4f18-9fb5-ba822e47a16d\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"f3b767f3-64e6-41e3-b26b-4bff220cd62a\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"4cd1f7e5-a51d-44aa-824c-6a32da67bd89\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"263fe82a-f48e-48c9-aeae-4d479cce8760\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Education not definable by level\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[0.636],\"label\":[{\"sub_function_name\":\"Education not definable by level\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Education not definable by level\"],\"width\":[0.8],\"x\":[\"Education not definable by level\"],\"y\":[0.318]}},\"id\":\"d1af2f09-883d-41e6-b6ba-4e235783e81b\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"5fea95b2-25e0-4571-b8de-27e4bbd649e2\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"e0fca57b-0dbd-4adb-b384-018f7d7f20d7\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"d4cd4334-4e16-4c06-8b7d-0514f92d306f\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"4cd1f7e5-a51d-44aa-824c-6a32da67bd89\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"42d86752-9bb5-4e35-84f3-87592d8c7bea\",\"type\":\"Rect\"}],\"root_ids\":[\"d8f8aee4-46e9-43dc-9435-ade92502fc60\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.3\"}};\n",
" var render_items = [{\"docid\":\"8636a6ef-c202-4ac1-9d2f-be5ab0df492f\",\"elementid\":\"6e8e4e61-97c4-4d4b-ba16-fcaa780a0f52\",\"modelid\":\"d8f8aee4-46e9-43dc-9435-ade92502fc60\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (!force) {\n",
" var cell = $(\"#6e8e4e61-97c4-4d4b-ba16-fcaa780a0f52\").parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
" \n",
" }\n",
" \n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
" }(this));\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"plotdiv\" id=\"d019e556-4e50-4d5e-b8f7-3a100573762f\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = \"\";\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_timeout = Date.now() + 0;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
" \n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
" \n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" Bokeh.$(\"#d019e556-4e50-4d5e-b8f7-3a100573762f\").text(\"BokehJS successfully loaded.\");\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
" \n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
" \n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"d019e556-4e50-4d5e-b8f7-3a100573762f\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'd019e556-4e50-4d5e-b8f7-3a100573762f' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
" \n",
" var js_urls = [];\n",
" \n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.$(function() {\n",
" var docs_json = {\"53847450-0fef-410b-85e2-d10e75c48b33\":{\"roots\":{\"references\":[{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"ee70c127-eb27-4ee8-976e-faff0dce4d26\",\"type\":\"Rect\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Unemployment\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[2.698],\"label\":[{\"sub_function_name\":\"Unemployment\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Unemployment\"],\"width\":[0.8],\"x\":[\"Unemployment\"],\"y\":[1.349]}},\"id\":\"69063656-9ce4-4952-82fa-bce58a0202df\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"62612b38-63c4-4e95-9ada-4d7e800e26cd\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"e60ad456-2807-4449-818f-063ab91de14c\",\"type\":\"HelpTool\"},{\"attributes\":{\"plot\":{\"id\":\"62612b38-63c4-4e95-9ada-4d7e800e26cd\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"a7d07d7f-7fa6-4fa3-981f-cb2f1b86c2bc\",\"type\":\"SaveTool\"},{\"attributes\":{\"data_source\":{\"id\":\"546f97c3-2dd6-4417-8483-f8ae172b566e\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"87b07285-4492-4afb-86d3-32150e21b661\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"88607b07-3d61-4565-92ae-c7a426342a75\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"factors\":[\" Family and children\",\"Housing\",\"Old age\",\"R&D social protection\",\"Sickness and disability\",\"Social exclusion n.e.c.\",\"Social protection n.e.c.\",\"Survivors\",\"Unemployment\"]},\"id\":\"a36c6746-835f-4fea-89f4-6b81625128d8\",\"type\":\"FactorRange\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Housing\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[26.374],\"label\":[{\"sub_function_name\":\"Housing\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Housing\"],\"width\":[0.8],\"x\":[\"Housing\"],\"y\":[13.187]}},\"id\":\"546f97c3-2dd6-4417-8483-f8ae172b566e\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Social protection n.e.c.\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[4.583],\"label\":[{\"sub_function_name\":\"Social protection n.e.c.\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Social protection n.e.c.\"],\"width\":[0.8],\"x\":[\"Social protection n.e.c.\"],\"y\":[2.2915]}},\"id\":\"7fcc202c-4275-4521-a69f-0def8d1acefd\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"87b07285-4492-4afb-86d3-32150e21b661\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"da898893-283e-4ef3-85ec-37c446d12164\",\"type\":\"Rect\"},{\"attributes\":{},\"id\":\"18cc93fa-a1ae-4c44-b706-09e0cab28aa7\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"a53070d1-1d22-4c37-b952-5642cf1b5f9d\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"564e445e-2d6a-4ae0-b71d-dff34a2cb7d1\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"9687a6ea-4761-4aa1-b083-6afa602c4116\",\"type\":\"Rect\"},{\"attributes\":{},\"id\":\"90d6e6af-4a31-45b7-9c9a-abea4003081b\",\"type\":\"ToolEvents\"},{\"attributes\":{\"below\":[{\"id\":\"fdcf61b6-3fb0-4819-a692-34fbf664192c\",\"type\":\"CategoricalAxis\"}],\"left\":[{\"id\":\"2ba1e519-947d-49d2-aec9-104ff9ede0ce\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"28c072f1-e104-49e1-95c4-d9c7a786fc3d\",\"type\":\"BoxAnnotation\"},{\"id\":\"df31e415-72c8-4147-afcd-fbe58fef79a2\",\"type\":\"GlyphRenderer\"},{\"id\":\"77b653c4-f18b-47e3-9c72-81bd9499df2b\",\"type\":\"GlyphRenderer\"},{\"id\":\"cf5d8c32-c689-4a78-9513-97c371497898\",\"type\":\"GlyphRenderer\"},{\"id\":\"8cdb44c1-f35b-4e0e-9543-5690e25e4074\",\"type\":\"GlyphRenderer\"},{\"id\":\"46738dff-e36a-42dc-a9b7-5e98fe9a8feb\",\"type\":\"GlyphRenderer\"},{\"id\":\"88607b07-3d61-4565-92ae-c7a426342a75\",\"type\":\"GlyphRenderer\"},{\"id\":\"ca356541-5726-4729-9186-1cb4063135a0\",\"type\":\"GlyphRenderer\"},{\"id\":\"070d4355-8477-41be-aef1-23968631b1ba\",\"type\":\"GlyphRenderer\"},{\"id\":\"77a744f1-f3e6-4984-8d96-f1bd5c20e31a\",\"type\":\"GlyphRenderer\"},{\"id\":\"fdcf61b6-3fb0-4819-a692-34fbf664192c\",\"type\":\"CategoricalAxis\"},{\"id\":\"2ba1e519-947d-49d2-aec9-104ff9ede0ce\",\"type\":\"LinearAxis\"},{\"id\":\"0e6fa2d2-d4e6-4805-8beb-5e9230e57e5b\",\"type\":\"Grid\"}],\"title\":{\"id\":\"fdd9779a-7a02-409c-8303-c36d4c916dee\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"90d6e6af-4a31-45b7-9c9a-abea4003081b\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"87ff0862-9ef9-4d29-bcd1-0a08177016a7\",\"type\":\"Toolbar\"},\"x_mapper_type\":\"auto\",\"x_range\":{\"id\":\"a36c6746-835f-4fea-89f4-6b81625128d8\",\"type\":\"FactorRange\"},\"y_mapper_type\":\"auto\",\"y_range\":{\"id\":\"70e5de5f-aa3d-4d47-aef8-cc645023f20e\",\"type\":\"Range1d\"}},\"id\":\"62612b38-63c4-4e95-9ada-4d7e800e26cd\",\"subtype\":\"Chart\",\"type\":\"Plot\"},{\"attributes\":{\"data_source\":{\"id\":\"379172a7-246e-454f-b1fe-d09b121164e3\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"374aa3f2-24f3-4f60-b981-f9fdbfd22663\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"8cdb44c1-f35b-4e0e-9543-5690e25e4074\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"a881fa7a-2501-4584-bc5b-60078d48f3f9\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"da898893-283e-4ef3-85ec-37c446d12164\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"df31e415-72c8-4147-afcd-fbe58fef79a2\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\" Family and children\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[24.795],\"label\":[{\"sub_function_name\":\" Family and children\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\" Family and children\"],\"width\":[0.8],\"x\":[\" Family and children\"],\"y\":[12.3975]}},\"id\":\"379172a7-246e-454f-b1fe-d09b121164e3\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"axis_label\":\"Government sub-function\",\"formatter\":{\"id\":\"18cc93fa-a1ae-4c44-b706-09e0cab28aa7\",\"type\":\"CategoricalTickFormatter\"},\"major_label_orientation\":0.7853981633974483,\"plot\":{\"id\":\"62612b38-63c4-4e95-9ada-4d7e800e26cd\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"7fa272ae-2918-4e9b-9919-37fdd892661d\",\"type\":\"CategoricalTicker\"}},\"id\":\"fdcf61b6-3fb0-4819-a692-34fbf664192c\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"c5fd73a2-00c8-45fa-af51-62d96ae630f1\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Survivors\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[1.164],\"label\":[{\"sub_function_name\":\"Survivors\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Survivors\"],\"width\":[0.8],\"x\":[\"Survivors\"],\"y\":[0.582]}},\"id\":\"1df303ab-8c95-4e49-87bc-275a243e8f3a\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"62612b38-63c4-4e95-9ada-4d7e800e26cd\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"68c76404-670c-41fa-8819-0cc5353ede2e\",\"type\":\"PanTool\"},{\"attributes\":{\"data_source\":{\"id\":\"69063656-9ce4-4952-82fa-bce58a0202df\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"c5fedc6c-d030-48d1-b24d-278eeeafed8e\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"46738dff-e36a-42dc-a9b7-5e98fe9a8feb\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"48133441-f71f-482d-95f1-2bd9ad6c42a4\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"564e445e-2d6a-4ae0-b71d-dff34a2cb7d1\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"070d4355-8477-41be-aef1-23968631b1ba\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"2cf556b4-b05f-42d7-a918-747d701ee0ab\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"ee70c127-eb27-4ee8-976e-faff0dce4d26\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"ca356541-5726-4729-9186-1cb4063135a0\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Sickness and disability\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[52.956],\"label\":[{\"sub_function_name\":\"Sickness and disability\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Sickness and disability\"],\"width\":[0.8],\"x\":[\"Sickness and disability\"],\"y\":[26.478]}},\"id\":\"a881fa7a-2501-4584-bc5b-60078d48f3f9\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"8758d92d-c495-4e3c-851d-dac796bf707d\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"62612b38-63c4-4e95-9ada-4d7e800e26cd\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"6a366c16-ad82-45cf-b613-b2e5ed9cd03b\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Social exclusion n.e.c.\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[31.485],\"label\":[{\"sub_function_name\":\"Social exclusion n.e.c.\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Social exclusion n.e.c.\"],\"width\":[0.8],\"x\":[\"Social exclusion n.e.c.\"],\"y\":[15.7425]}},\"id\":\"2cf556b4-b05f-42d7-a918-747d701ee0ab\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":null,\"text\":\"Social protection breakdown\"},\"id\":\"fdd9779a-7a02-409c-8303-c36d4c916dee\",\"type\":\"Title\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"c5fedc6c-d030-48d1-b24d-278eeeafed8e\",\"type\":\"Rect\"},{\"attributes\":{\"overlay\":{\"id\":\"28c072f1-e104-49e1-95c4-d9c7a786fc3d\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"62612b38-63c4-4e95-9ada-4d7e800e26cd\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"f826610b-5cbf-46f0-8180-5acbde556ccb\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"R&D social protection\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[0.0],\"label\":[{\"sub_function_name\":\"R&D social protection\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"R&D social protection\"],\"width\":[0.8],\"x\":[\"R&D social protection\"],\"y\":[0.0]}},\"id\":\"48133441-f71f-482d-95f1-2bd9ad6c42a4\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"axis_label\":\"Billions of pounds\",\"formatter\":{\"id\":\"c5fd73a2-00c8-45fa-af51-62d96ae630f1\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"62612b38-63c4-4e95-9ada-4d7e800e26cd\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"8758d92d-c495-4e3c-851d-dac796bf707d\",\"type\":\"BasicTicker\"}},\"id\":\"2ba1e519-947d-49d2-aec9-104ff9ede0ce\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"sub_function_name\":\"Old age\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"height\":[120.095],\"label\":[{\"sub_function_name\":\"Old age\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"sub_function_name\":[\"Old age\"],\"width\":[0.8],\"x\":[\"Old age\"],\"y\":[60.0475]}},\"id\":\"0b041020-1075-4aad-8c0b-5bb75a5bf28f\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"28c072f1-e104-49e1-95c4-d9c7a786fc3d\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"62612b38-63c4-4e95-9ada-4d7e800e26cd\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"8758d92d-c495-4e3c-851d-dac796bf707d\",\"type\":\"BasicTicker\"}},\"id\":\"0e6fa2d2-d4e6-4805-8beb-5e9230e57e5b\",\"type\":\"Grid\"},{\"attributes\":{\"plot\":{\"id\":\"62612b38-63c4-4e95-9ada-4d7e800e26cd\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"b912e1f5-b421-4d3e-959b-6f7e72b65ba4\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"7fa272ae-2918-4e9b-9919-37fdd892661d\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"374aa3f2-24f3-4f60-b981-f9fdbfd22663\",\"type\":\"Rect\"},{\"attributes\":{\"data_source\":{\"id\":\"0b041020-1075-4aad-8c0b-5bb75a5bf28f\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"a53070d1-1d22-4c37-b952-5642cf1b5f9d\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"77b653c4-f18b-47e3-9c72-81bd9499df2b\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"68c76404-670c-41fa-8819-0cc5353ede2e\",\"type\":\"PanTool\"},{\"id\":\"6a366c16-ad82-45cf-b613-b2e5ed9cd03b\",\"type\":\"WheelZoomTool\"},{\"id\":\"f826610b-5cbf-46f0-8180-5acbde556ccb\",\"type\":\"BoxZoomTool\"},{\"id\":\"a7d07d7f-7fa6-4fa3-981f-cb2f1b86c2bc\",\"type\":\"SaveTool\"},{\"id\":\"b912e1f5-b421-4d3e-959b-6f7e72b65ba4\",\"type\":\"ResetTool\"},{\"id\":\"e60ad456-2807-4449-818f-063ab91de14c\",\"type\":\"HelpTool\"}]},\"id\":\"87ff0862-9ef9-4d29-bcd1-0a08177016a7\",\"type\":\"Toolbar\"},{\"attributes\":{\"data_source\":{\"id\":\"1df303ab-8c95-4e49-87bc-275a243e8f3a\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"9687a6ea-4761-4aa1-b083-6afa602c4116\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"cf5d8c32-c689-4a78-9513-97c371497898\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"end\":126.09975},\"id\":\"70e5de5f-aa3d-4d47-aef8-cc645023f20e\",\"type\":\"Range1d\"},{\"attributes\":{\"data_source\":{\"id\":\"7fcc202c-4275-4521-a69f-0def8d1acefd\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"a22934c1-fc51-4b7b-aa63-b047421909d1\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"77a744f1-f3e6-4984-8d96-f1bd5c20e31a\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"a22934c1-fc51-4b7b-aa63-b047421909d1\",\"type\":\"Rect\"}],\"root_ids\":[\"62612b38-63c4-4e95-9ada-4d7e800e26cd\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.3\"}};\n",
" var render_items = [{\"docid\":\"53847450-0fef-410b-85e2-d10e75c48b33\",\"elementid\":\"d019e556-4e50-4d5e-b8f7-3a100573762f\",\"modelid\":\"62612b38-63c4-4e95-9ada-4d7e800e26cd\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (!force) {\n",
" var cell = $(\"#d019e556-4e50-4d5e-b8f7-3a100573762f\").parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
" \n",
" }\n",
" \n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
" }(this));\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"interesting_subs = [1, 3, 6, 8, 9, 10]\n",
"for function_nr in interesting_subs:\n",
" function_name = dp[dp.function_nr == function_nr].function_name.any()\n",
" show(Bar(dp[(dp.Year == 2015) & (dp.function_nr == function_nr)],\n",
" label='sub_function_name', values='Amount',\n",
" legend=False, title=function_name + ' breakdown', palette=palette,\n",
" xlabel='Government sub-function', ylabel=label_tot_alt))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Within the sub-functions, we can see which are most important. Here, you can see the sub-functions which together make up 95% of total spending."
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
" <div class=\"bk-root\">\n",
" <div class=\"plotdiv\" id=\"d8255c3d-ea94-4560-afac-6320f136bc6d\"></div>\n",
" </div>\n",
"<script type=\"text/javascript\">\n",
" \n",
" (function(global) {\n",
" function now() {\n",
" return new Date();\n",
" }\n",
" \n",
" var force = \"\";\n",
" \n",
" if (typeof (window._bokeh_onload_callbacks) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_onload_callbacks = [];\n",
" window._bokeh_is_loading = undefined;\n",
" }\n",
" \n",
" \n",
" \n",
" if (typeof (window._bokeh_timeout) === \"undefined\" || force !== \"\") {\n",
" window._bokeh_timeout = Date.now() + 0;\n",
" window._bokeh_failed_load = false;\n",
" }\n",
" \n",
" var NB_LOAD_WARNING = {'data': {'text/html':\n",
" \"<div style='background-color: #fdd'>\\n\"+\n",
" \"<p>\\n\"+\n",
" \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n",
" \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n",
" \"</p>\\n\"+\n",
" \"<ul>\\n\"+\n",
" \"<li>re-rerun `output_notebook()` to attempt to load from CDN again, or</li>\\n\"+\n",
" \"<li>use INLINE resources instead, as so:</li>\\n\"+\n",
" \"</ul>\\n\"+\n",
" \"<code>\\n\"+\n",
" \"from bokeh.resources import INLINE\\n\"+\n",
" \"output_notebook(resources=INLINE)\\n\"+\n",
" \"</code>\\n\"+\n",
" \"</div>\"}};\n",
" \n",
" function display_loaded() {\n",
" if (window.Bokeh !== undefined) {\n",
" Bokeh.$(\"#d8255c3d-ea94-4560-afac-6320f136bc6d\").text(\"BokehJS successfully loaded.\");\n",
" } else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(display_loaded, 100)\n",
" }\n",
" }\n",
" \n",
" function run_callbacks() {\n",
" window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
" delete window._bokeh_onload_callbacks\n",
" console.info(\"Bokeh: all callbacks have finished\");\n",
" }\n",
" \n",
" function load_libs(js_urls, callback) {\n",
" window._bokeh_onload_callbacks.push(callback);\n",
" if (window._bokeh_is_loading > 0) {\n",
" console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
" return null;\n",
" }\n",
" if (js_urls == null || js_urls.length === 0) {\n",
" run_callbacks();\n",
" return null;\n",
" }\n",
" console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
" window._bokeh_is_loading = js_urls.length;\n",
" for (var i = 0; i < js_urls.length; i++) {\n",
" var url = js_urls[i];\n",
" var s = document.createElement('script');\n",
" s.src = url;\n",
" s.async = false;\n",
" s.onreadystatechange = s.onload = function() {\n",
" window._bokeh_is_loading--;\n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
" run_callbacks()\n",
" }\n",
" };\n",
" s.onerror = function() {\n",
" console.warn(\"failed to load library \" + url);\n",
" };\n",
" console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
" document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
" }\n",
" };var element = document.getElementById(\"d8255c3d-ea94-4560-afac-6320f136bc6d\");\n",
" if (element == null) {\n",
" console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'd8255c3d-ea94-4560-afac-6320f136bc6d' but no matching script tag was found. \")\n",
" return false;\n",
" }\n",
" \n",
" var js_urls = [];\n",
" \n",
" var inline_js = [\n",
" function(Bokeh) {\n",
" Bokeh.$(function() {\n",
" var docs_json = {\"11ca4eaf-5644-4e0b-bfb3-4882b803e771\":{\"roots\":{\"references\":[{\"attributes\":{\"active_drag\":\"auto\",\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"4bfa6018-fc17-47e1-9b92-0947bca1e5d1\",\"type\":\"PanTool\"},{\"id\":\"9d81dda6-3bc9-4ff5-afb4-300698fee336\",\"type\":\"WheelZoomTool\"},{\"id\":\"c7e0e693-51b0-4145-b4b6-d105fdcb5d5c\",\"type\":\"BoxZoomTool\"},{\"id\":\"aff68118-bfb7-49b5-bd0f-72982943df40\",\"type\":\"SaveTool\"},{\"id\":\"b1039f6b-15a4-45ca-87c2-e5090d9fb18c\",\"type\":\"ResetTool\"},{\"id\":\"9c154a86-0ba8-4d9b-983f-c49c8c4c740e\",\"type\":\"HelpTool\"}]},\"id\":\"1977291f-ea71-4a99-81d7-5881007e40e8\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"70f3a1c2-054c-413b-af4f-cb9d024513cb\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":{\"id\":\"1585a0fe-0961-4f28-89fd-1e09c8d79e73\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"aff68118-bfb7-49b5-bd0f-72982943df40\",\"type\":\"SaveTool\"},{\"attributes\":{\"formatter\":{\"id\":\"23f48b49-e333-46ea-80ad-0e80fc68c54a\",\"type\":\"CategoricalTickFormatter\"},\"major_label_orientation\":0.7853981633974483,\"plot\":{\"id\":\"1585a0fe-0961-4f28-89fd-1e09c8d79e73\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"f06991c7-df0f-4ab6-833d-2bbcf908ff97\",\"type\":\"CategoricalTicker\"}},\"id\":\"1ae1fa74-e10b-4018-8f32-bb5061413459\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Social protection -- Social protection n.e.c.\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Social protection -- Social protection n.e.c.\"],\"height\":[4.583],\"label\":[{\"full_name\":\"Social protection -- Social protection n.e.c.\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Social protection -- Social protection n.e.c.\"],\"y\":[2.2915]}},\"id\":\"51f7d01d-5aa2-477d-8ec1-572003602061\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Recreation, culture and religion -- Cultural services\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Recreation, culture and religion -- Cultural services\"],\"height\":[4.003],\"label\":[{\"full_name\":\"Recreation, culture and religion -- Cultural services\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Recreation, culture and religion -- Cultural services\"],\"y\":[2.0015]}},\"id\":\"bfd40ead-5317-443d-886e-ef7d495c059b\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"30240610-a3de-4568-ad70-8d657265afc1\",\"type\":\"Rect\"},{\"attributes\":{\"data_source\":{\"id\":\"363a9076-29f1-4b66-b8a4-fe00948a9f7b\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"c385b5cc-7cef-47d3-943d-f2ab08035b96\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"43cbc471-e464-47ce-ace2-26b8e14dfeea\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"cde4ed27-39a5-4aa5-9bc6-2f576300b472\",\"type\":\"Rect\"},{\"attributes\":{\"axis_label\":\"Billions of pounds\",\"formatter\":{\"id\":\"70f3a1c2-054c-413b-af4f-cb9d024513cb\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"1585a0fe-0961-4f28-89fd-1e09c8d79e73\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"85b2ff03-523a-4305-b15c-d34dea642794\",\"type\":\"BasicTicker\"}},\"id\":\"b9147922-d12b-4f27-a9da-3535b04750c1\",\"type\":\"LinearAxis\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"a9857b01-491f-4847-ac96-0c08559a6d91\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"448bbb80-af65-4099-98fa-3899c534fc30\",\"type\":\"Rect\"},{\"attributes\":{},\"id\":\"1b9b0180-67b0-40f4-a4c8-d5f077ab02ff\",\"type\":\"ToolEvents\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"General public services -- Public debt transactions\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"General public services -- Public debt transactions\"],\"height\":[36.724],\"label\":[{\"full_name\":\"General public services -- Public debt transactions\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"General public services -- Public debt transactions\"],\"y\":[18.362]}},\"id\":\"22c9bbfb-f934-45d0-bf23-cb3f35769b51\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Housing and community amenities -- Housing development\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Housing and community amenities -- Housing development\"],\"height\":[5.572],\"label\":[{\"full_name\":\"Housing and community amenities -- Housing development\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Housing and community amenities -- Housing development\"],\"y\":[2.786]}},\"id\":\"be5a8204-7b4f-4759-a23b-72571dfd2f5d\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Social protection -- Old age\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Social protection -- Old age\"],\"height\":[120.095],\"label\":[{\"full_name\":\"Social protection -- Old age\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Social protection -- Old age\"],\"y\":[60.0475]}},\"id\":\"1b39715e-af25-4eac-bf1b-2cfd98ba3a17\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"General public services -- Foreign economic aid\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"General public services -- Foreign economic aid\"],\"height\":[8.173],\"label\":[{\"full_name\":\"General public services -- Foreign economic aid\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"General public services -- Foreign economic aid\"],\"y\":[4.0865]}},\"id\":\"082657bc-7312-4ad5-862a-560923b0d382\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"10482660-1784-47fd-b4a2-6a4dc8e82958\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"8052dddf-8ccc-41cb-929e-084a624a49af\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"1bd3a456-5002-458c-b2c7-f6357eb4ee33\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Public order and safety -- Prisons\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Public order and safety -- Prisons\"],\"height\":[4.092],\"label\":[{\"full_name\":\"Public order and safety -- Prisons\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Public order and safety -- Prisons\"],\"y\":[2.046]}},\"id\":\"a0df8739-44fb-49f5-964e-f5e48e859e77\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"f0601868-c415-4932-b15c-7b702a38e322\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"cde4ed27-39a5-4aa5-9bc6-2f576300b472\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"dee79b8b-0218-4db9-8768-b02a26cf1e03\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Public order and safety -- Law courts\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Public order and safety -- Law courts\"],\"height\":[5.691],\"label\":[{\"full_name\":\"Public order and safety -- Law courts\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Public order and safety -- Law courts\"],\"y\":[2.8455]}},\"id\":\"35cf082b-308c-4326-a696-c290044148c5\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Health -- Medical services\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Health -- Medical services\"],\"height\":[132.103],\"label\":[{\"full_name\":\"Health -- Medical services\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Health -- Medical services\"],\"y\":[66.0515]}},\"id\":\"00dd3699-6e11-4e81-a238-8a3865185539\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"c385b5cc-7cef-47d3-943d-f2ab08035b96\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"a6c4646d-52fc-43c3-b828-3d85ca9a1c2a\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3c86143d-a1c6-490e-8b65-049cb77caa13\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"72cf5830-6f84-47a0-aa73-9959b173485a\",\"type\":\"Rect\"},{\"attributes\":{\"data_source\":{\"id\":\"24612984-719e-4b4f-8471-1a1625e1778b\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1149f509-9cce-4875-bf4f-47ca97df52bc\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"5ab8b5ad-fd88-4c45-a067-32de8aac7cd0\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"8cee5a5b-87d4-4022-9650-9b3eb9b1624f\",\"type\":\"Rect\"},{\"attributes\":{\"data_source\":{\"id\":\"1b39715e-af25-4eac-bf1b-2cfd98ba3a17\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"389749b0-c75c-4d92-a18f-ae71fd0ec584\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"3bc635e5-6182-4909-8cf6-8a1e828fcbf7\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"f4526f37-6624-44c2-8666-ec1e740a2a5e\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"7318f087-e6db-4f56-bd7e-bdd8ff71f895\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"afcbaf8a-9a20-4867-85f1-1a0c5fcb7742\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"389749b0-c75c-4d92-a18f-ae71fd0ec584\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"2683be5e-f390-41b9-bf04-8b2f88ae166a\",\"type\":\"Rect\"},{\"attributes\":{\"callback\":null,\"end\":138.70815000000002},\"id\":\"c6812e76-eb26-4ad0-aa32-76c5d2886b23\",\"type\":\"Range1d\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Defence -- Military defence\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Defence -- Military defence\"],\"height\":[33.996],\"label\":[{\"full_name\":\"Defence -- Military defence\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Defence -- Military defence\"],\"y\":[16.998]}},\"id\":\"51d942c0-b53b-4899-af42-318eac9bf7a5\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"4b3cf73a-eebb-4621-803f-69ef9dca5871\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"72cf5830-6f84-47a0-aa73-9959b173485a\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"2ef120dd-c559-411c-922c-75c2cca63872\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"overlay\":{\"id\":\"017357b4-4252-4cac-8380-755eb736b01f\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"1585a0fe-0961-4f28-89fd-1e09c8d79e73\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"c7e0e693-51b0-4145-b4b6-d105fdcb5d5c\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Economic affairs -- Agriculture, forestry, fishing and hunting\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Economic affairs -- Agriculture, forestry, fishing and hunting\"],\"height\":[4.541],\"label\":[{\"full_name\":\"Economic affairs -- Agriculture, forestry, fishing and hunting\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Economic affairs -- Agriculture, forestry, fishing and hunting\"],\"y\":[2.2705]}},\"id\":\"7582142f-10da-469d-b931-b89b8647c902\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Education -- Subsidiary services to education\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Education -- Subsidiary services to education\"],\"height\":[4.092],\"label\":[{\"full_name\":\"Education -- Subsidiary services to education\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Education -- Subsidiary services to education\"],\"y\":[2.046]}},\"id\":\"98404341-3ad5-4610-afe9-0924b5101eff\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"8052dddf-8ccc-41cb-929e-084a624a49af\",\"type\":\"Rect\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Public order and safety -- Police services\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Public order and safety -- Police services\"],\"height\":[16.645],\"label\":[{\"full_name\":\"Public order and safety -- Police services\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Public order and safety -- Police services\"],\"y\":[8.3225]}},\"id\":\"e770b1db-77a1-4f58-908d-ee0e8c7c071e\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"a0df8739-44fb-49f5-964e-f5e48e859e77\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"c52ce44b-a8e2-4bb4-b236-abec7442a22f\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"47353e25-b257-41e9-be41-904533ea5013\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"bfd40ead-5317-443d-886e-ef7d495c059b\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"a9857b01-491f-4847-ac96-0c08559a6d91\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"741d811f-fb86-42c0-b6c2-85534a86220a\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Environment protection -- Waste management\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Environment protection -- Waste management\"],\"height\":[8.089],\"label\":[{\"full_name\":\"Environment protection -- Waste management\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Environment protection -- Waste management\"],\"y\":[4.0445]}},\"id\":\"4b3cf73a-eebb-4621-803f-69ef9dca5871\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"082657bc-7312-4ad5-862a-560923b0d382\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"2683be5e-f390-41b9-bf04-8b2f88ae166a\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"c5ce5136-f882-4566-a266-88d8e6a1f3c6\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Social protection -- Family and children\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Social protection -- Family and children\"],\"height\":[24.795],\"label\":[{\"full_name\":\"Social protection -- Family and children\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Social protection -- Family and children\"],\"y\":[12.3975]}},\"id\":\"f0601868-c415-4932-b15c-7b702a38e322\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Education -- Pre-primary and primary education\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Education -- Pre-primary and primary education\"],\"height\":[30.942],\"label\":[{\"full_name\":\"Education -- Pre-primary and primary education\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Education -- Pre-primary and primary education\"],\"y\":[15.471]}},\"id\":\"10482660-1784-47fd-b4a2-6a4dc8e82958\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"below\":[{\"id\":\"1ae1fa74-e10b-4018-8f32-bb5061413459\",\"type\":\"CategoricalAxis\"}],\"left\":[{\"id\":\"b9147922-d12b-4f27-a9da-3535b04750c1\",\"type\":\"LinearAxis\"}],\"renderers\":[{\"id\":\"017357b4-4252-4cac-8380-755eb736b01f\",\"type\":\"BoxAnnotation\"},{\"id\":\"c7b3a970-7d1e-4fd1-ac8e-4c5537930d73\",\"type\":\"GlyphRenderer\"},{\"id\":\"3bc635e5-6182-4909-8cf6-8a1e828fcbf7\",\"type\":\"GlyphRenderer\"},{\"id\":\"7b8801c6-b21b-4d92-a7b1-480881fbd8d6\",\"type\":\"GlyphRenderer\"},{\"id\":\"5ab8b5ad-fd88-4c45-a067-32de8aac7cd0\",\"type\":\"GlyphRenderer\"},{\"id\":\"5fbc0159-41c9-4d3e-8f5b-5d8c2d8a1955\",\"type\":\"GlyphRenderer\"},{\"id\":\"9a5999b0-c09b-4399-a4e6-6380c3e05918\",\"type\":\"GlyphRenderer\"},{\"id\":\"1b2373da-f49d-4abe-afd1-824313038596\",\"type\":\"GlyphRenderer\"},{\"id\":\"1bd3a456-5002-458c-b2c7-f6357eb4ee33\",\"type\":\"GlyphRenderer\"},{\"id\":\"3f24bfed-c77e-48b1-97aa-d5d016897a9c\",\"type\":\"GlyphRenderer\"},{\"id\":\"43cbc471-e464-47ce-ace2-26b8e14dfeea\",\"type\":\"GlyphRenderer\"},{\"id\":\"dee79b8b-0218-4db9-8768-b02a26cf1e03\",\"type\":\"GlyphRenderer\"},{\"id\":\"3b92ef4f-6b8d-436e-bc09-147443a3465b\",\"type\":\"GlyphRenderer\"},{\"id\":\"1ce77167-f399-4239-b6a2-86c9d5081a9e\",\"type\":\"GlyphRenderer\"},{\"id\":\"c5ce5136-f882-4566-a266-88d8e6a1f3c6\",\"type\":\"GlyphRenderer\"},{\"id\":\"2ef120dd-c559-411c-922c-75c2cca63872\",\"type\":\"GlyphRenderer\"},{\"id\":\"710bab04-8391-442b-b7f9-720fd4941aab\",\"type\":\"GlyphRenderer\"},{\"id\":\"002eb946-7201-4792-9006-02bc6f91c245\",\"type\":\"GlyphRenderer\"},{\"id\":\"d3813419-8a2f-4b97-ab74-1af280494392\",\"type\":\"GlyphRenderer\"},{\"id\":\"e0322ef0-8fe5-40ec-8d42-7e941829a32d\",\"type\":\"GlyphRenderer\"},{\"id\":\"7b034cc3-c9b1-47ba-aabf-dfbabea941d5\",\"type\":\"GlyphRenderer\"},{\"id\":\"0801992c-ac49-4108-bc0a-43699a36eb36\",\"type\":\"GlyphRenderer\"},{\"id\":\"a4050a01-9d06-4ca7-9003-aa02d079df1a\",\"type\":\"GlyphRenderer\"},{\"id\":\"afcbaf8a-9a20-4867-85f1-1a0c5fcb7742\",\"type\":\"GlyphRenderer\"},{\"id\":\"a750992c-6407-44c7-9d9a-5f3571195619\",\"type\":\"GlyphRenderer\"},{\"id\":\"47353e25-b257-41e9-be41-904533ea5013\",\"type\":\"GlyphRenderer\"},{\"id\":\"741d811f-fb86-42c0-b6c2-85534a86220a\",\"type\":\"GlyphRenderer\"},{\"id\":\"1ae1fa74-e10b-4018-8f32-bb5061413459\",\"type\":\"CategoricalAxis\"},{\"id\":\"b9147922-d12b-4f27-a9da-3535b04750c1\",\"type\":\"LinearAxis\"},{\"id\":\"884ed330-785c-4925-803b-8555917e3c00\",\"type\":\"Grid\"}],\"title\":{\"id\":\"646b2136-598f-4f6e-a422-ccb9574cc584\",\"type\":\"Title\"},\"tool_events\":{\"id\":\"1b9b0180-67b0-40f4-a4c8-d5f077ab02ff\",\"type\":\"ToolEvents\"},\"toolbar\":{\"id\":\"1977291f-ea71-4a99-81d7-5881007e40e8\",\"type\":\"Toolbar\"},\"x_mapper_type\":\"auto\",\"x_range\":{\"id\":\"c9e8bcaa-a3b4-48f0-94d1-c65a9fe17ff5\",\"type\":\"FactorRange\"},\"y_mapper_type\":\"auto\",\"y_range\":{\"id\":\"c6812e76-eb26-4ad0-aa32-76c5d2886b23\",\"type\":\"Range1d\"}},\"id\":\"1585a0fe-0961-4f28-89fd-1e09c8d79e73\",\"subtype\":\"Chart\",\"type\":\"Plot\"},{\"attributes\":{\"data_source\":{\"id\":\"e770b1db-77a1-4f58-908d-ee0e8c7c071e\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"8cee5a5b-87d4-4022-9650-9b3eb9b1624f\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"3b92ef4f-6b8d-436e-bc09-147443a3465b\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"5e462d01-f2a7-4f29-b5c7-e2eae49df5de\",\"type\":\"Rect\"},{\"attributes\":{\"data_source\":{\"id\":\"5eb122fd-c7b4-49c8-8e0c-51d2aca1c423\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"be91099d-5193-4f08-81f2-fdb27adaabe2\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"3f24bfed-c77e-48b1-97aa-d5d016897a9c\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"d6ff78f7-97a1-4498-82ea-d3a2ca754ca2\",\"type\":\"Rect\"},{\"attributes\":{\"callback\":null,\"factors\":[\"Health -- Medical services\",\"Social protection -- Old age\",\"Social protection -- Sickness and disability\",\"Education -- Secondary education\",\"General public services -- Public debt transactions\",\"Defence -- Military defence\",\"Social protection -- Social exclusion n.e.c.\",\"Education -- Pre-primary and primary education\",\"Economic affairs -- Transport\",\"Social protection -- Housing\",\"Social protection -- Family and children\",\"Public order and safety -- Police services\",\"General public services -- Executive and legislative organs, financial and fiscal affairs, external affairs\",\"General public services -- Foreign economic aid\",\"Environment protection -- Waste management\",\"Economic affairs -- General economic, commercial and labour affairs\",\"Education -- Tertiary education\",\"Public order and safety -- Law courts\",\"Housing and community amenities -- Housing development\",\"Economic affairs -- R&D economic affairs\",\"Social protection -- Social protection n.e.c.\",\"Economic affairs -- Agriculture, forestry, fishing and hunting\",\"Health -- Central and other health services\",\"Education -- Subsidiary services to education\",\"Public order and safety -- Prisons\",\"Recreation, culture and religion -- Cultural services\"]},\"id\":\"c9e8bcaa-a3b4-48f0-94d1-c65a9fe17ff5\",\"type\":\"FactorRange\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Economic affairs -- R&D economic affairs\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Economic affairs -- R&D economic affairs\"],\"height\":[4.787],\"label\":[{\"full_name\":\"Economic affairs -- R&D economic affairs\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Economic affairs -- R&D economic affairs\"],\"y\":[2.3935]}},\"id\":\"ccbb3743-7f43-4934-98ff-e07db12c2d9d\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"c92a06f0-c743-4009-a0d1-2a2642d13880\",\"type\":\"Rect\"},{\"attributes\":{\"data_source\":{\"id\":\"51f7d01d-5aa2-477d-8ec1-572003602061\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"6866e4ba-e9f8-4496-8efe-aacf8587f649\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"0801992c-ac49-4108-bc0a-43699a36eb36\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"52f72433-1e95-4c72-8e16-21ffe46d7c60\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"b619914e-86fd-423d-940b-4d7fde65d194\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"c52ce44b-a8e2-4bb4-b236-abec7442a22f\",\"type\":\"Rect\"},{\"attributes\":{\"data_source\":{\"id\":\"25def675-4ce5-469e-88ac-6146ecd88087\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"a6c4646d-52fc-43c3-b828-3d85ca9a1c2a\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"1b2373da-f49d-4abe-afd1-824313038596\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"6866e4ba-e9f8-4496-8efe-aacf8587f649\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"103b5046-42d3-42b0-b836-829cfd298640\",\"type\":\"Rect\"},{\"attributes\":{\"data_source\":{\"id\":\"b860b4b8-8db1-49ca-b503-621d80c4862c\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"134bd488-f906-4d62-a85f-8a9fea6ae434\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"7b8801c6-b21b-4d92-a7b1-480881fbd8d6\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"ccbb3743-7f43-4934-98ff-e07db12c2d9d\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"b619914e-86fd-423d-940b-4d7fde65d194\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"7b034cc3-c9b1-47ba-aabf-dfbabea941d5\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"85b2ff03-523a-4305-b15c-d34dea642794\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"23f48b49-e333-46ea-80ad-0e80fc68c54a\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Education -- Secondary education\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Education -- Secondary education\"],\"height\":[38.193],\"label\":[{\"full_name\":\"Education -- Secondary education\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Education -- Secondary education\"],\"y\":[19.0965]}},\"id\":\"24612984-719e-4b4f-8471-1a1625e1778b\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Economic affairs -- Transport\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Economic affairs -- Transport\"],\"height\":[28.061],\"label\":[{\"full_name\":\"Economic affairs -- Transport\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Economic affairs -- Transport\"],\"y\":[14.0305]}},\"id\":\"5eb122fd-c7b4-49c8-8e0c-51d2aca1c423\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"75c4e98c-0f73-4bad-b89c-8a8b7cc52401\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"52f72433-1e95-4c72-8e16-21ffe46d7c60\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"002eb946-7201-4792-9006-02bc6f91c245\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"7318f087-e6db-4f56-bd7e-bdd8ff71f895\",\"type\":\"Rect\"},{\"attributes\":{\"plot\":{\"id\":\"1585a0fe-0961-4f28-89fd-1e09c8d79e73\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"9d81dda6-3bc9-4ff5-afb4-300698fee336\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"plot\":{\"id\":\"1585a0fe-0961-4f28-89fd-1e09c8d79e73\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"4bfa6018-fc17-47e1-9b92-0947bca1e5d1\",\"type\":\"PanTool\"},{\"attributes\":{\"data_source\":{\"id\":\"1717c40a-345a-4f95-a828-dec09cbe6f6c\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"448bbb80-af65-4099-98fa-3899c534fc30\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"710bab04-8391-442b-b7f9-720fd4941aab\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"be5a8204-7b4f-4759-a23b-72571dfd2f5d\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3c86143d-a1c6-490e-8b65-049cb77caa13\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"e0322ef0-8fe5-40ec-8d42-7e941829a32d\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Social protection -- Sickness and disability\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Social protection -- Sickness and disability\"],\"height\":[52.956],\"label\":[{\"full_name\":\"Social protection -- Sickness and disability\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Social protection -- Sickness and disability\"],\"y\":[26.478]}},\"id\":\"b860b4b8-8db1-49ca-b503-621d80c4862c\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"35cf082b-308c-4326-a696-c290044148c5\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"30240610-a3de-4568-ad70-8d657265afc1\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"d3813419-8a2f-4b97-ab74-1af280494392\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"00dd3699-6e11-4e81-a238-8a3865185539\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"3b6d36ae-0029-4a1d-b8aa-361cee1ce2af\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"c7b3a970-7d1e-4fd1-ac8e-4c5537930d73\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"22c9bbfb-f934-45d0-bf23-cb3f35769b51\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"15e332bc-b584-48ad-afcd-e8311d5fc49a\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"5fbc0159-41c9-4d3e-8f5b-5d8c2d8a1955\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data_source\":{\"id\":\"c4193789-35c5-4b0b-be88-c3fa6a408e84\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"c92a06f0-c743-4009-a0d1-2a2642d13880\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"1ce77167-f399-4239-b6a2-86c9d5081a9e\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Social protection -- Social exclusion n.e.c.\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Social protection -- Social exclusion n.e.c.\"],\"height\":[31.485],\"label\":[{\"full_name\":\"Social protection -- Social exclusion n.e.c.\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Social protection -- Social exclusion n.e.c.\"],\"y\":[15.7425]}},\"id\":\"25def675-4ce5-469e-88ac-6146ecd88087\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"7582142f-10da-469d-b931-b89b8647c902\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"103b5046-42d3-42b0-b836-829cfd298640\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"a4050a01-9d06-4ca7-9003-aa02d079df1a\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"General public services -- Executive and legislative organs, financial and fiscal affairs, external affairs\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"General public services -- Executive and legislative organs, financial and fiscal affairs, external affairs\"],\"height\":[10.101],\"label\":[{\"full_name\":\"General public services -- Executive and legislative organs, financial and fiscal affairs, external affairs\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"General public services -- Executive and legislative organs, financial and fiscal affairs, external affairs\"],\"y\":[5.0505]}},\"id\":\"c4193789-35c5-4b0b-be88-c3fa6a408e84\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"017357b4-4252-4cac-8380-755eb736b01f\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"134bd488-f906-4d62-a85f-8a9fea6ae434\",\"type\":\"Rect\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Social protection -- Housing\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Social protection -- Housing\"],\"height\":[26.374],\"label\":[{\"full_name\":\"Social protection -- Housing\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Social protection -- Housing\"],\"y\":[13.187]}},\"id\":\"363a9076-29f1-4b66-b8a4-fe00948a9f7b\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"98404341-3ad5-4610-afe9-0924b5101eff\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"5e462d01-f2a7-4f29-b5c7-e2eae49df5de\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"a750992c-6407-44c7-9d9a-5f3571195619\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"f06991c7-df0f-4ab6-833d-2bbcf908ff97\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Economic affairs -- General economic, commercial and labour affairs\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Economic affairs -- General economic, commercial and labour affairs\"],\"height\":[6.03],\"label\":[{\"full_name\":\"Economic affairs -- General economic, commercial and labour affairs\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Economic affairs -- General economic, commercial and labour affairs\"],\"y\":[3.015]}},\"id\":\"1717c40a-345a-4f95-a828-dec09cbe6f6c\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"be91099d-5193-4f08-81f2-fdb27adaabe2\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"15e332bc-b584-48ad-afcd-e8311d5fc49a\",\"type\":\"Rect\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Education -- Tertiary education\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Education -- Tertiary education\"],\"height\":[5.896],\"label\":[{\"full_name\":\"Education -- Tertiary education\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Education -- Tertiary education\"],\"y\":[2.948]}},\"id\":\"75c4e98c-0f73-4bad-b89c-8a8b7cc52401\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"3b6d36ae-0029-4a1d-b8aa-361cee1ce2af\",\"type\":\"Rect\"},{\"attributes\":{\"fill_alpha\":{\"field\":\"fill_alpha\"},\"fill_color\":{\"field\":\"color\"},\"height\":{\"field\":\"height\",\"units\":\"data\"},\"line_color\":{\"field\":\"line_color\"},\"width\":{\"field\":\"width\",\"units\":\"data\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"1149f509-9cce-4875-bf4f-47ca97df52bc\",\"type\":\"Rect\"},{\"attributes\":{\"plot\":{\"id\":\"1585a0fe-0961-4f28-89fd-1e09c8d79e73\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"9c154a86-0ba8-4d9b-983f-c49c8c4c740e\",\"type\":\"HelpTool\"},{\"attributes\":{\"plot\":{\"id\":\"1585a0fe-0961-4f28-89fd-1e09c8d79e73\",\"subtype\":\"Chart\",\"type\":\"Plot\"}},\"id\":\"b1039f6b-15a4-45ca-87c2-e5090d9fb18c\",\"type\":\"ResetTool\"},{\"attributes\":{\"data_source\":{\"id\":\"51d942c0-b53b-4899-af42-318eac9bf7a5\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"d6ff78f7-97a1-4498-82ea-d3a2ca754ca2\",\"type\":\"Rect\"},\"hover_glyph\":null,\"nonselection_glyph\":null,\"selection_glyph\":null},\"id\":\"9a5999b0-c09b-4399-a4e6-6380c3e05918\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"plot\":null,\"text\":\"Government functions accounting for 95% of all spending\"},\"id\":\"646b2136-598f-4f6e-a422-ccb9574cc584\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"line_alpha\",\"x\",\"color\",\"height\",\"line_color\",\"label\",\"width\",\"y\",\"fill_alpha\"],\"data\":{\"chart_index\":[{\"full_name\":\"Health -- Central and other health services\"}],\"color\":[\"#f22c40\"],\"fill_alpha\":[0.8],\"full_name\":[\"Health -- Central and other health services\"],\"height\":[4.46],\"label\":[{\"full_name\":\"Health -- Central and other health services\"}],\"line_alpha\":[1.0],\"line_color\":[\"white\"],\"width\":[0.8],\"x\":[\"Health -- Central and other health services\"],\"y\":[2.23]}},\"id\":\"f4526f37-6624-44c2-8666-ec1e740a2a5e\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"dimension\":1,\"plot\":{\"id\":\"1585a0fe-0961-4f28-89fd-1e09c8d79e73\",\"subtype\":\"Chart\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"85b2ff03-523a-4305-b15c-d34dea642794\",\"type\":\"BasicTicker\"}},\"id\":\"884ed330-785c-4925-803b-8555917e3c00\",\"type\":\"Grid\"}],\"root_ids\":[\"1585a0fe-0961-4f28-89fd-1e09c8d79e73\"]},\"title\":\"Bokeh Application\",\"version\":\"0.12.3\"}};\n",
" var render_items = [{\"docid\":\"11ca4eaf-5644-4e0b-bfb3-4882b803e771\",\"elementid\":\"d8255c3d-ea94-4560-afac-6320f136bc6d\",\"modelid\":\"1585a0fe-0961-4f28-89fd-1e09c8d79e73\"}];\n",
" \n",
" Bokeh.embed.embed_items(docs_json, render_items);\n",
" });\n",
" },\n",
" function(Bokeh) {\n",
" }\n",
" ];\n",
" \n",
" function run_inline_js() {\n",
" \n",
" if ((window.Bokeh !== undefined) || (force === \"1\")) {\n",
" for (var i = 0; i < inline_js.length; i++) {\n",
" inline_js[i](window.Bokeh);\n",
" }if (force === \"1\") {\n",
" display_loaded();\n",
" }} else if (Date.now() < window._bokeh_timeout) {\n",
" setTimeout(run_inline_js, 100);\n",
" } else if (!window._bokeh_failed_load) {\n",
" console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n",
" window._bokeh_failed_load = true;\n",
" } else if (!force) {\n",
" var cell = $(\"#d8255c3d-ea94-4560-afac-6320f136bc6d\").parents('.cell').data().cell;\n",
" cell.output_area.append_execute_result(NB_LOAD_WARNING)\n",
" }\n",
" \n",
" }\n",
" \n",
" if (window._bokeh_is_loading === 0) {\n",
" console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
" run_inline_js();\n",
" } else {\n",
" load_libs(js_urls, function() {\n",
" console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
" run_inline_js();\n",
" });\n",
" }\n",
" }(this));\n",
"</script>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"dp_2015 = dp[dp.Year == 2015].sort_values('Amount', ascending=False)\n",
"frac_cum_sum = dp_2015.Amount.cumsum() / dp_2015.Amount.sum()\n",
"dp_big = dp_2015.loc[frac_cum_sum[frac_cum_sum < 0.95].index]\n",
"dp_big['full_name'] = dp_big.function_name + r' -- ' + dp_big.sub_function_name\n",
"label = CatAttr(df=dp_big, columns='full_name', sort=False)\n",
"\n",
"show(Bar(dp_big.sort_values('Amount', ascending=False), label=label, values='Amount',\n",
" legend=False, palette=palette,\n",
" title='Government functions accounting for 95% of all spending',\n",
" xlabel='', ylabel=label_tot_alt))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"That's all the analysis I want to show for now. I hope to delve into other aspects at a later date."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Acknowledgments\n",
"\n",
"Thanks to,\n",
"\n",
"- Jake Vanderplas for writing the plugin allowing me to host this notebook on my blog.\n",
"- Christopher Chantrill for his curation of the data\n",
"- The Bureau of Statistics, for providing inflation data and a nice API\n",
"- The UK Treasury, for providing government spending data in a *reasonably* accessible form"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Links\n",
"\n",
"- Find this notebook [here](https://gist.github.com/eddiejessup/a780d3a204bb6abd0bfd8918edaa1eb7)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.0"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment