@waveform-playlist/ui-components 15.0.0-next.7 → 15.0.0-next.8
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/index.js +3 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2996,10 +2996,9 @@ var SmartScale = ({
|
|
|
2996
2996
|
const { marker, bigStep, smallStep } = config;
|
|
2997
2997
|
const canvasInfo = /* @__PURE__ */ new Map();
|
|
2998
2998
|
const labels = [];
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
const pix = Math.floor(i);
|
|
2999
|
+
for (let counter = 0; ; counter += smallStep) {
|
|
3000
|
+
const pix = Math.floor(counter * sampleRate / (1e3 * samplesPerPixel));
|
|
3001
|
+
if (!(pix < widthX)) break;
|
|
3003
3002
|
if (counter % marker === 0) {
|
|
3004
3003
|
labels.push({
|
|
3005
3004
|
id: `timestamp-${counter}`,
|
|
@@ -3013,7 +3012,6 @@ var SmartScale = ({
|
|
|
3013
3012
|
} else if (counter % smallStep === 0) {
|
|
3014
3013
|
canvasInfo.set(pix, Math.floor(timeScaleHeight / 5));
|
|
3015
3014
|
}
|
|
3016
|
-
counter += smallStep;
|
|
3017
3015
|
}
|
|
3018
3016
|
return { widthX, canvasInfo, labels };
|
|
3019
3017
|
}, [beatsAndBars, duration, samplesPerPixel, sampleRate, timeScaleHeight]);
|