svelteplot 0.2.8-pr-68.0 → 0.2.8-pr-68.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/helpers/scales.js +7 -4
- package/package.json +1 -1
package/dist/helpers/scales.js
CHANGED
|
@@ -165,10 +165,12 @@ export function createScale(name, scaleOptions, marks, plotOptions, plotWidth, p
|
|
|
165
165
|
: extent(scaleOptions.zero ? [0, ...valueArray] : valueArray);
|
|
166
166
|
if (scaleOptions.interval) {
|
|
167
167
|
if (isOrdinal) {
|
|
168
|
-
domain = domainFromInterval(domain, scaleOptions.interval);
|
|
168
|
+
domain = domainFromInterval(domain, scaleOptions.interval, name);
|
|
169
169
|
}
|
|
170
170
|
else {
|
|
171
|
-
|
|
171
|
+
if (markTypes.size > 0) {
|
|
172
|
+
console.warn('Setting interval via axis options is only supported for ordinal scales');
|
|
173
|
+
}
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
176
|
if (!scaleOptions.scale) {
|
|
@@ -201,10 +203,11 @@ export function createScale(name, scaleOptions, marks, plotOptions, plotWidth, p
|
|
|
201
203
|
: null
|
|
202
204
|
};
|
|
203
205
|
}
|
|
204
|
-
function domainFromInterval(domain, interval) {
|
|
206
|
+
function domainFromInterval(domain, interval, name) {
|
|
205
207
|
const interval_ = maybeInterval(interval);
|
|
206
208
|
const [lo, hi] = extent(domain);
|
|
207
|
-
|
|
209
|
+
const out = interval_.range(lo, interval_.offset(hi));
|
|
210
|
+
return name === 'y' ? out.toReversed() : out;
|
|
208
211
|
}
|
|
209
212
|
/**
|
|
210
213
|
* Infer a scale type based on the scale name, the data values mapped to it and
|