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'; import type ItemMerger from './debug/ItemMerger';
interface Debug { 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. * 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 inputItems.length
} items`, } 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', 'maxHeightFont',
'fontToFormats', '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', 'Extracts X and Y out of the Transform array',
{ {
requireColumns: ['transform'], requireColumns: ['transform'],
debug: {
showAll: true,
},
}, },
(incomingSchema) => { (incomingSchema) => {
return incomingSchema.reduce((schema, column) => { return incomingSchema.reduce((schema, column) => {

View File

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

View File

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