You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/09/20 04:29:11 UTC
[GitHub] [superset] rusackas commented on a diff in pull request #21482: feat: Making bar graphs in Table viz from fixed-size divs instead of calculated gradients
rusackas commented on code in PR #21482:
URL: https://github.com/apache/superset/pull/21482#discussion_r974873995
##########
superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx:
##########
@@ -404,16 +429,33 @@ export default function TableChart<D extends DataRecord = DataRecord>(
const StyledCell = styled.td`
text-align: ${sharedStyle.textAlign};
- background: ${backgroundColor ||
- (valueRange
- ? cellBar({
+ white-space: ${value instanceof Date ? 'nowrap' : undefined};
+ position: relative;
+ background: ${backgroundColor || undefined};
+ `;
+
+ const cellBarStyles = css`
+ position: absolute;
+ height: 100%;
+ display: block;
+ top: 0;
+ ${valueRange &&
Review Comment:
This is actually just avoiding a bit of a typescript rabbit hole. The conditional isn't _really_ needed here, but if you take it out, it starts pulling the loose thread on a sweater...
##########
superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx:
##########
@@ -404,16 +429,33 @@ export default function TableChart<D extends DataRecord = DataRecord>(
const StyledCell = styled.td`
text-align: ${sharedStyle.textAlign};
- background: ${backgroundColor ||
- (valueRange
- ? cellBar({
+ white-space: ${value instanceof Date ? 'nowrap' : undefined};
+ position: relative;
+ background: ${backgroundColor || undefined};
+ `;
+
+ const cellBarStyles = css`
+ position: absolute;
+ height: 100%;
+ display: block;
+ top: 0;
+ ${valueRange &&
Review Comment:
I'll circle back to this if time allows.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org