|
@@ -2,11 +2,11 @@ import LineHeatmap from "./lineHeatmap";
|
|
import "nouislider";
|
|
import "nouislider";
|
|
|
|
|
|
const template = `<div>
|
|
const template = `<div>
|
|
- <div class='line-heatmap-controls'>
|
|
|
|
|
|
+ <div class="line-heatmap-controls">
|
|
<p>Cade o tempo no log?</p>
|
|
<p>Cade o tempo no log?</p>
|
|
<div id="line-heatmap-slider"></div>
|
|
<div id="line-heatmap-slider"></div>
|
|
</div>
|
|
</div>
|
|
- <div id='line-heatmap-canvas>
|
|
|
|
|
|
+ <div id="line-heatmap-canvas">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
`;
|
|
`;
|
|
@@ -19,6 +19,7 @@ function init (elementId, logString) {
|
|
const logData = logTransform(logString);
|
|
const logData = logTransform(logString);
|
|
// create container
|
|
// create container
|
|
const heatmap = new LineHeatmap('line-heatmap-canvas');
|
|
const heatmap = new LineHeatmap('line-heatmap-canvas');
|
|
|
|
+ heatmap.create();
|
|
heatmap.setTrackData(logData);
|
|
heatmap.setTrackData(logData);
|
|
|
|
|
|
const html5Slider = document.getElementById('line-heatmap-slider');
|
|
const html5Slider = document.getElementById('line-heatmap-slider');
|
|
@@ -26,6 +27,7 @@ function init (elementId, logString) {
|
|
start: [1, logData.length],
|
|
start: [1, logData.length],
|
|
connect: true,
|
|
connect: true,
|
|
margin: 1,
|
|
margin: 1,
|
|
|
|
+ step: 1,
|
|
range: {
|
|
range: {
|
|
'min': 1,
|
|
'min': 1,
|
|
'max': logData.length
|
|
'max': logData.length
|
|
@@ -38,9 +40,11 @@ function init (elementId, logString) {
|
|
stateObject['slider'] = html5Slider;
|
|
stateObject['slider'] = html5Slider;
|
|
|
|
|
|
html5Slider.noUiSlider.on('update', function (values, handle) {
|
|
html5Slider.noUiSlider.on('update', function (values, handle) {
|
|
- const logValues = html5Slider.get();
|
|
|
|
- const newData = stateObject['data'].slice(+logValues[0], +logValues[1] + 1);
|
|
|
|
- heatmap.setTrackData(newData);
|
|
|
|
|
|
+ const logValues = this.get();
|
|
|
|
+ console.log(logValues);
|
|
|
|
+ const newData = stateObject['data'].slice(+logValues[0]-1, +logValues[1] + 1);
|
|
|
|
+ console.log(newData);
|
|
|
|
+ stateObject['heatmap'].setTrackData(newData);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|