Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

filter_query of style_**_conditional cannot find empty value #544

Closed
laoxu0212 opened this issue Aug 12, 2019 · 0 comments · Fixed by #570
Closed

filter_query of style_**_conditional cannot find empty value #544

laoxu0212 opened this issue Aug 12, 2019 · 0 comments · Fixed by #570
Labels
dash-type-bug Something isn't working as intended size: 0.2
Milestone

Comments

@laoxu0212
Copy link

Here are the background and the requirement:

For each row of my data, some points are missing, which will leave some cells blank.
e.g.
columns=[{'name': 'a', 'id': 'a'}, {'name': 'b', 'id': 'b'}, {'name': 'c', 'id': 'c'}]
data=[{'a':1, 'b':2}, {'b':1, 'c':2},{'a':2, 'c':3}]

I would like to highlight some missing data by changing its cell's background color.

Therefore, I should use

style_data_conditional = [{
'if':{
'column_id': 'c',
'filter_query': '{c} = ????'}},
'backgroundColor': "#3D9970"
]

to filter the empty cell.

But I don't know what to write for ???? in code. I did not find it in the documents neither.

I know I could modify my data like data[0]['c'] = 'N/A' and filter that out. But it seems that the Operators from https://dash.plot.ly/datatable/filtering can only find valid data, is there or will there be anyway to filter out those empty cell without making my data redundant?

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dash-type-bug Something isn't working as intended size: 0.2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants