move graph scales, still hardcoded, into globals

This commit is contained in:
Colin Megill
2017-12-07 14:33:25 -08:00
parent 3799fda639
commit 9a3d349f99
2 changed files with 46 additions and 40 deletions
+18
View File
@@ -41,3 +41,21 @@ export const API = {
export const accentFont = "Georgia,Times,Times New Roman,serif";
export const maxParagraphWidth = 600;
export const maxControlsWidth = 800;
export const graphMargin = {top: 20, right: 10, bottom: 30, left: 40};
export const graphWidth = 960;
export const graphHeight = 500;
export const graphXScale = d3.scaleLinear()
.domain([0, 1]) /* while this is the default for d3, our data is normalized so better to be explicit */
.range([
0 + graphMargin.left,
graphWidth - graphMargin.right
]);
export const graphYScale = d3.scaleLinear()
.domain([0, 1]) /* while this is the default for d3, our data is normalized so better to be explicit */
.range([
graphHeight - graphMargin.bottom,
0 + graphMargin.top
]);