mirror of
https://github.com/ansible/awx.git
synced 2026-02-23 14:05:59 -03:30
Remove external script call to D3.js.
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "ui",
|
"name": "ui",
|
||||||
"homepage": ".",
|
|
||||||
"private": true,
|
"private": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.13.1"
|
"node": ">=16.13.1"
|
||||||
|
|||||||
@@ -1,21 +1,22 @@
|
|||||||
/* eslint-disable no-undef */
|
import * as d3 from 'd3';
|
||||||
importScripts('https://d3js.org/d3-collection.v1.min.js');
|
import { MESH_FORCE_LAYOUT } from '../screens/TopologyView/constants';
|
||||||
importScripts('https://d3js.org/d3-dispatch.v1.min.js');
|
|
||||||
importScripts('https://d3js.org/d3-quadtree.v1.min.js');
|
|
||||||
importScripts('https://d3js.org/d3-timer.v1.min.js');
|
|
||||||
importScripts('https://d3js.org/d3-force.v1.min.js');
|
|
||||||
|
|
||||||
onmessage = function calculateLayout({ data: { nodes, links } }) {
|
onmessage = function calculateLayout({ data: { nodes, links } }) {
|
||||||
const simulation = d3
|
const simulation = d3
|
||||||
.forceSimulation(nodes)
|
.forceSimulation(nodes)
|
||||||
.force('charge', d3.forceManyBody(15).strength(-50))
|
.force(
|
||||||
|
'charge',
|
||||||
|
d3
|
||||||
|
.forceManyBody(MESH_FORCE_LAYOUT.defaultForceBody)
|
||||||
|
.strength(MESH_FORCE_LAYOUT.defaultForceStrength)
|
||||||
|
)
|
||||||
.force(
|
.force(
|
||||||
'link',
|
'link',
|
||||||
d3.forceLink(links).id((d) => d.hostname)
|
d3.forceLink(links).id((d) => d.hostname)
|
||||||
)
|
)
|
||||||
.force('collide', d3.forceCollide(62))
|
.force('collide', d3.forceCollide(MESH_FORCE_LAYOUT.defaultCollisionFactor))
|
||||||
.force('forceX', d3.forceX(0))
|
.force('forceX', d3.forceX(MESH_FORCE_LAYOUT.defaultForceX))
|
||||||
.force('forceY', d3.forceY(0))
|
.force('forceY', d3.forceY(MESH_FORCE_LAYOUT.defaultForceY))
|
||||||
.stop();
|
.stop();
|
||||||
|
|
||||||
for (
|
for (
|
||||||
|
|||||||
Reference in New Issue
Block a user