Export Code
Connected
index.js
import {
select,
json,
zoom,
forceSimulation,
forceLink,
forceManyBody,
forceCenter,
drag,
event,
continuous,
scaleLinear
} from 'd3';

// Visualisation Variables
const width = 960;
const height = 500;
const textPadding = 8;
const corner = 5;
const ent_colour = '#03396c
Alt + Click on a hex color
Open a color picker to modify the color
';
const ent_t_colour = 'white';
const att_colour = '#ff4d00
Alt + Click on a hex color
Open a color picker to modify the color
';
const att_t_colour = 'white';
const rel_colour = '#007777
Alt + Click on a hex color
Open a color picker to modify the color
';
const rel_t_colour = 'black';
var icon_shape = "rnd-"; // or "rect-" or "norm-"
const icon_url = 'https://github.com/os-threat/images/blob/main/img/'


const svg = d3.select('.mysvg')
.append('svg')
.attr('class', 'SVG')
.attr("viewBox", [0, 0, width, height])
.call(d3.zoom().on("zoom", function () {
svg.attr("transform", d3.event.transform)
}))

Stix D3 Force Graph

brettforbes

Last edited Jun 15, 2023
Created on Jun 12, 2023
Forked from D3 Starter

A demonstration of how to start using D3 version 6.

MIT Licensed