Skip to content

Commit b820fcd

Browse files
committed
ui-manchette-with-spacetimechart: fix spacetimechart scales
In linear mode, the space time chart didn't shrink when there was some waypoints hidden in the middle of the path Signed-off-by: SharglutDev <[email protected]>
1 parent fb3b3bd commit b820fcd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ui-manchette-with-spacetimechart/src/helpers.ts

+13
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,19 @@ export const getScales = (
119119
{ height, isProportional, yZoom }: OperationalPointsOptions
120120
) => {
121121
if (ops.length < 2) return [];
122+
123+
if (!isProportional) {
124+
return ops.slice(0, -1).map((from, index) => {
125+
const to = ops[index + 1];
126+
127+
return {
128+
from: from.position,
129+
to: to.position,
130+
size: BASE_OP_HEIGHT * yZoom,
131+
};
132+
});
133+
}
134+
122135
const from = ops.at(0)!.position;
123136
const to = ops.at(-1)!.position;
124137

0 commit comments

Comments
 (0)