Fix/remove tsne position test (#5858)

Co-authored-by: StyleZhang <jasonapring2015@outlook.com>
This commit is contained in:
Jyong 2024-07-02 17:57:42 +08:00 • committed by GitHub
commit 0944ca9d91
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 89 deletions

View file

@ -2,51 +2,16 @@ import type { FC } from 'react'
import React from 'react'
import cn from 'classnames'
import { useTranslation } from 'react-i18next'
import ReactECharts from 'echarts-for-react'
import { SegmentIndexTag } from '../documents/detail/completed'
import s from '../documents/detail/completed/style.module.css'
import type { SegmentDetailModel } from '@/models/datasets'
import Divider from '@/app/components/base/divider'
type IScatterChartProps = {
data: Array<number[]>
curr: Array<number[]>
}
const ScatterChart: FC<IScatterChartProps> = ({ data, curr }) => {
const option = {
xAxis: {},
yAxis: {},
tooltip: {
trigger: 'item',
axisPointer: {
type: 'cross',
},
},
series: [
{
type: 'effectScatter',
symbolSize: 5,
data: curr,
},
{
type: 'scatter',
symbolSize: 5,
data,
},
],
}
return (
<ReactECharts option={option} style={{ height: 380, width: 430 }} />
)
}
type IHitDetailProps = {
segInfo?: Partial<SegmentDetailModel> & { id: string }
vectorInfo?: { curr: Array<number[]>; points: Array<number[]> }
}
const HitDetail: FC<IHitDetailProps> = ({ segInfo, vectorInfo }) => {
const HitDetail: FC<IHitDetailProps> = ({ segInfo }) => {
const { t } = useTranslation()
const renderContent = () => {
@ -65,8 +30,8 @@ const HitDetail: FC<IHitDetailProps> = ({ segInfo, vectorInfo }) => {
}
return (
<div className='flex flex-row overflow-x-auto'>
<div className="flex-1 bg-gray-25 p-6 min-w-[300px]">
<div className='overflow-x-auto'>
<div className="bg-gray-25 p-6">
<div className="flex items-center">
<SegmentIndexTag
positionId={segInfo?.position || ''}
@ -94,20 +59,6 @@ const HitDetail: FC<IHitDetailProps> = ({ segInfo, vectorInfo }) => {
})}
</div>
</div>
<div className="flex-1 bg-white p-6">
<div className="flex items-center">
<div className={cn(s.commonIcon, s.bezierCurveIcon)} />
<span className={s.numberInfo}>
{t('datasetDocuments.segment.vectorHash')}
</span>
</div>
<div
className={cn(s.numberInfo, 'w-[400px] truncate text-gray-700 mt-1')}
>
{segInfo?.index_node_hash}
</div>
<ScatterChart data={vectorInfo?.points || []} curr={vectorInfo?.curr || []} />
</div>
</div>
)
}