<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>tube &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/tube/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Fri, 14 Feb 2025 08:51:16 +0000</lastBuildDate>
	<language>en-GB</language>
	<copyright>© Terence Eden. 🄯 CC BY-SA. See https://shkspr.mobi/blog/copyright-and-copyleft/</copyright>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>tube &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[Force Directed Graph of the London Tube Map - including CrossRail!]]></title>
		<link>https://shkspr.mobi/blog/2021/02/force-directed-graph-of-the-london-tube-map-including-crossrail/</link>
					<comments>https://shkspr.mobi/blog/2021/02/force-directed-graph-of-the-london-tube-map-including-crossrail/#comments</comments>
				<dc:creator><![CDATA[Terence Eden]]></dc:creator>
		<pubDate>Sun, 14 Feb 2021 12:30:13 +0000</pubDate>
		<category><![CDATA[map]]></category><category><![CDATA[Open Data]]></category><category><![CDATA[TFL]]></category><category><![CDATA[tube]]></category>		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=38123</guid>

					<description><![CDATA[Force Directed Graphs of the London Underground have been done many times before - but I think I&#039;m the first person to add the new Elizabeth Line (CrossRail).  I&#039;ve also created a JSON graph of all of London&#039;s rail services - including DLR, Trams, C2C, ThamesLink etc.  Demo     Play with it yourself Grab the code from GitLab I&#039;ve also created a version with every London station and train line.  …]]></description>
										<content:encoded>&lt;p&gt;Force Directed Graphs of the London Underground have been done many times before - but I think I'm the first person to add the new Elizabeth Line (CrossRail).&lt;/p&gt;

&lt;p&gt;I've also created &lt;a href="https://gitlab.com/edent/force-directed-london-tube-map/-/blob/master/TfL%20Graph.json"&gt;a JSON graph of all of London's rail services&lt;/a&gt; - including DLR, Trams, C2C, ThamesLink etc.&lt;/p&gt;

&lt;h2 id="demo"&gt;&lt;a href="https://shkspr.mobi/blog/2021/02/force-directed-graph-of-the-london-tube-map-including-crossrail/#demo"&gt;Demo&lt;/a&gt;&lt;/h2&gt;

&lt;iframe title="Force Directed Graph of London Underground - including CrossRail - using D3." width="620" height="349" src="https://www.youtube.com/embed/gclRxDKlCEY?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen=""&gt;&lt;/iframe&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://edent.gitlab.io/force-directed-london-tube-map/force.html"&gt;Play with it yourself&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gitlab.com/edent/force-directed-london-tube-map/"&gt;Grab the code from GitLab&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;I've also created a version with &lt;a href="https://edent.gitlab.io/force-directed-london-tube-map/full.html"&gt;&lt;em&gt;every&lt;/em&gt; London station and train line&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="limitations"&gt;&lt;a href="https://shkspr.mobi/blog/2021/02/force-directed-graph-of-the-london-tube-map-including-crossrail/#limitations"&gt;Limitations&lt;/a&gt;&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;This is a quick weekend hack - don't expect polished code or performance!&lt;/li&gt;
&lt;li&gt;"Overlapping" lines don't show. So where a route is served by multiple lines, you'll only see one of them.&lt;/li&gt;
&lt;li&gt;Zoom is a bit shonky.&lt;/li&gt;
&lt;li&gt;Relies on an older version of D3 (V5).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id="background"&gt;&lt;a href="https://shkspr.mobi/blog/2021/02/force-directed-graph-of-the-london-tube-map-including-crossrail/#background"&gt;Background&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Drawing the Tube map as a graph is a popular pastime. See these prior arts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"&lt;a href="http://blogs.casa.ucl.ac.uk/2011/09/01/force-directed-graph-of-tube-lines/"&gt;Force-directed graph of tube lines&lt;/a&gt;" by Martin Zaltz Austwick (2011)&lt;/li&gt;
&lt;li&gt;"&lt;a href="https://www.researchgate.net/figure/The-London-Underground-map-with-a-focus-on-Green-Park-created-using-the-method-described_fig2_320371151"&gt;Graph Drawing by Weighted Constraint Relaxation&lt;/a&gt;" (2017)&lt;/li&gt;
&lt;li&gt;"&lt;a href="https://www.linkedin.com/pulse/what-would-london-tube-map-look-like-data-scientist-designed-mcnulty/"&gt;What would the London Tube Map look like if Data Scientists designed it?&lt;/a&gt;" by Keith McNulty (2018)&lt;/li&gt;
&lt;li&gt;"&lt;a href="https://neo4j.com/blog/going-underground-graphing-pathfinding-london-tube-lines/"&gt;Going Underground: Graphing and Pathfinding London Tube Lines&lt;/a&gt;" by Joe Depeau (2019)&lt;/li&gt;
&lt;li&gt;And many others.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I forked some code from &lt;a href="https://gist.github.com/mapio/53fed7d84cd1812d6a6639ed7aa83868"&gt;Massimo Santini&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Chris Bell maintains an excellent &lt;a href="https://www.doogal.co.uk/london_stations.php"&gt;CSV of all London stations and their connections&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The official colours for each line can be found in &lt;a href="https://web.archive.org/web/20210214123302/https://content.tfl.gov.uk/tfl-colour-standards-issue04.pdf"&gt;TfL's colour branding guide&lt;/a&gt; and in hex versions at &lt;a href="https://oobrien.com/2012/01/tube-colours/"&gt;Oliver O'Brien's site&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id="whats-next"&gt;&lt;a href="https://shkspr.mobi/blog/2021/02/force-directed-graph-of-the-london-tube-map-including-crossrail/#whats-next"&gt;What's next&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Possible ideas - feel free to &lt;a href="https://gitlab.com/edent/force-directed-london-tube-map/"&gt;contribute on GitLab&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Experiment with different layout algorithms.&lt;/li&gt;
&lt;li&gt;Weight links according to speed, distance, business, or some other metric.&lt;/li&gt;
&lt;li&gt;Better colour options for non-TfL lines.&lt;/li&gt;
&lt;li&gt;More efficient code.&lt;/li&gt;
&lt;/ul&gt;
&lt;img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=38123&amp;amp;HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager"&gt;</content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2021/02/force-directed-graph-of-the-london-tube-map-including-crossrail/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
	</channel>
</rss>
