<?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>Forem: Narayana Swamy</title>
    <description>The latest articles on Forem by Narayana Swamy (@nswamy14).</description>
    <link>https://forem.com/nswamy14</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%2F1250657%2F3e4e3969-5b7e-4580-8fb3-92c3634ae3f1.png</url>
      <title>Forem: Narayana Swamy</title>
      <link>https://forem.com/nswamy14</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/nswamy14"/>
    <language>en</language>
    <item>
      <title>Creating visually rich PDFs with PDF-Frame-Vue</title>
      <dc:creator>Narayana Swamy</dc:creator>
      <pubDate>Sun, 21 Jan 2024 10:10:15 +0000</pubDate>
      <link>https://forem.com/nswamy14/creating-visually-rich-pdfs-with-pdf-frame-vue-4577</link>
      <guid>https://forem.com/nswamy14/creating-visually-rich-pdfs-with-pdf-frame-vue-4577</guid>
      <description>&lt;p&gt;Ever wondered how to generate PDF and graphics content in HTML without writing any code? Forget graphics coding, say hello to &lt;strong&gt;PDF-Frame-vue&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3aswwpayc1n6acc8rosm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3aswwpayc1n6acc8rosm.png" alt="Pdf-frame logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  PDF-Frame-Vue
&lt;/h2&gt;

&lt;p&gt;PDF-Frame-Vue is a cutting-edge vue.js component designed for rendering PDF and Canvas graphics effortlessly on the web. This component boasts an intuitive HTML-based syntax and semantics that simplifies the creation and management of graphical content. Leveraging the i2djs framework, PDF-Frame-Vue currently supports rendering outputs in both PDF and Canvas formats.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Declarative Syntax&lt;/strong&gt;: Easily define PDF/Canvas graphical content using a clear and declarative syntax.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SVG-like Syntax and Semantics&lt;/strong&gt;: Adopts the familiar SVG tag and attribute syntax for defining geometrical shapes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistent Rendering&lt;/strong&gt;: Provides the same syntax and semantics for rendering both PDF and Canvas outputs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auto Layouting&lt;/strong&gt;: Automatic layout adjustments when content overflows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-page Support&lt;/strong&gt;: Create multi-page PDF documents seamlessly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Animations &amp;amp; Events&lt;/strong&gt;: Easy way to define the animations and events on elements in canvas context.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sample PDF-Frame template&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;pdfFrame 
    type="pdf" 
    :width="595" 
    :height="841" 
    :config="object" 
    :info="infoObj" 
    :encryption="encryptionObj"&amp;gt;
    &amp;lt;!-- Page Templates --&amp;gt;
    &amp;lt;i-page-template id="temp-1"&amp;gt;
        &amp;lt;i-rect :x="0" :y="0" :width="595" :height="841" :style="{ fill:'#ff0000' }"&amp;gt;&amp;lt;/i-rect&amp;gt;
    &amp;lt;/i-page-template&amp;gt;

    &amp;lt;!-- Page 1 --&amp;gt;
    &amp;lt;i-page p-template="temp-1"&amp;gt;
        &amp;lt;i-rect :x="30" :y="100" :width="535" :height="700" :style="{ fill:'#f0f0f0' }"&amp;gt;&amp;lt;/i-rect&amp;gt;
        &amp;lt;i-text :x="30" :y="60" :text="'Page 1 Title'" :width="530" :style="{font: '25px Arial', align: 'center'}"&amp;gt;&amp;lt;/i-text&amp;gt;
    &amp;lt;/i-page&amp;gt;

    &amp;lt;!-- Page 2 --&amp;gt;
    &amp;lt;i-page p-template="temp-1"&amp;gt;
        &amp;lt;i-text :x="30" :y="60" :text="'Page 2 Title'" :width="530" :style="{font: '25px Arial', align: 'center'}"&amp;gt;&amp;lt;/i-text&amp;gt;
        &amp;lt;i-image src="src/assets/i2d-frame.svg" :width="200" :x="175" :y="100"&amp;gt;&amp;lt;/i-image&amp;gt;
    &amp;lt;/i-page&amp;gt; 
&amp;lt;/pdfFrame&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Harnessing Vue's capabilities:
&lt;/h2&gt;

&lt;p&gt;PDF-Frame-Vue utilizes Vue.js' custom renderer approach, tapping into the framework's templating engine, reactivity system, and component architecture.&lt;/p&gt;
&lt;h2&gt;
  
  
  Template Engine:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Declarative Syntax&lt;/strong&gt;: pdf-frame-vue templates use HTML-like syntax, allowing developers to express complex rendering logic in a simple and readable way.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic Content&lt;/strong&gt;: Through directives, expressions, and bindings, pdf-frame-vue templates can render content based on dynamic data. With pdf-frame, this means the ability to create dynamic PDF content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Component architecture&lt;/strong&gt;: self-contained, reusable pieces of code that can be used to create complex UIs.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Reactivity:
&lt;/h2&gt;

&lt;p&gt;With Vue's reactivity system, any changes in data are automatically reflected in the pdf/Canvas.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automatic Updates: If the data used to generate the PDF changes, the PDF will be automatically updated to reflect those changes. Reactivity in PDF Rendering: This reactivity extends to the PDF content itself, enabling real-time updates of the PDF as the underlying Vue data changes.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Easy Integrations:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Seamless Integration&lt;/strong&gt;: pdf-frame-vue can be integrated directly within a Vue application, meaning developers can define and manipulate PDF content just as they would any other Vue component.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Broad Accessibility&lt;/strong&gt;: By integrating pdf-frame-vue, developers can leverage their existing knowledge of Vue and its ecosystem, making it a highly accessible tool for anyone familiar with Vue development.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Experience the synergy of Vue.js and PDF-Frame-Vue for a seamless and powerful approach to PDF and Canvas rendering in web applications.&lt;/p&gt;
&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

npm install @i2d/pdf-frame-vue


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Github&lt;/strong&gt;: &lt;a href="https://github.com/I2Djs/pdf-frame" rel="noopener noreferrer"&gt;https://github.com/I2Djs/pdf-frame&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;npm&lt;/strong&gt;: &lt;a href="https://www.npmjs.com/package/@i2d/pdf-frame-vue" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/@i2d/pdf-frame-vue&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Integration
&lt;/h2&gt;

&lt;p&gt;Register the pdf-frame-vue component into your application as shown below.&lt;/p&gt;

&lt;p&gt;Add the following code in vue entry file: main.js&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

import pdfFrame from "@i2d/pdf-frame-vue";

createApp(App).component("pdfFrame", pdfFrame)


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  PDF Capability:
&lt;/h2&gt;

&lt;p&gt;PDF-frame provides a wide range of geometrical primitives, similar to SVG, and also a set of abstract tags like i-page, i-page-template.. etc for easily defining the graphical content of PDFs. Below is a sample PDF-frame template for PDF rendering.&lt;br&gt;
Tags such as  and  are specifically designed and applicable only within the context of PDFs.&lt;/p&gt;
&lt;h3&gt;
  
  
  PDF Template: &lt;a href="https://pr3kh5.csb.app/" rel="noopener noreferrer"&gt;https://pr3kh5.csb.app/&lt;/a&gt;
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;pdfFrame 
    type="pdf" 
    :width="595" 
    :height="841" 
    :config="object" 
    :info="infoObj" 
    :encryption="encryptionObj"&amp;gt;
    &amp;lt;!-- Page Templates --&amp;gt;
    &amp;lt;i-page-template id="temp-1"&amp;gt;
        &amp;lt;i-rect :x="0" :y="0" :width="595" :height="841" :style="{ fill:'#ffffff' }"&amp;gt;&amp;lt;/i-rect&amp;gt;
        &amp;lt;i-text :x="30" :y="30" :text="'Header Text'" :width="530" :style="{font: '15px Arial'}"&amp;gt;&amp;lt;/i-text&amp;gt;
        &amp;lt;i-text :x="30" :y="810" :text="'Footer Text'" :width="530" :style="{font: '15px Arial'}"&amp;gt;&amp;lt;/i-text&amp;gt;
    &amp;lt;/i-page-template&amp;gt;
    &amp;lt;!-- Page 1 --&amp;gt;
    &amp;lt;i-page p-template="temp-1"&amp;gt;
        &amp;lt;i-text :x="30" :y="60" :text="'Page 1 Title'" :width="530" :style="{font: '25px Arial', align: 'center'}"&amp;gt;&amp;lt;/i-text&amp;gt;
        &amp;lt;i-rect :x="30" :y="100" :width="535" :height="700" :style="{ fill:'#f0f0f0' }"&amp;gt;&amp;lt;/i-rect&amp;gt;
    &amp;lt;/i-page&amp;gt;

    &amp;lt;!-- Page 2 --&amp;gt;
    &amp;lt;i-page p-template="temp-1"&amp;gt;
        &amp;lt;i-text :x="30" :y="60" :text="'Page 2 Title'" :width="530" :style="{font: '25px Arial', align: 'center'}"&amp;gt;&amp;lt;/i-text&amp;gt;
        &amp;lt;i-image src="src/assets/i2d-frame.svg" :width="200" :x="175" :y="100"&amp;gt;&amp;lt;/i-image&amp;gt;
    &amp;lt;/i-page&amp;gt; 
&amp;lt;/pdfFrame&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="https://stackblitz.com/edit/pdf-frame-vuejs?file=src%2FApp.vue" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fulgiooajjcqt8l0v1tbx.png" alt="pdf icon"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Canvas Capability:
&lt;/h2&gt;

&lt;p&gt;Similar to the PDF template, the canvas template also supports all geometrical permeative tags for defining 2D graphics. Below is the sample pdf-frame template for Canvas rendering. It also provides a way to define events and animations on elements.&lt;br&gt;
Some of the tags like  are not applicable for canvas context.&lt;/p&gt;
&lt;h3&gt;
  
  
  Canvas Template: &lt;a href="https://cmynlk.csb.app/" rel="noopener noreferrer"&gt;https://cmynlk.csb.app/&lt;/a&gt;
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;pdfFrame type="canvas" width="595" height="841"&amp;gt;
    &amp;lt;!-- Background Rectangle --&amp;gt;
    &amp;lt;i-rect :x="30" :y="100" :width="535" :height="700" :style="{ fill:'#f0f0f0' }"&amp;gt;&amp;lt;/i-rect&amp;gt;

    &amp;lt;!-- Dynamic Rectangles --&amp;gt;
    &amp;lt;i-rect
        v-for="n in 30"
        v-bind:key="n"
        :x="0"
        :y="n * 11"
        :width="(Math.sin(n * 0.4 - 4.5) + 1) * 3 + 4"
        :height="(Math.sin(n * 0.4 - 4.5) + 1) * 3 + 4"
        :transform="() =&amp;gt; ({
            translate: [130, 360]
        })"
        :style="{
          fill: 'hsl(230 ,100%,50%)',
          opacity: 0.6,
          lineWidth: 1,
        }"
        :event="{
            click: clickEventHndlr,
            dbClick: dbClickEventHndlr
        }"
    /&amp;gt;
&amp;lt;/pdfFrame&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;iframe src="https://stackblitz.com/edit/pdf-frame-vuejs-canvas?embed=1&amp;amp;file=src%2FApp.vue" width="100%" height="500"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Animation:
&lt;/h2&gt;

&lt;p&gt;The PDF-Frame provides an intuitive way to specify animations on PDF-Frame elements. Using the &lt;strong&gt;&lt;/strong&gt; element allows you to define the transitions of attributes and style properties for its parent element. In the provided example, transitions of x, y, and style properties have been applied to the rect element. Pdf-frame also provides &lt;strong&gt;&lt;/strong&gt;, which enables the animation of the "d" attribute in the path element.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;pdfFrame type="canvas" width="595" height="841"&amp;gt;
    &amp;lt;i-rect 
        :x="30" 
        :y="100" 
        :width="535" 
        :height="700" 
        :style="{ fill:'#f0f0f0' }"&amp;gt;
          &amp;lt;i-animate
            :duration="1000"
            :ease="linear"
            :to="{
              x: 200,
              y: 300,
              style: { fill: '#ff0000' }
            }" /&amp;gt;
    &amp;lt;/i-rect&amp;gt;
&amp;lt;/pdfFrame&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;iframe src="https://stackblitz.com/edit/pdf-frame-vuejs-canvas-qp1rhy?embed=1&amp;amp;file=src%2FApp.vue" width="100%" height="500"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Events:
&lt;/h2&gt;

&lt;p&gt;PDF-Frame facilitates easy integration of various events into its elements. For instance, in the example given, click and mouseover event handlers are attached to the rect element within the PDF-Frame canvas. The PDF-Frame canvas is versatile, supporting a wide array of events including &lt;strong&gt;click&lt;/strong&gt;, &lt;strong&gt;double-click&lt;/strong&gt;, &lt;strong&gt;mouseover&lt;/strong&gt;,  &lt;strong&gt;mousemove&lt;/strong&gt;, &lt;strong&gt;mousedown&lt;/strong&gt;, &lt;strong&gt;mouseup&lt;/strong&gt;, &lt;strong&gt;mouseleave&lt;/strong&gt;, &lt;strong&gt;contextmenu&lt;/strong&gt;, and various touch events like &lt;strong&gt;touchstart&lt;/strong&gt;, &lt;strong&gt;touchend&lt;/strong&gt;, &lt;strong&gt;touchmove&lt;/strong&gt;, and &lt;strong&gt;touchcancel&lt;/strong&gt;.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&lt;p&gt;&amp;lt;pdfFrame type="canvas" width="595" height="841"&amp;gt;&lt;br&gt;
    &amp;lt;i-rect &lt;br&gt;
        :x="30" &lt;br&gt;
        :y="100" &lt;br&gt;
        :width="535" &lt;br&gt;
        :height="700" &lt;br&gt;
        :style="{ fill:'#f0f0f0' }"&lt;br&gt;
        :event="{&lt;br&gt;
                click: clickHndlr,&lt;br&gt;
                mouseover: mouseHndlr&lt;br&gt;
             }"&lt;br&gt;
    &amp;gt;&lt;br&gt;
    &amp;lt;/i-rect&amp;gt;&lt;br&gt;
&amp;lt;/pdfFrame&amp;gt;&lt;/p&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Resources&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Github&lt;/strong&gt;: &lt;a href="https://github.com/I2Djs/pdf-frame" rel="noopener noreferrer"&gt;https://github.com/I2Djs/pdf-frame&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;npm&lt;/strong&gt;: &lt;a href="https://www.npmjs.com/package/@i2d/pdf-frame-vue" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/@i2d/pdf-frame-vue&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;wiki&lt;/strong&gt;: &lt;a href="https://github.com/I2Djs/pdf-frame/wiki/pdf%E2%80%90frame%E2%80%90vue" rel="noopener noreferrer"&gt;https://github.com/I2Djs/pdf-frame/wiki/pdf%E2%80%90frame%E2%80%90vue&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;element API&lt;/strong&gt;: &lt;a href="https://nswamy14.gitbook.io/i2djs-v4/api-reference/elements-api" rel="noopener noreferrer"&gt;https://nswamy14.gitbook.io/i2djs-v4/api-reference/elements-api&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>vue</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Unlocking Insights with Visual- Heatmap: A High-Performance JavaScript Module for Heatmap Visualisation</title>
      <dc:creator>Narayana Swamy</dc:creator>
      <pubDate>Mon, 15 Jan 2024 10:40:09 +0000</pubDate>
      <link>https://forem.com/nswamy14/unlocking-insights-with-visual-heatmap-a-high-performance-javascript-module-for-heatmap-visualisation-3f23</link>
      <guid>https://forem.com/nswamy14/unlocking-insights-with-visual-heatmap-a-high-performance-javascript-module-for-heatmap-visualisation-3f23</guid>
      <description>&lt;p&gt;In the digital age, data visualisation is crucial for understanding complex datasets. Visual Heatmap, an open-source JavaScript module, emerges as a powerful tool designed to render large-scale heatmaps with exceptional performance. This article delves into the functionality of Visual Heatmap and explores how it's revolutionising the way we visualise data.&lt;/p&gt;

&lt;p&gt;Github: &lt;a href="https://github.com/nswamy14/visual-heatmap"&gt;https://github.com/nswamy14/visual-heatmap&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Heatmap?
&lt;/h2&gt;

&lt;p&gt;A heatmap is a graphical representation of data where individual values are denoted by colors. Often used to show variation across a two-dimensional surface, heatmaps make it easy to understand complex data at a glance. They are particularly useful in various fields, from geographic mapping of demographics to displaying website traffic density.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C0E23pA1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o5lh1gf8gzca6hb7jtju.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C0E23pA1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o5lh1gf8gzca6hb7jtju.png" alt="Heatmap Image" width="800" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  High-Performance Visualisation with Visual Heatmap
&lt;/h2&gt;

&lt;p&gt;Visual Heatmap stands out due to its ability to handle and render over 500,000 data points seamlessly. By leveraging cutting-edge WebGL/Shaders for graphical rendering, it ensures that even the most extensive datasets are displayed smoothly and interactively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features and Advantages:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;High-Performance Rendering&lt;/strong&gt;: Effortlessly manage and render vast datasets with high responsiveness.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt;: Capable of visualizing over 500,000 data points, making it ideal for large-scale applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easy-to-Use Syntax&lt;/strong&gt;: The module's syntax is intuitive, making it accessible even to those new to coding.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lightweight Framework&lt;/strong&gt;: Despite its robust capabilities, Visual Heatmap is lightweight and won't bog down your applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customisable&lt;/strong&gt;: With a range of API options, users can tailor the heatmap to fit their specific needs, from adjusting point intensity and size to setting custom color gradients.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Installation and Setup
&lt;/h2&gt;

&lt;p&gt;Installing Visual Heatmap is straightforward. Users can add it to their projects via npm with&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm i visual-heatmap --save&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Or Download source code from below GitHub repo&lt;br&gt;
&lt;a href="https://github.com/nswamy14/visual-heatmap"&gt;https://github.com/nswamy14/visual-heatmap&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo:
&lt;/h2&gt;

&lt;p&gt;Click on the below examples&lt;/p&gt;

&lt;p&gt;&lt;a href="https://nswamy14.github.io/visual-heatmap/demo/heatmap3.html"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y5jrgKty--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4kkxv10rmbeddzfzk68s.png" alt="Interaction Example" width="800" height="120"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://nswamy14.github.io/visual-heatmap/demo/heatmap1.html"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5UYhmqiS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vr3e1b1n797qy1f6e0jq.png" alt="Scale Example" width="800" height="110"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://nswamy14.github.io/visual-heatmap/demo/heatmap2.html"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WxnRcOaz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s4engb1iqpup6si905l6.png" alt="Color Example" width="800" height="110"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://nswamy14.github.io/visual-heatmap/demo/heatmapWithLabels.html"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k9SC2Xlf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zhsmygmbmg78nq2juxqy.png" alt="Label Example" width="800" height="102"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Crafting Your Heatmap
&lt;/h2&gt;

&lt;p&gt;Creating a heatmap is simplified with a primary method, &lt;code&gt;Heatmap(containerId/containerElement, config)&lt;/code&gt;. This function initiates a new WebGL heatmap layer and returns a render instance for further manipulation. The configuration options are extensive, allowing for detailed customization, including size, maximum data value, blur, opacity, and more.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let renderInstance = Heatmap('#containerId', {
        size: 30.0,
        max: 100,  // if not set, will be derived from data
        min: 0,  // if not set, will be derived from data
        intensity: 1.0,
        background: {
            url: "urlPath",
            width: 100, // if not set, viewport width of the image will be considered
            height: 100, // if not set, viewport height of the image will be considered
            x: 0,
            y: 0
        },
        gradient: [{
            color: [0, 0, 255, 1.0],
            offset: 0
        }, {
            color: [0, 0, 255, 1.0],
            offset: 0.2
        }, {
            color: [0, 255, 0, 1.0],
            offset: 0.45
        }, {
            color: [255, 255, 0, 1.0],
            offset: 0.85
        }, {
            color: [255, 0, 0, 1.0],
            offset: 1.0
        }]
    });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Interactive and Dynamic
&lt;/h2&gt;

&lt;p&gt;Once instantiated, Visual Heatmap provides several API methods for dynamic interaction. Users can render data, add new data points, adjust maximum values, and apply transformations such as zoom, rotation, and translation. This interactivity ensures that the heatmap is not just a static image but a dynamic visualisation tool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;instance.renderData([])&lt;/strong&gt;&lt;br&gt;
Accepts an array of data points with 'x', 'y' and 'value'.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;instance.addData([], transformationIntactflag);&lt;/strong&gt;&lt;br&gt;
Accepts an array of data points with 'x', 'y' and 'value' and a flag to specify to apply existing canvas transformations on the newly added data points.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;instance.setMax(number)&lt;/strong&gt;&lt;br&gt;
To set max data value, for relative gradient calculations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;instance.setMin(number)&lt;/strong&gt;&lt;br&gt;
To set min data value, for relative gradient calculations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;instance.setTranslate([number, number])&lt;/strong&gt;&lt;br&gt;
Method to perform translate transformation on the canvas. Accepts array[x, y] as an input.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;instance.setZoom(number)&lt;/strong&gt;&lt;br&gt;
Method to perform zoom transformation on the canvas. Accepts float value as an input.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;instance.setRotationAngle(number)&lt;/strong&gt;&lt;br&gt;
Method to perform rotation transformation on the canvas. Accepts angle in radians.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;instance.setSize(number)&lt;/strong&gt;&lt;br&gt;
Method to set point radius. Accepts float value as an input.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;instance.setIntensity(number)&lt;/strong&gt;&lt;br&gt;
Method to set Intensity factor. Accepts float value as an input.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;instance.setOpacity(number)&lt;/strong&gt;&lt;br&gt;
Method to set Opacity factor. Accepts float value as an input.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;instance.setBackgroundImage({ url: , x: , y: , height: , width: })&lt;/strong&gt;&lt;br&gt;
Method to set Background image. Accepts Object with { Url, height, width, x, and y} properties as input.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;instance.projection({x: , y: })&lt;/strong&gt;&lt;br&gt;
Api to get projected co-ordinates relative to the heatmap layer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;instance.clear()&lt;/strong&gt;&lt;br&gt;
Method to clear canvas.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>visualisation</category>
    </item>
  </channel>
</rss>
