Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat[graph-tab]: integrate Euclidean distance into graph visualization tab #271

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/lib/graph-visualization-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,22 @@ export const getMinimalSpanningTree = (links, acs = true) => {

return mstLinks;
};

// the function which returns metric for given collection and name of the vector

export const getMetrics = async (qdrantClient, { collectionName }) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are no vector name in the arguments of the function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

const metricConfig = {};
try {
const collectionInfo = await qdrantClient.getCollection(collectionName);
Object.keys(collectionInfo.config.params.vectors).map((key) => {
if (typeof collectionInfo.config.params.vectors[key] === 'object') {
metricConfig[key] = collectionInfo.config.params.vectors[key].distance;
} else {
metricConfig[''] = collectionInfo.config.params.vectors.distance;
}
});
return metricConfig;
} catch (e) {
console.error(e);
}
};
Loading