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
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15; var _class16;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15; var _class16;
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var _chunkUXFWDEP6cjs = require('./chunk-UXFWDEP6.cjs');
|
|
5
4
|
|
|
6
5
|
|
|
7
|
-
var
|
|
6
|
+
var _chunkM4IQ5LIZcjs = require('./chunk-M4IQ5LIZ.cjs');
|
|
8
7
|
|
|
9
8
|
|
|
10
|
-
var _chunkEEF5WRRZcjs = require('./chunk-EEF5WRRZ.cjs');
|
|
11
9
|
|
|
10
|
+
var _chunkUXFWDEP6cjs = require('./chunk-UXFWDEP6.cjs');
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
|
|
13
|
+
var _chunkAL4XQZH6cjs = require('./chunk-AL4XQZH6.cjs');
|
|
14
14
|
|
|
15
15
|
// src/charts/reliabilitycharts/AllanVariance.ts
|
|
16
16
|
var AllanEstimator = /* @__PURE__ */ ((AllanEstimator2) => {
|
|
@@ -83,211 +83,6 @@ var AllanVariance = class _AllanVariance {
|
|
|
83
83
|
|
|
84
84
|
// src/charts/reliabilitycharts/AllanDeviationPlot.ts
|
|
85
85
|
var _d3 = require('d3');
|
|
86
|
-
|
|
87
|
-
// src/charts/reliabilitycharts/ReliabilitySamples.ts
|
|
88
|
-
var sig = (value, digits = 2) => +value.toPrecision(digits);
|
|
89
|
-
var ReliabilitySamples = class {
|
|
90
|
-
/** A cooling-water fault tree: `{ id, parent, label, gate, probability }`, with a probability on each basic event. */
|
|
91
|
-
static faultTree(seed) {
|
|
92
|
-
const { u } = _chunkUMEKIIHJcjs.SampleData.rng(seed);
|
|
93
|
-
const p = (base) => sig(base * (0.6 + 0.8 * u()));
|
|
94
|
-
const event = (id, parent, label2, base) => ({ id, parent, label: label2, gate: null, probability: p(base) });
|
|
95
|
-
const gate = (id, parent, label2, kind) => ({ id, parent, label: label2, gate: kind, probability: null });
|
|
96
|
-
return [
|
|
97
|
-
gate("TOP", null, "No cooling water flow", "or"),
|
|
98
|
-
gate("G1", "TOP", "Both pumps fail", "and"),
|
|
99
|
-
event("E1", "G1", "Pump A fails", 0.04),
|
|
100
|
-
event("E2", "G1", "Pump B fails", 0.05),
|
|
101
|
-
event("E3", "TOP", "Suction valve shut", 2e-3),
|
|
102
|
-
gate("G2", "TOP", "No power", "and"),
|
|
103
|
-
event("E4", "G2", "Mains supply lost", 0.02),
|
|
104
|
-
event("E5", "G2", "Generator fails to start", 0.06),
|
|
105
|
-
...seed % 2 ? [] : [event("E6", "TOP", "Strainer blocked", 4e-3)]
|
|
106
|
-
];
|
|
107
|
-
}
|
|
108
|
-
/** A gas-leak event tree: `{ id, parent, system, branch, probability, outcome }`. The first row is the leak and its frequency per year. */
|
|
109
|
-
static eventTree(seed) {
|
|
110
|
-
const { u } = _chunkUMEKIIHJcjs.SampleData.rng(seed);
|
|
111
|
-
const works = (base) => sig(Math.min(0.995, base + 0.04 * (u() - 0.5)), 3);
|
|
112
|
-
const pair = (id, parent, system, success, outcomes) => [
|
|
113
|
-
{ id: `${id}1`, parent, system, branch: "success", probability: success, outcome: outcomes[0] },
|
|
114
|
-
{ id: `${id}0`, parent, system, branch: "failure", probability: sig(1 - success, 3), outcome: outcomes[1] }
|
|
115
|
-
];
|
|
116
|
-
return [
|
|
117
|
-
{ id: "IE", parent: null, system: "Gas leak", branch: null, probability: sig(0.05 + 0.1 * u()), outcome: null },
|
|
118
|
-
...pair("D", "IE", "Detection", works(0.95), [null, null]),
|
|
119
|
-
...pair("S", "D1", "Isolation", works(0.9), ["Safe shutdown", null]),
|
|
120
|
-
...pair("N", "S0", "No ignition", works(0.8), ["Gas cloud", "Jet fire"]),
|
|
121
|
-
...pair("M", "D0", "No ignition", works(0.7), ["Gas cloud", "Explosion"])
|
|
122
|
-
];
|
|
123
|
-
}
|
|
124
|
-
/** A loss-of-containment bow-tie: `{ side, path, barrier }`, one row per barrier, plus the event and hazard rows. */
|
|
125
|
-
static bowTie(seed) {
|
|
126
|
-
const { u } = _chunkUMEKIIHJcjs.SampleData.rng(seed);
|
|
127
|
-
const lanes = (side, list) => list.flatMap(([path, barriers]) => barriers.slice(0, 1 + Math.floor(u() * barriers.length)).map((barrier) => ({ side, path, barrier })));
|
|
128
|
-
return [
|
|
129
|
-
{ side: "hazard", path: "LPG storage", barrier: null },
|
|
130
|
-
{ side: "event", path: "Loss of containment", barrier: null },
|
|
131
|
-
...lanes("threat", [["Corrosion", ["Coating", "Inspection"]], ["Overpressure", ["Relief valve", "Pressure trip"]], ["Vehicle impact", ["Crash barrier"]], ["Operator error", ["Procedure", "Interlock"]]]),
|
|
132
|
-
...lanes("consequence", [["Fire", ["Gas detection", "Deluge"]], ["Explosion", ["Ignition control", "Blast wall"]], ["Injury", ["Evacuation"]], ["Spill to ground", ["Bund"]]])
|
|
133
|
-
];
|
|
134
|
-
}
|
|
135
|
-
/** A pumping system as stages in series: `{ block, stage, branch, reliability }`. Blocks sharing a stage are redundant unless they share a branch. */
|
|
136
|
-
static blocks(seed) {
|
|
137
|
-
const { u } = _chunkUMEKIIHJcjs.SampleData.rng(seed);
|
|
138
|
-
const r = (base) => sig(1 - (1 - base) * (0.5 + u()), 3);
|
|
139
|
-
return [
|
|
140
|
-
{ block: "Supply", stage: "Power", branch: null, reliability: r(0.995) },
|
|
141
|
-
{ block: "Pump A", stage: "Pumping", branch: "A", reliability: r(0.93) },
|
|
142
|
-
{ block: "Pump B", stage: "Pumping", branch: "B", reliability: r(0.93) },
|
|
143
|
-
...seed % 2 ? [] : [{ block: "Pump C", stage: "Pumping", branch: "C", reliability: r(0.9) }],
|
|
144
|
-
{ block: "PLC", stage: "Control", branch: null, reliability: r(0.99) },
|
|
145
|
-
{ block: "Valve 1", stage: "Delivery", branch: "Line 1", reliability: r(0.97) },
|
|
146
|
-
{ block: "Filter", stage: "Delivery", branch: "Line 1", reliability: r(0.98) },
|
|
147
|
-
{ block: "Valve 2", stage: "Delivery", branch: "Line 2", reliability: r(0.95) }
|
|
148
|
-
];
|
|
149
|
-
}
|
|
150
|
-
/** 4,096 samples of a rate gyro at rest, 100 Hz: `{ time, rate }` in seconds and °/s, made of white noise, a flicker floor and a slow random walk. */
|
|
151
|
-
static gyro(seed) {
|
|
152
|
-
const { n: n12 } = _chunkUMEKIIHJcjs.SampleData.rng(seed);
|
|
153
|
-
const white = 0.02, flicker = 35e-4, walk = 5e-4;
|
|
154
|
-
const poles = [4, 16, 64, 256, 1024].map((samples) => Math.exp(-1 / samples)), states = poles.map(() => 0);
|
|
155
|
-
let wander = 0;
|
|
156
|
-
return Array.from({ length: 4096 }, (_, i) => {
|
|
157
|
-
poles.forEach((pole, k) => {
|
|
158
|
-
states[k] = pole * states[k] + Math.sqrt(1 - pole * pole) * n12();
|
|
159
|
-
});
|
|
160
|
-
wander += walk * n12();
|
|
161
|
-
return { time: +(i * 0.01).toFixed(2), rate: +(white * n12() + flicker * states.reduce((sum, value) => sum + value, 0) + wander).toFixed(5) };
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
/** A supply voltage against clock frequency sweep of one device: `{ voltage, frequency, pass }` in volts and GHz, with one stray failure inside the passing region. */
|
|
165
|
-
static shmoo(seed) {
|
|
166
|
-
const { u } = _chunkUMEKIIHJcjs.SampleData.rng(seed);
|
|
167
|
-
const knee = 0.6 + 0.06 * u(), gain = 3.3 + 0.5 * u(), hole = [3 + Math.floor(u() * 5), 1 + Math.floor(u() * 3)];
|
|
168
|
-
return Array.from({ length: 11 }, (_, i) => Array.from({ length: 10 }, (_2, j) => {
|
|
169
|
-
const voltage = +(0.8 + i * 0.04).toFixed(2), frequency = +(1 + j * 0.2).toFixed(1);
|
|
170
|
-
const limit = gain * Math.max(0, voltage - knee) ** 0.75 * (1 + 0.04 * (u() - 0.5));
|
|
171
|
-
return { voltage, frequency, pass: frequency <= limit && !(i === hole[0] + 3 && j === hole[1]) ? 1 : 0 };
|
|
172
|
-
})).flat();
|
|
173
|
-
}
|
|
174
|
-
/** Probe results for one wafer: `{ x, y, bin, value }` with die indices from 1, a test bin, and threshold voltage in volts. Yield falls toward the edge and around one defect cluster. */
|
|
175
|
-
static wafer(seed) {
|
|
176
|
-
const { u, n: n12 } = _chunkUMEKIIHJcjs.SampleData.rng(seed);
|
|
177
|
-
const across = 19, centre = (across + 1) / 2, radius = across / 2;
|
|
178
|
-
const angle = u() * 2 * Math.PI, spot = [centre + Math.cos(angle) * radius * 0.5, centre + Math.sin(angle) * radius * 0.5], tilt = (u() - 0.5) * 4e-3;
|
|
179
|
-
const rows = [];
|
|
180
|
-
for (let y = 1; y <= across; y++) for (let x = 1; x <= across; x++) {
|
|
181
|
-
const reach = Math.hypot(Math.abs(x - centre) + 0.5, Math.abs(y - centre) + 0.5) / radius;
|
|
182
|
-
if (reach > 1) continue;
|
|
183
|
-
const near = Math.hypot(x - spot[0], y - spot[1]), draw = u();
|
|
184
|
-
const bin = near < 1.8 && draw < 0.8 ? "Short" : draw < 0.03 + 0.4 * reach ** 5 ? u() < 0.6 ? "Leakage" : "Open" : draw > 0.975 ? "Slow" : "Pass";
|
|
185
|
-
rows.push({ x, y, bin, value: +(0.45 + 0.035 * reach * reach + tilt * (x - centre) + 6e-3 * n12()).toFixed(4) });
|
|
186
|
-
}
|
|
187
|
-
return rows;
|
|
188
|
-
}
|
|
189
|
-
/** A bathtub scan of a serial receiver: `{ position, ber }` across one unit interval, from a dual-Dirac jitter model, measured down to 1e-10. */
|
|
190
|
-
static jitterScan(seed) {
|
|
191
|
-
const { u, n: n12 } = _chunkUMEKIIHJcjs.SampleData.rng(seed);
|
|
192
|
-
const sigma = 0.018 + 8e-3 * u(), spread = 0.1 + 0.06 * u();
|
|
193
|
-
const wall = (x) => 0.25 * (_chunkAL4XQZH6cjs.StatMath.normalCdf(-(x - spread / 2) / sigma) + _chunkAL4XQZH6cjs.StatMath.normalCdf(-(x + spread / 2) / sigma));
|
|
194
|
-
return Array.from({ length: 41 }, (_, i) => i / 40).flatMap((position) => {
|
|
195
|
-
const ber = (wall(position) + wall(1 - position)) * Math.exp(0.2 * n12());
|
|
196
|
-
return ber < 1e-10 ? [] : [{ position: +position.toFixed(3), ber: +Math.min(0.5, ber).toExponential(3) }];
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
/** A feed and reaction unit: equipment and instruments as `nodes` (`{ id, kind, label }`), process and signal lines as `links` (`{ source, target, line }`). */
|
|
200
|
-
static processUnit(seed) {
|
|
201
|
-
const unit = 100 * (1 + seed % 4), tag = (letters, offset = 1) => `${letters}-${unit + offset}`;
|
|
202
|
-
const spare = seed % 2 === 1;
|
|
203
|
-
const nodes = [
|
|
204
|
-
{ id: "tank", kind: "tank", label: tag("T") },
|
|
205
|
-
{ id: "pumpA", kind: "pump", label: `${tag("P")}A` },
|
|
206
|
-
...spare ? [{ id: "pumpB", kind: "pump", label: `${tag("P")}B` }] : [],
|
|
207
|
-
{ id: "fv", kind: "control-valve", label: tag("FV") },
|
|
208
|
-
{ id: "heater", kind: "exchanger", label: tag("E") },
|
|
209
|
-
{ id: "reactor", kind: "vessel", label: tag("R") },
|
|
210
|
-
{ id: "outlet", kind: "valve", label: tag("HV", 2) },
|
|
211
|
-
{ id: "ft", kind: "instrument", label: tag("FT") },
|
|
212
|
-
{ id: "fic", kind: "instrument", label: tag("FIC") },
|
|
213
|
-
{ id: "tt", kind: "instrument", label: tag("TT", 2) },
|
|
214
|
-
{ id: "tic", kind: "instrument", label: tag("TIC", 2) }
|
|
215
|
-
];
|
|
216
|
-
const pipe = (source, target) => ({ source, target, line: "process" }), wire = (source, target) => ({ source, target, line: "signal" });
|
|
217
|
-
const links = [
|
|
218
|
-
pipe("tank", "pumpA"),
|
|
219
|
-
pipe("pumpA", "fv"),
|
|
220
|
-
...spare ? [pipe("tank", "pumpB"), pipe("pumpB", "fv")] : [],
|
|
221
|
-
pipe("fv", "heater"),
|
|
222
|
-
pipe("heater", "reactor"),
|
|
223
|
-
pipe("reactor", "outlet"),
|
|
224
|
-
pipe("reactor", "tank"),
|
|
225
|
-
wire("pumpA", "ft"),
|
|
226
|
-
wire("ft", "fic"),
|
|
227
|
-
wire("fic", "fv"),
|
|
228
|
-
wire("reactor", "tt"),
|
|
229
|
-
wire("tt", "tic"),
|
|
230
|
-
wire("tic", "heater")
|
|
231
|
-
];
|
|
232
|
-
return { nodes, links };
|
|
233
|
-
}
|
|
234
|
-
/** A small plant network: `{ id, kind, from, label, rating, voltage }`, fed from a grid infeed through one transformer to a bus with four feeders. */
|
|
235
|
-
static powerNetwork(seed) {
|
|
236
|
-
const { u } = _chunkUMEKIIHJcjs.SampleData.rng(seed);
|
|
237
|
-
const pick = (list) => list[Math.floor(u() * list.length)];
|
|
238
|
-
const high = "33 kV", medium = "11 kV";
|
|
239
|
-
return [
|
|
240
|
-
{ id: "GRID", kind: "source", from: null, label: "Grid", rating: `${pick([500, 750, 1e3])} MVA`, voltage: high },
|
|
241
|
-
{ id: "CB1", kind: "breaker", from: "GRID", label: "CB1", rating: "1250 A", voltage: high },
|
|
242
|
-
{ id: "T1", kind: "transformer", from: "CB1", label: "T1", rating: `${pick([10, 16, 20])} MVA`, voltage: medium },
|
|
243
|
-
{ id: "BUS", kind: "bus", from: "T1", label: "Main bus", rating: null, voltage: medium },
|
|
244
|
-
{ id: "CB2", kind: "breaker", from: "BUS", label: "CB2", rating: "630 A", voltage: medium },
|
|
245
|
-
{ id: "M1", kind: "motor", from: "CB2", label: "Pump M1", rating: `${pick([0.8, 1.2, 1.6])} MW`, voltage: medium },
|
|
246
|
-
{ id: "CB3", kind: "breaker", from: "BUS", label: "CB3", rating: "630 A", voltage: medium },
|
|
247
|
-
{ id: "G1", kind: "generator", from: "CB3", label: "Standby", rating: `${pick([2, 2.5, 3])} MVA`, voltage: medium },
|
|
248
|
-
{ id: "Q1", kind: "switch", from: "BUS", label: "Q1", rating: "400 A", voltage: medium },
|
|
249
|
-
{ id: "L1", kind: "load", from: "Q1", label: "Process", rating: `${pick([1.5, 2, 2.4])} MW`, voltage: medium },
|
|
250
|
-
{ id: "F1", kind: "fuse", from: "BUS", label: "F1", rating: "63 A", voltage: medium },
|
|
251
|
-
{ id: "L2", kind: "load", from: "F1", label: "Lighting", rating: `${pick([120, 160, 200])} kW`, voltage: medium }
|
|
252
|
-
];
|
|
253
|
-
}
|
|
254
|
-
/** A motor starter in ladder logic: `{ rung, step, kind, tag, state, preset, comment }`. The seed sets which inputs are on. */
|
|
255
|
-
static ladder(seed) {
|
|
256
|
-
const running = seed % 3 !== 0 ? 1 : 0, timed = seed % 2 === 0 && running ? 1 : 0;
|
|
257
|
-
const contact = (rung, step, kind, tag, state, comment = null) => ({ rung, step, kind, tag, state, preset: null, comment });
|
|
258
|
-
return [
|
|
259
|
-
contact(1, 1, "nc", "Stop", 0, "Motor start and stop with seal-in"),
|
|
260
|
-
contact(1, 2, "no", "Start", 0),
|
|
261
|
-
contact(1, 2, "no", "M1", running),
|
|
262
|
-
contact(1, 3, "nc", "OL1", 0),
|
|
263
|
-
{ rung: 1, step: 4, kind: "coil", tag: "M1", state: null, preset: null, comment: null },
|
|
264
|
-
contact(2, 1, "no", "M1", running, "Run-up delay"),
|
|
265
|
-
{ rung: 2, step: 2, kind: "timer", tag: "T1", state: null, preset: `${3 + seed % 4} s`, comment: null },
|
|
266
|
-
contact(3, 1, "no", "T1", timed, "Open discharge valve"),
|
|
267
|
-
contact(3, 2, "nc", "LSH", 0),
|
|
268
|
-
{ rung: 3, step: 3, kind: "coil", tag: "V1", state: null, preset: null, comment: null }
|
|
269
|
-
];
|
|
270
|
-
}
|
|
271
|
-
/** A single feedback loop with a disturbance: `nodes` (`{ id, kind, label }`) and `links` (`{ source, target, sign }`). */
|
|
272
|
-
static controlLoop(seed) {
|
|
273
|
-
const { u } = _chunkUMEKIIHJcjs.SampleData.rng(seed);
|
|
274
|
-
const whole = (low, high) => low + Math.floor(u() * (high - low + 1));
|
|
275
|
-
const nodes = [
|
|
276
|
-
{ id: "r", kind: "input", label: "R(s)" },
|
|
277
|
-
{ id: "e", kind: "sum", label: "" },
|
|
278
|
-
{ id: "c", kind: "block", label: `${whole(2, 9)}(s+${whole(1, 4)})/s` },
|
|
279
|
-
{ id: "u", kind: "sum", label: "" },
|
|
280
|
-
{ id: "g", kind: "block", label: `${whole(1, 6)}/(s+${whole(2, 9)})` },
|
|
281
|
-
{ id: "y", kind: "output", label: "Y(s)" },
|
|
282
|
-
{ id: "h", kind: "block", label: `1/(0.${whole(1, 5)}s+1)` },
|
|
283
|
-
{ id: "d", kind: "input", label: "D(s)" }
|
|
284
|
-
];
|
|
285
|
-
const link = (source, target, sign = null) => ({ source, target, sign });
|
|
286
|
-
return { nodes, links: [link("r", "e", "+"), link("e", "c"), link("c", "u", "+"), link("d", "u", "+"), link("u", "g"), link("g", "y"), link("g", "h"), link("h", "e", "-")] };
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
// src/charts/reliabilitycharts/AllanDeviationPlot.ts
|
|
291
86
|
var NOISE = /* @__PURE__ */ new Map([
|
|
292
87
|
[-1, ["Quantisation", "\u22121"]],
|
|
293
88
|
[-0.5, ["White noise", "\u2212\xBD"]],
|
|
@@ -304,7 +99,7 @@ var AllanDeviationPlot = (_class = class extends _chunkUXFWDEP6cjs.StatisticalCh
|
|
|
304
99
|
shape: "table" /* Table */,
|
|
305
100
|
description: "Computes Allan deviation from a sampled rate record and plots it against averaging time on log-log axes, marking the noise type each slope shows. The sample gyro record is invented.",
|
|
306
101
|
tags: ["allan variance", "adev", "stability", "gyro", "clock", "noise", "bias instability", "random walk"],
|
|
307
|
-
sample: (seed) => ReliabilitySamples.gyro(seed),
|
|
102
|
+
sample: (seed) => _chunkM4IQ5LIZcjs.ReliabilitySamples.gyro(seed),
|
|
308
103
|
variants: {
|
|
309
104
|
estimator: Object.values(AllanEstimator),
|
|
310
105
|
regions: [true, false],
|
|
@@ -382,79 +177,6 @@ var AllanDeviationPlot = (_class = class extends _chunkUXFWDEP6cjs.StatisticalCh
|
|
|
382
177
|
}
|
|
383
178
|
}, _class.__initStatic(), _class);
|
|
384
179
|
|
|
385
|
-
// src/charts/reliabilitycharts/SchematicChart.ts
|
|
386
|
-
var SchematicChart = class extends _chunkEEF5WRRZcjs.Chart2D {
|
|
387
|
-
plotMargin() {
|
|
388
|
-
return { top: 8, right: 12, bottom: 8, left: 12 };
|
|
389
|
-
}
|
|
390
|
-
rows() {
|
|
391
|
-
const { data } = this.options;
|
|
392
|
-
return (Array.isArray(data) ? data : []).filter((row) => row !== null && typeof row === "object");
|
|
393
|
-
}
|
|
394
|
-
static word(cell) {
|
|
395
|
-
return cell === null || cell === void 0 ? "" : String(cell).trim();
|
|
396
|
-
}
|
|
397
|
-
static number(cell) {
|
|
398
|
-
if (cell === null || cell === void 0 || cell === "" || typeof cell === "boolean") return null;
|
|
399
|
-
const value = +cell;
|
|
400
|
-
return Number.isFinite(value) ? value : null;
|
|
401
|
-
}
|
|
402
|
-
/** A filled triangle with its tip at `x, y`, pointing along `angle` in degrees (0 is right, 90 is down). */
|
|
403
|
-
static arrow(x, y, angle, size = 7) {
|
|
404
|
-
const turn = angle * Math.PI / 180, cos = Math.cos(turn), sin = Math.sin(turn), half = size * 0.45;
|
|
405
|
-
const at = (along, across) => `${+(x + along * cos - across * sin).toFixed(2)},${+(y + along * sin + across * cos).toFixed(2)}`;
|
|
406
|
-
return `M${at(0, 0)} L${at(-size, -half)} L${at(-size, half)} Z`;
|
|
407
|
-
}
|
|
408
|
-
wires(ctx, name, wires) {
|
|
409
|
-
const paths = ctx.marks(name, "path", wires, (wire) => wire.key).attr("fill", "none").attr("stroke", (wire) => _nullishCoalesce(wire.color, () => ( ctx.theme.inkSecondary))).attr("stroke-width", (wire) => _nullishCoalesce(wire.width, () => ( 1.5))).attr("stroke-dasharray", (wire) => _nullishCoalesce(wire.dash, () => ( null))).attr("stroke-linejoin", "round").attr("stroke-linecap", "round");
|
|
410
|
-
ctx.set(paths, { d: (wire) => wire.d });
|
|
411
|
-
paths.style("pointer-events", (wire) => wire.tip ? null : "none");
|
|
412
|
-
ctx.hover(paths.filter((wire) => !!wire.tip), (wire) => wire.tip);
|
|
413
|
-
return paths;
|
|
414
|
-
}
|
|
415
|
-
notes(ctx, name, notes) {
|
|
416
|
-
const fills = { ink: ctx.theme.ink, secondary: ctx.theme.inkSecondary, muted: ctx.theme.inkMuted };
|
|
417
|
-
const marks = ctx.marks(name, "text", notes, (note) => note.key).attr("text-anchor", (note) => _nullishCoalesce(note.anchor, () => ( "middle"))).attr("dominant-baseline", "central").attr("font-size", (note) => _nullishCoalesce(note.size, () => ( 10))).attr("font-weight", (note) => _nullishCoalesce(note.weight, () => ( null))).attr("font-family", ctx.theme.fontFamily).attr("fill", (note) => _nullishCoalesce(note.fill, () => ( fills[_nullishCoalesce(note.tone, () => ( "ink"))]))).attr("stroke", (note) => note.halo ? ctx.theme.surface : null).attr("stroke-width", (note) => note.halo ? 3 : null).attr("paint-order", (note) => note.halo ? "stroke" : null).style("pointer-events", "none").text((note) => note.text);
|
|
418
|
-
ctx.set(marks, { x: (note) => note.x, y: (note) => note.y });
|
|
419
|
-
}
|
|
420
|
-
};
|
|
421
|
-
|
|
422
|
-
// src/charts/reliabilitycharts/SchematicLabel.ts
|
|
423
|
-
var EM = 0.565;
|
|
424
|
-
var SchematicLabel = class _SchematicLabel {
|
|
425
|
-
static width(text, size = 10) {
|
|
426
|
-
return text.length * size * EM;
|
|
427
|
-
}
|
|
428
|
-
/** `text` cut to `room` px with an ellipsis, or nothing when under two characters would show. */
|
|
429
|
-
static fit(text, room, size = 10) {
|
|
430
|
-
if (_SchematicLabel.width(text, size) <= room) return text;
|
|
431
|
-
const keep = Math.floor(room / (size * EM)) - 1;
|
|
432
|
-
return keep >= 2 ? `${text.slice(0, keep).trimEnd()}\u2026` : "";
|
|
433
|
-
}
|
|
434
|
-
/** Up to `lines` lines broken at spaces, the last one cut to fit. */
|
|
435
|
-
static wrap(text, room, lines, size = 10) {
|
|
436
|
-
const out = [];
|
|
437
|
-
let rest = text.trim();
|
|
438
|
-
while (rest && out.length < lines) {
|
|
439
|
-
const cut = rest.lastIndexOf(" ", Math.floor(room / (size * EM)));
|
|
440
|
-
if (out.length === lines - 1 || _SchematicLabel.width(rest, size) <= room || cut <= 0) {
|
|
441
|
-
out.push(_SchematicLabel.fit(rest, room, size));
|
|
442
|
-
break;
|
|
443
|
-
}
|
|
444
|
-
out.push(rest.slice(0, cut));
|
|
445
|
-
rest = rest.slice(cut + 1);
|
|
446
|
-
}
|
|
447
|
-
return out.filter(Boolean);
|
|
448
|
-
}
|
|
449
|
-
/** A probability, rate or reliability in few characters: 0.95, 0.0125, 2.5e-5, and 0.99962 with every nine kept. */
|
|
450
|
-
static probability(value) {
|
|
451
|
-
if (value === null || !Number.isFinite(value)) return "?";
|
|
452
|
-
if (value === 0) return "0";
|
|
453
|
-
if (value > 0.99 && value < 1) return value.toFixed(Math.min(8, Math.ceil(-Math.log10(1 - value)) + 1));
|
|
454
|
-
return Math.abs(value) < 1e-3 ? value.toExponential(1) : `${+value.toPrecision(3)}`;
|
|
455
|
-
}
|
|
456
|
-
};
|
|
457
|
-
|
|
458
180
|
// src/charts/reliabilitycharts/BowTieDiagram.ts
|
|
459
181
|
var BowTieLinks = /* @__PURE__ */ ((BowTieLinks2) => {
|
|
460
182
|
BowTieLinks2["Converging"] = "converging";
|
|
@@ -468,7 +190,7 @@ var BowTieBarriers = /* @__PURE__ */ ((BowTieBarriers2) => {
|
|
|
468
190
|
})(BowTieBarriers || {});
|
|
469
191
|
var clamp = (value, low, high) => Math.max(low, Math.min(high, value));
|
|
470
192
|
var n = (value) => +value.toFixed(2);
|
|
471
|
-
var BowTieDiagram = (_class2 = class extends SchematicChart {
|
|
193
|
+
var BowTieDiagram = (_class2 = class extends _chunkM4IQ5LIZcjs.SchematicChart {
|
|
472
194
|
static __initStatic2() {this.meta = {
|
|
473
195
|
id: "bow-tie",
|
|
474
196
|
name: "Bow-tie diagram",
|
|
@@ -477,7 +199,7 @@ var BowTieDiagram = (_class2 = class extends SchematicChart {
|
|
|
477
199
|
shape: "table" /* Table */,
|
|
478
200
|
description: "Places threats and preventive barriers left of a top event, and mitigating barriers and consequences right of it, for barrier-based risk reviews. The sample scenario is invented.",
|
|
479
201
|
tags: ["bowtie", "risk", "safety", "barrier", "threat", "consequence", "hazard"],
|
|
480
|
-
sample: (seed) => ReliabilitySamples.bowTie(seed),
|
|
202
|
+
sample: (seed) => _chunkM4IQ5LIZcjs.ReliabilitySamples.bowTie(seed),
|
|
481
203
|
variants: {
|
|
482
204
|
links: Object.values(BowTieLinks),
|
|
483
205
|
barriers: Object.values(BowTieBarriers)
|
|
@@ -491,7 +213,7 @@ var BowTieDiagram = (_class2 = class extends SchematicChart {
|
|
|
491
213
|
const { side, path, barrier } = this.options;
|
|
492
214
|
const model = { event: "", hazard: "", threats: [], consequences: [] };
|
|
493
215
|
for (const row of this.rows()) {
|
|
494
|
-
const kind = SchematicChart.word(row[side]).toLowerCase(), name = SchematicChart.word(row[path]), stop = SchematicChart.word(row[barrier]);
|
|
216
|
+
const kind = _chunkM4IQ5LIZcjs.SchematicChart.word(row[side]).toLowerCase(), name = _chunkM4IQ5LIZcjs.SchematicChart.word(row[path]), stop = _chunkM4IQ5LIZcjs.SchematicChart.word(row[barrier]);
|
|
495
217
|
if (!name) continue;
|
|
496
218
|
if (/^(event|top)/.test(kind)) model.event ||= name;
|
|
497
219
|
else if (kind.startsWith("hazard")) model.hazard ||= name;
|
|
@@ -547,19 +269,19 @@ var BowTieDiagram = (_class2 = class extends SchematicChart {
|
|
|
547
269
|
const knot = ctx.marks("top-event", "circle", model.event || lanes.length ? [model.event || "Top event"] : []).attr("fill", colors.event).attr("stroke", theme.surface).attr("stroke-width", 2);
|
|
548
270
|
ctx.set(knot, { cx, cy, r: radius }, { r: 0 });
|
|
549
271
|
ctx.hover(knot, (name) => tip(name, "Top event", colors.event, model.hazard ? [["Hazard", model.hazard]] : []));
|
|
550
|
-
const hazardWidth = Math.min(1.7 * (radius + reach), Math.max(radius * 1.6, SchematicLabel.width(model.hazard) + 12));
|
|
272
|
+
const hazardWidth = Math.min(1.7 * (radius + reach), Math.max(radius * 1.6, _chunkM4IQ5LIZcjs.SchematicLabel.width(model.hazard) + 12));
|
|
551
273
|
const hazard = ctx.marks("hazard", "rect", model.hazard ? [model.hazard] : []).attr("rx", 3).attr("fill", theme.surface).attr("stroke", theme.axis).attr("stroke-width", 1.5).attr("stroke-dasharray", "5 3");
|
|
552
274
|
ctx.set(hazard, { x: cx - hazardWidth / 2, y: 0.75, width: hazardWidth, height: Math.max(0, hazardHeight - 1.5) });
|
|
553
275
|
ctx.hover(hazard, (name) => tip(name, "Hazard", theme.inkSecondary));
|
|
554
276
|
const lines = boxHeight >= 26 ? 2 : 1;
|
|
555
|
-
const inside = (key, text, x, y, room, fill, count = lines, size = 10) => SchematicLabel.wrap(text, room, count, size).map((line, i, all) => ({ key: `${key}/${i}`, text: line, x, y: y + (i - (all.length - 1) / 2) * (size + 1), size, fill: palette.inkOn(fill) }));
|
|
277
|
+
const inside = (key, text, x, y, room, fill, count = lines, size = 10) => _chunkM4IQ5LIZcjs.SchematicLabel.wrap(text, room, count, size).map((line, i, all) => ({ key: `${key}/${i}`, text: line, x, y: y + (i - (all.length - 1) / 2) * (size + 1), size, fill: palette.inkOn(fill) }));
|
|
556
278
|
const notes = [
|
|
557
279
|
...lanes.flatMap((item) => inside(`${item.left}/${item.lane.name}`, item.lane.name, item.left ? side / 2 : width - side / 2, item.y, side - 8, item.left ? colors.threat : colors.consequence)),
|
|
558
280
|
...model.event ? inside("event", model.event, cx, cy, radius * 1.7, colors.event, Math.max(1, Math.floor(radius * 1.5 / 11))) : [],
|
|
559
|
-
...model.hazard ? [{ key: "hazard", text: SchematicLabel.fit(model.hazard, hazardWidth - 8), x: cx, y: hazardHeight / 2 }] : [],
|
|
281
|
+
...model.hazard ? [{ key: "hazard", text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(model.hazard, hazardWidth - 8), x: cx, y: hazardHeight / 2 }] : [],
|
|
560
282
|
...stops.flatMap((item) => {
|
|
561
283
|
if (boxes) return item.width >= 26 ? inside(item.key, item.name, item.x, item.y, item.width - 4, colors.barrier, lines, 9) : [];
|
|
562
|
-
const text = rowHeight >= 34 && SchematicLabel.width(item.name, 9) <= item.room - 4 ? item.name : "";
|
|
284
|
+
const text = rowHeight >= 34 && _chunkM4IQ5LIZcjs.SchematicLabel.width(item.name, 9) <= item.room - 4 ? item.name : "";
|
|
563
285
|
return text ? [{ key: item.key, text, x: item.x, y: item.y - item.height / 2 - 6, size: 9, tone: "secondary" }] : [];
|
|
564
286
|
})
|
|
565
287
|
];
|
|
@@ -595,8 +317,8 @@ var ControlBlockLayout = (_class3 = class _ControlBlockLayout {
|
|
|
595
317
|
const parts = stacked && node.kind === "block" /* Block */ ? _ControlBlockLayout.fraction(node.label) : [node.label];
|
|
596
318
|
if (node.kind === "sum" /* Sum */) return { lines: [], width: SUM, height: SUM };
|
|
597
319
|
const boxed = node.kind === "block" /* Block */, pad = boxed ? 14 : 6;
|
|
598
|
-
const width = Math.max(boxed ? 30 : 12, Math.min(limit2, Math.max(...parts.map((part) => SchematicLabel.width(part, TEXT))) + pad));
|
|
599
|
-
return { lines: parts.map((part) => SchematicLabel.fit(part, width - pad + 2, TEXT)), width, height: boxed ? parts.length > 1 ? 34 : 24 : 14 };
|
|
320
|
+
const width = Math.max(boxed ? 30 : 12, Math.min(limit2, Math.max(...parts.map((part) => _chunkM4IQ5LIZcjs.SchematicLabel.width(part, TEXT))) + pad));
|
|
321
|
+
return { lines: parts.map((part) => _chunkM4IQ5LIZcjs.SchematicLabel.fit(part, width - pad + 2, TEXT)), width, height: boxed ? parts.length > 1 ? 34 : 24 : 14 };
|
|
600
322
|
};
|
|
601
323
|
const fixed = main.filter((node) => node.kind !== "block" /* Block */).reduce((sum, node) => sum + sized(node, area.width / 4).width, 0);
|
|
602
324
|
const blocks = main.filter((node) => node.kind === "block" /* Block */).length;
|
|
@@ -631,8 +353,8 @@ var ControlBlockLayout = (_class3 = class _ControlBlockLayout {
|
|
|
631
353
|
const edge = (node, toward) => node.x + toward * node.width / 2;
|
|
632
354
|
placed.slice(1).forEach((node, i) => {
|
|
633
355
|
const from = placed[i], link = links.find((item) => item.source === from.id && item.target === node.id);
|
|
634
|
-
const signs = node.kind === "sum" /* Sum */ && _optionalChain([link, 'optionalAccess',
|
|
635
|
-
this.signals.push({ key: `main/${i}`, role: "Forward path" /* Forward */, d: `M${n2(edge(from, 1))},${n2(line)} H${n2(edge(node, -1) - 4)}`, arrows: [SchematicChart.arrow(edge(node, -1), line, 0)], signs, takeoff: null });
|
|
356
|
+
const signs = node.kind === "sum" /* Sum */ && _optionalChain([link, 'optionalAccess', _2 => _2.sign]) ? [{ x: edge(node, -1) - 6, y: line - 8, text: link.sign }] : [];
|
|
357
|
+
this.signals.push({ key: `main/${i}`, role: "Forward path" /* Forward */, d: `M${n2(edge(from, 1))},${n2(line)} H${n2(edge(node, -1) - 4)}`, arrows: [_chunkM4IQ5LIZcjs.SchematicChart.arrow(edge(node, -1), line, 0)], signs, takeoff: null });
|
|
636
358
|
});
|
|
637
359
|
const leaving = /* @__PURE__ */ new Map(), entering = /* @__PURE__ */ new Map();
|
|
638
360
|
chains.forEach((chain, c) => {
|
|
@@ -661,7 +383,7 @@ var ControlBlockLayout = (_class3 = class _ControlBlockLayout {
|
|
|
661
383
|
const last = i === spots.length - 1 && tap === null;
|
|
662
384
|
if (at !== null) {
|
|
663
385
|
parts.push(`${parts.length && i === 0 ? "" : `M${n2(at)},${n2(y)} `}H${n2(edge(spot, -heading) - heading * 4)}`);
|
|
664
|
-
arrows.push(SchematicChart.arrow(edge(spot, -heading), y, turn));
|
|
386
|
+
arrows.push(_chunkM4IQ5LIZcjs.SchematicChart.arrow(edge(spot, -heading), y, turn));
|
|
665
387
|
}
|
|
666
388
|
at = last ? null : edge(spot, heading);
|
|
667
389
|
});
|
|
@@ -670,7 +392,7 @@ var ControlBlockLayout = (_class3 = class _ControlBlockLayout {
|
|
|
670
392
|
const stop = line + chain.side * target.height / 2, lead = spots.at(-1);
|
|
671
393
|
if (tap === null && lead) parts.push(`M${n2(lead.x)},${n2(y - chain.side * lead.height / 2)} V${n2(stop + chain.side * 4)}`);
|
|
672
394
|
else parts.push(`${at !== null && spots.length ? `M${n2(at)},${n2(y)} ` : ""}H${n2(entry)} V${n2(stop + chain.side * 4)}`);
|
|
673
|
-
arrows.push(SchematicChart.arrow(entry, stop, chain.side > 0 ? -90 : 90));
|
|
395
|
+
arrows.push(_chunkM4IQ5LIZcjs.SchematicChart.arrow(entry, stop, chain.side > 0 ? -90 : 90));
|
|
674
396
|
if (target.kind === "sum" /* Sum */ && chain.sign) signs.push({ x: entry - 8, y: stop + chain.side * 9, text: chain.sign });
|
|
675
397
|
}
|
|
676
398
|
this.signals.push({ key: `chain/${c}`, role: chain.role, d: parts.join(" "), arrows, signs, takeoff: tap === null ? null : { x: tap, y: line } });
|
|
@@ -738,7 +460,7 @@ var ControlBlockLayout = (_class3 = class _ControlBlockLayout {
|
|
|
738
460
|
}
|
|
739
461
|
const feed = links.find((link) => link.target === run[0].id && column.has(link.source)), exit = links.find((link) => link.source === run.at(-1).id && column.has(link.target));
|
|
740
462
|
const start = feed ? column.get(feed.source) : null, end = exit ? column.get(exit.target) : null;
|
|
741
|
-
chains.push({ nodes: run, start, end, sign: _nullishCoalesce(_optionalChain([exit, 'optionalAccess',
|
|
463
|
+
chains.push({ nodes: run, start, end, sign: _nullishCoalesce(_optionalChain([exit, 'optionalAccess', _3 => _3.sign]), () => ( "")), role: role(start, end), lane: 1, side: 1 });
|
|
742
464
|
}
|
|
743
465
|
return chains;
|
|
744
466
|
}
|
|
@@ -766,7 +488,7 @@ var KINDS = new Map([
|
|
|
766
488
|
]);
|
|
767
489
|
var NAME = { ["input" /* Input */]: "Input", ["output" /* Output */]: "Output", ["sum" /* Sum */]: "Summing junction", ["block" /* Block */]: "Transfer function" };
|
|
768
490
|
var n3 = (value) => +value.toFixed(2);
|
|
769
|
-
var ControlBlockDiagram = (_class4 = class extends SchematicChart {
|
|
491
|
+
var ControlBlockDiagram = (_class4 = class extends _chunkM4IQ5LIZcjs.SchematicChart {
|
|
770
492
|
static __initStatic3() {this.meta = {
|
|
771
493
|
id: "control-block-diagram",
|
|
772
494
|
name: "Control block diagram",
|
|
@@ -775,7 +497,7 @@ var ControlBlockDiagram = (_class4 = class extends SchematicChart {
|
|
|
775
497
|
shape: "graph" /* Graph */,
|
|
776
498
|
description: "Lays out a control system as transfer-function blocks, summing junctions and take-off points on a forward path, with feedback and feedforward paths routed around it. The sample loop is invented.",
|
|
777
499
|
tags: ["control", "feedback", "transfer function", "block diagram", "summing junction", "loop", "pid"],
|
|
778
|
-
sample: (seed) => ReliabilitySamples.controlLoop(seed),
|
|
500
|
+
sample: (seed) => _chunkM4IQ5LIZcjs.ReliabilitySamples.controlLoop(seed),
|
|
779
501
|
variants: {
|
|
780
502
|
junction: Object.values(ControlJunction),
|
|
781
503
|
feedback: Object.values(ControlFeedback),
|
|
@@ -789,13 +511,13 @@ var ControlBlockDiagram = (_class4 = class extends SchematicChart {
|
|
|
789
511
|
parts() {
|
|
790
512
|
const { data, kind, label: label2, sign } = this.options;
|
|
791
513
|
const nodes = /* @__PURE__ */ new Map();
|
|
792
|
-
for (const node of Array.isArray(_optionalChain([data, 'optionalAccess',
|
|
793
|
-
const id = SchematicChart.word(_optionalChain([node, 'optionalAccess',
|
|
794
|
-
if (id && !nodes.has(id)) nodes.set(id, { id, kind: _nullishCoalesce(KINDS.get(SchematicChart.word(node[kind]).toLowerCase()), () => ( "block")) /* Block */, label: SchematicChart.word(node[label2]) || id });
|
|
514
|
+
for (const node of Array.isArray(_optionalChain([data, 'optionalAccess', _4 => _4.nodes])) ? data.nodes : []) {
|
|
515
|
+
const id = _chunkM4IQ5LIZcjs.SchematicChart.word(_optionalChain([node, 'optionalAccess', _5 => _5.id]));
|
|
516
|
+
if (id && !nodes.has(id)) nodes.set(id, { id, kind: _nullishCoalesce(KINDS.get(_chunkM4IQ5LIZcjs.SchematicChart.word(node[kind]).toLowerCase()), () => ( "block")) /* Block */, label: _chunkM4IQ5LIZcjs.SchematicChart.word(node[label2]) || id });
|
|
795
517
|
}
|
|
796
|
-
const links = (Array.isArray(_optionalChain([data, 'optionalAccess',
|
|
797
|
-
const mark = SchematicChart.word(_optionalChain([link, 'optionalAccess',
|
|
798
|
-
return { source: SchematicChart.word(_optionalChain([link, 'optionalAccess',
|
|
518
|
+
const links = (Array.isArray(_optionalChain([data, 'optionalAccess', _6 => _6.links])) ? data.links : []).map((link) => {
|
|
519
|
+
const mark = _chunkM4IQ5LIZcjs.SchematicChart.word(_optionalChain([link, 'optionalAccess', _7 => _7[sign]]));
|
|
520
|
+
return { source: _chunkM4IQ5LIZcjs.SchematicChart.word(_optionalChain([link, 'optionalAccess', _8 => _8.source])), target: _chunkM4IQ5LIZcjs.SchematicChart.word(_optionalChain([link, 'optionalAccess', _9 => _9.target])), sign: /^(-|−|minus|neg)/i.test(mark) ? "\u2212" : mark ? "+" : "" };
|
|
799
521
|
}).filter((link) => nodes.has(link.source) && nodes.has(link.target));
|
|
800
522
|
return { nodes: [...nodes.values()], links };
|
|
801
523
|
}
|
|
@@ -849,26 +571,26 @@ var EventTreeModel = (_class5 = class {
|
|
|
849
571
|
constructor(rows, columns) {;_class5.prototype.__init3.call(this);_class5.prototype.__init4.call(this);_class5.prototype.__init5.call(this);
|
|
850
572
|
const byId = /* @__PURE__ */ new Map();
|
|
851
573
|
for (const row of rows) {
|
|
852
|
-
const id = SchematicChart.word(row[columns.id]);
|
|
574
|
+
const id = _chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.id]);
|
|
853
575
|
if (id && !byId.has(id)) byId.set(id, row);
|
|
854
576
|
}
|
|
855
577
|
const parentOf = (id) => {
|
|
856
|
-
const parent = SchematicChart.word(byId.get(id)[columns.parent]);
|
|
578
|
+
const parent = _chunkM4IQ5LIZcjs.SchematicChart.word(byId.get(id)[columns.parent]);
|
|
857
579
|
return parent !== id && byId.has(parent) ? parent : null;
|
|
858
580
|
};
|
|
859
581
|
const start = [...byId.keys()].find((id) => parentOf(id) === null);
|
|
860
582
|
const seen = /* @__PURE__ */ new Set();
|
|
861
583
|
const build = (id) => {
|
|
862
584
|
seen.add(id);
|
|
863
|
-
const row = byId.get(id), probability = SchematicChart.number(row[columns.probability]);
|
|
585
|
+
const row = byId.get(id), probability = _chunkM4IQ5LIZcjs.SchematicChart.number(row[columns.probability]);
|
|
864
586
|
const children = [...byId.keys()].filter((child) => !seen.has(child) && parentOf(child) === id).map(build);
|
|
865
587
|
children.sort((a, b) => +b.success - +a.success);
|
|
866
588
|
return {
|
|
867
589
|
id,
|
|
868
|
-
system: SchematicChart.word(row[columns.system]),
|
|
869
|
-
success: SUCCESS.test(SchematicChart.word(row[columns.branch])),
|
|
590
|
+
system: _chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.system]),
|
|
591
|
+
success: SUCCESS.test(_chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.branch])),
|
|
870
592
|
probability: probability === null ? null : Math.max(0, probability),
|
|
871
|
-
outcome: SchematicChart.word(row[columns.outcome]),
|
|
593
|
+
outcome: _chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.outcome]),
|
|
872
594
|
children,
|
|
873
595
|
column: 0,
|
|
874
596
|
row: 0,
|
|
@@ -902,7 +624,7 @@ var EventTreeLinks = /* @__PURE__ */ ((EventTreeLinks2) => {
|
|
|
902
624
|
})(EventTreeLinks || {});
|
|
903
625
|
var HEAD = 26;
|
|
904
626
|
var n4 = (value) => +value.toFixed(2);
|
|
905
|
-
var EventTreeDiagram = (_class6 = class extends SchematicChart {
|
|
627
|
+
var EventTreeDiagram = (_class6 = class extends _chunkM4IQ5LIZcjs.SchematicChart {
|
|
906
628
|
static __initStatic4() {this.meta = {
|
|
907
629
|
id: "event-tree",
|
|
908
630
|
name: "Event tree",
|
|
@@ -911,7 +633,7 @@ var EventTreeDiagram = (_class6 = class extends SchematicChart {
|
|
|
911
633
|
shape: "table" /* Table */,
|
|
912
634
|
description: "Branches an initiating event through the success and failure of each safety function and multiplies out the frequency of every path. The sample scenario is invented.",
|
|
913
635
|
tags: ["eta", "safety", "risk", "initiating event", "barrier", "path frequency", "pra"],
|
|
914
|
-
sample: (seed) => ReliabilitySamples.eventTree(seed),
|
|
636
|
+
sample: (seed) => _chunkM4IQ5LIZcjs.ReliabilitySamples.eventTree(seed),
|
|
915
637
|
variants: {
|
|
916
638
|
links: Object.values(EventTreeLinks),
|
|
917
639
|
strip: [false, true]
|
|
@@ -953,7 +675,7 @@ var EventTreeDiagram = (_class6 = class extends SchematicChart {
|
|
|
953
675
|
this.wires(ctx, "branches", lines);
|
|
954
676
|
const ends = ctx.marks("outcomes", "circle", paths, (path) => path.id).attr("fill", tone).attr("stroke", theme.surface).attr("stroke-width", 2);
|
|
955
677
|
ctx.set(ends, { cx: treeWidth - 6, cy: y, r: 4 }, { r: 0 }, 20);
|
|
956
|
-
const tip = (path) => ({ title: path.outcome || path.id, color: tone(path), rows: [["Path frequency", SchematicLabel.probability(path.frequency)]] });
|
|
678
|
+
const tip = (path) => ({ title: path.outcome || path.id, color: tone(path), rows: [["Path frequency", _chunkM4IQ5LIZcjs.SchematicLabel.probability(path.frequency)]] });
|
|
957
679
|
ctx.hover(ends, tip);
|
|
958
680
|
const known = paths.map((path) => path.frequency).filter((f) => f !== null && f > 0);
|
|
959
681
|
const low = Math.log10(Math.min(...known, 1)) - 0.5, high = Math.log10(Math.max(...known, 1e-12)) + 0.5;
|
|
@@ -964,18 +686,18 @@ var EventTreeDiagram = (_class6 = class extends SchematicChart {
|
|
|
964
686
|
const dots = ctx.marks("strip", "circle", plotted, (path) => path.id).attr("fill", tone).attr("stroke", theme.surface).attr("stroke-width", 2);
|
|
965
687
|
ctx.set(dots, { cx: (path) => along(path.frequency), cy: y, r: 4 }, { r: 0 }, 20);
|
|
966
688
|
ctx.hover(dots, tip);
|
|
967
|
-
const heading = (key, text, x, room, anchor = "middle") => SchematicLabel.wrap(text, room, 2, 9).map((line, i, all) => ({ key: `${key}/${i}`, text: line, x, y: HEAD / 2 - 3 + (i - (all.length - 1) / 2) * 10, anchor, size: 9, tone: "secondary", weight: 600 }));
|
|
689
|
+
const heading = (key, text, x, room, anchor = "middle") => _chunkM4IQ5LIZcjs.SchematicLabel.wrap(text, room, 2, 9).map((line, i, all) => ({ key: `${key}/${i}`, text: line, x, y: HEAD / 2 - 3 + (i - (all.length - 1) / 2) * 10, anchor, size: 9, tone: "secondary", weight: 600 }));
|
|
968
690
|
const tall = rowHeight >= 15, right = treeWidth + numberWidth + stripWidth + 6;
|
|
969
691
|
const notes = !root ? [] : [
|
|
970
|
-
...heading("head/start", SchematicLabel.width("Initiating", 9) <= column - 4 ? "Initiating event" : "Initiator", column / 2, column - 4),
|
|
692
|
+
...heading("head/start", _chunkM4IQ5LIZcjs.SchematicLabel.width("Initiating", 9) <= column - 4 ? "Initiating event" : "Initiator", column / 2, column - 4),
|
|
971
693
|
...model.systems.map((system, i) => ({ system, at: i + 1 })).filter(({ at }) => at < model.columns).flatMap(({ system, at }) => heading(`head/${system}`, system, (at + 0.5) * column, column - 4)),
|
|
972
694
|
...heading("head/frequency", "Frequency", treeWidth + 2, numberWidth - 2, "start"),
|
|
973
695
|
...heading("head/outcome", "Outcome", right, outcomeWidth, "start"),
|
|
974
|
-
{ key: "start/name", text: SchematicLabel.fit(root.system, column - 6), x: 2, y: y(root) - 8, anchor: "start", halo: true },
|
|
975
|
-
{ key: "start/rate", text: SchematicLabel.probability(root.probability), x: 2, y: y(root) + 9, anchor: "start", tone: "secondary", halo: true },
|
|
696
|
+
{ key: "start/name", text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(root.system, column - 6), x: 2, y: y(root) - 8, anchor: "start", halo: true },
|
|
697
|
+
{ key: "start/rate", text: _chunkM4IQ5LIZcjs.SchematicLabel.probability(root.probability), x: 2, y: y(root) + 9, anchor: "start", tone: "secondary", halo: true },
|
|
976
698
|
...tall ? branches.filter(({ parent }) => parent).map(({ branch }) => ({
|
|
977
699
|
key: `p/${branch.id}`,
|
|
978
|
-
text: SchematicLabel.fit(SchematicLabel.probability(branch.probability), column - slant - 2, 9),
|
|
700
|
+
text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(_chunkM4IQ5LIZcjs.SchematicLabel.probability(branch.probability), column - slant - 2, 9),
|
|
979
701
|
x: branch.column * column + slant + 4,
|
|
980
702
|
y: y(branch) - 7,
|
|
981
703
|
anchor: "start",
|
|
@@ -984,8 +706,8 @@ var EventTreeDiagram = (_class6 = class extends SchematicChart {
|
|
|
984
706
|
halo: true
|
|
985
707
|
})) : [],
|
|
986
708
|
...paths.filter((_, i) => tall || i % Math.ceil(11 / Math.max(1, rowHeight)) === 0).flatMap((path) => [
|
|
987
|
-
{ key: `f/${path.id}`, text: SchematicLabel.probability(path.frequency), x: treeWidth + 2, y: y(path), anchor: "start", weight: 600 },
|
|
988
|
-
{ key: `o/${path.id}`, text: SchematicLabel.fit(path.outcome, outcomeWidth), x: right, y: y(path), anchor: "start" }
|
|
709
|
+
{ key: `f/${path.id}`, text: _chunkM4IQ5LIZcjs.SchematicLabel.probability(path.frequency), x: treeWidth + 2, y: y(path), anchor: "start", weight: 600 },
|
|
710
|
+
{ key: `o/${path.id}`, text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(path.outcome, outcomeWidth), x: right, y: y(path), anchor: "start" }
|
|
989
711
|
])
|
|
990
712
|
];
|
|
991
713
|
this.notes(ctx, "labels", notes);
|
|
@@ -1005,21 +727,21 @@ var FaultTreeModel = class _FaultTreeModel {
|
|
|
1005
727
|
constructor(rows, columns) {
|
|
1006
728
|
const byId = /* @__PURE__ */ new Map();
|
|
1007
729
|
for (const row of rows) {
|
|
1008
|
-
const id = SchematicChart.word(row[columns.id]);
|
|
730
|
+
const id = _chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.id]);
|
|
1009
731
|
if (id && !byId.has(id)) byId.set(id, row);
|
|
1010
732
|
}
|
|
1011
733
|
const parentOf = (id) => {
|
|
1012
|
-
const parent = SchematicChart.word(byId.get(id)[columns.parent]);
|
|
734
|
+
const parent = _chunkM4IQ5LIZcjs.SchematicChart.word(byId.get(id)[columns.parent]);
|
|
1013
735
|
return parent !== id && byId.has(parent) ? parent : null;
|
|
1014
736
|
};
|
|
1015
737
|
const root = [...byId.keys()].find((id) => parentOf(id) === null);
|
|
1016
738
|
const seen = /* @__PURE__ */ new Set();
|
|
1017
739
|
const build = (id) => {
|
|
1018
740
|
seen.add(id);
|
|
1019
|
-
const row = byId.get(id), given = SchematicChart.number(row[columns.probability]);
|
|
741
|
+
const row = byId.get(id), given = _chunkM4IQ5LIZcjs.SchematicChart.number(row[columns.probability]);
|
|
1020
742
|
const children = [...byId.keys()].filter((child) => !seen.has(child) && parentOf(child) === id).map(build);
|
|
1021
|
-
const gate = !children.length ? null : SchematicChart.word(row[columns.gate]).toLowerCase() === "and" /* And */ ? "and" /* And */ : "or" /* Or */;
|
|
1022
|
-
return { id, label: SchematicChart.word(row[columns.label]) || id, gate, given: given === null ? null : Math.max(0, Math.min(1, given)), probability: null, importance: 0, children };
|
|
743
|
+
const gate = !children.length ? null : _chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.gate]).toLowerCase() === "and" /* And */ ? "and" /* And */ : "or" /* Or */;
|
|
744
|
+
return { id, label: _chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.label]) || id, gate, given: given === null ? null : Math.max(0, Math.min(1, given)), probability: null, importance: 0, children };
|
|
1023
745
|
};
|
|
1024
746
|
this.top = root === void 0 ? null : build(root);
|
|
1025
747
|
if (this.top) this.#solve(this.top);
|
|
@@ -1068,7 +790,7 @@ var LINE = 11;
|
|
|
1068
790
|
var NAME2 = { ["and" /* And */]: "AND gate", ["or" /* Or */]: "OR gate" };
|
|
1069
791
|
var clamp2 = (value, low, high) => Math.max(low, Math.min(high, value));
|
|
1070
792
|
var n5 = (value) => +value.toFixed(2);
|
|
1071
|
-
var FaultTreeDiagram = (_class7 = class _FaultTreeDiagram extends SchematicChart {
|
|
793
|
+
var FaultTreeDiagram = (_class7 = class _FaultTreeDiagram extends _chunkM4IQ5LIZcjs.SchematicChart {
|
|
1072
794
|
static __initStatic5() {this.meta = {
|
|
1073
795
|
id: "fault-tree",
|
|
1074
796
|
name: "Fault tree",
|
|
@@ -1077,7 +799,7 @@ var FaultTreeDiagram = (_class7 = class _FaultTreeDiagram extends SchematicChart
|
|
|
1077
799
|
shape: "table" /* Table */,
|
|
1078
800
|
description: "Breaks a top event down through AND and OR gates to basic events and computes every probability from the basic ones. The sample system is invented.",
|
|
1079
801
|
tags: ["fta", "reliability", "safety", "gate", "top event", "basic event", "risk"],
|
|
1080
|
-
sample: (seed) => ReliabilitySamples.faultTree(seed),
|
|
802
|
+
sample: (seed) => _chunkM4IQ5LIZcjs.ReliabilitySamples.faultTree(seed),
|
|
1081
803
|
variants: {
|
|
1082
804
|
leaves: Object.values(FaultTreeLeaves),
|
|
1083
805
|
probabilities: [true, false],
|
|
@@ -1113,7 +835,7 @@ var FaultTreeDiagram = (_class7 = class _FaultTreeDiagram extends SchematicChart
|
|
|
1113
835
|
const gap = Math.min(...gaps.values()), box = clamp2(gap * (width - 6) / (1 + gap), 24, 132);
|
|
1114
836
|
const wide = (node, x) => {
|
|
1115
837
|
const room = Math.min(gaps.get(Math.round(node.y * 1e6)) * (width - box) - 6, 2 * Math.min(x, width - x));
|
|
1116
|
-
return clamp2(Math.min(room, Math.max(box, SchematicLabel.width(node.data.label) + 14)), 24, 132);
|
|
838
|
+
return clamp2(Math.min(room, Math.max(box, _chunkM4IQ5LIZcjs.SchematicLabel.width(node.data.label) + 14)), 24, 132);
|
|
1117
839
|
};
|
|
1118
840
|
const row = height / (root.height + 1), lines = row >= 66 ? 2 : 1, tail = probabilities ? LINE : 0;
|
|
1119
841
|
const peak = Math.max(...nodes.map((node) => node.data.importance), 1e-12), full = clamp2(row * 0.16, 6, 11);
|
|
@@ -1129,7 +851,7 @@ var FaultTreeDiagram = (_class7 = class _FaultTreeDiagram extends SchematicChart
|
|
|
1129
851
|
return { placed, row };
|
|
1130
852
|
}
|
|
1131
853
|
#tip(event, color) {
|
|
1132
|
-
const rows = [["Type", event.gate ? NAME2[event.gate] : "Basic event"], ["Probability", SchematicLabel.probability(event.probability)]];
|
|
854
|
+
const rows = [["Type", event.gate ? NAME2[event.gate] : "Basic event"], ["Probability", _chunkM4IQ5LIZcjs.SchematicLabel.probability(event.probability)]];
|
|
1133
855
|
if (!event.gate) rows.push(["Criticality importance", `${(event.importance * 100).toFixed(1)}%`]);
|
|
1134
856
|
return { title: event.label, rows, color };
|
|
1135
857
|
}
|
|
@@ -1162,10 +884,10 @@ var FaultTreeDiagram = (_class7 = class _FaultTreeDiagram extends SchematicChart
|
|
|
1162
884
|
this.notes(ctx, "labels", placed.flatMap((item) => {
|
|
1163
885
|
const { event } = item, basic = !event.gate;
|
|
1164
886
|
const space = basic ? row - (item.out - item.top) - 4 - tail : item.boxHeight - 6 - tail;
|
|
1165
|
-
const lines = SchematicLabel.wrap(event.label, item.width - (basic ? 2 : 6), Math.max(1, Math.floor(space / LINE)));
|
|
887
|
+
const lines = _chunkM4IQ5LIZcjs.SchematicLabel.wrap(event.label, item.width - (basic ? 2 : 6), Math.max(1, Math.floor(space / LINE)));
|
|
1166
888
|
const first = basic ? item.out + 4 + LINE / 2 : item.top + 3 + LINE / 2;
|
|
1167
889
|
const text = lines.map((line, i) => ({ key: `${event.id}/${i}`, text: line, x: item.x, y: first + i * LINE }));
|
|
1168
|
-
if (probabilities) text.push({ key: `${event.id}/p`, text: SchematicLabel.probability(event.probability), x: item.x, y: first + lines.length * LINE, tone: "secondary", weight: basic ? void 0 : 600 });
|
|
890
|
+
if (probabilities) text.push({ key: `${event.id}/p`, text: _chunkM4IQ5LIZcjs.SchematicLabel.probability(event.probability), x: item.x, y: first + lines.length * LINE, tone: "secondary", weight: basic ? void 0 : 600 });
|
|
1169
891
|
return text;
|
|
1170
892
|
}));
|
|
1171
893
|
}
|
|
@@ -1226,7 +948,7 @@ var JitterBathtubCurve = (_class8 = class extends _chunkUXFWDEP6cjs.StatisticalC
|
|
|
1226
948
|
shape: "table" /* Table */,
|
|
1227
949
|
description: "Plots bit error ratio against sampling position across the unit interval, extends each wall with a fitted Gaussian tail, and reads the eye opening at a target error ratio. The sample scan is invented.",
|
|
1228
950
|
tags: ["jitter", "ber", "bathtub", "eye opening", "serdes", "signal integrity", "dual dirac", "timing margin"],
|
|
1229
|
-
sample: (seed) => ReliabilitySamples.jitterScan(seed),
|
|
951
|
+
sample: (seed) => _chunkM4IQ5LIZcjs.ReliabilitySamples.jitterScan(seed),
|
|
1230
952
|
variants: {
|
|
1231
953
|
scale: Object.values(JitterBathtubScale),
|
|
1232
954
|
extrapolate: [true, false],
|
|
@@ -1341,18 +1063,18 @@ var LadderProgram = (_class9 = class {
|
|
|
1341
1063
|
constructor(rows, columns) {;_class9.prototype.__init6.call(this);
|
|
1342
1064
|
const steps = /* @__PURE__ */ new Map();
|
|
1343
1065
|
rows.forEach((row, i) => {
|
|
1344
|
-
const kind = KINDS2.get(SchematicChart.word(row[columns.kind]).toLowerCase());
|
|
1066
|
+
const kind = KINDS2.get(_chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.kind]).toLowerCase());
|
|
1345
1067
|
if (!kind) return;
|
|
1346
|
-
const name = SchematicChart.word(row[columns.rung]) || "1", comment = SchematicChart.word(row[columns.comment]);
|
|
1068
|
+
const name = _chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.rung]) || "1", comment = _chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.comment]);
|
|
1347
1069
|
const rung = _nullishCoalesce(this.rungs.find((item) => item.name === name), () => ( this.rungs[this.rungs.push({ name, comment: "", steps: [], outputs: [], reach: 0, energised: false }) - 1]));
|
|
1348
1070
|
rung.comment ||= comment;
|
|
1349
|
-
const on = !OFF.has(SchematicChart.word(row[columns.state]).toLowerCase());
|
|
1350
|
-
const element = { kind, tag: SchematicChart.word(row[columns.tag]), on, preset: SchematicChart.word(row[columns.preset]), conducts: kind === "nc" /* Closed */ ? !on : on };
|
|
1071
|
+
const on = !OFF.has(_chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.state]).toLowerCase());
|
|
1072
|
+
const element = { kind, tag: _chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.tag]), on, preset: _chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.preset]), conducts: kind === "nc" /* Closed */ ? !on : on };
|
|
1351
1073
|
if (!CONTACTS.has(kind)) {
|
|
1352
1074
|
rung.outputs.push(element);
|
|
1353
1075
|
return;
|
|
1354
1076
|
}
|
|
1355
|
-
const at = _nullishCoalesce(steps.get(rung), () => ( steps.set(rung, /* @__PURE__ */ new Map()).get(rung))), key = SchematicChart.word(row[columns.step]) || `row ${i}`;
|
|
1077
|
+
const at = _nullishCoalesce(steps.get(rung), () => ( steps.set(rung, /* @__PURE__ */ new Map()).get(rung))), key = _chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.step]) || `row ${i}`;
|
|
1356
1078
|
at.set(key, [..._nullishCoalesce(at.get(key), () => ( [])), element]);
|
|
1357
1079
|
});
|
|
1358
1080
|
for (const rung of this.rungs) {
|
|
@@ -1386,7 +1108,7 @@ var NAME3 = {
|
|
|
1386
1108
|
var BLOCK = { ["timer" /* Timer */]: "TON", ["counter" /* Counter */]: "CTU" };
|
|
1387
1109
|
var LETTER = { ["set" /* Set */]: "S", ["reset" /* Reset */]: "R" };
|
|
1388
1110
|
var n6 = (value) => +value.toFixed(2);
|
|
1389
|
-
var LadderLogicDiagram = (_class10 = class _LadderLogicDiagram extends SchematicChart {
|
|
1111
|
+
var LadderLogicDiagram = (_class10 = class _LadderLogicDiagram extends _chunkM4IQ5LIZcjs.SchematicChart {
|
|
1390
1112
|
static __initStatic7() {this.meta = {
|
|
1391
1113
|
id: "ladder-logic",
|
|
1392
1114
|
name: "Ladder logic diagram",
|
|
@@ -1395,7 +1117,7 @@ var LadderLogicDiagram = (_class10 = class _LadderLogicDiagram extends Schematic
|
|
|
1395
1117
|
shape: "table" /* Table */,
|
|
1396
1118
|
description: "Draws ladder logic as rungs between two rails, with contacts, coils and timers, and traces which rungs the given contact states energise. The sample program is invented.",
|
|
1397
1119
|
tags: ["ladder", "plc", "relay logic", "rung", "contact", "coil", "timer", "iec 61131"],
|
|
1398
|
-
sample: (seed) => ReliabilitySamples.ladder(seed),
|
|
1120
|
+
sample: (seed) => _chunkM4IQ5LIZcjs.ReliabilitySamples.ladder(seed),
|
|
1399
1121
|
variants: {
|
|
1400
1122
|
outputs: Object.values(LadderOutputs),
|
|
1401
1123
|
powerFlow: [true, false],
|
|
@@ -1438,7 +1160,7 @@ var LadderLogicDiagram = (_class10 = class _LadderLogicDiagram extends Schematic
|
|
|
1438
1160
|
if (live) hot.push(d);
|
|
1439
1161
|
};
|
|
1440
1162
|
const y = (i) => top + head + i * rowHeight + rowHeight / 2 + 4, main = y(0);
|
|
1441
|
-
if (comments) notes.push({ key: `comment/${r}`, text: SchematicLabel.fit(`${r + 1} ${rung.comment}`.trimEnd(), right - left - 12), x: left + 6, y: top + COMMENT / 2, anchor: "start", tone: "secondary" });
|
|
1163
|
+
if (comments) notes.push({ key: `comment/${r}`, text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(`${r + 1} ${rung.comment}`.trimEnd(), right - left - 12), x: left + 6, y: top + COMMENT / 2, anchor: "start", tone: "secondary" });
|
|
1442
1164
|
let from = left;
|
|
1443
1165
|
rung.steps.forEach((step, k) => {
|
|
1444
1166
|
const x = left + 8 + (k + 0.5) * slot, reached = k <= rung.reach, passes = reached && k < rung.reach;
|
|
@@ -1481,9 +1203,9 @@ var LadderLogicDiagram = (_class10 = class _LadderLogicDiagram extends Schematic
|
|
|
1481
1203
|
}));
|
|
1482
1204
|
for (const mark of marks) {
|
|
1483
1205
|
const { element } = mark, block = BLOCK[element.kind], letter = LETTER[element.kind];
|
|
1484
|
-
const text = tagged ? SchematicLabel.fit(element.tag, (block ? 2 * BOX + 16 : slot) - 4) : "";
|
|
1206
|
+
const text = tagged ? _chunkM4IQ5LIZcjs.SchematicLabel.fit(element.tag, (block ? 2 * BOX + 16 : slot) - 4) : "";
|
|
1485
1207
|
if (text) notes.push({ key: `tag/${mark.key}`, text, x: mark.x, y: mark.y - plate - (block ? 9 : 7) });
|
|
1486
|
-
if (block) notes.push({ key: `block/${mark.key}`, text: SchematicLabel.fit(`${block} ${element.preset}`.trimEnd(), 2 * BOX - 4, 8), x: mark.x, y: mark.y, size: 8, weight: 600 });
|
|
1208
|
+
if (block) notes.push({ key: `block/${mark.key}`, text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(`${block} ${element.preset}`.trimEnd(), 2 * BOX - 4, 8), x: mark.x, y: mark.y, size: 8, weight: 600 });
|
|
1487
1209
|
if (letter) notes.push({ key: `letter/${mark.key}`, text: letter, x: mark.x, y: mark.y, size: 8, weight: 600 });
|
|
1488
1210
|
}
|
|
1489
1211
|
this.notes(ctx, "labels", notes);
|
|
@@ -1588,7 +1310,7 @@ var PidLayout = (_class11 = class _PidLayout {
|
|
|
1588
1310
|
const partners = (id) => lines.flatMap((line) => line.source === id ? [line.target] : line.target === id ? [line.source] : []);
|
|
1589
1311
|
const wish = /* @__PURE__ */ new Map();
|
|
1590
1312
|
for (let pass = 0; pass < 2; pass++) for (const item of bubbles) {
|
|
1591
|
-
const known = partners(item.id).map((id) => _nullishCoalesce(_optionalChain([placed, 'access',
|
|
1313
|
+
const known = partners(item.id).map((id) => _nullishCoalesce(_optionalChain([placed, 'access', _10 => _10.get, 'call', _11 => _11(id), 'optionalAccess', _12 => _12.x]), () => ( wish.get(id)))).filter((x) => x !== void 0);
|
|
1592
1314
|
if (known.length) wish.set(item.id, known.reduce((sum, x) => sum + x, 0) / known.length);
|
|
1593
1315
|
}
|
|
1594
1316
|
const queue = bubbles.map((item) => ({ item, x: _nullishCoalesce(wish.get(item.id), () => ( area.width / 2)) })).sort((a, b) => a.x - b.x);
|
|
@@ -1613,16 +1335,16 @@ var PidLayout = (_class11 = class _PidLayout {
|
|
|
1613
1335
|
return;
|
|
1614
1336
|
}
|
|
1615
1337
|
const start = [from.x + from.shape.half, from.y], end = [to.x - to.shape.half, to.y];
|
|
1616
|
-
const head = SchematicChart.arrow(end[0], end[1], 0);
|
|
1338
|
+
const head = _chunkM4IQ5LIZcjs.SchematicChart.arrow(end[0], end[1], 0);
|
|
1617
1339
|
if (direct) {
|
|
1618
1340
|
if (to.x > from.x) {
|
|
1619
|
-
this.lines.push({ ...line, key, d: `M${n8(start[0])},${n8(start[1])} L${n8(end[0] - 5)},${n8(end[1])}`, arrow: SchematicChart.arrow(end[0], end[1], Math.atan2(end[1] - start[1], end[0] - start[0]) * 180 / Math.PI) });
|
|
1341
|
+
this.lines.push({ ...line, key, d: `M${n8(start[0])},${n8(start[1])} L${n8(end[0] - 5)},${n8(end[1])}`, arrow: _chunkM4IQ5LIZcjs.SchematicChart.arrow(end[0], end[1], Math.atan2(end[1] - start[1], end[0] - start[0]) * 180 / Math.PI) });
|
|
1620
1342
|
return;
|
|
1621
1343
|
}
|
|
1622
1344
|
const y0 = from.y + from.shape.down, y1 = to.y + to.shape.down, clear = Math.min(area.height - 2, Math.max(...this.items.map((item) => item.y + item.shape.down)) + TAG + 4);
|
|
1623
1345
|
const dip = Math.max(y0, y1, (4 * clear - y0 - y1) / 2), mid = (from.x + to.x) / 2;
|
|
1624
1346
|
const angle = Math.atan2(to.y + to.shape.down - dip, to.x - mid) * 180 / Math.PI;
|
|
1625
|
-
this.lines.push({ ...line, key, d: `M${n8(from.x)},${n8(from.y + from.shape.down)} Q${n8(mid)},${n8(dip)} ${n8(to.x)},${n8(to.y + to.shape.down)}`, arrow: SchematicChart.arrow(to.x, to.y + to.shape.down, angle) });
|
|
1347
|
+
this.lines.push({ ...line, key, d: `M${n8(from.x)},${n8(from.y + from.shape.down)} Q${n8(mid)},${n8(dip)} ${n8(to.x)},${n8(to.y + to.shape.down)}`, arrow: _chunkM4IQ5LIZcjs.SchematicChart.arrow(to.x, to.y + to.shape.down, angle) });
|
|
1626
1348
|
return;
|
|
1627
1349
|
}
|
|
1628
1350
|
const lane = lanes.indexOf(line);
|
|
@@ -1698,7 +1420,7 @@ var NAME4 = {
|
|
|
1698
1420
|
["instrument" /* Instrument */]: "Instrument",
|
|
1699
1421
|
["other" /* Other */]: "Equipment"
|
|
1700
1422
|
};
|
|
1701
|
-
var PipingInstrumentDiagram = (_class12 = class extends SchematicChart {
|
|
1423
|
+
var PipingInstrumentDiagram = (_class12 = class extends _chunkM4IQ5LIZcjs.SchematicChart {
|
|
1702
1424
|
static __initStatic8() {this.meta = {
|
|
1703
1425
|
id: "piping-instrumentation-diagram",
|
|
1704
1426
|
name: "P&ID",
|
|
@@ -1707,7 +1429,7 @@ var PipingInstrumentDiagram = (_class12 = class extends SchematicChart {
|
|
|
1707
1429
|
shape: "graph" /* Graph */,
|
|
1708
1430
|
description: "Lays out a piping and instrumentation diagram from a list of equipment and connections: vessels, pumps, valves and exchangers on process lines, with tagged instrument bubbles. The sample unit is invented.",
|
|
1709
1431
|
tags: ["p&id", "piping", "instrumentation", "process", "plant", "schematic", "control loop", "isa"],
|
|
1710
|
-
sample: (seed) => ReliabilitySamples.processUnit(seed),
|
|
1432
|
+
sample: (seed) => _chunkM4IQ5LIZcjs.ReliabilitySamples.processUnit(seed),
|
|
1711
1433
|
variants: {
|
|
1712
1434
|
routing: Object.values(PidRouting),
|
|
1713
1435
|
instruments: [true, false],
|
|
@@ -1720,14 +1442,14 @@ var PipingInstrumentDiagram = (_class12 = class extends SchematicChart {
|
|
|
1720
1442
|
/** Items and lines read from the data. Repeated ids keep their first node, and lines to unknown ids are dropped. */
|
|
1721
1443
|
parts() {
|
|
1722
1444
|
const { data, kind, label: label2, line } = this.options;
|
|
1723
|
-
const nodes = Array.isArray(_optionalChain([data, 'optionalAccess',
|
|
1445
|
+
const nodes = Array.isArray(_optionalChain([data, 'optionalAccess', _13 => _13.nodes])) ? data.nodes : [], links = Array.isArray(_optionalChain([data, 'optionalAccess', _14 => _14.links])) ? data.links : [];
|
|
1724
1446
|
const items = /* @__PURE__ */ new Map();
|
|
1725
1447
|
for (const node of nodes) {
|
|
1726
|
-
const id = SchematicChart.word(_optionalChain([node, 'optionalAccess',
|
|
1727
|
-
if (id && !items.has(id)) items.set(id, { id, kind: _nullishCoalesce(KINDS3.get(SchematicChart.word(node[kind]).toLowerCase().replace(/[\s_]+/g, "-")), () => ( "other")) /* Other */, label: SchematicChart.word(node[label2]) || id });
|
|
1448
|
+
const id = _chunkM4IQ5LIZcjs.SchematicChart.word(_optionalChain([node, 'optionalAccess', _15 => _15.id]));
|
|
1449
|
+
if (id && !items.has(id)) items.set(id, { id, kind: _nullishCoalesce(KINDS3.get(_chunkM4IQ5LIZcjs.SchematicChart.word(node[kind]).toLowerCase().replace(/[\s_]+/g, "-")), () => ( "other")) /* Other */, label: _chunkM4IQ5LIZcjs.SchematicChart.word(node[label2]) || id });
|
|
1728
1450
|
}
|
|
1729
1451
|
const bubble = (id) => items.get(id).kind === "instrument" /* Instrument */;
|
|
1730
|
-
const lines = links.map((link) => ({ source: SchematicChart.word(_optionalChain([link, 'optionalAccess',
|
|
1452
|
+
const lines = links.map((link) => ({ source: _chunkM4IQ5LIZcjs.SchematicChart.word(_optionalChain([link, 'optionalAccess', _16 => _16.source])), target: _chunkM4IQ5LIZcjs.SchematicChart.word(_optionalChain([link, 'optionalAccess', _17 => _17.target])), flag: _chunkM4IQ5LIZcjs.SchematicChart.word(_optionalChain([link, 'optionalAccess', _18 => _18[line]])).toLowerCase() })).filter((link) => items.has(link.source) && items.has(link.target)).map(({ source, target, flag }) => ({ source, target, signal: flag.startsWith("sig") || bubble(source) || bubble(target) }));
|
|
1731
1453
|
return { items: [...items.values()], lines };
|
|
1732
1454
|
}
|
|
1733
1455
|
table() {
|
|
@@ -1740,7 +1462,7 @@ var PipingInstrumentDiagram = (_class12 = class extends SchematicChart {
|
|
|
1740
1462
|
const layout = new PidLayout(items, lines, ctx.plot, routing === "direct" /* Direct */, instruments);
|
|
1741
1463
|
const piped = layout.lines.some((link) => !link.signal), wired = layout.lines.some((link) => link.signal);
|
|
1742
1464
|
const pipe = piped ? palette.color("Process line") : theme.inkMuted, signal = wired ? palette.color("Signal line") : theme.inkMuted;
|
|
1743
|
-
const name = (id) => _nullishCoalesce(_optionalChain([items, 'access',
|
|
1465
|
+
const name = (id) => _nullishCoalesce(_optionalChain([items, 'access', _19 => _19.find, 'call', _20 => _20((item) => item.id === id), 'optionalAccess', _21 => _21.label]), () => ( id));
|
|
1744
1466
|
this.wires(ctx, "lines", layout.lines.map((link) => ({
|
|
1745
1467
|
key: link.key,
|
|
1746
1468
|
d: link.d,
|
|
@@ -1757,14 +1479,14 @@ var PipingInstrumentDiagram = (_class12 = class extends SchematicChart {
|
|
|
1757
1479
|
ctx.hover(symbols, (item) => ({ title: item.label, rows: [["Type", NAME4[item.kind]], ["Connects to", lines.filter((link) => link.source === item.id).map((link) => name(link.target)).join(", ") || "Nothing"]] }));
|
|
1758
1480
|
const notes = layout.items.flatMap((item) => {
|
|
1759
1481
|
if (item.kind !== "instrument" /* Instrument */) {
|
|
1760
|
-
const text = tags ? SchematicLabel.fit(item.label, layout.column - 6) : "";
|
|
1482
|
+
const text = tags ? _chunkM4IQ5LIZcjs.SchematicLabel.fit(item.label, layout.column - 6) : "";
|
|
1761
1483
|
return text ? [{ key: item.id, text, x: item.x, y: item.y + item.shape.down + 8, halo: true }] : [];
|
|
1762
1484
|
}
|
|
1763
1485
|
const [letters, loop] = item.label.split(/[-\s]+/, 2), size = Math.max(7, Math.min(9, item.shape.half * 0.62)), room = item.shape.half * 1.7;
|
|
1764
|
-
if (!tags || !loop) return [{ key: item.id, text: SchematicLabel.fit(_nullishCoalesce(letters, () => ( "")), room, size), x: item.x, y: item.y, size, weight: 600 }];
|
|
1486
|
+
if (!tags || !loop) return [{ key: item.id, text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(_nullishCoalesce(letters, () => ( "")), room, size), x: item.x, y: item.y, size, weight: 600 }];
|
|
1765
1487
|
return [
|
|
1766
|
-
{ key: `${item.id}/letters`, text: SchematicLabel.fit(_nullishCoalesce(letters, () => ( "")), room, size), x: item.x, y: item.y - size * 0.55, size, weight: 600 },
|
|
1767
|
-
{ key: `${item.id}/loop`, text: SchematicLabel.fit(loop, room, size), x: item.x, y: item.y + size * 0.6, size }
|
|
1488
|
+
{ key: `${item.id}/letters`, text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(_nullishCoalesce(letters, () => ( "")), room, size), x: item.x, y: item.y - size * 0.55, size, weight: 600 },
|
|
1489
|
+
{ key: `${item.id}/loop`, text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(loop, room, size), x: item.x, y: item.y + size * 0.6, size }
|
|
1768
1490
|
];
|
|
1769
1491
|
});
|
|
1770
1492
|
this.notes(ctx, "tags", notes);
|
|
@@ -1778,8 +1500,8 @@ var ReliabilityBlockModel = (_class13 = class _ReliabilityBlockModel {
|
|
|
1778
1500
|
|
|
1779
1501
|
constructor(rows, columns) {;_class13.prototype.__init9.call(this);
|
|
1780
1502
|
rows.forEach((row, i) => {
|
|
1781
|
-
const name = SchematicChart.word(row[columns.block]) || `Block ${i + 1}`, given = SchematicChart.number(row[columns.reliability]);
|
|
1782
|
-
const stageName = SchematicChart.word(row[columns.stage]) || name, branchName = SchematicChart.word(row[columns.branch]) || `#${i}`;
|
|
1503
|
+
const name = _chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.block]) || `Block ${i + 1}`, given = _chunkM4IQ5LIZcjs.SchematicChart.number(row[columns.reliability]);
|
|
1504
|
+
const stageName = _chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.stage]) || name, branchName = _chunkM4IQ5LIZcjs.SchematicChart.word(row[columns.branch]) || `#${i}`;
|
|
1783
1505
|
const stage = _nullishCoalesce(this.stages.find((item) => item.name === stageName), () => ( this.stages[this.stages.push({ name: stageName, branches: [], reliability: null }) - 1]));
|
|
1784
1506
|
const branch = _nullishCoalesce(stage.branches.find((item) => item.name === branchName), () => ( stage.branches[stage.branches.push({ name: branchName, blocks: [], reliability: null }) - 1]));
|
|
1785
1507
|
branch.blocks.push({ name, reliability: given === null ? null : Math.max(0, Math.min(1, given)) });
|
|
@@ -1803,7 +1525,7 @@ var ReliabilityBlockModel = (_class13 = class _ReliabilityBlockModel {
|
|
|
1803
1525
|
var HEAD2 = 18;
|
|
1804
1526
|
var END = 8;
|
|
1805
1527
|
var clamp4 = (value, low, high) => Math.max(low, Math.min(high, value));
|
|
1806
|
-
var ReliabilityBlockDiagram = (_class14 = class extends SchematicChart {
|
|
1528
|
+
var ReliabilityBlockDiagram = (_class14 = class extends _chunkM4IQ5LIZcjs.SchematicChart {
|
|
1807
1529
|
static __initStatic9() {this.meta = {
|
|
1808
1530
|
id: "reliability-block-diagram",
|
|
1809
1531
|
name: "Reliability block diagram",
|
|
@@ -1812,7 +1534,7 @@ var ReliabilityBlockDiagram = (_class14 = class extends SchematicChart {
|
|
|
1812
1534
|
shape: "table" /* Table */,
|
|
1813
1535
|
description: "Draws a system as blocks in series and in parallel between an input and an output, and multiplies out the reliability of each stage and of the whole. The sample system is invented.",
|
|
1814
1536
|
tags: ["rbd", "reliability", "series", "parallel", "redundancy", "availability"],
|
|
1815
|
-
sample: (seed) => ReliabilitySamples.blocks(seed),
|
|
1537
|
+
sample: (seed) => _chunkM4IQ5LIZcjs.ReliabilitySamples.blocks(seed),
|
|
1816
1538
|
variants: {
|
|
1817
1539
|
orientation: ["horizontal" /* Horizontal */, "vertical" /* Vertical */],
|
|
1818
1540
|
stageTotals: [true, false]
|
|
@@ -1857,8 +1579,8 @@ var ReliabilityBlockDiagram = (_class14 = class extends SchematicChart {
|
|
|
1857
1579
|
joints.push({ key: `${s}/${key}`, x, y });
|
|
1858
1580
|
}
|
|
1859
1581
|
if (stageTotals) {
|
|
1860
|
-
const text = `R ${SchematicLabel.probability(stage.reliability)}`, [x, y] = flat ? at((from + to) / 2, across + side / 2) : at((from + to) / 2, across + 6);
|
|
1861
|
-
notes.push({ key: `total/${s}`, text: SchematicLabel.fit(text, flat ? to - from + gap - 4 : side - 8), x, y, anchor: flat ? "middle" : "start", tone: "secondary" });
|
|
1582
|
+
const text = `R ${_chunkM4IQ5LIZcjs.SchematicLabel.probability(stage.reliability)}`, [x, y] = flat ? at((from + to) / 2, across + side / 2) : at((from + to) / 2, across + 6);
|
|
1583
|
+
notes.push({ key: `total/${s}`, text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(text, flat ? to - from + gap - 4 : side - 8), x, y, anchor: flat ? "middle" : "start", tone: "secondary" });
|
|
1862
1584
|
}
|
|
1863
1585
|
previous = to;
|
|
1864
1586
|
cursor = to + gap;
|
|
@@ -1876,19 +1598,19 @@ var ReliabilityBlockDiagram = (_class14 = class extends SchematicChart {
|
|
|
1876
1598
|
ctx.hover(rects, (box) => ({
|
|
1877
1599
|
title: box.block.name,
|
|
1878
1600
|
color: color(box),
|
|
1879
|
-
rows: [["Stage", box.stage.name], ["Reliability", SchematicLabel.probability(box.block.reliability)], ["Stage reliability", SchematicLabel.probability(box.stage.reliability)]]
|
|
1601
|
+
rows: [["Stage", box.stage.name], ["Reliability", _chunkM4IQ5LIZcjs.SchematicLabel.probability(box.block.reliability)], ["Stage reliability", _chunkM4IQ5LIZcjs.SchematicLabel.probability(box.stage.reliability)]]
|
|
1880
1602
|
}));
|
|
1881
1603
|
for (const box of boxes) {
|
|
1882
|
-
const fill = palette.inkOn(color(box)), value = SchematicLabel.probability(box.block.reliability);
|
|
1604
|
+
const fill = palette.inkOn(color(box)), value = _chunkM4IQ5LIZcjs.SchematicLabel.probability(box.block.reliability);
|
|
1883
1605
|
if (flat) {
|
|
1884
|
-
SchematicLabel.wrap(box.block.name, box.width - 4, box.height >= 24 ? 2 : 1, 9).forEach((line, i, all) => notes.push({ key: `name/${box.key}/${i}`, text: line, x: box.x, y: box.y + (i - (all.length - 1) / 2) * 10, size: 9, fill }));
|
|
1885
|
-
notes.push({ key: `value/${box.key}`, text: SchematicLabel.fit(value, box.width + 6, 9), x: box.x, y: box.y + box.height / 2 + 7, size: 9, tone: "secondary", halo: true });
|
|
1606
|
+
_chunkM4IQ5LIZcjs.SchematicLabel.wrap(box.block.name, box.width - 4, box.height >= 24 ? 2 : 1, 9).forEach((line, i, all) => notes.push({ key: `name/${box.key}/${i}`, text: line, x: box.x, y: box.y + (i - (all.length - 1) / 2) * 10, size: 9, fill }));
|
|
1607
|
+
notes.push({ key: `value/${box.key}`, text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(value, box.width + 6, 9), x: box.x, y: box.y + box.height / 2 + 7, size: 9, tone: "secondary", halo: true });
|
|
1886
1608
|
} else {
|
|
1887
1609
|
const size = box.height >= 13 ? 10 : 8, both = `${box.block.name} ${value}`;
|
|
1888
|
-
notes.push({ key: `name/${box.key}`, text: SchematicLabel.width(both, size) <= box.width - 6 ? both : SchematicLabel.fit(box.block.name, box.width - 6, size), x: box.x, y: box.y, size, fill });
|
|
1610
|
+
notes.push({ key: `name/${box.key}`, text: _chunkM4IQ5LIZcjs.SchematicLabel.width(both, size) <= box.width - 6 ? both : _chunkM4IQ5LIZcjs.SchematicLabel.fit(box.block.name, box.width - 6, size), x: box.x, y: box.y, size, fill });
|
|
1889
1611
|
}
|
|
1890
1612
|
}
|
|
1891
|
-
if (stages.length) notes.push({ key: "system", text: SchematicLabel.fit(`System reliability ${SchematicLabel.probability(model.reliability)}`, width, 11), x: 0, y: HEAD2 / 2 - 3, anchor: "start", size: 11, weight: 600 });
|
|
1613
|
+
if (stages.length) notes.push({ key: "system", text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(`System reliability ${_chunkM4IQ5LIZcjs.SchematicLabel.probability(model.reliability)}`, width, 11), x: 0, y: HEAD2 / 2 - 3, anchor: "start", size: 11, weight: 600 });
|
|
1892
1614
|
this.notes(ctx, "labels", notes);
|
|
1893
1615
|
}
|
|
1894
1616
|
}, _class14.__initStatic9(), _class14);
|
|
@@ -1910,7 +1632,7 @@ var ShmooPlot = (_class15 = class _ShmooPlot extends _chunkUXFWDEP6cjs.Statistic
|
|
|
1910
1632
|
shape: "table" /* Table */,
|
|
1911
1633
|
description: "Marks pass or fail at each point of a two-parameter sweep, showing the operating region of a device and its margins. The sample sweep is invented.",
|
|
1912
1634
|
tags: ["shmoo", "test", "semiconductor", "pass fail", "margin", "voltage", "frequency", "characterisation"],
|
|
1913
|
-
sample: (seed) => ReliabilitySamples.shmoo(seed),
|
|
1635
|
+
sample: (seed) => _chunkM4IQ5LIZcjs.ReliabilitySamples.shmoo(seed),
|
|
1914
1636
|
variants: {
|
|
1915
1637
|
form: Object.values(ShmooForm),
|
|
1916
1638
|
boundary: [true, false]
|
|
@@ -1925,7 +1647,7 @@ var ShmooPlot = (_class15 = class _ShmooPlot extends _chunkUXFWDEP6cjs.Statistic
|
|
|
1925
1647
|
}
|
|
1926
1648
|
/** Bands thinner than their labels keep every nth one. */
|
|
1927
1649
|
tickFormat(scale) {
|
|
1928
|
-
const names = _nullishCoalesce(_optionalChain([scale, 'access',
|
|
1650
|
+
const names = _nullishCoalesce(_optionalChain([scale, 'access', _22 => _22.domain, 'optionalCall', _23 => _23()]), () => ( [])), step = _nullishCoalesce(_optionalChain([scale, 'access', _24 => _24.step, 'optionalCall', _25 => _25()]), () => ( 0));
|
|
1929
1651
|
const upright = (_nullishCoalesce(scale.range()[0], () => ( 0))) > (_nullishCoalesce(scale.range()[1], () => ( 0)));
|
|
1930
1652
|
const need = upright ? 13 : Math.max(...names.map((name) => name.length), 1) * 6.2 + 8;
|
|
1931
1653
|
const every = Math.max(1, Math.ceil(need / Math.max(1, step)));
|
|
@@ -2086,7 +1808,7 @@ var NAME5 = {
|
|
|
2086
1808
|
var ENDS = /* @__PURE__ */ new Set(["generator" /* Generator */, "motor" /* Motor */, "load" /* Load */]);
|
|
2087
1809
|
var clamp5 = (value, low, high) => Math.max(low, Math.min(high, value));
|
|
2088
1810
|
var n10 = (value) => +value.toFixed(2);
|
|
2089
|
-
var SingleLineDiagram = (_class16 = class extends SchematicChart {
|
|
1811
|
+
var SingleLineDiagram = (_class16 = class extends _chunkM4IQ5LIZcjs.SchematicChart {
|
|
2090
1812
|
static __initStatic11() {this.meta = {
|
|
2091
1813
|
id: "single-line-diagram",
|
|
2092
1814
|
name: "Single-line diagram",
|
|
@@ -2095,7 +1817,7 @@ var SingleLineDiagram = (_class16 = class extends SchematicChart {
|
|
|
2095
1817
|
shape: "table" /* Table */,
|
|
2096
1818
|
description: "Draws an electrical network as one line per circuit, with standard symbols for sources, buses, breakers, transformers, motors and loads, coloured by voltage level. The sample network is invented.",
|
|
2097
1819
|
tags: ["one-line", "sld", "electrical", "power", "switchgear", "substation", "transformer", "breaker"],
|
|
2098
|
-
sample: (seed) => ReliabilitySamples.powerNetwork(seed),
|
|
1820
|
+
sample: (seed) => _chunkM4IQ5LIZcjs.ReliabilitySamples.powerNetwork(seed),
|
|
2099
1821
|
variants: {
|
|
2100
1822
|
symbols: Object.values(SingleLineSymbols),
|
|
2101
1823
|
orientation: ["vertical" /* Vertical */, "horizontal" /* Horizontal */],
|
|
@@ -2110,11 +1832,11 @@ var SingleLineDiagram = (_class16 = class extends SchematicChart {
|
|
|
2110
1832
|
const { id, kind, from, label: label2, rating, voltage } = this.options;
|
|
2111
1833
|
const byId = /* @__PURE__ */ new Map();
|
|
2112
1834
|
for (const row of this.rows()) {
|
|
2113
|
-
const key = SchematicChart.word(row[id]);
|
|
1835
|
+
const key = _chunkM4IQ5LIZcjs.SchematicChart.word(row[id]);
|
|
2114
1836
|
if (key && !byId.has(key)) byId.set(key, row);
|
|
2115
1837
|
}
|
|
2116
1838
|
const feeder = (key) => {
|
|
2117
|
-
const up = SchematicChart.word(byId.get(key)[from]);
|
|
1839
|
+
const up = _chunkM4IQ5LIZcjs.SchematicChart.word(byId.get(key)[from]);
|
|
2118
1840
|
return up !== key && byId.has(up) ? up : null;
|
|
2119
1841
|
};
|
|
2120
1842
|
const seen = /* @__PURE__ */ new Set(), all = [];
|
|
@@ -2124,10 +1846,10 @@ var SingleLineDiagram = (_class16 = class extends SchematicChart {
|
|
|
2124
1846
|
const row = byId.get(key);
|
|
2125
1847
|
const element = {
|
|
2126
1848
|
id: key,
|
|
2127
|
-
kind: _nullishCoalesce(KINDS4.get(SchematicChart.word(row[kind]).toLowerCase().replace(/[\s_]+/g, "-")), () => ( "load")) /* Load */,
|
|
2128
|
-
label: SchematicChart.word(row[label2]) || key,
|
|
2129
|
-
rating: SchematicChart.word(row[rating]),
|
|
2130
|
-
voltage: SchematicChart.word(row[voltage]) || (_nullishCoalesce(_optionalChain([parent, 'optionalAccess',
|
|
1849
|
+
kind: _nullishCoalesce(KINDS4.get(_chunkM4IQ5LIZcjs.SchematicChart.word(row[kind]).toLowerCase().replace(/[\s_]+/g, "-")), () => ( "load")) /* Load */,
|
|
1850
|
+
label: _chunkM4IQ5LIZcjs.SchematicChart.word(row[label2]) || key,
|
|
1851
|
+
rating: _chunkM4IQ5LIZcjs.SchematicChart.word(row[rating]),
|
|
1852
|
+
voltage: _chunkM4IQ5LIZcjs.SchematicChart.word(row[voltage]) || (_nullishCoalesce(_optionalChain([parent, 'optionalAccess', _26 => _26.voltage]), () => ( ""))),
|
|
2131
1853
|
parent,
|
|
2132
1854
|
children: [],
|
|
2133
1855
|
depth: parent ? parent.depth + 1 : 0,
|
|
@@ -2171,7 +1893,7 @@ var SingleLineDiagram = (_class16 = class extends SchematicChart {
|
|
|
2171
1893
|
const tip = (spot) => ({
|
|
2172
1894
|
title: spot.element.label,
|
|
2173
1895
|
color: color(spot.element),
|
|
2174
|
-
rows: [["Type", NAME5[spot.element.kind]], ...spot.element.rating ? [["Rating", spot.element.rating]] : [], ...spot.element.voltage ? [["Voltage", spot.element.voltage]] : [], ["Fed from", _nullishCoalesce(_optionalChain([spot, 'access',
|
|
1896
|
+
rows: [["Type", NAME5[spot.element.kind]], ...spot.element.rating ? [["Rating", spot.element.rating]] : [], ...spot.element.voltage ? [["Voltage", spot.element.voltage]] : [], ["Fed from", _nullishCoalesce(_optionalChain([spot, 'access', _27 => _27.element, 'access', _28 => _28.parent, 'optionalAccess', _29 => _29.label]), () => ( "Nothing"))]]
|
|
2175
1897
|
});
|
|
2176
1898
|
const rails = ctx.marks("buses", "rect", bars, (bar) => bar.element.id).attr("rx", 1.5).attr("fill", (bar) => color(bar.element));
|
|
2177
1899
|
ctx.set(rails, { x: (bar) => bar.left, y: (bar) => bar.top, width: (bar) => bar.width, height: (bar) => bar.height });
|
|
@@ -2189,152 +1911,24 @@ var SingleLineDiagram = (_class16 = class extends SchematicChart {
|
|
|
2189
1911
|
const { element } = spot, bar = bars.find((item) => item.element === element), detail = ratings && twoLines && !bar ? element.rating : "";
|
|
2190
1912
|
if (bar && down) {
|
|
2191
1913
|
const room = spot.x - bar.left - 6, aside = room < 30;
|
|
2192
|
-
notes.push({ key: element.id, text: SchematicLabel.fit(element.label, aside ? width - bar.left - bar.width - 6 : room), x: aside ? bar.left + bar.width + 4 : bar.left, y: aside ? spot.y : spot.y - 8, anchor: "start", halo: true });
|
|
1914
|
+
notes.push({ key: element.id, text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(element.label, aside ? width - bar.left - bar.width - 6 : room), x: aside ? bar.left + bar.width + 4 : bar.left, y: aside ? spot.y : spot.y - 8, anchor: "start", halo: true });
|
|
2193
1915
|
} else if (bar) {
|
|
2194
1916
|
const above = bar.top - 7 >= 5;
|
|
2195
|
-
notes.push({ key: element.id, text: SchematicLabel.fit(element.label, step - 6), x: spot.x, y: above ? bar.top - 7 : bar.top + bar.height + 8, halo: true });
|
|
1917
|
+
notes.push({ key: element.id, text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(element.label, step - 6), x: spot.x, y: above ? bar.top - 7 : bar.top + bar.height + 8, halo: true });
|
|
2196
1918
|
} else if (down) {
|
|
2197
1919
|
const x = spot.x + size / 2 + 4, next = Math.min(width, ...spots.filter((other) => other.element.depth === element.depth && other.x > spot.x).map((other) => other.x - size / 2 - 4));
|
|
2198
1920
|
const room = next - x;
|
|
2199
|
-
notes.push({ key: element.id, text: SchematicLabel.fit(element.label, room), x, y: spot.y - (detail ? 5 : 0), anchor: "start" });
|
|
2200
|
-
if (detail) notes.push({ key: `${element.id}/rating`, text: SchematicLabel.fit(detail, room, 9), x, y: spot.y + 6, anchor: "start", size: 9, tone: "secondary" });
|
|
1921
|
+
notes.push({ key: element.id, text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(element.label, room), x, y: spot.y - (detail ? 5 : 0), anchor: "start" });
|
|
1922
|
+
if (detail) notes.push({ key: `${element.id}/rating`, text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(detail, room, 9), x, y: spot.y + 6, anchor: "start", size: 9, tone: "secondary" });
|
|
2201
1923
|
} else {
|
|
2202
|
-
notes.push({ key: element.id, text: SchematicLabel.fit(element.label, step - 6), x: spot.x, y: spot.y + size / 2 + 8 });
|
|
2203
|
-
if (detail) notes.push({ key: `${element.id}/rating`, text: SchematicLabel.fit(detail, step - 6, 9), x: spot.x, y: spot.y + size / 2 + 19, size: 9, tone: "secondary" });
|
|
1924
|
+
notes.push({ key: element.id, text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(element.label, step - 6), x: spot.x, y: spot.y + size / 2 + 8 });
|
|
1925
|
+
if (detail) notes.push({ key: `${element.id}/rating`, text: _chunkM4IQ5LIZcjs.SchematicLabel.fit(detail, step - 6, 9), x: spot.x, y: spot.y + size / 2 + 19, size: 9, tone: "secondary" });
|
|
2204
1926
|
}
|
|
2205
1927
|
}
|
|
2206
1928
|
this.notes(ctx, "labels", notes.filter((note) => note.text));
|
|
2207
1929
|
}
|
|
2208
1930
|
}, _class16.__initStatic11(), _class16);
|
|
2209
1931
|
|
|
2210
|
-
// src/charts/reliabilitycharts/WaferMap.ts
|
|
2211
|
-
var WaferMapEncoding = /* @__PURE__ */ ((WaferMapEncoding2) => {
|
|
2212
|
-
WaferMapEncoding2["Bin"] = "bin";
|
|
2213
|
-
WaferMapEncoding2["Value"] = "value";
|
|
2214
|
-
return WaferMapEncoding2;
|
|
2215
|
-
})(WaferMapEncoding || {});
|
|
2216
|
-
var WaferMapMark = /* @__PURE__ */ ((WaferMapMark2) => {
|
|
2217
|
-
WaferMapMark2["Notch"] = "notch";
|
|
2218
|
-
WaferMapMark2["Flat"] = "flat";
|
|
2219
|
-
return WaferMapMark2;
|
|
2220
|
-
})(WaferMapMark || {});
|
|
2221
|
-
var ZONES = ["Centre", "Middle", "Edge"];
|
|
2222
|
-
var n11 = (value) => +value.toFixed(2);
|
|
2223
|
-
var percent = (good, total) => total ? `${(100 * good / total).toFixed(1)}%` : "n/a";
|
|
2224
|
-
var WaferMap = (_class17 = class _WaferMap extends SchematicChart {
|
|
2225
|
-
static __initStatic12() {this.meta = {
|
|
2226
|
-
id: "wafer-map",
|
|
2227
|
-
name: "Wafer map",
|
|
2228
|
-
family: "matrix" /* Matrix */,
|
|
2229
|
-
dimension: 2 /* Two */,
|
|
2230
|
-
shape: "table" /* Table */,
|
|
2231
|
-
description: "Draws the dies of a semiconductor wafer in place, coloured by test bin or a measured value, with the notch or flat and the yield overall and by ring. The sample wafer is invented.",
|
|
2232
|
-
tags: ["wafer", "semiconductor", "die", "yield", "bin map", "probe", "defect"],
|
|
2233
|
-
sample: (seed) => ReliabilitySamples.wafer(seed),
|
|
2234
|
-
variants: {
|
|
2235
|
-
encoding: Object.values(WaferMapEncoding),
|
|
2236
|
-
mark: Object.values(WaferMapMark),
|
|
2237
|
-
zones: [false, true]
|
|
2238
|
-
}
|
|
2239
|
-
}}
|
|
2240
|
-
defaults() {
|
|
2241
|
-
return { x: "x", y: "y", bin: "bin", value: "value", passBin: "Pass", encoding: "bin" /* Bin */, mark: "notch" /* Notch */, zones: false };
|
|
2242
|
-
}
|
|
2243
|
-
/** The value ramp has its own key beside the wafer. */
|
|
2244
|
-
legendItems() {
|
|
2245
|
-
return this.options.encoding === "value" /* Value */ ? [] : super.legendItems();
|
|
2246
|
-
}
|
|
2247
|
-
/** Dies, wafer radius and yield. A position given twice keeps its first row. */
|
|
2248
|
-
summary() {
|
|
2249
|
-
const { x, y, bin, value, passBin } = this.options;
|
|
2250
|
-
const seen = /* @__PURE__ */ new Map();
|
|
2251
|
-
for (const row of this.rows()) {
|
|
2252
|
-
const column = SchematicChart.number(row[x]), line = SchematicChart.number(row[y]);
|
|
2253
|
-
if (column === null || line === null || seen.has(`${column}/${line}`)) continue;
|
|
2254
|
-
seen.set(`${column}/${line}`, { x: column, y: line, bin: SchematicChart.word(row[bin]), value: SchematicChart.number(row[value]), reach: 0 });
|
|
2255
|
-
}
|
|
2256
|
-
const dies = [...seen.values()], xs = dies.map((die) => die.x), ys = dies.map((die) => die.y);
|
|
2257
|
-
const centre = dies.length ? [(Math.min(...xs) + Math.max(...xs)) / 2, (Math.min(...ys) + Math.max(...ys)) / 2] : [0, 0];
|
|
2258
|
-
const radius = Math.max(0.5, ...dies.map((die) => Math.hypot(Math.abs(die.x - centre[0]) + 0.5, Math.abs(die.y - centre[1]) + 0.5)));
|
|
2259
|
-
const zones = ZONES.map((name) => ({ name, good: 0, total: 0 }));
|
|
2260
|
-
let good = 0;
|
|
2261
|
-
for (const die of dies) {
|
|
2262
|
-
die.reach = Math.hypot(die.x - centre[0], die.y - centre[1]) / radius;
|
|
2263
|
-
const zone = zones[Math.min(2, Math.floor(die.reach * 3))], pass = die.bin === passBin;
|
|
2264
|
-
zone.total++;
|
|
2265
|
-
if (pass) {
|
|
2266
|
-
zone.good++;
|
|
2267
|
-
good++;
|
|
2268
|
-
}
|
|
2269
|
-
}
|
|
2270
|
-
return { dies, centre, radius, good, zones };
|
|
2271
|
-
}
|
|
2272
|
-
/** The wafer's edge around the origin: a V notch, or a flat no higher than `floor`, the lowest die edge. */
|
|
2273
|
-
static outline(radius, mark, floor = 0) {
|
|
2274
|
-
if (mark === "flat" /* Flat */) {
|
|
2275
|
-
const chord = Math.min(radius * 0.995, Math.max(radius * 0.93, floor + 1)), half2 = Math.sqrt(radius * radius - chord * chord);
|
|
2276
|
-
return `M${n11(half2)},${n11(chord)} A${n11(radius)},${n11(radius)} 0 1 0 ${n11(-half2)},${n11(chord)} Z`;
|
|
2277
|
-
}
|
|
2278
|
-
const depth = Math.max(4, radius * 0.05), half = depth * 0.8, drop = Math.sqrt(radius * radius - half * half);
|
|
2279
|
-
return `M${n11(half)},${n11(drop)} A${n11(radius)},${n11(radius)} 0 1 0 ${n11(-half)},${n11(drop)} L0,${n11(radius - depth)} Z`;
|
|
2280
|
-
}
|
|
2281
|
-
draw(ctx) {
|
|
2282
|
-
const { width, height } = ctx.plot, { encoding, mark, zones, value, bin } = this.options, { theme, palette } = ctx;
|
|
2283
|
-
const { dies, centre, radius, good, zones: rings } = this.summary();
|
|
2284
|
-
const panel = Math.max(84, Math.min(150, width * 0.3)), side = Math.max(20, Math.min(height, width - panel - 10));
|
|
2285
|
-
const reach = side / 2 - 2, pitch = reach / radius, wx = side / 2, wy = height / 2;
|
|
2286
|
-
const byValue = encoding === "value" /* Value */;
|
|
2287
|
-
const values = dies.map((die) => die.value).filter((v) => v !== null);
|
|
2288
|
-
const low = Math.min(...values), span = Math.max(...values) - low || 1;
|
|
2289
|
-
const counts = /* @__PURE__ */ new Map();
|
|
2290
|
-
for (const die of dies) counts.set(die.bin, (_nullishCoalesce(counts.get(die.bin), () => ( 0))) + 1);
|
|
2291
|
-
if (!byValue) [...counts].sort((a, b) => b[1] - a[1]).forEach(([name]) => palette.color(name || "Unbinned"));
|
|
2292
|
-
const color = (die) => byValue ? die.value === null ? theme.grid : palette.sequential((die.value - low) / span) : palette.color(die.bin || "Unbinned");
|
|
2293
|
-
const gap = pitch >= 9 ? 1 : pitch >= 5 ? 0.5 : 0;
|
|
2294
|
-
const cells = ctx.marks("cells", "rect", dies, (die) => `${die.x}/${die.y}`).attr("fill", color).attr("rx", pitch >= 9 ? 1.5 : 0);
|
|
2295
|
-
ctx.set(cells, { x: (die) => wx + (die.x - centre[0] - 0.5) * pitch + gap, y: (die) => wy + (die.y - centre[1] - 0.5) * pitch + gap, width: Math.max(0.5, pitch - 2 * gap), height: Math.max(0.5, pitch - 2 * gap) });
|
|
2296
|
-
ctx.hover(cells, (die) => ({
|
|
2297
|
-
title: `Die ${die.x}, ${die.y}`,
|
|
2298
|
-
color: color(die),
|
|
2299
|
-
rows: [[bin, die.bin || "n/a"], ...die.value === null ? [] : [[value, +die.value.toPrecision(4)]], ["Ring", ZONES[Math.min(2, Math.floor(die.reach * 3))]]]
|
|
2300
|
-
}));
|
|
2301
|
-
const floor = Math.max(0, ...dies.map((die) => (die.y - centre[1] + 0.5) * pitch));
|
|
2302
|
-
const edge = ctx.marks("axis-wafer", "path", dies.length ? [_WaferMap.outline(reach, mark, floor)] : []).attr("fill", "none").attr("stroke", theme.axis).attr("stroke-width", 1.5).attr("transform", `translate(${n11(wx)},${n11(wy)})`);
|
|
2303
|
-
ctx.set(edge, { d: (d) => d });
|
|
2304
|
-
const circles = ctx.marks("rings", "circle", zones && dies.length ? [1 / 3, 2 / 3] : []).attr("fill", "none").attr("stroke", theme.ink).attr("stroke-width", 1.5).attr("stroke-dasharray", "4 3");
|
|
2305
|
-
ctx.set(circles, { cx: wx, cy: wy, r: (share) => share * reach });
|
|
2306
|
-
circles.style("pointer-events", "none");
|
|
2307
|
-
const left = side + 12, room = width - left, notes = [];
|
|
2308
|
-
let y = Math.max(8, height / 2 - (60 + (zones ? 62 : 0) + (byValue ? 44 : 0)) / 2);
|
|
2309
|
-
if (dies.length) {
|
|
2310
|
-
notes.push(
|
|
2311
|
-
{ key: "yield/title", text: "Yield", x: left, y: y + 6, anchor: "start", tone: "secondary" },
|
|
2312
|
-
{ key: "yield/value", text: percent(good, dies.length), x: left, y: y + 26, anchor: "start", size: Math.min(22, room / 3.6), weight: 600 },
|
|
2313
|
-
{ key: "yield/count", text: SchematicLabel.fit(`${good} of ${dies.length} dies`, room), x: left, y: y + 46, anchor: "start", tone: "secondary" }
|
|
2314
|
-
);
|
|
2315
|
-
y += 66;
|
|
2316
|
-
if (zones) {
|
|
2317
|
-
rings.forEach((ring, i) => notes.push(
|
|
2318
|
-
{ key: `zone/${ring.name}`, text: ring.name, x: left, y: y + 6 + i * 16, anchor: "start", tone: "secondary" },
|
|
2319
|
-
{ key: `zone/${ring.name}/value`, text: percent(ring.good, ring.total), x: left + Math.min(room, 96), y: y + 6 + i * 16, anchor: "end", weight: 600 }
|
|
2320
|
-
));
|
|
2321
|
-
y += 62;
|
|
2322
|
-
}
|
|
2323
|
-
}
|
|
2324
|
-
const steps = byValue && values.length ? Array.from({ length: 24 }, (_, i) => i) : [], keyWidth = Math.min(room, 110);
|
|
2325
|
-
const ramp = ctx.marks("size-key", "rect", steps, (i) => i).attr("fill", (i) => palette.sequential(i / 23));
|
|
2326
|
-
ctx.set(ramp, { x: (i) => left + i * keyWidth / 24, y: y + 14, width: keyWidth / 24 + 0.5, height: 8 });
|
|
2327
|
-
if (steps.length) {
|
|
2328
|
-
notes.push(
|
|
2329
|
-
{ key: "key/title", text: SchematicLabel.fit(value, room), x: left, y: y + 5, anchor: "start", tone: "secondary" },
|
|
2330
|
-
{ key: "key/low", text: `${+low.toPrecision(3)}`, x: left, y: y + 31, anchor: "start", size: 9, tone: "secondary" },
|
|
2331
|
-
{ key: "key/high", text: `${+(low + span).toPrecision(3)}`, x: left + keyWidth, y: y + 31, anchor: "end", size: 9, tone: "secondary" }
|
|
2332
|
-
);
|
|
2333
|
-
}
|
|
2334
|
-
this.notes(ctx, "labels", notes);
|
|
2335
|
-
}
|
|
2336
|
-
}, _class17.__initStatic12(), _class17);
|
|
2337
|
-
|
|
2338
1932
|
// src/charts/reliabilitycharts/index.ts
|
|
2339
1933
|
var reliabilitychartsCatalog = [
|
|
2340
1934
|
FaultTreeDiagram,
|
|
@@ -2343,7 +1937,7 @@ var reliabilitychartsCatalog = [
|
|
|
2343
1937
|
ReliabilityBlockDiagram,
|
|
2344
1938
|
AllanDeviationPlot,
|
|
2345
1939
|
ShmooPlot,
|
|
2346
|
-
WaferMap,
|
|
1940
|
+
_chunkM4IQ5LIZcjs.WaferMap,
|
|
2347
1941
|
JitterBathtubCurve,
|
|
2348
1942
|
PipingInstrumentDiagram,
|
|
2349
1943
|
SingleLineDiagram,
|
|
@@ -2386,7 +1980,4 @@ var reliabilitychartsCatalog = [
|
|
|
2386
1980
|
|
|
2387
1981
|
|
|
2388
1982
|
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
exports.AllanEstimator = AllanEstimator; exports.AllanDeviationPlot = AllanDeviationPlot; exports.BowTieLinks = BowTieLinks; exports.BowTieBarriers = BowTieBarriers; exports.BowTieDiagram = BowTieDiagram; exports.ControlBlockKind = ControlBlockKind; exports.ControlSignalRole = ControlSignalRole; exports.ControlJunction = ControlJunction; exports.ControlFeedback = ControlFeedback; exports.ControlBlockDiagram = ControlBlockDiagram; exports.EventTreeModel = EventTreeModel; exports.EventTreeLinks = EventTreeLinks; exports.EventTreeDiagram = EventTreeDiagram; exports.FaultTreeGate = FaultTreeGate; exports.FaultTreeModel = FaultTreeModel; exports.FaultTreeLeaves = FaultTreeLeaves; exports.FaultTreeDiagram = FaultTreeDiagram; exports.JitterBathtubScale = JitterBathtubScale; exports.JitterBathtubCurve = JitterBathtubCurve; exports.LadderKind = LadderKind; exports.LadderProgram = LadderProgram; exports.LadderOutputs = LadderOutputs; exports.LadderLogicDiagram = LadderLogicDiagram; exports.PidSymbolKind = PidSymbolKind; exports.PidRouting = PidRouting; exports.PipingInstrumentDiagram = PipingInstrumentDiagram; exports.ReliabilityBlockModel = ReliabilityBlockModel; exports.ReliabilityBlockDiagram = ReliabilityBlockDiagram; exports.ShmooForm = ShmooForm; exports.ShmooPlot = ShmooPlot; exports.SingleLineKind = SingleLineKind; exports.SingleLineSymbols = SingleLineSymbols; exports.SingleLineDiagram = SingleLineDiagram; exports.WaferMapEncoding = WaferMapEncoding; exports.WaferMapMark = WaferMapMark; exports.WaferMap = WaferMap; exports.reliabilitychartsCatalog = reliabilitychartsCatalog;
|
|
1983
|
+
exports.AllanEstimator = AllanEstimator; exports.AllanDeviationPlot = AllanDeviationPlot; exports.BowTieLinks = BowTieLinks; exports.BowTieBarriers = BowTieBarriers; exports.BowTieDiagram = BowTieDiagram; exports.ControlBlockKind = ControlBlockKind; exports.ControlSignalRole = ControlSignalRole; exports.ControlJunction = ControlJunction; exports.ControlFeedback = ControlFeedback; exports.ControlBlockDiagram = ControlBlockDiagram; exports.EventTreeModel = EventTreeModel; exports.EventTreeLinks = EventTreeLinks; exports.EventTreeDiagram = EventTreeDiagram; exports.FaultTreeGate = FaultTreeGate; exports.FaultTreeModel = FaultTreeModel; exports.FaultTreeLeaves = FaultTreeLeaves; exports.FaultTreeDiagram = FaultTreeDiagram; exports.JitterBathtubScale = JitterBathtubScale; exports.JitterBathtubCurve = JitterBathtubCurve; exports.LadderKind = LadderKind; exports.LadderProgram = LadderProgram; exports.LadderOutputs = LadderOutputs; exports.LadderLogicDiagram = LadderLogicDiagram; exports.PidSymbolKind = PidSymbolKind; exports.PidRouting = PidRouting; exports.PipingInstrumentDiagram = PipingInstrumentDiagram; exports.ReliabilityBlockModel = ReliabilityBlockModel; exports.ReliabilityBlockDiagram = ReliabilityBlockDiagram; exports.ShmooForm = ShmooForm; exports.ShmooPlot = ShmooPlot; exports.SingleLineKind = SingleLineKind; exports.SingleLineSymbols = SingleLineSymbols; exports.SingleLineDiagram = SingleLineDiagram; exports.reliabilitychartsCatalog = reliabilitychartsCatalog;
|