You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "lilykuang (via GitHub)" <gi...@apache.org> on 2023/02/22 01:18:40 UTC

[GitHub] [superset] lilykuang opened a new pull request, #23145: chore: refactor SparklineCell for react 17 and react 18 upgrade

lilykuang opened a new pull request, #23145:
URL: https://github.com/apache/superset/pull/23145

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   @data-ui/sparkline doesn't support react 17 or react 18 
   - remove @data-ui/sparkline
   - migrate from @data-ui/sparkline to visx/xychart for SparklineCell
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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


[GitHub] [superset] eschutho commented on a diff in pull request #23145: chore: refactor SparklineCell for react 17 and react 18 upgrade

Posted by "eschutho (via GitHub)" <gi...@apache.org>.
eschutho commented on code in PR #23145:
URL: https://github.com/apache/superset/pull/23145#discussion_r1116242419


##########
superset-frontend/package.json:
##########
@@ -114,7 +113,12 @@
     "@superset-ui/plugin-chart-word-cloud": "file:./plugins/plugin-chart-word-cloud",
     "@superset-ui/preset-chart-xy": "file:./plugins/preset-chart-xy",
     "@superset-ui/switchboard": "file:./packages/superset-ui-switchboard",
+    "@visx/axis": "^3.0.1",
+    "@visx/grid": "^3.0.1",

Review Comment:
   any reason for/against using the same version across all @vizx packages?



-- 
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


[GitHub] [superset] codecov[bot] commented on pull request #23145: chore: refactor SparklineCell for react 17 and react 18 upgrade

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #23145:
URL: https://github.com/apache/superset/pull/23145#issuecomment-1439340411

   # [Codecov](https://codecov.io/gh/apache/superset/pull/23145?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#23145](https://codecov.io/gh/apache/superset/pull/23145?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f9c2aed) into [master](https://codecov.io/gh/apache/superset/commit/a40c12d63e04811f3a710a862298bfa68dfde3d8?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a40c12d) will **decrease** coverage by `0.01%`.
   > The diff coverage is `0.00%`.
   
   > :exclamation: Current head f9c2aed differs from pull request most recent head fc50e0f. Consider uploading reports for the commit fc50e0f to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #23145      +/-   ##
   ==========================================
   - Coverage   67.49%   67.48%   -0.01%     
   ==========================================
     Files        1898     1898              
     Lines       73070    73078       +8     
     Branches     7945     7948       +3     
   ==========================================
     Hits        49318    49318              
   - Misses      21716    21724       +8     
     Partials     2036     2036              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `53.66% <0.00%> (-0.02%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/23145?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...end/src/visualizations/TimeTable/SparklineCell.tsx](https://codecov.io/gh/apache/superset/pull/23145?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL1RpbWVUYWJsZS9TcGFya2xpbmVDZWxsLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...rontend/src/visualizations/TimeTable/TimeTable.jsx](https://codecov.io/gh/apache/superset/pull/23145?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL1RpbWVUYWJsZS9UaW1lVGFibGUuanN4) | `0.00% <ø> (ø)` | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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


[GitHub] [superset] lilykuang commented on a diff in pull request #23145: chore: refactor SparklineCell for react 17 and react 18 upgrade

Posted by "lilykuang (via GitHub)" <gi...@apache.org>.
lilykuang commented on code in PR #23145:
URL: https://github.com/apache/superset/pull/23145#discussion_r1116559764


##########
superset-frontend/package.json:
##########
@@ -114,7 +113,12 @@
     "@superset-ui/plugin-chart-word-cloud": "file:./plugins/plugin-chart-word-cloud",
     "@superset-ui/preset-chart-xy": "file:./plugins/preset-chart-xy",
     "@superset-ui/switchboard": "file:./packages/superset-ui-switchboard",
+    "@visx/axis": "^3.0.1",
+    "@visx/grid": "^3.0.1",

Review Comment:
   tried to install @visx/xychart 3.0.1 but there was a react-spring error. will keep @visx/xychart at 3.0.0



-- 
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


[GitHub] [superset] lilykuang commented on a diff in pull request #23145: chore: refactor SparklineCell for react 17 and react 18 upgrade

Posted by "lilykuang (via GitHub)" <gi...@apache.org>.
lilykuang commented on code in PR #23145:
URL: https://github.com/apache/superset/pull/23145#discussion_r1116559764


##########
superset-frontend/package.json:
##########
@@ -114,7 +113,12 @@
     "@superset-ui/plugin-chart-word-cloud": "file:./plugins/plugin-chart-word-cloud",
     "@superset-ui/preset-chart-xy": "file:./plugins/preset-chart-xy",
     "@superset-ui/switchboard": "file:./packages/superset-ui-switchboard",
+    "@visx/axis": "^3.0.1",
+    "@visx/grid": "^3.0.1",

Review Comment:
   tried to install @visx/xychart 3.0.1 but there was a react-spring error. will @visx/xychart 3.0.0



-- 
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


[GitHub] [superset] lilykuang commented on a diff in pull request #23145: chore: refactor SparklineCell for react 17 and react 18 upgrade

Posted by "lilykuang (via GitHub)" <gi...@apache.org>.
lilykuang commented on code in PR #23145:
URL: https://github.com/apache/superset/pull/23145#discussion_r1116559764


##########
superset-frontend/package.json:
##########
@@ -114,7 +113,12 @@
     "@superset-ui/plugin-chart-word-cloud": "file:./plugins/plugin-chart-word-cloud",
     "@superset-ui/preset-chart-xy": "file:./plugins/preset-chart-xy",
     "@superset-ui/switchboard": "file:./packages/superset-ui-switchboard",
+    "@visx/axis": "^3.0.1",
+    "@visx/grid": "^3.0.1",

Review Comment:
   tried to install @visx/xychart 3.0.1 but there was a react-spring error



-- 
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


[GitHub] [superset] Antonio-RiveroMartnez commented on a diff in pull request #23145: chore: refactor SparklineCell for react 17 and react 18 upgrade

Posted by "Antonio-RiveroMartnez (via GitHub)" <gi...@apache.org>.
Antonio-RiveroMartnez commented on code in PR #23145:
URL: https://github.com/apache/superset/pull/23145#discussion_r1114694376


##########
superset-frontend/src/visualizations/TimeTable/SparklineCell.tsx:
##########
@@ -18,39 +18,36 @@
  * under the License.
  */
 import React from 'react';
+import moment from 'moment';
 import {
-  Sparkline,
+  formatNumber,
+  formatTime,
+  getTextDimension,
+  useTheme,
+} from '@superset-ui/core';
+import { GridRows } from '@visx/grid';
+import { LinearScaleConfig, scaleLinear } from '@visx/scale';
+import { AxisScaleOutput } from '@visx/axis';
+import {
+  Axis,
   LineSeries,
-  PointSeries,
-  HorizontalReferenceLine,
-  VerticalReferenceLine,
-  WithTooltip,
-} from '@data-ui/sparkline';
-import { getTextDimension, formatNumber } from '@superset-ui/core';
+  Tooltip,
+  XYChart,
+  buildChartTheme,
+} from '@visx/xychart';
 
 interface Props {
-  ariaLabel: string;

Review Comment:
   Could we instead keep using it and pass it as the `accessibilityLabel` of the `XYChart`? https://airbnb.io/visx/docs/xychart#XYChart_accessibilityLabel



-- 
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


[GitHub] [superset] Antonio-RiveroMartnez commented on a diff in pull request #23145: chore: refactor SparklineCell for react 17 and react 18 upgrade

Posted by "Antonio-RiveroMartnez (via GitHub)" <gi...@apache.org>.
Antonio-RiveroMartnez commented on code in PR #23145:
URL: https://github.com/apache/superset/pull/23145#discussion_r1114671747


##########
superset-frontend/src/visualizations/TimeTable/SparklineCell.tsx:
##########
@@ -18,39 +18,36 @@
  * under the License.
  */
 import React from 'react';
+import moment from 'moment';
 import {
-  Sparkline,
+  formatNumber,
+  formatTime,
+  getTextDimension,
+  useTheme,
+} from '@superset-ui/core';
+import { GridRows } from '@visx/grid';
+import { LinearScaleConfig, scaleLinear } from '@visx/scale';
+import { AxisScaleOutput } from '@visx/axis';
+import {
+  Axis,
   LineSeries,
-  PointSeries,
-  HorizontalReferenceLine,
-  VerticalReferenceLine,
-  WithTooltip,
-} from '@data-ui/sparkline';
-import { getTextDimension, formatNumber } from '@superset-ui/core';
+  Tooltip,
+  XYChart,
+  buildChartTheme,
+} from '@visx/xychart';
 
 interface Props {
-  ariaLabel: string;
+  dataKey: string;
   className?: string;
+  data: Array<number>;
+  entries: Array<any>;
   height: number;
-  numberFormat: string;
-  renderTooltip: ({ index }: { index: number }) => void;
+  numberFormat?: string;

Review Comment:
   This wasn't optional before, any reason why we want it to be optional now?



##########
superset-frontend/src/visualizations/TimeTable/SparklineCell.tsx:
##########
@@ -18,39 +18,36 @@
  * under the License.
  */
 import React from 'react';
+import moment from 'moment';
 import {
-  Sparkline,
+  formatNumber,
+  formatTime,
+  getTextDimension,
+  useTheme,
+} from '@superset-ui/core';
+import { GridRows } from '@visx/grid';
+import { LinearScaleConfig, scaleLinear } from '@visx/scale';
+import { AxisScaleOutput } from '@visx/axis';
+import {
+  Axis,
   LineSeries,
-  PointSeries,
-  HorizontalReferenceLine,
-  VerticalReferenceLine,
-  WithTooltip,
-} from '@data-ui/sparkline';
-import { getTextDimension, formatNumber } from '@superset-ui/core';
+  Tooltip,
+  XYChart,
+  buildChartTheme,
+} from '@visx/xychart';
 
 interface Props {
-  ariaLabel: string;
+  dataKey: string;
   className?: string;
+  data: Array<number>;
+  entries: Array<any>;
   height: number;
-  numberFormat: string;
-  renderTooltip: ({ index }: { index: number }) => void;
+  numberFormat?: string;
+  dateFormat?: string;

Review Comment:
   This is new, but same as with `numberFormat`, do we want this to be optional?



-- 
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


[GitHub] [superset] lilykuang merged pull request #23145: chore: refactor SparklineCell for react 17 and react 18 upgrade

Posted by "lilykuang (via GitHub)" <gi...@apache.org>.
lilykuang merged PR #23145:
URL: https://github.com/apache/superset/pull/23145


-- 
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


[GitHub] [superset] lilykuang commented on a diff in pull request #23145: chore: refactor SparklineCell for react 17 and react 18 upgrade

Posted by "lilykuang (via GitHub)" <gi...@apache.org>.
lilykuang commented on code in PR #23145:
URL: https://github.com/apache/superset/pull/23145#discussion_r1116268298


##########
superset-frontend/package.json:
##########
@@ -114,7 +113,12 @@
     "@superset-ui/plugin-chart-word-cloud": "file:./plugins/plugin-chart-word-cloud",
     "@superset-ui/preset-chart-xy": "file:./plugins/preset-chart-xy",
     "@superset-ui/switchboard": "file:./packages/superset-ui-switchboard",
+    "@visx/axis": "^3.0.1",
+    "@visx/grid": "^3.0.1",

Review Comment:
   oh good catch. @visx/scale and @visx/tooltip are only on 3.0.0, @visx/xychart has 3.0.1 i will update that 



-- 
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


[GitHub] [superset] lilykuang commented on a diff in pull request #23145: chore: refactor SparklineCell for react 17 and react 18 upgrade

Posted by "lilykuang (via GitHub)" <gi...@apache.org>.
lilykuang commented on code in PR #23145:
URL: https://github.com/apache/superset/pull/23145#discussion_r1116268298


##########
superset-frontend/package.json:
##########
@@ -114,7 +113,12 @@
     "@superset-ui/plugin-chart-word-cloud": "file:./plugins/plugin-chart-word-cloud",
     "@superset-ui/preset-chart-xy": "file:./plugins/preset-chart-xy",
     "@superset-ui/switchboard": "file:./packages/superset-ui-switchboard",
+    "@visx/axis": "^3.0.1",
+    "@visx/grid": "^3.0.1",

Review Comment:
   oh good catch. @visx/scale and @visx/tooltip are only on 3.0.0, @visx/xychart has 3.0.1



-- 
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


[GitHub] [superset] lilykuang commented on a diff in pull request #23145: chore: refactor SparklineCell for react 17 and react 18 upgrade

Posted by "lilykuang (via GitHub)" <gi...@apache.org>.
lilykuang commented on code in PR #23145:
URL: https://github.com/apache/superset/pull/23145#discussion_r1116268298


##########
superset-frontend/package.json:
##########
@@ -114,7 +113,12 @@
     "@superset-ui/plugin-chart-word-cloud": "file:./plugins/plugin-chart-word-cloud",
     "@superset-ui/preset-chart-xy": "file:./plugins/preset-chart-xy",
     "@superset-ui/switchboard": "file:./packages/superset-ui-switchboard",
+    "@visx/axis": "^3.0.1",
+    "@visx/grid": "^3.0.1",

Review Comment:
   oh good catch. will update all visx to 3.0.1



-- 
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