Spaces:
Running
Running
Fix visualization issue with window shorter than text
Browse files
highlighted_text/src/HighlightedText.tsx
CHANGED
@@ -82,7 +82,7 @@ class HighlightedText extends StreamlitComponentBase<HighlightedTextState> {
|
|
82 |
const row = allScores[i].slice(0, hi);
|
83 |
row.reverse();
|
84 |
let result = [
|
85 |
-
...Array(Math.max(0, i -
|
86 |
...row.map((x) => x == undefined || isNaN(x) ? 0 : x)
|
87 |
];
|
88 |
result = [...result, ...Array(tokens.length - result.length).fill(0)];
|
|
|
82 |
const row = allScores[i].slice(0, hi);
|
83 |
row.reverse();
|
84 |
let result = [
|
85 |
+
...Array(Math.max(0, i - row.length)).fill(0),
|
86 |
...row.map((x) => x == undefined || isNaN(x) ? 0 : x)
|
87 |
];
|
88 |
result = [...result, ...Array(tokens.length - result.length).fill(0)];
|