Bladeren bron

Fix bug in heatmap update

Lucas de Souza 5 jaren geleden
bovenliggende
commit
e380f5a0e1
4 gewijzigde bestanden met toevoegingen van 8 en 6 verwijderingen
  1. 1 1
      dist/line_heatmap.js
  2. 1 1
      dist/line_heatmap.js.map
  3. 2 2
      src/heatContainer.js
  4. 4 2
      src/lineHeatmap.js

File diff suppressed because it is too large
+ 1 - 1
dist/line_heatmap.js


File diff suppressed because it is too large
+ 1 - 1
dist/line_heatmap.js.map


+ 2 - 2
src/heatContainer.js

@@ -3,7 +3,6 @@ import "nouislider";
 
 const template = `<div>
   <div class="line-heatmap-controls">
-    <p>Cade o tempo no log?</p>
     <div id="line-heatmap-slider"></div>
   </div>
   <div id="line-heatmap-canvas">
@@ -51,12 +50,13 @@ function init (elementId, logString) {
 function updateLogString (logString) {
   const logData = logTransform(logString);
   stateObject['data'] = logData;
-  stateObject['heatmap'].noUiSlider.updateOptions({
+  stateObject['slider'].noUiSlider.updateOptions({
     range: {
         'min': 1,
         'max': logData.length
     }
   });
+  stateObject['heatmap'].setTrackData(logData); 
 }
 
 function logTransform (logString) {

+ 4 - 2
src/lineHeatmap.js

@@ -17,8 +17,10 @@ export default class LineHeatmap {
   }
 
   setTrackData (data) {
-    data.forEach(point => {
-      this.heatmap.addData(point);
+    this.heatmap.setData({
+      max: Number.MAX_SAFE_INTEGER,
+      min: 0,
+      data: data
     });
   }
 }