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

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

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