Liking cljdoc? Tell your friends :D

metabase.automagic-dashboards.filters


add-filtersclj

(add-filters dashboard max-filters)
(add-filters dashboard dimensions max-filters)

Add up to max-filters filters to dashboard dashboard. Takes an optional argument dimensions which is a list of fields for which to create filters, else it tries to infer by which fields it would be useful to filter.

Add up to `max-filters` filters to dashboard `dashboard`. Takes an optional
argument `dimensions` which is a list of fields for which to create filters, else
it tries to infer by which fields it would be useful to filter.
sourceraw docstring

collect-field-referencesclj

(collect-field-references form)

Collect all field references ([:field-id], [:fk->] or [:field-literal] forms) from a given form.

Collect all field references (`[:field-id]`, `[:fk->]` or `[:field-literal]` forms) from a given
form.
sourceraw docstring

datetime?clj

(datetime? field)

Is field a datetime?

Is `field` a datetime?
sourceraw docstring

field-reference->idcljmultimethod

(field-reference->id op & args)

Extract field ID from a given field reference form.

Extract field ID from a given field reference form.
sourceraw docstring

inject-refinementclj

(inject-refinement filter-clause refinement)

Inject a filter refinement into an MBQL filter clause, returning a new filter clause.

There are two reasons why we want to do this: 1) to reduce visual noise when we display applied filters; and 2) some DBs don't do this optimization or even protest (eg. GA) if there are duplicate clauses.

Assumes that any refinement sub-clauses referencing fields that are also referenced in the main clause are subsets of the latter. Therefore we can rewrite the combined clause to ommit the more broad version from the main clause. Assumes both filter clauses can be flattened by recursively merging :and claueses (ie. no :ands inside :or or :not).

Inject a filter refinement into an MBQL filter clause, returning a new filter clause.

There are two reasons why we want to do this: 1) to reduce visual noise when we display applied filters; and 2) some
DBs don't do this optimization or even protest (eg. GA) if there are duplicate clauses.

Assumes that any refinement sub-clauses referencing fields that are also referenced in the main clause are subsets
of the latter. Therefore we can rewrite the combined clause to ommit the more broad version from the main clause.
Assumes both filter clauses can be flattened by recursively merging `:and` claueses
(ie. no `:and`s inside `:or` or `:not`).
sourceraw docstring

interesting-fieldsclj

(interesting-fields fields)

Pick out interesting fields and sort them by interestingness.

Pick out interesting fields and sort them by interestingness.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close