withDerivedData = FeatureView => props => {
  const {data, width} = props;
  const featureWithDerivedData = {
    ...data,
    name: getFeatureName(props),
    type: getFeatureType(props),
    domain: getFeatureDomain(props),
    distributions: getFeatureDistributions(props),
    distributionsNormalized: getFeatureDistributionsNormalized(props),
    distributionsMaxValues: getDistributionsMaxValues(props),
    divergence: getFeatureDivergence(props),
    // for categorical features only
    categoriesSortedOrder: getCategoriesSortedOrder(props),
  };

  const xScale = scaleLinear()
    .domain([
      featureWithDerivedData.domain[0],
      featureWithDerivedData.domain[featureWithDerivedData.domain.length - 1],
    ])
    .range([0, width - RIGHT_MARGIN_WIDTH]);

  return (
    <FeatureView {...props} data={featureWithDerivedData} xScale={xScale} />
  );
}
HOC function to check if feature meta is precomputed, if not, compute and inject result