function updateData(data, keyPath) {
  if (data.children) {
    data.children.map(child => updateData(child, keyPath));
  }
  // add a fill to all the uncolored cells
  if (!data.hex) {
    data.style = {
      fill: EXTENDED_DISCRETE_COLOR_RANGE[5]
    };
  }
  data.style = {
    ...data.style,
    fillOpacity: keyPath && !keyPath[data.name] ? 0.2 : 1
  };

  return data;
}
Recursively modify data depending on whether or not each cell has been selected by the hover/highlight
@param {Object} data - the current node being considered
@param {Object|Boolean} keyPath - a map of keys that are in the highlight path
if this is false then all nodes are marked as selected
@returns {Object} Updated tree structure