<?xml version="1.0" encoding="UTF-8"?>
<!--Xholon Workbook http://www.primordion.com/Xholon/wb/ (C) Ken Webb Wed Apr 11 2012 23:09:35 GMT-0400 (EDT)-->
<XholonWorkbook>
<Notes><![CDATA[
Xholon
------
Title: Thermohaline circulation and Raphael SVG paths
Description:
Url: http://en.wikipedia.org/wiki/Thermohaline_circulation
InternalName:
YoutubeId:
Keywords: Thermohaline circulation, Raphael, SVG, path
My Notes
--------
To run the simulation that's part of this workbook::
Click the Run button above.
Click the Pause button in the overlay, to unpause the action.
This workbook experiments with Raphael support for the SVG path element, using sample paths from the following Wikipedia SVG image::
http://upload.wikimedia.org/wikipedia/commons/a/a6/Conveyor_belt.svg
This sample is part of the thermohaline circulation in the Earth's oceans. In this case, it shows cold and warm (not-so-cold) currents that flow clockwise completely around the Antarctic continent.
Tools are available to help convert from SVG to Raphael::
http://readysetraphael.com/ (from local file)
http://toki-woki.net/p/SVG2RaphaelJS/ (from SVG text)
]]></Notes>
<script implName="lang:python:inline:"><![CDATA[
]]></script>
<script implName="lang:javascript:inline:"><![CDATA[
]]></script>
<_-.XholonClass>
<!-- domain objects -->
<PhysicalSystem/>
<Block/>
</_-.XholonClass>
<xholonClassDetails>
</xholonClassDetails>
<PhysicalSystem>
<Block/>
</PhysicalSystem>
<Blockbehavior implName="lang:python:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:javascript:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:webEditionjs:inline:"><![CDATA[
function postConfigure() {
this.xholoncreationservice('requireScript', 'raphael-min.js');
}
function act() {
if (this.application("getTimeStep") == 0) {
// use the existing SVG div, and remove any content it has
var mySVGDiv = $("div#mySVGDiv");
mySVGDiv.css("width", "345").css("height", "380");
mySVGDiv.empty();
var paper = Raphael(mySVGDiv[0], "100%", "100%");
// part of the map around Antarctica
paper.path("M165.325,313.073c-0.057-0.356-0.104-0.716-0.151-1.073c-0.514-0.011-1.061-0.054-1.67-0.162c-1.857-0.334-3.647-0.741-5.43-1.008c-1.003-0.234-0.814-0.739,0.422-1.508c2.146-0.31,4.271-0.435,6.37-0.427c-0.842-14.156,5.183-29.274,14.734-38.678c-3.076-1.686-5.3-4.265-6.691-7.76c-0.007-0.141,0.054-0.357,0.255-0.579c2.181,1.168,4.518,2.611,6.935,4.263c0,0,0.134-0.148,0.335-0.371c1.427,0.214,2.846,0.285,4.325,0.143c0.143-0.007,0.432,0.12,0.653,0.322c-0.003-0.751,0.113-1.271,0.327-1.595c0.066-0.908,0.186-1.828,0.302-2.76c-0.89-2.057-1.617-4.084-2.062-6.124c-0.155-0.275-0.236-0.484-0.533-0.753c-0.034-0.706-1.085-1.929-3.233-3.877c-1.63-1.478-2.844-3.117-3.572-4.993c1.946-3.635,4.808-7.386,8.663-11.044c0.269-0.296,0.47-0.519,0.672-0.74c1.211,0.152,2.401-0.118,3.423-0.946c0.343-0.229,0.544-0.452,0.745-0.674c2.249,1.094,4.435,0.916,6.625-0.607c0.067-0.074,0.216,0.061,0.438,0.262c-0.743,2.16,0.233,3.316,2.998,3.393c1.605-1.919,3.254-1.504,5.013,1.171c1.364-1.059,2.749-1.691,4.155-1.903c0.209-0.08,0.483-0.235,0.686-0.458c1.734-0.722,2.756-1.551,3.057-2.627l0.37,0.336c1.849-1.294,2.5-2.459,2.37-3.656c-0.014-0.282,0.047-0.498,0.248-0.72c1.023,0.657,2.065,0.253,3.126-1.215l0.371,0.336c0.757-1.879,2.073-3.925,3.961-5.858c0.269-0.296,0.47-0.519,0.671-0.74c0.03,0.028,0.062,0.056,0.093,0.084c-3.057-9.685-10.996-17.521-17.08-26.313c-3.42,3.206-7.221,6.071-11.342,8.644c-0.275,0.155-0.551,0.31-0.82,0.606c-3.996-0.653-8.013-1.731-12.052-3.232c-1.662-0.698-1.703-1.545-0.266-2.536c3.066-0.999,4.174-2.965,3.255-5.823l0.625-0.243c0.35-0.088,0.552-0.311,0.753-0.532c-0.576-3.087-2.039-5.493-4.173-7.158c-0.075-0.067-0.142,0.006-0.41,0.303c-2.61,0.199-4.391,1.419-5.202,3.653c-0.308,0.935-0.947,0.896-1.723-0.482c-4.543-1.689-5.893-4.667-3.833-8.874c0.195-0.363,0.322-0.653,0.523-0.875c0.234-1.003-0.641-1.526-2.558-1.645l0.336-0.371c2.888-3.185,4.148-6.362,3.862-9.321c-0.074-0.067-0.223-0.201-0.445-0.403c-0.414-0.312-0.659-0.666-0.758-1.048c-5.316-1.165-9.325-5.519-13.056-9.927c-0.006,0.202,0.012,0.406-0.003,0.607c-0.128,0.29-0.188,0.505-0.456,0.802c-2.114-1.242-4.362-2.335-6.396-3.369c-0.289-0.127-0.579-0.255-0.875-0.523c-0.124-2.542-2.011-4.928-5.667-7.297c-0.215-0.061-0.445-0.403-0.667-0.604c-3.692-4.562-7.303-8.917-10.982-13.197c-1.822,0.372-3.705,0.96-5.433,1.824c-0.275,0.154-0.551,0.31-0.82,0.605c-0.646-0.181-1.366-0.429-2.019-0.75c-0.29-0.127-0.579-0.255-0.875-0.523c-2.577-0.582-5.126-0.599-7.648-0.051c-0.35,0.089-0.558,0.169-0.827,0.466c-0.662-1.95-1.807-3.664-3.438-5.142c-1.326-1.068-1.241-2.205,0.198-3.195c-0.386-1.152-0.973-1.996-1.733-2.564c-1.953,1.454-4.041,2.728-6.459,3.412c-0.398-0.361-1.187-0.299-2.058-0.368c0.361,0.44,0.029,0.945-0.98,1.486c-3.941,0.476-7.792,2.788-11.695,6.943c-0.201,0.223-0.403,0.444-0.672,0.741c0.681,0.888,0.426,1.466-0.973,1.817l0.37,0.336c-1.968,1.725-4.004,3.523-6.04,5.322c-0.275,0.155-0.477,0.377-0.746,0.674c-2.223-2.016-4.281-2.127-6.317-0.328c-0.275,0.155-0.477,0.377-0.746,0.674c-2.019-0.751-3.58-0.816-4.467-0.135c-0.268,0.296-0.692,0.316-1.116,0.338c-2.267-0.031-2.218,0.957,0.071,2.898c-1.997,1.16-3.758,1.316-5.361,0.404c-0.215-0.061-0.49,0.095-0.961,0.613c-0.402,0.444-0.873,0.963-1.343,1.481c-4.937,0.383-8.438-1.71-10.442-6.497c-0.014-0.282-0.236-0.484-0.532-0.753c-0.055-1.13-1.28-1.565-3.601-1.239c-0.423,0.021-0.928-0.167-1.447-0.638c-0.444-0.403-0.963-0.873-1.481-1.343c-1.988,2.787-4.248,2.897-7.062,0.346l-0.707,0.034c-0.423,0.021-0.928-0.167-1.447-0.637c-1.383,2.12-2.235,3.507-2.692,4.309c-0.127,0.289-0.329,0.511-0.598,0.808c-0.132,1.635-0.83,3.298-1.951,4.98c-0.127,0.289-0.329,0.512-0.598,0.808c1.53,2.333,1.641,4.593,0.271,6.996c-0.127,0.289-0.329,0.511-0.597,0.808c-0.637,1.447-2.547,1.47-5.516,0.129c-0.29-0.127-0.579-0.255-0.875-0.523c-0.469-3.8-0.024-7.716,1.478-11.754c0.06-0.216-0.162-0.417-0.809-0.598c-0.074-0.066-0.282,0.014-0.551,0.311c-1.45,2.194-2.063,1.233-1.908-2.81c-0.001-0.045-0.016-0.099-0.037-0.155c-0.59,0.324-1.192,0.63-1.804,0.922c0.036,0.032,0.077,0.064,0.113,0.097c0.893,3.779,0.446,6.208-1.402,7.502l0.335-0.37c-2.498-1.86-3.728-0.95-3.743,3.086c0.007,0.142,0.162,0.417,0.384,0.618c-1.815,0.514-2.378,2.027-1.696,4.402c1.042,3.913,1.093,7.875-0.058,11.825c-0.114,0.571-0.227,1.144-0.482,1.723c-0.1,0.854,0.224,1.688,1.12,2.635c-1.814,2.001-2.766,4.242-2.85,6.865l-0.37-0.336c-1.73-0.623-2.176-2.513-1.474-5.52c0.415-1.649-0.104-2.119-1.697-1.404c-2.106-1.101-2.624-0.084-1.832,3.063c0.243,0.624,0.277,1.331,0.238,1.97c-0.179,2.133,0.065,4.245,0.526,6.417c0.583,3.229,0.08,4.527-1.737,3.554c0.344-4.547-1.064-5.823-4.008-3.768c0,0-0.141,0.007-0.437-0.262c-0.908,0.256-1.047,1.75-0.633,4.42c0.956,5.051,1.561,10.189,1.601,15.354c1.28,1.565,2.137,3.152,2.57,4.76c0.154,0.275,0.31,0.551,0.532,0.752c-0.378,3.842,0.515,7.621,2.759,11.547c0.998,1.579,2.009,3.441,3.102,5.512c0.775,1.378,2.465,2.64,5.063,3.646c0.269-0.297,0.47-0.519,0.672-0.741c0.519,0.471,0.896,0.947,1.064,1.506c0.148,0.135,0.014,0.282-0.255,0.579c3.075,4.946,6.195,9.396,9.503,13.34c0,0-0.067,0.073-0.336,0.37c1.778,1.612,3.415,3.23,4.85,5.072c0,0-0.067,0.074-0.336,0.37c1.771,1.472,3.387,2.666,5.124,3.431c0.215,0.061,0.511,0.329,0.733,0.53c-0.59,0.949-0.185,1.991,1.215,3.127l-0.335,0.37c1.481,1.344,2.896,2.761,4.035,4.333c0.074,0.067,0.007,0.142-0.262,0.438c0.021,0.424-0.032,0.78-0.301,1.077l-0.37-0.336c0.696,2.656,2.34,4.417,5.005,5.348c0.141-0.007,0.364,0.195,0.586,0.396c14.434,14.302,28.816,24.642,43.22,31.087c1.016,0.517,2.16,0.743,3.304,0.971c2.108,2.587,5.252,4.628,9.433,6.122c7.288,2.829,14.61,4.878,21.837,6.436c1.144,0.228,2.146,0.461,3.216,0.621c6.781,1.155,13.476,1.96,20.088,2.556c2.078-0.95,3.441-2.009,4.174-2.965c0.194-0.364,0.396-0.586,0.598-0.809C156.659,313.316,160.996,313.265,165.325,313.073z M19.815,151.866l0.181-0.646c0.128-0.29,0.255-0.579,0.457-0.801C22.828,151.224,22.641,151.729,19.815,151.866z M42.974,140.468l0.336-0.371C44.96,141.998,44.826,142.146,42.974,140.468z M75.034,146.048c-0.134,0.148-0.478,0.378-0.968,0.473c-2.657,0.696-3.397,0.025-2.229-2.156C75.192,143.491,76.283,144.075,75.034,146.048z M28.857,183.282c-0.08-0.209,0.047-0.498,0.249-0.721C28.994,184.62,28.866,184.91,28.857,183.282z M29.391,179.716c-0.081-0.209,0.046-0.498,0.248-0.72C29.528,181.054,29.4,181.344,29.391,179.716z M29.252,176.891c-0.08-0.208,0.047-0.498,0.249-0.72C29.389,178.229,29.261,178.519,29.252,176.891z M29.442,167.749c-0.014-0.283,0.114-0.572,0.315-0.794C29.646,169.013,29.518,169.303,29.442,167.749z M29.837,161.357c-0.013-0.282,0.114-0.571,0.315-0.794C30.186,165.589,30.125,165.805,29.837,161.357z M10.424,181.281c-0.081-0.208-0.021-0.424,0.181-0.646C11.026,183.447,10.965,183.662,10.424,181.281z M18.307,216.506c-1.659-3.529-3.319-7.059-5.045-10.514c0.568-2.86,0.006-5.664-1.894-8.332c-0.155-0.275-0.378-0.478-0.674-0.746c-0.141-4.312-0.132-8.488-0.199-12.733c-0.08-0.208,0.047-0.498,0.248-0.72c0.871,1.868,1.243,3.691,1.407,5.595c-0.061,0.216-0.188,0.505-0.389,0.727c2.292,3.428,3.454,6.911,3.767,10.436c-0.06,0.215-0.12,0.43-0.389,0.727c1.53,2.332,2.63,4.544,3.379,6.844c0.155,0.275,0.31,0.551,0.532,0.752c-0.59,0.949-0.684,1.945-0.279,2.987c0.148,0.135,0.014,0.282-0.254,0.579c2.669,3.904,4.558,7.776,5.814,11.75c0.08,0.209,0.236,0.484,0.458,0.686C22.238,223.039,20.055,220.385,18.307,216.506z M26.884,231.165l0.335-0.37C28.877,232.838,28.81,232.912,26.884,231.165z M51.549,265.002c2.465,2.64,2.331,2.788-0.336,0.37L51.549,265.002z M49.267,269.007l0.335-0.37C53.625,272.688,53.49,272.836,49.267,269.007z M59.569,276.998l0.336-0.37c3.41,0.258,6.912,2.351,10.71,6.201c0.155,0.275,0.444,0.402,0.808,0.598c2.545,1.361,3.817,2.785,3.9,4.48C70.027,285.264,64.822,281.626,59.569,276.998z M76.401,288.209l0.336-0.37C78.462,289.808,78.328,289.956,76.401,288.209z M162.874,268.613c-1.52,0.781-1.963,0.379-1.475-1.203C164.224,267.272,164.743,267.742,162.874,268.613z M189.264,229.232c0.47-0.519,0.94-1.037,1.343-1.481c1.315,2.271,0.644,3.013-2.015,2.223L189.264,229.232z M168.471,223.879c2.79-0.845,3.31-0.374,1.623,1.337c-0.544,0.451-1.176,0.553-2.038,0.312C167.121,225.22,167.235,224.648,168.471,223.879z M164.534,227.329c-1.606,0.432-1.634-0.133-0.23-1.83C167.72,225.898,167.755,226.604,164.534,227.329z M158.653,225.775c4.367,0.99,4.133,1.993-0.568,2.86l-0.304-0.41C157.101,227.339,157.417,226.545,158.653,225.775z M82.48,292.371c-1.716-0.341-2.463-1.153-2.109-2.587c2.416,0.165,3.378,1.038,2.963,2.687L82.48,292.371z M117.316,305.462c-0.216-0.06-0.505-0.188-0.802-0.456c-0.641-1.526-2.392-2.573-5.109-3.148c-5.942-1.338-11.884-2.675-17.906-4.221c-2.378-2.29-4.788-3.8-7.083-4.396c-1.655-0.556-1.764-1.329-0.326-2.32c3.723,2.296,7.291,4.315,10.913,5.979c0.289,0.127,0.511,0.329,0.733,0.53c0.989-0.049,1.904-0.164,2.744-0.347c0.277-0.155,0.484-0.236,0.753-0.532c6.798,2.923,13.508,5.498,20.13,7.723c0.357,0.053,0.579,0.254,0.801,0.456c1.855-1.152,3.786-0.752,5.72,1.136c0.296,0.269,0.519,0.47,0.741,0.672C124.878,306.648,121.11,306.338,117.316,305.462z M138.114,309.47c-0.29-0.126-0.579-0.254-0.875-0.523c-0.201,0.223-0.41,0.304-0.619,0.385c-3.552-0.251-6.015-1.404-7.323-3.535c2.45,0.871,4.812,1.393,7.146,1.35c0.216,0.06,0.504,0.188,0.727,0.389c0.202-0.222,0.471-0.519,0.672-0.74C141.834,310.279,141.809,311.201,138.114,309.47z M143.293,309.712l0.336-0.37C145.354,311.311,145.22,311.459,143.293,309.712z M152.371,311.463c-0.357-0.053-0.572-0.113-0.869-0.383c-0.201,0.223-0.477,0.378-0.618,0.385c-3.746,0.112-5.423-0.867-5.17-2.933c1.765,1.329,3.474,1.529,5.141,0.881c0.135-0.148,0.356,0.054,0.579,0.255c0.269-0.297,0.47-0.519,0.671-0.741c0.27-0.297,0.471-0.519,0.672-0.74C156.029,311,155.87,312.07,152.371,311.463z").attr("fill","#7DD0EE").attr("stroke","#7DD0EE");
// part of the map around Antarctica
paper.path("M212.324,159.879c4.262-10.265,3.709-21.877,7.649-32.037c-1.766-1.043-3.587-1.896-5.354-2.504c0.269-0.297,0.329-0.511,0.389-0.727c-0.43-4.439-0.792-8.952-1.08-13.398c-0.223-0.201-0.378-0.477-0.392-0.76c-0.514-1.814-1.592-3.604-3.451-5.424c0.27-0.296,0.471-0.519,0.457-0.801c0.996-4.226,0.93-8.47-0.407-12.652c-0.223-0.201-0.378-0.477-0.674-0.745c-1.981-2.877-4.204-4.893-6.734-5.972c0.269-0.297,0.544-0.451,0.819-0.606c0.834-0.324,0.758-1.878-0.355-4.372c-0.222-0.201-0.512-0.329-0.727-0.389c-3.068-0.487-5.377-1.366-7.215-2.762c-0.721-0.249-1.212-0.153-1.695,0.083c-2.937,2.196-5.963,2.557-8.864,1.142c-2.627,2.748-5.431,3.31-8.339,1.754c-4.369-2.477-8.697-4.105-13.057-4.954c-0.222-0.201-0.304-0.41-0.243-0.625c0.406-3.277-0.747-5.132-3.6-5.559c-0.222-0.201-0.377-0.477-0.532-0.753c-0.986-2.783-0.768-5.555,0.789-8.463c0.27-0.297,0.403-0.444,0.255-0.579c-1.154-3.342-1.131-5.749,0.071-7.225c-0.444-0.403-1.03-0.799-1.542-1.128c-0.653-0.322-1.15-0.368-1.493-0.14c-1.499,1.206-3.066,1-4.838-0.471c-1.22-1.781-2.68-2.701-4.375-2.617c-0.681-0.888-0.218-1.548,1.53-1.987c2.663-0.555,4.235-1.693,4.584-3.269c-0.433-1.607-1.94-2.028-4.321-1.487c-1.607,0.433-3.234,0.441-4.964-0.182c0.269-0.297,0.47-0.519,0.82-0.606c1.028-0.688,2.198-1.382,3.279-2.426c-0.072-0.066-0.122-0.149-0.179-0.229c-0.986,0.18-1.979,0.268-2.981,0.137c-1.301,0.705-2.666,1.661-4.068,2.854c-0.067,0.074-0.141,0.007-0.438-0.262c-0.521-1.957-2.197-2.937-5.029-2.939c-0.283,0.014-0.49,0.095-0.759,0.391c0.169,0.559,0.432,1.607,0.71,2.939c0.162,0.417-0.04,0.639-0.665,0.882c-0.833,0.323-1.674,0.507-2.663,0.555c-0.292-1.613-0.375-3.309-0.242-4.943l-0.625,0.242c-0.794,0.294-1.468,0.387-2.02,0.287c-7.66,10.355-22.024,11.426-33.003,17.945c-1.263,0.711-2.068,1.552-2.77,2.464c0.561,1.247,0.812,2.429,0.679,3.563c-2.003,1.019-4.161,1.761-6.273,2.006c-0.841,0.184-2.542,0.125-4.958-0.04l-0.336,0.37c-0.736-2.017-2.331-2.788-4.711-2.247c-0.498-0.047-0.773,0.108-1.042,0.405c-0.201,0.222-0.335,0.37-0.335,0.37c-2.818,0.279-5.608,1.124-8.372,2.534c-0.202,0.222-0.403,0.443-0.598,0.808c-2.472,3.023-3.884,3.093-4.312,0.141c-0.23-0.441-0.374-0.886-0.432-1.333c-0.286,0.173-0.571,0.344-0.854,0.511c0.074,1.235-0.39,2.496-1.401,3.785c-0.201,0.223-0.402,0.444-0.671,0.741c0.245,2.112,0.349,4.23,0.311,6.356l0.371,0.335l-0.336,0.371c1.892,1.04,3.828,0.096,5.586-3.034c0.269-0.297,0.396-0.586,0.598-0.809c1.681-0.365,3.302-0.516,4.997-0.599c0.142-0.007,0.431,0.121,0.653,0.322c3.527-3.146,4.866-3.283,4.022-0.269c0.014,0.283-0.188,0.505-0.457,0.802c2.126,0.037,3.015,0.843,2.593,2.351l-0.37-0.336c-2.876,1.982-5.88,4.253-8.796,6.873c-0.275,0.155-0.477,0.377-0.746,0.674c0.496-1.44,0.709-2.866,0.99-4.367c0.26-1.924-0.608-2.307-2.679-1.214c-3.914,1.042-4.671,2.919-2.273,5.634c0.674,0.745,0.507,1.674-0.508,2.645c-0.201,0.222-0.254,0.578-0.301,1.076c1.378-0.775,2.696-1.335,3.833-1.249l-0.336,0.37c-2.513,2.176-4.125,3.954-4.776,5.118c-0.127,0.29-0.329,0.512-0.598,0.809c-1.288,2.611-1.795,5.256-1.389,7.785c0.014,0.282,0.169,0.558,0.391,0.759c3.584-0.529,7.234-2.619,10.957-6.129c0.067-0.074,0.208-0.081,0.342-0.229c1.862-1.012,2.441-0.757,1.878,0.758c2.635-1.12,2.566-2.532-0.208-4.237l0.382-0.869c0.194-0.362,0.315-0.794,0.22-1.284c-2.753-1.281-4.161-2.558-4.088-3.978c-0.014-0.282,0.114-0.571,0.315-0.794c2.941-3.542,5.987-4.966,9.129-4.412c0.215,0.062,0.35-0.087,0.551-0.31c-0.474-2.454,0.809-3.721,4.051-4.021c0.989-0.048,1.924,0.261,2.874,0.851c1.841-1.435,3.71-2.306,5.6-2.752c0.216,0.061,0.431,0.121,0.653,0.322c1.616,1.195,1.248,2.347-0.964,3.445c-0.135,0.148-0.41,0.304-0.537,0.593c-2.666,3.387-2.852,5.379-0.84,5.988c2.399-1.604,2.844-1.201,1.408,1.275c-0.127,0.29-0.329,0.512-0.598,0.809c-0.672,0.74-1.518,2.269-2.692,4.309c-0.127,0.289-0.329,0.512-0.598,0.808c-0.063,3.048-0.268,6.102-0.539,9.23c-0.061,0.215-0.12,0.43-0.389,0.727c2.839,0.145,3.399,1.462,1.754,4.021c-0.134,0.148-0.201,0.222-0.269,0.296c-1.744,3.413-0.792,5.49,2.564,6.104c2.378,2.29,1.699,2.891-1.693,1.569c-0.936-0.308-1.762,0.157-2.406,1.464c-2.299,0.749-3.279,2.426-2.939,5.028c0.013,0.283,0.169,0.559,0.391,0.76c-1.58,0.997-2.742,1.833-3.354,2.358c-0.275,0.155-0.477,0.377-0.746,0.674c0.648,1.667,0.657,3.296-0.034,5.099c-0.06,0.216,0.088,0.351,0.31,0.552c0.696,2.656,2.676,4.046,5.872,4.243c0.215,0.06,0.505,0.188,0.727,0.39c2.682-1.618,3.613-4.283,2.942-7.861c-0.155-0.275-0.236-0.483-0.532-0.753c2.365-2.31,4.221-1.977,5.719,1.137l0.671-0.741c0.47-0.519,0.941-1.037,1.343-1.481c1.906-1.41,3.283-0.935,4.142,1.265c2.444-1.165,4.648-2.992,6.932-4.911c0.126-0.704,0.08-1.75-0.151-3.189c-0.19-0.981,0.542-1.938,2.047-3.003c2.296,2.083,3.035,1.268,2.438-2.243c-0.014-0.282,0.047-0.498,0.248-0.72c2.131-1.309,4.201-2.4,6.413-3.5c2.218-0.958,4.471-1.21,6.833-0.688c2.747-3.179,5.457-4.231,8.344-3.099c0.289,0.127,0.511,0.329,0.733,0.53c0.852,2.932,1.847,3.024,3.196,0.197l0.37,0.336c1.364-1.058,2.756-1.551,4.182-1.337c0.216,0.06,0.505,0.188,0.727,0.389c0.947-0.896,1.834-1.577,2.743-1.833c0.208-0.081,0.483-0.236,0.686-0.458c2.926,0.494,5.759,0.496,8.562-0.065c0.216,0.06,0.431,0.12,0.653,0.321c-0.158,2.557-0.383,5.188-0.609,7.817c-0.06,0.216-0.12,0.431-0.389,0.728c2.479,2.923,3.189,5.861,2.354,9.017c0.014,0.283-0.188,0.505-0.457,0.802c-2.851,1.061-3.453,3.214-1.599,6.379c0.08,0.209,0.31,0.552,0.532,0.753c-0.737,2.302-1.05,4.582-0.717,7.044c0.013,0.282,0.169,0.558,0.391,0.76c-2.709,1.053-2.883,1.84-0.663,2.368c0.283-0.014,0.579,0.255,0.802,0.456c-1.357,1.199-2.075,2.438-2.161,3.575c-0.128,0.29-0.188,0.505-0.457,0.801c0.083,1.695,0.213,2.893,0.389,3.593c0.468,2.312,1.666,3.67,3.523,4.004c1.137,2.138,1.598,4.247,1.546,6.325c3.73,4.408,7.739,8.762,13.056,9.927c-0.11-0.433-0.028-0.902,0.284-1.406c1.387,0.477,2.438,1.045,3.164,1.707c0.004,0,0.008,0,0.013,0c-0.005,0-0.009,0-0.013,0c1.54,1.402,1.613,3.232,0.236,5.56c-0.061,0.216-0.262,0.438-0.531,0.734c-0.201,0.222-0.254,0.578-0.301,1.076c1.287,1.708,3.709,2.014,7.05,0.858c0.351-0.088,0.552-0.31,0.753-0.532c2.937-2.196,3.405-4.202,1.472-6.09l0.336-0.37c2.654-2.184,4.468-4.183,5.448-5.859c0.269-0.297,0.396-0.586,0.598-0.809c2.839,0.145,5.771,0.779,8.875,1.974c0.074,0.066,0.208-0.082,0.41-0.304c0.891,2.292,2.426,3.279,4.463,2.967c0.216,0.061,0.432,0.121,0.653,0.322c0.119,0.235,0.285,0.488,0.479,0.749C208.806,163.891,211.12,162.129,212.324,159.879z M67.597,78.024c-0.08-0.209,0.047-0.498,0.249-0.721C67.734,79.362,67.606,79.652,67.597,78.024z M99.175,75.204c-0.416,0.161-0.826,0.465-1.304,0.843c-1.976,1.583-2.823,1.624-2.475,0.05c0.415-1.649,1.08-2.53,2.008-2.364l0.181-0.646c0.128-0.29,0.255-0.579,0.457-0.801C100.936,73.56,101.267,74.535,99.175,75.204z M102.734,110.285c-2.687,2.964-5.173,4.218-7.596,3.912l0.672-0.741c0.269-0.296,0.47-0.519,0.671-0.74c2.346-1.248,4.564-2.206,6.588-2.801L102.734,110.285z M104.429,110.202c-1.223,1.052-1.042,0.405,0.765-1.736c0.127-0.289,0.322-0.653,0.368-1.15c0.107-0.713,0.355-1.434,0.461-2.146C108.466,105.898,107.91,107.555,104.429,110.202z M110.615,103.528c-0.081-0.209,0.047-0.498,0.248-0.721C110.752,104.866,110.624,105.156,110.615,103.528z").attr("fill","#7DD0EE").attr("stroke","#7DD0EE");
// part of the map around Antarctica
paper.path("M231.441,224.549c0.357,0.053,0.579,0.255,0.801,0.456c0.095,0.588,0.652,1.712,1.709,3.298c6.072,1.923,13.306,2.171,19.486-0.245c0.875-0.957,1.81-1.918,2.813-2.883c0.343-0.229,0.544-0.452,0.745-0.674c0.71,0.244,1.073,0.59,1.106,1.041c0.679-0.527,1.356-1.052,2.034-1.574c0.023-0.346,0.041-0.693,0.039-1.038c-0.08-0.209,0.047-0.498,0.248-0.721c2.649-0.838,4.269-2.475,4.917-5.125c0.128-0.29,0.255-0.579,0.457-0.802c2.851-1.06,5.854-3.33,8.944-6.738c3.298-3.489,5.307-5.853,5.957-7.018c1.039-1.892,1.315-2.046,0.686-0.458c0.011,3.114-1.882,6.393-5.462,9.896c-0.276,0.155-0.478,0.377-0.746,0.674c-0.426,0.519-0.857,1.016-1.284,1.524c2.063-1.282,4.157-2.474,6.299-3.544c2.092-3.179,4.346-4.139,6.71-2.873c0,0,0.208-0.081,0.41-0.304c3.004-2.271,5.892-5.456,8.806-9.563c0.194-0.364,0.396-0.586,0.598-0.808c-1.892-1.04-2.204-3.078-1.092-6.389c0.322-0.653,0.57-1.374,0.677-2.087c3.335-1.296,4.771-3.773,4.315-7.291c-0.014-0.282,0.047-0.498,0.248-0.72c1.304-0.843,2.277-2.66,2.905-5.735c0.373-2.495,1.177-4.871,2.122-7.254c-0.008-1.628-0.278-2.818-0.879-3.497c-0.222-0.201-0.444-0.402-0.741-0.672c-0.057-2.616-0.114-5.232-0.03-7.856c-0.006-0.142-0.088-0.35-0.384-0.618c-2.255-1.235-3.638-3.433-3.878-6.89c-0.068-1.413-0.997-1.579-2.859-0.568c-0.254-3.739-1.386-5.171-3.402-4.435l0.37,0.336c-1.482,2.976-2.879,4.813-4.122,5.44c-0.143,0.007-0.283,0.014-0.58-0.255c-0.458-0.686-0.856-1.586-1.268-2.77c-0.508-1.674-0.865-3.214-1.231-4.896c0.873-0.963,1.391-1.979,1.563-2.767c0.055-0.356,0.113-0.572,0.383-0.869c-0.585-4.714-0.746-9.449-0.134-14.294c0.232-2.489,0.391-5.045,0.622-7.534c0.166-2.416,0.256-4.897,0.213-7.231c-2.302-0.737-3.878-2.571-4.723-5.361c-0.088-0.35-0.236-0.484-0.532-0.753c0.581-2.577,0.033-5.099-1.563-7.357c-1.834-2.742-2.953-5.377-3.436-7.974c-3.865-3.774-6.971-6.454-9.232-7.83c-0.215-0.061-0.512-0.33-0.667-0.604c-3.065-3.319-5.644-5.388-7.812-6.273c2.804,3.758,5.074,6.761,6.873,8.797c0.229,0.343,0.452,0.544,0.674,0.745c0.15,1.621-0.621,3.217-2.18,4.639c-0.067,0.073-0.142,0.007-0.438-0.263c-2.575,0.905-5.125,0.888-7.925,0.105c-0.073-0.067-0.281,0.013-0.551,0.31c-3.13-1.758-6.186-3.449-9.229-4.857c-0.869-0.382-1.677-0.98-2.417-1.651c-0.788-0.174-0.605,0.667,0.622,2.589c0.991,1.438,1.914,2.951,2.549,4.335c3.915,0.445,7.141,2.695,9.891,6.809c0.007,0.141-0.061,0.214-0.329,0.511c-0.603,2.153-2.027,3.427-3.924,3.732c-0.141,0.007-0.06,0.215,0.103,0.632c0.397,0.9-0.362,1.292-2.293,0.891c0.027,0.565-0.032,0.78-0.302,1.077l-0.37-0.336c-0.269,0.297-0.336,0.37-0.409,0.304c-1.893-1.041-3.594-1.1-5.241-0.027c-0.269,0.297-0.402,0.444-0.679,0.601c-0.624,0.242-1.519,0.781-2.748,1.691c-0.27,0.297-0.329,0.512-0.383,0.868c-0.552,4.629-0.815,9.385-1.011,14.066c-0.201,0.223-0.409,0.304-0.551,0.311c-2.496-0.373-4.823-0.188-7.183,0.776c-0.202,0.223-0.329,0.512-0.249,0.721c0.051,2.475-1.809,4.973-5.728,7.359c-0.222-0.201-0.37-0.336-0.438-0.262c-1.996,1.159-3.933,2.104-5.815,2.691c-0.222-0.201-0.444-0.402-0.74-0.671c-0.387-0.252-0.781-0.483-1.176-0.717c-3.94,10.16-3.388,21.772-7.649,32.037c-1.204,2.25-3.518,4.012-5.918,5.571c0.825,1.119,2.338,2.461,4.707,3.953c0.297,0.269,0.52,0.47,0.741,0.671c0.314,3.525-0.489,5.901-2.404,7.269c-0.202,0.223-0.478,0.377-0.747,0.674c0.454,2.031,0.946,3.423,1.62,4.168c0.297,0.27,0.519,0.471,0.741,0.672c-0.084,2.624-0.591,5.268-1.308,7.993c0.007,0.142,0.088,0.35,0.31,0.551c-0.906,0.969-1.851,1.901-2.822,2.812c6.084,8.793,14.023,16.629,17.08,26.313C226.383,222.499,228.755,223.843,231.441,224.549z M286.94,156.487l0.106-0.713c0.133-1.635,0.756-3.364,1.735-5.041C290.851,153.96,290.162,155.763,286.94,156.487z M246.793,130.347c-0.208,0.081-0.483,0.236-0.753,0.532c0.09,1.836-1.281,2.754-4.046,2.677c-0.282,0.014-0.497-0.047-0.794-0.315c-1.646-3.246-1.191-5.534,1.49-7.152c0.41-0.303,0.672-0.741,0.779-1.454c0.12-0.431,0.167-0.929,0.071-1.42c2.711,0.434,5.2,0.666,7.817,0.609c0.216,0.06,0.505,0.188,0.727,0.389C251.175,127.301,249.436,129.368,246.793,130.347z").attr("fill","#7DD0EE").attr("stroke","#7DD0EE");
// parts of the cold thermohaline current around Antarctica
paper.setStart();
paper.path("M168.686,166.633c-3.362,6.62-4.028,14.908-1.295,22.006l-3.765,1.352c-3.077-8.135-2.432-17.461,1.56-25.295L168.686,166.633z").id="pathc0";
paper.path("M187.145,155.72c-7.659,0.38-14.79,4.326-18.459,10.913l-3.5-1.938c4.315-7.877,13.068-12.603,21.693-12.968L187.145,155.72z").id="pathc1";
paper.path("M207.657,163.22c-5.11-5.791-12.812-8.007-20.512-7.5l-0.266-3.992c8.432-0.668,17.859,2.072,23.674,8.732L207.657,163.22z").id="pathc2";
paper.path("M215.859,183.879c0.245-7.471-3.004-15.222-8.202-20.659l2.896-2.76c5.927,6.271,9.537,14.767,9.304,23.541L215.859,183.879z").id="pathc3";
paper.path("M204.709,202.058c6.628-3.646,11.062-10.651,11.149-18.179l3.998,0.122c-0.07,8.872-5.48,17.357-13.155,21.526L204.709,202.058z").id="pathc4";
paper.path("M182.825,204.084c7.087,2.53,15.368,1.747,21.885-2.026l1.992,3.47c-7.557,4.355-16.976,5.245-25.199,2.332L182.825,204.084z").id="pathc5";
paper.path("M167.391,188.639c2.462,7.187,8.241,13.01,15.434,15.445l-1.322,3.775c-8.304-2.792-15.049-9.614-17.876-17.869L167.391,188.639z").id="pathc6";
paper.setFinish().attr("fill","#4E9CD5").attr("stroke","#4E9CD5");
// parts of the not-so-cold (warm) thermohaline current around Antarctica
paper.setStart();
paper.path("M158.975,170.816c-2.417,8.139-1.546,17.352,2.936,24.554l-3.419,2.077c-5.108-8.244-6.069-18.623-3.352-27.771L158.975,170.816z").id="pathw0";
paper.path("M175.162,151.982c-7.643,3.967-13.895,10.592-16.187,18.834l-3.835-1.141c2.604-9.354,9.797-16.951,18.165-21.237L175.162,151.982z").id="pathw1";
paper.path("M177.866,151.573c-7.696,1.611-14.342,8.355-20.873,13.433c5.688-5.957,10.659-13.467,19.43-17.164L177.866,151.573z").id="pathw2";
paper.path("M199.857,149.396c-8.016-2.7-17.131-1.432-24.695,2.587l-1.856-3.544c8.354-4.433,18.58-5.942,27.841-2.83L199.857,149.396z").id="pathw3";
paper.path("M218.625,166.027c-4.105-7.562-10.729-13.863-18.768-16.632l1.289-3.787c9.186,3.173,16.488,10.222,20.99,18.504L218.625,166.027z").id="pathw4";
paper.path("M222.663,190.821c1.965-8.253,0.036-17.245-4.038-24.794l3.512-1.915 c4.453,8.273,6.646,18.141,4.421,27.624L222.663,190.821z").id="pathw5";
paper.path("M207.051,209.546c7.781-3.38,13.778-10.437,15.611-18.725l3.895,0.915c-2.079,9.469-9.035,17.648-17.884,21.467L207.051,209.546z").id="pathw6";
paper.path("M181.909,210.667c8.155,2.446,17.35,2.229,25.143-1.121l1.622,3.657c-8.871,3.793-18.852,3.988-27.967,1.279L181.909,210.667z").id="pathw7";
paper.path("M161.911,195.37c4.597,7.061,11.843,12.741,19.998,15.297l-1.202,3.815c-9.097-2.898-16.973-8.984-22.215-17.035L161.911,195.37z").id="pathw8";
paper.setFinish().attr("fill","#A84366").attr("stroke","#A84366");
this.parent().data("paper", paper);
this.parent().data("nextidc", 0);
this.parent().data("nextposc", 28);
paper.circle(0,0,4).attr("fill", "blue").attr("stroke", "blue").id="markerc";
this.parent().data("nextidw", 0);
this.parent().data("nextposw", 28);
paper.circle(0,0,4).attr("fill", "red").attr("stroke", "red").id="markerw";
// a reusable function that makes the current flow
flow = function($this, nextidStr, nextposStr, pathStr, markerStr, maxid) {
var nextid = $this.data(nextidStr);
var nextpos = $this.data(nextposStr);
var path = paper.getById(pathStr + nextid);
var len = path.getTotalLength();
var marker = paper.getById(markerStr);
var point = path.getPointAtLength(nextpos);
marker.attr("cx", point.x);
marker.attr("cy", point.y);
nextpos++;
if (nextpos >= len - 5) {
nextid++;
if (nextid >= maxid) {nextid = 0;};
$this.data(nextidStr, nextid);
nextpos = len / 2;
}
$this.data(nextposStr, nextpos);
}
} // end of initialization code that only runs once
// this code runs every time step
var $this = this.parent();
flow($this, "nextidc", "nextposc", "pathc", "markerc", 7); // cold current
flow($this, "nextidw", "nextposw", "pathw", "markerw", 9); // not-so-cold (warm) current
}
]]></Blockbehavior>
<Blockbehavior implName="lang:bsh:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:jruby:inline:"><![CDATA[
]]></Blockbehavior>
<Blockbehavior implName="lang:groovy:inline:"><![CDATA[
]]></Blockbehavior>
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml,
<svg width="345" height="380" xmlns="http://www.w3.org/2000/svg">
</svg>
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient>
</XholonWorkbook>