How to use the dash-table/components/Table/props.ColumnType.Any 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 / utils / applyClipboardToData.ts View on Github external
let newData = R.clone(data);
    // Might add columns, not modifying the columns themselves, shallow clone is sufficient
    let newColumns = columns_.slice(0);
    let newVisibleColumns = visibleColumns.slice(0);

    if (overflowColumns && values[0].length + (activeCell as any).column >= visibleColumns.length) {
        const _newColumns = [];
        for (
            let i = visibleColumns.length;
            i < values[0].length + (activeCell as any).column;
            i++
        ) {
            _newColumns.push({
                id: `Column ${i + 1}`,
                name: `Column ${i + 1}`,
                type: ColumnType.Any,
                sort_as_null: []
            } as any);
            newData.forEach(row => (row[`Column ${i}`] = ''));
        }

        newColumns = R.insertAll(
            R.indexOf(R.last(visibleColumns), columns_) + 1,
            _newColumns,
            newColumns
        );

        newVisibleColumns = R.concat(newVisibleColumns, _newColumns);
    }

    const realActiveRow = derived_viewport_indices[(activeCell as any).row];
    if (overflowRows && values.length + realActiveRow >= data.length) {
github plotly / dash-table / tests / visual / percy-storybook / Style.percy.tsx View on Github external
.add('first column is editable and not blue', () => ())
    .add('style header and column based on edibility', () => (
github plotly / dash-table / tests / visual / percy-storybook / Style.percy.tsx View on Github external
{ a: 1, b: 2, c: '3', d: '4', e: 5, f: 6, g: 7, h: 8 },
            { a: 11, b: 22, c: '33', d: '44', e: 55, f: 66, g: 77, h: 88 },
            { a: 111, b: 222, c: '333', d: '444', e: 555, f: 666, g: 777, h: 888 }
        ]}
        columns={[
            { id: 'a', name: 'A', type: ColumnType.Any },
            { id: 'b', name: 'B', type: ColumnType.Any },
            { id: 'c', name: 'C', type: ColumnType.Text },
            { id: 'd', name: 'D', type: ColumnType.Text },
            { id: 'e', name: 'E', type: ColumnType.Numeric },
            { id: 'f', name: 'F', type: ColumnType.Numeric },
            { id: 'g', name: 'G' },
            { id: 'h', name: 'H' }
        ]}
        style_data_conditional={[
            { if: { column_type: ColumnType.Any, row_index: 'even' }, background_color: 'blue', color: 'white' },
            { if: { column_type: ColumnType.Text, row_index: 'even' }, background_color: 'red', color: 'white' },
            { if: { column_type: ColumnType.Numeric, row_index: 'even' }, background_color: 'green', color: 'white' },
            { if: { column_type: ColumnType.Any }, background_color: 'blue' },
            { if: { column_type: ColumnType.Text }, background_color: 'red' },
            { if: { column_type: ColumnType.Numeric }, background_color: 'green' }
        ]}
    />))
    .add('row padding', () => (
github plotly / dash-table / src / dash-table / syntax-tree / SingleColumnSyntaxTree.ts View on Github external
function getImplicitLexeme(type: ColumnType = ColumnType.Any): ILexemeResult {
    switch (type) {
        case ColumnType.Any:
        case ColumnType.Text:
            return {
                lexeme: boundLexeme(contains),
                value: RelationalOperator.Contains
            };
        case ColumnType.Datetime:
            return {
                lexeme: boundLexeme(dateStartsWith),
                value: RelationalOperator.DateStartsWith
            };
        case ColumnType.Numeric:
            return {
                lexeme: boundLexeme(equal),
                value: RelationalOperator.Equal
            };
    }
github plotly / dash-table / src / dash-table / type / reconcile.ts View on Github external
function getValidator(c: Options): (value: any, c?: any) => IReconciliation {
    switch (c.type) {
        case ColumnType.Numeric:
            return validateNumber;
        case ColumnType.Text:
            return validateText;
        case ColumnType.Datetime:
            return validateDate;
        case ColumnType.Any:
        default:
            return reconcileAny;
    }
}
github plotly / dash-table / src / dash-table / conditional / index.ts View on Github external
export function ifColumnType(condition: ITypedElement | undefined, columnType?: ColumnType) {
    return !condition ||
        condition.column_type === undefined ||
        condition.column_type === (columnType || ColumnType.Any);
}
github plotly / dash-table / src / dash-table / syntax-tree / SingleColumnSyntaxTree.ts View on Github external
function getImplicitLexeme(type: ColumnType = ColumnType.Any): ILexemeResult {
    switch (type) {
        case ColumnType.Any:
        case ColumnType.Text:
            return {
                lexeme: boundLexeme(contains),
                value: RelationalOperator.Contains
            };
        case ColumnType.Datetime:
            return {
                lexeme: boundLexeme(dateStartsWith),
                value: RelationalOperator.DateStartsWith
            };
        case ColumnType.Numeric:
            return {
                lexeme: boundLexeme(equal),
                value: RelationalOperator.Equal