Skip to content

Commit b647aad

Browse files
Copilothustcc
andcommitted
Fix DataPreview table row height and add remark-gfm for markdown tables
Co-authored-by: hustcc <7856674+hustcc@users.noreply.github.com>
1 parent e2d94ea commit b647aad

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

site/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"buffer": "^6.0.3",
1515
"react": "^19.2.0",
1616
"react-dom": "^19.2.0",
17-
"react-markdown": "^10.1.0"
17+
"react-markdown": "^10.1.0",
18+
"remark-gfm": "^4.0.1"
1819
},
1920
"devDependencies": {
2021
"@eslint/js": "^9.39.1",

site/src/components/DataPreview.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const DataPreview: React.FC<DataPreviewProps> = ({ data }) => {
6161
<thead>
6262
<tr className="border-b border-gray-100">
6363
{columns.map(col => (
64-
<th key={col} className="text-left py-3 px-4 font-medium text-[#78d3f8]">
64+
<th key={col} className="text-left py-2 px-4 font-medium text-[#78d3f8]">
6565
{col}
6666
</th>
6767
))}
@@ -71,7 +71,7 @@ const DataPreview: React.FC<DataPreviewProps> = ({ data }) => {
7171
{displayData.map((row, idx) => (
7272
<tr key={idx} className="border-b border-gray-50 hover:bg-gray-50/50">
7373
{columns.map(col => (
74-
<td key={col} className={`py-3 px-4 ${getValueColor(row[col])}`}>
74+
<td key={col} className={`py-2 px-4 ${getValueColor(row[col])}`}>
7575
{formatValue(row[col])}
7676
</td>
7777
))}

site/src/components/Visualization.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useState, useCallback, useEffect, useRef } from 'react';
22
import ReactMarkdown from 'react-markdown';
3+
import remarkGfm from 'remark-gfm';
34
import { AVA } from '@antv/ava';
45
import type { AnalysisResponse } from '@antv/ava';
56

@@ -112,7 +113,7 @@ const Visualization: React.FC<VisualizationProps> = ({ avaInstance }) => {
112113
)}
113114
</div>
114115
<div className="text-sm text-gray-600 prose prose-sm max-w-none">
115-
<ReactMarkdown>{result.text}</ReactMarkdown>
116+
<ReactMarkdown remarkPlugins={[remarkGfm]}>{result.text}</ReactMarkdown>
116117
</div>
117118

118119
{/* Collapsible Code Block */}

0 commit comments

Comments
 (0)