How to use the dash-table/syntax-tree.QuerySyntaxTree 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 / derived / style / index.ts View on Github external
matchesFilter: (datum: Datum) =>
            !style.if ||
            style.if.filter_query === undefined ||
            (ast = ast || new QuerySyntaxTree(style.if.filter_query)).evaluate(datum),
        style: convertStyle(style)
github plotly / dash-table / src / dash-table / derived / cell / dropdowns.ts View on Github external
private readonly ast = memoizerCache<[ColumnId, number]>()((
        query: string
    ) => new QuerySyntaxTree(query));
github plotly / dash-table / src / dash-table / conditional / index.ts View on Github external
export function ifFilter(condition: IConditionalElement | undefined, datum: Datum) {
    return !condition ||
        condition.filter_query === undefined ||
        ifAstFilter(new QuerySyntaxTree(condition.filter_query), datum);
}
github plotly / dash-table / src / dash-table / derived / data / virtual.ts View on Github external
const getter = (
    columns: Columns,
    data: Data,
    filter_action: TableAction,
    filter_query: string,
    sort_action: TableAction,
    sort_by: SortBy = []
): IDerivedData => {
    const map = new Map();
    R.addIndex(R.forEach)((datum, index) => {
        map.set(datum, index);
    }, data);

    if (filter_action === TableAction.Native) {
        const tree = new QuerySyntaxTree(filter_query);

        data = tree.isValid ?
            tree.filter(data) :
            data;
    }

    const getNullyCases = (
        columnId: ColumnId
    ): SortAsNull => {
        const column = R.find(c => c.id === columnId, columns);

        return (column && column.sort_as_null) || [];
    };

    const isNully = (
        value: any,