Skip to content

Commit

Permalink
Merge pull request #174 from VisActor/feat/vchart_editor_merge_spec
Browse files Browse the repository at this point in the history
Feat/vchart editor merge spec
  • Loading branch information
666haiwen authored Jan 8, 2025
2 parents 8db1843 + d9749d1 commit 90f26b9
Show file tree
Hide file tree
Showing 11 changed files with 1,376 additions and 184 deletions.
196 changes: 191 additions & 5 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,7 @@ export function QARag() {
{
spec: spec,
appendSpec: {
leafSpec: dslRes,
parentKeyPath,
aliasKeyPath
spec: dslRes
}
},
true
Expand Down Expand Up @@ -478,28 +476,30 @@ export function QARag() {

<div className="one-content">
<div>KeyPath Recall:</div>
{keyPathResult.map((item, index) => (
<Card key={index} className="qa-card">
<div className="qa-div">
<span className="title">Score:</span>
<span>{item.scores.toFixed(2)}</span>
</div>
<div className="qa-div">
<div className="title">content:</div>
<span>{item.text}</span>
</div>
{ragOption.type === 'qa' && (
<div className="qa-div">
<div className="title">Answer:</div>
<span>{item.answer}</span>
</div>
)}
<div className="qa-div">
<div className="title">key:</div>
<span>{item.key}</span>
</div>
</Card>
))}
{keyPathResult && keyPathResult.length
? keyPathResult.map((item, index) => (
<Card key={index} className="qa-card">
<div className="qa-div">
<span className="title">Score:</span>
<span>{item.scores.toFixed(2)}</span>
</div>
<div className="qa-div">
<div className="title">content:</div>
<span>{item.text}</span>
</div>
{ragOption.type === 'qa' ? (
<div className="qa-div">
<div className="title">Answer:</div>
<span>{JSON.stringify(item.answer)}</span>
</div>
) : null}
<div className="qa-div">
<div className="title">key:</div>
<span>{item.key}</span>
</div>
</Card>
))
: null}
</div>
</div>
</div>
Expand Down
16 changes: 16 additions & 0 deletions packages/vmind/__tests__/unit/utils/set.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { set } from '../../../src/utils/set';

describe('set', () => {
it('should set value correctly', () => {
const spec = { padding: { top: 0, left: 0 } };
set(spec, 'padding', 10);

expect(spec).toEqual({ padding: 10 });
});

it('should handle nested object correctly', () => {
const spec = { label: { a: 1 } };
set(spec, 'label.visible', false);
expect(spec).toEqual({ label: { a: 1, visible: false } });
});
});
Loading

0 comments on commit 90f26b9

Please sign in to comment.