appkit-ui - Using GenieQueryVisualization not working as expected

未關閉
#403 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 3 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
45/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
冷清
技術堆疊
react, typescript
領域
frontend

研究方向

先查看 GenieQueryVisualization 文件和 issue 中的範例元件,然後使用提供的 queryResult 資料重現獨立 React 應用程式的行為。檢查預設表格和圖表類型控制項是否符合元件文件中描述的行為;當預期的分頁和圖表渲染行為獲得確認或被清楚記錄時,即視為完成。

由索引模型根據 Issue 內容生成。

描述

Hello,

I am using GenieQueryVisualization component in a standalone react app to render data obtained via the Genie API.

Please see screenshot attached inline.

Image

Two questions:

  1. Is the table always supposed to be rendered by default? I would have expected it to only show when Table tab is clicked.
  2. Not sure why the chart type selection is rendered on the chart?

Thanks,
Amit.

Example component

import "./App.css";

import { cn, GenieQueryVisualization } from "@databricks/appkit-ui/react";

const exampleSchema = {
  format: "JSON_ARRAY",
  schema: {
    column_count: 5,
    columns: [
      {
        name: "FinancialYear",
        type_text: "DATE",
        type_name: "DATE",
        position: 0,
      },
      {
        name: "ARDRG_Version",
        type_text: "STRING",
        type_name: "STRING",
        position: 1,
      },
      {
        name: "ARDRG_Code",
        type_text: "STRING",
        type_name: "STRING",
        position: 2,
      },
      {
        name: "ARDRG_Description",
        type_text: "STRING",
        type_name: "STRING",
        position: 3,
      },
      {
        name: "AvgLOS_Inpatient",
        type_text: "DOUBLE",
        type_name: "DOUBLE",
        position: 4,
      },
    ],
  },
  total_chunk_count: 1,
  chunks: [{ chunk_index: 0, row_offset: 0, row_count: 4111 }],
  total_row_count: 4111,
  truncated: false,
};

const exampleDataArray = [
  [
    "2026",
    "10.0",
    "I69A",
    "Bone Diseases and Arthropathies, Major Complexity",
    "6.0",
  ],
  [
    "2026",
    "11.0",
    "I69A",
    "Bone Diseases and Arthropathies, Major Complexity",
    "52.0",
  ],
  [
    "2026",
    "8.0",
    "T01A",
    "Infectious and Parasitic Diseases W OR Procedures, Major Complexity",
    "4.0",
  ],
  [
    "2026",
    "8.0",
    "J65A",
    "Trauma to Skin, Subcutaneous Tissue and Breast, Major Complexity",
    "4.0",
  ],
];

function App() {
  const queryResult = {
    manifest: {
      schema: exampleSchema["schema"],
    },
    result: {
      data_array: exampleDataArray,
    },
  };

  return (
    <>
      <section id="center">
        <div style={{ height: 600 }}>
          <GenieQueryVisualization data={queryResult} />
        </div>
      </section>
    </>
  );
}

export default App;

主要語言
TypeScript
星號
119
分支
36
平均合併
4 天 16 小時
30 天內合併 PR
37

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

databricks/appkit 的其他 Issue

查看 databricks/appkit 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。