Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed #6650, Boost module failed with styled mode and heatmap.
  • Loading branch information
TorsteinHonsi committed Apr 28, 2017
1 parent 7b180b1 commit d66ec28
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 3 deletions.
10 changes: 7 additions & 3 deletions js/modules/boost.src.js
Expand Up @@ -1172,9 +1172,13 @@ function GLRenderer(postRenderCallback) {

if (plotY !== undefined && !isNaN(plotY) && point.y !== null) {
shapeArgs = point.shapeArgs;
pointAttr = (point.pointAttr && point.pointAttr['']) ||
point.series.pointAttribs(point);
swidth = pointAttr['stroke-width'];

/*= if (build.classic) { =*/
pointAttr = point.series.pointAttribs(point);
/*= } else { =*/
pointAttr = point.series.colorAttribs(point);
/*= } =*/
swidth = pointAttr['stroke-width'] || 0;

// Handle point colors
color = H.color(pointAttr.fill).rgba;
Expand Down
1 change: 1 addition & 0 deletions samples/unit-tests/boost/heatmap-styled-mode/demo.css
@@ -0,0 +1 @@
@import 'https://code.highcharts.com/css/highcharts.css';
6 changes: 6 additions & 0 deletions samples/unit-tests/boost/heatmap-styled-mode/demo.details
@@ -0,0 +1,6 @@
---
resources:
- https://code.jquery.com/qunit/qunit-2.0.1.js
- https://code.jquery.com/qunit/qunit-2.0.1.css
js_wrap: b
...
9 changes: 9 additions & 0 deletions samples/unit-tests/boost/heatmap-styled-mode/demo.html
@@ -0,0 +1,9 @@
<script src="https://code.highcharts.com/js/highcharts.js"></script>
<script src="https://code.highcharts.com/js/modules/heatmap.js"></script>
<script src="https://code.highcharts.com/js/modules/boost.js"></script>


<div id="qunit"></div>
<div id="qunit-fixture"></div>

<div id="container" style="width: 600px; height: 250px; margin: 0 auto"></div>
89 changes: 89 additions & 0 deletions samples/unit-tests/boost/heatmap-styled-mode/demo.js
@@ -0,0 +1,89 @@
QUnit.test('Boosted heatmap with styled mode (#6650)', function (assert) {

assert.expect(0);
var xsize = 26;
var ysize = 100;
// Add some random data
var data = new Array(xsize * ysize);
for (var i = 0; i < xsize * ysize; i++) {
var row = new Array(3);
row[0] = Math.floor(i / ysize);
row[1] = -i % ysize;


row[2] = ((row[1] / ysize) * 125);
// row[2] = Math.random() * -125;
data[i] = row;
}

Highcharts.chart('container', {
chart: {
type: 'heatmap',
margin: [60, 10, 80, 50]
},

boost: {
useGPUTranslations: true
},

title: {
text: 'Swept Spectrogram',
align: 'left',
x: 40
},

xAxis: {
type: 'number',
title: {
text: 'Channel'
},
min: 0,
max: 25,
showLastLabel: true
},

yAxis: {
title: {
text: null
},
labels: {
format: '{value}s'
},
minPadding: 0,
maxPadding: 0,
startOnTick: false,
endOnTick: false,
min: -99,
max: 0,
reversed: true
},

colorAxis: {
stops: [
[0, '#FF0000'],
[0.25, '#FFFF00'],
[0.5, '#00FF00'],
[0.75, '#00FFFF'],
[1, '#0000FF']
],
min: -125,
max: 0,
startOnTick: false,
endOnTick: false,
reversed: true,
labels: {
format: '{value} dBm'
}
},

series: [{
boostThreshold: 100,
borderWidth: 0,
// nullColor: '#000000',
// colsize: 100*26, // one full buffer ? no idea...
data: data
}]
});


});

0 comments on commit d66ec28

Please sign in to comment.