Skip to content

Instantly share code, notes, and snippets.

@vasturiano
vasturiano / .ne_110m_admin_0_countries.json
Last active October 25, 2018 11:06
World cartogram on d3 v4
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vasturiano
vasturiano / README.md
Last active December 7, 2019 15:28
Volcanoes of the World
@vasturiano
vasturiano / .block
Last active November 16, 2017 06:14 — forked from mbostock/.block
Geo Zoom & Pan using Versors
license: gpl-3.0
height: 600
border: no
@vasturiano
vasturiano / README.md
Last active September 18, 2019 01:21
VR Hyperspace

Simulation of random distribution of objects in 3D space after a (big) bang. Rendered in VR using 3d-force-graph-vr. Move around using arrow/wasd keys or a gamepad.

@vasturiano
vasturiano / README.md
Last active March 10, 2018 10:37
Binary Star System

A simulation of orbital trajectories using the d3-force simulation engine with the gravity-like d3-force-magnetic attraction force.

By default the layout represents a binary system. All the stars (red nodes) have the same mass and their attraction influence on the satellite (blue node) is proportional to the inverse-square of the distance. The stars are statically positioned and remain unaffected by either the satellite or other stars. Stars can be added and removed by double-clicking on canvas/nodes. All nodes can also be repositioned by dragging.

The initial velocity (and direction) of the satellite can be changed using the controls on the top-right. The length of the pre-estimated trajectory can be manipulated by changing the number of samples (represented as dots).

See also Single Orbital Trajectory.

@vasturiano
vasturiano / README.md
Last active April 25, 2023 09:36
Zoomable Sunburst with Labels

Adapted from Mike Bostock's Zoomable Sunburst to include arc labels.

Click on any arc to zoom in. Click on the center circle to zoom out. Click on canvas background to reset zoom.

Also packaged as a reusable component at sunburst-chart.

@vasturiano
vasturiano / README.md
Last active March 29, 2023 10:19
Spinning Wheel

Simulation of the visual illusion that occurs when the visual capture frame-rate is unable to absorb all the intermediary positions of a spinning object. Patterns start emerging at angular velocities that are multiples of even circle divisions.

The wheel's angular velocity increases linearly from 0 to infinity. Its constant acceleration is implemented using the force-constant force type, part of the d3-force simulation engine.

@vasturiano
vasturiano / README.md
Last active October 22, 2017 04:08
Plasma

Simulation of attraction-of-opposites particles, similar to the interaction between protons and electrons.

Uses D3's force plugin forceMagnetic to simulate the asymmetrical attraction/repulsion of objects in an inverse-square relationship with distance. Further, particles are prevented from overlapping by applying a non-elastic collision force using forceBounce.

Using the slider controls you can add/remove particles to the system, and regulate the ratio of positive (+) vs negative (-) particles.

@vasturiano
vasturiano / README.md
Last active March 29, 2023 10:10
Knitting with the Force

Build textile-like fabric data structures using node-link relationships, rendered as a 3d force-directed layout using 3d-force-graph.

@vasturiano
vasturiano / index.html
Last active March 29, 2023 10:07
Force Beeswarm
<head>
<style>body { margin: 0; }</style>
<script src="//cdnjs.cloudflare.com/ajax/libs/dat-gui/0.6.5/dat.gui.js"></script>
<script src="//unpkg.com/d3-force-pod"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/4.10.2/d3.min.js"></script>
</head>
<body>
<script>