Black Lives Matter. Please consider donating to Black Girls Code today.

Highlighting a selected row in DataTable

I have a relatively complex dash app with 2 datatables (A and B) and 3 graphs (P and Q).
On selection of rows in table A, a callback retrieves data (expensive operation), plots graph P and fills table B. It also generates conditional rules to set a background color on rows in table B, based on what item was selected in table A (ie. there is 1-to-many relationship between table A records and table B records, and I use colors to make them clear).

Table B also allows selection of multiple rows. Based on the selection, I go retrieve more data (another expensive operation) and plot graph Q.
I would like to also find a way of using colors to tie in table B rows and the Q graph. I was therefore hoping to be able to set a border colour around the selected rows in table B when they are selected. (border color would show link between table B and graph Q, whereas background color shows link between table B and table A).

I did not find a direct way of setting border color when selecting the row.
I then thought that maybe I could use a callback, using Input(“tableB”, “selected_rows”) and Output(“tableB”, “style_data_conditional”).

Unfortunately when I do that, I get the following error:
Multi output ..tableB.style_data_conditional.. contains an `Output` object that was already assigned. Duplicates: {'table_outputs.style_data_conditional'}

Maybe I could add to the other set of style_data_conditional in the first callback (filling B from table A selection), but that would force all the data being retrieved again to fill B when I am just selecting a row…

Any recommendation?