index.js
function(x, y){
                if(x < 0 || y < 0)
                    return;

                var me = this,
                    heatmap = me.get("heatmap"),
                    data = me.get("data");

                if(!data[x])
                    data[x] = [];

                if(!data[x][y])
                    data[x][y] = 0;

                // if count parameter is set increment by count otherwise by 1
                data[x][y]+=(arguments.length<3)?1:arguments[2];
                
                me.set("data", data);
                // do we have a new maximum?
                if(me.max < data[x][y]){
                    // max changed, we need to redraw all existing(lower) datapoints
                    heatmap.get("actx").clearRect(0,0,heatmap.get("width"),heatmap.get("height"));
                    me.setDataSet({ max: data[x][y], data: data }, true);
                    return;
                }
                heatmap.drawAlpha(x, y, data[x][y], true);
            }
function(x, y){
                if(x < 0 || y < 0)
                    return;

                var me = this,
                    heatmap = me.get("heatmap"),
                    data = me.get("data");

                if(!data[x])
                    data[x] = [];

                if(!data[x][y])
                    data[x][y] = 0;

                // if count parameter is set increment by count otherwise by 1
                data[x][y]+=(arguments.length<3)?1:arguments[2];
                
                me.set("data", data);
                // do we have a new maximum?
                if(me.max < data[x][y]){
                    // max changed, we need to redraw all existing(lower) datapoints
                    heatmap.get("actx").clearRect(0,0,heatmap.get("width"),heatmap.get("height"));
                    me.setDataSet({ max: data[x][y], data: data }, true);
                    return;
                }
                heatmap.drawAlpha(x, y, data[x][y], true);
            }
function ( x , y ) { if ( x < 0 || y < 0 ) return ; var me = this , heatmap = me . get ( "heatmap" ) , data = me . get ( "data" ) ; if ( ! data [ x ] ) data [ x ] = [ ] ; if ( ! data [ x ] [ y ] ) data [ x ] [ y ] = 0 ; // if count parameter is set increment by count otherwise by 1 data [ x ] [ y ] += ( arguments . length < 3 ) ? 1 : arguments [ 2 ] ; me . set ( "data" , data ) ; // do we have a new maximum? if ( me . max < data [ x ] [ y ] ) { // max changed, we need to redraw all existing(lower) datapoints heatmap . get ( "actx" ) . clearRect ( 0 , 0 , heatmap . get ( "width" ) , heatmap . get ( "height" ) ) ; me . setDataSet ( { max : data [ x ] [ y ] , data : data } , true ) ; return ; } heatmap . drawAlpha ( x , y , data [ x ] [ y ] , true ) ; }
function for adding datapoints to the store datapoints are usually defined by x and y but could also contain a third parameter which represents the occurrence
function for adding datapoints to the store datapoints are usually defined by x and y but could also contain a third parameter which represents the occurrence