|
|
|
|
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 (){
|
|
}
|
});
|
|
}
|