Skip to content

Commit

Permalink
And even more minor cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
prakhargoel-beacon committed Jun 7, 2019
1 parent 817b720 commit f097b1c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/TableRenderers.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import {PivotData} from './Utilities';
import {PivotData, flatKey} from './Utilities';
import memoize from 'memoize-one';

function redColorScaleGenerator(values) {
Expand Down Expand Up @@ -112,7 +112,7 @@ function makeRenderer(opts = {}) {
const rowValues = Object.values(cd).map(a => a.value());
rowColorScales[rk] = colorScaleGenerator(rowValues);
});
valueCellColors = (r, c, v) => rowColorScales[r.join(String.fromCharCode(0))](v);
valueCellColors = (r, c, v) => rowColorScales[flatKey(r)](v);
} else if (opts.heatmapMode === 'col') {
const colColorScales = {};
const colValues = {};
Expand All @@ -127,7 +127,7 @@ function makeRenderer(opts = {}) {
for (const k in colValues) {
colColorScales[k] = colorScaleGenerator(colValues[k]);
}
valueCellColors = (r, c, v) => colColorScales[c.join(String.fromCharCode(0))](v);
valueCellColors = (r, c, v) => colColorScales[flatKey(c)](v);
}
}
return {valueCellColors, rowTotalColors, colTotalColors};
Expand Down

0 comments on commit f097b1c

Please sign in to comment.