data = Data.buildMeasureMap(WorkforceData.sizeByMonthForCalendarYear.months, [
{ id: "openingHeadcount" },
{
id: "startingHeadcount",
source: row => row.openingHeadcount + row.startingHires
},
{
id: "endingHeadcount",
source: row => row.closingHeadcount + row.endingTerminations
},
{ id: "closingHeadcount" },
{
id: "openingClosingHeadcount",
source: row => {
const decline = row.openingHeadcount < row.closingHeadcount;
return {
borderColor: decline ? "#66BB6A" : "#FFA726",
color: decline ? "#C8E6C9" : "#FFE0B2",
low: row.openingHeadcount,
high: row.closingHeadcount
};
}
},
{
id: "startingEndingHeadcount",
source: row => {
const decline =
row.openingHeadcount + row.startingHires <
row.closingHeadcount + row.endingTerminations;
return {
borderColor: decline ? "#66BB6A" : "#FFA726",
color: decline ? "#66BB6A" : "#FFA726",
low: row.openingHeadcount + row.startingHires,
high: row.closingHeadcount + row.endingTerminations
};
}
}
])