Public
Edited
Mar 8, 2023
2 forks
2 stars
Insert cell
Insert cell
showText = false;
Insert cell
showDivText = true
Insert cell
radius = 30
Insert cell
width = 1000
Insert cell
height = 800
Insert cell
LABEL_FONT_SIZE = 6
Insert cell
showLevel = 1
Insert cell
forceLinkStrength = 0.1
Insert cell
centerStrength = 0.05
Insert cell
forceManybodyStrength = -300
Insert cell
selectedR = 15;
Insert cell
dragFixed = false
Insert cell
colors = d3.schemeCategory10;
Insert cell
Insert cell
show(milvusData)
Insert cell
Insert cell
show(vearchData)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
<style type="text/css">
.shadow {
filter: drop-shadow(2px 2px 5px #cccccca0);
border: 1px solid red;
}
</style>
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
const svg = d3.create("svg").attr("width", 1000)
initDefs(svg);
const r = 50;
gradientIds.forEach((id, i) => {
svg
.append("circle")
.attr("cx", (i*2 + 1) * r)
.attr("cy", r)
.attr("r", r)
.attr("fill", `url(#${id})`);
});

return svg.node();
}
Insert cell
initDefs = (svg) => {
const defs = svg.append("defs");
gradientIds.forEach((id, i) => {
const gradient = defs
.append("linearGradient")
.attr("id", id)
.attr("x1", "0%")
.attr("x2", "100%")
.attr("y1", "0%")
.attr("y2", "100%");
gradient
.append("stop")
.attr("class", "start")
.attr("offset", "0%")
// .attr("stop-color", lightColors[i])
.attr("stop-color", darkColors[i])
.attr("stop-opacity", 1);
gradient
.append("stop")
.attr("class", "end")
.attr("offset", "100%")
// .attr("stop-color", uLightColors[i])
.attr("stop-color", uDarkColors[i])
.attr("stop-opacity", 1);
});
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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