<?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 emily leung on Medium]]></title>
        <description><![CDATA[Stories by emily leung on Medium]]></description>
        <link>https://medium.com/@emilyleung?source=rss-4efb1b923054------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*E89gbyx7XJlVB_48l3LsZw.jpeg</url>
            <title>Stories by emily leung on Medium</title>
            <link>https://medium.com/@emilyleung?source=rss-4efb1b923054------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 05:43:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@emilyleung/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[NOTE: Precedents]]></title>
            <link>https://medium.com/projectavalanche/0002-precedents-be69374f2063?source=rss-4efb1b923054------2</link>
            <guid isPermaLink="false">https://medium.com/p/be69374f2063</guid>
            <category><![CDATA[computational-design]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[side-project]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[emily leung]]></dc:creator>
            <pubDate>Thu, 30 Nov 2017 01:16:45 GMT</pubDate>
            <atom:updated>2018-03-21T03:19:01.170Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0to9G5S5jIHjZc5xmVJLXA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/photos/1qkyck-UL3g?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">James Pond</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>NOTE: 0002 — Wednesday 29th November 2017</p><p>As part of the process, 7 hours will be dedicated to research and application.</p><h3>WEEK 0001: Thursday 23rd November 2017</h3><p>Hours: 8 (9AM — 5PM)</p><p>The first day was spent in brainstorming possible workarounds on achieving a workflow / application that would allow for allow for visual scripting applications in architecture be accessible on the web.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T-usnbZ7FIw-6EzYyYkJew.jpeg" /></figure><p>More specifically, a platform for collaboration. Instead of modelling, we replace that method with the process of programming logic to a building.</p><p>There were a number of things I stumbled upon during this research process:</p><p>Title: Collaborative Code Editor for Developing at an Urban Scale</p><ul><li>Three.js</li><li>Python</li><li>Code Editor</li><li>Open-source components</li></ul><p>Examples:</p><ul><li><a href="https://github.com/jzitelli/three.py"><strong>three.py</strong></a> — “Utilities for integrating Python with three.js.”</li><li><a href="https://github.com/jovyan/pythreejs"><strong>Pythreejs</strong></a><br>- “A Python / ThreeJS bridge utilizing the Jupyter widget infrastructure.”<br>- Requires the installation of <a href="https://github.com/BurntSushi/nfldb/wiki/Python-&amp;-pip-Windows-installation">python and pip</a><br>- The python arrangement is note closely compatible with Python for Rhinoceros</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*cBGd4txEUH2rmYXr8jlWXg.gif" /></figure><p>There would be two parts of the workflow that could potentially assist in creating this one large project:</p><ol><li>Python to Three.js<br>- Processing Python using JavaScript<br>- Processing Python script to Three.js Geometry</li><li>Web-based Code Editor<br>- Storying, accessing and editing from a repository (Github)<br>- Live?</li></ol><p>The resulting research into these options looks like it may be easier to create Rhinoceros as a server, which is then piped through to the web application.</p><blockquote>© Emily Y Leung and Project Avalanche, 2017. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Emily Y Leung and Project Avalanche with appropriate and specific direction to the original content.</blockquote><p>Last modified on Thursday 30th November 2017</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be69374f2063" width="1" height="1" alt=""><hr><p><a href="https://medium.com/projectavalanche/0002-precedents-be69374f2063">NOTE: Precedents</a> was originally published in <a href="https://medium.com/projectavalanche">PROJECT AVALANCHE</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NOTE: Evaluating REDBACK BIM]]></title>
            <link>https://medium.com/scratch-pad-3201-3202/note-evaluating-redback-bim-8169a230703d?source=rss-4efb1b923054------2</link>
            <guid isPermaLink="false">https://medium.com/p/8169a230703d</guid>
            <category><![CDATA[notebook]]></category>
            <category><![CDATA[field-notes]]></category>
            <category><![CDATA[project-thesis]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[computational-design]]></category>
            <dc:creator><![CDATA[emily leung]]></dc:creator>
            <pubDate>Tue, 24 Oct 2017 06:32:53 GMT</pubDate>
            <atom:updated>2017-10-24T06:32:53.010Z</atom:updated>
            <content:encoded><![CDATA[<p>NOTE: 0020 — Tuesday 24 October 2017</p><p>REDBACK BIM will eventually seek to enter into the world of Flux web applications. Below is a screenshot of its logo design and label when situated in Flux.io.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JRnhCKHr9PaRkBTI8hJKlw.png" /><figcaption>Flux.io Web Applications</figcaption></figure><p>There are of course still matters of where it stands as a finalised product (mainly because it is an open-source product), the constraints and limitations are listed below:</p><h3>Constraints + Limitations:</h3><ul><li>Better performance with low poly count — approx 4500 faces. Is not lightweight for some reason. Smaller the better (0.1 scale factor), less polys the better (under 4500 potentially in total per key)</li><li>Has yet to define an object’s name — must be entered in manually within the JSON string. Cannot select to preview attached section of JSON string</li><li>Users must understand how<strong> JSON structure works + Flux JSON schema</strong> to add values. I.e. custom attributes and colours/transparency. If entered incorrectly, the object would not be understood as geometry and will be defined it as invalid</li><li>Grouping objects into scenes is yet to be found</li><li>Lag in interface for loading / interacting with objects in the Flux Viewport — unaware of the issue that is happening here</li><li>Tends to crash inconsistently — it could be an internet thing (bad/low quality connection)</li><li>In order to add more geometry to a key, it must be in an array of objects or defined within a scene. Not sure how we can restructure the JSON yet.</li><li>Is ideal to have grouped geometries (1 mesh per object) but that means that customisation on colours and details is difficult to achieve</li><li>Delayed orbiting and editing requires time for it to fully function at ideal speed. Unsure why this is occurring. Could it be because it’s not published to the web? As in it’s using localhost or is it the internet connection?</li><li>Would be fantastic to include an input text area for users to add in additional JSON strings for more objects in space. But then how could you add it into an array? Or scene object?</li><li>Limitations in terms of JSON schema only reading things like the origin — if you think about how to position a door, it would require the bottom face of a rectangular prism, otherwise the door’s centre would need to be calculated to find the ideal position.</li><li>Classification of objects for BIM</li><li>You can build your own JSON schema for Flux, however with lack of knowledge on how to implement that, it meant that you’re again <strong>restricted </strong>to follow their guidelines.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yV-9xlJCGVgukte7j6ovgw.png" /><figcaption>Tuesday 24 October 2017</figcaption></figure><p>At the moment, when you select an object or geometry, it console.logs the JSON string of the selected. We could create a new key that can collect the JSON for whatever objects that are selected?</p><blockquote>© Emily Y Leung and Project Redback, 2017. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Emily Y Leung and Project Redback with appropriate and specific direction to the original content.</blockquote><p>Last modified on Tuesday 24 October 2017</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8169a230703d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/scratch-pad-3201-3202/note-evaluating-redback-bim-8169a230703d">NOTE: Evaluating REDBACK BIM</a> was originally published in <a href="https://medium.com/scratch-pad-3201-3202">PROJECT REDBACK</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NOTE: Telling the Story from the Beginning]]></title>
            <link>https://medium.com/scratch-pad-3201-3202/note-telling-the-story-from-the-beginning-bd875aa7a306?source=rss-4efb1b923054------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd875aa7a306</guid>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[computational-design]]></category>
            <category><![CDATA[field-notes]]></category>
            <category><![CDATA[notebook]]></category>
            <category><![CDATA[project-thesis]]></category>
            <dc:creator><![CDATA[emily leung]]></dc:creator>
            <pubDate>Mon, 23 Oct 2017 08:54:11 GMT</pubDate>
            <atom:updated>2017-10-23T09:09:29.885Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1dSyMraS4SOjnonKXCzdJg.png" /><figcaption>Diagram from my Sketchbook of Project REDBACK logo design</figcaption></figure><p>NOTE: 0019 — Monday 23 October 2017</p><p>It has been a while since I have posted on Medium in regards to the process of my Graduation Thesis Research Project. With lack of time to slowly build up this documentation, I’ve decided to compile a timeline within this post to encapsulate the process from its early stage up until today.</p><p>To start, the initial idea in terms of an end goal was to <strong>create a BIM reporting tool that could redefine how documentation could be viewed when decentralised onto a platform for model interrogation</strong>. An example of such a tool was inspired by the work of CL3VER — an interactive 3D presentation software.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*neq8dsa0bs9D7toH43Q_gA.png" /><figcaption><a href="https://www.foro3d.com/attachments/193879d1400506650-cl3ver-visualizacion-3d-interactiva-bim-green-tower-demo-05-05-2014-edit.png">https://www.foro3d.com/attachments/193879d1400506650-cl3ver-visualizacion-3d-interactiva-bim-green-tower-demo-05-05-2014-edit.png</a></figcaption></figure><p>Above is an screenshot of the final presentation from using Cl3VER which requires the use of their software to realise the interaction and storytelling process.</p><p>Instead of using the actual program they provide (which requires subscription to), <strong>I would aim to create a free alternative in creating the same results on the web as there are alternatives to generating interactive models.</strong></p><p>With this idea in mind, I looked heavily into creating such scenes using open-source libraries as A-Frame to present models on the web. Prerequisites for learning A-Frame include:</p><ul><li>HTML</li><li>CSS</li><li>JavaScript</li><li>3D modelling software (to understand exporting modelling file types)</li></ul><p>I’ve posted my process earlier in this publication as shown:</p><ul><li><a href="https://medium.com/scratch-pad-3201-3202/note-a-frame-basics-b6d614b2f3ee">NOTE: A-Frame Basics</a></li><li><a href="https://medium.com/scratch-pad-3201-3202/note-the-prototyping-process-def0404d37d5">NOTE: The Prototyping Process</a></li><li><a href="https://medium.com/scratch-pad-3201-3202/note-setting-a-scene-in-a-frame-c45b298b3720">NOTE: Setting a Scene in A-Frame</a></li><li><a href="https://medium.com/scratch-pad-3201-3202/note-building-interactivity-in-a-frame-825c719d39cc">NOTE: Building Interactivity in A-Frame</a></li><li><a href="https://medium.com/scratch-pad-3201-3202/note-adding-data-to-objects-in-a-frame-part-a-feddfbb79536">NOTE: Adding Data to Objects in A-Frame — Part A</a></li><li><a href="https://medium.com/scratch-pad-3201-3202/note-adding-data-to-objects-in-a-frame-part-b-a03befb4ef71">NOTE: Adding Data to Objects in A-Frame — Part B</a></li><li><a href="https://medium.com/scratch-pad-3201-3202/note-building-buttons-for-a-frame-ea46fad0cfef">NOTE: Building Buttons for A-Frame</a></li></ul><p>The process had led me to understand how to build interactive A-Frame scenes which could attach data to objects when clicked to view. Time was still well spent as it was considered the first of two parts in my first prototype exploration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ohvIOyc7Cysnx2KRdPerag.png" /><figcaption>Friday 01 September 2017</figcaption></figure><p>Prototype 1-A (A-Frame scene) was still without a doubt very useful for presentation related outcomes for architects to tell their story. HOWEVER, what I realised throughout this process was that such tools, even the one CL3VER provides, are useful for final collective scenarios of collating data but are not ideal in real world scenarios. More specifically what I mean by this is that a project within the architecture, engineering and construction (AEC) industry revolves the matter of constantly re-framing, reiterating and redesigning the end building. In order to keep up with this process, it is essential to look for much faster and effective ways of documentation.</p><p>In the next post, I referred to this idea and elaborated on potential ways to solve this issue: <a href="https://medium.com/scratch-pad-3201-3202/note-where-to-from-here-1e3d0cd04c6">NOTE: Where to from here?</a></p><p>The successful outcomes and problems of the A-Frame scene were noted down in this particular post and derived the need for real-time changes to be the underlying factor to achieve a fundamental shift in architectural practice. This led to understanding how Flux.io can play a role in assisting with achieving real-time changes to 3D geometry on the web.</p><p>Below was the result of a conversation I had with my industry partners in an attempt to resolve the issue with implementation of Flux.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UDAHIcn6DnhtMfBjpp5krg.jpeg" /><figcaption>Thursday 03 August 2017</figcaption></figure><p>The diagram is broken down as such:</p><ul><li>A database is used to store all the objects inside a building information model where each item is catalogued with attributes</li><li>The object’s geometry data is passed through to Flux and presented on a web application built using A-Frame (my role in the process) and the end user is able to view the attributes from the database as well as edit the data/geometries directly in the interface. This will be synchronised through Flux and updated in the database (a CRUD spreadsheet — create, read, update and delete).</li></ul><p>It was from the discussion that I attempted to follow Flux’s SDK documentation to build their default application (as a starting off point) into realising the real-time relationships of updated geometries.</p><blockquote>In essence, it was to allow for the data of geometries to be piped directly from Flux into A-Frame for real-time editing.</blockquote><p>This is demonstrated in the post: <a href="https://medium.com/scratch-pad-3201-3202/note-starting-with-flux-64abd3ee4b19">NOTE: Starting with Flux</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jtYGDPLdn3W9cU_nTaGx3A.png" /><figcaption>Monday 28 August 2017</figcaption></figure><p>The result of this exploration — Prototype 1B (shown above) proved that we could without a doubt develop the product further for collaboration and interaction (as it was more of a model viewer who can update integer data values.</p><p>The concept of hosting live geometry on the web was derived in this workflow diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gYc-NvtLg0YF-4rBSonD-g.png" /><figcaption>Tuesday 29 August 2017</figcaption></figure><p>What is happening in the diagram is a breakdown process of sending a model from an external server to the web via Flux. Through that process a script will continuously loop to break down the model into data that is readable for the web platform as well as the database. The changes made by the user on the web platform are tracked and synchronised back to the database through Flux. Flux has the ability to synchronise back to the original model on the external server.</p><p>What was realised later on from this workflow diagram is the idea that the model is still seen as an external product. When sending back to the model, you are in fact duplicating the model and the changes made on the model externally aren’t synchronised instantaneously — which is a problem for real-time collaboration.</p><p><strong>What do I mean by this?</strong></p><p>We are all familiar with the collaborative example of Google Docs.</p><p>It is a web application that allows for multiple users to edit a word document on their web browser. Any changes made by a user, others will see too at the same time. This is what makes the internet very powerful.</p><blockquote>What if the 3D model was a collaborative document?</blockquote><p>My research project aims to suggest the possibility that this should exist. It already does in other forms such as live documentation (Google Docs) as well as online multiplayer games (Minecraft). Technologies such as verbal communication, emails and file sharing services are the alternatives practitioners use to close the communication gap about model changes. This is an ineffective and time consuming process that results with the duplication of files and repetitive method of synchronising parts of a model to be up to date.</p><p>The next step from having understood the successes and faults of the initial prototype (Prototype 1A — A-Frame Scene + Prototype 1B — Flux Default Application) was through another conversation with Kyle from Flux.io. The conversation started because from exploring Flux previously, we’ve noted down that the viewport they use, uses Three.js library. Three.js is a library that can create 3D geometries on the web and is the backbone of A-Frame. Flux had actually used the open-source library (Three.js) and developed it further to customise their standard look and interaction called ‘Flux Viewport’ which allowed them to also create their own JSON schema.</p><p>Let me rephrase that paragraph by starting off with how we should look at this scenario:</p><ul><li>3D geometries on the web are made up of JSON strings (that hold properties of a geometry — such as dimensions, origins, vertices, colours, etc)</li><li>The JSON string of a geometry is different to that of Flux because of the fact that Flux had included their own JSON schema in order to simplify how it reads the data. This is explained further in this post: <a href="https://medium.com/scratch-pad-3201-3202/note-flux-sample-app-review-85268b27d482">NOTE: Flux Sample App Review</a></li><li>What we wanted to do from here was revert it back to the Three.js JSON so that we could pipe it straight into a Three.js / A-Frame scene because we would then be able to customise the interaction of the geometries in our own viewport</li><li>This was when I emailed Kyle from Flux in regards to being able to generate the Three.js JSON of the same geometry. He provided a react application which he put together found here: <a href="https://github.com/flux-labs/flux-three-json">https://github.com/flux-labs/flux-three-json</a> and successfully demonstrated the possibilities</li></ul><p>After reviewing the application, I needed to regain a sense of how the application was put together. Through my research of learning React which is seen here, <a href="https://medium.com/scratch-pad-3201-3202/note-learn-react-part-1-3e8f03e6cb26">NOTE: Learn React — Part 1</a>, it turns out that React was the perfect platform to create a web application because:</p><blockquote><em>React really shines when your data changes over time.</em></blockquote><p>I then built sample elements through following tutorials for React, which I further described in <a href="https://medium.com/scratch-pad-3201-3202/note-interactivity-in-react-2d0be313c40a">NOTE: Interactivity in React— Part 2</a>.</p><p>After understanding how to build the parts of React, I used Kyle’s Flux-Three-JSON React application as the basis for the entire application. What I had learnt from the React tutorials also allowed me to create elements for my Flux projects and keys, which are displayed on the left of my application (shown below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b8YDtyfvc508lO9hidH7-w.png" /><figcaption>Wednesday 20 September 2017</figcaption></figure><p>The initial step when developing further the React Application that Kyle — the Flux engineer put together, was to successfully implement the same features as defined in the Flux SDK tutorial. It was an unusual process when translating HTML and JavaScript to React elements. The interesting part of the process was determining states within the elements. This being the underlying feature that allowed me to stay in control of the application.</p><p>Once the elements were in place, it was a matter of correlating the submission buttons and input values to speak with Flux.</p><p>Below are some of the functions implemented to each of the elements which were prevalent in the SDK tutorial. So there is some similar processes because React does use the exact same JavaScript functions for its elements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*LtZiCW-TBkQD4d1jkE1e_A.png" /><figcaption>Functions from Flux helpers.js</figcaption></figure><p>Now that I was able to view Flux geometries, create keys as well as update the value of its keys (as shown below), it meant that I could start to edit the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pnR72iPUZJMwOYjP0xwvMg.png" /><figcaption>Friday 29 September 2017</figcaption></figure><p>More specifically, through developing the default Flux Application using the Flux SDK tutorial, I picked up the possibility of adding custom attributes to any geometry by including it in it’s JSON string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*-rUTcF_j7BsYLxhsBwPgUg.png" /><figcaption><a href="https://flux.gitbooks.io/flux-javascript-sdk/content/tutorial/Chapter-4.html#custom-attributes">https://flux.gitbooks.io/flux-javascript-sdk/content/tutorial/Chapter-4.html#custom-attributes</a></figcaption></figure><p>I decided to test it out by editing the sphere’s JSON string in the same project using Flux Flow (shown below). It can store the edited data into a new key, but is this necessary? In fact do we need Flux Flow altogether to be able to edit the JSON string?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6XynHBO5qUTK57GcE2Ge0g.png" /><figcaption>Thursday 05 October 2017</figcaption></figure><p>After discussing further with my industry partners, it is clear that what would be really beneficial is to make the application as user friendly as possible and be able to add/edit/delete additional data to an object. By looking directly at modifying the geometry’s JSON string, we could potentially resolve this issue. More specifically, we could break down a JSON string into a data table that is editable for users of the application (sketch shown below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZMzSQgMcNiN6ZI-ULXJ7OQ.jpeg" /><figcaption>Wednesday 18 October 2017</figcaption></figure><p>What I hypothesised the process to be was:</p><ul><li>Obtain JSON string of geometry from Flux</li><li>Display the geometry as a table in the web application</li><li>Edit the data table in the web application</li><li>Push the newly edited table as a new JSON string to Flux</li><li>Override/update JSON data — updates geometry in Flux</li></ul><p>Below is an interactive application that allows the selected geometry’s JSON string to be shown as a table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MNQ8-ZbjL-basaoP-y7DJQ.png" /></figure><p><a href="http://www.encodedna.com/javascript/populate-json-data-to-html-table-using-javascript.htm">http://www.encodedna.com/javascript/populate-json-data-to-html-table-using-javascript.htm</a></p><p>Using the above link as a guide, I was able to populate a HTML table in the application, so that whenever any geometry was selected in the viewport, it would generate the selected geometry’s JSON string into the table. However, a problem with this method is that the nested data could not be displayed. Instead it appears as [object object] and this was a problem if I wanted to edit it. It is also a HTML element and not a React element, which is problematic for setting and updating states.</p><p>After reviewing possible ways of viewing and editing JSON through React, I came across a few JSON tree editors:</p><h4>riek — <a href="https://github.com/kaivi">kaivi</a></h4><p><a href="https://github.com/kaivi/riek">https://github.com/kaivi/riek</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*SAdlbNlP-8vZJ3pRLrxBPg.png" /><figcaption><a href="http://kaivi.github.io/riek/">http://kaivi.github.io/riek/</a></figcaption></figure><p>Riek’s demo was what drew me in to try it out. However, as I had very little knowledge in incorporating other people’s components, I found riek difficult as it did not include an example script.</p><h4>react-json-view — <a href="https://github.com/prodhan29">prodhan29</a></h4><p><a href="https://github.com/prodhan29/react-treeview-component">https://github.com/prodhan29/react-treeview-component</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*tQqp9XU9337kn_GaN9GVcA.png" /><figcaption><a href="https://prodhan29.github.io/react-treeview-component/">https://prodhan29.github.io/react-treeview-component/</a></figcaption></figure><p>This particular component lacked documentation for me to successfully implement the feature. I realised when I applied react-json-view that I understood the problem — requires a callback function.</p><h4>react-treeview-component — <a href="https://github.com/mac-s-g">mac-s-g</a></h4><p><a href="https://github.com/mac-s-g/react-json-view#onedit-onadd-and-ondelete-interaction">https://github.com/mac-s-g/react-json-view#onedit-onadd-and-ondelete-interaction</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*w5dI8cfVeDE3GyXQa9F-Fg.png" /><figcaption><a href="https://mac-s-g.github.io/react-json-view/demo/dist/">https://mac-s-g.github.io/react-json-view/demo/dist/</a></figcaption></figure><p>The one linked above was the component I implemented successfully in the application. I had success with this particular one because of the amount of effort put into documenting how to use it.</p><p>I was able to view the selected Key’s data on the JSON tree as well as edit it, but I could not edit the data of that JSON until I pushed the edited JSON back. This was the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KJtd7o2K2XRdi8LsE7a9yA.png" /><figcaption>Rendered React component by <a href="https://github.com/mac-s-g">mac-s-g</a> in Project REDBACK</figcaption></figure><p>The script below is a callback function, when the JSON tree is edited, this function is called to update the state of the data and the object (which is the JSON tree’s input JSON value), the Flux cell value is also updated with the edited JSON string as well as the Flux viewport’s geometry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*jXbax10DIkoj1MEp7iFmFA.png" /><figcaption>Callback function used to change the JSON tree and Flux geometry state</figcaption></figure><p>The limitations of this process of using Flux is its inability to create geometry directly from the application. My understanding for this is that:</p><ul><li>You can input data into the Flux Flow</li><li>However it must be serialized as a JSON string and parsed as a JSON object as shown below before it can be a Flux geometry</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AkHNRIx-W7ZlKHqy5FB0tw.png" /><figcaption>Monday 23 October 2017</figcaption></figure><p>Once the data is set up in Flux, the JSON is readily editable on the web application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*87Qa8tPO4OwboOSvUiFFhg.png" /><figcaption>Monday 23 October 2017</figcaption></figure><p>The ending result is a web application that is able to access Flux:</p><ul><li>Your Flux projects</li><li>Your Flux Keys</li><li>Your Flux Data</li></ul><p>Once we were able to access the JSON data of the geometry from the keys and pipe that through into an editable JSON tree viewer, we could override the attributes and update it back to Flux.</p><p>This proof of concept shows that we can edit models in real time as collaborative documents on the web.</p><blockquote>© Emily Y Leung and Project Redback, 2017. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Emily Y Leung and Project Redback with appropriate and specific direction to the original content.</blockquote><p>Last modified on Monday 23 October 2017</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd875aa7a306" width="1" height="1" alt=""><hr><p><a href="https://medium.com/scratch-pad-3201-3202/note-telling-the-story-from-the-beginning-bd875aa7a306">NOTE: Telling the Story from the Beginning</a> was originally published in <a href="https://medium.com/scratch-pad-3201-3202">PROJECT REDBACK</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[M-NOTE: Gists]]></title>
            <link>https://medium.com/scratch-pad-3201-3202/m-note-gists-34086d7eb291?source=rss-4efb1b923054------2</link>
            <guid isPermaLink="false">https://medium.com/p/34086d7eb291</guid>
            <category><![CDATA[miscellaneous]]></category>
            <category><![CDATA[field-notes]]></category>
            <category><![CDATA[computational-design]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[project-thesis]]></category>
            <dc:creator><![CDATA[emily leung]]></dc:creator>
            <pubDate>Wed, 04 Oct 2017 02:14:10 GMT</pubDate>
            <atom:updated>2017-10-04T02:29:27.088Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*brAd2n-kQ92KLnfRPZSjww.png" /></figure><p>M-NOTE: 0009— Sunday 17 September 2017</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplayer.vimeo.com%2Fvideo%2F1381658&amp;dntp=1&amp;url=https%3A%2F%2Fvimeo.com%2F1381658&amp;image=https%3A%2F%2Fi.vimeocdn.com%2Fvideo%2F58532511_295x166.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=vimeo" width="504" height="380" frameborder="0" scrolling="no"><a href="https://medium.com/media/f5258ba35ca43600f31575bc6e16944c/href">https://medium.com/media/f5258ba35ca43600f31575bc6e16944c/href</a></iframe><blockquote>© Emily Y Leung and Project Redback, 2017. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Emily Y Leung and Project Redback with appropriate and specific direction to the original content.</blockquote><p>Last modified on Sunday 17 September 2017</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34086d7eb291" width="1" height="1" alt=""><hr><p><a href="https://medium.com/scratch-pad-3201-3202/m-note-gists-34086d7eb291">M-NOTE: Gists</a> was originally published in <a href="https://medium.com/scratch-pad-3201-3202">PROJECT REDBACK</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[M-NOTE: Three.js + Firebase]]></title>
            <link>https://medium.com/scratch-pad-3201-3202/m-note-three-js-firebase-dbf43eb753b6?source=rss-4efb1b923054------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbf43eb753b6</guid>
            <category><![CDATA[computational-design]]></category>
            <category><![CDATA[project-thesis]]></category>
            <category><![CDATA[field-notes]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[miscellaneous]]></category>
            <dc:creator><![CDATA[emily leung]]></dc:creator>
            <pubDate>Wed, 04 Oct 2017 02:12:08 GMT</pubDate>
            <atom:updated>2017-10-04T02:29:14.336Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*brAd2n-kQ92KLnfRPZSjww.png" /></figure><p>M-NOTE 0008 — Monday 25 September 2017</p><h3>What is Three.js?</h3><p>Three.js is an open-source JavaScript 3D library used to build interactive scenes on the web.</p><h3>What is Firebase?</h3><p>Firebase is a mobile and web application development platform used for backend data management and multiplayer use.</p><h3>PROCESS</h3><h4>STEP 1 —Setting up a Three.js Multiplayer Game</h4><p>Setting up a scene in Three.js to accommodate multiplayers is ever so slightly different and so the process must be managed with a close eye. We’ll first start with the basic setup of files:</p><ul><li><strong>Index.html</strong></li><li><strong>css/Main.css</strong></li><li><strong>js/Main.js</strong></li><li><strong>js/three.js</strong> — referenced file from Three.js or can be a minified link: <a href="https://cdnjs.cloudflare.com/ajax/libs/three.js/87/three.min.js">https://cdnjs.cloudflare.com/ajax/libs/three.js/87/three.min.js</a></li></ul><p>Each file serves its own specific purpose:</p><ul><li><strong>Index.html </strong>— web page structure with referenced scripts</li><li><strong>Main.css</strong> — web page visual markup</li><li><strong>Main.js</strong> — sets up the Three.js scene using the main functions (init, animate, render and onWindowResize)</li></ul><h4>STEP 2 — Setup Index.html file</h4><p>This is where we hold:</p><ol><li>html document setup</li></ol><pre>&lt;!doctype html&gt;<br>&lt;html&gt;<br>  &lt;head&gt;<br>    <br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    <br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><p>2. Title of scene (head)</p><pre>&lt;title&gt;3D Multiplayer Game&lt;/title&gt;</pre><p>3. Stylesheet reference (head)</p><pre>&lt;link rel=&quot;stylesheet&quot; href=&quot;css/Main.css&quot; /&gt;</pre><p>4. Three.js file reference (head)</p><pre>&lt;script src=&quot;<a href="https://cdnjs.cloudflare.com/ajax/libs/three.js/87/three.min.js">https://cdnjs.cloudflare.com/ajax/libs/three.js/87/three.min.js</a>&quot;&gt;&lt;/script&gt;</pre><p>5. Player Controls file reference (head)</p><pre>&lt;script src=&quot;js/lib/PlayerControls.js&quot;&gt;&lt;/script&gt;</pre><p>6. Div that holds the scene (body)</p><pre>&lt;div id=&quot;container&quot;&gt;&lt;/div&gt;</pre><p>7. JavaScripts that we will write (body)</p><pre>&lt;script src=&quot;js/Player.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;js/Game.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;js/Main.js&quot;&gt;&lt;/script&gt;</pre><p>The resulting script at this stage of the tutorial for Index.html:</p><pre>&lt;!doctype html&gt;<br>&lt;html&gt;<br>  &lt;head&gt;<br>    &lt;title&gt;3D Multiplayer Game&lt;/title&gt;<br>    &lt;link rel=&quot;stylesheet&quot; href=&quot;css/Main.css&quot; /&gt;<br>    &lt;script src=&quot;<a href="https://cdnjs.cloudflare.com/ajax/libs/three.js/87/three.min.js">https://cdnjs.cloudflare.com/ajax/libs/three.js/87/three.min.js</a>&quot;&gt;&lt;/script&gt;<br>    &lt;script src=&quot;js/lib/PlayerControls.js&quot;&gt;&lt;/script&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;div id=&quot;container&quot;&gt;&lt;/div&gt;<br>    &lt;script src=&quot;js/Player.js&quot;&gt;&lt;/script&gt;<br>    &lt;script src=&quot;js/Game.js&quot;&gt;&lt;/script&gt;<br>    &lt;script src=&quot;js/Main.js&quot;&gt;&lt;/script&gt;<br>  &lt;/body&gt;<br>&lt;/html&gt;</pre><h4>STEP 3 — Setting up the Three.js Scene</h4><p><a href="https://github.com/PiusNyakoojo/PlayerControls">https://github.com/PiusNyakoojo/PlayerControls</a></p><h4>STEP X — Make a project in Firebase</h4><blockquote>© Emily Y Leung and Project Redback, 2017. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Emily Y Leung and Project Redback with appropriate and specific direction to the original content.</blockquote><p>Last modified on Monday 25 September 2017</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbf43eb753b6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/scratch-pad-3201-3202/m-note-three-js-firebase-dbf43eb753b6">M-NOTE: Three.js + Firebase</a> was originally published in <a href="https://medium.com/scratch-pad-3201-3202">PROJECT REDBACK</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NOTE: Interactivity in React — Part 2]]></title>
            <link>https://medium.com/scratch-pad-3201-3202/note-interactivity-in-react-2d0be313c40a?source=rss-4efb1b923054------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d0be313c40a</guid>
            <category><![CDATA[notebook]]></category>
            <category><![CDATA[project-thesis]]></category>
            <category><![CDATA[computational-design]]></category>
            <category><![CDATA[field-notes]]></category>
            <category><![CDATA[architecture]]></category>
            <dc:creator><![CDATA[emily leung]]></dc:creator>
            <pubDate>Wed, 04 Oct 2017 02:08:53 GMT</pubDate>
            <atom:updated>2017-10-04T02:09:11.519Z</atom:updated>
            <content:encoded><![CDATA[<p>NOTE: 0018 — Wednesday 13 September 2017</p><p>Now that we are able to build components into a React App. We should now look into creating user interface components. This will follow through to realising the potential of connecting it with an external API. It may or may not be explained in this post or the next.</p><h3>PROCESS</h3><h4>STEP 1 — Create a new Component in the ‘Components’ folder</h4><p>We’re going to start with creating a component that allows us to add new projects in the list of already defined projects. Almost the equivalent of a To-do-list!</p><p>To start, in the ‘Components’ folder, create a new file — ‘<strong>AddProject.js</strong>’</p><h4>STEP 2 — Add in the backbone</h4><p>Now copy over the lines of code we produced in ‘Projects.js’ to ‘AddProject.js’. Make sure to remove:</p><ul><li>the imported ‘ProjectItem’ component</li><li>the lines of code between the ‘render’ and ‘return’ function to create a clean slate</li><li>and replace ‘Projects’ with ‘AddProject’</li></ul><h4>STEP 3 — Import the AddProject component into App.js</h4><pre>import AddProject from &#39;./Components/AddProject&#39;;</pre><p>To add it into the App, situate the element at the top of the application.</p><pre>render() {<br>    return (<br>      &lt;div className=&quot;App&quot;&gt;<br>       <strong> &lt;AddProject /&gt;</strong><br>        &lt;Projects projects={this.state.projects} /&gt;<br>      &lt;/div&gt;<br>    );<br>  }<br>}</pre><p>To test that it works, we will add in some visible text in an empty div (with no className) in the render function within ‘<strong>AddProject.js</strong>’:</p><pre>import React, { Component } from &#39;react&#39;;</pre><pre>class AddProject extends Component {<br>  render() {<br>    return (<br>      &lt;div&gt;<br>        <strong>&lt;h3&gt;Add Project&lt;/h3&gt;</strong><br>      &lt;/div&gt;<br>    );<br>  }<br>}</pre><pre>export default AddProject;</pre><p>Check back on the app to see if it’s visible. If it works, let’s add in a space to input data by creating a form:</p><pre>import React, { Component } from &#39;react&#39;;</pre><pre>class AddProject extends Component {<br>  render() {<br>    return (<br>      &lt;div&gt;<br>        &lt;h3&gt;Add Project&lt;/h3&gt;<br>        <strong>&lt;form&gt;<br>          &lt;div&gt;<br>            &lt;label&gt;Title&lt;/label&gt;&lt;br /&gt;<br>            &lt;input type=&quot;text&quot; ref=&quot;title&quot; /&gt;<br>          &lt;/div&gt;<br>        &lt;/form&gt;</strong><br>      &lt;/div&gt;<br>    );<br>  }<br>}</pre><pre>export default AddProject;</pre><p>Then to make things interesting, let’s ask for the categories to come out as a dropdown. That way we limit the types of categories the user can enter by using a &lt;select&gt; element.</p><pre>import React, { Component } from &#39;react&#39;;</pre><pre>class AddProject extends Component {<br>  render() {<br>    return (<br>      &lt;div&gt;<br>        &lt;h3&gt;Add Project&lt;/h3&gt;<br>        &lt;form&gt;<br>          &lt;div&gt;<br>            &lt;label&gt;Title&lt;/label&gt;&lt;br /&gt;<br>            &lt;input type=&quot;text&quot; ref=&quot;title&quot; /&gt;<br>          &lt;/div&gt;<br><strong>          &lt;div&gt;<br>            &lt;label&gt;Category&lt;/label&gt;&lt;br /&gt;<br>            &lt;select ref=&quot;category&quot;&gt;<br>              <br>            &lt;/select&gt;<br>          &lt;/div&gt;</strong><br>        &lt;/form&gt;<br>      &lt;/div&gt;<br>    );<br>  }<br>}</pre><pre>export default AddProject;</pre><p>I want to categories to be a property component. To do this, we need to first set up some static defaultProps:</p><pre>class AddProject extends Component {<br><strong>  static defaultProps = {<br>    categories: [&#39;Web Design&#39;, &#39;Web Development&#39;, &#39;Mobile Development&#39;]<br>  }</strong></pre><p>We’ll then need to grab the options and map through them, so that they pump out as one category per option.</p><pre>render() {<br>    <strong>let categoryOptions = this.props.categories.map(category =&gt; {<br>      return &lt;option key={category} value=&quot;category&quot;&gt;{category}&lt;/option&gt;<br>    });</strong></pre><p>Now, in our select element, we can now insert the categoryOption property into the dropdown menu to be selected:</p><pre>import React, { Component } from &#39;react&#39;;</pre><pre>class AddProject extends Component {<br>  static defaultProps = {<br>    categories: [&#39;Web Design&#39;, &#39;Web Development&#39;, &#39;Mobile Development&#39;]<br>  }</pre><pre>render() {<br>    let categoryOptions = this.props.categories.map(category =&gt; {<br>      return &lt;option key={category} value=&quot;category&quot;&gt;{category}&lt;/option&gt;<br>    });<br>    return (<br>      &lt;div&gt;<br>        &lt;h3&gt;Add Project&lt;/h3&gt;<br>        &lt;form&gt;<br>          &lt;div&gt;<br>            &lt;label&gt;Title&lt;/label&gt;&lt;br /&gt;<br>            &lt;input type=&quot;text&quot; ref=&quot;title&quot; /&gt;<br>          &lt;/div&gt;<br>          &lt;div&gt;<br>            &lt;label&gt;Category&lt;/label&gt;&lt;br /&gt;<br>            &lt;select ref=&quot;category&quot;&gt;<br>              <strong>{categoryOptions}</strong><br>            &lt;/select&gt;<br>          &lt;/div&gt;<br>        &lt;/form&gt;<br>      &lt;/div&gt;<br>    );<br>  }<br>}</pre><pre>export default AddProject;</pre><p>Now, to submit the form, we need to add a submit button.</p><pre>&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;</pre><p>The add in the existing form tag a handler called ‘onSubmit’.</p><pre>&lt;form onSubmit={this.handleSubmit}&gt;</pre><p>Then make sure to bind the change to the submit button.</p><pre>&lt;form onSubmit={this.handleSubmit<strong>.bind(this)</strong>}&gt;</pre><p>Of course, the handleSubmit function doesn’t exist, so we’ll need to create that right above the render function:</p><pre>handleSubmit() {<br>    console.log(&#39;Submitted&#39;);<br>}</pre><p>Those specific lines of code won’t do anything until we make sure to include the event:</p><pre>handleSubmit(e) {<br>    console.log(&#39;Submitted&#39;);<br>    e.preventDefault();<br>}</pre><p>The ‘e.preventDefault( );’ actually prevents the form from actually submitting, but allows us to see the console.log action happen.</p><h4>STEP 4 — App to store the changes made in submitting data</h4><p>In order to start this, we need to create a constructor method and define the initial state:</p><pre>class AddProject extends Component {<br>  constructor() {<br>    super();<br>    this.state = {<br>      newProject: {}<br>    }<br>}</pre><p>But we don’t want to define them already, we instead want the data input to be connected to what is submitted. So, let’s jump back into the handleSubmit function and extract the value of the title being submitted:</p><pre>handleSubmit(e) {<br>    console.log(this.refs.title.value);<br>    e.preventDefault();<br>}</pre><p>Now when you type in data into the input, then hit submit, the console will log the data.</p><p>We also don’t want the user to submit a blank title, so we can add in a validation method to alert the need to input by again going into the handleSubmit function and replacing the console.log with:</p><pre>handleSubmit(e) {<br>    <strong>if(this.refs.title.value === &#39;&#39;) {<br>      alert(&#39;Title is required&#39;);<br>    }</strong></pre><p>Above basically means that if the input for the title is equal to nothing, then an alert will pop up saying ‘Title is required’.</p><p>We’ll also need to include an ‘else’, which will be actual submission of the form and make that a new state:</p><pre>handleSubmit(e) {<br>    if(this.refs.title.value === &#39;&#39;) {<br>      alert(&#39;Title is required&#39;);<br>    }<strong> else {<br>      this.setState({newProject:{<br>        title: this.refs.title.value,<br>        category: this.refs.category.value<br>    }});</strong></pre><p>The setState can take in a second parameter which in this case will be a callback function to console.log the resulting new state:</p><pre>handleSubmit(e) {<br>    if(this.refs.title.value === &#39;&#39;) {<br>      alert(&#39;Title is required&#39;);<br>    } else {<br>      this.setState({newProject:{<br>        title: this.refs.title.value,<br>        category: this.refs.category.value<br>      }}, <strong>function() {<br>        console.log(this.state);<br>      });<br>    };</strong><br>    e.preventDefault();<br>}</pre><p>The state in the ‘AddProjects’ component is different from the state in the main ‘App’ component.</p><blockquote>Each component has its own state</blockquote><p>But what we want to do is take the data we submitted and pass it up into the main ‘App’ component and save it in the main in that state. We can send it up through a property — a function inside the properties.</p><p>We will do this be first removing the console.log in the handleSubmit function and replace it with obtaining the new state:</p><pre>handleSubmit(e) {<br>    if(this.refs.title.value === &#39;&#39;) {<br>      alert(&#39;Title is required&#39;);<br>    } else {<br>      this.setState({newProject:{<br>        title: this.refs.title.value,<br>        category: this.refs.category.value<br>      }}, function() {<br>        //console.log(this.state);<br>        <strong>this.props.addProject(this.state.newProject);</strong><br>      });<br>    };<br>    e.preventDefault();<br>}</pre><p>Then in the &lt;AddProject&gt; element, add a property with the new state binded:</p><pre>&lt;AddProject <strong>addProject={this.handleAddProject.bind(this)</strong>} /&gt;</pre><p>The handleAddProject handler is a function we will need to define above the render function:</p><pre>handleAddProject(project){<br>    console.log(project);<br>}</pre><p>In React, the state is immutable meaning that you don’t want to change it, you want to update it, so that we want to get everything that’s in it pushed to it (the new project) and then set it again. So to do that:</p><pre>handleAddProject(project){<br>    //console.log(project);<br>    let projects = this.state.projects;<br>    projects.push(project);<br>    this.setState({projects:projects});<br>}</pre><p>But when you start to add in titles, new bullet points will be made (which is fantastic!) but the selected category does not show. We need to jump back into the ‘AddProjects’ component and replace the value from the returned option property for value from “category” to {category}.</p><pre>render() {<br>    let categoryOptions = this.props.categories.map(category =&gt; {<br>      return &lt;option key={category} value=<strong>{category}</strong>&gt;{category}&lt;/option&gt;<br>});</pre><p>Now it should work!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*bjACck8UvxFD2Ix3oFJguw.png" /></figure><p>You could potentially push the data into some sort of external API or server. But React focuses on the user interface part of it. The back end is completely separated from the front end, which is really useful!</p><p>Now let’s look into removing data in the user interface.</p><p>We can do this by first grabbing the unique id for each component. First thing we’ll need to do, is first install the UUID module in Node.js. To do this, stop the localhost app and type in:</p><pre>npm install --save uuid</pre><p>Hit enter and allow Node.js to load the module. Then open the program again:</p><pre>npm start</pre><p>Then we must jump into ‘App.js’ to import it into the top section of the app:</p><pre>import uuid from &#39;uuid&#39;;</pre><p>We can now add unique Id’s to each object that we’ve previously set in the componentWillMount lifecycle method:</p><pre>componentWillMount(){<br>    this.setState({projects: [<br>      {<br>        <strong>id: uuid.v4(),</strong><br>        title: &#39;Business Website&#39;,<br>        category: &#39;Web Design&#39;<br>      },<br>      {<br>        <strong>id: uuid.v4(),</strong><br>        title: &#39;Social App&#39;,<br>        category: &#39;Mobile Development&#39;<br>      },<br>      {<br>        <strong>id: uuid.v4(),</strong><br>        title: &#39;Ecommerce Shopping Cart&#39;,<br>        category: &#39;Web Development&#39;<br>      }<br>    ]});<br>  }</pre><p>This pretty much allows for the creation of new unique ids</p><p>We will also need to include this in our ‘AddProject’ setState function:</p><pre>handleSubmit(e) {<br>    if(this.refs.title.value === &#39;&#39;) {<br>      alert(&#39;Title is required&#39;);<br>    } else {<br>      this.setState({newProject:{<br>        <strong>id: uuid.v4(),</strong><br>        title: this.refs.title.value,<br>        category: this.refs.category.value<br>      }}, function() {<br>        //console.log(this.state);<br>        this.props.addProject(this.state.newProject);<br>      });<br>    };<br>    e.preventDefault();<br>  }</pre><p>We can check that the unique id is appearing by replacing ‘title’ with ‘id’ in the ‘ProjectItem’ component:</p><pre>&lt;strong&gt;<strong>{this.props.project.id}</strong>&lt;/strong&gt;: {this.props.project.category}</pre><p>Now, we can create a delete function for all objects.</p><p>We can do this by creating a link in the ProjectItem component and within it, an event handler:</p><pre>&lt;strong&gt;{this.props.project.title}&lt;/strong&gt;: {this.props.project.category} <strong>&lt;a href=&quot;#&quot; onClick={this.deleteProject.bind(this)}&gt;X&lt;/a&gt;</strong></pre><p>We now will need to define the ‘deleteProject’ function above the render function still within ‘ProjectItem.js’.</p><pre>deleteProject() {<br>    console.log(&#39;test&#39;);<br>}</pre><p>The console.log will tell us if it reacts to the click.</p><p>The process needs to be done within the main app component. In this case it will need to be passed two times in order to reach the main app component before deleting it.</p><p>To do this, we need to update the deleteProject function by generating a property for the id:</p><pre>deleteProject(id) {<br>    //console.log(&#39;test&#39;);<br>    <strong>this.props.onDelete(id);</strong><br>}</pre><p>We’ll then also need to update the resulting binding element to include an additional property:</p><pre>&lt;a href=&quot;#!&quot; onClick={this.deleteProject.bind(this, this.props.project.id)}&gt;X&lt;/a&gt;</pre><p>Now we’ll need to add onDeleteKey to the Projects component as a property on the &lt;ProjectItem&gt;:</p><pre>&lt;ProjectItem onDelete={this.deleteProject.bind(this)} key={project.title} project={project} /&gt;</pre><p>We’ll also need to create the function ‘deleteProject’ in the Projects Component:</p><pre>deleteProject(id) {<br>    //console.log(&#39;test&#39;);<br>    <strong>this.props.onDelete(id);</strong><br>}</pre><p>Finally, in the App component, we’ll add the ‘onDelete’ property to the &lt;Projects /&gt; element</p><pre>&lt;Projects projects={this.state.projects} <strong>onDelete={this.handleDeleteProject.bind(this)}</strong> /&gt;</pre><p>We can now add and delete objects in our user interface!</p><h4>Prop Types — From testing it, I think it’s outdated and is a module that we can reference in.</h4><p>Are pretty much like a validation for our properties. This is seen in our Projects Component. We can see that our Projects has a property and the deleteProject function has a property.</p><pre>AddProject.propTypes = {<br>categories: React.PropTypes.array,<br>addProject: React.PropTypes.func<br>}</pre><p>One last thing, is the ability to bring in data from an external API.</p><p>Let’s first install JQuery using Node.js. We must first close the application and the type:</p><pre>npm install jquery --save</pre><p>This will run and install JQuery. Now you can reopen your application.</p><p>Now we must import JQuery in a line of code in the App component:</p><pre>import $ from &#39;jquery&#39;;</pre><p>We can grab our data from a fake data resource such as <a href="https://jsonplaceholder.typicode.com/">https://jsonplaceholder.typicode.com/</a> to test it out!</p><p>We want to make the request in both lifecycle methods — componentWillMount and componentDidMount. We’ll first start with creating 2 new functions:</p><pre>getTodos(){<br>}</pre><p>as well as</p><pre>getProjects(){<br>    this.setState({projects: [<br>      {<br>        id: uuid.v4(),<br>        title: &#39;Business Website&#39;,<br>        category: &#39;Web Design&#39;<br>      },<br>      {<br>        id: uuid.v4(),<br>        title: &#39;Social App&#39;,<br>        category: &#39;Mobile Development&#39;<br>      },<br>      {<br>        id: uuid.v4(),<br>        title: &#39;Ecommerce Shopping Cart&#39;,<br>        category: &#39;Web Development&#39;<br>      }<br>    ]});<br>}</pre><p>and we’ll call them in the 2 life cycle methods:</p><pre>componentWillMount(){<br>  this.getProjects();<br>  this.getTodos();<br>}</pre><pre>componentDidMount(){<br>  this.getTodos();<br>}</pre><p>In the ‘getTodos’ function, this is where we will make our request to grab data. There’s so many modules we can use to make http requests, but we’re going to use JQuery. Now that we already have it installed:</p><pre>getTodos(){<br>  $.ajax(){<br>    url: &#39;<a href="https://jsonplaceholder.typicode.com/todos">https://jsonplaceholder.typicode.com/todos</a>&#39;,<br>    dataType: &#39;json&#39;,<br>    cache: false,<br>    success: function(data){<br>      this.setState({todos: data}, function(){ <br>        console.log(this.state)<br>    });<br>    }.bind(this),<br>    error: function(xhr, status, err){<br>      console.log(err);<br>    }<br>  });<br>}</pre><p>Make sure to add ‘todos’ in the properties of the initial state:</p><pre>class App extends Component {<br>  constructor() {<br>    super();<br>    this.state = {<br>      projects: [],<br>      <strong>todos: []</strong><br>    }<br>}</pre><p>Duplicate ‘Projects.js’ and ‘ProjectItem.js’ and replace the word project with ‘todo’ in however way it was described in the original file. It must follow the same representation, otherwise the code will not work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*I-DrBEHGin95GIE6C8BM8A.png" /><figcaption>Final App using the React Tutorial</figcaption></figure><p>Now the user is able to add project names, place it into a category, as well as create their own To Do List. The “X” on the right of each project or bullet point allow for deleting each item.</p><p>You can find the resulting code <a href="https://github.com/emilyyleung/Test_React_App">here</a>.</p><blockquote><em>© Emily Y Leung and Project Redback, 2017. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Emily Y Leung and Project Redback with appropriate and specific direction to the original content.</em></blockquote><p>Last modified on Wednesday 13 September 2017</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d0be313c40a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/scratch-pad-3201-3202/note-interactivity-in-react-2d0be313c40a">NOTE: Interactivity in React — Part 2</a> was originally published in <a href="https://medium.com/scratch-pad-3201-3202">PROJECT REDBACK</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NOTE: Learn React — Part 1]]></title>
            <link>https://medium.com/scratch-pad-3201-3202/note-learn-react-part-1-3e8f03e6cb26?source=rss-4efb1b923054------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e8f03e6cb26</guid>
            <category><![CDATA[project-thesis]]></category>
            <category><![CDATA[field-notes]]></category>
            <category><![CDATA[notebook]]></category>
            <category><![CDATA[computational-design]]></category>
            <category><![CDATA[architecture]]></category>
            <dc:creator><![CDATA[emily leung]]></dc:creator>
            <pubDate>Wed, 04 Oct 2017 01:58:59 GMT</pubDate>
            <atom:updated>2017-10-04T02:09:26.154Z</atom:updated>
            <content:encoded><![CDATA[<p>NOTE: 0017 — Wednesday 13 September 2017</p><p>In this post, we’ll be focusing on building apps with React.</p><h4>Reason for this?</h4><p>For one reason, and one reason only:</p><blockquote>React really shines when your data changes over time.</blockquote><blockquote>This is a note to breakdown the React JS Crash Course by Traversy Media in his video: <a href="https://www.youtube.com/watch?v=A71aqufiNtQ">https://www.youtube.com/watch?v=A71aqufiNtQ</a></blockquote><h4>What you’ll need:</h4><ul><li>Node.js installed</li><li>Understand how to use Node.js commands</li><li>Link to React website for information <a href="https://facebook.github.io/react/">https://facebook.github.io/react/</a></li><li>Text Editor — Up to you as to which program you use — Brackets, Atom, Sublime Text, etc.</li></ul><h3>PROCESS</h3><h4>STEP 1 — Getting started with React / Installation</h4><p>After you have node.js installed and up and running, go to <a href="https://facebook.github.io/react/docs/installation.html">https://facebook.github.io/react/docs/installation.html</a> where you’ll find the code to install React straight through Node.js globally:</p><ol><li>Open Node.js</li><li>Type:</li></ol><pre>npm install -g create-react-app</pre><p>3. Find the folder you want to place your project in. You can use:</p><pre><strong>c:</strong> or <strong>d:</strong> to switch between hard drives</pre><p>4. Once you’ve found the folder, you type in the command ‘create-react-app’ space ‘yourprojectname’. One thing to note is that the project name cannot have any capital letters:</p><pre>create-react-app projectnamehere</pre><p>5. Hit enter, and this will load.</p><p>6. Type:</p><pre>cd projectnamehere</pre><p>7. Type:</p><pre>npm start</pre><p>8. This will open your application in a localhost website!</p><h4>STEP 2 — Opening your project</h4><p>Use your text editor to open up your project you’ve just created.</p><ul><li>In ‘package.json’, you’ll find the version of React you’re using and the script commands for running the application.</li><li>In the ‘public’ folder, you’ll find ‘index.html’ all set up for you. Here, you can delete the comments to make the code tidier.</li><li>In the ‘index.html’ file, the one thing to know is that the &lt;div&gt; has the id of “root” where the application will be rendered.</li><li>You can also change the name of the application’s tab on the browser in the &lt;title&gt; tags to the project’s name.</li></ul><h4>STEP 3 — Where React Sits</h4><p>In our src folder, all of our React stuff goes in here.</p><blockquote>index.js</blockquote><ul><li>Imports React, ReactDOM and the App component</li><li>It also renders the App to the “root” &lt;div&gt; of the index.html file</li></ul><blockquote>App.js</blockquote><ul><li>Is our gateway to our main App component</li><li>Imports React, App.css</li><li>Can delete the logo that originally sits there</li><li>Has a class called ‘App’ which extends the Component, with a render function which returns the JSX</li><li>When returning elements in the render, everything has to sit in ONE main div.</li><li>Can have as many elements inside the main div</li><li>Can delete everything inside the main div to start</li><li>Can delete everything inside the ‘App.css’ file</li><li>Delete ‘logo.svg’</li></ul><h4>STEP 4 — Setting up to Start</h4><p>Open the web browser (Google Chrome) to see changes you make as well as the inspector (console).</p><p>This is a blank React Application that you’ve just set up.</p><h4>STEP 5 — Let’s Start!</h4><p>For this main App component, we should use it as a placeholder for all of our smaller components. We can import them and place them within the render function.</p><p>Therefore, we should have a folder inside our ‘src’ folder called ‘Components’.</p><p>Create a new file within the ‘Components’ folder called ‘Projects.js’. It will be responsible for listing all of our projects.</p><p>Copy everything from within ‘App.js’ because we need that same basic format in ‘Projects.js’. We don’t need the imported CSS file and must change all of the ‘App’ names to ‘Projects’.</p><p>Then go back to ‘App.js’ to import the ‘Projects’ component. Below is ‘<strong>App.js’</strong></p><pre>import React, { Component } from &#39;react&#39;;<br>import Projects from &#39;./Components/Projects&#39;;<br>import &#39;./App.css&#39;;</pre><pre>class App extends Component {<br>  render() {<br>    return (<br>      &lt;div className=&quot;App&quot;&gt;<br>        My App<br>        &lt;Projects /&gt;<br>      &lt;/div&gt;<br>    );<br>  }<br>}</pre><pre>export default App;</pre><p>You can also add properties (props) by going into the element and creating it in the tag:</p><pre>&lt;Projects <strong>test=&quot;Hello World&quot;</strong> /&gt;</pre><p>Then in the ‘Projects.js’:</p><pre>import React, { Component } from &#39;react&#39;;</pre><pre>class Projects extends Component {<br>  render() {<br>    return (<br>      &lt;div className=&quot;Projects&quot;&gt;<br>        My Projects<br>        <strong>{this.props.test}</strong><br>      &lt;/div&gt;<br>    );<br>  }<br>}</pre><pre>export default Projects;</pre><p>It will then render:</p><pre>My App</pre><pre>My ProjectsHello World</pre><h4>STEP 6 — States</h4><p>All of our projects are going to be held in states. That’s where our data needs to be held. Usually, we would need to fetch it from some API or database and then put it in our state, but we’re just going to put the data right in our state.</p><p>So first we want to create a ‘constructor’. So right above our render in ‘<strong>App.js</strong>’, we add in a constructor:</p><pre>import React, { Component } from &#39;react&#39;;<br>import Projects from &#39;./Components/Projects&#39;;<br>import &#39;./App.css&#39;;</pre><pre>class App extends Component {<br>  <strong>constructor() {<br>    <br>  }</strong><br>  render() {<br>    return (<br>      &lt;div className=&quot;App&quot;&gt;<br>        My App<br>        &lt;Projects test=&quot;Hello World&quot; /&gt;<br>      &lt;/div&gt;<br>    );<br>  }<br>}</pre><pre>export default App;</pre><p>This is where we want to define our initial states / state keys:</p><pre>constructor() {<br>    super();<br>    <strong>this.state = {</strong></pre><pre><strong>    }</strong><br>}</pre><p>In the state, we want our projects to be an array of objects:</p><pre>constructor() {<br>    this.state = {<br>      <strong>projects: [<br>        {<br>          title: &#39;Business Website&#39;,<br>          category: &#39;Web Design&#39;<br>        },<br>        {<br>          title: &#39;Social App&#39;,<br>          category: &#39;Mobile Development&#39;<br>        },<br>        {<br>          title: &#39;Ecommerce Shopping Cart&#39;,<br>          category: &#39;Web Development&#39;<br>        }</strong><br>     <strong> ]</strong><br>    }<br>  }</pre><p>We want to take this state and pass it into &lt;Projects /&gt; as a property. So basically, you want everything at the top in your application in the state, and then pass it down into other components through properties. The data should be immutable. It should be from the top, down.</p><p>We can render the projects through the property:</p><pre>&lt;Projects projects={this.state.projects} /&gt;</pre><p>But when we refresh the page, it will show an error, because we hadn’t called the ‘super( );’ function. So make sure to add that in first in the ‘constructor( )’ method.</p><p>Then in ‘Projects.js’, between the render and return function, add:</p><pre>console.log(this.props);</pre><p>But it will only show the projects in the console like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*NKS2Osj_1FGDnSYqBeimFg.png" /></figure><p>We can now access the data through our ‘Projects’ component.</p><p>Now, when you have an array of objects like this, you usually want to create a separate component for each individual item and then you want to map through those projects and output that component.</p><p>So, we’re going to create a new component in the ‘Components’ folder called ‘ProjectItem.js’.</p><p>Copy everything from ‘Projects.js’ and place into ‘ProjectItem.js’ where you’ll replace the specific word ‘Projects’ with ‘ProjectItem’. We’re also going to make it wrapped within an &lt;li&gt; list item with a className of “Project”. Like so:</p><pre>import React, { Component } from &#39;react&#39;;</pre><pre>class ProjectItem extends Component {<br>  render() {<br>    console.log(this.props);<br>    return (<br>      &lt;li className=&quot;Project&quot;&gt;<br>        My Projects<br>      &lt;/li&gt;<br>    );<br>  }<br>}</pre><pre>export default ProjectItem;</pre><p>Now go back into ‘Projects.js’. Create a variable called “projectItems” in the render function:</p><pre>let projectItems;</pre><p>We’re then going to test if there is any projects coming through by using an if statement in the render function in ‘<strong>Projects.js</strong>’:</p><pre>import React, { Component } from &#39;react&#39;;<br>import ProjectItem from &#39;./ProjectItem&#39;;</pre><pre>class Projects extends Component {<br>  render() {<br>    let projectItems;<br>    if(this.props.projects){<br>      projectItems = this.props.projects.map(project =&gt; {<br>        console.log(project);<br>      });<br>    }<br>    return (<br>      &lt;div className=&quot;Projects&quot;&gt;<br>        My Projects<br>        {projectItems}<br>      &lt;/div&gt;<br>    );<br>  }<br>}</pre><pre>export default Projects;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*ACj0hM44I05A7PtjDjmb-Q.png" /></figure><p>So now each object is logged in the console. We’re getting each individual project.</p><p>Now we will comment out the ‘console.log’ function with a ‘return’ function. It will return the &lt;ProjectItem /&gt; component where we want to pass in each object as a property.</p><pre>class Projects extends Component {<br>  render() {<br>    let projectItems;<br>    if(this.props.projects){<br>      projectItems = this.props.projects.map(project =&gt; {<br>        //console.log(project);<br>        <strong>return (<br>          &lt;ProjectItem project={project} /&gt;<br>        );</strong><br>      });<br>    }</pre><p>We’re assigning each &lt;ProjectItem /&gt; with the the variable ‘projectItems’.</p><p>So now in the Projects.js return function, we are able to pass each listed project as a component into the “Projects” div. Make sure to import the ProjectItem component into ‘Projects.js’.</p><p>It’s also good to add a key property to our &lt;ProjectItem /&gt; element:</p><pre>&lt;ProjectItem key={project.title} project={project} /&gt;</pre><p>Now, this will show an empty bullet list because we haven’t brought out the data in ‘ProjectItem.js’ return function within the &lt;li&gt; tag.</p><pre>import React, { Component } from &#39;react&#39;;</pre><pre>class ProjectItem extends Component {<br>  render() {<br>    console.log(this.props);<br>    return (<br>      <strong>&lt;li className=&quot;Project&quot;&gt;<br>        &lt;strong&gt;{this.props.project.title}&lt;/strong&gt;: {this.props.project.category}<br>      &lt;/li&gt;</strong><br>    );<br>  }<br>}</pre><pre>export default ProjectItem;</pre><p>It’s better to place predetermined data in the ‘componentWillMount’ lifecycle method rather than instantiated in the ‘constructor’ method. Like so:</p><pre>class App extends Component {<br>  constructor() {<br>    super();<br>    this.state = {<br>      <strong>projects: []</strong> //is an empty array<br>    }<br>  }</pre><pre>componentWillMount(){<br>    <strong>this.setState({projects: [<br>      {<br>        title: &#39;Business Website&#39;,<br>        category: &#39;Web Design&#39;<br>      },<br>      {<br>        title: &#39;Social App&#39;,<br>        category: &#39;Mobile Development&#39;<br>      },<br>      {<br>        title: &#39;Ecommerce Shopping Cart&#39;,<br>        category: &#39;Web Development&#39;<br>      }<br>    ]});</strong><br>  }</pre><h3>To Summarise</h3><p>We’re basically setting our state in the App component in <strong>App.js </strong>using: this.state and this.setState.</p><p>The state is called ‘projects:’ which has an array of objects (or in this case, projects)</p><p><strong>App.js</strong></p><pre>{projects: [<br>      {<br>        title: &#39;Business Website&#39;,<br>        category: &#39;Web Design&#39;<br>      },<br>      {<br>        title: &#39;Social App&#39;,<br>        category: &#39;Mobile Development&#39;<br>      },<br>      {<br>        title: &#39;Ecommerce Shopping Cart&#39;,<br>        category: &#39;Web Development&#39;<br>      }<br>]}</pre><p>We’re passing ‘projects:’ into &lt;Projects /&gt; as a property by calling ‘this.state.projects’:</p><p>In <strong>App.js</strong></p><pre>&lt;Projects projects={this.state.projects} /&gt;</pre><p>Then inside ‘Projects.js’, we’re mapping through that array using the .map function:</p><p>In <strong>Projects.js</strong></p><pre>class Projects extends Component {<br>  render() {<br>    <strong>let projectItems;<br>    if(this.props.projects){<br>      projectItems = this.props.projects.map(project =&gt; {<br>        console.log(project);</strong><br>      });<br>    }<br>    return (<br>      &lt;div className=&quot;Projects&quot;&gt;<br>        My Projects<br>        {projectItems}<br>      &lt;/div&gt;<br>    );<br>  }<br>}</pre><p>and we’re outputting a &lt;ProjectItem /&gt; component</p><pre>class Projects extends Component {<br>  render() {<br>    let projectItems;<br>    if(this.props.projects){<br>      projectItems = this.props.projects.map(project =&gt; {<br>        //console.log(project);<br>        <strong>return (<br>          &lt;ProjectItem project={project} /&gt;</strong><br>        );<br>      });<br>    }<br>    return (<br>      &lt;div className=&quot;Projects&quot;&gt;<br>        My Projects<br>        {projectItems}<br>      &lt;/div&gt;<br>    );<br>  }<br>}</pre><p>which has each project where we output the title and category</p><p><strong>ProjectItem.js</strong></p><pre>class ProjectItem extends Component {<br>  render() {<br>    console.log(this.props);<br>    return (<br>      <strong>&lt;li className=&quot;Project&quot;&gt;<br>        &lt;strong&gt;{this.props.project.title}&lt;/strong&gt;: {this.props.project.category}<br>      &lt;/li&gt;</strong><br>    );<br>  }<br>}</pre><pre>export default ProjectItem;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*Az_Vd8kIKz9DK-oJ1Ml6Ng.png" /><figcaption>Final Result of Part 1</figcaption></figure><p>This is a basic app that does not hold any form of interactivity. But it does present a range of basic principles used in React and allow us to understand the interconnected relationship of building components.</p><p>Next post will focus on developing an interface of adding buttons, submitting data to create new components in the application.</p><p>Because it is looking into the front end aspect of the application, I may have to develop an understanding of connecting that to back end programming (or in this case, potentially flux?).</p><blockquote>© Emily Y Leung and Project Redback, 2017. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Emily Y Leung and Project Redback with appropriate and specific direction to the original content.</blockquote><p>Last modified on Wednesday 13 September 2017</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e8f03e6cb26" width="1" height="1" alt=""><hr><p><a href="https://medium.com/scratch-pad-3201-3202/note-learn-react-part-1-3e8f03e6cb26">NOTE: Learn React — Part 1</a> was originally published in <a href="https://medium.com/scratch-pad-3201-3202">PROJECT REDBACK</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[M-NOTE: Generating the First Prototype]]></title>
            <link>https://medium.com/scratch-pad-3201-3202/note-generating-the-first-prototype-dc18b5eca082?source=rss-4efb1b923054------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc18b5eca082</guid>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[field-notes]]></category>
            <category><![CDATA[computational-design]]></category>
            <category><![CDATA[miscellaneous]]></category>
            <category><![CDATA[project-thesis]]></category>
            <dc:creator><![CDATA[emily leung]]></dc:creator>
            <pubDate>Wed, 04 Oct 2017 01:56:54 GMT</pubDate>
            <atom:updated>2017-10-04T02:28:57.746Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*brAd2n-kQ92KLnfRPZSjww.png" /></figure><p>M-NOTE: 0007 — Wednesday 30 August 2017</p><h3>INTRODUCTION</h3><h3>PROBLEM</h3><h3>QUESTION POSED</h3><h3>RESEARCH METHOD</h3><h3>WORKFLOW DIAGRAM</h3><h3>PROTOTYPE 1-A</h3><h3>PROTOTYPE 1-B</h3><h3>COMPARATIVE STUDY OF PROTOTYPES 1-A + 1-B</h3><blockquote>© Emily Y Leung and Project Redback, 2017. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Emily Y Leung and Project Redback with appropriate and specific direction to the original content.</blockquote><p>Last modified on Wednesday 30 August 2017</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc18b5eca082" width="1" height="1" alt=""><hr><p><a href="https://medium.com/scratch-pad-3201-3202/note-generating-the-first-prototype-dc18b5eca082">M-NOTE: Generating the First Prototype</a> was originally published in <a href="https://medium.com/scratch-pad-3201-3202">PROJECT REDBACK</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[M-NOTE: Incorporating Colour in the App]]></title>
            <link>https://medium.com/scratch-pad-3201-3202/m-note-incorporating-colour-in-the-app-d2829b35c106?source=rss-4efb1b923054------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2829b35c106</guid>
            <category><![CDATA[project-thesis]]></category>
            <category><![CDATA[miscellaneous]]></category>
            <category><![CDATA[computational-design]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[field-notes]]></category>
            <dc:creator><![CDATA[emily leung]]></dc:creator>
            <pubDate>Wed, 04 Oct 2017 01:55:33 GMT</pubDate>
            <atom:updated>2017-10-04T02:28:25.946Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*brAd2n-kQ92KLnfRPZSjww.png" /></figure><p>M-NOTE: 0006— Monday 04 September 2017</p><p>Now that the ability to generate Three.js JSON geometry data is possible via the Flux Sample App, the next step is to think about how we can achieve the flow of interactivity. The most distinct way of showing the ability to change is through <strong>colour</strong>. So how can this be achieved?</p><h3>Flux Flow</h3><p>Within the flow, we have the opportunity to manipulate each object that sits inside the one key. However, the process as shown below is quite a manual process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4hhA5a-Md3Vnk0avucMIsA.png" /><figcaption><a href="https://community.flux.io/articles/1435/adding-color-to-objects-within-flux.html">https://community.flux.io/articles/1435/adding-color-to-objects-within-flux.html</a></figcaption></figure><p>What it’s essentially doing is selecting the key of objects. Breaking it apart into however many objects. Then obtaining each individual object and attaching a material to it. They are then reattached as a list to finalise the transformation.</p><p>Instead of going through the process of picking each individual object as shown above. We need an intuitive way that allows for us to select the object, then clicking a button to change its colour.</p><h4>What is Raycasting?</h4><p>So in order to do that, we’ll need to first look into raycasting within Three.js.</p><blockquote>used for mouse picking (working out what objects in the 3D space the mouse is over) amongst other things.</blockquote><p>With this particular technique, we will need to include the Raycaster.js script as provided by the Three.js Master Folder.</p><p>When we reference it into our HTML document, we can start building a connection between the user and the 3D space — provided the translation of the 2D window of the web page.</p><h3>PROCESS — Let’s do an example</h3><h4>STEP 1— Build your boilerplate scene</h4><p>https://ajax.googleapis.com/ajax/libs/threejs/r76/three.min.js</p><pre>&lt;!DOCTYPE&gt;<br>&lt;html&gt;</pre><pre>&lt;head&gt;<br>  &lt;title&gt;Raycasting Tutorial&lt;/title&gt;<br>  <br>&lt;/head&gt;</pre><pre>&lt;body&gt;<br>  &lt;script <strong>src=</strong>&quot;<strong>js/three.min.js</strong>&quot;&gt;&lt;/script&gt;</pre><pre>  &lt;script&gt;<br>  <br> <strong> // This is where our Three.js scene will sit</strong></pre><pre>  &lt;/script&gt;<br>&lt;/body&gt;</pre><pre>&lt;/html&gt;</pre><h4>STEP 2— Determine your variables</h4><p>To be continued…</p><h3>Making it applicable</h3><p>In order to change the object’s properties AND bring that change back to the original model, it must be documented somewhere, rather than just visually transmitted onto the object.</p><blockquote><em>© Emily Y Leung and Project Redback, 2017. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Emily Y Leung and Project Redback with appropriate and specific direction to the original content.</em></blockquote><p>Last modified on Monday 04 September 2017</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2829b35c106" width="1" height="1" alt=""><hr><p><a href="https://medium.com/scratch-pad-3201-3202/m-note-incorporating-colour-in-the-app-d2829b35c106">M-NOTE: Incorporating Colour in the App</a> was originally published in <a href="https://medium.com/scratch-pad-3201-3202">PROJECT REDBACK</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[M-NOTE: Progressing Tests]]></title>
            <link>https://medium.com/scratch-pad-3201-3202/m-note-progressing-tests-359de8f3569e?source=rss-4efb1b923054------2</link>
            <guid isPermaLink="false">https://medium.com/p/359de8f3569e</guid>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[computational-design]]></category>
            <category><![CDATA[project-thesis]]></category>
            <category><![CDATA[field-notes]]></category>
            <category><![CDATA[miscellaneous]]></category>
            <dc:creator><![CDATA[emily leung]]></dc:creator>
            <pubDate>Wed, 04 Oct 2017 01:53:44 GMT</pubDate>
            <atom:updated>2017-10-04T02:26:29.737Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*brAd2n-kQ92KLnfRPZSjww.png" /></figure><p>M-NOTE: 0005— Thursday 10 August 2017</p><h3>Objectives</h3><p>The things I wanted to test out on any particular geometry:</p><ul><li>Bringing in external geometry (Revit / Rhino) using the sample project from Revit</li><li>User interface (hover + displaying information such as text)</li><li>Object / project interaction (animations + click)</li></ul><blockquote>© Emily Y Leung and Project Redback, 2017. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Emily Y Leung and Project Redback with appropriate and specific direction to the original content.</blockquote><p>Last modified on Monday 21 August 2017</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=359de8f3569e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/scratch-pad-3201-3202/m-note-progressing-tests-359de8f3569e">M-NOTE: Progressing Tests</a> was originally published in <a href="https://medium.com/scratch-pad-3201-3202">PROJECT REDBACK</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>