Created
January 21, 2014 20:47
-
-
Save randyzwitch/8548024 to your computer and use it in GitHub Desktop.
Documentation and examples for UAParser Julia package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"metadata": { | |
"language": "Julia", | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ | |
"cell_type": "heading", | |
"level": 1, | |
"metadata": {}, | |
"source": [ | |
"UAParser documentation & examples" | |
] | |
}, | |
{ | |
"cell_type": "heading", | |
"level": 2, | |
"metadata": {}, | |
"source": [ | |
"Basic Setup" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"Pkg.add(\"UAParser\")" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"using RDatasets, Gadfly, DataFrames, ODBC, UAParser\n", | |
"Gadfly.set_default_plot_size(16cm, 12cm);" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "heading", | |
"level": 2, | |
"metadata": {}, | |
"source": [ | |
"Load user-agent data into DataFrame" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"#My user-agent data is stored in a MySQL database, accessed using the ODBC package\n", | |
"mysqlcon = advancedconnect(\"Driver={MySQL};user=root;server=localhost;database=useragent;\")\n", | |
"\n", | |
"#Create a single column DataFrame called ua_df holding user-agent strings\n", | |
"ua_df = query(\"select * from ua;\", mysqlcon);" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "heading", | |
"level": 2, | |
"metadata": {}, | |
"source": [ | |
"UAParser examples" | |
] | |
}, | |
{ | |
"cell_type": "heading", | |
"level": 3, | |
"metadata": {}, | |
"source": [ | |
"Single string examples" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"#User-agent string for iPhone\n", | |
"user_agent_string = \"Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B179 Safari/7534.48.3\"\n", | |
"\n", | |
"#parsedevice\n", | |
"pd = parsedevice(user_agent_string)\n", | |
"println(pd)\n", | |
"\n", | |
"#parseos\n", | |
"po = parseos(user_agent_string)\n", | |
"println(po)\n", | |
"\n", | |
"#parseuseragent\n", | |
"pua = parseuseragent(user_agent_string)\n", | |
"println(pua)" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": [ | |
"DeviceResult(" | |
] | |
}, | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": [ | |
"\"iPhone\")\n", | |
"OSResult(\"iOS\",\"5\",\"1\",nothing,nothing)\n", | |
"UAResult(\"Mobile Safari\",\"5\",\"1\",nothing)\n" | |
] | |
} | |
], | |
"prompt_number": 95 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"#You can index into the individual fields for each custom type using . (dot) syntax\n", | |
"println(\"parsedevice family: \", pd.family)\n", | |
"\n", | |
"println(\"parseos major version: \", po.major)\n", | |
"\n", | |
"println(\"parseuseragent minor version: \", pua.minor)" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": [ | |
"parsedevice family: iPhone" | |
] | |
}, | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": [ | |
"\n", | |
"parseos major version: 5\n", | |
"parseuseragent minor version: 1\n" | |
] | |
} | |
], | |
"prompt_number": 100 | |
}, | |
{ | |
"cell_type": "heading", | |
"level": 3, | |
"metadata": {}, | |
"source": [ | |
"Array of user-agent strings" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"#UAParser functions are vectorized, so you can pass in an Array of user-agent strings as single argument\n", | |
"ua_array = [\"Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B179 Safari/7534.48.3\",\n", | |
" \"Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B179 Safari/7534.48.3\"]\n", | |
"\n", | |
"println(parsedevice(ua_array))\n", | |
"println(parseos(ua_array))\n", | |
"println(parseuseragent(ua_array))" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": [ | |
"DeviceResult(\"iPhone\")\n", | |
"DeviceResult(\"iPhone\")\n", | |
"\n" | |
] | |
}, | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": [ | |
"OSResult(\"iOS\",\"5\",\"1\",nothing,nothing)\n", | |
"OSResult(\"iOS\",\"5\",\"1\",nothing,nothing)\n", | |
"\n", | |
"UAResult(\"Mobile Safari\",\"5\",\"1\",nothing)\n", | |
"UAResult(\"Mobile Safari\",\"5\",\"1\",nothing)\n" | |
] | |
}, | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": [ | |
"\n" | |
] | |
} | |
], | |
"prompt_number": 1 | |
}, | |
{ | |
"cell_type": "heading", | |
"level": 3, | |
"metadata": {}, | |
"source": [ | |
"DataFrame methods" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"#DataFrame methods have been defined for each UAParser function\n", | |
"\n", | |
"#devicearray is an array of length 2 with type DeviceResult\n", | |
"devicearray = parsedevice(ua_array)\n", | |
"println(devicearray)\n", | |
"\n", | |
"#Create a DataFrame just by calling the DataFrame function\n", | |
"devicedf = DataFrame(devicearray)\n", | |
"println(devicedf)" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": [ | |
"DeviceResult(\"iPhone\")\n", | |
"DeviceResult(\"iPhone\")\n", | |
"\n" | |
] | |
}, | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": [ | |
"2x1 DataFrame" | |
] | |
}, | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": [ | |
"\n", | |
"|-------|--------|\n", | |
"| Row # | device |\n", | |
"| 1 | iPhone |\n", | |
"| 2 | iPhone |\n", | |
"\n" | |
] | |
} | |
], | |
"prompt_number": 4 | |
}, | |
{ | |
"cell_type": "heading", | |
"level": 1, | |
"metadata": {}, | |
"source": [ | |
"Performance" | |
] | |
}, | |
{ | |
"cell_type": "heading", | |
"level": 2, | |
"metadata": {}, | |
"source": [ | |
"Time ParseDevice function" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"#Timing function for parsedevice\n", | |
"#Test is comparing parsing user-agent strings in an array, results in an array, Julia vs. Python pandas\n", | |
"function time_parsedevice(rows::Int64)\n", | |
"\tprintln(@elapsed [parsedevice(x) for x in ua_df[1:rows, 1]])\n", | |
"end\n", | |
"\n", | |
"for value in [1, 100, 1000, 10_000, 100_000, 1_000_000, 10_000_000]\n", | |
"\ttime_parsedevice(value)\n", | |
"end\n", | |
"\n", | |
"#Equivalent Python code not shown" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"#Create arrays holding results\n", | |
"python_results = [0.000536918640137, 0.0219399929047, 0.173039913177, 1.56596684456, 15.4903931618, 156.235334873, 1589.47466683]\n", | |
"julia_results = [0.000301082, 0.027070686, 1.291835857, 13.172287281, 132.945497853, 1430.751020585, 24350.937362556]\n", | |
"num_parsed = [1, 10, 1000, 10000, 100000, 1000000, 10000000]\n", | |
"\n", | |
"#Format results into a stacked DataFrame to take advantage of auto-generated legend with stacked data\n", | |
"p = DataFrame(hcat([\"Python\" for x in 1:7], num_parsed, python_results))\n", | |
"j = DataFrame(hcat([\"Julia\" for x in 1:7], num_parsed, julia_results))\n", | |
"results = DataFrame(vcat(p,j))\n", | |
"names!(results, [\"language\", \"num_parsed\", \"time_seconds\"])" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 36 | |
}, | |
{ | |
"cell_type": "heading", | |
"level": 2, | |
"metadata": {}, | |
"source": [ | |
"Plot Results" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": [ | |
"#Set plot a little bigger due to legend\n", | |
"Gadfly.set_default_plot_size(24cm, 14cm)\n", | |
"\n", | |
"#Plot using DataFrame, custom Theme options\n", | |
"p = plot(results, x = \"num_parsed\", y = \"time_seconds\", color = \"language\", #Data\n", | |
" Geom.line, Geom.point, #Rendered output\n", | |
" Scale.y_log10, Scale.x_log10, #X and Y Scale as Log10\n", | |
" Guide.Title(\"Python vs. Julia - Timings of DeviceParser\"),\n", | |
" Guide.XLabel(\"Number of user-agent strings parsed\"),\n", | |
" Guide.YLabel(\"(log) Time\"),\n", | |
" Theme(#major_label_font = \"Garamond\", \n", | |
" #major_label_font_size = 20px,\n", | |
" #minor_label_font = \"Garamond\",\n", | |
" #minor_label_font_size = 20px,\n", | |
" panel_stroke = color(\"Dark Gray\"),\n", | |
" line_width = 3px,\n", | |
" grid_line_width = 0px))" | |
], | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"html": [ | |
"<div id=\"gadflyplot-fSoGl3q4KnSUDrlGn679\"></div>\n", | |
"<script>\n", | |
"(function (module) {\n", | |
"function draw_with_data(data, parent_id) {\n", | |
" var g = d3.select(parent_id)\n", | |
" .append(\"svg\")\n", | |
" .attr(\"width\", \"240mm\")\n", | |
" .attr(\"height\", \"140mm\")\n", | |
" .attr(\"viewBox\", \"0 0 240 140\")\n", | |
" .attr(\"stroke-width\", \"0.5\")\n", | |
" .attr(\"style\", \"stroke:black;fill:black\");\n", | |
" g.append(\"defs\");\n", | |
" var ctx = {\n", | |
" \"scale\": 1.0,\n", | |
" \"tx\": 0.0,\n", | |
" \"ty\": 0.0\n", | |
" };\n", | |
"(function (g) {\n", | |
" g.attr(\"class\", \"plotroot xscalable yscalable\");\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke\", \"none\")\n", | |
" .attr(\"fill\", \"#4C404B\")\n", | |
" .attr(\"font-family\", \"'PT Sans','Helvetica Neue','Helvetica',sans-serif\")\n", | |
" .style(\"font-size\", \"3.18px\")\n", | |
" .attr(\"class\", \"guide ylabels\");\n", | |
" (function (g) {\n", | |
" g.attr(\"visibility\", \"hidden\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 19.24)\n", | |
" .attr(\"y\", 270.05)\n", | |
" .attr(\"text-anchor\", \"end\")\n", | |
" .style(\"dominant-baseline\", \"central\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"-20\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 19.24)\n", | |
" .attr(\"y\", 15.93)\n", | |
" .attr(\"text-anchor\", \"end\")\n", | |
" .style(\"dominant-baseline\", \"central\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"5\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" (function (g) {\n", | |
" g.attr(\"visibility\", \"hidden\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 19.24)\n", | |
" .attr(\"y\", 168.4)\n", | |
" .attr(\"text-anchor\", \"end\")\n", | |
" .style(\"dominant-baseline\", \"central\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"-10\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"visibility\", \"hidden\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 19.24)\n", | |
" .attr(\"y\", 219.23)\n", | |
" .attr(\"text-anchor\", \"end\")\n", | |
" .style(\"dominant-baseline\", \"central\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"-15\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 19.24)\n", | |
" .attr(\"y\", 117.58)\n", | |
" .attr(\"text-anchor\", \"end\")\n", | |
" .style(\"dominant-baseline\", \"central\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"-5\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" (function (g) {\n", | |
" g.attr(\"visibility\", \"hidden\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 19.24)\n", | |
" .attr(\"y\", -34.89)\n", | |
" .attr(\"text-anchor\", \"end\")\n", | |
" .style(\"dominant-baseline\", \"central\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"10\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"visibility\", \"hidden\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 19.24)\n", | |
" .attr(\"y\", -85.72)\n", | |
" .attr(\"text-anchor\", \"end\")\n", | |
" .style(\"dominant-baseline\", \"central\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"15\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"visibility\", \"hidden\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 19.24)\n", | |
" .attr(\"y\", -136.54)\n", | |
" .attr(\"text-anchor\", \"end\")\n", | |
" .style(\"dominant-baseline\", \"central\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"20\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 19.24)\n", | |
" .attr(\"y\", 66.76)\n", | |
" .attr(\"text-anchor\", \"end\")\n", | |
" .style(\"dominant-baseline\", \"central\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"0\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke\", \"none\")\n", | |
" .attr(\"fill\", \"#362A35\")\n", | |
" .attr(\"font-family\", \"'PT Sans','Helvetica Neue','Helvetica',sans-serif\")\n", | |
" .style(\"font-size\", \"3.88px\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 7.94)\n", | |
" .attr(\"y\", 66.76)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .style(\"dominant-baseline\", \"central\")\n", | |
" .attr(\"transform\", \"rotate(-90, 7.94, 66.76)\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"(log) Time\");\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke\", \"none\")\n", | |
" .attr(\"fill\", \"#4C404B\")\n", | |
" .attr(\"font-family\", \"'PT Sans','Helvetica Neue','Helvetica',sans-serif\")\n", | |
" .style(\"font-size\", \"3.18px\")\n", | |
" .attr(\"class\", \"guide xlabels\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 71.96)\n", | |
" .attr(\"y\", 126.12)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"2\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" (function (g) {\n", | |
" g.attr(\"visibility\", \"hidden\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", -66.58)\n", | |
" .attr(\"y\", 126.12)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"-4\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"visibility\", \"hidden\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 441.38)\n", | |
" .attr(\"y\", 126.12)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"18\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"visibility\", \"hidden\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 256.67)\n", | |
" .attr(\"y\", 126.12)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"10\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"visibility\", \"hidden\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", -20.4)\n", | |
" .attr(\"y\", 126.12)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"-2\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"visibility\", \"hidden\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", -112.75)\n", | |
" .attr(\"y\", 126.12)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"-6\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"visibility\", \"hidden\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", -205.11)\n", | |
" .attr(\"y\", 126.12)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"-10\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"visibility\", \"hidden\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 349.02)\n", | |
" .attr(\"y\", 126.12)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"14\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 118.13)\n", | |
" .attr(\"y\", 126.12)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"4\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 210.49)\n", | |
" .attr(\"y\", 126.12)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"8\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 164.31)\n", | |
" .attr(\"y\", 126.12)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"6\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 25.78)\n", | |
" .attr(\"y\", 126.12)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"0\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" (function (g) {\n", | |
" g.attr(\"visibility\", \"hidden\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", -158.93)\n", | |
" .attr(\"y\", 126.12)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"-8\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"visibility\", \"hidden\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 302.84)\n", | |
" .attr(\"y\", 126.12)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"12\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"visibility\", \"hidden\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 395.2)\n", | |
" .attr(\"y\", 126.12)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.append(\"tspan\").text(\"10\")\n", | |
" .append(\"tspan\")\n", | |
" .attr(\"dy\", \"-1ex\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"16\");\n", | |
" })\n", | |
".append(\"tspan\").attr(\"font-style\", \"normal\") ;\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke\", \"none\")\n", | |
" .attr(\"fill\", \"#362A35\")\n", | |
" .attr(\"font-family\", \"'PT Sans','Helvetica Neue','Helvetica',sans-serif\")\n", | |
" .style(\"font-size\", \"3.88px\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 118.13)\n", | |
" .attr(\"y\", 133)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"Number of user-agent strings parsed\");\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke\", \"none\")\n", | |
" .attr(\"font-family\", \"'PT Sans','Helvetica Neue','Helvetica',sans-serif\")\n", | |
" .style(\"font-size\", \"3.88px\")\n", | |
" .attr(\"fill\", \"#362A35\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 227.51)\n", | |
" .attr(\"y\", 65.52)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"language\");\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"font-family\", \"'PT Sans','Helvetica Neue','Helvetica',sans-serif\")\n", | |
" .style(\"font-size\", \"3.18px\");\n", | |
" (function (g) {\n", | |
" g.attr(\"class\", \"guide color_Julia\")\n", | |
" .on(\"click\", guide_toggle_color(\"color_Julia\"));\n", | |
" (function (g) {\n", | |
" g.attr(\"fill\", \"#00BFFF\")\n", | |
" .attr(\"stroke\", \"#0096DD\")\n", | |
" .attr(\"stroke-width\", 0.3);\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M218.03,67.52 L 221.2 67.52 221.2 70.7 218.03 70.7 z\");\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke\", \"none\")\n", | |
" .attr(\"fill\", \"#4C404B\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 222.2)\n", | |
" .attr(\"y\", 69.11)\n", | |
" .style(\"dominant-baseline\", \"central\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"Julia\");\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"class\", \"guide color_Python\")\n", | |
" .on(\"click\", guide_toggle_color(\"color_Python\"));\n", | |
" (function (g) {\n", | |
" g.attr(\"fill\", \"#D4CA3A\")\n", | |
" .attr(\"stroke\", \"#A8A200\")\n", | |
" .attr(\"stroke-width\", 0.3);\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M218.03,71.7 L 221.2 71.7 221.2 74.87 218.03 74.87 z\");\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke\", \"none\")\n", | |
" .attr(\"fill\", \"#4C404B\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 222.2)\n", | |
" .attr(\"y\", 73.28)\n", | |
" .style(\"dominant-baseline\", \"central\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"Python\");\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" }(g.append(\"g\")));\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke\", \"none\")\n", | |
" .attr(\"fill\", \"#362A35\")\n", | |
" .attr(\"font-family\", \"'PT Sans','Helvetica Neue','Helvetica',sans-serif\")\n", | |
" .style(\"font-size\", \"3.88px\");\n", | |
" g.append(\"svg:text\")\n", | |
" .attr(\"x\", 118.13)\n", | |
" .attr(\"y\", 10.88)\n", | |
" .attr(\"text-anchor\", \"middle\")\n", | |
" .call(function(text) {\n", | |
" text.text(\"Python vs. Julia - Timings of DeviceParser\");\n", | |
" })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.on(\"mouseover\", guide_background_mouseover(\"#C6C6C9\"))\n", | |
" .on(\"mouseout\", guide_background_mouseout(\"#F0F0F3\"))\n", | |
" .call(zoom_behavior(ctx))\n", | |
";\n", | |
" (function (g) {\n", | |
" d3.select(\"defs\")\n", | |
" .append(\"svg:clipPath\")\n", | |
" .attr(\"id\", parent_id + \"_clippath0\")\n", | |
" .append(\"svg:path\")\n", | |
" .attr(\"d\", \" M20.24,12.88 L 216.03 12.88 216.03 120.63 20.24 120.63 z\");g.attr(\"clip-path\", \"url(#\" + parent_id + \"_clippath0)\");\n", | |
" (function (g) {\n", | |
" g.attr(\"class\", \"guide background\")\n", | |
" .attr(\"stroke\", \"#A9A9A9\")\n", | |
" .attr(\"fill\", \"#FAFAFA\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M20.24,12.88 L 216.03 12.88 216.03 120.63 20.24 120.63 z\");\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke\", \"#F0F0F3\")\n", | |
" .attr(\"stroke-width\", 0)\n", | |
" .attr(\"class\", \"guide ygridlines xfixed\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M20.24,15.93 L 216.03 15.93\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M20.24,219.23 L 216.03 219.23\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M20.24,-34.89 L 216.03 -34.89\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M20.24,-136.54 L 216.03 -136.54\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M20.24,66.76 L 216.03 66.76\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M20.24,-85.72 L 216.03 -85.72\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M20.24,117.58 L 216.03 117.58\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M20.24,168.4 L 216.03 168.4\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M20.24,270.05 L 216.03 270.05\");\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke\", \"#F0F0F3\")\n", | |
" .attr(\"stroke-width\", 0)\n", | |
" .attr(\"class\", \"guide xgridlines yfixed\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M-66.58,12.88 L -66.58 120.63\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M256.67,12.88 L 256.67 120.63\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M-112.75,12.88 L -112.75 120.63\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M349.02,12.88 L 349.02 120.63\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M210.49,12.88 L 210.49 120.63\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M25.78,12.88 L 25.78 120.63\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M302.84,12.88 L 302.84 120.63\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M395.2,12.88 L 395.2 120.63\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M-158.93,12.88 L -158.93 120.63\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M164.31,12.88 L 164.31 120.63\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M118.13,12.88 L 118.13 120.63\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M-205.11,12.88 L -205.11 120.63\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M-20.4,12.88 L -20.4 120.63\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M441.38,12.88 L 441.38 120.63\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M71.96,12.88 L 71.96 120.63\");\n", | |
" }(g.append(\"g\")));\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" d3.select(\"defs\")\n", | |
" .append(\"svg:clipPath\")\n", | |
" .attr(\"id\", parent_id + \"_clippath1\")\n", | |
" .append(\"svg:path\")\n", | |
" .attr(\"d\", \" M20.24,12.88 L 216.03 12.88 216.03 120.63 20.24 120.63 z\");g.attr(\"clip-path\", \"url(#\" + parent_id + \"_clippath1)\");\n", | |
" (function (g) {\n", | |
" g.attr(\"class\", \"plotpanel\");\n", | |
" (function (g) {\n", | |
" g.attr(\"fill\", \"none\")\n", | |
" .attr(\"stroke-width\", 0.79);\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke\", \"#00BFFF\")\n", | |
" .attr(\"class\", \"geometry color_Julia\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M25.78,102.55 L 48.87 82.69 95.04 65.62 118.13 55.37 141.22 45.17 164.31 34.68 187.4 22.17\");\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke\", \"#D4CA3A\")\n", | |
" .attr(\"class\", \"geometry color_Python\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M25.78,100 L 48.87 83.62 95.04 74.5 118.13 64.78 141.22 54.66 164.31 44.46 187.4 34.21\");\n", | |
" }(g.append(\"g\")));\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke-width\", 0.79);\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke-width\", 0.79);\n", | |
"g.selectAll(\"form0\")\n", | |
" .data(d3.zip(data[0],data[1],data[2],data[3],data[4]))\n", | |
" .enter()\n", | |
" .append(\"circle\")\n", | |
".attr(\"cx\", function(d) { return d[0]; })\n", | |
".attr(\"cy\", function(d) { return d[1]; })\n", | |
".attr(\"r\", 0.6)\n", | |
".attr(\"class\", function(d) { return d[2]; })\n", | |
".on(\"mouseout\", geom_point_mouseout(10.00, 1.32), false)\n", | |
".on(\"mouseover\", geom_point_mouseover(10.00, 1.32), false)\n", | |
".attr(\"stroke\", function(d) { return d[3]; })\n", | |
".attr(\"fill\", function(d, i) { return d[4]; })\n", | |
";\n", | |
" }(g.append(\"g\")));\n", | |
" }(g.append(\"g\")));\n", | |
" }(g.append(\"g\")));\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" d3.select(\"defs\")\n", | |
" .append(\"svg:clipPath\")\n", | |
" .attr(\"id\", parent_id + \"_clippath2\")\n", | |
" .append(\"svg:path\")\n", | |
" .attr(\"d\", \" M20.24,12.88 L 216.03 12.88 216.03 120.63 20.24 120.63 z\");g.attr(\"clip-path\", \"url(#\" + parent_id + \"_clippath2)\");\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke\", \"none\")\n", | |
" .attr(\"class\", \"guide zoomslider\")\n", | |
" .attr(\"opacity\", 0.00);\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke\", \"#6A6A6A\")\n", | |
" .attr(\"stroke-opacity\", 0.00)\n", | |
" .attr(\"stroke-width\", 0.3)\n", | |
" .attr(\"fill\", \"#EAEAEA\")\n", | |
" .on(\"click\", zoomin_behavior(ctx))\n", | |
".on(\"dblclick\", function() { d3.event.stopPropagation(); })\n", | |
".on(\"mouseover\", zoomslider_button_mouseover(\"#cd5c5c\"))\n", | |
".on(\"mouseout\", zoomslider_button_mouseover(\"#6a6a6a\"))\n", | |
";\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M209.03,15.88 L 213.03 15.88 213.03 19.88 209.03 19.88 z\");\n", | |
" (function (g) {\n", | |
" g.attr(\"fill\", \"#6A6A6A\")\n", | |
" .attr(\"class\", \"button_logo\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M209.83,17.48 L 210.63 17.48 210.63 16.68 211.43 16.68 211.43 17.48 212.23 17.48 212.23 18.28 211.43 18.28 211.43 19.08 210.63 19.08 210.63 18.28 209.83 18.28 z\");\n", | |
" }(g.append(\"g\")));\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"fill\", \"#EAEAEA\")\n", | |
" .on(\"click\", zoomslider_track_behavior(ctx, 183.03, 200.03));\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M189.53,15.88 L 208.53 15.88 208.53 19.88 189.53 19.88 z\");\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"fill\", \"#6A6A6A\")\n", | |
" .attr(\"class\", \"zoomslider_thumb\")\n", | |
" .call(zoomslider_behavior(ctx, 183.03, 200.03))\n", | |
".on(\"mouseover\", zoomslider_thumb_mouseover(\"#cd5c5c\"))\n", | |
".on(\"mouseout\", zoomslider_thumb_mouseover(\"#6a6a6a\"))\n", | |
";\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M198.03,15.88 L 200.03 15.88 200.03 19.88 198.03 19.88 z\");\n", | |
" }(g.append(\"g\")));\n", | |
" (function (g) {\n", | |
" g.attr(\"stroke\", \"#6A6A6A\")\n", | |
" .attr(\"stroke-opacity\", 0.00)\n", | |
" .attr(\"stroke-width\", 0.3)\n", | |
" .attr(\"fill\", \"#EAEAEA\")\n", | |
" .on(\"click\", zoomout_behavior(ctx))\n", | |
".on(\"dblclick\", function() { d3.event.stopPropagation(); })\n", | |
".on(\"mouseover\", zoomslider_button_mouseover(\"#cd5c5c\"))\n", | |
".on(\"mouseout\", zoomslider_button_mouseover(\"#6a6a6a\"))\n", | |
";\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M185.03,15.88 L 189.03 15.88 189.03 19.88 185.03 19.88 z\");\n", | |
" (function (g) {\n", | |
" g.attr(\"fill\", \"#6A6A6A\")\n", | |
" .attr(\"class\", \"button_logo\");\n", | |
" g.append(\"svg:path\")\n", | |
" .attr(\"d\", \"M185.83,17.48 L 188.23 17.48 188.23 18.28 185.83 18.28 z\");\n", | |
" }(g.append(\"g\")));\n", | |
" }(g.append(\"g\")));\n", | |
" }(g.append(\"g\")));\n", | |
" }(g.append(\"g\")));\n", | |
" }(g.append(\"g\")));\n", | |
"}(g.append(\"g\")));\n", | |
" d3.select(parent_id)\n", | |
" .selectAll(\"path\")\n", | |
" .each(function() {\n", | |
" var sw = parseFloat(window.getComputedStyle(this).getPropertyValue(\"stroke-width\"));\n", | |
" d3.select(this)\n", | |
" .attr(\"vector-effect\", \"non-scaling-stroke\")\n", | |
" .style(\"stroke-width\", sw + \"mm\");\n", | |
" });\n", | |
"}\n", | |
"\n", | |
"var data = [\n", | |
" [25.77782634999017,48.86658848536589,95.04411275611733,118.13287489149305,141.2216370268688,164.3103991622445,187.3991612976202,25.77782634999017,48.86658848536589,95.04411275611733,118.13287489149305,141.2216370268688,164.3103991622445,187.3991612976202],\n", | |
" [99.99545170943783,83.61631839515589,74.4992390246654,64.77504068859616,54.65803049905883,44.45525885798194,34.2142920019663,102.5491380450434,82.68863314654826,65.62458205869105,55.37365848209569,45.167881877396944,34.67872578969948,22.166114664658995],\n", | |
" [\"geometry color_Python\",\"geometry color_Python\",\"geometry color_Python\",\"geometry color_Python\",\"geometry color_Python\",\"geometry color_Python\",\"geometry color_Python\",\"geometry color_Julia\",\"geometry color_Julia\",\"geometry color_Julia\",\"geometry color_Julia\",\"geometry color_Julia\",\"geometry color_Julia\",\"geometry color_Julia\"],\n", | |
" [\"#A8A200\",\"#A8A200\",\"#A8A200\",\"#A8A200\",\"#A8A200\",\"#A8A200\",\"#A8A200\",\"#0096DD\",\"#0096DD\",\"#0096DD\",\"#0096DD\",\"#0096DD\",\"#0096DD\",\"#0096DD\"],\n", | |
" [\"#D4CA3A\",\"#D4CA3A\",\"#D4CA3A\",\"#D4CA3A\",\"#D4CA3A\",\"#D4CA3A\",\"#D4CA3A\",\"#00BFFF\",\"#00BFFF\",\"#00BFFF\",\"#00BFFF\",\"#00BFFF\",\"#00BFFF\",\"#00BFFF\"]];\n", | |
"\n", | |
"var draw = function(parent_id) {\n", | |
" draw_with_data(data, parent_id);\n", | |
"};\n", | |
"\n", | |
"if ('undefined' !== typeof module) {\n", | |
" module.exports = draw;\n", | |
"} else if ('undefined' !== typeof window) {\n", | |
" window.draw = draw\n", | |
"}\n", | |
"\n", | |
"return module;\n", | |
"})({}).exports(\"#gadflyplot-fSoGl3q4KnSUDrlGn679\");\n", | |
"//@ sourceURL=gadflyplot-fSoGl3q4KnSUDrlGn679.js\n", | |
"</script>\n" | |
], | |
"metadata": {}, | |
"output_type": "display_data", | |
"text": [ | |
"D3(240.0,140.0,IOBuffer([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x20,0x64 \u2026 0x20,0x3d,0x20,0x64,0x72,0x61,0x77,0x0a,0x7d,0x0a],true,true,true,false,24562,9223372036854775807,24563),0,[],[],1,3,[0xd23b7e6f971de02c=>([\"geometry color_Python\",\"geometry color_Python\",\"geometry color_Python\",\"geometry color_Python\",\"geometry color_Python\",\"geometry color_Python\",\"geometry color_Python\",\"geometry color_Julia\",\"geometry color_Julia\",\"geometry color_Julia\",\"geometry color_Julia\",\"geometry color_Julia\",\"geometry color_Julia\",\"geometry color_Julia\"],2),0xdc3c9fc3aafc60b0=>([99.99545170943783,83.61631839515589,74.4992390246654,64.77504068859616,54.65803049905883,44.45525885798194,34.2142920019663,102.5491380450434,82.68863314654826,65.62458205869105,55.37365848209569,45.167881877396944,34.67872578969948,22.166114664658995],1),0x36bb0d2ae01c8705=>({LCHab(65.0,70.0,100.43478260869566),LCHab(65.0,70.0,100.43478260869566),LCHab(65.0,70.0,100.43478260869566),LCHab(65.0,70.0,100.43478260869566),LCHab(65.0,70.0,100.43478260869566),LCHab(65.0,70.0,100.43478260869566),LCHab(65.0,70.0,100.43478260869566),LCHab(55.0,60.0,240.0),LCHab(55.0,60.0,240.0),LCHab(55.0,60.0,240.0),LCHab(55.0,60.0,240.0),LCHab(55.0,60.0,240.0),LCHab(55.0,60.0,240.0),LCHab(55.0,60.0,240.0)},3),0x0b75a5b1096e082a=>([25.77782634999017,48.86658848536589,95.04411275611733,118.13287489149305,141.2216370268688,164.3103991622445,187.3991612976202,25.77782634999017,48.86658848536589,95.04411275611733,118.13287489149305,141.2216370268688,164.3103991622445,187.3991612976202],0),0x19172052be2ccd39=>([LCHab(80.0,70.0,100.43478260869566),LCHab(80.0,70.0,100.43478260869566),LCHab(80.0,70.0,100.43478260869566),LCHab(80.0,70.0,100.43478260869566),LCHab(80.0,70.0,100.43478260869566),LCHab(80.0,70.0,100.43478260869566),LCHab(80.0,70.0,100.43478260869566),LCHab(70.0,60.0,240.0),LCHab(70.0,60.0,240.0),LCHab(70.0,60.0,240.0),LCHab(70.0,60.0,240.0),LCHab(70.0,60.0,240.0),LCHab(70.0,60.0,240.0),LCHab(70.0,60.0,240.0)],4)],true,false,nothing,true)" | |
] | |
}, | |
{ | |
"html": [], | |
"metadata": {}, | |
"output_type": "pyout", | |
"prompt_number": 83, | |
"text": [ | |
"Plot(...)" | |
] | |
} | |
], | |
"prompt_number": 83 | |
} | |
], | |
"metadata": {} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment