improve graph scale and centering (#796)

* add gutter to embedding canvas

* improve layout scale and translate

* fix lint

* pin tables to version 3.5.1

* fix lasso coordinate smoke tests
This commit is contained in:
Bruce Martin
2019-05-30 13:31:41 -07:00
committed by GitHub
parent ffd7f0db49
commit a6142bdf93
4 changed files with 21 additions and 7 deletions
+3 -2
View File
@@ -146,9 +146,10 @@ class Graph extends React.Component {
const sizeBuffer = regl.buffer();
// preallocate coordinate system transformation between data and gl
const fractionToUse = 0.98; // fraction of dimension to use
const transform = {
glScaleX: scaleLinear([0, 1], [-1, 1]),
glScaleY: scaleLinear([0, 1], [1, -1])
glScaleX: scaleLinear([0, 1], [-1 * fractionToUse, 1 * fractionToUse]),
glScaleY: scaleLinear([0, 1], [1 * fractionToUse, -1 * fractionToUse])
};
/* first time, but this duplicates above function, should be possile to avoid this */