How to use the dash-table/derived/header/headerRows function in dash-table

To help you get started, we’ve selected a few dash-table examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github plotly / dash-table / src / dash-table / dash / Sanitizer.ts View on Github external
const getFixedRows = (
    fixed: Fixed,
    columns: IColumn[],
    filter_action: TableAction
) => !fixed.headers ?
        0 :
        headerRows(columns) + (filter_action !== TableAction.None ? 1 : 0) + data2number(fixed.data);
github plotly / dash-table / src / dash-table / utils / TableClipboardHelper.ts View on Github external
const selectedRows = R.uniq(R.pluck('row', selectedCells).sort((a, b) => a - b));
        const selectedCols: any = R.uniq(R.pluck('column', selectedCells).sort((a, b) => a - b));

        const df = R.slice(
            R.head(selectedRows) as any,
            R.last(selectedRows) as any + 1,
            data
        ).map(row =>
            R.props(selectedCols, R.props(R.pluck('id', visibleColumns) as any, row) as any)
        );

        let value = SheetClip.prototype.stringify(df);
        TableClipboardHelper.lastLocalCopy = df;

        if (includeHeaders) {
            const transposedHeaders = createHeadings(R.pluck('name', visibleColumns), getHeaderRows(columns));
            const headers: any = R.map((row: string[]) => R.map((index: number) => row[index], selectedCols), transposedHeaders);
            const dfHeaders = headers.concat(df);
            value = SheetClip.prototype.stringify(dfHeaders);
            TableClipboardHelper.lastLocalCopy = dfHeaders;
            TableClipboardHelper.localCopyWithoutHeaders = df;
        }

        Logger.trace('TableClipboard -- set clipboard data: ', value);

        Clipboard.set(e, value);
    }
github plotly / dash-table / src / dash-table / components / EdgeFactory.tsx View on Github external
const filterStyles = this.filterStyles(
            style_cell,
            style_filter,
            style_cell_conditional,
            style_filter_conditional
        );

        const headerStyles = this.headerStyles(
            style_cell,
            style_header,
            style_cell_conditional,
            style_header_conditional
        );

        const headerRows = getHeaderRows(columns);

        let dataEdges = this.getDataEdges(
            visibleColumns,
            dataStyles,
            data,
            offset,
            active_cell,
            style_as_list_view
        );

        let dataOpEdges = this.getDataOpEdges(
            operations,
            dataStyles,
            data,
            offset,
            style_as_list_view
github plotly / dash-table / src / dash-table / components / Export / index.tsx View on Github external
const handleExport = async () => {
        const columnID = exportedColumns.map(column => column.id);
        const columnHeaders = exportedColumns.map(column => column.name);

        const maxLength = getHeaderRows(columns);
        const heading = (export_headers !== ExportHeaders.None) ? createHeadings(columnHeaders, maxLength) : [];

        const wb = await createWorkbook(heading, virtual_data.data, columnID, export_headers, merge_duplicate_headers);

        await exportWorkbook(wb, export_format);
    };