prographs 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -1
- package/README.md +6 -4
- package/dist/AutoGraph-PDPEAIXL.cjs +145 -0
- package/dist/GraphType.js +19 -0
- package/dist/autograph/chartIndex.js +521 -0
- package/dist/autograph/chartModules.js +2 -1
- package/dist/autograph/index.cjs +98 -93
- package/dist/catalog-DI4XZ46L.cjs +142 -0
- package/dist/catalog.js +2 -1
- package/dist/charts/biologycharts/BiologySamples.js +59 -0
- package/dist/charts/biologycharts/PunnettSquare.js +342 -0
- package/dist/charts/biologycharts/biologyEnums.js +22 -1
- package/dist/charts/biologycharts/index.js +5 -3
- package/dist/charts/doecharts/DoeSamples.js +78 -0
- package/dist/charts/doecharts/SipocDiagram.js +453 -0
- package/dist/charts/doecharts/index.js +4 -2
- package/dist/charts/fieldcharts/SpeciesAccumulationCurve.js +350 -0
- package/dist/charts/fieldcharts/fieldEnums.js +8 -1
- package/dist/charts/fieldcharts/index.js +5 -3
- package/dist/charts/signals/AntennaPatternChart.js +492 -0
- package/dist/charts/signals/SignalSamples.js +17 -0
- package/dist/charts/signals/index.js +5 -3
- package/dist/charts/softwarediagrams/ComponentDiagram.js +504 -0
- package/dist/charts/softwarediagrams/DeploymentDiagram.js +419 -0
- package/dist/charts/softwarediagrams/SoftwareSamples.js +283 -1
- package/dist/charts/softwarediagrams/index.js +7 -3
- package/dist/charts/softwarediagrams/softwareEnums.js +45 -1
- package/dist/charts/sportscharts/PowerDurationCurve.js +301 -0
- package/dist/charts/sportscharts/SportsSamples.js +102 -0
- package/dist/charts/sportscharts/TrainingLoadChart.js +325 -0
- package/dist/charts/sportscharts/index.js +6 -2
- package/dist/charts/strategycharts/BassDiffusionChart.js +362 -0
- package/dist/charts/strategycharts/BassModel.js +96 -0
- package/dist/charts/strategycharts/BurnRunwayChart.js +284 -0
- package/dist/charts/strategycharts/CapTableChart.js +366 -0
- package/dist/charts/strategycharts/KanbanBoard.js +324 -0
- package/dist/charts/strategycharts/OkrTree.js +339 -0
- package/dist/charts/strategycharts/StrategyPane.js +27 -0
- package/dist/charts/strategycharts/StrategySamples.js +251 -0
- package/dist/charts/strategycharts/index.js +15 -3
- package/dist/charts/threefields/BsfcMap3DChart.js +231 -0
- package/dist/charts/threefields/CompressorMap3DChart.js +217 -0
- package/dist/charts/threefields/FieldGrid.js +50 -0
- package/dist/charts/threefields/LossLandscape3DChart.js +201 -0
- package/dist/charts/threefields/MapSheet.js +77 -0
- package/dist/charts/threefields/TerrainRoute3DChart.js +201 -0
- package/dist/charts/threefields/TerrainRouteMath.js +40 -0
- package/dist/charts/threefields/ThreeFieldBase.js +117 -0
- package/dist/charts/threefields/ThreeFieldsSamples.js +80 -0
- package/dist/charts/threefields/WaferMap3DChart.js +218 -0
- package/dist/charts/threefields/index.js +19 -0
- package/dist/charts/threesurfaces/index.js +2 -2
- package/dist/charts/tradingcharts/KeltnerChannelChart.js +171 -0
- package/dist/charts/tradingcharts/TradingMath.js +20 -0
- package/dist/charts/tradingcharts/index.js +4 -2
- package/dist/{chunk-ZL6XDXMK.cjs → chunk-26PSLEP4.cjs} +8 -8
- package/dist/{chunk-W3US6EFP.cjs → chunk-2BO5DZUP.cjs} +12 -12
- package/dist/{chunk-5DP7OUSE.cjs → chunk-2GG5YYSC.cjs} +6 -6
- package/dist/{chunk-7FG4JSVO.cjs → chunk-2GL2VNJU.cjs} +253 -33
- package/dist/{chunk-LCWMRCLF.cjs → chunk-2PYOI7OY.cjs} +21 -21
- package/dist/{chunk-JFWJAEBD.cjs → chunk-3U4MCSKI.cjs} +4 -4
- package/dist/{chunk-CUPLHZRR.cjs → chunk-3ZMM3FSK.cjs} +4 -4
- package/dist/{chunk-L2AV62DP.cjs → chunk-4767WQJ7.cjs} +6 -6
- package/dist/{chunk-DA2EYIIP.cjs → chunk-4E7FSSBF.cjs} +1210 -168
- package/dist/{chunk-VS5LQEZB.cjs → chunk-526STI2S.cjs} +5 -5
- package/dist/{chunk-RXIMEK6C.cjs → chunk-55767YPI.cjs} +20 -20
- package/dist/{chunk-JXLSKIUV.cjs → chunk-5FBQOMMT.cjs} +26 -26
- package/dist/{chunk-27PZV5BR.cjs → chunk-5N4Z7MTS.cjs} +4 -4
- package/dist/{chunk-KEWCUIQA.cjs → chunk-5WEV6YWA.cjs} +22 -22
- package/dist/chunk-5XOVVC5X.cjs +3281 -0
- package/dist/{chunk-HK5J7Q2W.cjs → chunk-6HLXVWXU.cjs} +9 -9
- package/dist/{chunk-7JG47RW4.cjs → chunk-6LQT4WJ5.cjs} +25 -25
- package/dist/{chunk-OCVTI6X4.cjs → chunk-6YTWOUFD.cjs} +329 -36
- package/dist/{chunk-W7IQCAVN.cjs → chunk-7F6W6HKL.cjs} +11 -11
- package/dist/{chunk-F2DCJXDM.cjs → chunk-7L6KYU5A.cjs} +21 -21
- package/dist/{chunk-GTGR6LPR.cjs → chunk-A4GIN4FE.cjs} +17 -17
- package/dist/{chunk-B2CETSR6.cjs → chunk-A4US7SA7.cjs} +5 -5
- package/dist/{chunk-3DIF2YYW.cjs → chunk-AOXPBLPW.cjs} +10 -10
- package/dist/{chunk-7TTR4UF5.cjs → chunk-ATI45Z4M.cjs} +2 -2
- package/dist/{chunk-5BFCIX2V.cjs → chunk-CPPMO4IQ.cjs} +434 -148
- package/dist/{chunk-AYZZQ6AC.cjs → chunk-CZ5KGF6Q.cjs} +9 -9
- package/dist/{chunk-7THJ3ZBK.cjs → chunk-D4I35MCE.cjs} +2 -2
- package/dist/{chunk-MCPPFRLN.cjs → chunk-DCGAAN3Z.cjs} +2 -2
- package/dist/{chunk-VABL6CVX.cjs → chunk-DEY36N37.cjs} +21 -21
- package/dist/{chunk-RNCKGJCC.cjs → chunk-DXHXD3DK.cjs} +3 -3
- package/dist/{chunk-A56ZGMVZ.cjs → chunk-E7B45DBZ.cjs} +11 -11
- package/dist/{chunk-DOR6L4MT.cjs → chunk-EJC6EAC5.cjs} +18 -18
- package/dist/{chunk-UPGNM7MA.cjs → chunk-EULJOOMA.cjs} +11 -11
- package/dist/{chunk-G4AZL4GO.cjs → chunk-EYM6LEIF.cjs} +474 -70
- package/dist/{chunk-NJ4X6XGV.cjs → chunk-EZTYX2GH.cjs} +5 -5
- package/dist/chunk-FDD4UP73.cjs +521 -0
- package/dist/{chunk-WJ3VH2Q4.cjs → chunk-GEAIGM3J.cjs} +110 -615
- package/dist/{chunk-P3SBHF43.cjs → chunk-GRUYVXTS.cjs} +2 -2
- package/dist/{chunk-NX4Z5LMS.cjs → chunk-H3SZXND5.cjs} +5 -5
- package/dist/{chunk-EE4S4TOE.cjs → chunk-HS45TOFJ.cjs} +21 -21
- package/dist/chunk-INGOG6OV.cjs +899 -0
- package/dist/{chunk-UDKA6DGT.cjs → chunk-J3CDXZHF.cjs} +4 -4
- package/dist/{chunk-YO6G7TKI.cjs → chunk-JAU5ADEU.cjs} +11 -11
- package/dist/{chunk-22LBK4GA.cjs → chunk-JQEBSHX3.cjs} +4 -4
- package/dist/{chunk-RXX3U7VQ.cjs → chunk-KLXGLMFU.cjs} +10 -10
- package/dist/chunk-KVOX36J3.cjs +327 -0
- package/dist/chunk-L6BGNHFL.cjs +139 -0
- package/dist/{chunk-GMER35L3.cjs → chunk-L7TB7PU5.cjs} +20 -20
- package/dist/{chunk-AFXYNBL2.cjs → chunk-LBTRYEM2.cjs} +4 -4
- package/dist/{chunk-WYYCKIOD.cjs → chunk-LLULNJSP.cjs} +11 -11
- package/dist/{chunk-J27XOSLP.cjs → chunk-LSO46AFV.cjs} +8 -8
- package/dist/{chunk-5XJO45ES.cjs → chunk-LZ2KJ7ZX.cjs} +11 -11
- package/dist/chunk-M4IQ5LIZ.cjs +422 -0
- package/dist/{chunk-Y2KIUKJF.cjs → chunk-MPDHDKYZ.cjs} +11 -11
- package/dist/{chunk-4EMPKRZU.cjs → chunk-MRQ42ZJE.cjs} +3 -3
- package/dist/{chunk-EU5D2MF4.cjs → chunk-MYV4KZWP.cjs} +9 -9
- package/dist/{chunk-XD7KN4UN.cjs → chunk-MZXVLC24.cjs} +6 -6
- package/dist/{chunk-PPSONARU.cjs → chunk-NLBVDFIR.cjs} +41 -2
- package/dist/{chunk-L3PEGMGM.cjs → chunk-NY3TBZY4.cjs} +33 -33
- package/dist/{chunk-6YNYXXB6.cjs → chunk-OGVVSFAR.cjs} +3 -3
- package/dist/{chunk-MLV7QLB6.cjs → chunk-OMTQIQMN.cjs} +6 -6
- package/dist/{chunk-BEEOSNK7.cjs → chunk-PEJJ6TXJ.cjs} +15 -144
- package/dist/{chunk-SOKOWUF5.cjs → chunk-PPGWHIU7.cjs} +2 -2
- package/dist/{chunk-IELWOM2J.cjs → chunk-PPO6SDAN.cjs} +6 -6
- package/dist/{chunk-6JTZZCSL.cjs → chunk-PUMKX5F2.cjs} +3 -3
- package/dist/{chunk-RFOXFY2U.cjs → chunk-PXBYWCNB.cjs} +190 -799
- package/dist/{chunk-3BYXOISI.cjs → chunk-Q3HB3IX6.cjs} +4 -4
- package/dist/{chunk-RXCOVONX.cjs → chunk-RBMUOIXE.cjs} +289 -34
- package/dist/{chunk-MSBNHCSE.cjs → chunk-RJHGCUUD.cjs} +6 -6
- package/dist/{chunk-I6VG7F6Z.cjs → chunk-RSONDMYW.cjs} +708 -141
- package/dist/{chunk-GZDNPHMT.cjs → chunk-SHMPFCUE.cjs} +19 -19
- package/dist/{chunk-ZIBVCOW6.cjs → chunk-SN4FCXFC.cjs} +19 -19
- package/dist/{chunk-7KM52NMN.cjs → chunk-SN5T7WYO.cjs} +2 -2
- package/dist/{chunk-7MSZR65Z.cjs → chunk-SQJZGVDR.cjs} +7 -7
- package/dist/chunk-SYABFMD7.cjs +633 -0
- package/dist/{chunk-2RRFEYFH.cjs → chunk-TICB3MAC.cjs} +16 -16
- package/dist/{chunk-AOOKHUV5.cjs → chunk-U7Z7XYR2.cjs} +5 -5
- package/dist/{chunk-JEWQAXVG.cjs → chunk-UA2THQFV.cjs} +6 -6
- package/dist/{chunk-LHZPAHU3.cjs → chunk-VIK4L2YF.cjs} +112 -521
- package/dist/{chunk-4YWMAQ4J.cjs → chunk-VM2Y6BDY.cjs} +4 -4
- package/dist/{chunk-IRRKE2ZE.cjs → chunk-VMS3KWYI.cjs} +21 -21
- package/dist/{chunk-4SLARW6F.cjs → chunk-VU5NUD46.cjs} +17 -17
- package/dist/{chunk-XHY6TVYG.cjs → chunk-VV5CVOF7.cjs} +13 -13
- package/dist/{chunk-CCIBPGPZ.cjs → chunk-VYSAWPSS.cjs} +57 -57
- package/dist/{chunk-TTNEMQ2A.cjs → chunk-W7YRWEWQ.cjs} +22 -22
- package/dist/{chunk-C7MUOGEW.cjs → chunk-X7R5SY62.cjs} +6 -6
- package/dist/{chunk-ILR5KBMB.cjs → chunk-XOK3KTSS.cjs} +6 -6
- package/dist/{chunk-2CZM2I3T.cjs → chunk-XUIX45VU.cjs} +19 -19
- package/dist/{chunk-TGRMPS3A.cjs → chunk-XWH46PVJ.cjs} +165 -43
- package/dist/{chunk-WQYXXECR.cjs → chunk-Y5XVMK3K.cjs} +6 -6
- package/dist/{chunk-AK4TX2WG.cjs → chunk-YCNKEDTG.cjs} +13 -13
- package/dist/{chunk-PJJB24DU.cjs → chunk-YEF7SE3X.cjs} +20 -20
- package/dist/{chunk-RVLV4XW6.cjs → chunk-YMTVPMU3.cjs} +22 -22
- package/dist/data/index.cjs +2 -2
- package/dist/entries/autograph-lazy.cjs +2 -2
- package/dist/entries/charts/acoustictransport.cjs +3 -3
- package/dist/entries/charts/analysischarts.cjs +3 -3
- package/dist/entries/charts/astrocharts.cjs +3 -3
- package/dist/entries/charts/bars.cjs +3 -3
- package/dist/entries/charts/bayesiancharts.cjs +3 -3
- package/dist/entries/charts/biocharts.cjs +3 -3
- package/dist/entries/charts/biologycharts.cjs +11 -3
- package/dist/entries/charts/biologycharts.d.ts +1 -1
- package/dist/entries/charts/biologycharts.js +3 -2
- package/dist/entries/charts/business.cjs +3 -3
- package/dist/entries/charts/carecharts.cjs +3 -3
- package/dist/entries/charts/chemistrycharts.cjs +3 -3
- package/dist/entries/charts/civicscharts.cjs +3 -3
- package/dist/entries/charts/clinicalcharts.cjs +3 -3
- package/dist/entries/charts/comparison.cjs +3 -3
- package/dist/entries/charts/demography.cjs +3 -3
- package/dist/entries/charts/density.cjs +3 -3
- package/dist/entries/charts/diagrams.cjs +3 -3
- package/dist/entries/charts/distribution.cjs +3 -3
- package/dist/entries/charts/doecharts.cjs +13 -3
- package/dist/entries/charts/doecharts.d.ts +1 -1
- package/dist/entries/charts/doecharts.js +2 -1
- package/dist/entries/charts/earthscience.cjs +3 -3
- package/dist/entries/charts/economicscharts.cjs +3 -3
- package/dist/entries/charts/energycharts.cjs +3 -3
- package/dist/entries/charts/engineering.cjs +3 -3
- package/dist/entries/charts/fieldcharts.cjs +7 -3
- package/dist/entries/charts/fieldcharts.d.ts +1 -1
- package/dist/entries/charts/fieldcharts.js +3 -2
- package/dist/entries/charts/financial.cjs +3 -3
- package/dist/entries/charts/flow.cjs +3 -3
- package/dist/entries/charts/frameworks.cjs +3 -3
- package/dist/entries/charts/genomics.cjs +3 -3
- package/dist/entries/charts/geoflows.cjs +3 -3
- package/dist/entries/charts/geomaps.cjs +3 -3
- package/dist/entries/charts/geosciencecharts.cjs +3 -3
- package/dist/entries/charts/hierarchy.cjs +3 -3
- package/dist/entries/charts/indicators.cjs +3 -3
- package/dist/entries/charts/inferencecharts.cjs +3 -3
- package/dist/entries/charts/layoutcharts.cjs +3 -3
- package/dist/entries/charts/lifescience.cjs +4 -4
- package/dist/entries/charts/linesareas.cjs +3 -3
- package/dist/entries/charts/logisticscharts.cjs +3 -3
- package/dist/entries/charts/machinecharts.cjs +7 -3
- package/dist/entries/charts/machinecharts.d.ts +1 -1
- package/dist/entries/charts/machinecharts.js +2 -1
- package/dist/entries/charts/massive.cjs +3 -3
- package/dist/entries/charts/mathematical.cjs +3 -3
- package/dist/entries/charts/matrix.cjs +3 -3
- package/dist/entries/charts/medicalcharts.cjs +4 -4
- package/dist/entries/charts/mlcharts.cjs +4 -4
- package/dist/entries/charts/modelcharts.cjs +6 -5
- package/dist/entries/charts/multivariate.cjs +3 -3
- package/dist/entries/charts/musiccharts.cjs +3 -3
- package/dist/entries/charts/network.cjs +3 -3
- package/dist/entries/charts/physicscharts.cjs +3 -3
- package/dist/entries/charts/pictorial.cjs +4 -4
- package/dist/entries/charts/portfoliocharts.cjs +3 -3
- package/dist/entries/charts/productcharts.cjs +3 -3
- package/dist/entries/charts/proportion.cjs +3 -3
- package/dist/entries/charts/qualitycharts.cjs +3 -3
- package/dist/entries/charts/radial.cjs +3 -3
- package/dist/entries/charts/reliabilitycharts.cjs +5 -3
- package/dist/entries/charts/scatter.cjs +3 -3
- package/dist/entries/charts/scientific.cjs +3 -3
- package/dist/entries/charts/seriescharts.cjs +3 -3
- package/dist/entries/charts/signals.cjs +7 -3
- package/dist/entries/charts/signals.d.ts +1 -1
- package/dist/entries/charts/signals.js +2 -1
- package/dist/entries/charts/softwarediagrams.cjs +21 -3
- package/dist/entries/charts/softwarediagrams.d.ts +1 -1
- package/dist/entries/charts/softwarediagrams.js +4 -2
- package/dist/entries/charts/sportscharts.cjs +13 -3
- package/dist/entries/charts/sportscharts.d.ts +1 -1
- package/dist/entries/charts/sportscharts.js +3 -1
- package/dist/entries/charts/statistics.cjs +6 -6
- package/dist/entries/charts/strategycharts.cjs +30 -3
- package/dist/entries/charts/strategycharts.d.ts +1 -1
- package/dist/entries/charts/strategycharts.js +6 -1
- package/dist/entries/charts/structure.cjs +3 -3
- package/dist/entries/charts/surveycharts.cjs +3 -3
- package/dist/entries/charts/systemscharts.cjs +3 -3
- package/dist/entries/charts/textcharts.cjs +5 -5
- package/dist/entries/charts/thematicmaps.cjs +4 -4
- package/dist/entries/charts/threebars.cjs +3 -3
- package/dist/entries/charts/threefields.cjs +53 -0
- package/dist/entries/charts/threefields.d.ts +1 -0
- package/dist/entries/charts/threefields.js +6 -0
- package/dist/entries/charts/threeglobe.cjs +3 -3
- package/dist/entries/charts/threenetwork.cjs +3 -3
- package/dist/entries/charts/threestrata.cjs +3 -3
- package/dist/entries/charts/threesurfaces.cjs +7 -3
- package/dist/entries/charts/threesurfaces.d.ts +1 -1
- package/dist/entries/charts/threesurfaces.js +2 -1
- package/dist/entries/charts/threevolume.cjs +4 -4
- package/dist/entries/charts/timeline.cjs +3 -3
- package/dist/entries/charts/tracecharts.cjs +3 -3
- package/dist/entries/charts/trackscharts.cjs +3 -3
- package/dist/entries/charts/tradingcharts.cjs +6 -4
- package/dist/entries/charts/tradingcharts.d.ts +1 -1
- package/dist/entries/charts/tradingcharts.js +2 -1
- package/dist/entries/three.cjs +60 -20
- package/dist/entries/three.d.ts +1 -1
- package/dist/entries/three.js +7 -1
- package/dist/index.cjs +258 -97
- package/dist/index.d.cts +1953 -10
- package/dist/index.d.ts +1953 -10
- package/dist/index.js +26 -5
- package/dist/page/index.cjs +2 -2
- package/dist/react/components.js +58 -1
- package/dist/react/index.cjs +135 -92
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +2 -2
- package/package.json +1 -1
- package/dist/AutoGraph-XLBJQDRB.cjs +0 -140
- package/dist/catalog-O7XGDD2H.cjs +0 -137
- package/dist/chunk-77K2HTRC.cjs +0 -3220
- package/dist/chunk-XEK47TVD.cjs +0 -323
- /package/dist/{chunk-UMEKIIHJ.cjs → chunk-LNWTC72Y.cjs} +0 -0
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import { ChartFamily, DataShape, Dimension, Orientation } from "../../core/enums.js";
|
|
2
|
+
import { DeploymentArtifactForm, DeploymentKind, DeploymentNodeForm, SoftwareRouting } from "./softwareEnums.js";
|
|
3
|
+
import { SoftwareDiagram } from "./SoftwareDiagram.js";
|
|
4
|
+
import { SoftwareGraph } from "./SoftwareGraph.js";
|
|
5
|
+
import { SoftwarePlacer } from "./SoftwarePlacer.js";
|
|
6
|
+
import { SoftwareSamples } from "./SoftwareSamples.js";
|
|
7
|
+
import { SoftwareShapes } from "./SoftwareShapes.js";
|
|
8
|
+
import { SoftwareText } from "./SoftwareText.js";
|
|
9
|
+
import { SoftwareWiring } from "./SoftwareWiring.js";
|
|
10
|
+
// src/charts/softwarediagrams/DeploymentDiagram.ts
|
|
11
|
+
var SIZE = 10.5;
|
|
12
|
+
var PAD = 8;
|
|
13
|
+
var LEAD = 13;
|
|
14
|
+
/** How far the top and side faces of a node box reach up and to the right. */
|
|
15
|
+
var DEPTH = 7;
|
|
16
|
+
var TOP = "";
|
|
17
|
+
var KINDS = new Set(Object.values(DeploymentKind));
|
|
18
|
+
var NAME = {
|
|
19
|
+
node: "Node",
|
|
20
|
+
device: "Device",
|
|
21
|
+
environment: "Execution environment",
|
|
22
|
+
artifact: "Artifact"
|
|
23
|
+
};
|
|
24
|
+
var STEREOTYPE = {
|
|
25
|
+
node: "",
|
|
26
|
+
device: "«device»",
|
|
27
|
+
environment: "«executionEnvironment»",
|
|
28
|
+
artifact: "«artifact»"
|
|
29
|
+
};
|
|
30
|
+
var { Artifact } = DeploymentKind;
|
|
31
|
+
var n = (value) => Math.round(value * 100) / 100;
|
|
32
|
+
/** A connector path, which holds absolute coordinate pairs only, moved by `(dx, dy)`. */
|
|
33
|
+
var shifted = (d, dx, dy) => d.replace(/(-?[\d.]+),(-?[\d.]+)/g, (_, x, y) => `${n(+x + dx)},${n(+y + dy)}`);
|
|
34
|
+
/**
|
|
35
|
+
* UML deployment diagram: devices and execution environments as node boxes that nest, the artifacts deployed on them,
|
|
36
|
+
* and communication paths labelled with their protocols. Use it to show which software runs on which hardware. For a
|
|
37
|
+
* network drawn with device icons use the network topology diagram.
|
|
38
|
+
*/
|
|
39
|
+
var DeploymentDiagram = class DeploymentDiagram extends SoftwareDiagram {
|
|
40
|
+
static meta = {
|
|
41
|
+
id: "uml-deployment-diagram",
|
|
42
|
+
name: "UML deployment diagram",
|
|
43
|
+
family: ChartFamily.Network,
|
|
44
|
+
dimension: Dimension.Two,
|
|
45
|
+
shape: DataShape.Graph,
|
|
46
|
+
description: "Nests devices, execution environments and their artifacts as UML node boxes, joined by communication paths labelled with protocols.",
|
|
47
|
+
tags: [
|
|
48
|
+
"uml",
|
|
49
|
+
"deployment",
|
|
50
|
+
"node",
|
|
51
|
+
"device",
|
|
52
|
+
"execution environment",
|
|
53
|
+
"artifact",
|
|
54
|
+
"communication path",
|
|
55
|
+
"infrastructure"
|
|
56
|
+
],
|
|
57
|
+
sample: (seed) => SoftwareSamples.deployment(seed),
|
|
58
|
+
variants: {
|
|
59
|
+
orientation: [Orientation.Horizontal, Orientation.Vertical],
|
|
60
|
+
routing: [SoftwareRouting.Orthogonal, SoftwareRouting.Curved],
|
|
61
|
+
form: [DeploymentNodeForm.Cube, DeploymentNodeForm.Flat],
|
|
62
|
+
artifacts: [DeploymentArtifactForm.Symbol, DeploymentArtifactForm.Listed]
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
defaults() {
|
|
66
|
+
return {
|
|
67
|
+
nodeId: "id",
|
|
68
|
+
label: "label",
|
|
69
|
+
kind: "kind",
|
|
70
|
+
parent: "parent",
|
|
71
|
+
source: "source",
|
|
72
|
+
target: "target",
|
|
73
|
+
protocol: "protocol",
|
|
74
|
+
orientation: Orientation.Horizontal,
|
|
75
|
+
routing: SoftwareRouting.Orthogonal,
|
|
76
|
+
form: DeploymentNodeForm.Cube,
|
|
77
|
+
artifacts: DeploymentArtifactForm.Symbol
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
legendItems() {
|
|
81
|
+
return this.palette.items();
|
|
82
|
+
}
|
|
83
|
+
#graph() {
|
|
84
|
+
const { nodeId, source, target } = this.options;
|
|
85
|
+
return SoftwareGraph.read(this.options.data, {
|
|
86
|
+
nodeId,
|
|
87
|
+
source,
|
|
88
|
+
target
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
table() {
|
|
92
|
+
const { source, target, protocol } = this.options;
|
|
93
|
+
return this.rowsOf(this.#graph().arcs.map((arc) => arc.raw), [
|
|
94
|
+
source,
|
|
95
|
+
target,
|
|
96
|
+
protocol
|
|
97
|
+
]);
|
|
98
|
+
}
|
|
99
|
+
/** Every element with its parent and children. A parent that is unknown, or that would close a loop, is ignored. */
|
|
100
|
+
static tree(graph, columns) {
|
|
101
|
+
const elements = new Map(graph.vertices.map(({ id, raw }) => {
|
|
102
|
+
const kind = String(raw[columns.kind] ?? "").toLowerCase();
|
|
103
|
+
return [id, {
|
|
104
|
+
id,
|
|
105
|
+
raw,
|
|
106
|
+
label: SoftwareGraph.text(raw[columns.label]) ?? id,
|
|
107
|
+
kind: KINDS.has(kind) ? kind : DeploymentKind.Node,
|
|
108
|
+
parent: null,
|
|
109
|
+
children: []
|
|
110
|
+
}];
|
|
111
|
+
}));
|
|
112
|
+
for (const element of elements.values()) {
|
|
113
|
+
const holder = elements.get(SoftwareGraph.text(element.raw[columns.parent]) ?? TOP);
|
|
114
|
+
let up = holder ?? null;
|
|
115
|
+
while (up && up !== element) up = up.parent;
|
|
116
|
+
if (!holder || up) continue;
|
|
117
|
+
element.parent = holder;
|
|
118
|
+
holder.children.push(element);
|
|
119
|
+
}
|
|
120
|
+
return elements;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Sizes every node from the inside out, then places it from the outside in. The children of one node are layered by
|
|
124
|
+
* the paths among them, and a path between elements of different nodes is drawn at the level where their holders are siblings.
|
|
125
|
+
*/
|
|
126
|
+
static layout(elements, links, look) {
|
|
127
|
+
const { vertical, routing, depth, listed } = look;
|
|
128
|
+
const symbol = (element) => element.kind === Artifact && !element.children.length;
|
|
129
|
+
const named = (element) => listed && symbol(element) && !!element.parent;
|
|
130
|
+
/** The drawn elements that hold `id`, outermost first, ending with the element itself. */
|
|
131
|
+
const chain = (id) => {
|
|
132
|
+
const out = [];
|
|
133
|
+
for (let element = elements.get(id) ?? null; element; element = element.parent) if (!named(element)) out.unshift(element);
|
|
134
|
+
return out;
|
|
135
|
+
};
|
|
136
|
+
const levels = /* @__PURE__ */ new Map();
|
|
137
|
+
links.forEach((link, index) => {
|
|
138
|
+
const a = chain(link.source), b = chain(link.target);
|
|
139
|
+
let k = 0;
|
|
140
|
+
while (k < a.length && k < b.length && a[k] === b[k]) k++;
|
|
141
|
+
if (k >= a.length || k >= b.length) return;
|
|
142
|
+
const level = k ? a[k - 1].id : TOP;
|
|
143
|
+
levels.set(level, [...levels.get(level) ?? [], {
|
|
144
|
+
link: index,
|
|
145
|
+
source: a[k].id,
|
|
146
|
+
target: b[k].id
|
|
147
|
+
}]);
|
|
148
|
+
});
|
|
149
|
+
const size = (element) => {
|
|
150
|
+
if (symbol(element)) {
|
|
151
|
+
const title = SoftwareText.fit(element.label, 110, SIZE);
|
|
152
|
+
return {
|
|
153
|
+
element,
|
|
154
|
+
symbol: true,
|
|
155
|
+
width: Math.max(64, SoftwareText.width(title, SIZE) + 32),
|
|
156
|
+
height: 24,
|
|
157
|
+
head: 0,
|
|
158
|
+
title,
|
|
159
|
+
names: [],
|
|
160
|
+
inner: null
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
const title = SoftwareText.fit(element.label, 150, 11, true), names = element.children.filter(named).map((child) => SoftwareText.fit(child.label, 140, 10)).filter(Boolean);
|
|
164
|
+
const head = STEREOTYPE[element.kind] ? 30 : 22, kids = element.children.filter((child) => !named(child)), inner = kids.length ? group(kids, element.id) : null;
|
|
165
|
+
const text = Math.max(SoftwareText.width(STEREOTYPE[element.kind], 9), SoftwareText.width(title, 11, true), ...names.map((name) => SoftwareText.width(name, 10)));
|
|
166
|
+
return {
|
|
167
|
+
element,
|
|
168
|
+
symbol: false,
|
|
169
|
+
head,
|
|
170
|
+
title,
|
|
171
|
+
names,
|
|
172
|
+
inner,
|
|
173
|
+
width: Math.max(80, text + 16, (inner?.plan.width ?? 0) + 16),
|
|
174
|
+
height: head + (names.length ? names.length * LEAD + 2 : 0) + (inner ? inner.plan.height + PAD : names.length ? 4 : 2)
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
const group = (kids, level, room) => {
|
|
178
|
+
const sized = kids.map(size), own = levels.get(level) ?? [], words = own.map(({ link }) => SoftwareText.width(links[link].text, 10));
|
|
179
|
+
const wide = Math.max(0, ...sized.filter((entry) => entry.symbol).map((entry) => entry.width));
|
|
180
|
+
for (const entry of sized) if (entry.symbol) entry.width = wide;
|
|
181
|
+
return {
|
|
182
|
+
sized,
|
|
183
|
+
plan: SoftwareWiring.build({
|
|
184
|
+
nodes: sized.map((entry) => {
|
|
185
|
+
const width = entry.width + (entry.symbol ? 0 : depth), height = entry.height + (entry.symbol ? 0 : depth);
|
|
186
|
+
return {
|
|
187
|
+
id: entry.element.id,
|
|
188
|
+
along: vertical ? height : width,
|
|
189
|
+
across: vertical ? width : height,
|
|
190
|
+
ports: "spread"
|
|
191
|
+
};
|
|
192
|
+
}),
|
|
193
|
+
links: own,
|
|
194
|
+
vertical,
|
|
195
|
+
routing,
|
|
196
|
+
nodeGap: 12,
|
|
197
|
+
inset: 0,
|
|
198
|
+
room,
|
|
199
|
+
rankGap: vertical ? 30 : Math.max(36, Math.min(110, Math.max(0, ...words) + 20)),
|
|
200
|
+
labelRoom: words.map((width) => width ? width + 16 : 0)
|
|
201
|
+
}),
|
|
202
|
+
links: own.map(({ link }) => link)
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
const blocks = [], runs = [], areas = /* @__PURE__ */ new Map();
|
|
206
|
+
const put = (inner, left, top, level) => {
|
|
207
|
+
areas.set(level, {
|
|
208
|
+
x0: left,
|
|
209
|
+
y0: top,
|
|
210
|
+
x1: left + inner.plan.width,
|
|
211
|
+
y1: top + inner.plan.height
|
|
212
|
+
});
|
|
213
|
+
inner.plan.wires.forEach((wire, i) => runs.push({
|
|
214
|
+
key: `${level}/${i}`,
|
|
215
|
+
level,
|
|
216
|
+
link: inner.links[i],
|
|
217
|
+
wire: {
|
|
218
|
+
...wire,
|
|
219
|
+
d: shifted(wire.d, left, top),
|
|
220
|
+
points: wire.points.map(([x, y]) => [x + left, y + top]),
|
|
221
|
+
tip: [wire.tip[0] + left, wire.tip[1] + top]
|
|
222
|
+
}
|
|
223
|
+
}));
|
|
224
|
+
for (const entry of inner.sized) {
|
|
225
|
+
const box = inner.plan.boxes.get(entry.element.id), x = left + box.x - box.width / 2, y = top + box.y - box.height / 2 + (entry.symbol ? 0 : depth);
|
|
226
|
+
blocks.push({
|
|
227
|
+
element: entry.element,
|
|
228
|
+
symbol: entry.symbol,
|
|
229
|
+
level,
|
|
230
|
+
x,
|
|
231
|
+
y,
|
|
232
|
+
width: entry.width,
|
|
233
|
+
height: entry.height,
|
|
234
|
+
title: entry.title,
|
|
235
|
+
names: entry.names
|
|
236
|
+
});
|
|
237
|
+
if (entry.inner) put(entry.inner, x + (entry.width - entry.inner.plan.width) / 2, y + entry.head + (entry.names.length ? entry.names.length * LEAD + 2 : 0), entry.element.id);
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
const root = group([...elements.values()].filter((element) => !element.parent), TOP, look.room);
|
|
241
|
+
put(root, 0, 0, TOP);
|
|
242
|
+
return {
|
|
243
|
+
blocks,
|
|
244
|
+
runs,
|
|
245
|
+
areas,
|
|
246
|
+
width: root.plan.width,
|
|
247
|
+
height: root.plan.height
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
draw(ctx) {
|
|
251
|
+
const { orientation, routing, form, artifacts, label, kind, parent, protocol } = this.options;
|
|
252
|
+
const vertical = orientation === Orientation.Vertical, depth = form === DeploymentNodeForm.Cube ? DEPTH : 0, { theme, palette } = ctx;
|
|
253
|
+
const graph = this.#graph(), elements = DeploymentDiagram.tree(graph, {
|
|
254
|
+
label,
|
|
255
|
+
kind,
|
|
256
|
+
parent
|
|
257
|
+
});
|
|
258
|
+
const words = graph.arcs.map((arc) => SoftwareText.fit(SoftwareGraph.text(arc.raw[protocol]) ?? "", 90, 10));
|
|
259
|
+
const plan = DeploymentDiagram.layout(elements, graph.arcs.map((arc, i) => ({
|
|
260
|
+
source: arc.source,
|
|
261
|
+
target: arc.target,
|
|
262
|
+
text: words[i]
|
|
263
|
+
})), {
|
|
264
|
+
vertical,
|
|
265
|
+
routing,
|
|
266
|
+
depth,
|
|
267
|
+
listed: artifacts === DeploymentArtifactForm.Listed,
|
|
268
|
+
room: vertical ? {
|
|
269
|
+
length: ctx.plot.height,
|
|
270
|
+
breadth: ctx.plot.width
|
|
271
|
+
} : {
|
|
272
|
+
length: ctx.plot.width,
|
|
273
|
+
breadth: ctx.plot.height
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
const stage = this.stage(ctx, plan.width, plan.height);
|
|
277
|
+
const shapes = [], labels = [];
|
|
278
|
+
for (const { element, symbol, x, y, width: w, height: h, title, names } of plan.blocks) {
|
|
279
|
+
const sort = symbol ? NAME.artifact : NAME[element.kind], fill = palette.color(sort), main = {
|
|
280
|
+
key: element.id,
|
|
281
|
+
raw: element.raw
|
|
282
|
+
};
|
|
283
|
+
const held = element.children.map((child) => child.label);
|
|
284
|
+
const tip = {
|
|
285
|
+
title: element.label,
|
|
286
|
+
color: fill,
|
|
287
|
+
rows: [
|
|
288
|
+
["Kind", sort],
|
|
289
|
+
...element.parent ? [["On", element.parent.label]] : [],
|
|
290
|
+
...held.length ? [["Holds", held.join(", ")]] : []
|
|
291
|
+
]
|
|
292
|
+
};
|
|
293
|
+
if (symbol) {
|
|
294
|
+
const on = palette.inkOn(fill), gx = x + w - 16, gy = y + 6;
|
|
295
|
+
shapes.push({
|
|
296
|
+
...main,
|
|
297
|
+
d: SoftwareShapes.rect(x, y, w, h, 2),
|
|
298
|
+
fill,
|
|
299
|
+
tip
|
|
300
|
+
});
|
|
301
|
+
shapes.push({
|
|
302
|
+
key: `${element.id}/page`,
|
|
303
|
+
d: `M${n(gx)},${n(gy)}h5.5l3.5,3.5v8.5h-9ZM${n(gx + 5.5)},${n(gy)}v3.5h3.5`,
|
|
304
|
+
stroke: on,
|
|
305
|
+
strokeWidth: 1.2
|
|
306
|
+
});
|
|
307
|
+
labels.push({
|
|
308
|
+
key: element.id,
|
|
309
|
+
x: x + 8,
|
|
310
|
+
y: y + h / 2 + 3.5,
|
|
311
|
+
text: title,
|
|
312
|
+
size: SIZE,
|
|
313
|
+
fill: on
|
|
314
|
+
});
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
if (depth) {
|
|
318
|
+
shapes.push({
|
|
319
|
+
key: `${element.id}/top`,
|
|
320
|
+
d: SoftwareShapes.polygon([
|
|
321
|
+
[x, y],
|
|
322
|
+
[x + depth, y - depth],
|
|
323
|
+
[x + w + depth, y - depth],
|
|
324
|
+
[x + w, y]
|
|
325
|
+
]),
|
|
326
|
+
fill,
|
|
327
|
+
opacity: .5,
|
|
328
|
+
stroke: theme.surface,
|
|
329
|
+
strokeWidth: 1
|
|
330
|
+
});
|
|
331
|
+
shapes.push({
|
|
332
|
+
key: `${element.id}/side`,
|
|
333
|
+
d: SoftwareShapes.polygon([
|
|
334
|
+
[x + w, y],
|
|
335
|
+
[x + w + depth, y - depth],
|
|
336
|
+
[x + w + depth, y + h - depth],
|
|
337
|
+
[x + w, y + h]
|
|
338
|
+
]),
|
|
339
|
+
fill,
|
|
340
|
+
opacity: .8,
|
|
341
|
+
stroke: theme.surface,
|
|
342
|
+
strokeWidth: 1
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
shapes.push({
|
|
346
|
+
...main,
|
|
347
|
+
d: SoftwareShapes.rect(x, y, w, h),
|
|
348
|
+
fill,
|
|
349
|
+
opacity: .2,
|
|
350
|
+
stroke: theme.surface,
|
|
351
|
+
strokeWidth: 1,
|
|
352
|
+
tip
|
|
353
|
+
});
|
|
354
|
+
const stereotype = STEREOTYPE[element.kind], base = y + (stereotype ? 30 : 22);
|
|
355
|
+
if (stereotype) labels.push({
|
|
356
|
+
key: `${element.id}/kind`,
|
|
357
|
+
x: x + w / 2,
|
|
358
|
+
y: y + 12,
|
|
359
|
+
text: stereotype,
|
|
360
|
+
anchor: "middle",
|
|
361
|
+
size: 9,
|
|
362
|
+
fill: theme.inkSecondary
|
|
363
|
+
});
|
|
364
|
+
labels.push({
|
|
365
|
+
key: element.id,
|
|
366
|
+
x: x + w / 2,
|
|
367
|
+
y: base - 6,
|
|
368
|
+
text: title,
|
|
369
|
+
anchor: "middle",
|
|
370
|
+
size: 11,
|
|
371
|
+
weight: 600
|
|
372
|
+
});
|
|
373
|
+
names.forEach((name, i) => labels.push({
|
|
374
|
+
key: `${element.id}/${i}`,
|
|
375
|
+
x: x + w / 2,
|
|
376
|
+
y: base + 8 + i * LEAD,
|
|
377
|
+
text: name,
|
|
378
|
+
anchor: "middle",
|
|
379
|
+
size: 10
|
|
380
|
+
}));
|
|
381
|
+
}
|
|
382
|
+
const marks = [];
|
|
383
|
+
for (const [level, area] of plan.areas) {
|
|
384
|
+
const own = plan.runs.filter((run) => run.level === level), placer = new SoftwarePlacer(area);
|
|
385
|
+
for (const block of plan.blocks) {
|
|
386
|
+
if (block.level !== level) continue;
|
|
387
|
+
const lift = block.symbol ? 0 : depth;
|
|
388
|
+
placer.block({
|
|
389
|
+
x0: block.x - 2,
|
|
390
|
+
y0: block.y - lift - 2,
|
|
391
|
+
x1: block.x + block.width + lift + 2,
|
|
392
|
+
y1: block.y + block.height + 2
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
for (const run of own) placer.avoid(run.wire.points);
|
|
396
|
+
marks.push(...this.wireLabels(placer, own.map((run) => run.wire), (i) => words[own[i].link]).map((mark) => ({
|
|
397
|
+
...mark,
|
|
398
|
+
key: `${level}/${mark.key}`
|
|
399
|
+
})));
|
|
400
|
+
}
|
|
401
|
+
const wires = plan.runs.map(({ key, link, wire }) => {
|
|
402
|
+
const arc = graph.arcs[link];
|
|
403
|
+
return {
|
|
404
|
+
key,
|
|
405
|
+
raw: arc.raw,
|
|
406
|
+
d: wire.d,
|
|
407
|
+
tip: {
|
|
408
|
+
title: `${elements.get(arc.source).label} ↔ ${elements.get(arc.target).label}`,
|
|
409
|
+
rows: words[link] ? [["Protocol", words[link]]] : []
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
});
|
|
413
|
+
this.paths(stage, ctx, "nodes", shapes);
|
|
414
|
+
this.wires(stage, ctx, wires);
|
|
415
|
+
this.texts(stage, ctx, "node-text", labels);
|
|
416
|
+
this.texts(stage, ctx, "wire-text", marks);
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
export { DeploymentDiagram };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SampleData } from "../../data/SampleData.js";
|
|
2
|
-
import { ActivityNodeKind, BpmnFlowKind, BpmnNodeKind, DataFlowKind, NassiKind, PetriNodeKind, UseCaseLinkKind, UseCaseNodeKind } from "./softwareEnums.js";
|
|
2
|
+
import { ActivityNodeKind, BpmnFlowKind, BpmnNodeKind, ComponentLinkKind, ComponentNodeKind, DataFlowKind, DeploymentKind, NassiKind, PetriNodeKind, UseCaseLinkKind, UseCaseNodeKind } from "./softwareEnums.js";
|
|
3
3
|
// src/charts/softwarediagrams/SoftwareSamples.ts
|
|
4
4
|
var { Start, End, Action, Decision, Fork, Join } = ActivityNodeKind;
|
|
5
5
|
var pick = (list, u) => list[Math.floor(u() * list.length)];
|
|
@@ -1074,5 +1074,287 @@ var SoftwareSamples = class {
|
|
|
1074
1074
|
count: Math.round(5 + u() * 90)
|
|
1075
1075
|
}));
|
|
1076
1076
|
}
|
|
1077
|
+
/**
|
|
1078
|
+
* A shop as UML components: `{ id, label, kind, package }` components and interfaces, and `{ source, target, kind, label }` links
|
|
1079
|
+
* that say which component provides or requires which interface, plus one plain dependency. One interface is required and provided by nobody.
|
|
1080
|
+
*/
|
|
1081
|
+
static components(seed) {
|
|
1082
|
+
const { u } = SampleData.rng(seed), { Component, Interface } = ComponentNodeKind, { Provides, Requires, Dependency } = ComponentLinkKind;
|
|
1083
|
+
const front = pick([
|
|
1084
|
+
"Web shop",
|
|
1085
|
+
"Mobile app",
|
|
1086
|
+
"Kiosk"
|
|
1087
|
+
], u), gateway = pick([
|
|
1088
|
+
"CardGateway",
|
|
1089
|
+
"BankTransfer",
|
|
1090
|
+
"Wallet"
|
|
1091
|
+
], u), used = pick(["catalogue", "billing"], u);
|
|
1092
|
+
const web = {
|
|
1093
|
+
kind: Component,
|
|
1094
|
+
package: "Front end"
|
|
1095
|
+
}, services = {
|
|
1096
|
+
kind: Component,
|
|
1097
|
+
package: "Services"
|
|
1098
|
+
}, data = {
|
|
1099
|
+
kind: Component,
|
|
1100
|
+
package: "Data"
|
|
1101
|
+
};
|
|
1102
|
+
return {
|
|
1103
|
+
nodes: [
|
|
1104
|
+
{
|
|
1105
|
+
id: "shop",
|
|
1106
|
+
label: front,
|
|
1107
|
+
...web
|
|
1108
|
+
},
|
|
1109
|
+
{
|
|
1110
|
+
id: "admin",
|
|
1111
|
+
label: "Admin console",
|
|
1112
|
+
...web
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
id: "orders",
|
|
1116
|
+
label: "Order service",
|
|
1117
|
+
...services
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
id: "catalogue",
|
|
1121
|
+
label: "Catalogue",
|
|
1122
|
+
...services
|
|
1123
|
+
},
|
|
1124
|
+
{
|
|
1125
|
+
id: "billing",
|
|
1126
|
+
label: "Billing",
|
|
1127
|
+
...services
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
id: "store",
|
|
1131
|
+
label: "Order store",
|
|
1132
|
+
...data
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
id: "index",
|
|
1136
|
+
label: "Search index",
|
|
1137
|
+
...data
|
|
1138
|
+
},
|
|
1139
|
+
...[
|
|
1140
|
+
"Orders",
|
|
1141
|
+
"Products",
|
|
1142
|
+
"Payments",
|
|
1143
|
+
"Persistence",
|
|
1144
|
+
"Search",
|
|
1145
|
+
gateway
|
|
1146
|
+
].map((id) => ({
|
|
1147
|
+
id,
|
|
1148
|
+
kind: Interface
|
|
1149
|
+
}))
|
|
1150
|
+
],
|
|
1151
|
+
links: [
|
|
1152
|
+
{
|
|
1153
|
+
source: "orders",
|
|
1154
|
+
target: "Orders",
|
|
1155
|
+
kind: Provides
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
source: "shop",
|
|
1159
|
+
target: "Orders",
|
|
1160
|
+
kind: Requires
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
source: "admin",
|
|
1164
|
+
target: "Orders",
|
|
1165
|
+
kind: Requires
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
source: "catalogue",
|
|
1169
|
+
target: "Products",
|
|
1170
|
+
kind: Provides
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
source: "shop",
|
|
1174
|
+
target: "Products",
|
|
1175
|
+
kind: Requires
|
|
1176
|
+
},
|
|
1177
|
+
{
|
|
1178
|
+
source: "billing",
|
|
1179
|
+
target: "Payments",
|
|
1180
|
+
kind: Provides
|
|
1181
|
+
},
|
|
1182
|
+
{
|
|
1183
|
+
source: "orders",
|
|
1184
|
+
target: "Payments",
|
|
1185
|
+
kind: Requires
|
|
1186
|
+
},
|
|
1187
|
+
{
|
|
1188
|
+
source: "store",
|
|
1189
|
+
target: "Persistence",
|
|
1190
|
+
kind: Provides
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
source: "orders",
|
|
1194
|
+
target: "Persistence",
|
|
1195
|
+
kind: Requires
|
|
1196
|
+
},
|
|
1197
|
+
{
|
|
1198
|
+
source: "index",
|
|
1199
|
+
target: "Search",
|
|
1200
|
+
kind: Provides
|
|
1201
|
+
},
|
|
1202
|
+
{
|
|
1203
|
+
source: "catalogue",
|
|
1204
|
+
target: "Search",
|
|
1205
|
+
kind: Requires
|
|
1206
|
+
},
|
|
1207
|
+
{
|
|
1208
|
+
source: "billing",
|
|
1209
|
+
target: gateway,
|
|
1210
|
+
kind: Requires
|
|
1211
|
+
},
|
|
1212
|
+
{
|
|
1213
|
+
source: "admin",
|
|
1214
|
+
target: used,
|
|
1215
|
+
kind: Dependency,
|
|
1216
|
+
label: "«use»"
|
|
1217
|
+
}
|
|
1218
|
+
]
|
|
1219
|
+
};
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* Where a shop runs, as a UML deployment: `{ id, label, kind, parent }` devices, execution environments and artifacts, nested
|
|
1223
|
+
* by `parent`, and `{ source, target, protocol }` communication paths.
|
|
1224
|
+
*/
|
|
1225
|
+
static deployment(seed) {
|
|
1226
|
+
const { u } = SampleData.rng(seed), { Device, Environment, Artifact } = DeploymentKind;
|
|
1227
|
+
const client = pick([
|
|
1228
|
+
["Customer phone", "shop.apk"],
|
|
1229
|
+
["Till", "till.exe"],
|
|
1230
|
+
["Customer laptop", "shop.js"]
|
|
1231
|
+
], u), wire = pick([
|
|
1232
|
+
"JDBC",
|
|
1233
|
+
"TCP/IP",
|
|
1234
|
+
"TLS"
|
|
1235
|
+
], u);
|
|
1236
|
+
const extra = pick([
|
|
1237
|
+
[
|
|
1238
|
+
"Payment host",
|
|
1239
|
+
"gateway.war",
|
|
1240
|
+
"HTTPS"
|
|
1241
|
+
],
|
|
1242
|
+
[
|
|
1243
|
+
"Mail relay",
|
|
1244
|
+
"relay.conf",
|
|
1245
|
+
"SMTP"
|
|
1246
|
+
],
|
|
1247
|
+
[
|
|
1248
|
+
"Report server",
|
|
1249
|
+
"reports.jar",
|
|
1250
|
+
"gRPC"
|
|
1251
|
+
]
|
|
1252
|
+
], u);
|
|
1253
|
+
return {
|
|
1254
|
+
nodes: [
|
|
1255
|
+
{
|
|
1256
|
+
id: "client",
|
|
1257
|
+
label: client[0],
|
|
1258
|
+
kind: Device
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
id: "client-app",
|
|
1262
|
+
label: client[1],
|
|
1263
|
+
kind: Artifact,
|
|
1264
|
+
parent: "client"
|
|
1265
|
+
},
|
|
1266
|
+
{
|
|
1267
|
+
id: "web",
|
|
1268
|
+
label: "Web server",
|
|
1269
|
+
kind: Device
|
|
1270
|
+
},
|
|
1271
|
+
{
|
|
1272
|
+
id: "site",
|
|
1273
|
+
label: "site.conf",
|
|
1274
|
+
kind: Artifact,
|
|
1275
|
+
parent: "web"
|
|
1276
|
+
},
|
|
1277
|
+
{
|
|
1278
|
+
id: "assets",
|
|
1279
|
+
label: "assets.zip",
|
|
1280
|
+
kind: Artifact,
|
|
1281
|
+
parent: "web"
|
|
1282
|
+
},
|
|
1283
|
+
{
|
|
1284
|
+
id: "app",
|
|
1285
|
+
label: "Application server",
|
|
1286
|
+
kind: Device
|
|
1287
|
+
},
|
|
1288
|
+
{
|
|
1289
|
+
id: "runtime",
|
|
1290
|
+
label: "Servlet container",
|
|
1291
|
+
kind: Environment,
|
|
1292
|
+
parent: "app"
|
|
1293
|
+
},
|
|
1294
|
+
{
|
|
1295
|
+
id: "orders",
|
|
1296
|
+
label: "orders.war",
|
|
1297
|
+
kind: Artifact,
|
|
1298
|
+
parent: "runtime"
|
|
1299
|
+
},
|
|
1300
|
+
{
|
|
1301
|
+
id: "billing",
|
|
1302
|
+
label: "billing.war",
|
|
1303
|
+
kind: Artifact,
|
|
1304
|
+
parent: "runtime"
|
|
1305
|
+
},
|
|
1306
|
+
{
|
|
1307
|
+
id: "db",
|
|
1308
|
+
label: "Database server",
|
|
1309
|
+
kind: Device
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
id: "dbms",
|
|
1313
|
+
label: "SQL database",
|
|
1314
|
+
kind: Environment,
|
|
1315
|
+
parent: "db"
|
|
1316
|
+
},
|
|
1317
|
+
{
|
|
1318
|
+
id: "schema",
|
|
1319
|
+
label: "schema.sql",
|
|
1320
|
+
kind: Artifact,
|
|
1321
|
+
parent: "dbms"
|
|
1322
|
+
},
|
|
1323
|
+
{
|
|
1324
|
+
id: "extra",
|
|
1325
|
+
label: extra[0],
|
|
1326
|
+
kind: Device
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
id: "extra-app",
|
|
1330
|
+
label: extra[1],
|
|
1331
|
+
kind: Artifact,
|
|
1332
|
+
parent: "extra"
|
|
1333
|
+
}
|
|
1334
|
+
],
|
|
1335
|
+
links: [
|
|
1336
|
+
{
|
|
1337
|
+
source: "client",
|
|
1338
|
+
target: "web",
|
|
1339
|
+
protocol: "HTTPS"
|
|
1340
|
+
},
|
|
1341
|
+
{
|
|
1342
|
+
source: "web",
|
|
1343
|
+
target: "app",
|
|
1344
|
+
protocol: "HTTP"
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
source: "app",
|
|
1348
|
+
target: "db",
|
|
1349
|
+
protocol: wire
|
|
1350
|
+
},
|
|
1351
|
+
{
|
|
1352
|
+
source: "app",
|
|
1353
|
+
target: "extra",
|
|
1354
|
+
protocol: extra[2]
|
|
1355
|
+
}
|
|
1356
|
+
]
|
|
1357
|
+
};
|
|
1358
|
+
}
|
|
1077
1359
|
};
|
|
1078
1360
|
export { SoftwareSamples };
|