rusackas commented on a change in pull request #11239:
URL: 
https://github.com/apache/incubator-superset/pull/11239#discussion_r508203275



##########
File path: superset-frontend/src/visualizations/TimeTable/TimeTable.jsx
##########
@@ -89,7 +90,74 @@ const defaultProps = {
   url: '',
 };
 
+const TimeTableStyles = styled.div`
+  height: ${props => props.height}px;
+
+  th {
+    z-index: 1; // to cover sparkline
+  }
+`;
+
 class TimeTable extends React.PureComponent {
+  memoizedColumns = memoize(columnConfigs => [
+    { accessor: 'metric', Header: 'Metric' },
+    ...columnConfigs.map((columnConfig, i) => ({
+      accessor: columnConfig.key,
+      cellProps: columnConfig.colType === 'spark' && { style: { width: '1%' } 
},
+      Header: () => (
+        <>
+          {columnConfig.label}{' '}
+          {columnConfig.tooltip && (
+            <InfoTooltipWithTrigger
+              tooltip={columnConfig.tooltip}
+              label={`tt-col-${i}`}
+              placement="top"
+            />
+          )}
+        </>
+      ),
+      sortType: (rowA, rowB, columnId) => {
+        const rowAVal = rowA.values[columnId].props['data-value'];
+        const rowBVal = rowB.values[columnId].props['data-value'];
+        return rowAVal - rowBVal;
+      },
+    })),
+  ]);
+
+  memoizedRows = memoize((data, rows, columnConfigs) => {

Review comment:
       oh... this one is going to have issues, from the look of it... we should 
_definitely_ not be using `lodash/memoize` for this.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to