/* Copyright © 2020 Splunk Inc.
SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
in part without a valid written license from Splunk Inc. is PROHIBITED. */
import {
  formatValueForPlottingWithSeriesConfig,
  getMergedSeriesConfigForField
} from "./chunk-6N4JNZ5S.js";

// src/getFormattedDataColumns.ts
var getFormattedDataColumns = (data, seriesConfig, scaleConfig) => {
  const { fields, columns: originalColumns } = data;
  const [, ...dataColumns] = originalColumns;
  let fieldsIndex = 1;
  const formattedDataColumns = dataColumns.map((dataColumn) => {
    const mergedSeriesConfig = getMergedSeriesConfigForField(
      seriesConfig,
      scaleConfig,
      fields[fieldsIndex]
    );
    if (mergedSeriesConfig.scale !== "y") {
      return dataColumn;
    }
    const formattedDataColumn = dataColumn.map(
      (dataPoint) => dataPoint !== null ? formatValueForPlottingWithSeriesConfig(dataPoint, mergedSeriesConfig, data) : "0"
    );
    fieldsIndex += 1;
    return formattedDataColumn;
  });
  return formattedDataColumns;
};

export {
  getFormattedDataColumns
};
//# sourceMappingURL=chunk-XJ2QF2ND.js.map
