<?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 Bob Cavezza on Medium]]></title>
        <description><![CDATA[Stories by Bob Cavezza on Medium]]></description>
        <link>https://medium.com/@cavezza?source=rss-219a517280de------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*QzfGl5BAOTHlvIRCLNRT3g.jpeg</url>
            <title>Stories by Bob Cavezza on Medium</title>
            <link>https://medium.com/@cavezza?source=rss-219a517280de------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 19:23:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cavezza/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[Lessons from one week of print design]]></title>
            <link>https://medium.com/creating12/lessons-from-one-week-of-print-design-c4551604a6a2?source=rss-219a517280de------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4551604a6a2</guid>
            <category><![CDATA[print]]></category>
            <category><![CDATA[printing]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[print-design]]></category>
            <dc:creator><![CDATA[Bob Cavezza]]></dc:creator>
            <pubDate>Sun, 02 Feb 2020 17:13:23 GMT</pubDate>
            <atom:updated>2020-02-04T02:55:53.983Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_zusaX0-Jhx967NG.png" /><figcaption>Creating a bookmark cover in Adobe Illustrator</figcaption></figure><p>If you haven’t been following along, I’m on a journey to create 12 products in 12 months. I’m currently on product #2. I worked a lot on print design for product 1. The full list of posts is available at <a href="http://creating12.com/">http://creating12.com</a></p><p>Print design was a new experience for me. Here are some of the key takeaways from my recent experiences.</p><h3>Tools</h3><p>The tool of choice for print design is Adobe Illustrator. I tried numerous other options including source tools and online tools. No other tool gave me the ability to make changes quickly and reliably that Adobe Illustrator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EKoDurG2d0Jwl0xD.png" /></figure><h3>Color</h3><p>Most web design for the web uses RBG (red, blue, green) color codes because colors are created by light. Most print design uses CMYK (cyan, magenta, yellow, key/black) color codes because colors are created by ink. <a href="https://99designs.com/blog/tips/correct-file-formats-rgb-and-cmyk/">Here’s more details on the differences</a></p><h3>Bleed</h3><p>A bleed is the area beyond the expected print area. The reason you design with a bleed is that printing errors are inevitable. There’s probably a +/-2% leeway for printers. Because of this, you want to leave room for error.</p><p><a href="https://overnightprints.com/">Overnightprints.com</a>, our printing partner at <a href="https://ibuildmvps.com/blog/introducing-inspiremarks/">Inspiremarks</a> sent me this a<br>Adobe Illustrator file to help with designing bleeds. Overnight Prints suggests using a full bleed. In the image below, the red line is the safe zone, the dotted line is where the bleed extends to. For for a full bleed, they suggest continuing the design throughout the entire file past the dotted line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YHN6ExFgijGrs_ED.png" /></figure><p>Here’s a screenshot of more information about the common mistake of not leaving a bleed on the overnight prints common mistakes page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1H5iJAAzyn6wfTjp.png" /></figure><h3>DPI is Critical</h3><p>DPI, or <a href="https://www.lifewire.com/dpi-in-graphics-1078848">Dots Per Inch</a> is a critical setting for print quality. Print shops expect at least 300 DPI. You need to be careful because many programs default to 72 DPI. Make sure you double check your settings before exporting files to PDF.</p><h3>PDF Format</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/0*7j8-weZEocM8aYl6.png" /></figure><p>Send files in PDF format. It’s the best format to send completed designs because it does not rely on the end user having the correct fonts installed on their machines. If you send files in other formats, you risk the end product being slightly different than you had intended. This is usually never the desired result.</p><p><em>Originally published at </em><a href="https://ibuildmvps.com/blog/print-design-learnings/"><em>https://ibuildmvps.com</em></a><em> on February 2, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4551604a6a2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/creating12/lessons-from-one-week-of-print-design-c4551604a6a2">Lessons from one week of print design</a> was originally published in <a href="https://medium.com/creating12">Creating12</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing Inspiremarks]]></title>
            <link>https://medium.com/creating12/introducing-inspiremarks-24d8678d9b9f?source=rss-219a517280de------2</link>
            <guid isPermaLink="false">https://medium.com/p/24d8678d9b9f</guid>
            <category><![CDATA[startup-lessons]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[product-design]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[bookmarks]]></category>
            <dc:creator><![CDATA[Bob Cavezza]]></dc:creator>
            <pubDate>Fri, 31 Jan 2020 13:28:28 GMT</pubDate>
            <atom:updated>2020-01-31T13:28:28.277Z</atom:updated>
            <content:encoded><![CDATA[<p>I launched my first physical product about a week ago. It’s a <a href="https://inspiremarks.com/">set of bookmarks with quotes from startup leaders</a>.</p><p><a href="http://inspiremarks.com/">Inspiremarks</a> is a set of five startup quote themed bookmarks I designed and printed in the last few weeks. They are 2x6 printed on 15pt premium paper with a non-glossy matte finish. The set retails for $7.99.</p><p>I went from idea to first sales in less than three weeks.</p><p><strong>Here’s the story of how it all came together. </strong>In this post, I talk about the reason I created this bookmark set and the design process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yK12hdopo_N6PNL6XNjTNQ.jpeg" /></figure><h3>The Inspiration</h3><p>I’m the type of person that buys more books than he has room for. Books don’t fit on the bookshelf anymore. They are on the windowsill, they’re on the floor, they’re everywhere.</p><p>I don’t often get rid of books, but we simply had too many in our house. We had to trim down the number of books. I went through the books on the bookshelves and donated dozens of books to local charities</p><p>When I was going through the books, I realized that I don’t use bookmarks. I was holding my place with book jackets, rubber bands, receipts, dollar bills, pieces of paper, and other random items.</p><p>Here’s a photo of a few things I was using as bookmarks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BhbN35vcLpPBSAd0JrxTWA@2x.jpeg" /><figcaption>“Bookmarks” — sheets of paper, dollar bills, receipts, an actual bookmark, and a rubber band</figcaption></figure><p>I was talking to a coworker yesterday, and he mentioned he was folding in the corners of pages as a bookmark.</p><p>I was never a bookmark person. I never gave it thought. I grabbed what was nearby to hold my page. That was good enough for me.</p><p>But that soon changed.</p><p>I was reading in a coffeeshop as I usually do. It was a Saturday. I bought a cup of coffee. I bought a croissant. And I read in the corner by myself. I didn’t think twice about what I was using to mark my place.</p><p>Then — it happened.</p><p>I looked up to a an odd look from the person next to me. It was a look of disgust. I was baffled. I had no idea what I did or what was happening.</p><p>After she left, I started to become more aware of my surroundings and my possessions. It was thirty seconds after she left the cafe that I realized what the look was all about.</p><p>I was using a piece of toilet paper as my bookmark.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ChL7wGJHKbDpstXk-Snzog@2x.jpeg" /><figcaption>The offending “bookmark” (toilet paper)</figcaption></figure><p>This was the day I decided to buy proper bookmarks.</p><p>I started searching for bookmarks the next day. I wanted bookmarks that said something about my personality or what I stand for. With my new heightened awareness of my surroundings brought on by shame, I wanted bookmarks that would say something about me. I usually read books about software, startups, management, and leadership. I naturally assumed that there would be an abundance of bookmarks that fit into these categories.</p><p>I found none.</p><p>At that point, I decided to make them myself.</p><h3>The Process</h3><p>I didn’t know where to start. I searched online and found a lot of interesting bookmarks. There were leather bookmarks, metal bookmarks, corner page bookmarks. There were bookmarks with strings, bookmarks made of metal, and bookmarks made of crazy colors.</p><p>It was surprisingly difficult to find bookmarks that are the rectangular shape with no bells and whistles that I grew up with. I found a few — just not the overwhelming amount I expected to find. I ordered a few bookmarks that I liked. I wanted some inspiration and to cross-examine the differences between certain sizes and paper thickness.</p><p>The ones I loved most were these two bookmark sets: 1 from ObviousState (<a href="https://obviousstate.com/">https://obviousstate.com</a>) and one from the New York Public Library (<a href="https://www.nypl.org/">https://www.nypl.org/</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*domPPZkgrGRMc-ELxxXDQw.jpeg" /><figcaption>Obvious State 2x6 bookmarks</figcaption></figure><p>The Obvious State bookmarks had a very intriguing, elegant feel to them. I really loved how they were primarily black and white with small hints of other colors. The quality of these drawings were superb. I also loved the shape and feel of these bookmarks. The 2x6 size just felt right compared to larger sizes. I also really liked the non-glossy matte coating on them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*mY6wDsTpQI7c0RRpOfbjSw.jpeg" /></figure><p>The New York Public Library Quote bookmark setwas intriguing because I loved the idea of quotes in my bookmark set. I also enjoyed the idea of having a full color palette with some unifying marks to bring the entire set together. I didn’t like how they were larger than 2x6 (They were 7.25x2.25 — I know it’s subtle, but it made a big difference for me) and I also didn’t like their glossy finish.</p><p>At the end of the day, I knew I wanted to combine elements of each of these two sets with my own style and interests.</p><p>Step 1 was determining which startup quotes to use. I had a few on the top of my head, but I also wanted to go out and do some google searches for some I might be forgetting. I ended up creating a Google Drive document of quotes to choose from.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9eLobmVyJo9YthOR5_BxoQ.gif" /></figure><p>I wasn’t able to choose which quotes to use. I decided to skip that decision process and come back to it. I still needed a design — it didn’t really matter which quotes were chosen.</p><p>I was off looking for design inspiration. I started playing around with a tool called <a href="https://canva.com/">Canva</a> — I used canva for Twitter and blog images, but I didn’t realize they were a tool you could use for print design. While I was looking at some bookmarks on canva, I came across this intriguing bookmark with a quote from Helen Keller on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*zD92w_k09DfSnR5mckLB3A.png" /><figcaption>Helen Keller quote on a bookmark</figcaption></figure><p>There was something fantastic about the bottom part of this bookmark. In this particular bookmark, it felt like it was being misused. Instead of being the focal point of the design, this quote felt like an afterthought. I thought there was something there, though. I decided to use that format of a design as the focal point of the bookmarks I was designing.</p><p>The next piece of the puzzle was color scheme. I wanted something that represented me and the things I like. As I was sitting in Cafe Fixe in Brookline, Massachusetts, I looked down and thought about how beautiful my espresso looked. I had a flicker of inspiration and started to look for coffee and espresso themed color palettes. I found some interesting websites like <a href="http://colorpalettes.net/">http://colorpalettes.net</a> that make color palettes from images. Soon, I found this color palette and it was love at first site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j8aMRBD-4s6yp3R77beRBQ.png" /><figcaption>Life inspires art</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pIm_8p1o18UFbdeNLj4Ycg.jpeg" /><figcaption>Espresso inspired bookmark colors</figcaption></figure><p>The name of the company was the next thing that fell into place. I really wanted to call this startmarks or startupmarks. My first rule of naming a company is you need to find the .com for that name. My two first choices were not available. As I kept thinking, I decided that I didn’t want to limit myself to just startup themed products or bookmarks. With that in mind, I ended up deciding on <a href="https://inspiremarks.com/">Inspiremarks</a>. Inspiremarks allows me to build things that inspire people. And it allows me to make a mark on society. <strong>Inspiremarks!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gZEj4w2p10sAqgvnidsTrw.jpeg" /></figure><p>The idea of putting branding on the bottom of every bookmark came from the New York Public Library set and how it has their logo and brand name on the bottom of each bookmark in that set.</p><p>Another interesting design choice was the placement of the Quote at the top. This was very much intentional. With this placement, when you have a closed book, you are able to see only the quote mark sticking out. I think that’s pretty cool.</p><p>Another interesting design choice was the placement of the Quote at the top. This was very much intentional. With this placement, when you have a closed book, you are able to see only the quote mark sticking out. I think that’s pretty cool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AdwuNUHPcSMqMchyDAF5ww.jpeg" /><figcaption>Quotemark sticking out of Dare to Lead by Brene Brown</figcaption></figure><h3>More to come</h3><p>There’s more to the story including printing, packaging, photography, and getting into stores.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24d8678d9b9f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/creating12/introducing-inspiremarks-24d8678d9b9f">Introducing Inspiremarks</a> was originally published in <a href="https://medium.com/creating12">Creating12</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating12: 12 products. 1 year.]]></title>
            <link>https://medium.com/creating12/creating12-12-products-1-year-751876742e30?source=rss-219a517280de------2</link>
            <guid isPermaLink="false">https://medium.com/p/751876742e30</guid>
            <category><![CDATA[minimum-viable-product]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[product]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Bob Cavezza]]></dc:creator>
            <pubDate>Sat, 25 Jan 2020 17:15:12 GMT</pubDate>
            <atom:updated>2020-01-27T00:33:28.822Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*1y6jKsuOvz6VFEQg.png" /></figure><p>I am creating 12 products in 12 months.<br>You can follow my progress at <a href="http://creating12.com/">http://creating12.com</a></p><p><strong>How is this going down?</strong></p><p>This has already started. My first project has launched at <a href="https://inspiremarks.com/">Inspiremarks.com</a>. It’s a printing of startup themed bookmarks. I love them! I think they are the perfect bookmarks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yK12hdopo_N6PNL6XNjTNQ.jpeg" /></figure><p>I will continue to make incremental improvements.</p><p>February is going to be an application related to determining and keeping track of team health at work.</p><p>Then, I’m going to continue building and launching products. I’m going through the entire process of research, design, launching, and marketing for each new product.</p><p>I will be sharing my progress here as I continue and learn new things.</p><h3>How can I help?</h3><p>You can buy a set of bookmarks at <a href="https://inspiremarks.com/">Inspiremarks.com</a> to show your appreciation for this project. You can also share this post on social media. You an also send me a note of encouragement: It’s extremely difficult to work a full time job, take graduate level computer science courses, and also build 12 products in a month.</p><p>I’m going to be posting progress at <a href="http://creating12.com/">Creating12.com</a>. You can follow along by subscribing to the publication on Medium. You should also follow me on Twitter. I’ll be sharing updates as I go.</p><h3>Why do this?</h3><p>Here’s a list of reasons</p><p><strong>1.) Prioritizing execution</strong></p><p>When you force yourself to create something from nothing in a month, you don’t have time to worry about the minor details. You don’t have the time. You need to make a decision and keep moving forward. You can’t debate the pros and cons of a color scheme for days. You are forced to make a decision and keep moving forward. If you don’t do that, you will not finish. You can always go back and make changes, but this priority of execution forces you to ignore minor details in order to focus on delivery.</p><p><strong>2.) Sturgeon’s Law is real</strong></p><p><a href="https://ibuildmvps.com/blog/sturgeons-law-less-vs-more-and-you-dont-win-everyday/">Sturgeon’s Law</a> says that 90% of things are crap. Cavezza’s corollary says that no creator knows what fits into the 90% and what fits into the 10%. The crucial insight is that 1 out of 10 products you create will be a success, but you don’t know which of the 10 will be the success. By forcing yourself to bring 12 ideas into the world in one year, this dramatically increases your odds of success based on Sturgeon’s Law and Cavezza’s Corollary.</p><p><strong>3.) Learning new skills</strong></p><p>I didn’t think printed physical bookmarks would be a complex project. As I got deeper into the project, I was forced to learn how to design for print, how to work with a printing company, how to open an e-commerce store, how to write product copy, and how to photograph products. I’m learning at a rapid pace. This project has forced me into a rapid learning of unique skills.</p><p><strong>4.) I’m working on things I love</strong></p><p>In the past, I stayed away from enjoyable projects. I worked on projects targeted at big markets where I thought a big opportunity was. Now, I’m focusing more on things I enjoy. Little things like physical bookmarks. I’m also focusing on problems I have at work — scratching my own itch. This has been a lot of fun!</p><p><strong>5.) Launching creates opportunities</strong></p><p>The more projects you launch, the more serendipitous opportunities come your way. It’s a law of life on the internet. Sometimes, this manifests itself by people emailing for advice and I love helping people. Other times, it manifests itself in career opportunities. I believe in the power of serendipity and love increasing the odds of serendipity.</p><p><strong>6.) Creating helps exercise your idea muscles</strong></p><p>Before starting on this project, I was not generating new ideas regularly. I was producing a new product idea once every three months. Since starting, I’m coming up with a few new ideas each day. The act of creation helps create an atmosphere for more creation.</p><p>12 products need to be creating and launched before December 31, 2020 at 11:59pm eastern time.</p><p>There are no restrictions on types of products. My expertise is in web development, but I want to branch out and try different things. The first product is completed and it is a set of startup quote themed bookmarks — <a href="https://inspiremarks.com/">Inspiremarks.com</a>. The second product will be a B2B saas web application. Don’t be surprised if there’s a desktop application and a mobile application built along the way.</p><p><strong>Thanks for reading. Wish me luck!</strong></p><p><em>Originally published at </em><a href="https://ibuildmvps.com/blog/creating12/"><em>https://ibuildmvps.com</em></a><em> on January 25, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=751876742e30" width="1" height="1" alt=""><hr><p><a href="https://medium.com/creating12/creating12-12-products-1-year-751876742e30">Creating12: 12 products. 1 year.</a> was originally published in <a href="https://medium.com/creating12">Creating12</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Simple Guide to HTML SVGs]]></title>
            <link>https://medium.com/fincura-engineering/the-simple-guide-to-html-svgs-79798a987d5e?source=rss-219a517280de------2</link>
            <guid isPermaLink="false">https://medium.com/p/79798a987d5e</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[d3js]]></category>
            <category><![CDATA[svg]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[dataviz]]></category>
            <dc:creator><![CDATA[Bob Cavezza]]></dc:creator>
            <pubDate>Wed, 28 Aug 2019 13:37:42 GMT</pubDate>
            <atom:updated>2019-08-28T13:55:38.211Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*_vtHxVw2PWljFWlPf14P2g.png" /></figure><p>You want to work with D3, but you don’t understand how SVGs are rendered in the browser. This makes it very difficult to understand HTML code that D3 outputs. Let’s tackle some of these issues.</p><p>The code we will be looking at today was generated by D3. However, in this example, we’re not looking at D3. We’re looking only at the SVG code rendered in HTML.</p><p>This is very important because when working with D3, you will typically be creating SVGs. If you’re not familiar with how an SVG looks and behaves, debugging D3 code will be very difficult.</p><p>Before getting started, I want you to keep one thing in mind when looking at this code. SVG code, in its simplest form, is putting shapes on a canvas. In the example below, we will draw an SVG canvas and place shapes and text on that canvas. That’s all we’re doing. Don’t let this code deter you. It’s nothing more than drawing a canvas, and then drawing shapes on that canvas. There might be syntax you’ve never seen before, but learning is fun!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fcavezza%2Fembed%2Fpreview%2FxxKdbGM%3Fheight%3D600%26slug-hash%3DxxKdbGM%26default-tabs%3Dhtml%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2Fcavezza%2Fpen%2FxxKdbGM&amp;image=https%3A%2F%2Fscreenshot.codepen.io%2F3523069.xxKdbGM.small.7dce36aa-a819-4c8a-ad54-bce7b98b3f71.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e40f588514ed64667f6c065dc8fd35f/href">https://medium.com/media/1e40f588514ed64667f6c065dc8fd35f/href</a></iframe><p>You view the full CodePen in your browser by <a href="https://codepen.io/cavezza/pen/xxKdbGM">clicking here</a>.</p><p>Don’t forget that CodePen is interactive! You should interact with the CodePen and play around with the values. Change some values, see what happens. Remove an element and see how it changes how the graph is displayed on your screen.</p><p>Let’s start looking at the code.</p><p>First, we have an &lt;svg&gt; tag that is creating an area where we can draw the elements we see. In essence, this tag is drawing our canvas. This creates a canvas that is 600 pixels wide and 400 pixels high. Now that we have the canvas ready, it’s time to start putting shapes on that canvas.</p><p>Now, to place items on this canvas, we have to tell the canvas the x and y coordinates for each item. On an SVG canvas, the coordinates start at the top left. If we want 0,0, that would be the very top left. If we want 600,400, that would give us the very bottom right. The graphic below should help explain this better than text can.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/0*ct2V-ntFSodbMcMm.png" /><figcaption>The SVG Coordinate System</figcaption></figure><p>Let’s continue looking at the code. The next line of code is:</p><pre>&lt;g class=&quot;axis axis-y&quot; transform=&quot;translate(40, 40)&quot; fill=&quot;none&quot; font-size=&quot;10&quot; font-family=&quot;sans-serif&quot; text-anchor=&quot;end&quot;&gt;</pre><p>&lt;g&gt; is an interesting sub element of &lt;svg&gt;. It’s the only element besides &lt;svg&gt; itself that isn’t drawing a shape. &lt;g&gt; a container that is used to group other SVG elements. “The important aspect of a &lt;g&gt; element to know is that transformations applied to the &lt;g&gt; element are performed on its child elements and its attributes are inherited by its children” (<a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g">from Mozilla mdn</a>). You can test this out in the CodePen by taking the transform of a grouping element, removing it from the g element, and putting it on each of its descendants.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/0*oSN0cW1Nf1qOhK83.gif" /></figure><p>What’s important to note is what the transform attribute does. Transform defines a list of definitions that are applied to it and its children. The most common one you often see is translate(x, y). What this does is moves the item and its children to the right x amount of pixels and down y amount of pixels.</p><p>There are other, more complex transform options. You will be able to do some really cool animations when you learn transforms well and combine them with animations in D3.</p><p>In the next line, we encounter the &lt;path&gt; element.</p><p>&lt;path class=&quot;domain&quot; stroke=&quot;#f00&quot; d=&quot;M-6,0.5H0.5V320.5H-6&quot;&gt;&lt;/path&gt;</p><p>Path is an intriguing element and what I believe to be the most complex element in SVG land. In the &lt;path&gt; element, the magic happens in the d= area. I am still not able to decipher what the specific values inside the d attribute do in a path element. When you draw more complex line graphs, that value can grow to hundreds or thousands of characters. What a path does is draws on the canvas. It is used to draw more complex objects than simple shapes.</p><p>The &lt;path&gt;in our example is the only one that isn’t a simple line or a simple shape. This particular &lt;path&gt; object draws a line with two ends sticking out of it. Instead of a typical line that looks like | (a line), they look like ] (a line with two lines sticking out at the ends). This might be the simplest &lt;path&gt; element you’ll ever see as they get extremely more complex.</p><p>Here’s a screenshot of changing the color of that path so you can fully understand what I mean.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/0*9LTrLfrmoxd5dQhV.png" /></figure><p>Although we’re not looking at it here, &lt;path&gt;s are where D3 really starts to shine. Since the values in the d attribute are so complex, a tool like D3 is important to be able to write code that other developers will understand when building these complex path objects.</p><p>On the next line, we run into the &lt;g&gt; element again.&lt;g class=&quot;tick&quot; opacity=&quot;1&quot;&gt;</p><p>Since we discussed the &lt;g&gt; element earlier, we now know that this will add the tick class to all of its descendants and will also pass the opacity of 1 to all of its descendants (two elements – a &lt;line&gt; element and a &lt;text&gt; element).</p><p>Next, we see the &lt;line&gt; element. As you might have guessed, a line element draws a simple line: &lt;line stroke=&quot;#000&quot; x2=&quot;520&quot; transform=&quot;translate(0,29.59)&quot;&gt;&lt;/line&gt;</p><p>Stroke is the color of the line. x2 is the x coordinate where the line ends. x1‘s default value is 0. Since there are no values for x1, y1, or y2, we know that they all default to 0. Due to the inherited transforms, this specific element’s own “grid system” starts where the transforms have it start.</p><p>Next, we run into the &lt;text&gt; element. And this SVG element does exactly what you expect it to, it renders text on the SVG canvas. The reason we have a &lt;text&gt; element within SVG elements is so you can place it on the canvas by giving it x and y coordinates.</p><p>The x attribute tells you where that element should be placed on the xcoordinate plane. The dyattribute is a little different. This tells you where the element should be placed on the y axis in comparison to the previous element. In this example, we are placing it 0.32 ems away from the line element before it. If you’re not familiar with em, it’s the same as the computed font-size of an element. Alternatives to use (instead of an em) are pixels or rems. You can also use percentages in the dy attribute.</p><p>What this first pattern does that we just looked at is draw the y axis and the horizontal lines along the y axis. Then, it draws the horizontal line on the grid next to 90 and placed the text of 90 onto the grid.</p><p>Now, you will see this pattern repeated a few times as the rest of those horizontal lines and text field numbers are placed on the grid. <br>Once that is complete, you will see an almost identical grouping of elements that add values to the x axis. Here is the complete code that draws all the lines of the canvas (not including the graph rectangles themselves). You should now be able to understand this entire block of code since we went through all of the building blocks above.</p><pre>&lt;g class=&quot;axis axis-y&quot; transform=&quot;translate(40, 40)&quot; fill=&quot;none&quot; font-size=&quot;10&quot; font-family=&quot;sans-serif&quot; text-anchor=&quot;end&quot;&gt;<br>    &lt;path class=&quot;domain&quot; stroke=&quot;#f00&quot; d=&quot;M-6,0.5H0.5V320.5H-6&quot;&gt;&lt;/path&gt;<br>    &lt;g class=&quot;tick&quot; opacity=&quot;1&quot;&gt;<br>        &lt;line stroke=&quot;#000&quot; x2=&quot;520&quot; transform=&quot;translate(0,29.59)&quot;&gt;&lt;/line&gt;<br>        &lt;text fill=&quot;#000&quot; x=&quot;-10&quot; dy=&quot;0.32em&quot; transform=&quot;translate(0,29.59)&quot;&gt;90&lt;/text&gt;<br>    &lt;/g&gt;<br>    &lt;g class=&quot;tick&quot; opacity=&quot;1&quot; transform=&quot;translate(0,126.56)&quot;&gt;<br>        &lt;line stroke=&quot;#000&quot; x2=&quot;520&quot;&gt;&lt;/line&gt;<br>        &lt;text fill=&quot;#000&quot; x=&quot;-10&quot; dy=&quot;0.32em&quot;&gt;60&lt;/text&gt;<br>    &lt;/g&gt;<br>    &lt;g class=&quot;tick&quot; opacity=&quot;1&quot; transform=&quot;translate(0,223.53)&quot;&gt;<br>        &lt;line stroke=&quot;#000&quot; x2=&quot;520&quot;&gt;&lt;/line&gt;<br>        &lt;text fill=&quot;#000&quot; x=&quot;-10&quot; dy=&quot;0.32em&quot;&gt;30&lt;/text&gt;<br>    &lt;/g&gt;<br>    &lt;g class=&quot;tick&quot; opacity=&quot;1&quot; transform=&quot;translate(0,320.5)&quot;&gt;<br>        &lt;line stroke=&quot;#000&quot; x2=&quot;520&quot;&gt;&lt;/line&gt;<br>        &lt;text fill=&quot;#000&quot; x=&quot;-10&quot; dy=&quot;0.32em&quot;&gt;0&lt;/text&gt;<br>    &lt;/g&gt;<br>&lt;/g&gt;<br>&lt;g class=&quot;axis axis-x&quot; transform=&quot;translate(40, 360)&quot; fill=&quot;none&quot; font-size=&quot;10&quot; font-family=&quot;sans-serif&quot; text-anchor=&quot;middle&quot;&gt;<br>    &lt;path class=&quot;domain&quot; stroke=&quot;#000&quot; d=&quot;M0.5,6V0.5H520.5V6&quot;&gt;&lt;/path&gt;<br>    &lt;g class=&quot;tick&quot; opacity=&quot;1&quot; transform=&quot;translate(87.16,0)&quot;&gt;<br>        &lt;line stroke=&quot;#000&quot; y2=&quot;6&quot;&gt;&lt;/line&gt;<br>        &lt;text fill=&quot;#000&quot; y=&quot;9&quot; dy=&quot;0.71em&quot;&gt;Mon&lt;/text&gt;<br>    &lt;/g&gt;<br>    &lt;g class=&quot;tick&quot; opacity=&quot;1&quot; transform=&quot;translate(260.5,0)&quot;&gt;<br>        &lt;line stroke=&quot;#000&quot; y2=&quot;6&quot;&gt;&lt;/line&gt;<br>        &lt;text fill=&quot;#000&quot; y=&quot;9&quot; dy=&quot;0.71em&quot;&gt;Tues&lt;/text&gt;<br>    &lt;/g&gt;<br>    &lt;g class=&quot;tick&quot; opacity=&quot;1&quot; transform=&quot;translate(433.83,0)&quot;&gt;<br>        &lt;line stroke=&quot;#000&quot; y2=&quot;6&quot;&gt;&lt;/line&gt;<br>        &lt;text fill=&quot;#000&quot; y=&quot;9&quot; dy=&quot;0.71em&quot;&gt;Wed&lt;/text&gt;<br>    &lt;/g&gt;<br>&lt;/g&gt;</pre><p>What’s left is the drawing of the graphing elements themselves. At this point, I’m not sure if you would be surprised or expecting to learn that these three graphing elements are nothing more than rectangles.<br>Here is the full code to build the three rectangles on our graph:</p><pre>&lt;rect class=&quot;bar-line&quot; transform=&quot;translate(40, 40)&quot; height=&quot;320&quot; width=&quot;153.33&quot; x=&quot;10&quot; y=&quot;0&quot;&gt;&lt;/rect&gt;<br>&lt;rect class=&quot;bar-line&quot; transform=&quot;translate(40, 40)&quot; height=&quot;203.63&quot; width=&quot;153.33&quot; x=&quot;183.33&quot; y=&quot;116.36&quot;&gt;&lt;/rect&gt;<br>&lt;rect class=&quot;bar-line&quot; transform=&quot;translate(40, 40)&quot; height=&quot;132.52&quot; width=&quot;153.33&quot; x=&quot;356.66&quot; y=&quot;187.47&quot;&gt;&lt;/rect&gt;</pre><p>&lt;rect&gt;s are one of the more simple SVG elements. You apply a height and width, and then also the starting x and y coordinates.</p><p><strong>And that’s it for this visualization!</strong></p><p>At this point, you know enough SVG code to be able to create graphs that you can reasonably expect to be needed at your job. Congratulations! Most people don’t fully understand SVGs in order to explain it to other engineers. <br>Today, you achieved that milestone!</p><p>At this point, you probably didn’t fully understand one or two of the elements from the CodePen. If that’s the case, you should go and change some of the CodePen values to see what happens to the visualization when those values are changed. Playing with code is the easiest way to make sure you understand it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79798a987d5e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fincura-engineering/the-simple-guide-to-html-svgs-79798a987d5e">The Simple Guide to HTML SVGs</a> was originally published in <a href="https://medium.com/fincura-engineering">Fincura Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Front End Architecture for Angular Applications]]></title>
            <link>https://medium.com/fincura-engineering/front-end-architecture-for-angular-applications-d6840b78706c?source=rss-219a517280de------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6840b78706c</guid>
            <category><![CDATA[angular2]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[frontend-architecture]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Bob Cavezza]]></dc:creator>
            <pubDate>Thu, 15 Aug 2019 00:58:55 GMT</pubDate>
            <atom:updated>2019-08-15T00:58:55.205Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BlLt70cftbPuXUONDGFEKg.png" /></figure><p>In my current role as Director of Product Engineering at <a href="https://www.fincura.com/">FINCURA</a>, I’m often thinking about our front end architecture. For our front end application, we use Angular.</p><p>Angular architecture comes down to three main players: services, container components, and presentation components (to read more about these, Angular University has a <a href="https://blog.angular-university.io/angular-2-smart-components-vs-presentation-components-whats-the-difference-when-to-use-each-and-why/">great post</a> on this topic).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZBRKVN8FRS_IaypD.png" /></figure><p>I’m going to explain each of these pieces separately, but to get a snapshot of what’s going on, take a look at this diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/0*ACEd7hxg-M6cKM9d.jpg" /></figure><p>[Image by Claudo Clavijo from his slideshare deck at <a href="https://www.slideshare.net/paucls/angular-and-redux">https://www.slideshare.net/paucls/angular-and-redux</a>]</p><p><strong>Services</strong></p><p>Services will do the heavy lifting for your application. They should contain all business logic in your application because business logic will typically be used system-wide. In order to ensure maximum reusability, make sure you can access business rules easily. Angular’s dependency injection for services makes it trivial to reuse service methods site-wide.</p><p>If you’re not using Redux, you will want to store system-wide state in services. One common example is keeping the current logged in user as a variable in the `UserService`. It is an alternative option to store common state in a system-wide container component that is the master parent. However, if you do this, there will be instances in your application where you pass a `user` variable down in many places. You can expect most components to need the `user` variable at different times. I call this “Input() Hell” and it’s not all that different from “callback” hell.</p><p>Services don’t have any visual output. They process data for components and then components are the part of the infrastructure that display information.</p><p>According to <a href="https://angular.io/guide/testing#service-tests">Angular’s official documentation</a>, “services are the easiest files to unit test” and I agree with that statement. Generally, when you test services, you don’t need to worry about the Angular TestBed. Services aren’t much more than regular javascript classes. My go-to method for testing services are to instantiate the service classes with their dependencies mocked using jasmine’s “createSpyObj” method. Once you do that, you can write tests as if you were dealing with a regular javascript class. Here’s a quick example of a test I wrote a few weeks ago:</p><pre>describe(&#39;PortfolioService&#39;, () =&gt; {<br>    let portfolioService: PortfolioService<br>    const apiServiceSpy = jasmine.createSpyObj(&#39;ApiService&#39;, {&#39;send&#39;: of( { response: { objects: [] }} ) } );</pre><pre>    beforeEach(() =&gt; {<br>        portfolioService = new PortfolioService(apiServiceSpy);<br>    });</pre><pre>    describe(&#39;#cssColorNumber&#39;, () =&gt; {<br>        beforeEach(() =&gt; {<br>            const portfolios = [<br>               { name: &#39;Portfolio1&#39;, id: 0 },<br>               { name: &#39;Portfolio2&#39;, id: 1 },<br>               { name: &#39;Portfolio3&#39;, id: 2 },<br>               { name: &#39;Portfolio4&#39;, id: 13 },<br>               { name: &#39;Portfolio5&#39;, id: 14 },<br>            ];</pre><pre>            portfolioService.portfolios = portfolios;<br>        });<br></pre><pre>        it(&#39;returns id index +1 of id found&#39;, () =&gt; {<br>            const expectedResult = 5;<br>            const result = portfolioService.cssColorNumber({name: &#39;Portfolio5&#39;, id: 14});</pre><pre>            expect(result).toEqual(expectedResult);<br>        });<br>    });<br>});</pre><p>In the test above, we are testing the output of a method that returns the index+1 of objects found in an array by their id. Before each test, we instantiate the service class with a mocked dependency injection. We apply sample data to the service we are testing. Then, we are able to test this with a simple expectation. No TestBed needed and no complicated setup that typically comes with the TestBed.</p><p>In summary, services should contain all business logic for your application, contain shared state over different pieces of the application, perform all api calls, and have no visual output. They are also much easier to test than presentation components.</p><p><strong>Container Components</strong></p><p>Container components get their name because they contain presentation components, and always pass data down to these presentation component layers. They are sometimes referred to as smart components. In many cases, you will have nested container components that pass data down to other containers, which eventually pass data down to presentation components.</p><p>It’s difficult to get a true sense of what this looks like without an example, so let’s take a look at how this works in practice.</p><p>Let’s use the LinkedIn homepage as our example. Here is a recent screenshot of my LinkedIn homepage when logged in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Kr9sV2MV30sJuRqa.png" /></figure><p>Here’s an attempt to break this up based on what I assume LinkedIn’s container components and presentation components are (in their front end architecture). Note: Most of my abilities to mock up container components and presentation components comes from reading <a href="https://reactjs.org/docs/thinking-in-react.html">Thinking in React</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l85w3OPDHh2RB5iU.png" /></figure><p>The different colors represent the hierarchies of container components. The main focus for drawing components in this example is the left side navigation bar and all of its parents (which are also container components). The entire page is wrapped by a red line. This will typically be called “app-component” in an application. The next yellow layer of hierarchy separates the top navigation bar from the main wrapper component, which will represent the body of the page. The pink layer is the container for the sidebar. After that, the orange breaks up each of the clearly separated panels. Then the panels are further subdivided into separate child components. The red, yellow, purple, and orange are all container components. Once we get past that, it’s a little more hazy depending on what exactly the application is doing and how granular LinkedIn builds its presentation components. Once you get down to the green layer, you are now looking at presentation components. It’s pretty easy to tell how the top 2 green rectangles and the bottom two green rectangles are probably reused presentation components based on how similar they look.</p><p>In our Angular application, we utilize a technique that React has made famous called “<a href="https://reactjs.org/docs/lifting-state-up.html">lifting state up</a>”. This means that we store the state used by numerous different components at their lowest shared parent component.</p><p>Let’s use LinkedIn’s homepage for this example as well. In our current working example, we have one instance of a user’s avatar on the page. A product manager has come to us and has told us that she wants to add a new item to the top navigation component that contains the user’s avatar. The mockup she gives us looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6RzNQQaVWBQn8DAz.png" /></figure><p>[The mockup our PM has given us. Click to enlarge]</p><p>If we look closely at the page that we marked up with the component structure, we can see that we already have the avatar on the page. One option is to call our user service again as part of the navigation component, but http calls are expensive. Instead, we want to move where we store the user’s avatar information up to a common parent of both the side navigation bar and the top navigation header. That common parent is the component that we highlighted with a red outline — “app-component”.</p><p>If we are currently calling the UserService.getUser method in the orange panel container component, we will now want to call that method in app component (the red wrapper). Then, we will pass down the avatar url as “@Input()”s down to the yellow, down to the maroon, and then down to the orange, where it lived to begin with. We will also pass that same value down to the yellow navigation component and to its children where the new html element will live and display the avatar on the navigation bar.</p><p>Containers do not do a lot of heavy lifting for the visual components, but they do have a key presentation responsibility. That responsibility is the placement of presentation components. A good rule of thumb is that you don’t want presentation components to have margin css attributes. The positioning of presentation components should generally be controlled by their parent container components.</p><p>Testing container components is generally the hardest of the three types of files we discuss in this article. The main reason for this is the handling of state. State changes and angular lifecycle methods need to be tested. This causes added testing complexity. A key reason to separate out container components and presentation components is so you test container components less and presentation components more.</p><p><strong>Presentation components</strong></p><p>Presentation components are sometimes referred to as “dumb” components, used mostly to display information. Presentation components will inherit all data and events (@Input()s and @Output()s) from parent components. They are entirely visual output components.</p><p>Continuing with our LinkedIn example, we can see a presentation wrapped in green:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5b0fwIALMeD_vOJr.png" /></figure><p>This presentation component is used four times on this page, in two separate places. You can reasonably guess what the inputs and outputs are for this presentation component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*mr4X0r76znPDDjYe.png" /></figure><p>The inputs and outputs for this component will probably look something like this:</p><pre>@Input() label <br>@Input() value<br>@Output() onClickLabel<br>@Output() onClickValue</pre><p>These inputs and outputs are passed in by their parents.</p><p><strong>Why separate container and presentation components?</strong></p><p>There are three reasons: (1) reusability, (2) testability, (both reusability and testability cited from <a href="https://medium.com/@cyrilletuzi/architecture-in-angular-projects-242606567e40">this article</a>), and (3) ease of use for HTML/CSS designers.</p><p><em>(1) Reusability</em></p><p>If you break components down into smaller and smaller pieces, you will be able to reuse different components in different areas of your code. You can see this in the LinkedIn example with the green outlines on the sidebar. This is all about the “DRY” (don’t repeat yourself) principle. If you didn’t break those green outlines into presentation components, you would have coded the same thing twice. If you later got instructions to change something there, you would have to make changes in multiple places. Doing this usually leads to bugs.</p><p><em>(2) Testability</em></p><p>Presentation components are much easier to test than container components. When you remove state and lifecycle methods as concerns, testing is much easier. Yes, you do need to test container components. It’s a part of writing good, maintainable code. However, the more testing you can do in presentation components, the better off you will be.</p><p><em>(3) HTML/CSS Developers</em></p><p>Many software teams have varying degrees of skillsets. It is not unusual to have someone on the team that knows HTML and CSS really well, but little javascript. When you separate presentation components and container components, it is now a lot easier for HTML/CSS specialists to tweak design-related code. Using a tool like <a href="https://storybook.js.org/">Storybook</a> works wonders on letting HTML/CSS developers control design elements.</p><p><strong>Conclusion</strong></p><p>This architecture has worked well for us. Separating logic into services, container components, and presentation components has made testing easier. Having a well tested codebase has allowed us to have a much more stable application.</p><p>Breaking components down into presentation components has increased our code reusability. Code reusability has allowed us to deliver features faster and introduce less bugs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6840b78706c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fincura-engineering/front-end-architecture-for-angular-applications-d6840b78706c">Front End Architecture for Angular Applications</a> was originally published in <a href="https://medium.com/fincura-engineering">Fincura Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>