Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Freelancing – Open to exciting opportunities

Ashish Singh git-ashish

🏠
Freelancing – Open to exciting opportunities
View GitHub Profile
@veltman
veltman / README.md
Last active Nov 20, 2020
Flocking boids
View README.md
@mrcslws
mrcslws / .block
Last active May 7, 2019 — forked from mbostock/.block
Pan & Zoom Axes
View .block
license: gpl-3.0
@pbeshai
pbeshai / .block
Last active Aug 4, 2020
Animate thousands of points with canvas and D3
View .block
license: mit
height: 620
border: no
@emeeks
emeeks / README.md
Last active Jun 6, 2019
Network Annotation with Collision Detection
View README.md

Using collision detection with network visualization labels

This demonstrates how to use d3-annotation() with bboxCollide to procedurally place node labels. After using the nodes data to create a network visualization of the Les Miserables play, we filter the nodes to leave out the side characters and pass that array to d3-annotation. We then create a second forceSimulation, this time using the size of the notes as the property in our bounding box collision detection, to move the labels out of each others' way.

d3-annotation by Susie Lu.

@steveharoz
steveharoz / .block
Last active Jan 14, 2021 — forked from mbostock/.block
d3-force testing ground
View .block
license: gpl-3.0
height: 1030
scrolling: yes
@yurivish
yurivish / venn-diagrams.js
Last active Dec 26, 2020
Area-proportional Venn Diagrams
View venn-diagrams.js
// Since `overlapArea` function is monotonic increasing, we can perform a
// simple bisection search to find the distance that leads to an overlap
// area within epsilon of the desired overlap.
function distanceForOverlapArea(r1, r2, desiredOverlap) {
// Ensure r1 <= r2
if (r1 > r2) {
var temp = r2;
r2 = r1;
r1 = temp;
}
@drzax
drzax / .block
Last active Feb 12, 2021
Narrative Charts
View .block
license: mit
scrolling: true
height: 300
View .block
license: gpl-3.0
height: 960
redirect: https://observablehq.com/@mbostock/star-map
@mbostock
mbostock / .block
Last active Jul 5, 2019
Line with Missing Data
View .block
license: gpl-3.0
redirect: https://observablehq.com/@d3/line-with-missing-data
@paulirish
paulirish / what-forces-layout.md
Last active Mar 2, 2021
What forces layout/reflow. The comprehensive list.
View what-forces-layout.md

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent