You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2022/09/15 05:08:06 UTC

[superset] branch revising-table-bar-chart-css updated (8c3024919b -> 9d71ae10ab)

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a change to branch revising-table-bar-chart-css
in repository https://gitbox.apache.org/repos/asf/superset.git


    from 8c3024919b conditional div, optimized styling, useful class names
     new 746841ab6a adding classnames types dependency
     new 9d71ae10ab linting

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../plugins/plugin-chart-table/package.json        |  2 +
 .../plugins/plugin-chart-table/src/TableChart.tsx  | 53 ++++++++++------------
 2 files changed, 25 insertions(+), 30 deletions(-)


[superset] 01/02: adding classnames types dependency

Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch revising-table-bar-chart-css
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 746841ab6afca622063bd362f947a51a783d270a
Author: Evan Rusackas <ev...@preset.io>
AuthorDate: Wed Sep 14 23:07:44 2022 -0600

    adding classnames types dependency
---
 superset-frontend/plugins/plugin-chart-table/package.json | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/superset-frontend/plugins/plugin-chart-table/package.json b/superset-frontend/plugins/plugin-chart-table/package.json
index 0577c731a6..bbb5bb6518 100644
--- a/superset-frontend/plugins/plugin-chart-table/package.json
+++ b/superset-frontend/plugins/plugin-chart-table/package.json
@@ -39,9 +39,11 @@
   },
   "peerDependencies": {
     "@types/react": "*",
+    "@types/classnames": "*",
     "@superset-ui/chart-controls": "*",
     "@superset-ui/core": "*",
     "react": "^16.13.1",
     "react-dom": "^16.13.1"
+    
   }
 }


[superset] 02/02: linting

Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch revising-table-bar-chart-css
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 9d71ae10ab7466bb1a3cf6e9d3405f1d48f668ea
Author: Evan Rusackas <ev...@preset.io>
AuthorDate: Wed Sep 14 23:07:49 2022 -0600

    linting
---
 .../plugins/plugin-chart-table/src/TableChart.tsx  | 53 ++++++++++------------
 1 file changed, 23 insertions(+), 30 deletions(-)

diff --git a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
index 0cffa1fdbc..8bbf893543 100644
--- a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
+++ b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
@@ -142,9 +142,7 @@ function cellBackground({
   colorPositiveNegative: boolean;
 }) {
   const r = colorPositiveNegative && value < 0 ? 150 : 0;
-  return (
-    `rgba(${r},0,0,0.2)`
-  );
+  return `rgba(${r},0,0,0.2)`;
 }
 
 function SortIcon<D extends object>({ column }: { column: ColumnInstance<D> }) {
@@ -440,29 +438,23 @@ export default function TableChart<D extends DataRecord = DataRecord>(
             height: 100%;
             display: block;
             top: 0;
-            ${
-              valueRange && `
-                width: ${
-                  cellWidth({
-                      value: value as number,
-                      valueRange,
-                      alignPositiveNegative,
-                    }) + '%'};
-                left: ${
-                  cellOffset({
-                      value: value as number,
-                      valueRange,
-                      alignPositiveNegative,
-                    }) + '%'
-                  };
-                background-color: ${
-                  cellBackground({
-                      value: value as number,
-                      colorPositiveNegative,
-                    })
-                  };
-              `
-            }
+            ${valueRange &&
+            `
+                width: ${`${cellWidth({
+                  value: value as number,
+                  valueRange,
+                  alignPositiveNegative,
+                })}%`};
+                left: ${`${cellOffset({
+                  value: value as number,
+                  valueRange,
+                  alignPositiveNegative,
+                })}%`};
+                background-color: ${cellBackground({
+                  value: value as number,
+                  colorPositiveNegative,
+                })};
+              `}
           `;
 
           const cellProps = {
@@ -509,12 +501,13 @@ export default function TableChart<D extends DataRecord = DataRecord>(
                 text
               )}
               {valueRange && (
-                <div className={
-                  cx(
+                <div
+                  className={cx(
                     'cell-bar',
                     value && value < 0 ? 'negative' : 'positive',
-                  )
-                }  css={cellBarStyles} />
+                  )}
+                  css={cellBarStyles}
+                />
               )}
             </StyledCell>
           );