aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DataVizBox/components/TableBox.tsx
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-07-18 10:50:16 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-07-18 10:50:16 -0400
commit65ab8c985a86f18ebb51a269f20d7865dcfc6589 (patch)
tree6a9666d7c623afcbeea1debc7ceda30a599762cf /src/client/views/nodes/DataVizBox/components/TableBox.tsx
parent56c2063deb32302b58044181c9f3248da409bf13 (diff)
click on histograms
Diffstat (limited to 'src/client/views/nodes/DataVizBox/components/TableBox.tsx')
-rw-r--r--src/client/views/nodes/DataVizBox/components/TableBox.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/TableBox.tsx b/src/client/views/nodes/DataVizBox/components/TableBox.tsx
index d84e34d52..8c8264861 100644
--- a/src/client/views/nodes/DataVizBox/components/TableBox.tsx
+++ b/src/client/views/nodes/DataVizBox/components/TableBox.tsx
@@ -33,6 +33,7 @@ export class TableBox extends React.Component<TableBoxProps> {
const header = React.createRef<HTMLElement>();
return (
<th
+ key={this.columns.indexOf(col)}
ref={header as any}
style={{
color: this.props.axes.slice().reverse().lastElement() === col ? 'green' : this.props.axes.lastElement() === col ? 'red' : undefined,
@@ -90,9 +91,9 @@ export class TableBox extends React.Component<TableBoxProps> {
<tbody>
{this.props.pairs?.map((p, i) => {
return (
- <tr className="table-row" onClick={action(e => (p['select' + this.props.docView?.()?.rootDoc![Id]] = !p['select' + this.props.docView?.()?.rootDoc![Id]]))}>
+ <tr key={i} className="table-row" onClick={action(e => (p['select' + this.props.docView?.()?.rootDoc![Id]] = !p['select' + this.props.docView?.()?.rootDoc![Id]]))}>
{this.columns.map(col => (
- <td style={{ fontWeight: p['select' + this.props.docView?.()?.rootDoc![Id]] ? 'bold' : '' }}>{p[col]}</td>
+ <td key={this.columns.indexOf(col)} style={{ fontWeight: p['select' + this.props.docView?.()?.rootDoc![Id]] ? 'bold' : '' }}>{p[col]}</td>
))}
</tr>
);