OK. looks like we are on the same versions now. Even though pip is 2.5.1, doing the prints like you I show the same.
I have added tooltip_conditional to the above code (to match more like mine) and am receiving the same error now. Maybe this was always tooltip related, not styling.
here is the full code with added tooltip_conditional:
import dash
import dash_table
import dash_html_components as html
from dash.dependencies import Input, Output, State, MATCH, ALL
import pandas as pd
app = dash.Dash(__name__)
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/Emissions%20Data.csv').reset_index()
df['Emission'] = df['Emission'].map(lambda x: '{0:.2f}'.format(x))
app.layout = html.Div([html.Div([], id='test'), dash_table.DataTable(
id='table',
data=df.to_dict('records'),
columns=[{'id': c, 'name': c} for c in df.columns],
editable=True,
filter_action="native",
sort_action="native",
sort_mode="multi",
page_action="none",
fixed_rows={'headers': True, 'data': 0},
#sort_action='native',
export_format="xlsx",
export_headers="display",
export_columns='all',
#filter_action='native',
virtualization=True,
style_data_conditional=[{
'if': {
'filter_query': '{Emission} > 0',
'column_id': 'Emission'
},
'color': 'green'
},
{
'if': {
'filter_query': '{Emission} < 0',
'column_id': 'Emission'
},
'color': 'red'
}],
tooltip_conditional=[
{
'if': {
'filter_query': '{Emission} < 0',
'column_id': 'Emission'
},
'value': 'Further review required, calculated demand is 20% lower than the 3 year average units sold'
},
{
'if': {
'filter_query': '{Emission} > 0',
'column_id': 'Emission'
},
'value': 'Further review required, calculated demand is 20% higher than the 3 year average units sold'
},
]
)
])
@app.callback(Output('test', 'children'), [Input('table', 'active_cell')])
def updateIT(ac):
if ac:
return ac['column_id']
else:
return ''
if __name__ == '__main__':
app.run_server(debug=True)