<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alexander Karlsson</title>
    <description>The latest articles on DEV Community by Alexander Karlsson (@mindspank).</description>
    <link>https://dev.to/mindspank</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F5367%2F-DsUs1c6.jpg</url>
      <title>DEV Community: Alexander Karlsson</title>
      <link>https://dev.to/mindspank</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mindspank"/>
    <language>en</language>
    <item>
      <title>Qlik ❤ D3 </title>
      <dc:creator>Alexander Karlsson</dc:creator>
      <pubDate>Mon, 17 Sep 2018 14:35:32 +0000</pubDate>
      <link>https://dev.to/qlikbranch/qlik--d3--4h48</link>
      <guid>https://dev.to/qlikbranch/qlik--d3--4h48</guid>
      <description>&lt;p&gt;Chances are that if you have seen a piece of data visualization on the web you have come across &lt;a href="https://d3js.org/"&gt;D3&lt;/a&gt;. It’s heavily used by organizations like The New York Times to produce wonderful graphics that engage their readers and enhances their stories.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; Together with &lt;a href="https://developer.qlik.com"&gt;Qlik&lt;/a&gt; you can create very lean data visualizations using D3, letting D3 bind the data to the DOM and draw visualizations. Letting Qlik perform the heavy lifting in terms of data manipulation and a reactive data flow, abstraction away data state management from D3.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FC5LPtDA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2ASRSaPD--YuRzB5hQK-e8AA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FC5LPtDA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/1600/1%2ASRSaPD--YuRzB5hQK-e8AA.png" alt="d3 example on GitHub"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sample project: &lt;a href="https://github.com/mindspank/d3-blogpost-example"&gt;https://github.com/mindspank/d3-blogpost-example&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Ironically, while you can create wonderful data visualizations using D3 it is &lt;strong&gt;not&lt;/strong&gt; a data visualization library. It has no bar chart or line chart methods. Instead it focuses on binding data to the DOM and performing manipulations of the document based on data. The data binding paired with additional components such as layout algorithms and components such as scales and axis makes it a perfect library for general purpose data visualization.&lt;/p&gt;

&lt;p&gt;Where D3 suffers is when you have many visualizations on the page that you want to keep in sync, manipulating larger data sets and having to fetch the full data sets to calculate a proper scale.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Looks familiar?&lt;/span&gt;
&lt;span class="nx"&gt;d3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;scaleLinear&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;range&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;domain&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;d3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;})]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Qlik to the rescue!
&lt;/h3&gt;

&lt;p&gt;Luckily the &lt;a href="https://developer.qlik.com/knowledge/tutorial/engineTutorial"&gt;Qlik Associative Engine&lt;/a&gt; is a blazingly fast in-memory computation engine that provides tons of useful metadata around your data geared towards building visualization components.&lt;/p&gt;

&lt;p&gt;By letting Qlik take care of the data computation you can omit heavy data wrangling on the client and push those calculations onto the server, leaving you with very lean front-end code that focuses on what D3 does best; binding data to the DOM and outputting a visualization representation of that data.&lt;/p&gt;

&lt;p&gt;To cherry pick a few nuggets that Qlik gives you out of the box:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimum and maximum values for calculations for scale inputs&lt;/li&gt;
&lt;li&gt;Glyph counts for the longest dimensional value for label widths&lt;/li&gt;
&lt;li&gt;Data reduction for “glanceable” visualizations&lt;/li&gt;
&lt;li&gt;Server-side configurable sorting and formatting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most of the points above D3 handles quite fine, however for larger datasets it’s quite taxing on the browser to crunch all those numbers.&lt;/p&gt;

&lt;p&gt;However, for me personally, the biggest win is that I can write code that is readable, neat and doesn’t mutate my data.&lt;/p&gt;

</description>
      <category>d3</category>
      <category>javascript</category>
      <category>qlik</category>
      <category>data</category>
    </item>
  </channel>
</rss>
