How to use the dash-table/components/Table/props.ColumnType.Numeric 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 / tests / visual / percy-storybook / Style.percy.tsx View on Github external
{ 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 / tests / visual / percy-storybook / Style.percy.tsx View on Github external
.add('green if table is not editable', () => ())
    .add('first column is editable and blue', () => (
github plotly / dash-table / tests / visual / percy-storybook / Style.percy.tsx View on Github external
.add('with 1 column', () => ())
    .add('row padding', () => (
github plotly / dash-table / tests / visual / percy-storybook / Style.percy.tsx View on Github external
.add('with 1 column', () => ())
    .add('row padding', () => (
github plotly / dash-table / demo / data.ts View on Github external
export const generateSpaceMockData = (rows: number) => unpackIntoColumnsAndData([
    {
        id: 'rows',
        type: ColumnType.Numeric,
        editable: false,
        data: gendata(i => i, rows)
    },

    {
        id: 'c cc',
        name: ['City', 'Canada', 'Toronto'],
        type: ColumnType.Numeric,
        data: gendata(i => i, rows)
    },

    {
        id: 'd:dd',
        name: ['City', 'Canada', 'Montréal'],
        type: ColumnType.Numeric,
        data: gendata(i => i * 100, rows)
github plotly / dash-table / demo / data.ts View on Github external
name: ['City', 'America', 'New York City'],
        type: ColumnType.Numeric,
        data: gendata(i => i, rows)
    },

    {
        id: 'fff',
        name: ['City', 'America', 'Boston'],
        type: ColumnType.Numeric,
        data: gendata(i => i + 1, rows)
    },

    {
        id: 'ggg',
        name: ['City', 'France', 'Paris'],
        type: ColumnType.Numeric,
        editable: true,
        data: gendata(i => i * 10, rows)
    },

    {
        id: 'bbb',
        name: ['', 'Weather', 'Climate'],
        type: ColumnType.Text,
        presentation: 'dropdown',
        data: gendata(
            i => ['Humid', 'Wet', 'Snowy', 'Tropical Beaches'][i % 4],
            rows
        )
    },

    {
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 / dash / Sanitizer.ts View on Github external
) => R.map(column => {
    const c = R.clone(column);
    c.editable = resolveFlag(editable, column.editable);
    c.sort_as_null = c.sort_as_null || defaultSort;

    if (c.type === ColumnType.Numeric && c.format) {
        c.format.locale = getLocale(defaultLocale, c.format.locale);
        c.format.nully = getNully(c.format.nully);
        c.format.specifier = getSpecifier(c.format.specifier);
    }
    return c;
}, columns);
github plotly / dash-table / src / dash-table / type / reconcile.ts View on Github external
function getCoercer(c: Options): (value: any, c?: any) => IReconciliation {
    switch (c.type) {
        case ColumnType.Numeric:
            return coerceNumber;
        case ColumnType.Text:
            return coerceText;
        case ColumnType.Datetime:
            return coerceDate;
        case ColumnType.Any:
        default:
            return reconcileAny;
    }
}