You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

475 lines
24 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //TTC subway
  2. //subway.js
  3. // Author: Cameron Davidson-Pilon
  4. // Date: July, 2012
  5. // License: MIT
  6. // Dependencies:
  7. // Paper.js (http://paperjs.org/)
  8. //subway for blogs.
  9. //canvas dimensions
  10. width = 1890;
  11. height = 1000;
  12. // These change the subway chacteristics. Try manipulating them to see what they do.
  13. // Note: all measurments are in pixels.
  14. var NODE_SIZE = 16; //radius.
  15. var INNER_NODE_SIZE = 7;
  16. var CUR_NODE_SIZE = 9;
  17. var LINE_WIDTH = 5;
  18. // fonts
  19. var FONT_SIZE = 16;
  20. var TEXT_FONT = 'Arial';
  21. var CHARACTER_STYLE = {
  22. fillColor: 'black',
  23. fontSize: FONT_SIZE,
  24. font: TEXT_FONT,
  25. };
  26. // after initilization, this variable will contain all stations. Needed for clicking with mouse.
  27. nodes = [];
  28. function Line( color, name ){
  29. // the Line object creates a subway line.
  30. // color: must be a paper.js RgbColor or a keyword color, eg: 'black', 'green'.
  31. // name: the unique name of the line.
  32. this.color = color;
  33. this.path = new Path();
  34. this.path.strokeWidth = LINE_WIDTH;
  35. this.path.strokeColor = this.color;
  36. this.name = name;
  37. }
  38. function SingleNode( line, position, neighbours, name, url, name_offset, name_angle){
  39. // the Node object is a non transitionay subway stop
  40. // line: the line the node lies on.
  41. // position: the coordinates on the canvas as Point class object.
  42. // neighbours: the neighbours of the node. It
  43. // must be the syntax {'E':Neighbour1, 'W':Neighbour2, etc.}. Note: this way we can also do things like:
  44. // {'W': Neighbour1, 'S': Neighbour1, 'E': Neighbour2}. Note all the directions need to be defined.
  45. // name: the station name to be displayed.
  46. // url: the url to go to if the SpaceBar is pressed. Leave as '' if not wanted.
  47. // name_offset: the amount to move the display named away from the center of the station. It must be a paper.js Point
  48. // object. ie. new Point( 10, 10) will position the top left corner of the text 10 pixels right and
  49. // 10 pixels below the center of the station.
  50. // name_angle: the angle the name to be at. Enter it in counterclockwise radians.
  51. this.line = line;
  52. this.position = position;
  53. this.neighbours = neighbours;
  54. this.name = name;
  55. this.url = url;
  56. nodes.push(this)
  57. //Methods
  58. this.onkeydownNode = onkeydownNode;
  59. this.emptyNode = emptyNode;
  60. this.fillNode = fillNode;
  61. // generate the visual shapes.
  62. var c = new Path.Circle( this.position, NODE_SIZE);
  63. c.fillColor = this.line.color;
  64. var ic = new Path.Circle( this.position, INNER_NODE_SIZE);
  65. ic.fillColor = 'white';
  66. this.text = new PointText( this.position + name_offset );
  67. this.text.content = this.name;
  68. this.text.characterStyle = CHARACTER_STYLE;
  69. // To rotate names, uncomment below.
  70. this.text.rotate( -name_angle, this.position );
  71. // add it to the line.
  72. this.line.path.add( this.position);
  73. }
  74. function TransitionNode( line, line2, angle, position, neighbours, name, url,name_offset, name_angle){
  75. // the Node object is a non transitionay subway stop
  76. // line: the primary line the node lies on.
  77. // line2: the secondary line the node lies on.
  78. // angle: the angle of the above and underneath node. Equal to the angle of the two lines.
  79. // position: the coordinates on the canvas as Point class object.
  80. // neighbours: the neighbours of the node. It
  81. // must be the syntax {'E':Neighbour1, 'W':Neighbour2, etc.}. Note: this way we can also do things like:
  82. // {'W': Neighbour1, 'S': Neighbour1, 'E': Neighbour2}. Note all the directions need to be defined.
  83. // name: the station name to be displayed.
  84. // url: the url to go to if the SpaceBar is pressed. Leave as '' if not wanted.
  85. // name_offset: the amount to move the display named away from the center of the station. It must be a paper.js Point
  86. // object. ie. new Point( 10, 10) will position the top left corner of the text 10 pixels right and
  87. // 10 pixels below the center of the station.
  88. // name_angle: the angle the name to be at. Enter it in counterclockwise radians.
  89. STROKE_WIDTH = 2; //this two control the offset and appearance of the 'underneath node'
  90. CIRCLE_DIST = 16;
  91. //This Node is the class for line transition stations.
  92. this.line = line;
  93. this.line2 = line2;
  94. this.position = position; //This is the position of either of the circles. The angle determines the position of the other one.
  95. this.neighbours = neighbours;
  96. this.angle = angle; //This is the angle between the two circles.
  97. this.positionAlt = this.position + new Point( CIRCLE_DIST*Math.cos( angle), CIRCLE_DIST*Math.sin( angle) );
  98. this.name = name;
  99. this.url = url;
  100. nodes.push(this);
  101. //Methods;
  102. this.onkeydownNode = onkeydownNode;
  103. this.emptyNode = function(){
  104. this.innerc.remove()
  105. }
  106. //this.fillNode = fillNode;
  107. this.fillNode = function(){
  108. this.innerc = new Path.Circle( this.position, CUR_NODE_SIZE);
  109. this.innerc.fillColor = 'black';
  110. // window.location.href=this.url;
  111. }
  112. this.text = new PointText( this.position + name_offset );
  113. this.text.content = this.name;
  114. this.text.characterStyle = CHARACTER_STYLE;
  115. // uncomment below to rotate.
  116. this.text.rotate( -name_angle, this.position);
  117. //generate visual shapes
  118. var c2 = new Path.Circle( this.positionAlt , NODE_SIZE);
  119. c2.strokeWidth = STROKE_WIDTH;
  120. c2.strokeColor = 'black';
  121. c2.fillColor = 'white';
  122. var c2 = new Path.Circle( this.positionAlt, CUR_NODE_SIZE+1);
  123. c2.fillColor = this.line2.color;
  124. var c1 = new Path.Circle( this.position, NODE_SIZE);
  125. c1.strokeWidth = STROKE_WIDTH;
  126. c1.fillColor = 'white';
  127. c1.strokeColor = 'black';
  128. var c1 = new Path.Circle( this.position, CUR_NODE_SIZE);
  129. c1.fillColor = this.line.color;
  130. //add it the the lines.
  131. this.line.path.add( this.position);
  132. this.line2.path.add(this.positionAlt);
  133. }
  134. function LegendItem( start, end, subwayLine ){
  135. this.line = new Line(subwayLine.color, subwayLine.name);
  136. this.line.path.add( start, end)
  137. title = new PointText( end + new Point( 7,5) );
  138. title.content = subwayLine.name;
  139. title.characterStyle = {
  140. fillColor: 'black',
  141. fontSize: 14,
  142. font: TEXT_FONT
  143. };
  144. }
  145. function onKeyDown(event){
  146. //this function fires when a key is pressed.
  147. if (event.key =='w' ){
  148. current_position.onkeydownNode('N');}
  149. if (event.key =='a' ){
  150. current_position.onkeydownNode('W');}
  151. if (event.key == 'd'){
  152. current_position.onkeydownNode('E');}
  153. if (event.key == 's'){
  154. current_position.onkeydownNode('S');}
  155. //if (event.key in oc(['enter', 'space']) ){
  156. //will work if you set station urls. See the doc for SingleNode.
  157. // window.location.href=current_position.url;
  158. // }
  159. }
  160. function onkeydownNode( keydown ){
  161. for ( key in this.neighbours ){
  162. if (key == keydown){
  163. current_position.emptyNode();
  164. current_position = this.neighbours[key];
  165. current_position.fillNode();
  166. }
  167. }
  168. return 0;
  169. }
  170. function fillNode(){
  171. //this method fires when the user enters the node.
  172. var c = new Path.Circle( this.position, CUR_NODE_SIZE);
  173. c.fillColor = 'black';
  174. }
  175. function emptyNode(){
  176. //this function fires when the user leaves the node;
  177. var c = new Path.Circle( this.position, NODE_SIZE);
  178. c.fillColor = this.line.color;
  179. var ic = new Path.Circle( this.position, INNER_NODE_SIZE);
  180. ic.fillColor = 'white';
  181. }
  182. function DashLine( color, point1, point2){
  183. // This creates a dashed subway line to represent either construction or leaving the webpage.
  184. // color: the color of the dashed line.
  185. // point1, point2: the beginning and end of the dashed line, as paper.js Point objects.
  186. this.color = color;
  187. this.path = new Path();
  188. this.path.style = {
  189. strokeWidth: LINE_WIDTH,
  190. strokeColor: this.color,
  191. };
  192. this.path.dashArray = [7,4];
  193. this.path.add(point1, point2);
  194. }
  195. function onMouseDown(event){
  196. // This function fires whenever the mouse is pressed down. It iteratres through the stations and stops if it finds the
  197. // cursor is over a station.
  198. var N = nodes.length;
  199. for( var i=0; i<N; i++){
  200. var node_position = nodes[i].position;
  201. if (Path.Circle( node_position, NODE_SIZE ).bounds.contains(event.point) ){
  202. current_position.emptyNode();
  203. current_position = nodes[i];
  204. current_position.fillNode();
  205. break;
  206. }
  207. }
  208. }
  209. function onFrame(event){
  210. //This control the halo. You can choose to turn it off by removing this function, or you can create your own using
  211. //this function too.
  212. if( event.count%2!=0) return;
  213. halo.strokeColor = current_position.line.color;
  214. halo.scale( Math.pow( 1.05, Math.sin(event.count/4 )));
  215. halo.position = current_position.position ;
  216. }
  217. bloorLine = new Line( '#2C7212', 'Bloor Line');
  218. youngeLine = new Line( '#FCC61C', 'Younge Line');
  219. sheppardLine = new Line( 'rgb(151,69,120)', 'Sheppard Line');
  220. scarboroughLine = new Line('rgb(0,146,220)', 'Scarborough Line');
  221. d_bloor = Math.floor( 1700/28 );
  222. i_bloor = 20;
  223. bloor_height = 470 + 70;
  224. bloor_offset = new Point( 15, -12);
  225. bloor_offset_alt = new Point( 20, 8);
  226. bloor_name_angle = 35;
  227. younge_offset = new Point( 22, 5 );
  228. younge_d = 50;
  229. younge_i = 30 + 70;
  230. younge_width = i_bloor + 13*d_bloor;
  231. young_d_alt = 44;
  232. // I think it would be useful to package the offset, angle etc. into a new object, so it can be passed around easier.
  233. downsview = new SingleNode( youngeLine, new Point(younge_width - 2*d_bloor+20, younge_i + 0*younge_d), null, 'Downsview','url', younge_offset, 0 );
  234. wilson = new SingleNode( youngeLine, new Point(younge_width -2*d_bloor+20, younge_i + 1*younge_d), null, 'Wilson','url', younge_offset, 0 );
  235. yorkdale = new SingleNode( youngeLine, new Point(younge_width- 2*d_bloor+20, younge_i + 2*younge_d), null, 'Yorkdale','url', younge_offset, 0 );
  236. lawrenceWest = new SingleNode( youngeLine, new Point(younge_width-2*d_bloor+20, younge_i + 3*younge_d), null, 'Lawrence West','url', younge_offset, 0 );
  237. glencairn = new SingleNode( youngeLine, new Point(younge_width-2*d_bloor+20, younge_i + 4*younge_d), null, 'Glencairn','url', younge_offset, 0 );
  238. eglingtonWest = new SingleNode( youngeLine, new Point(younge_width-2*d_bloor+20, younge_i + 5*younge_d), null, 'Eglington West','url', younge_offset, 0 );
  239. stClairWest = new SingleNode( youngeLine, new Point(younge_width-1*d_bloor+10, younge_i + 6*younge_d), null, 'St. Clair West','url', younge_offset, 0 );
  240. dupont = new SingleNode( youngeLine, new Point(younge_width, younge_i + 7*younge_d), null, 'Dupont','url', younge_offset, 0 );
  241. kipling = new SingleNode( bloorLine, new Point(i_bloor + 0*d_bloor, bloor_height) + new Point( 5, d_bloor-10 ), null, 'Kipling','url', bloor_offset_alt, 0 );
  242. islington = new SingleNode( bloorLine, new Point(i_bloor + 1*d_bloor, bloor_height), null, 'Islington','url', bloor_offset, bloor_name_angle );
  243. royalYork = new SingleNode( bloorLine,new Point(i_bloor + 2*d_bloor, bloor_height), null, 'Royal York','url', bloor_offset, bloor_name_angle );
  244. oldMill = new SingleNode( bloorLine, new Point(i_bloor + 3*d_bloor, bloor_height), null, 'Old Mill','url', bloor_offset, bloor_name_angle );
  245. runnymede = new SingleNode( bloorLine, new Point(i_bloor + 4*d_bloor, bloor_height), null, 'Runnymede','url', bloor_offset, bloor_name_angle );
  246. highPark = new SingleNode( bloorLine, new Point(i_bloor + 5*d_bloor, bloor_height), null, 'High Park','url', bloor_offset, bloor_name_angle );
  247. keele = new SingleNode( bloorLine, new Point(i_bloor + 6*d_bloor, bloor_height), null, 'Keele','url', bloor_offset, bloor_name_angle );
  248. dundasWest = new SingleNode( bloorLine, new Point(i_bloor + 7*d_bloor, bloor_height), null, 'Dundas West','url', bloor_offset, bloor_name_angle );
  249. lansdowne = new SingleNode( bloorLine, new Point(i_bloor + 8*d_bloor, bloor_height), null, 'Landsdowne','url', bloor_offset, bloor_name_angle );
  250. dufferin = new SingleNode( bloorLine, new Point(i_bloor + 9*d_bloor, bloor_height), null, 'Dufferin','url', bloor_offset, bloor_name_angle );
  251. ossington = new SingleNode( bloorLine, new Point(i_bloor + 10*d_bloor, bloor_height), null, 'Ossington','url', bloor_offset, bloor_name_angle );
  252. christie = new SingleNode( bloorLine, new Point(i_bloor + 11*d_bloor, bloor_height), null, 'Christie','url', bloor_offset, bloor_name_angle );
  253. bathurst = new SingleNode( bloorLine, new Point(i_bloor + 12*d_bloor, bloor_height), null, 'Bathurst','url', bloor_offset, bloor_name_angle );
  254. spadina = new TransitionNode( bloorLine, youngeLine, 1.571, new Point(i_bloor + 13*d_bloor, bloor_height), null, 'Spadina','url', bloor_offset, bloor_name_angle );
  255. stGeorge = new TransitionNode( bloorLine, youngeLine, 1.571, new Point(i_bloor + 14*d_bloor, bloor_height), null, 'St. George','url', bloor_offset, bloor_name_angle );
  256. museum = new SingleNode( youngeLine, new Point(i_bloor + 14*d_bloor, younge_i + 10*younge_d), null, 'Museum','url', new Point(-80,5), 0 );
  257. queensPark = new SingleNode( youngeLine, new Point(i_bloor + 14*d_bloor, younge_i + 11*younge_d), null, 'Queen\'s Park','url', new Point(-115,5), 0 );
  258. stPatrick = new SingleNode( youngeLine, new Point(i_bloor + 14*d_bloor, younge_i + 12*younge_d), null, 'St. Patrick','url', new Point(-95,5), 0 );
  259. osgoode = new SingleNode( youngeLine, new Point(i_bloor + 14*d_bloor, younge_i + 13*younge_d), null, 'Osgoode','url', new Point(-87,5), 0 );
  260. stAndrew = new SingleNode( youngeLine, new Point(i_bloor + 14*d_bloor, younge_i + 14*younge_d), null, 'St. Andrews','url', new Point(-105,5), 0 );
  261. union = new SingleNode( youngeLine, new Point(i_bloor + 15*d_bloor, younge_i + 15*younge_d - 20), null, 'Union','url', new Point(20, 15), 0 );
  262. king = new SingleNode( youngeLine, new Point(i_bloor + 16*d_bloor, younge_i + 14*younge_d), null, 'King','url', younge_offset, 0 );
  263. queen = new SingleNode( youngeLine, new Point(i_bloor + 16*d_bloor, younge_i + 13*younge_d), null, 'Queen','url', younge_offset, 0 );
  264. dundas = new SingleNode( youngeLine, new Point(i_bloor + 16*d_bloor, younge_i + 12*younge_d), null, 'Dundas','url', younge_offset, 0 );
  265. college = new SingleNode( youngeLine, new Point(i_bloor + 16*d_bloor, younge_i + 11*younge_d), null, 'College','url', younge_offset, 0 );
  266. wellesley = new SingleNode( youngeLine, new Point(i_bloor + 16*d_bloor, younge_i + 10*younge_d), null, 'Wellesley','url', younge_offset, 0 );
  267. bay = new SingleNode( bloorLine, new Point(i_bloor + 15*d_bloor, bloor_height), null, 'Bay','url', bloor_offset, bloor_name_angle );
  268. bloorYounge = new TransitionNode( bloorLine, youngeLine, 1.571, new Point(i_bloor + 16*d_bloor, bloor_height), null, 'Bloor/Younge','url', bloor_offset, bloor_name_angle );
  269. sherbourne = new SingleNode( bloorLine, new Point(i_bloor + 17*d_bloor, bloor_height), null, 'Sherbourne','url', bloor_offset, bloor_name_angle );
  270. castleFrank = new SingleNode( bloorLine, new Point(i_bloor + 18*d_bloor, bloor_height), null, 'Castle frank','url', bloor_offset, bloor_name_angle);
  271. broadview = new SingleNode( bloorLine, new Point(i_bloor + 19*d_bloor, bloor_height), null, 'Broadview','url', bloor_offset, bloor_name_angle );
  272. chester = new SingleNode( bloorLine, new Point(i_bloor + 20*d_bloor, bloor_height), null, 'Chester','url', bloor_offset, bloor_name_angle );
  273. pape = new SingleNode( bloorLine, new Point(i_bloor + 21*d_bloor, bloor_height), null, 'Pape','url', bloor_offset, bloor_name_angle );
  274. donlands = new SingleNode( bloorLine, new Point(i_bloor + 22*d_bloor, bloor_height), null, 'Donlands','url', bloor_offset, bloor_name_angle );
  275. greenwood = new SingleNode( bloorLine, new Point(i_bloor + 23*d_bloor, bloor_height), null, 'Greenwood','url', bloor_offset, bloor_name_angle );
  276. coxwell = new SingleNode( bloorLine, new Point(i_bloor + 24*d_bloor, bloor_height), null, 'Coxwell','url', bloor_offset, bloor_name_angle );
  277. woodbine = new SingleNode( bloorLine, new Point(i_bloor + 25*d_bloor, bloor_height), null, 'Woodbine','url', bloor_offset, bloor_name_angle);
  278. mainStreet = new SingleNode( bloorLine, new Point(i_bloor + 26*d_bloor, bloor_height), null, 'Main Street','url', bloor_offset_alt, 0);
  279. victoriaPark = new SingleNode( bloorLine, new Point(i_bloor + 27*d_bloor, bloor_height) + new Point( -20, -d_bloor+10 ) , null, 'Victoria Park','url', bloor_offset_alt, 0);
  280. warden = new SingleNode( bloorLine, new Point(i_bloor + 28*d_bloor, bloor_height) + new Point( -2*20, -2*d_bloor+2*10 ), null, 'Warden','url', bloor_offset_alt, 0 );
  281. kennedy = new TransitionNode( bloorLine, scarboroughLine, -1.571, new Point(i_bloor + 29*d_bloor -3*20, bloor_height -3*d_bloor+3*10) , null, 'Kennedy','url', bloor_offset_alt ,0 );
  282. rosedale = new SingleNode( youngeLine, new Point(i_bloor + 16*d_bloor, younge_i + 6.5*younge_d + 0*young_d_alt), null, 'Rosedale','url', younge_offset, 0 );
  283. summerhill = new SingleNode( youngeLine, new Point(i_bloor + 16*d_bloor, younge_i + 6.5*younge_d -1*young_d_alt), null, 'Summerhill','url', younge_offset, 0 );
  284. stClair = new SingleNode( youngeLine, new Point(i_bloor + 16*d_bloor, younge_i + 6.5*younge_d-2*young_d_alt), null, 'St. Clair','url', younge_offset, 0 );
  285. davisville = new SingleNode( youngeLine, new Point(i_bloor + 16*d_bloor, younge_i + 6.5*younge_d-3*young_d_alt), null, 'Davisville','url', younge_offset, 0 );
  286. eglington = new SingleNode( youngeLine, new Point(i_bloor + 16*d_bloor, younge_i + 6.5*younge_d-4*young_d_alt), null, 'Eglington','url', younge_offset, 0 );
  287. lawrence = new SingleNode( youngeLine, new Point(i_bloor + 16*d_bloor, younge_i + 6.5*younge_d-5*young_d_alt), null, 'Lawrence','url', younge_offset, 0 );
  288. yorkMills = new SingleNode( youngeLine, new Point(i_bloor + 16*d_bloor, younge_i + 6.5*younge_d-6*young_d_alt), null, 'York Mills','url', younge_offset, 0 );
  289. sheppardYounge = new TransitionNode( youngeLine, sheppardLine, 0, new Point(i_bloor + 16*d_bloor, younge_i + 6.5*younge_d-7*young_d_alt), null, 'Sheppard-Younge','url', new Point(-150, 5), 0 );
  290. northYorkCentre = new SingleNode( youngeLine, new Point(i_bloor + 16*d_bloor, younge_i + 6.5*younge_d-8*young_d_alt), null, 'North York Centre','url', younge_offset, 0 );
  291. finch = new SingleNode( youngeLine, new Point(i_bloor + 16*d_bloor, younge_i + 6.5*younge_d-9*young_d_alt), null, 'Finch','url', younge_offset, 0 );
  292. //purpz line
  293. shep_d = 60;
  294. shep_i = 90;
  295. bayview = new SingleNode( sheppardLine, new Point(i_bloor + 16*d_bloor + shep_i + 1*shep_d, younge_i + 6.5*younge_d-7*young_d_alt), null, 'Bayview','url', bloor_offset, bloor_name_angle );
  296. bessarion = new SingleNode( sheppardLine, new Point(i_bloor + 16*d_bloor + shep_i + 2*shep_d, younge_i + 6.5*younge_d-7*young_d_alt), null, 'Bessarion','url', bloor_offset, bloor_name_angle );
  297. leslie = new SingleNode( sheppardLine, new Point(i_bloor + 16*d_bloor + shep_i + 3*shep_d, younge_i + 6.5*younge_d-7*young_d_alt), null, 'Leslie','url', bloor_offset, bloor_name_angle );
  298. donMills = new SingleNode( sheppardLine, new Point(i_bloor + 16*d_bloor + shep_i + 4*shep_d, younge_i + 6.5*younge_d-7*young_d_alt), null, 'Don Mills','url', bloor_offset, bloor_name_angle );
  299. // bluez line
  300. lawrenceEast = new SingleNode( scarboroughLine, new Point(i_bloor + 29*d_bloor -3*20, bloor_height -3*d_bloor+15 - 1*60), null, 'Lawrence East','', bloor_offset_alt, 0);
  301. ellsemere = new SingleNode( scarboroughLine, new Point(i_bloor + 29*d_bloor -3*20, bloor_height -3*d_bloor+15 - 2*60), null, 'Ellsemere', '', bloor_offset_alt, 0);
  302. midland = new SingleNode( scarboroughLine, new Point(i_bloor + 29*d_bloor -3*20, bloor_height -3*d_bloor+15 - 3*60), null, 'Midland','', bloor_offset, bloor_name_angle);
  303. scarboroughCentre = new SingleNode( scarboroughLine, new Point(i_bloor + 29*d_bloor -3*20 + 50, bloor_height -3*d_bloor+15 - 3*60), null, 'Scarborough Centre', '', bloor_offset, bloor_name_angle);
  304. mcCowan = new SingleNode( scarboroughLine, new Point(i_bloor + 29*d_bloor -3*20 + 2*50, bloor_height -3*d_bloor+15 - 3*60), null, 'McCowan', '', bloor_offset, bloor_name_angle);
  305. kipling.neighbours = {'N': islington, 'E': islington };
  306. islington.neighbours = {'W': kipling, 'E': royalYork, 'S':kipling };
  307. royalYork.neighbours = {'W': islington,'E':oldMill};
  308. oldMill.neighbours = {'W':royalYork, 'E':runnymede};
  309. runnymede.neighbours = {'W':oldMill, 'E':highPark};
  310. highPark.neighbours = {'W':runnymede, 'E':keele};
  311. keele.neighbours = {'W':highPark, 'E':dundasWest};
  312. dundasWest.neighbours = {'W':keele, 'E':lansdowne};
  313. lansdowne.neighbours = {'W':dundasWest, 'E':dufferin};
  314. dufferin.neighbours = {'W':lansdowne, 'E':ossington};
  315. ossington.neighbours = {'W':dufferin, 'E':christie};
  316. christie.neighbours = {'W':ossington, 'E':bathurst};
  317. bathurst.neighbours = {'W':christie, 'E':spadina};
  318. spadina.neighbours = {'W':bathurst, 'E':stGeorge, 'N':dupont, 'S':stGeorge};
  319. stGeorge.neighbours = {'W':spadina, 'E':bay, 'S':museum, 'N':spadina};
  320. bay.neighbours = {'W':stGeorge, 'E':bloorYounge};
  321. bloorYounge.neighbours = {'W':bay, 'E':sherbourne, 'N':rosedale, 'S':wellesley};
  322. sherbourne.neighbours = {'E':castleFrank, 'W':bloorYounge};
  323. castleFrank.neighbours = {'W':sherbourne, 'E':broadview};
  324. broadview.neighbours = {'W':castleFrank, 'E':chester};
  325. chester.neighbours = {'W':broadview, 'E':pape};
  326. pape.neighbours = {'W':chester, 'E':donlands};
  327. donlands.neighbours = {'W':pape, 'E':coxwell};
  328. coxwell.neighbours = {'W':donlands, 'E':woodbine};
  329. woodbine.neighbours = {'W':coxwell, 'E':mainStreet};
  330. mainStreet.neighbours = {'W':woodbine, 'E':victoriaPark, 'N':victoriaPark};
  331. victoriaPark.neighbours = {'W':mainStreet, 'E':warden, 'S':mainStreet, 'N':warden};
  332. warden.neighbours = {'W':victoriaPark, 'E':kennedy, 'S':victoriaPark, 'N':kennedy};
  333. kennedy.neighbours = {'W':warden, 'S':warden, 'N':lawrenceEast};
  334. lawrenceEast.neighbours = { 'S':kennedy, 'N':ellsemere};
  335. ellsemere.neighbours = { 'S':lawrenceEast, 'N':midland};
  336. midland.neighbours = { 'S':ellsemere, 'E':scarboroughCentre};
  337. scarboroughCentre.neighbours = { 'W':midland, 'E':mcCowan};
  338. mcCowan.neighbours = { 'W':scarboroughCentre};
  339. dupont.neighbours = {'S':spadina, 'N':stClairWest, 'W':stClairWest};
  340. stClairWest.neighbours = {'S':dupont, 'N':eglingtonWest, 'W':eglingtonWest, 'E':dupont};
  341. eglingtonWest.neighbours = {'E':stClairWest, 'S':stClairWest, 'N':glencairn};
  342. glencairn.neighbours = {'N':lawrenceWest, 'S':eglingtonWest};
  343. lawrenceWest.neighbours = {'N':yorkdale, 'S':glencairn};
  344. yorkdale.neighbours = {'N':wilson, 'S':lawrenceWest};
  345. wilson.neighbours = {'N':downsview, 'S':yorkdale};
  346. downsview.neighbours = {'S':wilson};
  347. finch.neighbours = {'S':northYorkCentre};
  348. northYorkCentre.neighbours = {'S':sheppardYounge, 'N':finch };
  349. sheppardYounge.neighbours = {'S':yorkMills, 'N':northYorkCentre, 'E':bayview };
  350. yorkMills.neighbours = {'S':lawrence, 'N':sheppardYounge };
  351. lawrence.neighbours = {'S':eglington, 'N':yorkMills };
  352. eglington.neighbours = {'S':davisville, 'N':lawrence };
  353. davisville.neighbours = {'S':stClair, 'N':eglington };
  354. stClair.neighbours = {'S':summerhill, 'N':davisville };
  355. summerhill.neighbours = {'S':rosedale, 'N':stClair };
  356. rosedale.neighbours = {'S':bloorYounge, 'N':summerhill };
  357. museum.neighbours = {'N':stGeorge, 'S':queensPark};
  358. queensPark.neighbours = {'N':museum, 'S':stPatrick};
  359. stPatrick.neighbours = {'N':queensPark, 'S':osgoode};
  360. osgoode.neighbours = {'N':stPatrick, 'S':stAndrew};
  361. stAndrew.neighbours = {'N':osgoode, 'S':union, 'E':union};
  362. king.neighbours = {'N':queen, 'S':union, 'W':union};
  363. union.neighbours = {'E':king, 'W':stAndrew};
  364. queen.neighbours = {'N':dundas, 'S':king};
  365. dundas.neighbours = {'N':college, 'S':queen};
  366. college.neighbours = {'N':wellesley, 'S':dundas};
  367. wellesley.neighbours = {'N':bloorYounge, 'S':college};
  368. bayview.neighbours = {'W':sheppardYounge, 'E':bessarion};
  369. bessarion.neighbours = {'W':bayview, 'E':leslie};
  370. leslie.neighbours = {'W':bessarion, 'E':donMills};
  371. donMills.neighbours = {'W':leslie};
  372. // initialize myself.
  373. current_position = stGeorge;
  374. current_position.fillNode();
  375. // form the halo
  376. halo = new Path.Circle( current_position.position, NODE_SIZE );
  377. halo.strokeColor = current_position.line.color;
  378. halo.strokeWidth = 1;