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

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more