Published
Edited
Jun 28, 2022
Insert cell
Insert cell
Insert cell
FederModule = import("https://unpkg.com/@zilliz/feder")
Insert cell
FederCore = FederModule.FederCore
Insert cell
Insert cell
Insert cell
indexArrayBuffer = fetch(indexFilePath).then((res) => res.arrayBuffer())
Insert cell
federCore = new FederCore({
data: indexArrayBuffer,
source: indexSource,
})
Insert cell
indexMeta = federCore.indexMeta
Insert cell
testId = Math.floor(Math.random() * 10000)
Insert cell
testVector = federCore.id2vector[testId]
Insert cell
searchRes = federCore.search(testVector)
Insert cell
visData = parseVisRecords(searchRes)
Insert cell
HNSW_NODE_TYPE = {
return { Coarse: 1, Candidate: 2, Fine: 3, Target: 4 };
}
Insert cell
Insert cell
Insert cell
Insert cell
connection = '---';
Insert cell
getLinkId = (sourceId, targetId) =>
`${sourceId}${connection}${targetId}`;
Insert cell
parseLinkId = (linkId) => linkId.split(connection).map((d) => +d);
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more