{ "cells": [ { "cell_type": "markdown", "source": [ "# MSTICPy - Matrix Plot\r\n", "\r\n", "This notebook demonstrates the use of the MSTICPy matrix visualization built using the [Bokeh library](https://bokeh.pydata.org).\r\n", "\r\n", "You must have msticpy installed:\r\n", "```\r\n", "%pip install --upgrade msticpy\r\n", "```\r\n", "\r\n", "The matrix plot is designed to show interactions between two items stored\r\n", "in a pandas DataFrame in a x-y grid.\r\n", "\r\n", "To take an example, if you have a DataFrame with source and destination IP addresses\r\n", "(for example, a firewall log), you can plot the source IPs on the y axis and\r\n", "destination IPs on the x axis. Where there is an event (row) that links a given\r\n", "source and destination the matrix plot will plot a circle.\r\n", "\r\n", "By default the circle is proportional to the number of events containing a given\r\n", "source/destination (x and y).\r\n", "\r\n", "The matrix plot also has the following variations:\r\n", "- You can use a named column from the input data (e.g. bytes transmitted) to control\r\n", " the size of the plotted circle.\r\n", "- You can invert the circle plot size, so that rarer interactions are shown\r\n", " with a large intersection point.\r\n", "- You can plot just the presence of one or more interactions - this plots\r\n", " a fixed-size point and is useful if you only want to see the presence/\r\n", " absence of an interaction but don't care about the number of interactions.\r\n", "- You can use a count of distinct values to control the size (e.g. you might\r\n", " specify \"protocol\" as the value column and want to see how many distinct\r\n", " protocols the source/destination interacted over).\r\n", "- You can plot the log of any of the above counts/size - this is useful if\r\n", " the variance in the size is orders of magnitude.\r\n" ], "metadata": {} }, { "cell_type": "code", "execution_count": 1, "source": [ "# Imports\r\n", "\r\n", "from msticpy.common.utility import check_py_version\r\n", "MIN_REQ_PYTHON = (3,6)\r\n", "check_py_version(MIN_REQ_PYTHON)\r\n", "\r\n", "import pandas as pd\r\n", "\r\n", "from msticpy import init_notebook\r\n", "init_notebook(globals())\r\n" ], "outputs": [ { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "

Starting Notebook initialization...

" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "msticpy version installed: 1.3.1 latest published: 1.3.1
Latest version is installed.

" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "Processing imports....
" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "Imported: pd (pandas), IPython.get_ipython, IPython.display.display, IPython.display.HTML, IPython.display.Markdown, widgets (ipywidgets), pathlib.Path, plt (matplotlib.pyplot), matplotlib.MatplotlibDeprecationWarning, sns (seaborn), np (numpy), msticpy, msticpy.data.QueryProvider, msticpy.nbtools.foliummap.FoliumMap, msticpy.common.utility.md, msticpy.common.utility.md_warn, msticpy.common.wsconfig.WorkspaceConfig, msticpy.datamodel.pivot.Pivot, msticpy.datamodel.entities, msticpy.vis.mp_pandas_plot
" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "Checking configuration....
" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "Setting notebook options....
" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "
" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "

Notebook initialization complete

" ] }, "metadata": {} }, { "output_type": "execute_result", "data": { "text/plain": [ "True" ] }, "metadata": {}, "execution_count": 1 } ], "metadata": { "ExecuteTime": { "end_time": "2020-01-30T20:46:28.835951Z", "start_time": "2020-01-30T20:46:26.259919Z" }, "scrolled": true } }, { "cell_type": "markdown", "source": [ "# Creating some sample data\r\n" ], "metadata": {} }, { "cell_type": "code", "execution_count": 2, "source": [ "all_df = pd.read_csv(\r\n", " \"data/az_net_flows.csv\",\r\n", " index_col=0,\r\n", " parse_dates=[\r\n", " \"TimeGenerated\",\r\n", " \"FlowStartTime\",\r\n", " \"FlowEndTime\",\r\n", " \"FlowIntervalEndTime\",\r\n", " ],\r\n", " )\r\n", "\r\n", "# Create some sample data to work with\r\n", "net_df = (\r\n", " all_df[[\"AllExtIPs\", \"L7Protocol\", \"TotalAllowedFlows\"]]\r\n", " .rename(columns={\"AllExtIPs\": \"SourceIP\"})\r\n", " .sample(100)\r\n", ")\r\n", "\r\n", "\r\n", "def get_dest_ip(row):\r\n", " dest_ip = None\r\n", " while dest_ip is None or row.SourceIP == dest_ip:\r\n", " dest_ip = net_df[~net_df[\"SourceIP\"].str.startswith(\"10.\")].sample(1)[\"SourceIP\"].values[0]\r\n", " return dest_ip\r\n", "\r\n", "net_df[\"DestinationIP\"] = net_df.apply(get_dest_ip, axis=1)\r\n", "net_df.head(3)" ], "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " SourceIP L7Protocol TotalAllowedFlows DestinationIP\n", "690 20.38.98.100 https 1.0 65.55.44.109\n", "544 13.67.143.117 https 1.0 13.71.172.130\n", "957 65.55.163.76 https 5.0 13.65.107.32" ], "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
SourceIPL7ProtocolTotalAllowedFlowsDestinationIP
69020.38.98.100https1.065.55.44.109
54413.67.143.117https1.013.71.172.130
95765.55.163.76https5.013.65.107.32
\n", "
" ] }, "metadata": {}, "execution_count": 2 } ], "metadata": { "ExecuteTime": { "end_time": "2020-01-30T20:46:28.957882Z", "start_time": "2020-01-30T20:46:28.836950Z" } } }, { "cell_type": "markdown", "source": [ "## The basic matrix/interaction plot\r\n", "\r\n", "The basic plot displays a circle at each interaction between the X and\r\n", "Y axes items. The size of the circle is proportional to the number \r\n", "of records/rows in which the X and Y parameter interact.\r\n", "\r\n", "Here we are using MSTICPy pandas accessor to plot the graph directly\r\n", "from the DataFrame\r\n", "\r\n", "`data.mp_plot.matrix()`" ], "metadata": {} }, { "cell_type": "code", "execution_count": 3, "source": [ "net_df.mp_plot.matrix(x=\"SourceIP\", y=\"DestinationIP\", title=\"IP Interaction\")" ], "outputs": [ { "output_type": "display_data", "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "application/javascript": "\n(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n\n if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n var JS_MIME_TYPE = 'application/javascript';\n var HTML_MIME_TYPE = 'text/html';\n var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n var CLASS_NAME = 'output_bokeh rendered_html';\n\n /**\n * Render data to the DOM node\n */\n function render(props, node) {\n var script = document.createElement(\"script\");\n node.appendChild(script);\n }\n\n /**\n * Handle when an output is cleared or removed\n */\n function handleClearOutput(event, handle) {\n var cell = handle.cell;\n\n var id = cell.output_area._bokeh_element_id;\n var server_id = cell.output_area._bokeh_server_id;\n // Clean up Bokeh references\n if (id != null && id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n\n if (server_id !== undefined) {\n // Clean up Bokeh references\n var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n cell.notebook.kernel.execute(cmd, {\n iopub: {\n output: function(msg) {\n var id = msg.content.text.trim();\n if (id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n }\n }\n });\n // Destroy server and session\n var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n cell.notebook.kernel.execute(cmd);\n }\n }\n\n /**\n * Handle when a new output is added\n */\n function handleAddOutput(event, handle) {\n var output_area = handle.output_area;\n var output = handle.output;\n\n // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n if ((output.output_type != \"display_data\") || (!Object.prototype.hasOwnProperty.call(output.data, EXEC_MIME_TYPE))) {\n return\n }\n\n var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n\n if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n // store reference to embed id on output_area\n output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n }\n if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n var bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n var script_attrs = bk_div.children[0].attributes;\n for (var i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\n }\n // store reference to server id on output_area\n output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n }\n }\n\n function register_renderer(events, OutputArea) {\n\n function append_mime(data, metadata, element) {\n // create a DOM node to render to\n var toinsert = this.create_output_subarea(\n metadata,\n CLASS_NAME,\n EXEC_MIME_TYPE\n );\n this.keyboard_manager.register_events(toinsert);\n // Render to node\n var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n render(props, toinsert[toinsert.length - 1]);\n element.append(toinsert);\n return toinsert\n }\n\n /* Handle when an output is cleared or removed */\n events.on('clear_output.CodeCell', handleClearOutput);\n events.on('delete.Cell', handleClearOutput);\n\n /* Handle when a new output is added */\n events.on('output_added.OutputArea', handleAddOutput);\n\n /**\n * Register the mime type and append_mime function with output_area\n */\n OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n /* Is output safe? */\n safe: true,\n /* Index of renderer in `output_area.display_order` */\n index: 0\n });\n }\n\n // register the mime type if in Jupyter Notebook environment and previously unregistered\n if (root.Jupyter !== undefined) {\n var events = require('base/js/events');\n var OutputArea = require('notebook/js/outputarea').OutputArea;\n\n if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n register_renderer(events, OutputArea);\n }\n }\n\n \n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n var NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\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 \"

\\n\"+\n \"
    \\n\"+\n \"
  • re-rerun `output_notebook()` to attempt to load from CDN again, or
  • \\n\"+\n \"
  • use INLINE resources instead, as so:
  • \\n\"+\n \"
\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n var el = document.getElementById(\"1002\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"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.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error(url) {\n console.error(\"failed to load \" + url);\n }\n\n for (let i = 0; i < css_urls.length; i++) {\n const url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n const hashes = {\"https://cdn.bokeh.org/bokeh/release/bokeh-2.3.2.min.js\": \"XypntL49z55iwGVUW4qsEu83zKL3XEcz0MjuGOQ9SlaaQ68X/g+k1FcioZi7oQAc\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.2.min.js\": \"bEsM86IHGDTLCS0Zod8a8WM6Y4+lafAL/eSiyQcuPzinmWNgNO2/olUF0Z2Dkn5i\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\": \"TX0gSQTdXTTeScqxj6PVQxTiRW8DOoGVwinyi1D3kxv7wuxQ02XkOxv0xwiypcAH\"};\n\n for (let i = 0; i < js_urls.length; i++) {\n const url = js_urls[i];\n const element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.async = false;\n element.src = url;\n if (url in hashes) {\n element.crossOrigin = \"anonymous\";\n element.integrity = \"sha384-\" + hashes[url];\n }\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n \n var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.2.min.js\"];\n var css_urls = [];\n \n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n function(Bokeh) {\n \n \n }\n ];\n\n function run_inline_js() {\n \n if (root.Bokeh !== undefined || force === true) {\n \n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }\n if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n var cell = $(document.getElementById(\"1002\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));", "application/vnd.bokehjs_load.v0+json": "" }, "metadata": {} }, { "output_type": "display_data", "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "application/vnd.bokehjs_exec.v0+json": "", "application/javascript": "(function(root) {\n function embed_document(root) {\n \n var docs_json = {\"4886a7c7-79bd-447a-b046-29ff5c453ce1\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1015\"}],\"center\":[{\"id\":\"1017\"},{\"id\":\"1020\"}],\"height\":700,\"left\":[{\"id\":\"1018\"}],\"outline_line_color\":null,\"renderers\":[{\"id\":\"1038\"}],\"title\":{\"id\":\"1005\"},\"toolbar\":{\"id\":\"1027\"},\"toolbar_location\":\"above\",\"width\":900,\"x_range\":{\"id\":\"1007\"},\"x_scale\":{\"id\":\"1011\"},\"y_range\":{\"id\":\"1009\"},\"y_scale\":{\"id\":\"1013\"}},\"id\":\"1004\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1021\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1048\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1023\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1025\",\"type\":\"SaveTool\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"SourceIP\",\"@SourceIP\"],[\"DestinationIP\",\"@DestinationIP\"],[\"value\",\"@size\"]]},\"id\":\"1033\",\"type\":\"HoverTool\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"1026\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"data_source\":{\"id\":\"1003\"},\"glyph\":{\"id\":\"1036\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1037\"},\"view\":{\"id\":\"1039\"}},\"id\":\"1038\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{\"DestinationIP\":[\"40.77.228.69\",\"52.168.138.145\",\"13.71.172.130\",\"40.91.75.5\",\"40.124.45.19\",\"13.71.172.128\",\"172.217.15.99\",\"20.38.98.100\",\"104.43.212.12\",\"13.71.172.128\",\"13.71.172.130\",\"40.124.45.19\",\"65.55.44.109\",\"65.55.44.109\",\"13.65.107.32\",\"40.124.45.19\",\"40.77.228.69\",\"52.165.170.112\",\"52.168.138.145\",\"72.21.81.200\",\"13.65.107.32\",\"40.124.45.19\",\"52.168.138.145\",\"65.55.44.109\",\"52.168.138.145\",\"40.124.45.19\",\"72.21.91.29\",\"72.21.81.200\",\"40.91.75.5\",\"13.71.172.130\",\"65.55.44.108\",\"65.55.44.109\",\"72.21.81.240\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"13.71.172.128\",\"40.77.232.95\",\"52.165.170.112\",\"65.55.44.109\",\"72.21.81.200\",\"72.21.91.29\",\"52.168.138.145\",\"13.67.143.117\",\"13.68.93.109\",\"13.71.172.128\",\"23.48.36.78\",\"52.165.170.112\",\"65.55.44.109\",\"20.38.98.100\",\"8.249.241.254\",\"40.77.228.69\",\"172.217.15.99\",\"13.67.143.117\",\"13.71.172.130\",\"40.124.45.19\",\"40.77.226.250\",\"52.239.152.10\",\"65.55.44.109\",\"90.130.70.73\",\"20.38.98.100\",\"65.55.44.109\",\"13.65.107.32\",\"13.67.143.117\",\"20.38.98.100\",\"13.67.143.117\",\"13.71.172.128\",\"13.71.172.130\",\"13.83.148.218\",\"20.38.98.100\",\"23.4.187.27\",\"40.124.45.19\",\"65.55.44.108\",\"72.21.81.200\",\"72.21.91.29\",\"99.84.104.63\",\"13.65.107.32\",\"40.124.45.19\",\"172.217.15.99\",\"8.249.241.254\",\"13.68.93.109\",\"40.77.228.69\",\"65.55.44.109\",\"52.168.138.145\",\"40.124.45.19\",\"157.55.134.136\"],\"SourceIP\":[\"10.0.3.5\",\"10.0.3.5\",\"104.43.212.12\",\"104.43.212.12\",\"13.107.4.50\",\"13.65.107.32\",\"13.65.107.32\",\"13.65.107.32\",\"13.67.143.117\",\"13.67.143.117\",\"13.67.143.117\",\"13.67.143.117\",\"13.67.143.117\",\"13.68.93.109\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.130\",\"13.71.172.130\",\"13.71.172.130\",\"13.71.172.130\",\"13.83.148.218\",\"131.107.147.209\",\"157.55.134.136\",\"172.217.15.99\",\"172.217.8.14\",\"20.38.98.100\",\"20.38.98.100\",\"20.38.98.100\",\"20.38.98.100\",\"205.185.216.42\",\"23.4.187.27\",\"23.48.36.78\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.77.226.250\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.232.95\",\"40.77.232.95\",\"40.91.75.5\",\"52.165.170.112\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.239.152.10\",\"52.239.152.10\",\"65.55.163.76\",\"65.55.44.108\",\"65.55.44.108\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"72.21.81.200\",\"72.21.81.200\",\"72.21.81.240\",\"72.21.81.240\",\"72.21.91.29\",\"72.21.91.29\",\"72.21.91.29\",\"8.249.241.254\",\"90.130.70.73\",\"99.84.104.63\"],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85],\"plt_size\":{\"__ndarray__\":\"AAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAUQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAABRAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAeQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAABRAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAABRAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAAFEAAAAAAAAAEQAAAAAAAAARAAAAAAAAAFEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAAFEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAUQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAkQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAUQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[86]},\"row_count\":[1,1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,3,1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,2,1,1,2,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,4,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\"size\":[1,1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,3,1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,2,1,1,2,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,4,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]},\"selected\":{\"id\":\"1047\"},\"selection_policy\":{\"id\":\"1048\"}},\"id\":\"1003\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1045\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"source\":{\"id\":\"1003\"}},\"id\":\"1039\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"1042\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"text\":\"IP Interaction\",\"text_font_size\":\"15pt\"},\"id\":\"1005\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1011\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"1041\",\"type\":\"AllLabels\"},{\"attributes\":{\"factors\":[\"40.77.228.69\",\"52.168.138.145\",\"13.71.172.130\",\"40.91.75.5\",\"40.124.45.19\",\"13.71.172.128\",\"172.217.15.99\",\"20.38.98.100\",\"104.43.212.12\",\"65.55.44.109\",\"13.65.107.32\",\"52.165.170.112\",\"72.21.81.200\",\"72.21.91.29\",\"65.55.44.108\",\"72.21.81.240\",\"40.77.232.95\",\"13.67.143.117\",\"13.68.93.109\",\"23.48.36.78\",\"8.249.241.254\",\"40.77.226.250\",\"52.239.152.10\",\"90.130.70.73\",\"13.83.148.218\",\"23.4.187.27\",\"99.84.104.63\",\"157.55.134.136\"]},\"id\":\"1009\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"1013\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"1024\",\"type\":\"ResetTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.6},\"fill_color\":{\"value\":\"red\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"field\":\"plt_size\"},\"x\":{\"field\":\"SourceIP\"},\"y\":{\"field\":\"DestinationIP\"}},\"id\":\"1036\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"1044\",\"type\":\"AllLabels\"},{\"attributes\":{\"axis\":{\"id\":\"1015\"},\"grid_line_alpha\":0.1,\"grid_line_color\":\"navy\",\"ticker\":null},\"id\":\"1017\",\"type\":\"Grid\"},{\"attributes\":{\"axis_label\":\"DestinationIP\",\"axis_line_color\":null,\"formatter\":{\"id\":\"1042\"},\"major_label_policy\":{\"id\":\"1041\"},\"major_label_standoff\":0,\"major_label_text_font_size\":\"11pt\",\"major_tick_line_color\":null,\"ticker\":{\"id\":\"1019\"}},\"id\":\"1018\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"overlay\":{\"id\":\"1026\"}},\"id\":\"1022\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1047\",\"type\":\"Selection\"},{\"attributes\":{\"factors\":[\"10.0.3.5\",\"104.43.212.12\",\"13.107.4.50\",\"13.65.107.32\",\"13.67.143.117\",\"13.68.93.109\",\"13.71.172.128\",\"13.71.172.130\",\"13.83.148.218\",\"131.107.147.209\",\"157.55.134.136\",\"172.217.15.99\",\"172.217.8.14\",\"20.38.98.100\",\"205.185.216.42\",\"23.4.187.27\",\"23.48.36.78\",\"40.124.45.19\",\"40.77.226.250\",\"40.77.228.69\",\"40.77.232.95\",\"40.91.75.5\",\"52.165.170.112\",\"52.168.138.145\",\"52.239.152.10\",\"65.55.163.76\",\"65.55.44.108\",\"65.55.44.109\",\"72.21.81.200\",\"72.21.81.240\",\"72.21.91.29\",\"8.249.241.254\",\"90.130.70.73\",\"99.84.104.63\"]},\"id\":\"1007\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"1019\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"1016\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"1021\"},{\"id\":\"1022\"},{\"id\":\"1023\"},{\"id\":\"1024\"},{\"id\":\"1025\"},{\"id\":\"1033\"}]},\"id\":\"1027\",\"type\":\"Toolbar\"},{\"attributes\":{\"axis_label\":\"SourceIP\",\"axis_line_color\":null,\"formatter\":{\"id\":\"1045\"},\"major_label_orientation\":1.5707963267948966,\"major_label_policy\":{\"id\":\"1044\"},\"major_label_standoff\":0,\"major_label_text_font_size\":\"11pt\",\"major_tick_line_color\":null,\"ticker\":{\"id\":\"1016\"}},\"id\":\"1015\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"axis\":{\"id\":\"1018\"},\"dimension\":1,\"grid_line_alpha\":0.1,\"grid_line_color\":\"navy\",\"ticker\":null},\"id\":\"1020\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"red\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"field\":\"plt_size\"},\"x\":{\"field\":\"SourceIP\"},\"y\":{\"field\":\"DestinationIP\"}},\"id\":\"1037\",\"type\":\"Circle\"}],\"root_ids\":[\"1004\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n var render_items = [{\"docid\":\"4886a7c7-79bd-447a-b046-29ff5c453ce1\",\"root_ids\":[\"1004\"],\"roots\":{\"1004\":\"0ffe5812-238b-4500-9fbd-c6ddf970b799\"}}];\n root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n\n }\n if (root.Bokeh !== undefined) {\n embed_document(root);\n } else {\n var attempts = 0;\n var timer = setInterval(function(root) {\n if (root.Bokeh !== undefined) {\n clearInterval(timer);\n embed_document(root);\n } else {\n attempts++;\n if (attempts > 100) {\n clearInterval(timer);\n console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n }\n }\n }, 10, root)\n }\n})(window);" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1004" } } }, { "output_type": "execute_result", "data": { "text/plain": [ "Figure(id='1004', ...)" ], "text/html": [ "
Figure(
id = '1004', …)
above = [],
align = 'start',
aspect_ratio = None,
aspect_scale = 1,
background = None,
background_fill_alpha = 1.0,
background_fill_color = '#ffffff',
below = [CategoricalAxis(id='1015', ...)],
border_fill_alpha = 1.0,
border_fill_color = '#ffffff',
center = [Grid(id='1017', ...), Grid(id='1020', ...)],
css_classes = [],
disabled = False,
extra_x_ranges = {},
extra_y_ranges = {},
frame_height = None,
frame_width = None,
height = 700,
height_policy = 'auto',
hidpi = True,
inner_height = 0,
inner_width = 0,
js_event_callbacks = {},
js_property_callbacks = {},
left = [CategoricalAxis(id='1018', ...)],
lod_factor = 10,
lod_interval = 300,
lod_threshold = 2000,
lod_timeout = 500,
margin = (0, 0, 0, 0),
match_aspect = False,
max_height = None,
max_width = None,
min_border = 5,
min_border_bottom = None,
min_border_left = None,
min_border_right = None,
min_border_top = None,
min_height = None,
min_width = None,
name = None,
outer_height = 0,
outer_width = 0,
outline_line_alpha = 1.0,
outline_line_cap = 'butt',
outline_line_color = None,
outline_line_dash = [],
outline_line_dash_offset = 0,
outline_line_join = 'bevel',
outline_line_width = 1,
output_backend = 'canvas',
renderers = [GlyphRenderer(id='1038', ...)],
reset_policy = 'standard',
right = [],
sizing_mode = None,
subscribed_events = [],
syncable = True,
tags = [],
title = Title(id='1005', ...),
title_location = 'above',
toolbar = Toolbar(id='1027', ...),
toolbar_location = 'above',
toolbar_sticky = True,
visible = True,
width = 900,
width_policy = 'auto',
x_range = FactorRange(id='1007', ...),
x_scale = CategoricalScale(id='1011', ...),
y_range = FactorRange(id='1009', ...),
y_scale = CategoricalScale(id='1013', ...))
\n", "\n" ] }, "metadata": {}, "execution_count": 3 } ], "metadata": {} }, { "cell_type": "markdown", "source": [ "## Using the Bokeh interactive tools\r\n", "\r\n", "The Bokeh graph is interactive and has the following features:\r\n", "- Tooltip display for each event marker as you hover over it\r\n", "- Toolbar with the following tools (most are toggles enabling or disabling the tool):\r\n", " - Panning \r\n", " - Select zoom\r\n", " - Mouse wheel zoom\r\n", " - Reset to default view\r\n", " - Save image to PNG\r\n", " - Hover tool" ], "metadata": {} }, { "cell_type": "markdown", "source": [ "## Sorting the X and Y values\r\n", "\r\n", "You can use `sort` to sort both axes or `sort_x` and `sort_y` to individually sort the values.\r\n", "\r\n", "The sort parameters take values \"asc\" (ascending), \"desc\" (descending), `True` (ascending).\r\n", "`None` and `False` produce no sorting." ], "metadata": {} }, { "cell_type": "code", "execution_count": 25, "source": [ "net_df.mp_plot.matrix(\r\n", " x=\"SourceIP\",\r\n", " y=\"DestinationIP\",\r\n", " title=\"IP Interaction\",\r\n", " sort_y=\"asc\",\r\n", " sort_x=False,\r\n", ")" ], "outputs": [ { "output_type": "display_data", "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "application/javascript": "\n(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n\n if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n var JS_MIME_TYPE = 'application/javascript';\n var HTML_MIME_TYPE = 'text/html';\n var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n var CLASS_NAME = 'output_bokeh rendered_html';\n\n /**\n * Render data to the DOM node\n */\n function render(props, node) {\n var script = document.createElement(\"script\");\n node.appendChild(script);\n }\n\n /**\n * Handle when an output is cleared or removed\n */\n function handleClearOutput(event, handle) {\n var cell = handle.cell;\n\n var id = cell.output_area._bokeh_element_id;\n var server_id = cell.output_area._bokeh_server_id;\n // Clean up Bokeh references\n if (id != null && id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n\n if (server_id !== undefined) {\n // Clean up Bokeh references\n var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n cell.notebook.kernel.execute(cmd, {\n iopub: {\n output: function(msg) {\n var id = msg.content.text.trim();\n if (id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n }\n }\n });\n // Destroy server and session\n var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n cell.notebook.kernel.execute(cmd);\n }\n }\n\n /**\n * Handle when a new output is added\n */\n function handleAddOutput(event, handle) {\n var output_area = handle.output_area;\n var output = handle.output;\n\n // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n if ((output.output_type != \"display_data\") || (!Object.prototype.hasOwnProperty.call(output.data, EXEC_MIME_TYPE))) {\n return\n }\n\n var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n\n if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n // store reference to embed id on output_area\n output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n }\n if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n var bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n var script_attrs = bk_div.children[0].attributes;\n for (var i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\n }\n // store reference to server id on output_area\n output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n }\n }\n\n function register_renderer(events, OutputArea) {\n\n function append_mime(data, metadata, element) {\n // create a DOM node to render to\n var toinsert = this.create_output_subarea(\n metadata,\n CLASS_NAME,\n EXEC_MIME_TYPE\n );\n this.keyboard_manager.register_events(toinsert);\n // Render to node\n var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n render(props, toinsert[toinsert.length - 1]);\n element.append(toinsert);\n return toinsert\n }\n\n /* Handle when an output is cleared or removed */\n events.on('clear_output.CodeCell', handleClearOutput);\n events.on('delete.Cell', handleClearOutput);\n\n /* Handle when a new output is added */\n events.on('output_added.OutputArea', handleAddOutput);\n\n /**\n * Register the mime type and append_mime function with output_area\n */\n OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n /* Is output safe? */\n safe: true,\n /* Index of renderer in `output_area.display_order` */\n index: 0\n });\n }\n\n // register the mime type if in Jupyter Notebook environment and previously unregistered\n if (root.Jupyter !== undefined) {\n var events = require('base/js/events');\n var OutputArea = require('notebook/js/outputarea').OutputArea;\n\n if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n register_renderer(events, OutputArea);\n }\n }\n\n \n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n var NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\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 \"

\\n\"+\n \"
    \\n\"+\n \"
  • re-rerun `output_notebook()` to attempt to load from CDN again, or
  • \\n\"+\n \"
  • use INLINE resources instead, as so:
  • \\n\"+\n \"
\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n var el = document.getElementById(\"3022\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"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.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error(url) {\n console.error(\"failed to load \" + url);\n }\n\n for (let i = 0; i < css_urls.length; i++) {\n const url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n const hashes = {\"https://cdn.bokeh.org/bokeh/release/bokeh-2.3.2.min.js\": \"XypntL49z55iwGVUW4qsEu83zKL3XEcz0MjuGOQ9SlaaQ68X/g+k1FcioZi7oQAc\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.2.min.js\": \"bEsM86IHGDTLCS0Zod8a8WM6Y4+lafAL/eSiyQcuPzinmWNgNO2/olUF0Z2Dkn5i\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\": \"TX0gSQTdXTTeScqxj6PVQxTiRW8DOoGVwinyi1D3kxv7wuxQ02XkOxv0xwiypcAH\"};\n\n for (let i = 0; i < js_urls.length; i++) {\n const url = js_urls[i];\n const element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.async = false;\n element.src = url;\n if (url in hashes) {\n element.crossOrigin = \"anonymous\";\n element.integrity = \"sha384-\" + hashes[url];\n }\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n \n var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.2.min.js\"];\n var css_urls = [];\n \n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n function(Bokeh) {\n \n \n }\n ];\n\n function run_inline_js() {\n \n if (root.Bokeh !== undefined || force === true) {\n \n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }\n if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n var cell = $(document.getElementById(\"3022\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));", "application/vnd.bokehjs_load.v0+json": "" }, "metadata": {} }, { "output_type": "display_data", "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "application/vnd.bokehjs_exec.v0+json": "", "application/javascript": "(function(root) {\n function embed_document(root) {\n \n var docs_json = {\"6b8c0e0a-efc0-4209-9c65-a64b0970f987\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"3035\"}],\"center\":[{\"id\":\"3037\"},{\"id\":\"3040\"}],\"height\":700,\"left\":[{\"id\":\"3038\"}],\"outline_line_color\":null,\"renderers\":[{\"id\":\"3058\"}],\"title\":{\"id\":\"3025\"},\"toolbar\":{\"id\":\"3047\"},\"toolbar_location\":\"above\",\"width\":900,\"x_range\":{\"id\":\"3027\"},\"x_scale\":{\"id\":\"3031\"},\"y_range\":{\"id\":\"3029\"},\"y_scale\":{\"id\":\"3033\"}},\"id\":\"3024\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"3044\",\"type\":\"ResetTool\"},{\"attributes\":{\"data\":{\"DestinationIP\":[\"40.77.228.69\",\"52.168.138.145\",\"13.71.172.130\",\"40.91.75.5\",\"40.124.45.19\",\"13.71.172.128\",\"172.217.15.99\",\"20.38.98.100\",\"104.43.212.12\",\"13.71.172.128\",\"13.71.172.130\",\"40.124.45.19\",\"65.55.44.109\",\"65.55.44.109\",\"13.65.107.32\",\"40.124.45.19\",\"40.77.228.69\",\"52.165.170.112\",\"52.168.138.145\",\"72.21.81.200\",\"13.65.107.32\",\"40.124.45.19\",\"52.168.138.145\",\"65.55.44.109\",\"52.168.138.145\",\"40.124.45.19\",\"72.21.91.29\",\"72.21.81.200\",\"40.91.75.5\",\"13.71.172.130\",\"65.55.44.108\",\"65.55.44.109\",\"72.21.81.240\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"13.71.172.128\",\"40.77.232.95\",\"52.165.170.112\",\"65.55.44.109\",\"72.21.81.200\",\"72.21.91.29\",\"52.168.138.145\",\"13.67.143.117\",\"13.68.93.109\",\"13.71.172.128\",\"23.48.36.78\",\"52.165.170.112\",\"65.55.44.109\",\"20.38.98.100\",\"8.249.241.254\",\"40.77.228.69\",\"172.217.15.99\",\"13.67.143.117\",\"13.71.172.130\",\"40.124.45.19\",\"40.77.226.250\",\"52.239.152.10\",\"65.55.44.109\",\"90.130.70.73\",\"20.38.98.100\",\"65.55.44.109\",\"13.65.107.32\",\"13.67.143.117\",\"20.38.98.100\",\"13.67.143.117\",\"13.71.172.128\",\"13.71.172.130\",\"13.83.148.218\",\"20.38.98.100\",\"23.4.187.27\",\"40.124.45.19\",\"65.55.44.108\",\"72.21.81.200\",\"72.21.91.29\",\"99.84.104.63\",\"13.65.107.32\",\"40.124.45.19\",\"172.217.15.99\",\"8.249.241.254\",\"13.68.93.109\",\"40.77.228.69\",\"65.55.44.109\",\"52.168.138.145\",\"40.124.45.19\",\"157.55.134.136\"],\"SourceIP\":[\"10.0.3.5\",\"10.0.3.5\",\"104.43.212.12\",\"104.43.212.12\",\"13.107.4.50\",\"13.65.107.32\",\"13.65.107.32\",\"13.65.107.32\",\"13.67.143.117\",\"13.67.143.117\",\"13.67.143.117\",\"13.67.143.117\",\"13.67.143.117\",\"13.68.93.109\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.130\",\"13.71.172.130\",\"13.71.172.130\",\"13.71.172.130\",\"13.83.148.218\",\"131.107.147.209\",\"157.55.134.136\",\"172.217.15.99\",\"172.217.8.14\",\"20.38.98.100\",\"20.38.98.100\",\"20.38.98.100\",\"20.38.98.100\",\"205.185.216.42\",\"23.4.187.27\",\"23.48.36.78\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.77.226.250\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.232.95\",\"40.77.232.95\",\"40.91.75.5\",\"52.165.170.112\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.239.152.10\",\"52.239.152.10\",\"65.55.163.76\",\"65.55.44.108\",\"65.55.44.108\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"72.21.81.200\",\"72.21.81.200\",\"72.21.81.240\",\"72.21.81.240\",\"72.21.91.29\",\"72.21.91.29\",\"72.21.91.29\",\"8.249.241.254\",\"90.130.70.73\",\"99.84.104.63\"],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85],\"plt_size\":{\"__ndarray__\":\"AAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAUQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAABRAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAeQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAABRAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAABRAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAAFEAAAAAAAAAEQAAAAAAAAARAAAAAAAAAFEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAAFEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAUQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAkQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAUQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[86]},\"row_count\":[1,1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,3,1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,2,1,1,2,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,4,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\"size\":[1,1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,3,1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,2,1,1,2,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,4,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]},\"selected\":{\"id\":\"3067\"},\"selection_policy\":{\"id\":\"3068\"}},\"id\":\"3023\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"3039\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"text\":\"IP Interaction\",\"text_font_size\":\"15pt\"},\"id\":\"3025\",\"type\":\"Title\"},{\"attributes\":{\"axis_label\":\"SourceIP\",\"axis_line_color\":null,\"formatter\":{\"id\":\"3065\"},\"major_label_orientation\":1.5707963267948966,\"major_label_policy\":{\"id\":\"3064\"},\"major_label_standoff\":0,\"major_label_text_font_size\":\"11pt\",\"major_tick_line_color\":null,\"ticker\":{\"id\":\"3036\"}},\"id\":\"3035\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"3064\",\"type\":\"AllLabels\"},{\"attributes\":{\"factors\":[\"99.84.104.63\",\"90.130.70.73\",\"8.249.241.254\",\"72.21.91.29\",\"72.21.81.240\",\"72.21.81.200\",\"65.55.44.109\",\"65.55.44.108\",\"52.239.152.10\",\"52.168.138.145\",\"52.165.170.112\",\"40.91.75.5\",\"40.77.232.95\",\"40.77.228.69\",\"40.77.226.250\",\"40.124.45.19\",\"23.48.36.78\",\"23.4.187.27\",\"20.38.98.100\",\"172.217.15.99\",\"157.55.134.136\",\"13.83.148.218\",\"13.71.172.130\",\"13.71.172.128\",\"13.68.93.109\",\"13.67.143.117\",\"13.65.107.32\",\"104.43.212.12\"]},\"id\":\"3029\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"3062\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"axis_label\":\"DestinationIP\",\"axis_line_color\":null,\"formatter\":{\"id\":\"3062\"},\"major_label_policy\":{\"id\":\"3061\"},\"major_label_standoff\":0,\"major_label_text_font_size\":\"11pt\",\"major_tick_line_color\":null,\"ticker\":{\"id\":\"3039\"}},\"id\":\"3038\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"axis\":{\"id\":\"3035\"},\"grid_line_alpha\":0.1,\"grid_line_color\":\"navy\",\"ticker\":null},\"id\":\"3037\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"3033\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"3067\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"3061\",\"type\":\"AllLabels\"},{\"attributes\":{\"data_source\":{\"id\":\"3023\"},\"glyph\":{\"id\":\"3056\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"3057\"},\"view\":{\"id\":\"3059\"}},\"id\":\"3058\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"3041\"},{\"id\":\"3042\"},{\"id\":\"3043\"},{\"id\":\"3044\"},{\"id\":\"3045\"},{\"id\":\"3053\"}]},\"id\":\"3047\",\"type\":\"Toolbar\"},{\"attributes\":{\"axis\":{\"id\":\"3038\"},\"dimension\":1,\"grid_line_alpha\":0.1,\"grid_line_color\":\"navy\",\"ticker\":null},\"id\":\"3040\",\"type\":\"Grid\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.6},\"fill_color\":{\"value\":\"red\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"field\":\"plt_size\"},\"x\":{\"field\":\"SourceIP\"},\"y\":{\"field\":\"DestinationIP\"}},\"id\":\"3056\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"3031\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"source\":{\"id\":\"3023\"}},\"id\":\"3059\",\"type\":\"CDSView\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"red\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"field\":\"plt_size\"},\"x\":{\"field\":\"SourceIP\"},\"y\":{\"field\":\"DestinationIP\"}},\"id\":\"3057\",\"type\":\"Circle\"},{\"attributes\":{\"factors\":[\"10.0.3.5\",\"104.43.212.12\",\"13.107.4.50\",\"13.65.107.32\",\"13.67.143.117\",\"13.68.93.109\",\"13.71.172.128\",\"13.71.172.130\",\"13.83.148.218\",\"131.107.147.209\",\"157.55.134.136\",\"172.217.15.99\",\"172.217.8.14\",\"20.38.98.100\",\"205.185.216.42\",\"23.4.187.27\",\"23.48.36.78\",\"40.124.45.19\",\"40.77.226.250\",\"40.77.228.69\",\"40.77.232.95\",\"40.91.75.5\",\"52.165.170.112\",\"52.168.138.145\",\"52.239.152.10\",\"65.55.163.76\",\"65.55.44.108\",\"65.55.44.109\",\"72.21.81.200\",\"72.21.81.240\",\"72.21.91.29\",\"8.249.241.254\",\"90.130.70.73\",\"99.84.104.63\"]},\"id\":\"3027\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"3068\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"SourceIP\",\"@SourceIP\"],[\"DestinationIP\",\"@DestinationIP\"],[\"value\",\"@size\"]]},\"id\":\"3053\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"3065\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"3036\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"3041\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"3046\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"3045\",\"type\":\"SaveTool\"},{\"attributes\":{\"overlay\":{\"id\":\"3046\"}},\"id\":\"3042\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"3043\",\"type\":\"PanTool\"}],\"root_ids\":[\"3024\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n var render_items = [{\"docid\":\"6b8c0e0a-efc0-4209-9c65-a64b0970f987\",\"root_ids\":[\"3024\"],\"roots\":{\"3024\":\"54e127b6-3f66-4976-965f-e7c8f33696d8\"}}];\n root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n\n }\n if (root.Bokeh !== undefined) {\n embed_document(root);\n } else {\n var attempts = 0;\n var timer = setInterval(function(root) {\n if (root.Bokeh !== undefined) {\n clearInterval(timer);\n embed_document(root);\n } else {\n attempts++;\n if (attempts > 100) {\n clearInterval(timer);\n console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n }\n }\n }, 10, root)\n }\n})(window);" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "3024" } } }, { "output_type": "execute_result", "data": { "text/plain": [ "Figure(id='3024', ...)" ], "text/html": [ "
Figure(
id = '3024', …)
above = [],
align = 'start',
aspect_ratio = None,
aspect_scale = 1,
background = None,
background_fill_alpha = 1.0,
background_fill_color = '#ffffff',
below = [CategoricalAxis(id='3035', ...)],
border_fill_alpha = 1.0,
border_fill_color = '#ffffff',
center = [Grid(id='3037', ...), Grid(id='3040', ...)],
css_classes = [],
disabled = False,
extra_x_ranges = {},
extra_y_ranges = {},
frame_height = None,
frame_width = None,
height = 700,
height_policy = 'auto',
hidpi = True,
inner_height = 0,
inner_width = 0,
js_event_callbacks = {},
js_property_callbacks = {},
left = [CategoricalAxis(id='3038', ...)],
lod_factor = 10,
lod_interval = 300,
lod_threshold = 2000,
lod_timeout = 500,
margin = (0, 0, 0, 0),
match_aspect = False,
max_height = None,
max_width = None,
min_border = 5,
min_border_bottom = None,
min_border_left = None,
min_border_right = None,
min_border_top = None,
min_height = None,
min_width = None,
name = None,
outer_height = 0,
outer_width = 0,
outline_line_alpha = 1.0,
outline_line_cap = 'butt',
outline_line_color = None,
outline_line_dash = [],
outline_line_dash_offset = 0,
outline_line_join = 'bevel',
outline_line_width = 1,
output_backend = 'canvas',
renderers = [GlyphRenderer(id='3058', ...)],
reset_policy = 'standard',
right = [],
sizing_mode = None,
subscribed_events = [],
syncable = True,
tags = [],
title = Title(id='3025', ...),
title_location = 'above',
toolbar = Toolbar(id='3047', ...),
toolbar_location = 'above',
toolbar_sticky = True,
visible = True,
width = 900,
width_policy = 'auto',
x_range = FactorRange(id='3027', ...),
x_scale = CategoricalScale(id='3031', ...),
y_range = FactorRange(id='3029', ...),
y_scale = CategoricalScale(id='3033', ...))
\n", "\n" ] }, "metadata": {}, "execution_count": 25 } ], "metadata": {} }, { "cell_type": "markdown", "source": [ "## You can also import and use the `plot_matrix` function directly\r\n", "\r\n", "Supply the input DataFrame as the first parameter (or as named\r\n", "parameter `data`)\r\n", "\r\n", "```python\r\n", "from msticpy.vis.matrix_plot import plot_matrix\r\n", "\r\n", "plot_matrix(data=net_df, x=\"SourceIP\", y=\"DestinationIP\", title=\"IP Interaction\")\r\n", "```" ], "metadata": {} }, { "cell_type": "markdown", "source": [ "## Plotting interactions based on column value\r\n", "\r\n", "Instead of a simple count of rows linking an X-Y pair of entities,\r\n", "you can use a numeric column in the input DataFrame to control\r\n", "the size of the plotted circle.\r\n", "\r\n", "In this example, we're using the \"TotalAllowedFlows\" column." ], "metadata": {} }, { "cell_type": "code", "execution_count": 13, "source": [ "all_df.mp_plot.matrix(\r\n", " x=\"L7Protocol\",\r\n", " y=\"AllExtIPs\",\r\n", " value_col=\"TotalAllowedFlows\",\r\n", " title=\"External IP protocol flows\",\r\n", " sort=\"asc\",\r\n", ")" ], "outputs": [ { "output_type": "display_data", "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "application/javascript": "\n(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n\n if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n var JS_MIME_TYPE = 'application/javascript';\n var HTML_MIME_TYPE = 'text/html';\n var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n var CLASS_NAME = 'output_bokeh rendered_html';\n\n /**\n * Render data to the DOM node\n */\n function render(props, node) {\n var script = document.createElement(\"script\");\n node.appendChild(script);\n }\n\n /**\n * Handle when an output is cleared or removed\n */\n function handleClearOutput(event, handle) {\n var cell = handle.cell;\n\n var id = cell.output_area._bokeh_element_id;\n var server_id = cell.output_area._bokeh_server_id;\n // Clean up Bokeh references\n if (id != null && id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n\n if (server_id !== undefined) {\n // Clean up Bokeh references\n var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n cell.notebook.kernel.execute(cmd, {\n iopub: {\n output: function(msg) {\n var id = msg.content.text.trim();\n if (id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n }\n }\n });\n // Destroy server and session\n var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n cell.notebook.kernel.execute(cmd);\n }\n }\n\n /**\n * Handle when a new output is added\n */\n function handleAddOutput(event, handle) {\n var output_area = handle.output_area;\n var output = handle.output;\n\n // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n if ((output.output_type != \"display_data\") || (!Object.prototype.hasOwnProperty.call(output.data, EXEC_MIME_TYPE))) {\n return\n }\n\n var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n\n if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n // store reference to embed id on output_area\n output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n }\n if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n var bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n var script_attrs = bk_div.children[0].attributes;\n for (var i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\n }\n // store reference to server id on output_area\n output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n }\n }\n\n function register_renderer(events, OutputArea) {\n\n function append_mime(data, metadata, element) {\n // create a DOM node to render to\n var toinsert = this.create_output_subarea(\n metadata,\n CLASS_NAME,\n EXEC_MIME_TYPE\n );\n this.keyboard_manager.register_events(toinsert);\n // Render to node\n var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n render(props, toinsert[toinsert.length - 1]);\n element.append(toinsert);\n return toinsert\n }\n\n /* Handle when an output is cleared or removed */\n events.on('clear_output.CodeCell', handleClearOutput);\n events.on('delete.Cell', handleClearOutput);\n\n /* Handle when a new output is added */\n events.on('output_added.OutputArea', handleAddOutput);\n\n /**\n * Register the mime type and append_mime function with output_area\n */\n OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n /* Is output safe? */\n safe: true,\n /* Index of renderer in `output_area.display_order` */\n index: 0\n });\n }\n\n // register the mime type if in Jupyter Notebook environment and previously unregistered\n if (root.Jupyter !== undefined) {\n var events = require('base/js/events');\n var OutputArea = require('notebook/js/outputarea').OutputArea;\n\n if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n register_renderer(events, OutputArea);\n }\n }\n\n \n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n var NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\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 \"

\\n\"+\n \"
    \\n\"+\n \"
  • re-rerun `output_notebook()` to attempt to load from CDN again, or
  • \\n\"+\n \"
  • use INLINE resources instead, as so:
  • \\n\"+\n \"
\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n var el = document.getElementById(\"1911\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"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.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error(url) {\n console.error(\"failed to load \" + url);\n }\n\n for (let i = 0; i < css_urls.length; i++) {\n const url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n const hashes = {\"https://cdn.bokeh.org/bokeh/release/bokeh-2.3.2.min.js\": \"XypntL49z55iwGVUW4qsEu83zKL3XEcz0MjuGOQ9SlaaQ68X/g+k1FcioZi7oQAc\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.2.min.js\": \"bEsM86IHGDTLCS0Zod8a8WM6Y4+lafAL/eSiyQcuPzinmWNgNO2/olUF0Z2Dkn5i\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\": \"TX0gSQTdXTTeScqxj6PVQxTiRW8DOoGVwinyi1D3kxv7wuxQ02XkOxv0xwiypcAH\"};\n\n for (let i = 0; i < js_urls.length; i++) {\n const url = js_urls[i];\n const element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.async = false;\n element.src = url;\n if (url in hashes) {\n element.crossOrigin = \"anonymous\";\n element.integrity = \"sha384-\" + hashes[url];\n }\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n \n var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.2.min.js\"];\n var css_urls = [];\n \n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n function(Bokeh) {\n \n \n }\n ];\n\n function run_inline_js() {\n \n if (root.Bokeh !== undefined || force === true) {\n \n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }\n if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n var cell = $(document.getElementById(\"1911\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));", "application/vnd.bokehjs_load.v0+json": "" }, "metadata": {} }, { "output_type": "display_data", "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "application/vnd.bokehjs_exec.v0+json": "", "application/javascript": "(function(root) {\n function embed_document(root) {\n \n var docs_json = {\"26e8a68e-c0db-4e9a-83c5-bb7403894e33\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1924\"}],\"center\":[{\"id\":\"1926\"},{\"id\":\"1929\"}],\"height\":700,\"left\":[{\"id\":\"1927\"}],\"outline_line_color\":null,\"renderers\":[{\"id\":\"1947\"}],\"title\":{\"id\":\"1914\"},\"toolbar\":{\"id\":\"1936\"},\"toolbar_location\":\"above\",\"width\":900,\"x_range\":{\"id\":\"1916\"},\"x_scale\":{\"id\":\"1920\"},\"y_range\":{\"id\":\"1918\"},\"y_scale\":{\"id\":\"1922\"}},\"id\":\"1913\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1930\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"1934\",\"type\":\"SaveTool\"},{\"attributes\":{\"data\":{\"AllExtIPs\":[\"90.130.70.73\",\"13.107.4.50\",\"173.194.61.40\",\"205.185.216.42\",\"216.58.218.238\",\"23.223.3.100\",\"23.3.13.106\",\"23.3.13.112\",\"23.3.13.146\",\"23.4.187.27\",\"23.45.180.121\",\"23.45.180.234\",\"23.48.36.47\",\"23.48.36.78\",\"40.80.145.38\",\"40.87.63.92\",\"72.21.81.240\",\"72.21.91.29\",\"8.249.241.254\",\"8.253.45.249\",\"99.84.106.178\",\"99.84.106.27\",\"99.84.106.92\",\"104.43.212.12\",\"13.64.188.245\",\"13.65.107.32\",\"13.67.143.117\",\"13.68.226.108\",\"13.68.93.109\",\"13.71.172.128\",\"13.71.172.130\",\"13.74.179.117\",\"13.82.152.48\",\"13.83.148.218\",\"13.83.148.235\",\"13.83.149.5\",\"13.86.124.191\",\"13.89.187.212\",\"13.89.220.65\",\"134.170.58.123\",\"157.55.134.136\",\"157.55.134.142\",\"157.55.135.128\",\"168.62.32.212\",\"172.217.15.110\",\"172.217.15.78\",\"172.217.15.99\",\"172.217.8.14\",\"172.217.8.3\",\"20.38.98.100\",\"20.41.41.23\",\"20.42.24.50\",\"204.79.197.200\",\"212.13.197.231\",\"23.47.27.169\",\"23.96.64.84\",\"40.121.3.131\",\"40.124.45.19\",\"40.69.153.67\",\"40.77.226.250\",\"40.77.228.69\",\"40.77.232.95\",\"40.79.85.125\",\"40.85.232.64\",\"40.91.75.5\",\"46.43.34.31\",\"52.165.170.112\",\"52.165.175.144\",\"52.173.26.181\",\"52.173.28.179\",\"52.183.114.173\",\"52.239.152.10\",\"65.52.108.92\",\"65.55.163.76\",\"65.55.163.78\",\"65.55.163.80\",\"65.55.252.190\",\"65.55.44.108\",\"65.55.44.109\",\"72.21.81.200\",\"99.84.104.63\",\"10.0.3.4\",\"10.0.3.5\",\"131.107.147.209\",\"52.168.138.145\",\"52.179.17.38\",\"10.0.3.4\",\"10.0.3.5\",\"104.211.30.1\"],\"L7Protocol\":[\"ftp\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"microsoft-ds\",\"microsoft-ds\",\"ms-wbt-server\",\"ntp\",\"ntp\",\"ssh\",\"ssh\",\"ssh\"],\"TotalAllowedFlows\":{\"__ndarray__\":\"AAAAAAAA8D8AAAAAAIBIQAAAAAAAAABAAAAAAACARUAAAAAAAAAAQAAAAAAAgERAAAAAAAAAJEAAAAAAAAAkQAAAAAAAACRAAAAAAAAAFEAAAAAAAAAAQAAAAAAAACRAAAAAAAAAAEAAAAAAAIBEQAAAAAAAAABAAAAAAAAAAEAAAAAAAIBNQAAAAAAAgElAAAAAAAAA8D8AAAAAAIBEQAAAAAAAACRAAAAAAAAAJEAAAAAAAAAkQAAAAAAAABxAAAAAAAAACEAAAAAAAIBaQAAAAAAAAD1AAAAAAAAAGEAAAAAAAIBAQAAAAAAAYH9AAAAAAADoh0AAAAAAAAAYQAAAAAAAACBAAAAAAAAAAEAAAAAAAAAQQAAAAAAAABBAAAAAAAAAEEAAAAAAAAAQQAAAAAAAADFAAAAAAAAAFEAAAAAAAAAcQAAAAAAAAABAAAAAAAAA8D8AAAAAAAAgQAAAAAAAAABAAAAAAAAAFEAAAAAAAAAoQAAAAAAAAABAAAAAAAAAGEAAAAAAAIBCQAAAAAAAACJAAAAAAAAA8D8AAAAAAAAoQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAsQAAAAAAAABBAAAAAAADgYEAAAAAAAAAAQAAAAAAAADhAAAAAAAAgYEAAAAAAAAAzQAAAAAAAACRAAAAAAAAAOEAAAAAAAAAAQAAAAAAAABRAAAAAAAAAPkAAAAAAAAAzQAAAAAAAAAhAAAAAAAAACEAAAAAAAADwPwAAAAAAACRAAAAAAAAALkAAAAAAAAAUQAAAAAAAACJAAAAAAAAA8D8AAAAAAAAIQAAAAAAAIGBAAAAAAABAcEAAAAAAAAA2QAAAAAAAABxAAAAAAAAAIkAAAAAAAAAiQAAAAAAAADJAAAAAAABAXUAAAAAAAAAAQAAAAAAAAPA/AAAAAAAA8D8AAAAAAAAyQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[89]},\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88],\"plt_size\":{\"__ndarray__\":\"G3DFGnDFij/UKX/UKX/kPxtwxRpwxZo/Uqf8Uaf84T8bcMUacMWaP9F7JtF7JuE/EWa7EGa7wD8RZrsQZrvAPxFmuxBmu8A/EWa7EGa7sD8bcMUacMWaPxFmuxBmu8A/G3DFGnDFmj/ReybReybhPxtwxRpwxZo/G3DFGnDFmj9ZA65YA67oP1VVVVVVVeU/G3DFGnDFij/ReybReybhPxFmuxBmu8A/EWa7EGa7wD8RZrsQZrvAPxfCbBfCbLc/FBQUFBQUpD/WgCvWgCv2P5jtQpjtQtg/FBQUFBQUtD+cm5ubm5vbP+qUP+qUPxpAAAAAAAAAJEAUFBQUFBS0PxtwxRpwxbo/G3DFGnDFmj8bcMUacMWqPxtwxRpwxao/G3DFGnDFqj8bcMUacMWqPxzHcRzHccw/EWa7EGa7sD8XwmwXwmy3PxtwxRpwxZo/G3DFGnDFij8bcMUacMW6PxtwxRpwxZo/EWa7EGa7sD8UFBQUFBTEPxtwxRpwxZo/FBQUFBQUtD+fSfSeSfTePx4eHh4eHr4/G3DFGnDFij8UFBQUFBTEPxFmuxBmu7A/EWa7EGa7sD8XwmwXwmzHPxtwxRpwxao/PDw8PDw8/D8bcMUacMWaPxQUFBQUFNQ/+/r6+vr6+j8gdcofdcrPPxFmuxBmu8A/FBQUFBQU1D8bcMUacMWaPxFmuxBmu7A/GRkZGRkZ2T8gdcofdcrPPxQUFBQUFKQ/FBQUFBQUpD8bcMUacMWKPxFmuxBmu8A/GRkZGRkZyT8RZrsQZruwPx4eHh4eHr4/G3DFGnDFij8UFBQUFBSkP/v6+vr6+vo/24Uw24UwC0ASvWcSvWfSPxfCbBfCbLc/Hh4eHh4evj8eHh4eHh6+Px4eHh4eHs4/eHh4eHh4+D8bcMUacMWaPxtwxRpwxYo/G3DFGnDFij8eHh4eHh7OPw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[89]},\"size\":{\"__ndarray__\":\"AAAAAAAA8D8AAAAAAIBIQAAAAAAAAABAAAAAAACARUAAAAAAAAAAQAAAAAAAgERAAAAAAAAAJEAAAAAAAAAkQAAAAAAAACRAAAAAAAAAFEAAAAAAAAAAQAAAAAAAACRAAAAAAAAAAEAAAAAAAIBEQAAAAAAAAABAAAAAAAAAAEAAAAAAAIBNQAAAAAAAgElAAAAAAAAA8D8AAAAAAIBEQAAAAAAAACRAAAAAAAAAJEAAAAAAAAAkQAAAAAAAABxAAAAAAAAACEAAAAAAAIBaQAAAAAAAAD1AAAAAAAAAGEAAAAAAAIBAQAAAAAAAYH9AAAAAAADoh0AAAAAAAAAYQAAAAAAAACBAAAAAAAAAAEAAAAAAAAAQQAAAAAAAABBAAAAAAAAAEEAAAAAAAAAQQAAAAAAAADFAAAAAAAAAFEAAAAAAAAAcQAAAAAAAAABAAAAAAAAA8D8AAAAAAAAgQAAAAAAAAABAAAAAAAAAFEAAAAAAAAAoQAAAAAAAAABAAAAAAAAAGEAAAAAAAIBCQAAAAAAAACJAAAAAAAAA8D8AAAAAAAAoQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAsQAAAAAAAABBAAAAAAADgYEAAAAAAAAAAQAAAAAAAADhAAAAAAAAgYEAAAAAAAAAzQAAAAAAAACRAAAAAAAAAOEAAAAAAAAAAQAAAAAAAABRAAAAAAAAAPkAAAAAAAAAzQAAAAAAAAAhAAAAAAAAACEAAAAAAAADwPwAAAAAAACRAAAAAAAAALkAAAAAAAAAUQAAAAAAAACJAAAAAAAAA8D8AAAAAAAAIQAAAAAAAIGBAAAAAAABAcEAAAAAAAAA2QAAAAAAAABxAAAAAAAAAIkAAAAAAAAAiQAAAAAAAADJAAAAAAABAXUAAAAAAAAAAQAAAAAAAAPA/AAAAAAAA8D8AAAAAAAAyQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[89]}},\"selected\":{\"id\":\"1956\"},\"selection_policy\":{\"id\":\"1957\"}},\"id\":\"1912\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"overlay\":{\"id\":\"1935\"}},\"id\":\"1931\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"1932\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"1933\",\"type\":\"ResetTool\"},{\"attributes\":{\"data_source\":{\"id\":\"1912\"},\"glyph\":{\"id\":\"1945\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1946\"},\"view\":{\"id\":\"1948\"}},\"id\":\"1947\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"factors\":[\"ftp\",\"http\",\"https\",\"microsoft-ds\",\"ms-wbt-server\",\"ntp\",\"ssh\"]},\"id\":\"1916\",\"type\":\"FactorRange\"},{\"attributes\":{\"axis_label\":\"AllExtIPs\",\"axis_line_color\":null,\"formatter\":{\"id\":\"1951\"},\"major_label_policy\":{\"id\":\"1950\"},\"major_label_standoff\":0,\"major_label_text_font_size\":\"5pt\",\"major_tick_line_color\":null,\"ticker\":{\"id\":\"1928\"}},\"id\":\"1927\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"axis_label\":\"L7Protocol\",\"axis_line_color\":null,\"formatter\":{\"id\":\"1954\"},\"major_label_orientation\":1.5707963267948966,\"major_label_policy\":{\"id\":\"1953\"},\"major_label_standoff\":0,\"major_label_text_font_size\":\"11pt\",\"major_tick_line_color\":null,\"ticker\":{\"id\":\"1925\"}},\"id\":\"1924\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"axis\":{\"id\":\"1924\"},\"grid_line_alpha\":0.1,\"grid_line_color\":\"navy\",\"ticker\":null},\"id\":\"1926\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1954\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"1922\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"1950\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"1951\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"1957\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis\":{\"id\":\"1927\"},\"dimension\":1,\"grid_line_alpha\":0.1,\"grid_line_color\":\"navy\",\"ticker\":null},\"id\":\"1929\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"1925\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"1956\",\"type\":\"Selection\"},{\"attributes\":{\"text\":\"External IP protocol flows\",\"text_font_size\":\"15pt\"},\"id\":\"1914\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1928\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"1930\"},{\"id\":\"1931\"},{\"id\":\"1932\"},{\"id\":\"1933\"},{\"id\":\"1934\"},{\"id\":\"1942\"}]},\"id\":\"1936\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1953\",\"type\":\"AllLabels\"},{\"attributes\":{\"factors\":[\"99.84.106.92\",\"99.84.106.27\",\"99.84.106.178\",\"99.84.104.63\",\"90.130.70.73\",\"8.253.45.249\",\"8.249.241.254\",\"72.21.91.29\",\"72.21.81.240\",\"72.21.81.200\",\"65.55.44.109\",\"65.55.44.108\",\"65.55.252.190\",\"65.55.163.80\",\"65.55.163.78\",\"65.55.163.76\",\"65.52.108.92\",\"52.239.152.10\",\"52.183.114.173\",\"52.179.17.38\",\"52.173.28.179\",\"52.173.26.181\",\"52.168.138.145\",\"52.165.175.144\",\"52.165.170.112\",\"46.43.34.31\",\"40.91.75.5\",\"40.87.63.92\",\"40.85.232.64\",\"40.80.145.38\",\"40.79.85.125\",\"40.77.232.95\",\"40.77.228.69\",\"40.77.226.250\",\"40.69.153.67\",\"40.124.45.19\",\"40.121.3.131\",\"23.96.64.84\",\"23.48.36.78\",\"23.48.36.47\",\"23.47.27.169\",\"23.45.180.234\",\"23.45.180.121\",\"23.4.187.27\",\"23.3.13.146\",\"23.3.13.112\",\"23.3.13.106\",\"23.223.3.100\",\"216.58.218.238\",\"212.13.197.231\",\"205.185.216.42\",\"204.79.197.200\",\"20.42.24.50\",\"20.41.41.23\",\"20.38.98.100\",\"173.194.61.40\",\"172.217.8.3\",\"172.217.8.14\",\"172.217.15.99\",\"172.217.15.78\",\"172.217.15.110\",\"168.62.32.212\",\"157.55.135.128\",\"157.55.134.142\",\"157.55.134.136\",\"134.170.58.123\",\"131.107.147.209\",\"13.89.220.65\",\"13.89.187.212\",\"13.86.124.191\",\"13.83.149.5\",\"13.83.148.235\",\"13.83.148.218\",\"13.82.152.48\",\"13.74.179.117\",\"13.71.172.130\",\"13.71.172.128\",\"13.68.93.109\",\"13.68.226.108\",\"13.67.143.117\",\"13.65.107.32\",\"13.64.188.245\",\"13.107.4.50\",\"104.43.212.12\",\"104.211.30.1\",\"10.0.3.5\",\"10.0.3.4\"]},\"id\":\"1918\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"1920\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.6},\"fill_color\":{\"value\":\"red\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"field\":\"plt_size\"},\"x\":{\"field\":\"L7Protocol\"},\"y\":{\"field\":\"AllExtIPs\"}},\"id\":\"1945\",\"type\":\"Circle\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"1935\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"red\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"field\":\"plt_size\"},\"x\":{\"field\":\"L7Protocol\"},\"y\":{\"field\":\"AllExtIPs\"}},\"id\":\"1946\",\"type\":\"Circle\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"L7Protocol\",\"@L7Protocol\"],[\"AllExtIPs\",\"@AllExtIPs\"],[\"value\",\"@size\"]]},\"id\":\"1942\",\"type\":\"HoverTool\"},{\"attributes\":{\"source\":{\"id\":\"1912\"}},\"id\":\"1948\",\"type\":\"CDSView\"}],\"root_ids\":[\"1913\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n var render_items = [{\"docid\":\"26e8a68e-c0db-4e9a-83c5-bb7403894e33\",\"root_ids\":[\"1913\"],\"roots\":{\"1913\":\"4ffdd16a-b8ab-427e-b773-724ce5826468\"}}];\n root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n\n }\n if (root.Bokeh !== undefined) {\n embed_document(root);\n } else {\n var attempts = 0;\n var timer = setInterval(function(root) {\n if (root.Bokeh !== undefined) {\n clearInterval(timer);\n embed_document(root);\n } else {\n attempts++;\n if (attempts > 100) {\n clearInterval(timer);\n console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n }\n }\n }, 10, root)\n }\n})(window);" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1913" } } }, { "output_type": "execute_result", "data": { "text/plain": [ "Figure(id='1913', ...)" ], "text/html": [ "
Figure(
id = '1913', …)
above = [],
align = 'start',
aspect_ratio = None,
aspect_scale = 1,
background = None,
background_fill_alpha = 1.0,
background_fill_color = '#ffffff',
below = [CategoricalAxis(id='1924', ...)],
border_fill_alpha = 1.0,
border_fill_color = '#ffffff',
center = [Grid(id='1926', ...), Grid(id='1929', ...)],
css_classes = [],
disabled = False,
extra_x_ranges = {},
extra_y_ranges = {},
frame_height = None,
frame_width = None,
height = 700,
height_policy = 'auto',
hidpi = True,
inner_height = 0,
inner_width = 0,
js_event_callbacks = {},
js_property_callbacks = {},
left = [CategoricalAxis(id='1927', ...)],
lod_factor = 10,
lod_interval = 300,
lod_threshold = 2000,
lod_timeout = 500,
margin = (0, 0, 0, 0),
match_aspect = False,
max_height = None,
max_width = None,
min_border = 5,
min_border_bottom = None,
min_border_left = None,
min_border_right = None,
min_border_top = None,
min_height = None,
min_width = None,
name = None,
outer_height = 0,
outer_width = 0,
outline_line_alpha = 1.0,
outline_line_cap = 'butt',
outline_line_color = None,
outline_line_dash = [],
outline_line_dash_offset = 0,
outline_line_join = 'bevel',
outline_line_width = 1,
output_backend = 'canvas',
renderers = [GlyphRenderer(id='1947', ...)],
reset_policy = 'standard',
right = [],
sizing_mode = None,
subscribed_events = [],
syncable = True,
tags = [],
title = Title(id='1914', ...),
title_location = 'above',
toolbar = Toolbar(id='1936', ...),
toolbar_location = 'above',
toolbar_sticky = True,
visible = True,
width = 900,
width_policy = 'auto',
x_range = FactorRange(id='1916', ...),
x_scale = CategoricalScale(id='1920', ...),
y_range = FactorRange(id='1918', ...),
y_scale = CategoricalScale(id='1922', ...))
\n", "\n" ] }, "metadata": {}, "execution_count": 13 } ], "metadata": {} }, { "cell_type": "markdown", "source": [ "## Log scaling the size column\r\n", "\r\n", "Note because of a few large values in the data many points are difficult to see in the previous plot.\r\n", "We can change this by plotting the log of the scalar values." ], "metadata": {} }, { "cell_type": "code", "execution_count": 14, "source": [ "all_df.mp_plot.matrix(\r\n", " x=\"L7Protocol\",\r\n", " y=\"AllExtIPs\",\r\n", " value_col=\"TotalAllowedFlows\",\r\n", " title=\"External IP protocol flows (log of size)\",\r\n", " log_size=True,\r\n", " sort=\"asc\",\r\n", ")" ], "outputs": [ { "output_type": "display_data", "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "application/javascript": "\n(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n\n if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n var JS_MIME_TYPE = 'application/javascript';\n var HTML_MIME_TYPE = 'text/html';\n var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n var CLASS_NAME = 'output_bokeh rendered_html';\n\n /**\n * Render data to the DOM node\n */\n function render(props, node) {\n var script = document.createElement(\"script\");\n node.appendChild(script);\n }\n\n /**\n * Handle when an output is cleared or removed\n */\n function handleClearOutput(event, handle) {\n var cell = handle.cell;\n\n var id = cell.output_area._bokeh_element_id;\n var server_id = cell.output_area._bokeh_server_id;\n // Clean up Bokeh references\n if (id != null && id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n\n if (server_id !== undefined) {\n // Clean up Bokeh references\n var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n cell.notebook.kernel.execute(cmd, {\n iopub: {\n output: function(msg) {\n var id = msg.content.text.trim();\n if (id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n }\n }\n });\n // Destroy server and session\n var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n cell.notebook.kernel.execute(cmd);\n }\n }\n\n /**\n * Handle when a new output is added\n */\n function handleAddOutput(event, handle) {\n var output_area = handle.output_area;\n var output = handle.output;\n\n // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n if ((output.output_type != \"display_data\") || (!Object.prototype.hasOwnProperty.call(output.data, EXEC_MIME_TYPE))) {\n return\n }\n\n var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n\n if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n // store reference to embed id on output_area\n output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n }\n if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n var bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n var script_attrs = bk_div.children[0].attributes;\n for (var i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\n }\n // store reference to server id on output_area\n output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n }\n }\n\n function register_renderer(events, OutputArea) {\n\n function append_mime(data, metadata, element) {\n // create a DOM node to render to\n var toinsert = this.create_output_subarea(\n metadata,\n CLASS_NAME,\n EXEC_MIME_TYPE\n );\n this.keyboard_manager.register_events(toinsert);\n // Render to node\n var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n render(props, toinsert[toinsert.length - 1]);\n element.append(toinsert);\n return toinsert\n }\n\n /* Handle when an output is cleared or removed */\n events.on('clear_output.CodeCell', handleClearOutput);\n events.on('delete.Cell', handleClearOutput);\n\n /* Handle when a new output is added */\n events.on('output_added.OutputArea', handleAddOutput);\n\n /**\n * Register the mime type and append_mime function with output_area\n */\n OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n /* Is output safe? */\n safe: true,\n /* Index of renderer in `output_area.display_order` */\n index: 0\n });\n }\n\n // register the mime type if in Jupyter Notebook environment and previously unregistered\n if (root.Jupyter !== undefined) {\n var events = require('base/js/events');\n var OutputArea = require('notebook/js/outputarea').OutputArea;\n\n if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n register_renderer(events, OutputArea);\n }\n }\n\n \n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n var NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\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 \"

\\n\"+\n \"
    \\n\"+\n \"
  • re-rerun `output_notebook()` to attempt to load from CDN again, or
  • \\n\"+\n \"
  • use INLINE resources instead, as so:
  • \\n\"+\n \"
\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n var el = document.getElementById(\"2012\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"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.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error(url) {\n console.error(\"failed to load \" + url);\n }\n\n for (let i = 0; i < css_urls.length; i++) {\n const url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n const hashes = {\"https://cdn.bokeh.org/bokeh/release/bokeh-2.3.2.min.js\": \"XypntL49z55iwGVUW4qsEu83zKL3XEcz0MjuGOQ9SlaaQ68X/g+k1FcioZi7oQAc\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.2.min.js\": \"bEsM86IHGDTLCS0Zod8a8WM6Y4+lafAL/eSiyQcuPzinmWNgNO2/olUF0Z2Dkn5i\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\": \"TX0gSQTdXTTeScqxj6PVQxTiRW8DOoGVwinyi1D3kxv7wuxQ02XkOxv0xwiypcAH\"};\n\n for (let i = 0; i < js_urls.length; i++) {\n const url = js_urls[i];\n const element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.async = false;\n element.src = url;\n if (url in hashes) {\n element.crossOrigin = \"anonymous\";\n element.integrity = \"sha384-\" + hashes[url];\n }\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n \n var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.2.min.js\"];\n var css_urls = [];\n \n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n function(Bokeh) {\n \n \n }\n ];\n\n function run_inline_js() {\n \n if (root.Bokeh !== undefined || force === true) {\n \n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }\n if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n var cell = $(document.getElementById(\"2012\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));", "application/vnd.bokehjs_load.v0+json": "" }, "metadata": {} }, { "output_type": "display_data", "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "application/vnd.bokehjs_exec.v0+json": "", "application/javascript": "(function(root) {\n function embed_document(root) {\n \n var docs_json = {\"22d50b31-c79b-4864-9adf-7c465aaa663a\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2025\"}],\"center\":[{\"id\":\"2027\"},{\"id\":\"2030\"}],\"height\":700,\"left\":[{\"id\":\"2028\"}],\"outline_line_color\":null,\"renderers\":[{\"id\":\"2048\"}],\"title\":{\"id\":\"2015\"},\"toolbar\":{\"id\":\"2037\"},\"toolbar_location\":\"above\",\"width\":900,\"x_range\":{\"id\":\"2017\"},\"x_scale\":{\"id\":\"2021\"},\"y_range\":{\"id\":\"2019\"},\"y_scale\":{\"id\":\"2023\"}},\"id\":\"2014\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"red\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"field\":\"plt_size\"},\"x\":{\"field\":\"L7Protocol\"},\"y\":{\"field\":\"AllExtIPs\"}},\"id\":\"2047\",\"type\":\"Circle\"},{\"attributes\":{\"axis\":{\"id\":\"2028\"},\"dimension\":1,\"grid_line_alpha\":0.1,\"grid_line_color\":\"navy\",\"ticker\":null},\"id\":\"2030\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2021\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"2029\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"axis\":{\"id\":\"2025\"},\"grid_line_alpha\":0.1,\"grid_line_color\":\"navy\",\"ticker\":null},\"id\":\"2027\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2058\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis_label\":\"AllExtIPs\",\"axis_line_color\":null,\"formatter\":{\"id\":\"2052\"},\"major_label_policy\":{\"id\":\"2051\"},\"major_label_standoff\":0,\"major_label_text_font_size\":\"5pt\",\"major_tick_line_color\":null,\"ticker\":{\"id\":\"2029\"}},\"id\":\"2028\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"2026\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"axis_label\":\"L7Protocol\",\"axis_line_color\":null,\"formatter\":{\"id\":\"2055\"},\"major_label_orientation\":1.5707963267948966,\"major_label_policy\":{\"id\":\"2054\"},\"major_label_standoff\":0,\"major_label_text_font_size\":\"11pt\",\"major_tick_line_color\":null,\"ticker\":{\"id\":\"2026\"}},\"id\":\"2025\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"2031\"},{\"id\":\"2032\"},{\"id\":\"2033\"},{\"id\":\"2034\"},{\"id\":\"2035\"},{\"id\":\"2043\"}]},\"id\":\"2037\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"2052\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"2036\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"text\":\"External IP protocol flows (log of size)\",\"text_font_size\":\"15pt\"},\"id\":\"2015\",\"type\":\"Title\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"L7Protocol\",\"@L7Protocol\"],[\"AllExtIPs\",\"@AllExtIPs\"],[\"value\",\"@size\"]]},\"id\":\"2043\",\"type\":\"HoverTool\"},{\"attributes\":{\"data_source\":{\"id\":\"2013\"},\"glyph\":{\"id\":\"2046\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2047\"},\"view\":{\"id\":\"2049\"}},\"id\":\"2048\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"data\":{\"AllExtIPs\":[\"90.130.70.73\",\"13.107.4.50\",\"173.194.61.40\",\"205.185.216.42\",\"216.58.218.238\",\"23.223.3.100\",\"23.3.13.106\",\"23.3.13.112\",\"23.3.13.146\",\"23.4.187.27\",\"23.45.180.121\",\"23.45.180.234\",\"23.48.36.47\",\"23.48.36.78\",\"40.80.145.38\",\"40.87.63.92\",\"72.21.81.240\",\"72.21.91.29\",\"8.249.241.254\",\"8.253.45.249\",\"99.84.106.178\",\"99.84.106.27\",\"99.84.106.92\",\"104.43.212.12\",\"13.64.188.245\",\"13.65.107.32\",\"13.67.143.117\",\"13.68.226.108\",\"13.68.93.109\",\"13.71.172.128\",\"13.71.172.130\",\"13.74.179.117\",\"13.82.152.48\",\"13.83.148.218\",\"13.83.148.235\",\"13.83.149.5\",\"13.86.124.191\",\"13.89.187.212\",\"13.89.220.65\",\"134.170.58.123\",\"157.55.134.136\",\"157.55.134.142\",\"157.55.135.128\",\"168.62.32.212\",\"172.217.15.110\",\"172.217.15.78\",\"172.217.15.99\",\"172.217.8.14\",\"172.217.8.3\",\"20.38.98.100\",\"20.41.41.23\",\"20.42.24.50\",\"204.79.197.200\",\"212.13.197.231\",\"23.47.27.169\",\"23.96.64.84\",\"40.121.3.131\",\"40.124.45.19\",\"40.69.153.67\",\"40.77.226.250\",\"40.77.228.69\",\"40.77.232.95\",\"40.79.85.125\",\"40.85.232.64\",\"40.91.75.5\",\"46.43.34.31\",\"52.165.170.112\",\"52.165.175.144\",\"52.173.26.181\",\"52.173.28.179\",\"52.183.114.173\",\"52.239.152.10\",\"65.52.108.92\",\"65.55.163.76\",\"65.55.163.78\",\"65.55.163.80\",\"65.55.252.190\",\"65.55.44.108\",\"65.55.44.109\",\"72.21.81.200\",\"99.84.104.63\",\"10.0.3.4\",\"10.0.3.5\",\"131.107.147.209\",\"52.168.138.145\",\"52.179.17.38\",\"10.0.3.4\",\"10.0.3.5\",\"104.211.30.1\"],\"L7Protocol\":[\"ftp\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"http\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"https\",\"microsoft-ds\",\"microsoft-ds\",\"ms-wbt-server\",\"ntp\",\"ntp\",\"ssh\",\"ssh\",\"ssh\"],\"TotalAllowedFlows\":{\"__ndarray__\":\"AAAAAAAA8D8AAAAAAIBIQAAAAAAAAABAAAAAAACARUAAAAAAAAAAQAAAAAAAgERAAAAAAAAAJEAAAAAAAAAkQAAAAAAAACRAAAAAAAAAFEAAAAAAAAAAQAAAAAAAACRAAAAAAAAAAEAAAAAAAIBEQAAAAAAAAABAAAAAAAAAAEAAAAAAAIBNQAAAAAAAgElAAAAAAAAA8D8AAAAAAIBEQAAAAAAAACRAAAAAAAAAJEAAAAAAAAAkQAAAAAAAABxAAAAAAAAACEAAAAAAAIBaQAAAAAAAAD1AAAAAAAAAGEAAAAAAAIBAQAAAAAAAYH9AAAAAAADoh0AAAAAAAAAYQAAAAAAAACBAAAAAAAAAAEAAAAAAAAAQQAAAAAAAABBAAAAAAAAAEEAAAAAAAAAQQAAAAAAAADFAAAAAAAAAFEAAAAAAAAAcQAAAAAAAAABAAAAAAAAA8D8AAAAAAAAgQAAAAAAAAABAAAAAAAAAFEAAAAAAAAAoQAAAAAAAAABAAAAAAAAAGEAAAAAAAIBCQAAAAAAAACJAAAAAAAAA8D8AAAAAAAAoQAAAAAAAABRAAAAAAAAAFEAAAAAAAAAsQAAAAAAAABBAAAAAAADgYEAAAAAAAAAAQAAAAAAAADhAAAAAAAAgYEAAAAAAAAAzQAAAAAAAACRAAAAAAAAAOEAAAAAAAAAAQAAAAAAAABRAAAAAAAAAPkAAAAAAAAAzQAAAAAAAAAhAAAAAAAAACEAAAAAAAADwPwAAAAAAACRAAAAAAAAALkAAAAAAAAAUQAAAAAAAACJAAAAAAAAA8D8AAAAAAAAIQAAAAAAAIGBAAAAAAABAcEAAAAAAAAA2QAAAAAAAABxAAAAAAAAAIkAAAAAAAAAiQAAAAAAAADJAAAAAAABAXUAAAAAAAAAAQAAAAAAAAPA/AAAAAAAA8D8AAAAAAAAyQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[89]},\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88],\"plt_size\":{\"__ndarray__\":\"AAAAAAAAAAAsckyh9HEXQCzphSLhs/A/+/58coOoFkAs6YUi4bPwP52vecUPXxZARY2S/hS+C0BFjZL+FL4LQEWNkv4UvgtArZhPbSRkA0As6YUi4bPwP0WNkv4UvgtALOmFIuGz8D+dr3nFD18WQCzphSLhs/A/LOmFIuGz8D924zw8XpAYQNXtttamrxdAAAAAAAAAAACdr3nFD18WQEWNkv4UvgtARY2S/hS+C0BFjZL+FL4LQCxyTKH0cQdAUReFyht5+j9ymW618RccQDzVhQYJSRRAPoCFdn6WBUCXefYlThAVQG7OUqInuyJAAAAAAAAAJEA+gIV2fpYFQMHdyLPRDQlALOmFIuGz8D8s6YUi4bMAQCzphSLhswBALOmFIuGzAEAs6YUi4bMAQAGoFeRfERFArZhPbSRkA0Asckyh9HEHQCzphSLhs/A/AAAAAAAAAADB3ciz0Q0JQCzphSLhs/A/rZhPbSRkA0DUdMgHb/ANQCzphSLhs/A/PoCFdn6WBUAGsfGlv8AVQFEXhcobeQpAAAAAAAAAAADUdMgHb/ANQK2YT20kZANArZhPbSRkA0DCZo8y5csPQCzphSLhswBA052LDueMHUAs6YUi4bPwP7W0hcwvJRNAzkQeZcpGHUBjcYsO6LwRQEWNkv4UvgtAtbSFzC8lE0As6YUi4bPwP62YT20kZANAdozqcVF9FEBjcYsO6LwRQFEXhcobefo/UReFyht5+j8AAAAAAAAAAEWNkv4UvgtAKxJJKVlQEECtmE9tJGQDQFEXhcobeQpAAAAAAAAAAABRF4XKG3n6P85EHmXKRh1AFNdfrtW/IEAOrvZ7/54SQCxyTKH0cQdAUReFyht5CkBRF4XKG3kKQPMF5C2GaRFA5XgXejawHEAs6YUi4bPwPwAAAAAAAAAAAAAAAAAAAADzBeQthmkRQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[89]},\"size\":{\"__ndarray__\":\"AAAAAAAAAABXWjKuciIPQO85+v5CLuY/EewUFvAWDkDvOfr+Qi7mP06sjkVltQ1AFlW1u7FrAkAWVbW7sWsCQBZVtbuxawJAM43t90HA+T/vOfr+Qi7mPxZVtbuxawJA7zn6/kIu5j9OrI5FZbUNQO85+v5CLuY/7zn6/kIu5j95Kcf5ZU8QQP8AUf9gdA9AAAAAAAAAAABOrI5FZbUNQBZVtbuxawJAFlW1u7FrAkAWVbW7sWsCQFdaMq5yIv8/CwOteuqT8T+TZfCTXKcSQB/+zcs48ApAAiAq+gur/D/RuNX02PgLQCDps7XY3xhAjyRPnDuPGkACICr6C6v8P3OrOz+yogBA7zn6/kIu5j/vOfr+Qi72P+85+v5CLvY/7zn6/kIu9j/vOfr+Qi72P3p/+sFrqgZAM43t90HA+T9XWjKuciL/P+85+v5CLuY/AAAAAAAAAABzqzs/sqIAQO85+v5CLuY/M43t90HA+T99ntO8FuEDQO85+v5CLuY/AiAq+gur/D+9xzruKOMMQAsDrXrqkwFAAAAAAAAAAAB9ntO8FuEDQDON7fdBwPk/M43t90HA+T+nu9cWyhwFQO85+v5CLvY/lSX9WQCfE0DvOfr+Qi7mP/ksknynbAlAy7a1qXJwE0AsswQGNo4HQBZVtbuxawJA+SySfKdsCUDvOfr+Qi7mPzON7fdBwPk/m9YL+aY1C0AsswQGNo4HQAsDrXrqk/E/CwOteuqT8T8AAAAAAAAAABZVtbuxawJAH0hNORaqBUAzje33QcD5PwsDrXrqkwFAAAAAAAAAAAALA6166pPxP8u2talycBNA8bdSUyM+FkDIxT13dLoIQFdaMq5yIv8/CwOteuqTAUALA6166pMBQIaRazp7HwdArkfvUncME0DvOfr+Qi7mPwAAAAAAAAAAAAAAAAAAAACGkWs6ex8HQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[89]}},\"selected\":{\"id\":\"2057\"},\"selection_policy\":{\"id\":\"2058\"}},\"id\":\"2013\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"factors\":[\"ftp\",\"http\",\"https\",\"microsoft-ds\",\"ms-wbt-server\",\"ntp\",\"ssh\"]},\"id\":\"2017\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"2031\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"2035\",\"type\":\"SaveTool\"},{\"attributes\":{\"source\":{\"id\":\"2013\"}},\"id\":\"2049\",\"type\":\"CDSView\"},{\"attributes\":{\"overlay\":{\"id\":\"2036\"}},\"id\":\"2032\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"2033\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"2057\",\"type\":\"Selection\"},{\"attributes\":{},\"id\":\"2034\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"2023\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"2054\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"2051\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"2055\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"factors\":[\"99.84.106.92\",\"99.84.106.27\",\"99.84.106.178\",\"99.84.104.63\",\"90.130.70.73\",\"8.253.45.249\",\"8.249.241.254\",\"72.21.91.29\",\"72.21.81.240\",\"72.21.81.200\",\"65.55.44.109\",\"65.55.44.108\",\"65.55.252.190\",\"65.55.163.80\",\"65.55.163.78\",\"65.55.163.76\",\"65.52.108.92\",\"52.239.152.10\",\"52.183.114.173\",\"52.179.17.38\",\"52.173.28.179\",\"52.173.26.181\",\"52.168.138.145\",\"52.165.175.144\",\"52.165.170.112\",\"46.43.34.31\",\"40.91.75.5\",\"40.87.63.92\",\"40.85.232.64\",\"40.80.145.38\",\"40.79.85.125\",\"40.77.232.95\",\"40.77.228.69\",\"40.77.226.250\",\"40.69.153.67\",\"40.124.45.19\",\"40.121.3.131\",\"23.96.64.84\",\"23.48.36.78\",\"23.48.36.47\",\"23.47.27.169\",\"23.45.180.234\",\"23.45.180.121\",\"23.4.187.27\",\"23.3.13.146\",\"23.3.13.112\",\"23.3.13.106\",\"23.223.3.100\",\"216.58.218.238\",\"212.13.197.231\",\"205.185.216.42\",\"204.79.197.200\",\"20.42.24.50\",\"20.41.41.23\",\"20.38.98.100\",\"173.194.61.40\",\"172.217.8.3\",\"172.217.8.14\",\"172.217.15.99\",\"172.217.15.78\",\"172.217.15.110\",\"168.62.32.212\",\"157.55.135.128\",\"157.55.134.142\",\"157.55.134.136\",\"134.170.58.123\",\"131.107.147.209\",\"13.89.220.65\",\"13.89.187.212\",\"13.86.124.191\",\"13.83.149.5\",\"13.83.148.235\",\"13.83.148.218\",\"13.82.152.48\",\"13.74.179.117\",\"13.71.172.130\",\"13.71.172.128\",\"13.68.93.109\",\"13.68.226.108\",\"13.67.143.117\",\"13.65.107.32\",\"13.64.188.245\",\"13.107.4.50\",\"104.43.212.12\",\"104.211.30.1\",\"10.0.3.5\",\"10.0.3.4\"]},\"id\":\"2019\",\"type\":\"FactorRange\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.6},\"fill_color\":{\"value\":\"red\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"field\":\"plt_size\"},\"x\":{\"field\":\"L7Protocol\"},\"y\":{\"field\":\"AllExtIPs\"}},\"id\":\"2046\",\"type\":\"Circle\"}],\"root_ids\":[\"2014\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n var render_items = [{\"docid\":\"22d50b31-c79b-4864-9adf-7c465aaa663a\",\"root_ids\":[\"2014\"],\"roots\":{\"2014\":\"f17d5834-b56c-4f93-a485-07d2d7cacf5f\"}}];\n root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n\n }\n if (root.Bokeh !== undefined) {\n embed_document(root);\n } else {\n var attempts = 0;\n var timer = setInterval(function(root) {\n if (root.Bokeh !== undefined) {\n clearInterval(timer);\n embed_document(root);\n } else {\n attempts++;\n if (attempts > 100) {\n clearInterval(timer);\n console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n }\n }\n }, 10, root)\n }\n})(window);" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "2014" } } }, { "output_type": "execute_result", "data": { "text/plain": [ "Figure(id='2014', ...)" ], "text/html": [ "
Figure(
id = '2014', …)
above = [],
align = 'start',
aspect_ratio = None,
aspect_scale = 1,
background = None,
background_fill_alpha = 1.0,
background_fill_color = '#ffffff',
below = [CategoricalAxis(id='2025', ...)],
border_fill_alpha = 1.0,
border_fill_color = '#ffffff',
center = [Grid(id='2027', ...), Grid(id='2030', ...)],
css_classes = [],
disabled = False,
extra_x_ranges = {},
extra_y_ranges = {},
frame_height = None,
frame_width = None,
height = 700,
height_policy = 'auto',
hidpi = True,
inner_height = 0,
inner_width = 0,
js_event_callbacks = {},
js_property_callbacks = {},
left = [CategoricalAxis(id='2028', ...)],
lod_factor = 10,
lod_interval = 300,
lod_threshold = 2000,
lod_timeout = 500,
margin = (0, 0, 0, 0),
match_aspect = False,
max_height = None,
max_width = None,
min_border = 5,
min_border_bottom = None,
min_border_left = None,
min_border_right = None,
min_border_top = None,
min_height = None,
min_width = None,
name = None,
outer_height = 0,
outer_width = 0,
outline_line_alpha = 1.0,
outline_line_cap = 'butt',
outline_line_color = None,
outline_line_dash = [],
outline_line_dash_offset = 0,
outline_line_join = 'bevel',
outline_line_width = 1,
output_backend = 'canvas',
renderers = [GlyphRenderer(id='2048', ...)],
reset_policy = 'standard',
right = [],
sizing_mode = None,
subscribed_events = [],
syncable = True,
tags = [],
title = Title(id='2015', ...),
title_location = 'above',
toolbar = Toolbar(id='2037', ...),
toolbar_location = 'above',
toolbar_sticky = True,
visible = True,
width = 900,
width_policy = 'auto',
x_range = FactorRange(id='2017', ...),
x_scale = CategoricalScale(id='2021', ...),
y_range = FactorRange(id='2019', ...),
y_scale = CategoricalScale(id='2023', ...))
\n", "\n" ] }, "metadata": {}, "execution_count": 14 } ], "metadata": {} }, { "cell_type": "markdown", "source": [ "## Size based on number of distinct values\r\n", "\r\n", "Use the `dist_count` parameter with the `value_col` parameter\r\n", "to display size based on number of distinct values in the value_col column.\r\n", "\r\n", "The plot below plots the circle size in proportion to the number\r\n", "of distinct Layer 7 protocols used between the endpoints." ], "metadata": {} }, { "cell_type": "code", "execution_count": 21, "source": [ "net_df.mp_plot.matrix(\r\n", " x=\"SourceIP\",\r\n", " y=\"DestinationIP\",\r\n", " value_col=\"TotalAllowedFlows\",\r\n", " dist_count=True,\r\n", " title=\"External IP protocol flows (distinct protocols)\",\r\n", " sort=\"asc\",\r\n", " max_label_font_size=9,\r\n", ")" ], "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": "\n(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n\n if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n var JS_MIME_TYPE = 'application/javascript';\n var HTML_MIME_TYPE = 'text/html';\n var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n var CLASS_NAME = 'output_bokeh rendered_html';\n\n /**\n * Render data to the DOM node\n */\n function render(props, node) {\n var script = document.createElement(\"script\");\n node.appendChild(script);\n }\n\n /**\n * Handle when an output is cleared or removed\n */\n function handleClearOutput(event, handle) {\n var cell = handle.cell;\n\n var id = cell.output_area._bokeh_element_id;\n var server_id = cell.output_area._bokeh_server_id;\n // Clean up Bokeh references\n if (id != null && id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n\n if (server_id !== undefined) {\n // Clean up Bokeh references\n var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n cell.notebook.kernel.execute(cmd, {\n iopub: {\n output: function(msg) {\n var id = msg.content.text.trim();\n if (id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n }\n }\n });\n // Destroy server and session\n var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n cell.notebook.kernel.execute(cmd);\n }\n }\n\n /**\n * Handle when a new output is added\n */\n function handleAddOutput(event, handle) {\n var output_area = handle.output_area;\n var output = handle.output;\n\n // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n if ((output.output_type != \"display_data\") || (!Object.prototype.hasOwnProperty.call(output.data, EXEC_MIME_TYPE))) {\n return\n }\n\n var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n\n if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n // store reference to embed id on output_area\n output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n }\n if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n var bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n var script_attrs = bk_div.children[0].attributes;\n for (var i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\n }\n // store reference to server id on output_area\n output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n }\n }\n\n function register_renderer(events, OutputArea) {\n\n function append_mime(data, metadata, element) {\n // create a DOM node to render to\n var toinsert = this.create_output_subarea(\n metadata,\n CLASS_NAME,\n EXEC_MIME_TYPE\n );\n this.keyboard_manager.register_events(toinsert);\n // Render to node\n var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n render(props, toinsert[toinsert.length - 1]);\n element.append(toinsert);\n return toinsert\n }\n\n /* Handle when an output is cleared or removed */\n events.on('clear_output.CodeCell', handleClearOutput);\n events.on('delete.Cell', handleClearOutput);\n\n /* Handle when a new output is added */\n events.on('output_added.OutputArea', handleAddOutput);\n\n /**\n * Register the mime type and append_mime function with output_area\n */\n OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n /* Is output safe? */\n safe: true,\n /* Index of renderer in `output_area.display_order` */\n index: 0\n });\n }\n\n // register the mime type if in Jupyter Notebook environment and previously unregistered\n if (root.Jupyter !== undefined) {\n var events = require('base/js/events');\n var OutputArea = require('notebook/js/outputarea').OutputArea;\n\n if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n register_renderer(events, OutputArea);\n }\n }\n\n \n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n var NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\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 \"

\\n\"+\n \"
    \\n\"+\n \"
  • re-rerun `output_notebook()` to attempt to load from CDN again, or
  • \\n\"+\n \"
  • use INLINE resources instead, as so:
  • \\n\"+\n \"
\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n var el = document.getElementById(\"2719\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"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.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error(url) {\n console.error(\"failed to load \" + url);\n }\n\n for (let i = 0; i < css_urls.length; i++) {\n const url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n const hashes = {\"https://cdn.bokeh.org/bokeh/release/bokeh-2.3.2.min.js\": \"XypntL49z55iwGVUW4qsEu83zKL3XEcz0MjuGOQ9SlaaQ68X/g+k1FcioZi7oQAc\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.2.min.js\": \"bEsM86IHGDTLCS0Zod8a8WM6Y4+lafAL/eSiyQcuPzinmWNgNO2/olUF0Z2Dkn5i\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\": \"TX0gSQTdXTTeScqxj6PVQxTiRW8DOoGVwinyi1D3kxv7wuxQ02XkOxv0xwiypcAH\"};\n\n for (let i = 0; i < js_urls.length; i++) {\n const url = js_urls[i];\n const element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.async = false;\n element.src = url;\n if (url in hashes) {\n element.crossOrigin = \"anonymous\";\n element.integrity = \"sha384-\" + hashes[url];\n }\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n \n var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.2.min.js\"];\n var css_urls = [];\n \n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n function(Bokeh) {\n \n \n }\n ];\n\n function run_inline_js() {\n \n if (root.Bokeh !== undefined || force === true) {\n \n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }\n if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n var cell = $(document.getElementById(\"2719\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));", "application/vnd.bokehjs_load.v0+json": "" }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.bokehjs_exec.v0+json": "", "application/javascript": "(function(root) {\n function embed_document(root) {\n \n var docs_json = {\"3be3ee9c-f301-4867-8aea-40e766d6dfc7\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2732\"}],\"center\":[{\"id\":\"2734\"},{\"id\":\"2737\"}],\"height\":700,\"left\":[{\"id\":\"2735\"}],\"outline_line_color\":null,\"renderers\":[{\"id\":\"2755\"}],\"title\":{\"id\":\"2722\"},\"toolbar\":{\"id\":\"2744\"},\"toolbar_location\":\"above\",\"width\":900,\"x_range\":{\"id\":\"2724\"},\"x_scale\":{\"id\":\"2728\"},\"y_range\":{\"id\":\"2726\"},\"y_scale\":{\"id\":\"2730\"}},\"id\":\"2721\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"2733\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"2738\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"2758\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"2762\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"2728\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"data\":{\"DestinationIP\":[\"40.77.228.69\",\"52.168.138.145\",\"13.71.172.130\",\"40.91.75.5\",\"40.124.45.19\",\"13.71.172.128\",\"172.217.15.99\",\"20.38.98.100\",\"104.43.212.12\",\"13.71.172.128\",\"13.71.172.130\",\"40.124.45.19\",\"65.55.44.109\",\"65.55.44.109\",\"13.65.107.32\",\"40.124.45.19\",\"40.77.228.69\",\"52.165.170.112\",\"52.168.138.145\",\"72.21.81.200\",\"13.65.107.32\",\"40.124.45.19\",\"52.168.138.145\",\"65.55.44.109\",\"52.168.138.145\",\"40.124.45.19\",\"72.21.91.29\",\"72.21.81.200\",\"40.91.75.5\",\"13.71.172.130\",\"65.55.44.108\",\"65.55.44.109\",\"72.21.81.240\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"13.71.172.128\",\"40.77.232.95\",\"52.165.170.112\",\"65.55.44.109\",\"72.21.81.200\",\"72.21.91.29\",\"52.168.138.145\",\"13.67.143.117\",\"13.68.93.109\",\"13.71.172.128\",\"23.48.36.78\",\"52.165.170.112\",\"65.55.44.109\",\"20.38.98.100\",\"8.249.241.254\",\"40.77.228.69\",\"172.217.15.99\",\"13.67.143.117\",\"13.71.172.130\",\"40.124.45.19\",\"40.77.226.250\",\"52.239.152.10\",\"65.55.44.109\",\"90.130.70.73\",\"20.38.98.100\",\"65.55.44.109\",\"13.65.107.32\",\"13.67.143.117\",\"20.38.98.100\",\"13.67.143.117\",\"13.71.172.128\",\"13.71.172.130\",\"13.83.148.218\",\"20.38.98.100\",\"23.4.187.27\",\"40.124.45.19\",\"65.55.44.108\",\"72.21.81.200\",\"72.21.91.29\",\"99.84.104.63\",\"13.65.107.32\",\"40.124.45.19\",\"172.217.15.99\",\"8.249.241.254\",\"13.68.93.109\",\"40.77.228.69\",\"65.55.44.109\",\"52.168.138.145\",\"40.124.45.19\",\"157.55.134.136\"],\"SourceIP\":[\"10.0.3.5\",\"10.0.3.5\",\"104.43.212.12\",\"104.43.212.12\",\"13.107.4.50\",\"13.65.107.32\",\"13.65.107.32\",\"13.65.107.32\",\"13.67.143.117\",\"13.67.143.117\",\"13.67.143.117\",\"13.67.143.117\",\"13.67.143.117\",\"13.68.93.109\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.130\",\"13.71.172.130\",\"13.71.172.130\",\"13.71.172.130\",\"13.83.148.218\",\"131.107.147.209\",\"157.55.134.136\",\"172.217.15.99\",\"172.217.8.14\",\"20.38.98.100\",\"20.38.98.100\",\"20.38.98.100\",\"20.38.98.100\",\"205.185.216.42\",\"23.4.187.27\",\"23.48.36.78\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.77.226.250\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.232.95\",\"40.77.232.95\",\"40.91.75.5\",\"52.165.170.112\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.239.152.10\",\"52.239.152.10\",\"65.55.163.76\",\"65.55.44.108\",\"65.55.44.108\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"72.21.81.200\",\"72.21.81.200\",\"72.21.81.240\",\"72.21.81.240\",\"72.21.91.29\",\"72.21.91.29\",\"72.21.91.29\",\"8.249.241.254\",\"90.130.70.73\",\"99.84.104.63\"],\"TotalAllowedFlows\":[1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,3,1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85],\"plt_size\":{\"__ndarray__\":\"q6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqhpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkAAAAAAAAAkQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqhpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqhpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqGkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqGkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoaQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkCrqqqqqqoKQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[86]},\"size\":[1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,3,1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]},\"selected\":{\"id\":\"2764\"},\"selection_policy\":{\"id\":\"2765\"}},\"id\":\"2720\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"2742\",\"type\":\"SaveTool\"},{\"attributes\":{},\"id\":\"2736\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"2761\",\"type\":\"AllLabels\"},{\"attributes\":{\"axis_label\":\"DestinationIP\",\"axis_line_color\":null,\"formatter\":{\"id\":\"2759\"},\"major_label_policy\":{\"id\":\"2758\"},\"major_label_standoff\":0,\"major_label_text_font_size\":\"9pt\",\"major_tick_line_color\":null,\"ticker\":{\"id\":\"2736\"}},\"id\":\"2735\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"2743\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"factors\":[\"10.0.3.5\",\"104.43.212.12\",\"13.107.4.50\",\"13.65.107.32\",\"13.67.143.117\",\"13.68.93.109\",\"13.71.172.128\",\"13.71.172.130\",\"13.83.148.218\",\"131.107.147.209\",\"157.55.134.136\",\"172.217.15.99\",\"172.217.8.14\",\"20.38.98.100\",\"205.185.216.42\",\"23.4.187.27\",\"23.48.36.78\",\"40.124.45.19\",\"40.77.226.250\",\"40.77.228.69\",\"40.77.232.95\",\"40.91.75.5\",\"52.165.170.112\",\"52.168.138.145\",\"52.239.152.10\",\"65.55.163.76\",\"65.55.44.108\",\"65.55.44.109\",\"72.21.81.200\",\"72.21.81.240\",\"72.21.91.29\",\"8.249.241.254\",\"90.130.70.73\",\"99.84.104.63\"]},\"id\":\"2724\",\"type\":\"FactorRange\"},{\"attributes\":{\"source\":{\"id\":\"2720\"}},\"id\":\"2756\",\"type\":\"CDSView\"},{\"attributes\":{\"overlay\":{\"id\":\"2743\"}},\"id\":\"2739\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"2765\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis\":{\"id\":\"2732\"},\"grid_line_alpha\":0.1,\"grid_line_color\":\"navy\",\"ticker\":null},\"id\":\"2734\",\"type\":\"Grid\"},{\"attributes\":{\"text\":\"External IP protocol flows (distinct protocols)\",\"text_font_size\":\"15pt\"},\"id\":\"2722\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"2759\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"red\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"field\":\"plt_size\"},\"x\":{\"field\":\"SourceIP\"},\"y\":{\"field\":\"DestinationIP\"}},\"id\":\"2754\",\"type\":\"Circle\"},{\"attributes\":{\"axis\":{\"id\":\"2735\"},\"dimension\":1,\"grid_line_alpha\":0.1,\"grid_line_color\":\"navy\",\"ticker\":null},\"id\":\"2737\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2740\",\"type\":\"PanTool\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"SourceIP\",\"@SourceIP\"],[\"DestinationIP\",\"@DestinationIP\"],[\"value\",\"@size\"]]},\"id\":\"2750\",\"type\":\"HoverTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.6},\"fill_color\":{\"value\":\"red\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"field\":\"plt_size\"},\"x\":{\"field\":\"SourceIP\"},\"y\":{\"field\":\"DestinationIP\"}},\"id\":\"2753\",\"type\":\"Circle\"},{\"attributes\":{\"data_source\":{\"id\":\"2720\"},\"glyph\":{\"id\":\"2753\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2754\"},\"view\":{\"id\":\"2756\"}},\"id\":\"2755\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"2738\"},{\"id\":\"2739\"},{\"id\":\"2740\"},{\"id\":\"2741\"},{\"id\":\"2742\"},{\"id\":\"2750\"}]},\"id\":\"2744\",\"type\":\"Toolbar\"},{\"attributes\":{\"axis_label\":\"SourceIP\",\"axis_line_color\":null,\"formatter\":{\"id\":\"2762\"},\"major_label_orientation\":1.5707963267948966,\"major_label_policy\":{\"id\":\"2761\"},\"major_label_standoff\":0,\"major_label_text_font_size\":\"9pt\",\"major_tick_line_color\":null,\"ticker\":{\"id\":\"2733\"}},\"id\":\"2732\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"2730\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"factors\":[\"99.84.104.63\",\"90.130.70.73\",\"8.249.241.254\",\"72.21.91.29\",\"72.21.81.240\",\"72.21.81.200\",\"65.55.44.109\",\"65.55.44.108\",\"52.239.152.10\",\"52.168.138.145\",\"52.165.170.112\",\"40.91.75.5\",\"40.77.232.95\",\"40.77.228.69\",\"40.77.226.250\",\"40.124.45.19\",\"23.48.36.78\",\"23.4.187.27\",\"20.38.98.100\",\"172.217.15.99\",\"157.55.134.136\",\"13.83.148.218\",\"13.71.172.130\",\"13.71.172.128\",\"13.68.93.109\",\"13.67.143.117\",\"13.65.107.32\",\"104.43.212.12\"]},\"id\":\"2726\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"2741\",\"type\":\"ResetTool\"},{\"attributes\":{},\"id\":\"2764\",\"type\":\"Selection\"}],\"root_ids\":[\"2721\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n var render_items = [{\"docid\":\"3be3ee9c-f301-4867-8aea-40e766d6dfc7\",\"root_ids\":[\"2721\"],\"roots\":{\"2721\":\"abc0d1cf-253b-45f4-8494-1173f4a07fcd\"}}];\n root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n\n }\n if (root.Bokeh !== undefined) {\n embed_document(root);\n } else {\n var attempts = 0;\n var timer = setInterval(function(root) {\n if (root.Bokeh !== undefined) {\n clearInterval(timer);\n embed_document(root);\n } else {\n attempts++;\n if (attempts > 100) {\n clearInterval(timer);\n console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n }\n }\n }, 10, root)\n }\n})(window);" }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "Figure(id='2721', ...)" ], "text/html": [ "
Figure(
id = '2721', …)
above = [],
align = 'start',
aspect_ratio = None,
aspect_scale = 1,
background = None,
background_fill_alpha = 1.0,
background_fill_color = '#ffffff',
below = [CategoricalAxis(id='2732', ...)],
border_fill_alpha = 1.0,
border_fill_color = '#ffffff',
center = [Grid(id='2734', ...), Grid(id='2737', ...)],
css_classes = [],
disabled = False,
extra_x_ranges = {},
extra_y_ranges = {},
frame_height = None,
frame_width = None,
height = 700,
height_policy = 'auto',
hidpi = True,
inner_height = 0,
inner_width = 0,
js_event_callbacks = {},
js_property_callbacks = {},
left = [CategoricalAxis(id='2735', ...)],
lod_factor = 10,
lod_interval = 300,
lod_threshold = 2000,
lod_timeout = 500,
margin = (0, 0, 0, 0),
match_aspect = False,
max_height = None,
max_width = None,
min_border = 5,
min_border_bottom = None,
min_border_left = None,
min_border_right = None,
min_border_top = None,
min_height = None,
min_width = None,
name = None,
outer_height = 0,
outer_width = 0,
outline_line_alpha = 1.0,
outline_line_cap = 'butt',
outline_line_color = None,
outline_line_dash = [],
outline_line_dash_offset = 0,
outline_line_join = 'bevel',
outline_line_width = 1,
output_backend = 'canvas',
renderers = [GlyphRenderer(id='2755', ...)],
reset_policy = 'standard',
right = [],
sizing_mode = None,
subscribed_events = [],
syncable = True,
tags = [],
title = Title(id='2722', ...),
title_location = 'above',
toolbar = Toolbar(id='2744', ...),
toolbar_location = 'above',
toolbar_sticky = True,
visible = True,
width = 900,
width_policy = 'auto',
x_range = FactorRange(id='2724', ...),
x_scale = CategoricalScale(id='2728', ...),
y_range = FactorRange(id='2726', ...),
y_scale = CategoricalScale(id='2730', ...))
\n", "\n" ] }, "metadata": {}, "output_type": "display_data" } ], "metadata": {} }, { "cell_type": "markdown", "source": [ "## Inverting to show rare interactions as larger\r\n", "\r\n", "Where you want to highlight unusual interactions, we can plot the\r\n", "inverse of the `value_col` value or count of interactions using the `invert=True` parameter.\r\n", "\r\n", "This results in a plot with larger circles for rarer interactions." ], "metadata": {} }, { "cell_type": "code", "execution_count": 16, "source": [ "net_df.mp_plot.matrix(\r\n", " x=\"SourceIP\",\r\n", " y=\"DestinationIP\",\r\n", " value_col=\"TotalAllowedFlows\",\r\n", " title=\"External IP flows (rare flows == larger)\",\r\n", " invert=True,\r\n", " sort=\"asc\",\r\n", ")" ], "outputs": [ { "output_type": "display_data", "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "application/javascript": "\n(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n\n if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n var JS_MIME_TYPE = 'application/javascript';\n var HTML_MIME_TYPE = 'text/html';\n var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n var CLASS_NAME = 'output_bokeh rendered_html';\n\n /**\n * Render data to the DOM node\n */\n function render(props, node) {\n var script = document.createElement(\"script\");\n node.appendChild(script);\n }\n\n /**\n * Handle when an output is cleared or removed\n */\n function handleClearOutput(event, handle) {\n var cell = handle.cell;\n\n var id = cell.output_area._bokeh_element_id;\n var server_id = cell.output_area._bokeh_server_id;\n // Clean up Bokeh references\n if (id != null && id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n\n if (server_id !== undefined) {\n // Clean up Bokeh references\n var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n cell.notebook.kernel.execute(cmd, {\n iopub: {\n output: function(msg) {\n var id = msg.content.text.trim();\n if (id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n }\n }\n });\n // Destroy server and session\n var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n cell.notebook.kernel.execute(cmd);\n }\n }\n\n /**\n * Handle when a new output is added\n */\n function handleAddOutput(event, handle) {\n var output_area = handle.output_area;\n var output = handle.output;\n\n // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n if ((output.output_type != \"display_data\") || (!Object.prototype.hasOwnProperty.call(output.data, EXEC_MIME_TYPE))) {\n return\n }\n\n var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n\n if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n // store reference to embed id on output_area\n output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n }\n if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n var bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n var script_attrs = bk_div.children[0].attributes;\n for (var i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\n }\n // store reference to server id on output_area\n output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n }\n }\n\n function register_renderer(events, OutputArea) {\n\n function append_mime(data, metadata, element) {\n // create a DOM node to render to\n var toinsert = this.create_output_subarea(\n metadata,\n CLASS_NAME,\n EXEC_MIME_TYPE\n );\n this.keyboard_manager.register_events(toinsert);\n // Render to node\n var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n render(props, toinsert[toinsert.length - 1]);\n element.append(toinsert);\n return toinsert\n }\n\n /* Handle when an output is cleared or removed */\n events.on('clear_output.CodeCell', handleClearOutput);\n events.on('delete.Cell', handleClearOutput);\n\n /* Handle when a new output is added */\n events.on('output_added.OutputArea', handleAddOutput);\n\n /**\n * Register the mime type and append_mime function with output_area\n */\n OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n /* Is output safe? */\n safe: true,\n /* Index of renderer in `output_area.display_order` */\n index: 0\n });\n }\n\n // register the mime type if in Jupyter Notebook environment and previously unregistered\n if (root.Jupyter !== undefined) {\n var events = require('base/js/events');\n var OutputArea = require('notebook/js/outputarea').OutputArea;\n\n if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n register_renderer(events, OutputArea);\n }\n }\n\n \n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n var NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\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 \"

\\n\"+\n \"
    \\n\"+\n \"
  • re-rerun `output_notebook()` to attempt to load from CDN again, or
  • \\n\"+\n \"
  • use INLINE resources instead, as so:
  • \\n\"+\n \"
\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n var el = document.getElementById(\"2214\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"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.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error(url) {\n console.error(\"failed to load \" + url);\n }\n\n for (let i = 0; i < css_urls.length; i++) {\n const url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n const hashes = {\"https://cdn.bokeh.org/bokeh/release/bokeh-2.3.2.min.js\": \"XypntL49z55iwGVUW4qsEu83zKL3XEcz0MjuGOQ9SlaaQ68X/g+k1FcioZi7oQAc\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.2.min.js\": \"bEsM86IHGDTLCS0Zod8a8WM6Y4+lafAL/eSiyQcuPzinmWNgNO2/olUF0Z2Dkn5i\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\": \"TX0gSQTdXTTeScqxj6PVQxTiRW8DOoGVwinyi1D3kxv7wuxQ02XkOxv0xwiypcAH\"};\n\n for (let i = 0; i < js_urls.length; i++) {\n const url = js_urls[i];\n const element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.async = false;\n element.src = url;\n if (url in hashes) {\n element.crossOrigin = \"anonymous\";\n element.integrity = \"sha384-\" + hashes[url];\n }\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n \n var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.2.min.js\"];\n var css_urls = [];\n \n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n function(Bokeh) {\n \n \n }\n ];\n\n function run_inline_js() {\n \n if (root.Bokeh !== undefined || force === true) {\n \n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }\n if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n var cell = $(document.getElementById(\"2214\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));", "application/vnd.bokehjs_load.v0+json": "" }, "metadata": {} }, { "output_type": "display_data", "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "application/vnd.bokehjs_exec.v0+json": "", "application/javascript": "(function(root) {\n function embed_document(root) {\n \n var docs_json = {\"7c8296f2-2839-4214-8b60-72ead069e93f\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2227\"}],\"center\":[{\"id\":\"2229\"},{\"id\":\"2232\"}],\"height\":700,\"left\":[{\"id\":\"2230\"}],\"outline_line_color\":null,\"renderers\":[{\"id\":\"2250\"}],\"title\":{\"id\":\"2217\"},\"toolbar\":{\"id\":\"2239\"},\"toolbar_location\":\"above\",\"width\":900,\"x_range\":{\"id\":\"2219\"},\"x_scale\":{\"id\":\"2223\"},\"y_range\":{\"id\":\"2221\"},\"y_scale\":{\"id\":\"2225\"}},\"id\":\"2216\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"2228\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"text\":\"External IP flows (rare flows == larger)\",\"text_font_size\":\"15pt\"},\"id\":\"2217\",\"type\":\"Title\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.6},\"fill_color\":{\"value\":\"red\"},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"field\":\"plt_size\"},\"x\":{\"field\":\"SourceIP\"},\"y\":{\"field\":\"DestinationIP\"}},\"id\":\"2248\",\"type\":\"Circle\"},{\"attributes\":{\"source\":{\"id\":\"2215\"}},\"id\":\"2251\",\"type\":\"CDSView\"},{\"attributes\":{\"axis_label\":\"SourceIP\",\"axis_line_color\":null,\"formatter\":{\"id\":\"2257\"},\"major_label_orientation\":1.5707963267948966,\"major_label_policy\":{\"id\":\"2256\"},\"major_label_standoff\":0,\"major_label_text_font_size\":\"11pt\",\"major_tick_line_color\":null,\"ticker\":{\"id\":\"2228\"}},\"id\":\"2227\",\"type\":\"CategoricalAxis\"},{\"attributes\":{\"axis\":{\"id\":\"2227\"},\"grid_line_alpha\":0.1,\"grid_line_color\":\"navy\",\"ticker\":null},\"id\":\"2229\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2231\",\"type\":\"CategoricalTicker\"},{\"attributes\":{},\"id\":\"2260\",\"type\":\"UnionRenderers\"},{\"attributes\":{\"axis_label\":\"DestinationIP\",\"axis_line_color\":null,\"formatter\":{\"id\":\"2254\"},\"major_label_policy\":{\"id\":\"2253\"},\"major_label_standoff\":0,\"major_label_text_font_size\":\"11pt\",\"major_tick_line_color\":null,\"ticker\":{\"id\":\"2231\"}},\"id\":\"2230\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"2225\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"2253\",\"type\":\"AllLabels\"},{\"attributes\":{\"axis\":{\"id\":\"2230\"},\"dimension\":1,\"grid_line_alpha\":0.1,\"grid_line_color\":\"navy\",\"ticker\":null},\"id\":\"2232\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2223\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"2238\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"data\":{\"DestinationIP\":[\"40.77.228.69\",\"52.168.138.145\",\"13.71.172.130\",\"40.91.75.5\",\"40.124.45.19\",\"13.71.172.128\",\"172.217.15.99\",\"20.38.98.100\",\"104.43.212.12\",\"13.71.172.128\",\"13.71.172.130\",\"40.124.45.19\",\"65.55.44.109\",\"65.55.44.109\",\"13.65.107.32\",\"40.124.45.19\",\"40.77.228.69\",\"52.165.170.112\",\"52.168.138.145\",\"72.21.81.200\",\"13.65.107.32\",\"40.124.45.19\",\"52.168.138.145\",\"65.55.44.109\",\"52.168.138.145\",\"40.124.45.19\",\"72.21.91.29\",\"72.21.81.200\",\"40.91.75.5\",\"13.71.172.130\",\"65.55.44.108\",\"65.55.44.109\",\"72.21.81.240\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"13.71.172.128\",\"40.77.232.95\",\"52.165.170.112\",\"65.55.44.109\",\"72.21.81.200\",\"72.21.91.29\",\"52.168.138.145\",\"13.67.143.117\",\"13.68.93.109\",\"13.71.172.128\",\"23.48.36.78\",\"52.165.170.112\",\"65.55.44.109\",\"20.38.98.100\",\"8.249.241.254\",\"40.77.228.69\",\"172.217.15.99\",\"13.67.143.117\",\"13.71.172.130\",\"40.124.45.19\",\"40.77.226.250\",\"52.239.152.10\",\"65.55.44.109\",\"90.130.70.73\",\"20.38.98.100\",\"65.55.44.109\",\"13.65.107.32\",\"13.67.143.117\",\"20.38.98.100\",\"13.67.143.117\",\"13.71.172.128\",\"13.71.172.130\",\"13.83.148.218\",\"20.38.98.100\",\"23.4.187.27\",\"40.124.45.19\",\"65.55.44.108\",\"72.21.81.200\",\"72.21.91.29\",\"99.84.104.63\",\"13.65.107.32\",\"40.124.45.19\",\"172.217.15.99\",\"8.249.241.254\",\"13.68.93.109\",\"40.77.228.69\",\"65.55.44.109\",\"52.168.138.145\",\"40.124.45.19\",\"157.55.134.136\"],\"SourceIP\":[\"10.0.3.5\",\"10.0.3.5\",\"104.43.212.12\",\"104.43.212.12\",\"13.107.4.50\",\"13.65.107.32\",\"13.65.107.32\",\"13.65.107.32\",\"13.67.143.117\",\"13.67.143.117\",\"13.67.143.117\",\"13.67.143.117\",\"13.67.143.117\",\"13.68.93.109\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.130\",\"13.71.172.130\",\"13.71.172.130\",\"13.71.172.130\",\"13.83.148.218\",\"131.107.147.209\",\"157.55.134.136\",\"172.217.15.99\",\"172.217.8.14\",\"20.38.98.100\",\"20.38.98.100\",\"20.38.98.100\",\"20.38.98.100\",\"205.185.216.42\",\"23.4.187.27\",\"23.48.36.78\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.77.226.250\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.232.95\",\"40.77.232.95\",\"40.91.75.5\",\"52.165.170.112\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.239.152.10\",\"52.239.152.10\",\"65.55.163.76\",\"65.55.44.108\",\"65.55.44.108\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"72.21.81.200\",\"72.21.81.200\",\"72.21.81.240\",\"72.21.81.240\",\"72.21.91.29\",\"72.21.91.29\",\"72.21.91.29\",\"8.249.241.254\",\"90.130.70.73\",\"99.84.104.63\"],\"TotalAllowedFlows\":{\"__ndarray__\":\"AAAAAAAACEAAAAAAAADwPwAAAAAAABBAAAAAAAAAAEAAAAAAAAAAQAAAAAAAABBAAAAAAAAAFEAAAAAAAAAgQAAAAAAAAPA/AAAAAAAA8D8AAAAAAADwPwAAAAAAABBAAAAAAAAA8D8AAAAAAAAiQAAAAAAAADBAAAAAAAAAMEAAAAAAAABLQAAAAAAAADNAAAAAAAAAMkAAAAAAAAAzQAAAAAAAACpAAAAAAAAAMEAAAAAAAAAqQAAAAAAAAD9AAAAAAAAAAEAAAAAAAAAAQAAAAAAAABxAAAAAAAAAEEAAAAAAAAAAQAAAAAAAABxAAAAAAAAAAEAAAAAAAADwPwAAAAAAACBAAAAAAACAREAAAAAAAAAAQAAAAAAAgERAAAAAAAAAIEAAAAAAAAAUQAAAAAAAAPA/AAAAAAAAFEAAAAAAAAAcQAAAAAAAAPA/AAAAAAAA8D8AAAAAAAAUQAAAAAAAABRAAAAAAAAAIkAAAAAAAAAcQAAAAAAAACJAAAAAAAAAFEAAAAAAAAAAQAAAAAAAAPA/AAAAAAAAAEAAAAAAAAAIQAAAAAAAAAhAAAAAAAAACEAAAAAAAAAQQAAAAAAAABBAAAAAAAAAEEAAAAAAAAAqQAAAAAAAAAhAAAAAAAAAAEAAAAAAAAAQQAAAAAAAABRAAAAAAAAAIkAAAAAAAAAUQAAAAAAAACBAAAAAAAAAEEAAAAAAAAAkQAAAAAAAACJAAAAAAAAAFEAAAAAAAAAYQAAAAAAAABBAAAAAAAAAGEAAAAAAAAAYQAAAAAAAACJAAAAAAAAACEAAAAAAAAAUQAAAAAAAAABAAAAAAAAACEAAAAAAAAAkQAAAAAAAAPA/AAAAAAAA8D8AAAAAAADwPwAAAAAAAPA/AAAAAAAA8D8AAAAAAAAcQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[86]},\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85],\"plt_size\":{\"__ndarray__\":\"q6qqqqqqCkAAAAAAAAAkQAAAAAAAAARAAAAAAAAAFEAAAAAAAAAUQAAAAAAAAARAAAAAAAAAAEAAAAAAAAD0PwAAAAAAACRAAAAAAAAAJEAAAAAAAAAkQAAAAAAAAARAAAAAAAAAJEByHMdxHMfxPwAAAAAAAOQ/AAAAAAAA5D9CewntJbTHP3kN5TWU1+A/chzHcRzH4T95DeU1lNfgP9mJndiJneg/AAAAAAAA5D/ZiZ3YiZ3oP6WUUkoppdQ/AAAAAAAAFEAAAAAAAAAUQLdt27Zt2/Y/AAAAAAAABEAAAAAAAAAUQLdt27Zt2/Y/AAAAAAAAFEAAAAAAAAAkQAAAAAAAAPQ/OR+D8zE4zz8AAAAAAAAUQDkfg/MxOM8/AAAAAAAA9D8AAAAAAAAAQAAAAAAAACRAAAAAAAAAAEC3bdu2bdv2PwAAAAAAACRAAAAAAAAAJEAAAAAAAAAAQAAAAAAAAABAchzHcRzH8T+3bdu2bdv2P3Icx3Ecx/E/AAAAAAAAAEAAAAAAAAAUQAAAAAAAACRAAAAAAAAAFECrqqqqqqoKQKuqqqqqqgpAq6qqqqqqCkAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEDZiZ3YiZ3oP6uqqqqqqgpAAAAAAAAAFEAAAAAAAAAEQAAAAAAAAABAchzHcRzH8T8AAAAAAAAAQAAAAAAAAPQ/AAAAAAAABEAAAAAAAADwP3Icx3Ecx/E/AAAAAAAAAECrqqqqqqr6PwAAAAAAAARAq6qqqqqq+j+rqqqqqqr6P3Icx3Ecx/E/q6qqqqqqCkAAAAAAAAAAQAAAAAAAABRAq6qqqqqqCkAAAAAAAADwPwAAAAAAACRAAAAAAAAAJEAAAAAAAAAkQAAAAAAAACRAAAAAAAAAJEC3bdu2bdv2Pw==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[86]},\"size\":{\"__ndarray__\":\"AAAAAAAAMkAAAAAAAABLQAAAAAAAACtAAAAAAAAAO0AAAAAAAAA7QAAAAAAAACtAmpmZmZmZJUAAAAAAAAAbQAAAAAAAAEtAAAAAAAAAS0AAAAAAAABLQAAAAAAAACtAAAAAAAAAS0AAAAAAAAAYQAAAAAAAAAtAAAAAAAAAC0AAAAAAAADwP8prKK+hvAZAAAAAAAAACEDKayivobwGQNmJndiJnRBAAAAAAAAAC0DZiZ3YiZ0QQN9777333vs/AAAAAAAAO0AAAAAAAAA7QLdt27Zt2x5AAAAAAAAAK0AAAAAAAAA7QLdt27Zt2x5AAAAAAAAAO0AAAAAAAABLQAAAAAAAABtAE7UrUbsS9T8AAAAAAAA7QBO1K1G7EvU/AAAAAAAAG0CamZmZmZklQAAAAAAAAEtAmpmZmZmZJUC3bdu2bdseQAAAAAAAAEtAAAAAAAAAS0CamZmZmZklQJqZmZmZmSVAAAAAAAAAGEC3bdu2bdseQAAAAAAAABhAmpmZmZmZJUAAAAAAAAA7QAAAAAAAAEtAAAAAAAAAO0AAAAAAAAAyQAAAAAAAADJAAAAAAAAAMkAAAAAAAAArQAAAAAAAACtAAAAAAAAAK0DZiZ3YiZ0QQAAAAAAAADJAAAAAAAAAO0AAAAAAAAArQJqZmZmZmSVAAAAAAAAAGECamZmZmZklQAAAAAAAABtAAAAAAAAAK0CamZmZmZkVQAAAAAAAABhAmpmZmZmZJUAAAAAAAAAiQAAAAAAAACtAAAAAAAAAIkAAAAAAAAAiQAAAAAAAABhAAAAAAAAAMkCamZmZmZklQAAAAAAAADtAAAAAAAAAMkCamZmZmZkVQAAAAAAAAEtAAAAAAAAAS0AAAAAAAABLQAAAAAAAAEtAAAAAAAAAS0C3bdu2bdseQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[86]}},\"selected\":{\"id\":\"2259\"},\"selection_policy\":{\"id\":\"2260\"}},\"id\":\"2215\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"red\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"size\":{\"field\":\"plt_size\"},\"x\":{\"field\":\"SourceIP\"},\"y\":{\"field\":\"DestinationIP\"}},\"id\":\"2249\",\"type\":\"Circle\"},{\"attributes\":{},\"id\":\"2254\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"2257\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"factors\":[\"10.0.3.5\",\"104.43.212.12\",\"13.107.4.50\",\"13.65.107.32\",\"13.67.143.117\",\"13.68.93.109\",\"13.71.172.128\",\"13.71.172.130\",\"13.83.148.218\",\"131.107.147.209\",\"157.55.134.136\",\"172.217.15.99\",\"172.217.8.14\",\"20.38.98.100\",\"205.185.216.42\",\"23.4.187.27\",\"23.48.36.78\",\"40.124.45.19\",\"40.77.226.250\",\"40.77.228.69\",\"40.77.232.95\",\"40.91.75.5\",\"52.165.170.112\",\"52.168.138.145\",\"52.239.152.10\",\"65.55.163.76\",\"65.55.44.108\",\"65.55.44.109\",\"72.21.81.200\",\"72.21.81.240\",\"72.21.91.29\",\"8.249.241.254\",\"90.130.70.73\",\"99.84.104.63\"]},\"id\":\"2219\",\"type\":\"FactorRange\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"SourceIP\",\"@SourceIP\"],[\"DestinationIP\",\"@DestinationIP\"],[\"value\",\"@size\"]]},\"id\":\"2245\",\"type\":\"HoverTool\"},{\"attributes\":{},\"id\":\"2256\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"2259\",\"type\":\"Selection\"},{\"attributes\":{\"data_source\":{\"id\":\"2215\"},\"glyph\":{\"id\":\"2248\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2249\"},\"view\":{\"id\":\"2251\"}},\"id\":\"2250\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"2233\"},{\"id\":\"2234\"},{\"id\":\"2235\"},{\"id\":\"2236\"},{\"id\":\"2237\"},{\"id\":\"2245\"}]},\"id\":\"2239\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"2233\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"2237\",\"type\":\"SaveTool\"},{\"attributes\":{\"factors\":[\"99.84.104.63\",\"90.130.70.73\",\"8.249.241.254\",\"72.21.91.29\",\"72.21.81.240\",\"72.21.81.200\",\"65.55.44.109\",\"65.55.44.108\",\"52.239.152.10\",\"52.168.138.145\",\"52.165.170.112\",\"40.91.75.5\",\"40.77.232.95\",\"40.77.228.69\",\"40.77.226.250\",\"40.124.45.19\",\"23.48.36.78\",\"23.4.187.27\",\"20.38.98.100\",\"172.217.15.99\",\"157.55.134.136\",\"13.83.148.218\",\"13.71.172.130\",\"13.71.172.128\",\"13.68.93.109\",\"13.67.143.117\",\"13.65.107.32\",\"104.43.212.12\"]},\"id\":\"2221\",\"type\":\"FactorRange\"},{\"attributes\":{\"overlay\":{\"id\":\"2238\"}},\"id\":\"2234\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"2235\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"2236\",\"type\":\"ResetTool\"}],\"root_ids\":[\"2216\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n var render_items = [{\"docid\":\"7c8296f2-2839-4214-8b60-72ead069e93f\",\"root_ids\":[\"2216\"],\"roots\":{\"2216\":\"b5ea4311-74c5-4740-935d-16d399194efe\"}}];\n root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n\n }\n if (root.Bokeh !== undefined) {\n embed_document(root);\n } else {\n var attempts = 0;\n var timer = setInterval(function(root) {\n if (root.Bokeh !== undefined) {\n clearInterval(timer);\n embed_document(root);\n } else {\n attempts++;\n if (attempts > 100) {\n clearInterval(timer);\n console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n }\n }\n }, 10, root)\n }\n})(window);" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "2216" } } }, { "output_type": "execute_result", "data": { "text/plain": [ "Figure(id='2216', ...)" ], "text/html": [ "
Figure(
id = '2216', …)
above = [],
align = 'start',
aspect_ratio = None,
aspect_scale = 1,
background = None,
background_fill_alpha = 1.0,
background_fill_color = '#ffffff',
below = [CategoricalAxis(id='2227', ...)],
border_fill_alpha = 1.0,
border_fill_color = '#ffffff',
center = [Grid(id='2229', ...), Grid(id='2232', ...)],
css_classes = [],
disabled = False,
extra_x_ranges = {},
extra_y_ranges = {},
frame_height = None,
frame_width = None,
height = 700,
height_policy = 'auto',
hidpi = True,
inner_height = 0,
inner_width = 0,
js_event_callbacks = {},
js_property_callbacks = {},
left = [CategoricalAxis(id='2230', ...)],
lod_factor = 10,
lod_interval = 300,
lod_threshold = 2000,
lod_timeout = 500,
margin = (0, 0, 0, 0),
match_aspect = False,
max_height = None,
max_width = None,
min_border = 5,
min_border_bottom = None,
min_border_left = None,
min_border_right = None,
min_border_top = None,
min_height = None,
min_width = None,
name = None,
outer_height = 0,
outer_width = 0,
outline_line_alpha = 1.0,
outline_line_cap = 'butt',
outline_line_color = None,
outline_line_dash = [],
outline_line_dash_offset = 0,
outline_line_join = 'bevel',
outline_line_width = 1,
output_backend = 'canvas',
renderers = [GlyphRenderer(id='2250', ...)],
reset_policy = 'standard',
right = [],
sizing_mode = None,
subscribed_events = [],
syncable = True,
tags = [],
title = Title(id='2217', ...),
title_location = 'above',
toolbar = Toolbar(id='2239', ...),
toolbar_location = 'above',
toolbar_sticky = True,
visible = True,
width = 900,
width_policy = 'auto',
x_range = FactorRange(id='2219', ...),
x_scale = CategoricalScale(id='2223', ...),
y_range = FactorRange(id='2221', ...),
y_scale = CategoricalScale(id='2225', ...))
\n", "\n" ] }, "metadata": {}, "execution_count": 16 } ], "metadata": {} }, { "cell_type": "markdown", "source": [ "## Showing interactions only\r\n", "\r\n", "Where you do not care about any value associated with the interaction\r\n", "and only want to see if there has been an interaction, you can use\r\n", "the `intersect` parameter" ], "metadata": {} }, { "cell_type": "code", "execution_count": 19, "source": [ "net_df.mp_plot.matrix(\r\n", " x=\"SourceIP\",\r\n", " y=\"DestinationIP\",\r\n", " title=\"External IP flows (intersection)\",\r\n", " intersect=True,\r\n", " sort=\"asc\",\r\n", ")" ], "outputs": [ { "output_type": "display_data", "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "application/javascript": "\n(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n\n if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n var JS_MIME_TYPE = 'application/javascript';\n var HTML_MIME_TYPE = 'text/html';\n var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n var CLASS_NAME = 'output_bokeh rendered_html';\n\n /**\n * Render data to the DOM node\n */\n function render(props, node) {\n var script = document.createElement(\"script\");\n node.appendChild(script);\n }\n\n /**\n * Handle when an output is cleared or removed\n */\n function handleClearOutput(event, handle) {\n var cell = handle.cell;\n\n var id = cell.output_area._bokeh_element_id;\n var server_id = cell.output_area._bokeh_server_id;\n // Clean up Bokeh references\n if (id != null && id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n\n if (server_id !== undefined) {\n // Clean up Bokeh references\n var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n cell.notebook.kernel.execute(cmd, {\n iopub: {\n output: function(msg) {\n var id = msg.content.text.trim();\n if (id in Bokeh.index) {\n Bokeh.index[id].model.document.clear();\n delete Bokeh.index[id];\n }\n }\n }\n });\n // Destroy server and session\n var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n cell.notebook.kernel.execute(cmd);\n }\n }\n\n /**\n * Handle when a new output is added\n */\n function handleAddOutput(event, handle) {\n var output_area = handle.output_area;\n var output = handle.output;\n\n // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n if ((output.output_type != \"display_data\") || (!Object.prototype.hasOwnProperty.call(output.data, EXEC_MIME_TYPE))) {\n return\n }\n\n var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n\n if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n // store reference to embed id on output_area\n output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n }\n if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n var bk_div = document.createElement(\"div\");\n bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n var script_attrs = bk_div.children[0].attributes;\n for (var i = 0; i < script_attrs.length; i++) {\n toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n toinsert[toinsert.length - 1].firstChild.textContent = bk_div.children[0].textContent\n }\n // store reference to server id on output_area\n output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n }\n }\n\n function register_renderer(events, OutputArea) {\n\n function append_mime(data, metadata, element) {\n // create a DOM node to render to\n var toinsert = this.create_output_subarea(\n metadata,\n CLASS_NAME,\n EXEC_MIME_TYPE\n );\n this.keyboard_manager.register_events(toinsert);\n // Render to node\n var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n render(props, toinsert[toinsert.length - 1]);\n element.append(toinsert);\n return toinsert\n }\n\n /* Handle when an output is cleared or removed */\n events.on('clear_output.CodeCell', handleClearOutput);\n events.on('delete.Cell', handleClearOutput);\n\n /* Handle when a new output is added */\n events.on('output_added.OutputArea', handleAddOutput);\n\n /**\n * Register the mime type and append_mime function with output_area\n */\n OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n /* Is output safe? */\n safe: true,\n /* Index of renderer in `output_area.display_order` */\n index: 0\n });\n }\n\n // register the mime type if in Jupyter Notebook environment and previously unregistered\n if (root.Jupyter !== undefined) {\n var events = require('base/js/events');\n var OutputArea = require('notebook/js/outputarea').OutputArea;\n\n if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n register_renderer(events, OutputArea);\n }\n }\n\n \n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n var NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\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 \"

\\n\"+\n \"
    \\n\"+\n \"
  • re-rerun `output_notebook()` to attempt to load from CDN again, or
  • \\n\"+\n \"
  • use INLINE resources instead, as so:
  • \\n\"+\n \"
\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n var el = document.getElementById(\"2517\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"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.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error(url) {\n console.error(\"failed to load \" + url);\n }\n\n for (let i = 0; i < css_urls.length; i++) {\n const url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n const hashes = {\"https://cdn.bokeh.org/bokeh/release/bokeh-2.3.2.min.js\": \"XypntL49z55iwGVUW4qsEu83zKL3XEcz0MjuGOQ9SlaaQ68X/g+k1FcioZi7oQAc\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.2.min.js\": \"bEsM86IHGDTLCS0Zod8a8WM6Y4+lafAL/eSiyQcuPzinmWNgNO2/olUF0Z2Dkn5i\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\": \"TX0gSQTdXTTeScqxj6PVQxTiRW8DOoGVwinyi1D3kxv7wuxQ02XkOxv0xwiypcAH\"};\n\n for (let i = 0; i < js_urls.length; i++) {\n const url = js_urls[i];\n const element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error.bind(null, url);\n element.async = false;\n element.src = url;\n if (url in hashes) {\n element.crossOrigin = \"anonymous\";\n element.integrity = \"sha384-\" + hashes[url];\n }\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n \n var js_urls = [\"https://cdn.bokeh.org/bokeh/release/bokeh-2.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.3.2.min.js\", \"https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.3.2.min.js\"];\n var css_urls = [];\n \n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n function(Bokeh) {\n \n \n }\n ];\n\n function run_inline_js() {\n \n if (root.Bokeh !== undefined || force === true) {\n \n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }\n if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n var cell = $(document.getElementById(\"2517\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));", "application/vnd.bokehjs_load.v0+json": "" }, "metadata": {} }, { "output_type": "display_data", "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "application/vnd.bokehjs_exec.v0+json": "", "application/javascript": "(function(root) {\n function embed_document(root) {\n \n var docs_json = {\"9342d9cb-90c3-46be-879b-bc9b7200143b\":{\"defs\":[],\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"2530\"}],\"center\":[{\"id\":\"2532\"},{\"id\":\"2535\"}],\"height\":700,\"left\":[{\"id\":\"2533\"}],\"outline_line_color\":null,\"renderers\":[{\"id\":\"2553\"}],\"title\":{\"id\":\"2520\"},\"toolbar\":{\"id\":\"2542\"},\"toolbar_location\":\"above\",\"width\":900,\"x_range\":{\"id\":\"2522\"},\"x_scale\":{\"id\":\"2526\"},\"y_range\":{\"id\":\"2524\"},\"y_scale\":{\"id\":\"2528\"}},\"id\":\"2519\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"factors\":[\"10.0.3.5\",\"104.43.212.12\",\"13.107.4.50\",\"13.65.107.32\",\"13.67.143.117\",\"13.68.93.109\",\"13.71.172.128\",\"13.71.172.130\",\"13.83.148.218\",\"131.107.147.209\",\"157.55.134.136\",\"172.217.15.99\",\"172.217.8.14\",\"20.38.98.100\",\"205.185.216.42\",\"23.4.187.27\",\"23.48.36.78\",\"40.124.45.19\",\"40.77.226.250\",\"40.77.228.69\",\"40.77.232.95\",\"40.91.75.5\",\"52.165.170.112\",\"52.168.138.145\",\"52.239.152.10\",\"65.55.163.76\",\"65.55.44.108\",\"65.55.44.109\",\"72.21.81.200\",\"72.21.81.240\",\"72.21.91.29\",\"8.249.241.254\",\"90.130.70.73\",\"99.84.104.63\"]},\"id\":\"2522\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"2528\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"2560\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"2526\",\"type\":\"CategoricalScale\"},{\"attributes\":{\"data\":{\"DestinationIP\":[\"40.77.228.69\",\"52.168.138.145\",\"13.71.172.130\",\"40.91.75.5\",\"40.124.45.19\",\"13.71.172.128\",\"172.217.15.99\",\"20.38.98.100\",\"104.43.212.12\",\"13.71.172.128\",\"13.71.172.130\",\"40.124.45.19\",\"65.55.44.109\",\"65.55.44.109\",\"13.65.107.32\",\"40.124.45.19\",\"40.77.228.69\",\"52.165.170.112\",\"52.168.138.145\",\"72.21.81.200\",\"13.65.107.32\",\"40.124.45.19\",\"52.168.138.145\",\"65.55.44.109\",\"52.168.138.145\",\"40.124.45.19\",\"72.21.91.29\",\"72.21.81.200\",\"40.91.75.5\",\"13.71.172.130\",\"65.55.44.108\",\"65.55.44.109\",\"72.21.81.240\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"13.71.172.128\",\"40.77.232.95\",\"52.165.170.112\",\"65.55.44.109\",\"72.21.81.200\",\"72.21.91.29\",\"52.168.138.145\",\"13.67.143.117\",\"13.68.93.109\",\"13.71.172.128\",\"23.48.36.78\",\"52.165.170.112\",\"65.55.44.109\",\"20.38.98.100\",\"8.249.241.254\",\"40.77.228.69\",\"172.217.15.99\",\"13.67.143.117\",\"13.71.172.130\",\"40.124.45.19\",\"40.77.226.250\",\"52.239.152.10\",\"65.55.44.109\",\"90.130.70.73\",\"20.38.98.100\",\"65.55.44.109\",\"13.65.107.32\",\"13.67.143.117\",\"20.38.98.100\",\"13.67.143.117\",\"13.71.172.128\",\"13.71.172.130\",\"13.83.148.218\",\"20.38.98.100\",\"23.4.187.27\",\"40.124.45.19\",\"65.55.44.108\",\"72.21.81.200\",\"72.21.91.29\",\"99.84.104.63\",\"13.65.107.32\",\"40.124.45.19\",\"172.217.15.99\",\"8.249.241.254\",\"13.68.93.109\",\"40.77.228.69\",\"65.55.44.109\",\"52.168.138.145\",\"40.124.45.19\",\"157.55.134.136\"],\"SourceIP\":[\"10.0.3.5\",\"10.0.3.5\",\"104.43.212.12\",\"104.43.212.12\",\"13.107.4.50\",\"13.65.107.32\",\"13.65.107.32\",\"13.65.107.32\",\"13.67.143.117\",\"13.67.143.117\",\"13.67.143.117\",\"13.67.143.117\",\"13.67.143.117\",\"13.68.93.109\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.128\",\"13.71.172.130\",\"13.71.172.130\",\"13.71.172.130\",\"13.71.172.130\",\"13.83.148.218\",\"131.107.147.209\",\"157.55.134.136\",\"172.217.15.99\",\"172.217.8.14\",\"20.38.98.100\",\"20.38.98.100\",\"20.38.98.100\",\"20.38.98.100\",\"205.185.216.42\",\"23.4.187.27\",\"23.48.36.78\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.124.45.19\",\"40.77.226.250\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.228.69\",\"40.77.232.95\",\"40.77.232.95\",\"40.91.75.5\",\"52.165.170.112\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.168.138.145\",\"52.239.152.10\",\"52.239.152.10\",\"65.55.163.76\",\"65.55.44.108\",\"65.55.44.108\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"65.55.44.109\",\"72.21.81.200\",\"72.21.81.200\",\"72.21.81.240\",\"72.21.81.240\",\"72.21.91.29\",\"72.21.91.29\",\"72.21.91.29\",\"8.249.241.254\",\"90.130.70.73\",\"99.84.104.63\"],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85],\"plt_size\":{\"__ndarray__\":\"AAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAUQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAABRAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAeQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAABRAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAABRAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAAFEAAAAAAAAAEQAAAAAAAAARAAAAAAAAAFEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAAFEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAUQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAkQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAUQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQAAAAAAAAARAAAAAAAAABEAAAAAAAAAEQA==\",\"dtype\":\"float64\",\"order\":\"little\",\"shape\":[86]},\"row_count\":[1,1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,3,1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,2,1,1,2,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,4,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],\"size\":[1,1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,3,1,1,1,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,2,1,1,2,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,1,1,1,4,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]},\"selected\":{\"id\":\"2562\"},\"selection_policy\":{\"id\":\"2563\"}},\"id\":\"2518\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"axis_label\":\"SourceIP\",\"axis_line_color\":null,\"formatter\":{\"id\":\"2560\"},\"major_label_orientation\":1.5707963267948966,\"major_label_policy\":{\"id\":\"2559\"},\"major_label_standoff\":0,\"major_label_text_font_size\":\"11pt\",\"major_tick_line_color\":null,\"ticker\":{\"id\":\"2531\"}},\"id\":\"2530\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"2556\",\"type\":\"AllLabels\"},{\"attributes\":{},\"id\":\"2557\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{},\"id\":\"2531\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"axis\":{\"id\":\"2530\"},\"grid_line_alpha\":0.1,\"grid_line_color\":\"navy\",\"ticker\":null},\"id\":\"2532\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2534\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"active_multi\":null,\"tools\":[{\"id\":\"2536\"},{\"id\":\"2537\"},{\"id\":\"2538\"},{\"id\":\"2539\"},{\"id\":\"2540\"},{\"id\":\"2548\"}]},\"id\":\"2542\",\"type\":\"Toolbar\"},{\"attributes\":{\"axis_label\":\"DestinationIP\",\"axis_line_color\":null,\"formatter\":{\"id\":\"2557\"},\"major_label_policy\":{\"id\":\"2556\"},\"major_label_standoff\":0,\"major_label_text_font_size\":\"11pt\",\"major_tick_line_color\":null,\"ticker\":{\"id\":\"2534\"}},\"id\":\"2533\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"2563\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"2559\",\"type\":\"AllLabels\"},{\"attributes\":{\"axis\":{\"id\":\"2533\"},\"dimension\":1,\"grid_line_alpha\":0.1,\"grid_line_color\":\"navy\",\"ticker\":null},\"id\":\"2535\",\"type\":\"Grid\"},{\"attributes\":{},\"id\":\"2562\",\"type\":\"Selection\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"red\"},\"marker\":{\"value\":\"circle_cross\"},\"size\":{\"value\":5},\"x\":{\"field\":\"SourceIP\"},\"y\":{\"field\":\"DestinationIP\"}},\"id\":\"2552\",\"type\":\"Scatter\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":0.5,\"fill_color\":\"lightgrey\",\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":1.0,\"line_color\":\"black\",\"line_dash\":[4,4],\"line_width\":2,\"right_units\":\"screen\",\"syncable\":false,\"top_units\":\"screen\"},\"id\":\"2541\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.6},\"fill_color\":{\"value\":\"#1f77b4\"},\"line_color\":{\"value\":\"red\"},\"marker\":{\"value\":\"circle_cross\"},\"size\":{\"value\":5},\"x\":{\"field\":\"SourceIP\"},\"y\":{\"field\":\"DestinationIP\"}},\"id\":\"2551\",\"type\":\"Scatter\"},{\"attributes\":{\"callback\":null,\"tooltips\":[[\"SourceIP\",\"@SourceIP\"],[\"DestinationIP\",\"@DestinationIP\"],[\"value\",\"@size\"]]},\"id\":\"2548\",\"type\":\"HoverTool\"},{\"attributes\":{\"factors\":[\"99.84.104.63\",\"90.130.70.73\",\"8.249.241.254\",\"72.21.91.29\",\"72.21.81.240\",\"72.21.81.200\",\"65.55.44.109\",\"65.55.44.108\",\"52.239.152.10\",\"52.168.138.145\",\"52.165.170.112\",\"40.91.75.5\",\"40.77.232.95\",\"40.77.228.69\",\"40.77.226.250\",\"40.124.45.19\",\"23.48.36.78\",\"23.4.187.27\",\"20.38.98.100\",\"172.217.15.99\",\"157.55.134.136\",\"13.83.148.218\",\"13.71.172.130\",\"13.71.172.128\",\"13.68.93.109\",\"13.67.143.117\",\"13.65.107.32\",\"104.43.212.12\"]},\"id\":\"2524\",\"type\":\"FactorRange\"},{\"attributes\":{\"data_source\":{\"id\":\"2518\"},\"glyph\":{\"id\":\"2551\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"2552\"},\"view\":{\"id\":\"2554\"}},\"id\":\"2553\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"2536\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"text\":\"External IP flows (intersection)\",\"text_font_size\":\"15pt\"},\"id\":\"2520\",\"type\":\"Title\"},{\"attributes\":{\"source\":{\"id\":\"2518\"}},\"id\":\"2554\",\"type\":\"CDSView\"},{\"attributes\":{},\"id\":\"2540\",\"type\":\"SaveTool\"},{\"attributes\":{\"overlay\":{\"id\":\"2541\"}},\"id\":\"2537\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"2538\",\"type\":\"PanTool\"},{\"attributes\":{},\"id\":\"2539\",\"type\":\"ResetTool\"}],\"root_ids\":[\"2519\"]},\"title\":\"Bokeh Application\",\"version\":\"2.3.2\"}};\n var render_items = [{\"docid\":\"9342d9cb-90c3-46be-879b-bc9b7200143b\",\"root_ids\":[\"2519\"],\"roots\":{\"2519\":\"5161c325-188a-45cd-8049-b4a695981208\"}}];\n root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n\n }\n if (root.Bokeh !== undefined) {\n embed_document(root);\n } else {\n var attempts = 0;\n var timer = setInterval(function(root) {\n if (root.Bokeh !== undefined) {\n clearInterval(timer);\n embed_document(root);\n } else {\n attempts++;\n if (attempts > 100) {\n clearInterval(timer);\n console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n }\n }\n }, 10, root)\n }\n})(window);" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "2519" } } }, { "output_type": "execute_result", "data": { "text/plain": [ "Figure(id='2519', ...)" ], "text/html": [ "
Figure(
id = '2519', …)
above = [],
align = 'start',
aspect_ratio = None,
aspect_scale = 1,
background = None,
background_fill_alpha = 1.0,
background_fill_color = '#ffffff',
below = [CategoricalAxis(id='2530', ...)],
border_fill_alpha = 1.0,
border_fill_color = '#ffffff',
center = [Grid(id='2532', ...), Grid(id='2535', ...)],
css_classes = [],
disabled = False,
extra_x_ranges = {},
extra_y_ranges = {},
frame_height = None,
frame_width = None,
height = 700,
height_policy = 'auto',
hidpi = True,
inner_height = 0,
inner_width = 0,
js_event_callbacks = {},
js_property_callbacks = {},
left = [CategoricalAxis(id='2533', ...)],
lod_factor = 10,
lod_interval = 300,
lod_threshold = 2000,
lod_timeout = 500,
margin = (0, 0, 0, 0),
match_aspect = False,
max_height = None,
max_width = None,
min_border = 5,
min_border_bottom = None,
min_border_left = None,
min_border_right = None,
min_border_top = None,
min_height = None,
min_width = None,
name = None,
outer_height = 0,
outer_width = 0,
outline_line_alpha = 1.0,
outline_line_cap = 'butt',
outline_line_color = None,
outline_line_dash = [],
outline_line_dash_offset = 0,
outline_line_join = 'bevel',
outline_line_width = 1,
output_backend = 'canvas',
renderers = [GlyphRenderer(id='2553', ...)],
reset_policy = 'standard',
right = [],
sizing_mode = None,
subscribed_events = [],
syncable = True,
tags = [],
title = Title(id='2520', ...),
title_location = 'above',
toolbar = Toolbar(id='2542', ...),
toolbar_location = 'above',
toolbar_sticky = True,
visible = True,
width = 900,
width_policy = 'auto',
x_range = FactorRange(id='2522', ...),
x_scale = CategoricalScale(id='2526', ...),
y_range = FactorRange(id='2524', ...),
y_scale = CategoricalScale(id='2528', ...))
\n", "\n" ] }, "metadata": {}, "execution_count": 19 } ], "metadata": {} } ], "metadata": { "celltoolbar": "Tags", "hide_input": false, "interpreter": { "hash": "b736adfe05d9ae282eea4c01a733d58a0215ef3399d39339e6557e4c515b0f48" }, "kernelspec": { "name": "python3", "display_name": "Python 3.7.10 64-bit (conda)" }, "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.7.10" }, "toc": { "base_numbering": 1, "nav_menu": { "height": "318.996px", "width": "320.994px" }, "number_sections": false, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": true, "toc_position": { "height": "calc(100% - 180px)", "left": "10px", "top": "150px", "width": "165px" }, "toc_section_display": true, "toc_window_display": true }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "position": { "height": "406.193px", "left": "1468.4px", "right": "20px", "top": "120px", "width": "456.572px" }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": { "06408c1d26364c62bdef336cfec1716d": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "description_width": "" } }, "0dcf54e606e447f1a462e63dd4f23d2c": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "height": "150px", "width": "300px" } }, "1b1e59ba52c44f6b9ec3c405f1da5ed2": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "LabelModel", "state": { "layout": "IPY_MODEL_386a4307520e405aaee15c6cd1edfc06", "style": "IPY_MODEL_06408c1d26364c62bdef336cfec1716d" } }, "34e9742e64954d27b14150a4d980c6ad": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "width": "70%" } }, "386a4307520e405aaee15c6cd1edfc06": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "width": "99%" } }, "438313fbe5f14b908d6c010c2200ceef": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "height": "150px", "width": "300px" } }, "54a6e82f90754a82bfd1abab3ba5cf0d": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "width": "95%" } }, "70f8295184f44e84837be49dc197024c": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "width": "95%" } }, "74e4e00ea8984e1bbd94960547d47563": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "width": "99%" } }, "826ce822cc1d41bbb6255a4c6fba81d6": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "width": "70%" } }, "8cb49661379e4bc391d22ea6996368d9": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "width": "70%" } } }, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 4 }