mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-07 01:48:11 +08:00
warm to cool (#454)
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import * as d3 from "d3";
|
import * as d3 from "d3";
|
||||||
import { interpolateViridis, interpolateWarm } from "d3-scale-chromatic";
|
import { interpolateViridis, interpolateCool } from "d3-scale-chromatic";
|
||||||
|
|
||||||
// create continuous color legend
|
// create continuous color legend
|
||||||
// http://bl.ocks.org/syntagmatic/e8ccca52559796be775553b467593a9f
|
// http://bl.ocks.org/syntagmatic/e8ccca52559796be775553b467593a9f
|
||||||
@@ -126,7 +126,7 @@ class ContinuousLegend extends React.Component {
|
|||||||
if (colorScale.range()[0][0] !== "#") {
|
if (colorScale.range()[0][0] !== "#") {
|
||||||
continuous(
|
continuous(
|
||||||
"#continuous_legend",
|
"#continuous_legend",
|
||||||
d3.scaleSequential(interpolateWarm).domain(colorScale.domain()),
|
d3.scaleSequential(interpolateCool).domain(colorScale.domain()),
|
||||||
colorAccessor
|
colorAccessor
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
interpolateSpectral,
|
interpolateSpectral,
|
||||||
interpolateRainbow,
|
interpolateRainbow,
|
||||||
interpolateBlues,
|
interpolateBlues,
|
||||||
interpolateWarm
|
interpolateCool
|
||||||
} from "d3-scale-chromatic";
|
} from "d3-scale-chromatic";
|
||||||
import * as globals from "../globals";
|
import * as globals from "../globals";
|
||||||
import parseRGB from "../util/parseRGB";
|
import parseRGB from "../util/parseRGB";
|
||||||
@@ -89,7 +89,7 @@ const updateCellColorsMiddleware = store => next => action => {
|
|||||||
|
|
||||||
for (let i = 0; i < obsAnnotations.length; i += 1) {
|
for (let i = 0; i < obsAnnotations.length; i += 1) {
|
||||||
const obs = obsAnnotations[i];
|
const obs = obsAnnotations[i];
|
||||||
const c = interpolateWarm(colorScale(obs[action.colorAccessor]));
|
const c = interpolateCool(colorScale(obs[action.colorAccessor]));
|
||||||
colorsByName[i] = c;
|
colorsByName[i] = c;
|
||||||
colorsByRGB[i] = parseRGB(c);
|
colorsByRGB[i] = parseRGB(c);
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ const updateCellColorsMiddleware = store => next => action => {
|
|||||||
]); /* invert viridis... probably pass this scale through to others */
|
]); /* invert viridis... probably pass this scale through to others */
|
||||||
|
|
||||||
for (let i = 0, len = expression.length; i < len; i += 1) {
|
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;
|
colorsByName[i] = c;
|
||||||
colorsByRGB[i] = parseRGB(c);
|
colorsByRGB[i] = parseRGB(c);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user