GithubHelp home page GithubHelp logo

webgl-heatmap's Introduction

WebGL-HeatMap

###基于webgl的 热力图插件 ##Demo #####使用方法

var fakeData = [];
    for (var i = 0; i < 10000; i++) {
        fakeData.push([Math.random() * 2048, Math.random() * 900, Math.floor(Math.random() * 600)]);
    }


    var z = WebGLCanvas.render({
        width:1024,
        height:100,
        radius: 18,
        max: 800,
        min: 100,
        filter: 12
    }, fakeData);
    for (var i = 0; i < z.length; i++) {
        document.body.appendChild(z[i]);
    };

可以看到 插件需要的数据格式为 fakeData 提供的格式。

WebGLCanvas.render(cfg,data) 方法返回的是一个 多个canvas的数组。

你只需要把这些canvas append 到dom树中就行

注意 render 方法里面的 width 和 height 很可能不是最后生成的 canvas的实际尺寸,因为gl中要求每个纹理的尺寸必须是2的n次方。

img

img

webgl-heatmap's People

Contributors

wshxbqq avatar

Stargazers

雨中的鱼 avatar

Watchers

James Cloos avatar 雨中的鱼 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.