Dash와 Plotly로 대시보드 만들기
Alex Scriven
Data Scientist
style은 사용 불가 ❌cellStyle 사용 ✅grid = AgGrid(
defaultColDef={
"cellStyle":
{"textAlign": "right"}}
)

column_defs = [
{"field": "Major Category"
, "cellStyle": {"textAlign": "center"}},
{"field": "Total Sales ($)"
, "valueFormatter": money_fmt
, "cellStyle": {"textAlign": "right"}}
]

grid = AgGrid(
# Other setup
defaultColDef={
"cellStyle": {
"backgroundColor": "black",
"color": "white"}
})
$$

$$
cellClicked 속성 사용@callback(
Output("test_text", "children"),
Input("my_grid", "cellClicked")
)
def show_cell_info(cell_data):
return str(cell_data)

rowSelection을 "single" 또는 "multiple"로 설정grid = AgGrid( # Other parts dashGridOptions={ "rowSelection": "single"} )@callback( Output("test_text", "children"), Input("my_grid", "selectedRows") )

Dash와 Plotly로 대시보드 만들기