2023西安数博会CIM演示-【前端】-Web
AdaKing88
2023-08-21 bc03b832caa49bbcd2674fe4cae3701b5059bf95
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 
 
 
 
function DataTexture(){
 
    this.time = [];
    this.data = [];
    this.loadData();
}
DataTexture.prototype.createCanvas = function (){
    var canvas = document.createElement('canvas');
    canvas.id = "overlay";
    canvas.class = "fill-screen";
    canvas.width = 1000;
    canvas.height = 1000;
    document.body.appendChild(canvas);
 
}
DataTexture.prototype.loadData = function (callback){
 
 
    let that = this;
    request({
        url:"./data/permesh.json",
        type:"application/json",
        success:function (result){
 
            that.data = JSON.parse(result).data;
            for(let key in that.data)
            {
                that.time.push(key);
            }
 
            if (typeof callback == "function")
                callback();
        },
        error:function (){
 
        }
    });
 
}