juijs-graph
Advanced tools
Comparing version 0.2.1-es6 to 0.2.2-es6
@@ -7,3 +7,3 @@ import jui from '../src/main.js' | ||
this.draw = function() { | ||
console.log(`FPS:${this.chart.fps}, TPF:${this.chart.tpf}`); | ||
console.log(`FPS:${this.chart.getCache("fps")}, TPF:${this.chart.getCache("tpf")}`); | ||
} | ||
@@ -10,0 +10,0 @@ } |
{ | ||
"name": "juijs-graph", | ||
"version": "0.2.1-es6", | ||
"version": "0.2.2-es6", | ||
"sideEffects": false, | ||
@@ -5,0 +5,0 @@ "description": "SVG-based JUI chart that can be used in the browser and Node.js. Support many types of charts. (Dashboard, Map, Topology, Full 3D)", |
@@ -32,2 +32,3 @@ import jui from "juijs" | ||
var _canvas = { main: null, sub: null }; // 캔버스 모드 전용 | ||
var _cache = {}; | ||
@@ -1052,2 +1053,11 @@ function calculate(self) { | ||
} | ||
this.setCache = function(key, value) { | ||
_cache[key] = value; | ||
} | ||
this.getCache = function(key, defValue) { | ||
if(_cache[key] === undefined) return defValue; | ||
return _cache[key]; | ||
} | ||
} | ||
@@ -1054,0 +1064,0 @@ |
@@ -33,6 +33,8 @@ import JUI from "juijs" | ||
if(currentTime - prevTime > interval || interval == 0){ | ||
this.builder.tpf = (currentTime - prevTime) / 1000; | ||
if(this.builder.tpf > 1) this.builder.tpf = 1; | ||
this.builder.fps = (1.0 / this.builder.tpf); | ||
let tpf = (currentTime - prevTime) / 1000; | ||
if(tpf > 1) tpf = 1; | ||
this.builder.setCache("tpf", tpf); | ||
this.builder.setCache("fps", (1.0 / tpf)); | ||
this.render(); | ||
@@ -39,0 +41,0 @@ if(typeof(callback) == "function") { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
741711
9374