dave on Nostr: 'if': { 'column_id': 'expand', 'filter_query': '{expand} eq 1' }, 'display': 'none' ...
'if': {
'column_id': 'expand',
'filter_query': '{expand} eq 1'
},
'display': 'none'
},
{
'if': {
'column_id': 'collapse',
'filter_query': '{collapse} eq 1'
},
'display': 'none'
}
],
style_table={
'maxHeight': '300px',
'overflowY': 'scroll'
},
expand_rows=True
)
])
@app.callback(
Output("table-expand", "data"),
[Input("table-expand", "active_cell")]
)
def expand_row(active_cell):
global df
if active_cell is None:
return df.to_dict('records')
else:
active_row = active_cell['row']
if active_row is None:
return df.to_dict('records')
else:
row_state = active_cell['column_id']
df.loc[active_row, row_state] = df.loc[active_row, row_state]^1
return df.to_dict('records')
if __name__ == '__main__':
app.run_server(debug=True)
Published at
2023-01-08 14:02:18Event JSON
{
"id": "0b176d3e5a86b578b0c2ce5ab2ab838e0a667e44f64e11c5e6fb97761883289e",
"pubkey": "5c10ed0678805156d39ef1ef6d46110fe1e7e590ae04986ccf48ba1299cb53e2",
"created_at": 1673186538,
"kind": 1,
"tags": [
[
"e",
"00000081737e49c428865be1b96cc1029d6927bb17aa22d5659724c3f7664a57",
"",
"root"
],
[
"e",
"00028801bfe6a1bd133a7b740677d1b135d2cb0180f06b52ae0482b34d3074b2",
"",
"reply"
],
[
"p",
"9f5e70ecf99a0ac6171ca014885aeb93843ba869c679209e2ea4bb61b586da7d"
]
],
"content": "'if': {\n 'column_id': 'expand',\n 'filter_query': '{expand} eq 1'\n },\n 'display': 'none'\n },\n {\n 'if': {\n 'column_id': 'collapse',\n 'filter_query': '{collapse} eq 1'\n },\n 'display': 'none'\n }\n ],\n style_table={\n 'maxHeight': '300px',\n 'overflowY': 'scroll'\n },\n expand_rows=True\n )\n])\n\n@app.callback(\n Output(\"table-expand\", \"data\"),\n [Input(\"table-expand\", \"active_cell\")]\n)\ndef expand_row(active_cell):\n global df \n if active_cell is None:\n return df.to_dict('records')\n else:\n active_row = active_cell['row']\n if active_row is None:\n return df.to_dict('records')\n else:\n row_state = active_cell['column_id']\n df.loc[active_row, row_state] = df.loc[active_row, row_state]^1\n return df.to_dict('records')\n\nif __name__ == '__main__':\n app.run_server(debug=True)",
"sig": "778cdb8c6729f93dba0462227556b6673f8b2a2bc39945f01f15c21e582cb72e8f44b9bdf51908edbe4fbe56856701005dc60aea9a89661b5cb6152fe2aed577"
}