Vašek Šraier
4 years ago
4 changed files with 343 additions and 785 deletions
@ -1,736 +0,0 @@ |
|||
{ |
|||
"name": "svelte-app", |
|||
"version": "1.0.0", |
|||
"lockfileVersion": 1, |
|||
"requires": true, |
|||
"dependencies": { |
|||
"@babel/code-frame": { |
|||
"version": "7.10.4", |
|||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", |
|||
"integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", |
|||
"dev": true, |
|||
"requires": { |
|||
"@babel/highlight": "^7.10.4" |
|||
} |
|||
}, |
|||
"@babel/helper-validator-identifier": { |
|||
"version": "7.10.4", |
|||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", |
|||
"integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", |
|||
"dev": true |
|||
}, |
|||
"@babel/highlight": { |
|||
"version": "7.10.4", |
|||
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", |
|||
"integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", |
|||
"dev": true, |
|||
"requires": { |
|||
"@babel/helper-validator-identifier": "^7.10.4", |
|||
"chalk": "^2.0.0", |
|||
"js-tokens": "^4.0.0" |
|||
} |
|||
}, |
|||
"@polka/url": { |
|||
"version": "1.0.0-next.11", |
|||
"resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.11.tgz", |
|||
"integrity": "sha512-3NsZsJIA/22P3QUyrEDNA2D133H4j224twJrdipXN38dpnIOzAbUDtOwkcJ5pXmn75w7LSQDjA4tO9dm1XlqlA==" |
|||
}, |
|||
"@rollup/plugin-commonjs": { |
|||
"version": "14.0.0", |
|||
"resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-14.0.0.tgz", |
|||
"integrity": "sha512-+PSmD9ePwTAeU106i9FRdc+Zb3XUWyW26mo5Atr2mk82hor8+nPwkztEjFo8/B1fJKfaQDg9aM2bzQkjhi7zOw==", |
|||
"dev": true, |
|||
"requires": { |
|||
"@rollup/pluginutils": "^3.0.8", |
|||
"commondir": "^1.0.1", |
|||
"estree-walker": "^1.0.1", |
|||
"glob": "^7.1.2", |
|||
"is-reference": "^1.1.2", |
|||
"magic-string": "^0.25.2", |
|||
"resolve": "^1.11.0" |
|||
} |
|||
}, |
|||
"@rollup/plugin-node-resolve": { |
|||
"version": "8.4.0", |
|||
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-8.4.0.tgz", |
|||
"integrity": "sha512-LFqKdRLn0ShtQyf6SBYO69bGE1upV6wUhBX0vFOUnLAyzx5cwp8svA0eHUnu8+YU57XOkrMtfG63QOpQx25pHQ==", |
|||
"dev": true, |
|||
"requires": { |
|||
"@rollup/pluginutils": "^3.1.0", |
|||
"@types/resolve": "1.17.1", |
|||
"builtin-modules": "^3.1.0", |
|||
"deep-freeze": "^0.0.1", |
|||
"deepmerge": "^4.2.2", |
|||
"is-module": "^1.0.0", |
|||
"resolve": "^1.17.0" |
|||
} |
|||
}, |
|||
"@rollup/pluginutils": { |
|||
"version": "3.1.0", |
|||
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", |
|||
"integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", |
|||
"dev": true, |
|||
"requires": { |
|||
"@types/estree": "0.0.39", |
|||
"estree-walker": "^1.0.1", |
|||
"picomatch": "^2.2.2" |
|||
} |
|||
}, |
|||
"@types/estree": { |
|||
"version": "0.0.39", |
|||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", |
|||
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", |
|||
"dev": true |
|||
}, |
|||
"@types/node": { |
|||
"version": "14.11.2", |
|||
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.11.2.tgz", |
|||
"integrity": "sha512-jiE3QIxJ8JLNcb1Ps6rDbysDhN4xa8DJJvuC9prr6w+1tIh+QAbYyNF3tyiZNLDBIuBCf4KEcV2UvQm/V60xfA==", |
|||
"dev": true |
|||
}, |
|||
"@types/resolve": { |
|||
"version": "1.17.1", |
|||
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", |
|||
"integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", |
|||
"dev": true, |
|||
"requires": { |
|||
"@types/node": "*" |
|||
} |
|||
}, |
|||
"ansi-styles": { |
|||
"version": "3.2.1", |
|||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", |
|||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", |
|||
"dev": true, |
|||
"requires": { |
|||
"color-convert": "^1.9.0" |
|||
} |
|||
}, |
|||
"anymatch": { |
|||
"version": "3.1.1", |
|||
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", |
|||
"integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", |
|||
"dev": true, |
|||
"requires": { |
|||
"normalize-path": "^3.0.0", |
|||
"picomatch": "^2.0.4" |
|||
} |
|||
}, |
|||
"async-limiter": { |
|||
"version": "1.0.1", |
|||
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", |
|||
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", |
|||
"dev": true |
|||
}, |
|||
"balanced-match": { |
|||
"version": "1.0.0", |
|||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", |
|||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", |
|||
"dev": true |
|||
}, |
|||
"binary-extensions": { |
|||
"version": "2.1.0", |
|||
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", |
|||
"integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", |
|||
"dev": true |
|||
}, |
|||
"brace-expansion": { |
|||
"version": "1.1.11", |
|||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", |
|||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", |
|||
"dev": true, |
|||
"requires": { |
|||
"balanced-match": "^1.0.0", |
|||
"concat-map": "0.0.1" |
|||
} |
|||
}, |
|||
"braces": { |
|||
"version": "3.0.2", |
|||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", |
|||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", |
|||
"dev": true, |
|||
"requires": { |
|||
"fill-range": "^7.0.1" |
|||
} |
|||
}, |
|||
"buffer-from": { |
|||
"version": "1.1.1", |
|||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", |
|||
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", |
|||
"dev": true |
|||
}, |
|||
"builtin-modules": { |
|||
"version": "3.1.0", |
|||
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", |
|||
"integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", |
|||
"dev": true |
|||
}, |
|||
"chalk": { |
|||
"version": "2.4.2", |
|||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", |
|||
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", |
|||
"dev": true, |
|||
"requires": { |
|||
"ansi-styles": "^3.2.1", |
|||
"escape-string-regexp": "^1.0.5", |
|||
"supports-color": "^5.3.0" |
|||
} |
|||
}, |
|||
"chokidar": { |
|||
"version": "3.4.2", |
|||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.2.tgz", |
|||
"integrity": "sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A==", |
|||
"dev": true, |
|||
"requires": { |
|||
"anymatch": "~3.1.1", |
|||
"braces": "~3.0.2", |
|||
"fsevents": "~2.1.2", |
|||
"glob-parent": "~5.1.0", |
|||
"is-binary-path": "~2.1.0", |
|||
"is-glob": "~4.0.1", |
|||
"normalize-path": "~3.0.0", |
|||
"readdirp": "~3.4.0" |
|||
} |
|||
}, |
|||
"color-convert": { |
|||
"version": "1.9.3", |
|||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", |
|||
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", |
|||
"dev": true, |
|||
"requires": { |
|||
"color-name": "1.1.3" |
|||
} |
|||
}, |
|||
"color-name": { |
|||
"version": "1.1.3", |
|||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", |
|||
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", |
|||
"dev": true |
|||
}, |
|||
"commander": { |
|||
"version": "2.20.3", |
|||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", |
|||
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", |
|||
"dev": true |
|||
}, |
|||
"commondir": { |
|||
"version": "1.0.1", |
|||
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", |
|||
"integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", |
|||
"dev": true |
|||
}, |
|||
"concat-map": { |
|||
"version": "0.0.1", |
|||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", |
|||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", |
|||
"dev": true |
|||
}, |
|||
"console-clear": { |
|||
"version": "1.1.1", |
|||
"resolved": "https://registry.npmjs.org/console-clear/-/console-clear-1.1.1.tgz", |
|||
"integrity": "sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ==" |
|||
}, |
|||
"deep-freeze": { |
|||
"version": "0.0.1", |
|||
"resolved": "https://registry.npmjs.org/deep-freeze/-/deep-freeze-0.0.1.tgz", |
|||
"integrity": "sha1-OgsABd4YZygZ39OM0x+RF5yJPoQ=", |
|||
"dev": true |
|||
}, |
|||
"deepmerge": { |
|||
"version": "4.2.2", |
|||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", |
|||
"integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", |
|||
"dev": true |
|||
}, |
|||
"escape-string-regexp": { |
|||
"version": "1.0.5", |
|||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", |
|||
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", |
|||
"dev": true |
|||
}, |
|||
"estree-walker": { |
|||
"version": "1.0.1", |
|||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", |
|||
"integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", |
|||
"dev": true |
|||
}, |
|||
"fill-range": { |
|||
"version": "7.0.1", |
|||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", |
|||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", |
|||
"dev": true, |
|||
"requires": { |
|||
"to-regex-range": "^5.0.1" |
|||
} |
|||
}, |
|||
"fs.realpath": { |
|||
"version": "1.0.0", |
|||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", |
|||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", |
|||
"dev": true |
|||
}, |
|||
"fsevents": { |
|||
"version": "2.1.3", |
|||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", |
|||
"integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", |
|||
"dev": true, |
|||
"optional": true |
|||
}, |
|||
"get-port": { |
|||
"version": "3.2.0", |
|||
"resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", |
|||
"integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=" |
|||
}, |
|||
"glob": { |
|||
"version": "7.1.6", |
|||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", |
|||
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", |
|||
"dev": true, |
|||
"requires": { |
|||
"fs.realpath": "^1.0.0", |
|||
"inflight": "^1.0.4", |
|||
"inherits": "2", |
|||
"minimatch": "^3.0.4", |
|||
"once": "^1.3.0", |
|||
"path-is-absolute": "^1.0.0" |
|||
} |
|||
}, |
|||
"glob-parent": { |
|||
"version": "5.1.1", |
|||
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", |
|||
"integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", |
|||
"dev": true, |
|||
"requires": { |
|||
"is-glob": "^4.0.1" |
|||
} |
|||
}, |
|||
"has-flag": { |
|||
"version": "3.0.0", |
|||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", |
|||
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", |
|||
"dev": true |
|||
}, |
|||
"inflight": { |
|||
"version": "1.0.6", |
|||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", |
|||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", |
|||
"dev": true, |
|||
"requires": { |
|||
"once": "^1.3.0", |
|||
"wrappy": "1" |
|||
} |
|||
}, |
|||
"inherits": { |
|||
"version": "2.0.4", |
|||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", |
|||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", |
|||
"dev": true |
|||
}, |
|||
"is-binary-path": { |
|||
"version": "2.1.0", |
|||
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", |
|||
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", |
|||
"dev": true, |
|||
"requires": { |
|||
"binary-extensions": "^2.0.0" |
|||
} |
|||
}, |
|||
"is-extglob": { |
|||
"version": "2.1.1", |
|||
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", |
|||
"integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", |
|||
"dev": true |
|||
}, |
|||
"is-glob": { |
|||
"version": "4.0.1", |
|||
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", |
|||
"integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", |
|||
"dev": true, |
|||
"requires": { |
|||
"is-extglob": "^2.1.1" |
|||
} |
|||
}, |
|||
"is-module": { |
|||
"version": "1.0.0", |
|||
"resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", |
|||
"integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", |
|||
"dev": true |
|||
}, |
|||
"is-number": { |
|||
"version": "7.0.0", |
|||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", |
|||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", |
|||
"dev": true |
|||
}, |
|||
"is-reference": { |
|||
"version": "1.2.1", |
|||
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", |
|||
"integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", |
|||
"dev": true, |
|||
"requires": { |
|||
"@types/estree": "*" |
|||
} |
|||
}, |
|||
"jest-worker": { |
|||
"version": "26.3.0", |
|||
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.3.0.tgz", |
|||
"integrity": "sha512-Vmpn2F6IASefL+DVBhPzI2J9/GJUsqzomdeN+P+dK8/jKxbh8R3BtFnx3FIta7wYlPU62cpJMJQo4kuOowcMnw==", |
|||
"dev": true, |
|||
"requires": { |
|||
"@types/node": "*", |
|||
"merge-stream": "^2.0.0", |
|||
"supports-color": "^7.0.0" |
|||
}, |
|||
"dependencies": { |
|||
"has-flag": { |
|||
"version": "4.0.0", |
|||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", |
|||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", |
|||
"dev": true |
|||
}, |
|||
"supports-color": { |
|||
"version": "7.2.0", |
|||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", |
|||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", |
|||
"dev": true, |
|||
"requires": { |
|||
"has-flag": "^4.0.0" |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
"js-tokens": { |
|||
"version": "4.0.0", |
|||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", |
|||
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", |
|||
"dev": true |
|||
}, |
|||
"kleur": { |
|||
"version": "3.0.3", |
|||
"resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", |
|||
"integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==" |
|||
}, |
|||
"livereload": { |
|||
"version": "0.9.1", |
|||
"resolved": "https://registry.npmjs.org/livereload/-/livereload-0.9.1.tgz", |
|||
"integrity": "sha512-9g7sua11kkyZNo2hLRCG3LuZZwqexoyEyecSlV8cAsfAVVCZqLzVir6XDqmH0r+Vzgnd5LrdHDMyjtFnJQLAYw==", |
|||
"dev": true, |
|||
"requires": { |
|||
"chokidar": "^3.3.0", |
|||
"livereload-js": "^3.1.0", |
|||
"opts": ">= 1.2.0", |
|||
"ws": "^6.2.1" |
|||
} |
|||
}, |
|||
"livereload-js": { |
|||
"version": "3.3.1", |
|||
"resolved": "https://registry.npmjs.org/livereload-js/-/livereload-js-3.3.1.tgz", |
|||
"integrity": "sha512-CBu1gTEfzVhlOK1WASKAAJ9Qx1fHECTq0SUB67sfxwQssopTyvzqTlgl+c0h9pZ6V+Fzd2rc510ppuNusg9teQ==", |
|||
"dev": true |
|||
}, |
|||
"local-access": { |
|||
"version": "1.0.1", |
|||
"resolved": "https://registry.npmjs.org/local-access/-/local-access-1.0.1.tgz", |
|||
"integrity": "sha512-ykt2pgN0aqIy6KQC1CqdWTWkmUwNgaOS6dcpHVjyBJONA+Xi7AtSB1vuxC/U/0tjIP3wcRudwQk1YYzUvzk2bA==" |
|||
}, |
|||
"magic-string": { |
|||
"version": "0.25.7", |
|||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", |
|||
"integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", |
|||
"dev": true, |
|||
"requires": { |
|||
"sourcemap-codec": "^1.4.4" |
|||
} |
|||
}, |
|||
"merge-stream": { |
|||
"version": "2.0.0", |
|||
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", |
|||
"integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", |
|||
"dev": true |
|||
}, |
|||
"mime": { |
|||
"version": "2.4.6", |
|||
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", |
|||
"integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==" |
|||
}, |
|||
"minimatch": { |
|||
"version": "3.0.4", |
|||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", |
|||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", |
|||
"dev": true, |
|||
"requires": { |
|||
"brace-expansion": "^1.1.7" |
|||
} |
|||
}, |
|||
"mri": { |
|||
"version": "1.1.6", |
|||
"resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz", |
|||
"integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==" |
|||
}, |
|||
"normalize-path": { |
|||
"version": "3.0.0", |
|||
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", |
|||
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", |
|||
"dev": true |
|||
}, |
|||
"once": { |
|||
"version": "1.4.0", |
|||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", |
|||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", |
|||
"dev": true, |
|||
"requires": { |
|||
"wrappy": "1" |
|||
} |
|||
}, |
|||
"opts": { |
|||
"version": "2.0.2", |
|||
"resolved": "https://registry.npmjs.org/opts/-/opts-2.0.2.tgz", |
|||
"integrity": "sha512-k41FwbcLnlgnFh69f4qdUfvDQ+5vaSDnVPFI/y5XuhKRq97EnVVneO9F1ESVCdiVu4fCS2L8usX3mU331hB7pg==", |
|||
"dev": true |
|||
}, |
|||
"path-is-absolute": { |
|||
"version": "1.0.1", |
|||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", |
|||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", |
|||
"dev": true |
|||
}, |
|||
"path-parse": { |
|||
"version": "1.0.6", |
|||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", |
|||
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", |
|||
"dev": true |
|||
}, |
|||
"picomatch": { |
|||
"version": "2.2.2", |
|||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", |
|||
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", |
|||
"dev": true |
|||
}, |
|||
"randombytes": { |
|||
"version": "2.1.0", |
|||
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", |
|||
"integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", |
|||
"dev": true, |
|||
"requires": { |
|||
"safe-buffer": "^5.1.0" |
|||
} |
|||
}, |
|||
"readdirp": { |
|||
"version": "3.4.0", |
|||
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", |
|||
"integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", |
|||
"dev": true, |
|||
"requires": { |
|||
"picomatch": "^2.2.1" |
|||
} |
|||
}, |
|||
"require-relative": { |
|||
"version": "0.8.7", |
|||
"resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz", |
|||
"integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=", |
|||
"dev": true |
|||
}, |
|||
"resolve": { |
|||
"version": "1.17.0", |
|||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", |
|||
"integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", |
|||
"dev": true, |
|||
"requires": { |
|||
"path-parse": "^1.0.6" |
|||
} |
|||
}, |
|||
"rollup": { |
|||
"version": "2.28.2", |
|||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.28.2.tgz", |
|||
"integrity": "sha512-8txbsFBFLmm9Xdt4ByTOGa9Muonmc8MfNjnGAR8U8scJlF1ZW7AgNZa7aqBXaKtlvnYP/ab++fQIq9dB9NWUbg==", |
|||
"dev": true, |
|||
"requires": { |
|||
"fsevents": "~2.1.2" |
|||
} |
|||
}, |
|||
"rollup-plugin-livereload": { |
|||
"version": "2.0.0", |
|||
"resolved": "https://registry.npmjs.org/rollup-plugin-livereload/-/rollup-plugin-livereload-2.0.0.tgz", |
|||
"integrity": "sha512-oC/8NqumGYuphkqrfszOHUUIwzKsaHBICw6QRwT5uD07gvePTS+HW+GFwu6f9K8W02CUuTvtIM9AWJrbj4wE1A==", |
|||
"dev": true, |
|||
"requires": { |
|||
"livereload": "^0.9.1" |
|||
} |
|||
}, |
|||
"rollup-plugin-svelte": { |
|||
"version": "6.0.1", |
|||
"resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-6.0.1.tgz", |
|||
"integrity": "sha512-kS9/JZMBNgpKTqVKlwV8mhmGwxu8NiNf6+n5ZzdZ8yDp3+ADqjf8Au+JNEpoOn6kLlh1hLS2Gsa76k9RP57HDQ==", |
|||
"dev": true, |
|||
"requires": { |
|||
"require-relative": "^0.8.7", |
|||
"rollup-pluginutils": "^2.8.2", |
|||
"sourcemap-codec": "^1.4.8" |
|||
} |
|||
}, |
|||
"rollup-plugin-terser": { |
|||
"version": "7.0.2", |
|||
"resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz", |
|||
"integrity": "sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==", |
|||
"dev": true, |
|||
"requires": { |
|||
"@babel/code-frame": "^7.10.4", |
|||
"jest-worker": "^26.2.1", |
|||
"serialize-javascript": "^4.0.0", |
|||
"terser": "^5.0.0" |
|||
} |
|||
}, |
|||
"rollup-pluginutils": { |
|||
"version": "2.8.2", |
|||
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", |
|||
"integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", |
|||
"dev": true, |
|||
"requires": { |
|||
"estree-walker": "^0.6.1" |
|||
}, |
|||
"dependencies": { |
|||
"estree-walker": { |
|||
"version": "0.6.1", |
|||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", |
|||
"integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", |
|||
"dev": true |
|||
} |
|||
} |
|||
}, |
|||
"sade": { |
|||
"version": "1.7.3", |
|||
"resolved": "https://registry.npmjs.org/sade/-/sade-1.7.3.tgz", |
|||
"integrity": "sha512-m4BctppMvJ60W1dXnHq7jMmFe3hPJZDAH85kQ3ACTo7XZNVUuTItCQ+2HfyaMeV5cKrbw7l4vD/6We3GBxvdJw==", |
|||
"requires": { |
|||
"mri": "^1.1.0" |
|||
} |
|||
}, |
|||
"safe-buffer": { |
|||
"version": "5.2.1", |
|||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", |
|||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", |
|||
"dev": true |
|||
}, |
|||
"semiver": { |
|||
"version": "1.1.0", |
|||
"resolved": "https://registry.npmjs.org/semiver/-/semiver-1.1.0.tgz", |
|||
"integrity": "sha512-QNI2ChmuioGC1/xjyYwyZYADILWyW6AmS1UH6gDj/SFUUUS4MBAWs/7mxnkRPc/F4iHezDP+O8t0dO8WHiEOdg==" |
|||
}, |
|||
"serialize-javascript": { |
|||
"version": "4.0.0", |
|||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", |
|||
"integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", |
|||
"dev": true, |
|||
"requires": { |
|||
"randombytes": "^2.1.0" |
|||
} |
|||
}, |
|||
"sirv": { |
|||
"version": "1.0.6", |
|||
"resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.6.tgz", |
|||
"integrity": "sha512-LRGu7Op4Xl9hhigOy2kcB53zAYTjNDdpooey49dIU0cMdpOv9ithVf7nstk3jvs8EhMiT/VORoyazZYGgw4vnA==", |
|||
"requires": { |
|||
"@polka/url": "^1.0.0-next.9", |
|||
"mime": "^2.3.1", |
|||
"totalist": "^1.0.0" |
|||
} |
|||
}, |
|||
"sirv-cli": { |
|||
"version": "1.0.6", |
|||
"resolved": "https://registry.npmjs.org/sirv-cli/-/sirv-cli-1.0.6.tgz", |
|||
"integrity": "sha512-K/iY1OHG7hTw4GzLoqMhwzKCbgWmx5joYAAF2+CwyiamWCpVzAgNVWgAc0JmSA2Gf3wseov05il2QbFTGTZMVg==", |
|||
"requires": { |
|||
"console-clear": "^1.1.0", |
|||
"get-port": "^3.2.0", |
|||
"kleur": "^3.0.0", |
|||
"local-access": "^1.0.1", |
|||
"sade": "^1.6.0", |
|||
"semiver": "^1.0.0", |
|||
"sirv": "^1.0.6", |
|||
"tinydate": "^1.0.0" |
|||
} |
|||
}, |
|||
"source-map": { |
|||
"version": "0.6.1", |
|||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", |
|||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", |
|||
"dev": true |
|||
}, |
|||
"source-map-support": { |
|||
"version": "0.5.19", |
|||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", |
|||
"integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", |
|||
"dev": true, |
|||
"requires": { |
|||
"buffer-from": "^1.0.0", |
|||
"source-map": "^0.6.0" |
|||
} |
|||
}, |
|||
"sourcemap-codec": { |
|||
"version": "1.4.8", |
|||
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", |
|||
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", |
|||
"dev": true |
|||
}, |
|||
"supports-color": { |
|||
"version": "5.5.0", |
|||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", |
|||
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", |
|||
"dev": true, |
|||
"requires": { |
|||
"has-flag": "^3.0.0" |
|||
} |
|||
}, |
|||
"svelte": { |
|||
"version": "3.28.0", |
|||
"resolved": "https://registry.npmjs.org/svelte/-/svelte-3.28.0.tgz", |
|||
"integrity": "sha512-WJW8wD+aTmU5GUnTUjdhVF35mve2MjylubLgB6fGWoXHpYENdwcwWsWvjMQLayzMynqNH733h1Ck8wJzNR7gdQ==", |
|||
"dev": true |
|||
}, |
|||
"terser": { |
|||
"version": "5.3.2", |
|||
"resolved": "https://registry.npmjs.org/terser/-/terser-5.3.2.tgz", |
|||
"integrity": "sha512-H67sydwBz5jCUA32ZRL319ULu+Su1cAoZnnc+lXnenGRYWyLE3Scgkt8mNoAsMx0h5kdo758zdoS0LG9rYZXDQ==", |
|||
"dev": true, |
|||
"requires": { |
|||
"commander": "^2.20.0", |
|||
"source-map": "~0.6.1", |
|||
"source-map-support": "~0.5.12" |
|||
} |
|||
}, |
|||
"tinydate": { |
|||
"version": "1.3.0", |
|||
"resolved": "https://registry.npmjs.org/tinydate/-/tinydate-1.3.0.tgz", |
|||
"integrity": "sha512-7cR8rLy2QhYHpsBDBVYnnWXm8uRTr38RoZakFSW7Bs7PzfMPNZthuMLkwqZv7MTu8lhQ91cOFYS5a7iFj2oR3w==" |
|||
}, |
|||
"to-regex-range": { |
|||
"version": "5.0.1", |
|||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", |
|||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", |
|||
"dev": true, |
|||
"requires": { |
|||
"is-number": "^7.0.0" |
|||
} |
|||
}, |
|||
"totalist": { |
|||
"version": "1.1.0", |
|||
"resolved": "https://registry.npmjs.org/totalist/-/totalist-1.1.0.tgz", |
|||
"integrity": "sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==" |
|||
}, |
|||
"wrappy": { |
|||
"version": "1.0.2", |
|||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", |
|||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", |
|||
"dev": true |
|||
}, |
|||
"ws": { |
|||
"version": "6.2.1", |
|||
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", |
|||
"integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", |
|||
"dev": true, |
|||
"requires": { |
|||
"async-limiter": "~1.0.0" |
|||
} |
|||
} |
|||
} |
|||
} |
@ -1,60 +1,91 @@ |
|||
<script> |
|||
import { sigma } from "sigma"; |
|||
import "sigma/build/plugins/sigma.layout.forceAtlas2.min.js"; |
|||
import { onMount } from "svelte"; |
|||
import * as d3 from "d3"; |
|||
|
|||
onMount(async () => { |
|||
// set the dimensions and margins of the graph |
|||
var margin = { top: 10, right: 30, bottom: 30, left: 40 }, |
|||
width = 400 - margin.left - margin.right, |
|||
height = 400 - margin.top - margin.bottom; |
|||
|
|||
/** |
|||
* This is a basic example on how to instantiate sigma. A random graph is |
|||
* generated and stored in the "graph" variable, and then sigma is instantiated |
|||
* directly with the graph. |
|||
* |
|||
* The simple instance of sigma is enough to make it render the graph on the on |
|||
* the screen, since the graph is given directly to the constructor. |
|||
*/ |
|||
var i, |
|||
s, |
|||
N = 100, |
|||
E = 500, |
|||
g = { |
|||
nodes: [], |
|||
edges: [], |
|||
}; |
|||
|
|||
// Generate a random graph: |
|||
for (i = 0; i < N; i++) |
|||
g.nodes.push({ |
|||
id: "n" + i, |
|||
label: "Node " + i, |
|||
x: Math.random(), |
|||
y: Math.random(), |
|||
size: Math.random(), |
|||
color: "#666", |
|||
}); |
|||
|
|||
for (i = 0; i < E; i++) |
|||
g.edges.push({ |
|||
id: "e" + i, |
|||
source: "n" + ((Math.random() * N) | 0), |
|||
target: "n" + ((Math.random() * N) | 0), |
|||
size: Math.random(), |
|||
color: "#ccc", |
|||
}); |
|||
|
|||
// Instantiate sigma: |
|||
onMount(() => { |
|||
s = new sigma({ |
|||
graph: g, |
|||
container: "c", |
|||
}); |
|||
s.startForceAtlas2(); |
|||
// append the svg object to the body of the page |
|||
var svg = d3 |
|||
.select("#c") |
|||
.append("svg") |
|||
.attr("width", width + margin.left + margin.right) |
|||
.attr("height", height + margin.top + margin.bottom) |
|||
.append("g") |
|||
.attr("transform", "translate(" + margin.left + "," + margin.top + ")"); |
|||
|
|||
const data = await d3.json( |
|||
"https://raw.githubusercontent.com/holtzy/D3-graph-gallery/master/DATA/data_network.json" |
|||
); |
|||
|
|||
// Initialize the links |
|||
var link = svg |
|||
.selectAll("line") |
|||
.data(data.links) |
|||
.enter() |
|||
.append("line") |
|||
.style("stroke", "#aaa"); |
|||
|
|||
// Initialize the nodes |
|||
var node = svg |
|||
.selectAll("circle") |
|||
.data(data.nodes) |
|||
.enter() |
|||
.append("circle") |
|||
.attr("r", 20) |
|||
.style("fill", "#69b3a2"); |
|||
|
|||
// Let's list the force we wanna apply on the network |
|||
var simulation = d3 |
|||
.forceSimulation(data.nodes) // Force algorithm is applied to data.nodes |
|||
.force( |
|||
"link", |
|||
d3 |
|||
.forceLink() // This force provides links between nodes |
|||
.id(function (d) { |
|||
return d.id; |
|||
}) // This provide the id of a node |
|||
.links(data.links) // and this the list of links |
|||
) |
|||
.force("charge", d3.forceManyBody().strength(-400)) // This adds repulsion between nodes. Play with the -400 for the repulsion strength |
|||
.force("center", d3.forceCenter(width / 2, height / 2)) // This force attracts nodes to the center of the svg area |
|||
.on("end", ticked); |
|||
|
|||
// This function is run at each iteration of the force algorithm, updating the nodes position. |
|||
function ticked() { |
|||
link |
|||
.attr("x1", function (d) { |
|||
return d.source.x; |
|||
}) |
|||
.attr("y1", function (d) { |
|||
return d.source.y; |
|||
}) |
|||
.attr("x2", function (d) { |
|||
return d.target.x; |
|||
}) |
|||
.attr("y2", function (d) { |
|||
return d.target.y; |
|||
}); |
|||
|
|||
node |
|||
.attr("cx", function (d) { |
|||
return d.x + 6; |
|||
}) |
|||
.attr("cy", function (d) { |
|||
return d.y - 6; |
|||
}); |
|||
} |
|||
}); |
|||
</script> |
|||
|
|||
<div id="c" /> |
|||
|
|||
<style> |
|||
div { |
|||
height: 500px; |
|||
width: 80%; |
|||
} |
|||
</style> |
|||
|
|||
<div id="c" /> |
|||
|
Reference in new issue