protected processDomainValues()

in packages/util-scales/src/quantitative/LogScale.ts [48:65]


	protected processDomainValues(
		rawValues: any[],
	): [QuantitativeValue, QuantitativeValue] {
		const values = super.processDomainValues(rawValues)
		const isPositive = values[0] > 0 || values[1] > 0
		const isNegative = values[0] < 0 || values[1] < 0
		if (isPositive && isNegative) {
			throw new Error(
				'logscale domain values must both be either positive or negative',
			)
		}
		const zeroValue = isPositive ? POS_SENTINEL : NEG_SENTINEL

		return values.map(v => (v === 0 ? zeroValue : v)) as [
			QuantitativeValue,
			QuantitativeValue,
		]
	}