<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alec McEachran on Medium]]></title>
        <description><![CDATA[Stories by Alec McEachran on Medium]]></description>
        <link>https://medium.com/@alecmce?source=rss-5f0becdafd8b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Q37Pv3yNxPUdX3t-XVM45w.png</url>
            <title>Stories by Alec McEachran on Medium</title>
            <link>https://medium.com/@alecmce?source=rss-5f0becdafd8b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 08:17:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alecmce/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Comic Documentation]]></title>
            <link>https://medium.com/@alecmce/comic-documentation-850cccdf06f4?source=rss-5f0becdafd8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/850cccdf06f4</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[documentation]]></category>
            <category><![CDATA[comics]]></category>
            <dc:creator><![CDATA[Alec McEachran]]></dc:creator>
            <pubDate>Fri, 20 Aug 2021 08:45:23 GMT</pubDate>
            <atom:updated>2021-08-20T09:25:09.964Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="At KPV we have been experimenting with writing documentation as comics. They are more engaging and easier to read than written documents, in general. Our domain is visual, so for us this works well, letting us focus on broader themes and ideas and shifting emphasis from the written to the visual medium. Most coders are not natural technical writers, and poorly written documentation can be worse than no documentation at all. We try to do less documentation, better." src="https://cdn-images-1.medium.com/max/1024/1*30-Rt65BVP2EC7MrMgXS0A.png" /><figcaption>Comic Documentation • Page 1</figcaption></figure><figure><img alt="This is not a new idea. We are neither the first to do it, nor the best example. Mozilla and the Google have  good examples. Visual notes augment written note taking at some conferences. Comic-style animations are popular on YouTube. We suggest blocking out what you want to say in visual space, writing short explanations, and then focusing on pictures to give the explanations more context. We point out that you don’t need to be good graphical artists, and encourage people to give it a go." src="https://cdn-images-1.medium.com/max/1024/1*H6h2HaCFhJ8dW_u70ElRxw.png" /><figcaption>Comic Documentation • Page 2</figcaption></figure><p>At <a href="https://www.kpv-lab.co.uk/">KPV Edinburgh</a> we are building the next generation of real-time 3D data visualisation and presentation in the browser. <a href="https://www.kpv-lab.co.uk/jobs/">We are hiring</a>!</p><h3>This comic is available as a PDF</h3><figure><a href="https://drive.google.com/file/d/1gyUgPBvePW8wXB85YpOHKjcNlBTGMK5G/view"><img alt="" src="https://cdn-images-1.medium.com/max/100/1*bRAXFaVRDnh0-i60AB-62A.png" /></a><figcaption>Download PDF Version of this comic</figcaption></figure><h3><strong>Links from this comic</strong></h3><ul><li><a href="https://hacks.mozilla.org/category/code-cartoons/">Articles in &quot;Code Cartoons&quot; - Mozilla Hacks - the Web developer blog</a></li><li><a href="https://cloud.google.com/kubernetes-engine/kubernetes-comic/">Deploy code faster: with CI/CD and Kubernetes | Google Kubernetes Engine (GKE) | Google Cloud</a></li><li><a href="https://inkfactorystudio.com/">Ink Factory Studio: You Talk. We Draw. It&#39;s Awesome™</a></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FCWu29PRCUvQ&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DCWu29PRCUvQ&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FCWu29PRCUvQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d2f61f09b52db67bb689ec3447eec4fe/href">https://medium.com/media/d2f61f09b52db67bb689ec3447eec4fe/href</a></iframe><ul><li><a href="https://xkcd.com/">For the Sake of Simplicity</a></li><li><a href="https://affinity.serif.com/en-gb/">Affinity - Professional Creative Software</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=850cccdf06f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stateful Mouse Drag with RxJS]]></title>
            <link>https://medium.com/@alecmce/stateful-mouse-drag-with-rxjs-58e726b99947?source=rss-5f0becdafd8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/58e726b99947</guid>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[drag-and-drop]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Alec McEachran]]></dc:creator>
            <pubDate>Thu, 26 Apr 2018 16:52:41 GMT</pubDate>
            <atom:updated>2018-08-29T15:18:41.336Z</atom:updated>
            <content:encoded><![CDATA[<p>There are a few RxJs style drag-and-drop observable patterns out there. I enjoyed reading, and stole much of <a href="https://medium.com/u/f2291efe3d02">Juan Herrera</a>’s <a href="https://medium.com/@jdjuan/mouse-drag-with-rxjs-45861c4d0b7e">Mouse Drag with RxJS</a> for this snippet.</p><p>For my use-case, that implementation didn’t expose the state of the drag-and-drop. Sometimes you need to know if a drag is starting, on-going, or stopping. This implementation adds that information.</p><p>The full implementation is here:<br><a href="https://stackblitz.com/edit/typescript-eicaw9">https://stackblitz.com/edit/typescript-eicaw9</a></p><p>These interfaces give you the flavor of what I want: to know where the drag started, where the drag is right now, and whether we’re at the start, middle or end of the drag:</p><pre>export type DragTarget = Document | HTMLElement;</pre><pre>export interface XY {<br>  readonly x: number;<br>  readonly y: number;<br>}</pre><pre>export enum DragState {<br>  START = &#39;start&#39;,<br>  MIDDLE = &#39;middle&#39;,<br>  END = &#39;end&#39;<br>}</pre><pre>export interface Drag {<br>  readonly start: XY;<br>  readonly current: XY;<br>  readonly state: DragState;<br>}</pre><p>The implementation starts by converting events into rxjs streams.</p><pre>const mouseDown = fromEvent(target, &#39;mousedown&#39;).pipe(map(toXY));<br>const mouseMove = fromEvent(document, &#39;mousemove&#39;).pipe(map(toXY));<br>const mouseUp = fromEvent(target, &#39;mouseup&#39;).pipe(map(toXY));</pre><pre>function toXY(event: MouseEvent): XY {<br>  return {x: event.clientX, y: event.clientY};<br>}</pre><p>These streams need to be converted into start, middle and end drag states.</p><pre>const start: Observable&lt;Drag&gt; = mouseDown.pipe(<br>  map((xy) =&gt; ({start: xy, current: xy, state: DragState.START}))<br>);</pre><pre>const middle: Observable&lt;Drag&gt; = mouseDown.pipe(switchMap(<br>  start =&gt; mouseMove.pipe(takeUntil(mouseUp)),<br>  (start, current) =&gt; ({start, current, state: DragState.MIDDLE})<br>));</pre><pre>const end: Observable&lt;Drag&gt; = mouseDown.pipe(switchMap(<br>  start =&gt; mouseUp.pipe(take(1)),<br>  (start, current) =&gt; ({start, current, state: DragState.END})<br>));</pre><p>Finally, the three streams are merged together to produce a drag observable:</p><pre>start.pipe(merge(middle, end));</pre><p>In my opinion, this is an elegant solution with some improvements from others that I’ve seen online. As with all RxJS, I imagine that is a better way to do it! Can you do it more elegantly? Or faster?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58e726b99947" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>