Heatmap.js无法渲染热图

时间:2016-12-14 05:10:14

标签: javascript jquery heatmap

热图正在生成更早,但是当我更改了我的jquery库时它停止渲染我试图删除我的缓存buut也没有用。我使用的是heatmap.js的免费版本。

任何帮助都将不胜感激。

Javascript代码

function connect() {
    var socket = new SockJS('/iotapp/gs-guide-websocket');
    stompClient = Stomp.over(socket);
    stompClient.connect({}, function (frame) {
        setConnected(true);
        console.log('Connected: ' + frame);
        stompClient.subscribe('/topic/greetings', function (greeting) {
            console.log(JSON.stringify(greeting));
            showGreeting(JSON.parse(greeting.body).content, JSON.parse(greeting.body).cont, JSON.parse(greeting.body).rad);
        });
    });
}

function disconnect() {
    if (stompClient != null) {
        stompClient.disconnect();
    }
    setConnected(false);
    console.log("Disconnected");
}

function showGreeting(xcor,ycor,radi) {


    var inputdata= [{x: xcor, y: ycor, radius: radi}]
    $("#greetings").append("<tr><td>" + xcor + ycor + radi +"</td></tr>");
    var heatmap = h337.create({
        container: document.getElementById('heatMap'),
        maxOpacity: .5,
        radius: 10,
        blur: .75,
        // update the legend whenever there's an extrema change

      });

    var generate = function(input) {

        heatmap.addData({min: min, max: max, data :input});
    };

    generate(inputdata);


    };

脚本导入

<script src="/iotapp/static/js/heatmap.js"></script>
            <script src="/iotapp/static/js/jquery-3.1.1.min.js"></script>    
            <script src="/iotapp/static/js/sockjs.min.js"></script>
    <script src="/iotapp/static/js/stomp.min.js"></script>
    <script src="/iotapp/static/js/app.js"></script>

0 个答案:

没有答案