Skip to content

Commit

Permalink
Highcharts resize bug fix and temporary tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
texodus committed Jun 11, 2018
1 parent c8b16df commit 99e8cdf
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/perspective-viewer-highcharts/src/js/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,10 @@ export const draw = (mode) => async function(el, view, task) {
for (let e of Array.prototype.slice.call(el.children)) { el.removeChild(e); }
this._charts.map(x => el.appendChild(x.renderTo));
}

// TODO resize bug in Highcharts?
if (configs.length > 1) {
this._charts.map(x => x.reflow());
}
}

41 changes: 41 additions & 0 deletions packages/perspective-viewer-highcharts/test/html/treemap.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!--
Copyright (c) 2017, the Perspective Authors.
This file is part of the Perspective library, distributed under the terms of
the Apache License 2.0. The full license can be found in the LICENSE file.
-->

<!DOCTYPE html>
<html>
<head>

<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
<script src="perspective.view.js"></script>
<script src="highcharts.plugin.js"></script>

<link rel='stylesheet' href="demo.css">

</head>
<body>

<perspective-viewer
view='treemap'
columns='["Sales"]'>

</perspective-viewer>

<script>

var xhr = new XMLHttpRequest();
xhr.open('GET', 'superstore.csv', true);
xhr.onload = function () {
document.getElementsByTagName('perspective-viewer')[0].load(xhr.response);
}
xhr.send(null);

</script>

</body>
</html>
23 changes: 23 additions & 0 deletions packages/perspective-viewer-highcharts/test/js/treemap.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/******************************************************************************
*
* Copyright (c) 2017, the Perspective Authors.
*
* This file is part of the Perspective library, distributed under the terms of
* the Apache License 2.0. The full license can be found in the LICENSE file.
*
*/

const utils = require('@jpmorganchase/perspective-viewer/test/js/utils.js');

const simple_tests = require('@jpmorganchase/perspective-viewer/test/js/simple_tests.js');


utils.with_server({}, () => {

describe.page("treemap.html", () => {

simple_tests.default();

});

});
12 changes: 11 additions & 1 deletion packages/perspective-viewer-highcharts/test/results/results.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,15 @@
"heatmap.html/sorts by a numeric column.": "7e9496591d144d8c9dcefc383ade7067",
"heatmap.html/filters by a numeric column.": "f5ae636e34bdd781ae4c6e004bf8b108",
"heatmap.html/sorts by an alpha column.": "5f9ca7ad1c277d1ab897632e98714735",
"heatmap.html/displays visible columns.": "f2e5d2b34dd1585e48d9b9f552361ba0"
"heatmap.html/displays visible columns.": "f2e5d2b34dd1585e48d9b9f552361ba0",
"treemap.html/shows a grid without any settings applied.": "642f65f20d8e41142941a26b15e01c17",
"treemap.html/pivots by a row.": "b61ce1d49a4de91a97638d99cb80bc42",
"treemap.html/pivots by two rows.": "f06a60cadd750561d58e6c468f8bc884",
"treemap.html/pivots by a row and a column.": "9bef0c41f2d8787b3f05b919ba0fc976",
"treemap.html/pivots by two rows and two columns.": "53956497b98b508020babc7ac2a560a2",
"treemap.html/sorts by a hidden column.": "93f7bd6312470093e6d90468053fcc2b",
"treemap.html/sorts by a numeric column.": "c0d3133e42b220ae0b51a03a727a7220",
"treemap.html/filters by a numeric column.": "0d641b25f1251e98bb51fae105b64cec",
"treemap.html/sorts by an alpha column.": "01ef0c304078e6547e56484a89da5589",
"treemap.html/displays visible columns.": "aa3cbce618a10759be1377a85b0de74e"
}

0 comments on commit 99e8cdf

Please sign in to comment.