Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8790407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:38:40+00:00 2026-06-13T22:38:40+00:00

I’m using heatmap.js on my website, which looks great. One slight issue is that

  • 0

I’m using heatmap.js on my website, which looks great. One slight issue is that when the event to generate the heat map is triggered, the page becomes unusable for a few seconds while the canvas loads.

I’ve created a modal dialog with a load bar that will eventually hide the page during this process, I’m just having difficulty creating a function to call the modal.

On another (slightly less useful) heat map library called heatcanvas, there are two functions to handle this:

heatmap.onRenderingStart = function(){document.getElementById('status').innerHTML = 'rendering...'}
heatmap.onRenderingEnd = function(){document.getElementById('status').innerHTML = 'ready'}

Is there a way I can create two similar functions with the heatmap.js (http://www.patrick-wied.at/static/heatmapjs/) library?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:38:42+00:00Added an answer on June 13, 2026 at 10:38 pm

    Unfortunately, it seems that heatmap.js does not provide such callbacks by default. The best you can do is to fork the project and add this functionality by yourself. I will try to point you some places which need to be changed.

    First of all, you need to provide functionality to add callbacks:

    // heatmap object constructor
    var heatmap = function heatmap(config){
        // private variables
        var _ = {
            radius : 40,
            element : {},
            canvas : {},
            acanvas: {},
            ctx : {},
            actx : {},
            legend: null,
            visible : true,
            width : 0,
            height : 0,
            max : false,
            gradient : false,
            opacity: 180,
            premultiplyAlpha: false,
            bounds: {
                l: 1000,
                r: 0,
                t: 1000,
                b: 0
            },
            debug: false,
            onRenderingStart: null,
            onRenderingEnd: null
        };
    

    configure method:

       me.set("onRenderingStart", config.onRenderingStart || null);
       me.set("onRenderingEnd", config.onRenderingEnd || null);
    

    The last thing is to call these callbacks if they are attached. I guess that the best place to do this is a setDataSet method:

       setDataSet: function(obj, internal){
            var me = this,
                heatmap = me.get("heatmap"),
                onRenderingStart = heatmap.get("onRenderingStart"),
                onRenderingEnd= heatmap.get("onRenderingEnd"),
                data = [],
                d = obj.data,
                dlen = d.length;
    
            if(typeof onRenderingStart === "function") {
                onRenderingStart(/* maybe it'd be a good idea to pass reference to heatmap or sth */);
            }
    
            // the rest of the code
    
            heatmap.colorize();
            this.set("data", d);
    
            if(typeof onRenderingEnd === "function") {
                onRenderingEnd(/* maybe it'd be a good idea to pass reference to heatmap or sth */);
            }
        }
    

    Please note that I’ve not tested this solution and it may need some fixes and improvements. Hope it will help you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an autohotkey script which looks up a word in a bilingual dictionary
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.