diff --git a/client/__tests__/util/stateManager/world.test.js b/client/__tests__/util/stateManager/world.test.js index a90ef3cd..6e8c0bf5 100644 --- a/client/__tests__/util/stateManager/world.test.js +++ b/client/__tests__/util/stateManager/world.test.js @@ -232,3 +232,9 @@ describe("createVarDimension", () => { ); expect(result).toBeInstanceOf(Crossfilter.ScalarDimension); }); + +describe("worldEqUniverse", () => { + const { universe, world } = defaultBigBang(); + const result = World.worldEqUniverse(world, universe); + expect(result).toBe(true); +}); diff --git a/client/src/components/continuousLegend/index.js b/client/src/components/continuousLegend/index.js index 4db499a1..ea2879e4 100644 --- a/client/src/components/continuousLegend/index.js +++ b/client/src/components/continuousLegend/index.js @@ -6,7 +6,7 @@ import { interpolateViridis } from "d3-scale-chromatic"; // create continuous color legend // http://bl.ocks.org/syntagmatic/e8ccca52559796be775553b467593a9f -const continuous = (selectorId, colorscale) => { +const continuous = (selectorId, colorscale, colorAccessor) => { const legendheight = 200; const legendwidth = 80; const margin = { top: 10, right: 60, bottom: 10, left: 2 }; @@ -86,15 +86,15 @@ const continuous = (selectorId, colorscale) => { .call(legendaxis); // text label for the y axis - // svg - // .append("text") - // .attr("transform", "rotate(-90)") - // .attr("y", 3) - // .attr("x", 0 - legendheight / 2) - // .attr("dy", "1em") - // .style("text-anchor", "middle") - // .style("fill", "white") - // .text(colorAccessor); + svg + .append("text") + .attr("transform", "rotate(-90)") + .attr("y", 2) + .attr("x", 0 - legendheight / 2) + .attr("dy", "1em") + .style("text-anchor", "middle") + .style("fill", "white") + .text(colorAccessor); }; @connect(state => ({ diff --git a/client/src/components/graph/graph.js b/client/src/components/graph/graph.js index b58a8cb4..1593bddf 100644 --- a/client/src/components/graph/graph.js +++ b/client/src/components/graph/graph.js @@ -6,6 +6,7 @@ import { connect } from "react-redux"; import mat4 from "gl-mat4"; import _regl from "regl"; import { Button } from "@blueprintjs/core"; +import { worldEqUniverse } from "../../util/stateManager/world"; import setupSVGandBrushElements from "./setupSVGandBrush"; import actions from "../../actions"; @@ -17,6 +18,7 @@ import scaleLinear from "../../util/scaleLinear"; @connect(state => ({ world: state.controls.world, + universe: state.controls.universe, crossfilter: state.controls.crossfilter, responsive: state.responsive, colorRGB: _.get(state.controls, "colorRGB", null), @@ -326,11 +328,17 @@ class Graph extends React.Component { } render() { - const { dispatch, responsive } = this.props; + const { dispatch, responsive, world, universe, crossfilter } = this.props; const { mode } = this.state; return (