import { _getCanvasColor as getCanvasColor } from "@dynatrace/strato-components-preview/charts";
import { defineRadius } from "./define-radius.js";
import { calculateHoveredColor } from "../../../functions/calculate-hovered-color.js";
import { defineColor } from "../../../functions/define-color.js";
const parseBubbleDataToGeoJSON = (data, color, radius, scale) => {
  return {
    type: "FeatureCollection",
    features: data.map((feature) => {
      const { longitude, latitude, ...properties } = feature;
      const canvasColor = getCanvasColor(defineColor(color, feature));
      const hoveredColor = calculateHoveredColor(canvasColor);
      const scaledRadius = scale(defineRadius(radius, feature));
      return {
        type: "Feature",
        properties: {
          data: feature,
          ...properties,
          __color: canvasColor,
          __hoveredColor: hoveredColor,
          __radius: scaledRadius,
          __lat: latitude
        },
        geometry: { type: "Point", coordinates: [longitude, latitude] }
      };
    })
  };
};
export {
  parseBubbleDataToGeoJSON
};
//# sourceMappingURL=parse-bubble-data-to-geo-json.js.map
