ShowAll Marker for transformer stages

This commit is contained in:
Johannes Zillmann 2021-02-28 02:18:47 +01:00
parent e7574513c5
commit a99b031bc6
6 changed files with 14 additions and 2 deletions

View File

@ -1,6 +1,10 @@
import type ItemMerger from './debug/ItemMerger';
interface Debug {
/**
* If set to true, all items will be shown as relevant.
*/
readonly showAll?: boolean;
/**
* If this is set, the debug UI will group items and display a merged item.
*/

View File

@ -31,5 +31,5 @@ export function initialStage(inputSchema: string[], inputItems: Item[]): StageRe
inputItems.length
} items`,
];
return new StageResult(toDescriptor({}), schema, pages, tracker, messages);
return new StageResult(toDescriptor({ debug: { showAll: true } }), schema, pages, tracker, messages);
}

View File

@ -16,6 +16,9 @@ export default class CalculateStatistics extends ItemTransformer {
'maxHeightFont',
'fontToFormats',
],
debug: {
showAll: true,
},
});
}

View File

@ -10,6 +10,9 @@ export default class CalculateCoordinates extends ItemTransformer {
'Extracts X and Y out of the Transform array',
{
requireColumns: ['transform'],
debug: {
showAll: true,
},
},
(incomingSchema) => {
return incomingSchema.reduce((schema, column) => {

View File

@ -101,6 +101,7 @@
pages={visiblePages}
{maxPage}
{pageIsPinned}
showAllAsRelevant={stageResult.descriptor?.debug?.showAll}
bind:onlyRelevantItems
changes={stageResult.changes} />
</div>

View File

@ -13,6 +13,7 @@
export let maxPage: number;
export let pageIsPinned: boolean;
export let onlyRelevantItems: boolean;
export let showAllAsRelevant = false;
export let changes: ChangeIndex;
let maxItemsToRenderInOneLoad = 200;
let renderedMaxPage = 0;
@ -74,7 +75,7 @@
{/if}
<!-- Page items -->
{#each page.itemGroups.filter((group) => !onlyRelevantItems || changes.hasChanged(group.top)) as itemGroup, itemIdx}
{#each page.itemGroups.filter((group) => showAllAsRelevant || !onlyRelevantItems || changes.hasChanged(group.top)) as itemGroup, itemIdx}
<tr
class:expandable={itemGroup.hasMany()}
class:expanded={expandedItemGroup && isExpanded(page.index, itemIdx)}