async initializeData(
		data,
		{
			coordinates,
			value,
			checkInputs,
			min,
			max,
			colorPalette,
			legendType,
			valueFmt,
			chartType,
			legendId,
			legend,
			theme,
			sizeCol
		}
	) {
		await data.fetch();
		checkInputs(data, coordinates, [value, sizeCol]);
		let values = data.map((d) => d[value]);
		let minValue = Math.min(...values);
		let maxValue = Math.max(...values);
		let colorScale;

		if (!legendType) {
			typeof values[0] === 'number' ? (legendType = 'scalar') : (legendType = 'categorical');
		}

		if (legendType && !colorPalette) {
			colorPalette =
				legendType === 'categorical' ? theme.colorPalettes.default : theme.colorScales.default;
			colorPalette = colorPalette.map((item) => chroma(item).hex());
		}
		colorScale = chroma.scale(colorPalette).domain([min ?? minValue, max ?? maxValue]);

		if (legend && value) {
			values = this.handleLegendValues(colorPalette, values, legendType);
			this.buildLegend(
				colorPalette,
				values,
				minValue,
				maxValue,
				legendType,
				valueFmt,
				chartType,
				legendId,
				value,
				legend
			);
		}

		// Return the values, minValue, and maxValue for sharing with other functions
		return { values, colorPalette, colorScale };
	}
@param {unknown} data
@param {{ theme: import('@evidence-dev/tailwind').Theme }} opts