warm to cool (#454)

This commit is contained in:
Jeremy Freeman
2018-11-16 14:33:32 -08:00
committed by GitHub
parent 2b4aa92f67
commit dff2526077
2 changed files with 5 additions and 5 deletions
@@ -2,7 +2,7 @@
import React from "react";
import { connect } from "react-redux";
import * as d3 from "d3";
import { interpolateViridis, interpolateWarm } from "d3-scale-chromatic";
import { interpolateViridis, interpolateCool } from "d3-scale-chromatic";
// create continuous color legend
// http://bl.ocks.org/syntagmatic/e8ccca52559796be775553b467593a9f
@@ -126,7 +126,7 @@ class ContinuousLegend extends React.Component {
if (colorScale.range()[0][0] !== "#") {
continuous(
"#continuous_legend",
d3.scaleSequential(interpolateWarm).domain(colorScale.domain()),
d3.scaleSequential(interpolateCool).domain(colorScale.domain()),
colorAccessor
);
}
+3 -3
View File
@@ -6,7 +6,7 @@ import {
interpolateSpectral,
interpolateRainbow,
interpolateBlues,
interpolateWarm
interpolateCool
} from "d3-scale-chromatic";
import * as globals from "../globals";
import parseRGB from "../util/parseRGB";
@@ -89,7 +89,7 @@ const updateCellColorsMiddleware = store => next => action => {
for (let i = 0; i < obsAnnotations.length; i += 1) {
const obs = obsAnnotations[i];
const c = interpolateWarm(colorScale(obs[action.colorAccessor]));
const c = interpolateCool(colorScale(obs[action.colorAccessor]));
colorsByName[i] = c;
colorsByRGB[i] = parseRGB(c);
}
@@ -107,7 +107,7 @@ const updateCellColorsMiddleware = store => next => action => {
]); /* invert viridis... probably pass this scale through to others */
for (let i = 0, len = expression.length; i < len; i += 1) {
const c = interpolateWarm(colorScale(expression[i]));
const c = interpolateCool(colorScale(expression[i]));
colorsByName[i] = c;
colorsByRGB[i] = parseRGB(c);
}