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/04/06 17:33:50 UTC

[GitHub] [superset] lilykuang commented on a diff in pull request #23615: feat: Support further drill by in the modal

lilykuang commented on code in PR #23615:
URL: https://github.com/apache/superset/pull/23615#discussion_r1160079926


##########
superset-frontend/src/components/Chart/DrillBy/DrillByChart.tsx:
##########
@@ -16,25 +16,43 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import React, { useEffect, useState } from 'react';
-import { BaseFormData, Behavior, css, SuperChart } from '@superset-ui/core';
+import React, { useEffect, useMemo, useState } from 'react';
+import {
+  BaseFormData,
+  ContextMenuFilters,
+  css,
+  SuperChart,
+} from '@superset-ui/core';
 import { getChartDataRequest } from 'src/components/Chart/chartAction';
 import Loading from 'src/components/Loading';
 
 interface DrillByChartProps {
   formData: BaseFormData & { [key: string]: any };
+  onContextMenu: (
+    offsetX: number,
+    offsetY: number,
+    filters: ContextMenuFilters,
+  ) => void;
+  inContextMenu: boolean;
 }
 
-export default function DrillByChart({ formData }: DrillByChartProps) {
+export default function DrillByChart({
+  formData,
+  onContextMenu,
+  inContextMenu,
+}: DrillByChartProps) {
   const [chartDataResult, setChartDataResult] = useState();
 
+  const hooks = useMemo(() => ({ onContextMenu }), [onContextMenu]);
+
   useEffect(() => {
+    setChartDataResult(undefined);

Review Comment:
   nice!



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