Skip to content

Instantly share code, notes, and snippets.

@oddskool
Created February 5, 2014 13:56
Show Gist options
  • Save oddskool/8824062 to your computer and use it in GitHub Desktop.
Save oddskool/8824062 to your computer and use it in GitHub Desktop.
Julia tutorial
{
"metadata": {
"language": "Julia",
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"using Gadfly\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<script charset=\"utf-8\">\n",
"\n",
"// Minimum and maximum scale extents\n",
"var MIN_SCALE = 1.0/3.0;\n",
"var MAX_SCALE = 10.0;\n",
"\n",
"\n",
"// Traverse upwards from a d3 selection to find and return the first\n",
"// node with \"plotroot\" class.\n",
"var getplotroot = function(selection) {\n",
" var node = selection.node();\n",
" while (node && node.classList && !node.classList.contains(\"plotroot\")) {\n",
" node = node.parentNode;\n",
" }\n",
" return d3.select(node);\n",
"};\n",
"\n",
"\n",
"// Construct a callback for toggling geometries on/off using color groupings.\n",
"//\n",
"// Args:\n",
"// colorclass: class names assigned to geometries belonging to a paricular\n",
"// color group.\n",
"//\n",
"// Returns:\n",
"// A callback function.\n",
"//\n",
"var guide_toggle_color = function(colorclass) {\n",
" var visible = true;\n",
" return (function() {\n",
" var root = getplotroot(d3.select(this));\n",
" if (visible) {\n",
" d3.select(this)\n",
" .transition()\n",
" .duration(250)\n",
" .style(\"opacity\", 0.5);\n",
" root.selectAll(\".geometry.\" + colorclass)\n",
" .transition()\n",
" .duration(250)\n",
" .style(\"opacity\", 0);\n",
" visible = false;\n",
" } else {\n",
" d3.select(this)\n",
" .transition()\n",
" .duration(250)\n",
" .style(\"opacity\", 1.0);\n",
" root.selectAll(\".geometry.\" + colorclass)\n",
" .transition()\n",
" .duration(250)\n",
" .style(\"opacity\", 1.0);\n",
" visible = true;\n",
" }\n",
" });\n",
"};\n",
"\n",
"\n",
"// Construct a callback used to toggle highly-visibility grid lines.\n",
"//\n",
"// Args:\n",
"// color: Faded-in/faded-out color, respectively.\n",
"//\n",
"// Returns:\n",
"// Callback function.\n",
"//\n",
"var guide_background_mouseover = function(color) {\n",
" return (function () {\n",
" var root = getplotroot(d3.select(this));\n",
" root.selectAll(\".xgridlines, .ygridlines\")\n",
" .transition()\n",
" .duration(250)\n",
" .attr(\"stroke\", color);\n",
"\n",
" root.selectAll(\".zoomslider\")\n",
" .transition()\n",
" .duration(250)\n",
" .attr(\"opacity\", 1.0);\n",
" });\n",
"};\n",
"\n",
"var guide_background_mouseout = function(color) {\n",
" return (function () {\n",
" var root = getplotroot(d3.select(this));\n",
" root.selectAll(\".xgridlines, .ygridlines\")\n",
" .transition()\n",
" .duration(250)\n",
" .attr(\"stroke\", color);\n",
"\n",
" root.selectAll(\".zoomslider\")\n",
" .transition()\n",
" .duration(250)\n",
" .attr(\"opacity\", 0.0);\n",
" });\n",
"};\n",
"\n",
"\n",
"// Construct a call back used for mouseover effects in the point geometry.\n",
"//\n",
"// Args:\n",
"// scale: Scale for expanded width\n",
"// ratio: radius / line-width. This is necessary to maintain relative width\n",
"// at arbitraty levels of zoom\n",
"//\n",
"// Returns:\n",
"// Callback function.\n",
"//\n",
"var geom_point_mouseover = function(scale, ratio) {\n",
" return (function() {\n",
" var lw = this.getAttribute('r') * ratio * scale\n",
" d3.select(this)\n",
" .transition()\n",
" .duration(100)\n",
" .style(\"stroke-width\", lw + 'px', 'important');\n",
" });\n",
"};\n",
"\n",
"// Construct a call back used for mouseout effects in the point geometry.\n",
"//\n",
"// Args:\n",
"// scale: Scale for expanded width\n",
"// ratio: radius / line-width. This is necessary to maintain relative width\n",
"// at arbitraty levels of zoom\n",
"//\n",
"// Returns:\n",
"// Callback function.\n",
"//\n",
"var geom_point_mouseout = function(scale, ratio) {\n",
" return (function() {\n",
" var lw = this.getAttribute('r') * ratio\n",
" d3.select(this)\n",
" .transition()\n",
" .duration(100)\n",
" .style(\"stroke-width\", lw + 'px', 'important');\n",
" });\n",
"};\n",
"\n",
"// Translate and scale geometry while trying to maintain scale invariance for\n",
"// certain ellements.\n",
"//\n",
"// Args:\n",
"// root: d3 selection of the root plot group node.\n",
"// t: A transform of the form {\"scale\": scale}\n",
"// old_scale: The scaling factor applied prior to t.scale.\n",
"//\n",
"var set_geometry_transform = function(root, ctx, old_scale) {\n",
" var xscalable = root.node().classList.contains(\"xscalable\");\n",
" var yscalable = root.node().classList.contains(\"yscalable\");\n",
"\n",
" var xscale = 1.0;\n",
" var tx = 0.0;\n",
" if (xscalable) {\n",
" xscale = ctx.scale;\n",
" tx = ctx.tx;\n",
" }\n",
"\n",
" var yscale = 1.0;\n",
" var ty = 0.0;\n",
" if (yscalable) {\n",
" yscale = ctx.scale;\n",
" ty = ctx.ty;\n",
" }\n",
"\n",
" root.selectAll(\".geometry\")\n",
" .attr(\"transform\",\n",
" \"translate(\" + tx + \" \" + ty + \") \" +\n",
" \"scale(\" + xscale + \" \" + yscale + \")\");\n",
"\n",
" var unscale_factor = old_scale / ctx.scale;\n",
"\n",
" // unscale geometry widths, radiuses, etc.\n",
" var size_attribs = [\"r\"];\n",
" var size_styles = [\"font-size\", \"stroke-width\"];\n",
" root.select(\".plotpanel\")\n",
" .selectAll(\"g, .geometry\")\n",
" .each(function() {\n",
" sel = d3.select(this);\n",
" var i;\n",
" var key;\n",
" var val;\n",
" for (i in size_styles) {\n",
" key = size_styles[i];\n",
" val = sel.style(key);\n",
" if (val !== null) {\n",
" // For some reason d3 rounds things like font-sizes to the\n",
" // nearest integer, so we are setting styles directly instead.\n",
" val = parseFloat(val);\n",
" sel.node().style.setProperty(key, unscale_factor * val + \"px\", \"important\");\n",
" }\n",
" }\n",
"\n",
" for (i in size_attribs) {\n",
" key = size_attribs[i];\n",
" val = sel.attr(key);\n",
" if (val !== null) {\n",
" sel.attr(key, unscale_factor * val);\n",
" }\n",
" }\n",
" });\n",
"\n",
" // TODO:\n",
" // Is this going to work when we do things other than circles. Suppose we\n",
" // have plots where we have a path drawing some sort of symbol which we want\n",
" // to remain size-invariant. Should we be trying to place things using\n",
" // translate?\n",
"\n",
" // move axis labels and grid lines around\n",
" if (xscalable) {\n",
" root.selectAll(\".yfixed\")\n",
" .attr(\"transform\", function() {\n",
" return \"translate(\" + [ctx.tx, 0.0] + \") \" +\n",
" \"scale(\" + [ctx.scale, 1.0] + \")\";\n",
" });\n",
"\n",
" root.selectAll(\".xlabels\")\n",
" .attr(\"transform\", function() {\n",
" return \"translate(\" + [ctx.tx, 0.0] + \")\";\n",
" })\n",
" .selectAll(\"text\")\n",
" .each(function() {\n",
" d3.select(this).attr(\"x\",\n",
" ctx.scale / old_scale * d3.select(this).attr(\"x\"));\n",
" });\n",
" }\n",
"\n",
" if (yscalable) {\n",
" root.selectAll(\".xfixed\")\n",
" .attr(\"transform\", function() {\n",
" return \"translate(\" + [0.0, ctx.ty] + \") \" +\n",
" \"scale(\" + [1.0, ctx.scale] + \")\";\n",
" });\n",
"\n",
" root.selectAll(\".ylabels\")\n",
" .attr(\"transform\", function() {\n",
" return \"translate(\" + [0.0, ctx.ty] + \")\";\n",
" })\n",
" .selectAll(\"text\")\n",
" .each(function() {\n",
" d3.select(this).attr(\"y\",\n",
" ctx.scale / old_scale * d3.select(this).attr(\"y\"));\n",
" });\n",
" }\n",
"\n",
" var bbox = root.select(\".guide.background\")\n",
" .select(\"path\").node().getBBox();\n",
"\n",
" // hide/show ticks labels based on their position\n",
" root.selectAll(\".xlabels\")\n",
" .selectAll(\"text\")\n",
" .attr(\"visibility\", function() {\n",
" var x = parseInt(d3.select(this).attr(\"x\"), 10) + ctx.tx;\n",
" return bbox.x <= x && x <= bbox.x + bbox.width ? \"visible\" : \"hidden\";\n",
" });\n",
"\n",
" root.selectAll(\".ylabels\")\n",
" .selectAll(\"text\")\n",
" .attr(\"visibility\", function() {\n",
" var y = parseInt(d3.select(this).attr(\"y\"), 10) + ctx.ty;\n",
" return bbox.y <= y && y <= bbox.y + bbox.height ? \"visible\" : \"hidden\";\n",
" });\n",
"};\n",
"\n",
"\n",
"// Construct a callback used for zoombehavior.\n",
"//\n",
"// Args:\n",
"// t: A transform of the form {\"scale\": scale} to close arround.\n",
"//\n",
"// Returns:\n",
"// A zoom behavior.\n",
"//\n",
"var zoom_behavior = function(ctx) {\n",
" var zm = d3.behavior.zoom();\n",
" ctx.zoom_behavior = zm;\n",
"\n",
" zm.scaleExtent([MIN_SCALE, MAX_SCALE])\n",
" .on(\"zoom\", function(d, i) {\n",
" var root = getplotroot(d3.select(this));\n",
" old_scale = ctx.scale;\n",
" ctx.scale = d3.event.scale;\n",
" var bbox = root.select(\".guide.background\")\n",
" .select(\"path\").node().getBBox();\n",
"\n",
" var x_min = -bbox.width * ctx.scale - (ctx.scale * bbox.width - bbox.width);\n",
" var x_max = bbox.width * ctx.scale;\n",
" var y_min = -bbox.height * ctx.scale - (ctx.scale * bbox.height - bbox.height);\n",
" var y_max = bbox.height * ctx.scale;\n",
"\n",
" var x0 = bbox.x - ctx.scale * bbox.x;\n",
" var y0 = bbox.y - ctx.scale * bbox.y;\n",
"\n",
" var tx = Math.max(Math.min(d3.event.translate[0] - x0, x_max), x_min);\n",
" var ty = Math.max(Math.min(d3.event.translate[1] - y0, y_max), y_min);\n",
"\n",
" tx += x0;\n",
" ty += y0;\n",
"\n",
" ctx.tx = tx;\n",
" ctx.ty = ty;\n",
"\n",
" set_geometry_transform(\n",
" root,\n",
" {\"tx\": tx,\n",
" \"ty\": ty,\n",
" \"scale\": ctx.scale}, old_scale);\n",
" zm.translate([tx, ty]);\n",
"\n",
" update_zoomslider(root, ctx);\n",
" });\n",
"\n",
"\n",
" return (function (g) {\n",
" zm(g);\n",
" default_handler = g.on(\"wheel.zoom\");\n",
" function wheelhandler() {\n",
" if (d3.event.shiftKey) {\n",
" default_handler.call(this);\n",
" d3.event.stopPropagation();\n",
" }\n",
" }\n",
" g.on(\"wheel.zoom\", wheelhandler)\n",
" .on(\"mousewheel.zoom\", wheelhandler)\n",
" .on(\"DOMMouseScroll.zoom\", wheelhandler);\n",
" });\n",
"};\n",
"\n",
"\n",
"var slider_position_from_scale = function(scale) {\n",
" if (scale >= 1.0) {\n",
" return 0.5 + 0.5 * (Math.log(scale) / Math.log(MAX_SCALE));\n",
" }\n",
" else {\n",
" return 0.5 * (Math.log(scale) - Math.log(MIN_SCALE)) / (0 - Math.log(MIN_SCALE));\n",
" }\n",
"};\n",
"\n",
"\n",
"// Construct a call\n",
"var zoomslider_behavior = function(ctx, min_extent, max_extent) {\n",
" var drag = d3.behavior.drag();\n",
" ctx.zoomslider_behavior = drag;\n",
" ctx.min_zoomslider_extent = min_extent;\n",
" ctx.max_zoomslider_extent = max_extent;\n",
"\n",
" drag.on(\"drag\", function() {\n",
" var xmid = (min_extent + max_extent) / 2;\n",
" var new_scale;\n",
"\n",
" // current slider posisition\n",
" var xpos = slider_position_from_scale(ctx.scale) +\n",
" (d3.event.dx / (max_extent - min_extent));\n",
"\n",
" // new scale\n",
" if (xpos >= 0.5) {\n",
" new_scale = Math.exp(2.0 * (xpos - 0.5) * Math.log(MAX_SCALE));\n",
" }\n",
" else {\n",
" new_scale = Math.exp(2.0 * xpos * (0 - Math.log(MIN_SCALE)) +\n",
" Math.log(MIN_SCALE));\n",
" }\n",
" new_scale = Math.min(MAX_SCALE, Math.max(MIN_SCALE, new_scale));\n",
"\n",
" // update scale\n",
" var root = getplotroot(d3.select(this));\n",
" var new_trans = scale_centered_translation(root, ctx, new_scale);\n",
"\n",
" ctx.zoom_behavior.scale(new_scale);\n",
" ctx.zoom_behavior.translate(new_trans);\n",
" ctx.zoom_behavior.event(root);\n",
"\n",
" // Note: the zoom event will take care of repositioning the slider thumb\n",
" });\n",
"\n",
" drag.on(\"dragstart\", function() {\n",
" d3.event.sourceEvent.stopPropagation();\n",
" });\n",
"\n",
" return drag;\n",
"};\n",
"\n",
"\n",
"// Reposition the zoom slider thumb based on the current scale\n",
"var update_zoomslider = function(root, ctx) {\n",
" var xmid = (ctx.min_zoomslider_extent + ctx.max_zoomslider_extent) / 2;\n",
" var xpos = ctx.min_zoomslider_extent +\n",
" ((ctx.max_zoomslider_extent - ctx.min_zoomslider_extent) *\n",
" slider_position_from_scale(ctx.scale));\n",
" root.select(\".zoomslider_thumb\")\n",
" .attr(\"transform\", \"translate(\" + (xpos - xmid) + \" \" + 0 + \")\");\n",
"};\n",
"\n",
"\n",
"// Compute the translation needed to change the scale when keeping the plot\n",
"// centered.\n",
"scale_centered_translation = function(root, ctx, new_scale) {\n",
" var bbox = root.select(\".guide.background\")\n",
" .select(\"path\").node().getBBox();\n",
"\n",
" // how off from center the current view is\n",
" var xoff = ctx.zoom_behavior.translate()[0] -\n",
" (bbox.x * (1 - ctx.scale) + (bbox.width * (1 - ctx.scale)) / 2);\n",
" var yoff = ctx.zoom_behavior.translate()[1] -\n",
" (bbox.y * (1 - ctx.scale) + (bbox.height * (1 - ctx.scale)) / 2);\n",
"\n",
" // rescale offsets\n",
" xoff = xoff * new_scale / ctx.scale;\n",
" yoff = yoff * new_scale / ctx.scale;\n",
"\n",
" // adjust for the panel position being scaled\n",
" var x_edge_adjust = bbox.x * (1 - new_scale);\n",
" var y_edge_adjust = bbox.y * (1 - new_scale);\n",
"\n",
" return [xoff + x_edge_adjust + (bbox.width - bbox.width * new_scale) / 2,\n",
" yoff + y_edge_adjust + (bbox.height - bbox.height * new_scale) / 2];\n",
"};\n",
"\n",
"\n",
"// jump to a new scale with a nice transition\n",
"var zoom_step = function(root, ctx, new_scale) {\n",
" var bbox = root.select(\".guide.background\")\n",
" .select(\"path\").node().getBBox();\n",
" ctx.zoom_behavior.size([bbox.width, bbox.height]);\n",
" new_trans = scale_centered_translation(root, ctx, new_scale);\n",
"\n",
" root.transition()\n",
" .duration(250)\n",
" .tween(\"zoom\", function() {\n",
" var trans_interp = d3.interpolate(ctx.zoom_behavior.translate(), new_trans);\n",
" var scale_interp = d3.interpolate(ctx.zoom_behavior.scale(), new_scale);\n",
" return function (t) {\n",
" ctx.zoom_behavior.translate(trans_interp(t))\n",
" .scale(scale_interp(t));\n",
" ctx.zoom_behavior.event(root);\n",
" };\n",
" });\n",
"};\n",
"\n",
"\n",
"// Handlers for clicking the zoom in or zoom out buttons.\n",
"var zoomout_behavior = function(ctx) {\n",
" return (function() {\n",
" var new_scale = Math.max(MIN_SCALE, ctx.scale / 1.5);\n",
" var root = getplotroot(d3.select(this));\n",
" zoom_step(root, ctx, new_scale);\n",
" d3.event.stopPropagation();\n",
" });\n",
"};\n",
"\n",
"\n",
"var zoomin_behavior = function(ctx) {\n",
" return (function() {\n",
" var new_scale = Math.min(MAX_SCALE, ctx.scale * 1.5);\n",
" var root = getplotroot(d3.select(this));\n",
" zoom_step(root, ctx, new_scale);\n",
" d3.event.stopPropagation();\n",
" });\n",
"};\n",
"\n",
"\n",
"var zoomslider_track_behavior = function(ctx, min_extent, max_extent) {\n",
" return (function() {\n",
" var xpos = slider_position_from_scale(ctx.scale);\n",
" var bbox = this.getBBox();\n",
" var xclick = (d3.mouse(this)[0] - bbox.x) / bbox.width;\n",
" var root = getplotroot(d3.select(this));\n",
" var new_scale;\n",
" if (xclick < xpos) {\n",
" new_scale = Math.max(MIN_SCALE, ctx.scale / 1.5);\n",
" zoom_step(root, ctx, new_scale);\n",
" }\n",
" else {\n",
" new_scale = Math.min(MAX_SCALE, ctx.scale * 1.5);\n",
" zoom_step(root, ctx, new_scale);\n",
" }\n",
" d3.event.stopPropagation();\n",
" });\n",
"};\n",
"\n",
"\n",
"// Mouseover effects for zoom slider\n",
"var zoomslider_button_mouseover = function(destcolor) {\n",
" return (function() {\n",
" d3.select(this)\n",
" .selectAll(\".button_logo\")\n",
" .transition()\n",
" .duration(150)\n",
" .attr(\"fill\", destcolor);\n",
" });\n",
"};\n",
"\n",
"\n",
"var zoomslider_thumb_mouseover = function(destcolor) {\n",
" return (function() {\n",
" d3.select(this)\n",
" .transition()\n",
" .duration(150)\n",
" .attr(\"fill\", destcolor);\n",
" });\n",
"};\n",
"\n",
"//@ sourceURL=gadfly.js\n",
"</script>"
],
"metadata": {},
"output_type": "display_data"
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"Warning: could not import Base.foldl into NumericExtensions\n",
"Warning: could not import Base.foldr into NumericExtensions\n",
"Warning: could not import Base.sum! into NumericExtensions\n",
"Warning: could not import Base.maximum! into NumericExtensions\n",
"Warning: could not import Base.minimum! into NumericExtensions\n",
"Warning: could not import StatsBase.bandwidth into Stat\n",
"Warning: could not import StatsBase.kde into Stat\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"plot(x=[1:500], y=cumsum(randn(500)), Geom.line, Guide.XLabel(\"time\"), Guide.YLabel(\"random walk\"))\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div id=\"gadflyplot-hld7bOclB7Phjsyu2dwD\"></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\", \"120mm\")\n",
" .attr(\"height\", \"80mm\")\n",
" .attr(\"viewBox\", \"0 0 120 80\")\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(\"stroke\", \"none\")\n",
" .attr(\"fill\", \"#000000\")\n",
" .attr(\"stroke-width\", 0.3)\n",
" .attr(\"font-family\", \"Helvetic,Arial,sans\")\n",
" .style(\"font-size\", \"3.88px\");\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\", 22.82)\n",
" .attr(\"y\", -42.91)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"90\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", 105.27)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"-60\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", -33.03)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"80\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", 75.63)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"-30\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", -13.28)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"60\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", 36.12)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"10\");\n",
" })\n",
";\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", 65.76)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"-20\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", 55.88)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"-10\");\n",
" })\n",
";\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", 95.39)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"-50\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", 115.15)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"-70\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", -23.15)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"70\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", 26.24)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"20\");\n",
" })\n",
";\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", 46)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"0\");\n",
" })\n",
";\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", -3.4)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"50\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", 85.51)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"-40\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", 6.48)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"40\");\n",
" })\n",
";\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", 16.36)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"30\");\n",
" })\n",
";\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 22.82)\n",
" .attr(\"y\", -52.79)\n",
" .attr(\"text-anchor\", \"end\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .call(function(text) {\n",
" text.text(\"100\");\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\", 9.18)\n",
" .attr(\"y\", 31.18)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .style(\"dominant-baseline\", \"central\")\n",
" .attr(\"transform\", \"rotate(-90, 9.18, 31.18)\")\n",
" .call(function(text) {\n",
" text.text(\"random walk\");\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",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 9.19)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"-100\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 112.42)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"500\");\n",
" })\n",
";\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", -59.62)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"-500\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 60.81)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"200\");\n",
" })\n",
";\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 146.83)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"700\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 95.21)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"400\");\n",
" })\n",
";\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 78.01)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"300\");\n",
" })\n",
";\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", -42.42)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"-400\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 181.24)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"900\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 129.62)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"600\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 164.03)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"800\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 198.44)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"1000\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", -76.83)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"-600\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 215.65)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"1100\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 26.4)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"0\");\n",
" })\n",
";\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", -25.22)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"-300\");\n",
" })\n",
";\n",
" }(g.append(\"g\")));\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", 43.6)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"100\");\n",
" })\n",
";\n",
" (function (g) {\n",
" g.attr(\"visibility\", \"hidden\");\n",
" g.append(\"svg:text\")\n",
" .attr(\"x\", -8.01)\n",
" .attr(\"y\", 63.65)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"-200\");\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\", 69.41)\n",
" .attr(\"y\", 73)\n",
" .attr(\"text-anchor\", \"middle\")\n",
" .call(function(text) {\n",
" text.text(\"time\");\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\", \" M23.82,5 L 115 5 115 57.36 23.82 57.36 z\");g.attr(\"clip-path\", \"url(#\" + parent_id + \"_clippath0)\");\n",
" (function (g) {\n",
" g.attr(\"class\", \"guide background\")\n",
" .attr(\"stroke\", \"#F1F1F5\")\n",
" .attr(\"fill\", \"#FAFAFA\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,5 L 115 5 115 57.36 23.82 57.36 z\");\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"stroke\", \"#F0F0F3\")\n",
" .attr(\"stroke-width\", 0.2)\n",
" .attr(\"class\", \"guide ygridlines xfixed\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,105.27 L 115 105.27\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,75.63 L 115 75.63\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,36.12 L 115 36.12\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,55.88 L 115 55.88\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,115.15 L 115 115.15\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,26.24 L 115 26.24\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,-3.4 L 115 -3.4\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,6.48 L 115 6.48\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,-52.79 L 115 -52.79\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,16.36 L 115 16.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,85.51 L 115 85.51\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,46 L 115 46\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,-23.15 L 115 -23.15\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,95.39 L 115 95.39\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,65.76 L 115 65.76\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,-13.28 L 115 -13.28\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,-33.03 L 115 -33.03\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M23.82,-42.91 L 115 -42.91\");\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"stroke\", \"#F0F0F3\")\n",
" .attr(\"stroke-width\", 0.2)\n",
" .attr(\"class\", \"guide xgridlines yfixed\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M112.42,5 L 112.42 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M60.81,5 L 60.81 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M95.21,5 L 95.21 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M-42.42,5 L -42.42 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M129.62,5 L 129.62 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M198.44,5 L 198.44 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M215.65,5 L 215.65 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M-25.22,5 L -25.22 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M-8.01,5 L -8.01 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M43.6,5 L 43.6 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M26.4,5 L 26.4 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M-76.83,5 L -76.83 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M164.03,5 L 164.03 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M181.24,5 L 181.24 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M78.01,5 L 78.01 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M146.83,5 L 146.83 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M-59.62,5 L -59.62 57.36\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M9.19,5 L 9.19 57.36\");\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\", \" M23.82,5 L 115 5 115 57.36 23.82 57.36 z\");g.attr(\"clip-path\", \"url(#\" + parent_id + \"_clippath1)\");\n",
" (function (g) {\n",
" g.attr(\"class\", \"plotpanel\");\n",
" (function (g) {\n",
" g.attr(\"stroke\", \"#00BFFF\")\n",
" .attr(\"class\", \"geometry\")\n",
" .attr(\"fill\", \"none\")\n",
" .attr(\"stroke-width\", 0.3);\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M26.57,44.85 L 26.74 45.22 26.91 44.38 27.09 43.65 27.26 42.26 27.43 42.62 27.6 42.02 27.77 42.13 27.95 42.48 28.12 43.14 28.29 42.79 28.46 43.06 28.63 43.15 28.81 42.91 28.98 42.73 29.15 43.07 29.32 42.44 29.49 43 29.67 42.98 29.84 43.66 30.01 44.32 30.18 43.57 30.35 42.83 30.53 44.15 30.7 43.2 30.87 43.9 31.04 43.17 31.21 42.95 31.39 42.32 31.56 43.01 31.73 43.97 31.9 44.62 32.07 44.96 32.25 44.05 32.42 44.49 32.59 45.7 32.76 45.35 32.93 45.5 33.11 45.29 33.28 46.33 33.45 44.61 33.62 45.03 33.8 44.67 33.97 44.53 34.14 44.28 34.31 43.31 34.48 42.99 34.66 44.77 34.83 46.43 35 45.77 35.17 45.95 35.34 47.11 35.52 46.06 35.69 45.41 35.86 45.15 36.03 44.3 36.2 45.55 36.38 45.6 36.55 45.54 36.72 45.49 36.89 45.46 37.06 45 37.24 43.17 37.41 44.31 37.58 42.98 37.75 42.39 37.92 42.69 38.1 44.65 38.27 44.21 38.44 45.46 38.61 47.12 38.78 45.93 38.96 46.46 39.13 46.7 39.3 45.75 39.47 44.33 39.64 42.87 39.82 42.79 39.99 42.8 40.16 42.63 40.33 44.01 40.5 43.3 40.68 43.17 40.85 44.69 41.02 45.7 41.19 44.13 41.37 43.94 41.54 43.24 41.71 43.19 41.88 42.7 42.05 43.9 42.23 42.8 42.4 41.91 42.57 42.84 42.74 41.77 42.91 44 43.09 45.43 43.26 45.22 43.43 45.95 43.6 45.23 43.77 46.27 43.95 44.67 44.12 44.39 44.29 44.49 44.46 45.45 44.63 44.62 44.81 45.36 44.98 45.16 45.15 44.42 45.32 44.43 45.49 44.64 45.67 44.69 45.84 43.99 46.01 42.38 46.18 42.21 46.35 41.73 46.53 41.16 46.7 40.51 46.87 39.66 47.04 38.56 47.21 37.98 47.39 37.32 47.56 37.01 47.73 37.49 47.9 39.08 48.07 38.13 48.25 37.34 48.42 39.32 48.59 40.72 48.76 41.18 48.94 40.39 49.11 42.15 49.28 40.15 49.45 40.8 49.62 40.97 49.8 43.13 49.97 43.83 50.14 43.47 50.31 43.11 50.48 43.08 50.66 45.76 50.83 43.88 51 44.25 51.17 46.17 51.34 44.68 51.52 45.52 51.69 44.56 51.86 46.27 52.03 45.09 52.2 43.57 52.38 43.35 52.55 45.54 52.72 43.12 52.89 44.01 53.06 44.83 53.24 43.03 53.41 44.15 53.58 42.2 53.75 44.34 53.92 43.52 54.1 42.71 54.27 43.17 54.44 44.1 54.61 43.1 54.78 41.92 54.96 41.15 55.13 40.35 55.3 40.33 55.47 39.03 55.64 38.79 55.82 39.53 55.99 39.18 56.16 39.5 56.33 39.28 56.51 38.36 56.68 37.92 56.85 37.35 57.02 37.08 57.19 37.25 57.37 37.65 57.54 37.47 57.71 36.78 57.88 36.27 58.05 35.28 58.23 34.01 58.4 34.96 58.57 33.63 58.74 33.56 58.91 31.7 59.09 33.19 59.26 32.27 59.43 32.4 59.6 32.94 59.77 33.56 59.95 34.29 60.12 34.36 60.29 34.34 60.46 33.83 60.63 33.14 60.81 32.76 60.98 32.33 61.15 35.04 61.32 35.41 61.49 33.5 61.67 32.69 61.84 32.28 62.01 31.52 62.18 32.26 62.35 31.86 62.53 31.87 62.7 31.23 62.87 32.38 63.04 31.91 63.21 31.01 63.39 31.01 63.56 29.71 63.73 29.34 63.9 29.24 64.07 28.91 64.25 29.78 64.42 29.62 64.59 31.33 64.76 30.29 64.94 28.76 65.11 28.1 65.28 28.46 65.45 28.39 65.62 29.43 65.8 29.65 65.97 29.97 66.14 29.77 66.31 28.84 66.48 28.43 66.66 29.51 66.83 29.4 67 28.23 67.17 26.94 67.34 27.6 67.52 27.22 67.69 28.44 67.86 29.62 68.03 30.04 68.2 29.95 68.38 30.92 68.55 29.87 68.72 29.09 68.89 26.67 69.06 27.25 69.24 26.91 69.41 25.67 69.58 25.58 69.75 23.14 69.92 24.11 70.1 21.96 70.27 22.91 70.44 22.64 70.61 22.41 70.78 23.15 70.96 24.14 71.13 24.65 71.3 26.47 71.47 26.41 71.64 26.65 71.82 26.23 71.99 26.52 72.16 27.12 72.33 25.63 72.51 25.32 72.68 25.78 72.85 27.16 73.02 28.37 73.19 29.29 73.37 28.28 73.54 27.03 73.71 26.27 73.88 26.49 74.05 27.16 74.23 25.67 74.4 24.03 74.57 23.32 74.74 21.77 74.91 21.16 75.09 23.25 75.26 25.16 75.43 25.68 75.6 26.17 75.77 26.37 75.95 25.32 76.12 25.57 76.29 25.12 76.46 25.31 76.63 24.58 76.81 25.53 76.98 25.04 77.15 25.57 77.32 23.68 77.49 25.06 77.67 25.74 77.84 26.14 78.01 25.23 78.18 25.27 78.35 26.62 78.53 26.21 78.7 26.54 78.87 27.25 79.04 26.1 79.21 27.29 79.39 29.52 79.56 28.34 79.73 27.49 79.9 27.34 80.08 26.61 80.25 27.13 80.42 26.38 80.59 26.39 80.76 25.01 80.94 25.42 81.11 25.52 81.28 23.4 81.45 24.6 81.62 24.73 81.8 23.32 81.97 21.28 82.14 19.84 82.31 20.62 82.48 20.85 82.66 22.23 82.83 22.25 83 21.37 83.17 21.46 83.34 22.96 83.52 22.44 83.69 20.7 83.86 19.18 84.03 18.67 84.2 17.47 84.38 18.86 84.55 19.01 84.72 18.2 84.89 17.74 85.06 17.21 85.24 17.56 85.41 17.77 85.58 18.24 85.75 18.94 85.92 18.48 86.1 17.46 86.27 16.56 86.44 15.91 86.61 15.1 86.78 15.05 86.96 15.28 87.13 15.29 87.3 15.51 87.47 14.51 87.65 15.64 87.82 14.96 87.99 15 88.16 14.84 88.33 16.07 88.51 15.13 88.68 15.27 88.85 15.55 89.02 15.93 89.19 16.41 89.37 16.44 89.54 17.32 89.71 17.48 89.88 18.16 90.05 16.84 90.23 16.17 90.4 16.29 90.57 16.37 90.74 15.75 90.91 15.5 91.09 16.22 91.26 15.82 91.43 16.44 91.6 16.92 91.77 17.2 91.95 16.33 92.12 16.28 92.29 16.65 92.46 17.03 92.63 16.7 92.81 15.19 92.98 15.92 93.15 15.76 93.32 13.63 93.49 12.52 93.67 10.48 93.84 9.79 94.01 12.62 94.18 12.41 94.35 12.73 94.53 13.2 94.7 13.8 94.87 12.7 95.04 13.42 95.21 13.42 95.39 12.47 95.56 12.69 95.73 13.94 95.9 14.23 96.08 15.92 96.25 14.96 96.42 15.21 96.59 14.8 96.76 13.67 96.94 13.66 97.11 13.5 97.28 14.24 97.45 15.13 97.62 15.36 97.8 14.24 97.97 12.65 98.14 11.8 98.31 11.99 98.48 16.13 98.66 16.54 98.83 15.88 99 16.62 99.17 16.07 99.34 15.28 99.52 17.31 99.69 18.23 99.86 20.66 100.03 19.31 100.2 20.64 100.38 19.95 100.55 20.69 100.72 21.88 100.89 22.29 101.06 21.04 101.24 20.55 101.41 20.56 101.58 20.83 101.75 22.95 101.92 23.52 102.1 25.16 102.27 24.44 102.44 24.83 102.61 25.08 102.78 24.07 102.96 23.67 103.13 23.15 103.3 21.2 103.47 22.45 103.65 24.43 103.82 27.15 103.99 28.15 104.16 28.98 104.33 30.5 104.51 32.46 104.68 32.2 104.85 31.13 105.02 31.09 105.19 30.46 105.37 30.72 105.54 30.45 105.71 31.68 105.88 31.64 106.05 32.42 106.23 33.3 106.4 34.09 106.57 34.57 106.74 34.71 106.91 32.64 107.09 32.16 107.26 32.21 107.43 31.98 107.6 31.82 107.77 31.2 107.95 30.83 108.12 30.52 108.29 31.11 108.46 30.21 108.63 30.38 108.81 30.09 108.98 30.79 109.15 31.07 109.32 30.18 109.49 30.24 109.67 29.4 109.84 28.93 110.01 29.86 110.18 30.93 110.35 28.72 110.53 29.47 110.7 27.5 110.87 27.87 111.04 26.24 111.22 25.54 111.39 26.76 111.56 24.24 111.73 24.14 111.9 23.57 112.08 24.52 112.25 25.58 112.42 25.88\");\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\", \" M23.82,5 L 115 5 115 57.36 23.82 57.36 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\", \"M108,8 L 112 8 112 12 108 12 z\");\n",
" (function (g) {\n",
" g.attr(\"fill\", \"#6A6A6A\")\n",
" .attr(\"class\", \"button_logo\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M108.8,9.6 L 109.6 9.6 109.6 8.8 110.4 8.8 110.4 9.6 111.2 9.6 111.2 10.4 110.4 10.4 110.4 11.2 109.6 11.2 109.6 10.4 108.8 10.4 z\");\n",
" }(g.append(\"g\")));\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"fill\", \"#EAEAEA\")\n",
" .on(\"click\", zoomslider_track_behavior(ctx, 82, 99));\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M88.5,8 L 107.5 8 107.5 12 88.5 12 z\");\n",
" }(g.append(\"g\")));\n",
" (function (g) {\n",
" g.attr(\"fill\", \"#6A6A6A\")\n",
" .attr(\"class\", \"zoomslider_thumb\")\n",
" .call(zoomslider_behavior(ctx, 82, 99))\n",
".on(\"mouseover\", zoomslider_thumb_mouseover(\"#cd5c5c\"))\n",
".on(\"mouseout\", zoomslider_thumb_mouseover(\"#6a6a6a\"))\n",
";\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M97,8 L 99 8 99 12 97 12 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\", \"M84,8 L 88 8 88 12 84 12 z\");\n",
" (function (g) {\n",
" g.attr(\"fill\", \"#6A6A6A\")\n",
" .attr(\"class\", \"button_logo\");\n",
" g.append(\"svg:path\")\n",
" .attr(\"d\", \"M84.8,9.6 L 87.2 9.6 87.2 10.4 84.8 10.4 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",
"}(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",
"];\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-hld7bOclB7Phjsyu2dwD\");\n",
"//@ sourceURL=gadflyplot-hld7bOclB7Phjsyu2dwD.js\n",
"</script>\n"
],
"metadata": {},
"output_type": "display_data",
"text": [
"D3(120.0,80.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,26069,9223372036854775807,26070),0,[],[],0,3,Dict{Uint64,(Any,Int64)}(),true,false,nothing,true)"
]
},
{
"html": [],
"metadata": {},
"output_type": "pyout",
"prompt_number": 35,
"text": [
"Plot(...)"
]
}
],
"prompt_number": 35
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"N=1e8\n",
"nheads = @parallel (+) for i=1:N\n",
" int(randbool())\n",
"end\n",
"nheads /= N"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 59,
"text": [
"0.5000437"
]
}
],
"prompt_number": 59
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"r = remotecall(1, rand, 2, 2)\n",
"remotecall_fetch(1, getindex, r, 1, 1)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 63,
"text": [
"0.43394528682610245"
]
}
],
"prompt_number": 63
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"r = @spawn rand(2,2)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 64,
"text": [
"RemoteRef(1,1,49)"
]
}
],
"prompt_number": 64
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"s = @spawn 1+fetch(r)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 65,
"text": [
"RemoteRef(1,1,50)"
]
}
],
"prompt_number": 65
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"fetch(s)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 67,
"text": [
"2x2 Array{Float64,2}:\n",
" 1.39061 1.44075\n",
" 1.98796 1.5923 "
]
}
],
"prompt_number": 67
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"@everywhere id = myid()\n",
"remotecall_fetch(1, ()->id)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 76,
"text": [
"1"
]
}
],
"prompt_number": 76
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment