pyxley.filters package¶
Submodules¶
pyxley.filters.filters module¶
-
class
pyxley.filters.filters.
ApiButton
(label, url, filter_id, default, route_func)¶ Bases:
pyxley.filters.filters.Filter
Selections populated by API.
A dropdown selection button based on the React-Bootstrap Dropdown. http://react-bootstrap.github.io/components.html#buttons
The selections are created by calling an endpoint.
Parameters: - label (str) – label of the button.
- url (str) – name of endpoint to create.
- filter_id (str) – alias of the filter.
- default (str) – default selection.
- route_func (function) – endpoint function to serve the options.
-
class
pyxley.filters.filters.
ConditionalButton
(labels, items, filter_ids, defaults, filter_style='btn-group')¶ Bases:
pyxley.filters.filters.Filter
Conditional Button Group.
A group of two buttons where the parent choice affects the child choice.
Parameters: - labels (list) – labels of the button.
- items (dict) – choices, children are nested.
- filter_ids (list) – list of aliases for the filter.
- defaults (list) – default selections.
- filter_style – css for the buttons.
-
class
pyxley.filters.filters.
DownloadButton
(label, url, route_func)¶ Bases:
pyxley.filters.filters.Filter
Download Button.
A simple download button.
Parameters: - label (str) – label of the button.
- url (str) – endpoint to call upon click.
- route_func (function) – endpoint function.
-
class
pyxley.filters.filters.
DynamicTextInput
(url, filter_id, default, route_func, placeholder='Enter text...', help='')¶ Bases:
pyxley.filters.filters.Filter
Dynamic Text Selection.
A combination search bar plus drop down inspired by: https://realpython.com/blog/python/the-ultimate-flask-front-end-part-2/
The selections are created by calling an endpoint.
Parameters: - url (str) – name of endpoint to create.
- filter_id (str) – alias of the filter.
- default (str) – default selection.
- route_func (function) – endpoint function to serve the options.
- placeholder (str) – default text.
- help (str) – help text.
-
class
pyxley.filters.filters.
Filter
(component_type, options, route_func)¶ Bases:
pyxley.ui.UIComponent
Base class for Filter UIComponent
-
name
= 'Filter'¶
-
-
class
pyxley.filters.filters.
ReactSelect
(url, filter_id, default, route_func, placeholder='Enter text...', extra_args={})¶ Bases:
pyxley.filters.filters.Filter
react-select wrapper
This is a wrapper for the react-select library http://jedwatson.github.io/react-select/
Parameters: - url (str) – name of endpoint to create.
- filter_id (str) – alias of the filter.
- default (str) – default selection.
- route_func (function) – endpoint function to serve the options.
- placeholder (str) – default text.
- extra_args (dict) – extra props.
-
static
format_options
(opts)¶
-
class
pyxley.filters.filters.
SelectButton
(label, items, filter_id, default)¶ Bases:
pyxley.filters.filters.Filter
Dropdown Button.
A dropdown selection button based on the React-Bootstrap Dropdown. http://react-bootstrap.github.io/components.html#buttons
Parameters: - label (str) – label of the button.
- items (dict) – choices, children are nested.
- filter_id (str) – alias of the filter.
- default (str) – default selection.
-
class
pyxley.filters.filters.
SliderInput
(label, min_val, max_val, filter_id, default, step=1)¶ Bases:
pyxley.filters.filters.Filter
Simple Slider input.
A slider bar.
Parameters: - label (str) – label of the slider.
- min_val (int) – minimum value.
- max_val (int) – maximum value.
- filter_id (str) – list of aliases for the filter.
- default (int) – default selection.
- step (int) – size of the step associated with the slider.