@diagrammo/dgmo 0.46.0 → 0.48.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/dist/advanced.d.ts +3 -855
- package/dist/advanced.js +541 -70107
- package/dist/analyzer-UYKBXAKR.js +15 -0
- package/dist/auto.js +1 -1
- package/dist/auto.mjs +1 -1
- package/dist/block.js +83 -69417
- package/dist/calculator-LDYQCDDY.js +11 -0
- package/dist/charts-d3-QOZHKTCT.js +25 -0
- package/dist/chunk-2DXMZRWJ.js +800 -0
- package/dist/chunk-2LACINWN.js +786 -0
- package/dist/chunk-33LCUH4H.js +893 -0
- package/dist/chunk-3CIOJ5YJ.js +35 -0
- package/dist/chunk-3HDBAXF5.js +86 -0
- package/dist/chunk-3JLKYGBQ.js +290 -0
- package/dist/chunk-3MQQNXPD.js +415 -0
- package/dist/chunk-3R5POCTZ.js +967 -0
- package/dist/chunk-3SMGIJDD.js +112 -0
- package/dist/chunk-44CM72SQ.js +409 -0
- package/dist/chunk-4GRI7MEB.js +1604 -0
- package/dist/chunk-4OHACBGX.js +606 -0
- package/dist/chunk-5DH3KYFH.js +21 -0
- package/dist/chunk-5MLYVTYM.js +76 -0
- package/dist/chunk-5QXL4NYS.js +553 -0
- package/dist/chunk-5WRI5ZAA.js +31 -0
- package/dist/chunk-6EK55ART.js +117 -0
- package/dist/chunk-6FZYCKXB.js +2065 -0
- package/dist/chunk-6HO5ZTXK.js +277 -0
- package/dist/chunk-6KFWC4CO.js +7 -0
- package/dist/chunk-6MTWIQVO.js +121 -0
- package/dist/chunk-6NYWYNBI.js +329 -0
- package/dist/chunk-6SM5NJQH.js +620 -0
- package/dist/chunk-725LDASD.js +422 -0
- package/dist/chunk-76OWZ3BA.js +130 -0
- package/{src/block/parser.ts → dist/chunk-7JEGTRLD.js} +100 -189
- package/dist/chunk-A44USUV7.js +923 -0
- package/dist/chunk-A4GOY3PE.js +25 -0
- package/dist/chunk-A4VFQH5G.js +251 -0
- package/dist/chunk-AELOBFW5.js +375 -0
- package/dist/chunk-AN2MOO5T.js +522 -0
- package/dist/chunk-BMR4CIEO.js +41 -0
- package/dist/chunk-BS7SV7C3.js +51 -0
- package/dist/chunk-BUPDIHML.js +613 -0
- package/dist/chunk-BUVJFRPY.js +887 -0
- package/dist/chunk-C3Z4DX3V.js +112 -0
- package/dist/chunk-CI2G3OEB.js +1818 -0
- package/dist/chunk-CKNVO24D.js +54 -0
- package/dist/chunk-CUVHQHZ7.js +391 -0
- package/dist/chunk-CXK4DZH3.js +114 -0
- package/dist/{editor.cjs → chunk-DKEPS5LH.js} +14 -225
- package/dist/chunk-DU7W62N5.js +487 -0
- package/dist/chunk-DZAQBW35.js +751 -0
- package/dist/chunk-EB6FPQUP.js +316 -0
- package/dist/chunk-EMS2SK26.js +376 -0
- package/dist/chunk-ERLBPDGU.js +510 -0
- package/dist/chunk-EVCVDTXE.js +732 -0
- package/dist/chunk-FCIIHT24.js +384 -0
- package/dist/chunk-FFUN5D66.js +97 -0
- package/dist/chunk-FITOLXSX.js +714 -0
- package/dist/chunk-FMDSF3OV.js +68 -0
- package/dist/chunk-FNB3PNGF.js +410 -0
- package/dist/chunk-G2H74XJZ.js +2104 -0
- package/dist/chunk-GMR5MFHJ.js +339 -0
- package/dist/chunk-H6PI3KJT.js +305 -0
- package/dist/chunk-I46X5VUA.js +59 -0
- package/dist/chunk-I5IGB56C.js +255 -0
- package/dist/chunk-IH6ZMVQ5.js +3950 -0
- package/dist/chunk-IJZFN3HM.js +463 -0
- package/dist/chunk-IPWPWM6R.js +3079 -0
- package/dist/chunk-IYULMRBE.js +23 -0
- package/dist/chunk-IZMRON6C.js +167 -0
- package/dist/chunk-J5FIXQRT.js +813 -0
- package/dist/chunk-JED6ZDEE.js +73 -0
- package/dist/chunk-JEUJOX5X.js +136 -0
- package/dist/chunk-JM4LEPY3.js +436 -0
- package/dist/chunk-L3UHP6TD.js +101 -0
- package/dist/chunk-L66GEFB6.js +524 -0
- package/dist/chunk-LIOHW36Z.js +469 -0
- package/dist/chunk-LP7EC4MI.js +16 -0
- package/dist/chunk-MITI6NOL.js +548 -0
- package/dist/chunk-MO5YHHMQ.js +168 -0
- package/dist/chunk-MZSBFAPJ.js +885 -0
- package/dist/chunk-NNAAJVBU.js +9 -0
- package/dist/chunk-NOTA6TEI.js +47 -0
- package/dist/chunk-NURGB5Z4.js +335 -0
- package/dist/chunk-NX4EQS3U.js +1062 -0
- package/dist/chunk-NXMESY4J.js +1 -0
- package/dist/chunk-OJR3MQYV.js +1458 -0
- package/dist/chunk-OURHMODR.js +454 -0
- package/dist/chunk-P235SVAH.js +1057 -0
- package/dist/chunk-P4RH4OSP.js +1038 -0
- package/dist/chunk-P6T66CCZ.js +226 -0
- package/dist/chunk-PBAHEPLQ.js +223 -0
- package/dist/chunk-PBHE5UG6.js +1530 -0
- package/dist/chunk-PDKUANDZ.js +35 -0
- package/dist/chunk-PWIHZ6NJ.js +296 -0
- package/{src/c4/layout.ts → dist/chunk-QEBUY5NY.js} +384 -1140
- package/dist/chunk-QLCCJEJI.js +253 -0
- package/dist/chunk-QOOUC2J5.js +52 -0
- package/dist/chunk-QYTPPDAO.js +402 -0
- package/dist/chunk-R3XI2VC7.js +801 -0
- package/dist/chunk-RCERWOJR.js +154 -0
- package/dist/chunk-RJE5JTVK.js +362 -0
- package/dist/chunk-RTLBSQ3G.js +1155 -0
- package/dist/chunk-RUNNI6VE.js +448 -0
- package/dist/chunk-RVMRZAPB.js +354 -0
- package/dist/chunk-RYEGFMUO.js +955 -0
- package/dist/chunk-RZCF2VVM.js +528 -0
- package/dist/chunk-SML67VPV.js +1025 -0
- package/dist/chunk-SQ7IY53Q.js +44 -0
- package/dist/chunk-SQAG3UXH.js +161 -0
- package/dist/chunk-SRTU6HMQ.js +1851 -0
- package/dist/chunk-T2OE3YQB.js +550 -0
- package/dist/chunk-T3UBLACL.js +299 -0
- package/dist/chunk-TLVIHFRO.js +296 -0
- package/dist/chunk-TYS6CSS5.js +52 -0
- package/dist/chunk-U6EQI3U6.js +130 -0
- package/dist/chunk-UJ4FJLBF.js +86 -0
- package/dist/chunk-ULOEATBZ.js +347 -0
- package/dist/chunk-UNCCZ3NU.js +127 -0
- package/dist/chunk-USZW2HHU.js +197 -0
- package/dist/chunk-UWN33VNX.js +1610 -0
- package/dist/chunk-UZ7EZW3B.js +40 -0
- package/dist/chunk-VOKGH627.js +37 -0
- package/dist/chunk-WBRZJOEC.js +204 -0
- package/dist/chunk-WCSOJFU3.js +380 -0
- package/dist/chunk-WCT3NYCV.js +160 -0
- package/dist/chunk-WVAJFAIA.js +529 -0
- package/dist/chunk-X5LCYCL5.js +394 -0
- package/dist/chunk-XAKEUMEJ.js +1256 -0
- package/dist/chunk-Y2ZE3MSG.js +590 -0
- package/dist/chunk-Y3J7VR52.js +646 -0
- package/dist/chunk-Y5QGVTVC.js +33 -0
- package/dist/chunk-YAA6IID3.js +548 -0
- package/dist/chunk-YGJTDXVR.js +692 -0
- package/{src/utils/time-ticks.ts → dist/chunk-YRYKTYMQ.js} +45 -112
- package/dist/chunk-YYVTBZZC.js +61 -0
- package/dist/chunk-Z5CGSFJB.js +647 -0
- package/{src/gantt/calculator.ts → dist/chunk-Z72XRXD4.js} +236 -428
- package/dist/chunk-ZGR7ULFJ.js +978 -0
- package/dist/chunk-ZJEL4H2R.js +851 -0
- package/dist/chunk-ZO27FGJS.js +554 -0
- package/dist/collapse-CLPJD2RL.js +11 -0
- package/dist/collapse-SLINJQW6.js +9 -0
- package/dist/collapse-ZWUFFCK2.js +9 -0
- package/dist/compute-G55RG53N.js +8 -0
- package/dist/dgmo-router-DZCIDUO5.js +73 -0
- package/dist/dimensions-J3FHIMJ6.js +22 -0
- package/dist/element.js +1 -1
- package/dist/element.mjs +1 -1
- package/dist/flowchart-parser-ZNSKIBVR.js +21 -0
- package/dist/flowchart-renderer-ZAEOL4DX.js +35 -0
- package/dist/index.d.ts +3 -469
- package/dist/index.js +137 -69685
- package/dist/layout-46N4JJYK.js +17 -0
- package/dist/layout-5RA6QWR6.js +26 -0
- package/dist/layout-5T6RH5M6.js +14 -0
- package/dist/layout-7QXCNOVS.js +13 -0
- package/dist/layout-EE6GE46Y.js +17 -0
- package/dist/layout-G23F7LDH.js +9 -0
- package/dist/layout-HRBZPFCN.js +23 -0
- package/dist/layout-HWDSRX5E.js +20 -0
- package/dist/layout-HYZPWAK5.js +18 -0
- package/dist/layout-N76NR4ZO.js +19 -0
- package/dist/layout-OB3RI63S.js +14 -0
- package/dist/layout-S2QBYSK2.js +15 -0
- package/dist/layout-UM5F4DJB.js +15 -0
- package/dist/layout-search-OYV77HHS.js +1655 -0
- package/dist/load-data-EHDDZ5ZS.js +8 -0
- package/dist/palettes-PRJ2RI6D.js +56 -0
- package/dist/parser-2MFP2H2E.js +11 -0
- package/dist/parser-3STE62GB.js +21 -0
- package/dist/parser-4FL2CMDG.js +18 -0
- package/dist/parser-4OGOBJJ4.js +13 -0
- package/dist/parser-6BTRLKRZ.js +15 -0
- package/dist/parser-AQETEVRW.js +21 -0
- package/dist/parser-CFZD5IBL.js +12 -0
- package/dist/parser-FUSKFGZN.js +16 -0
- package/dist/parser-I6KXEYFK.js +13 -0
- package/dist/parser-IXSZZQHY.js +18 -0
- package/dist/parser-JAL2HD4I.js +13 -0
- package/dist/parser-KNSQSKQO.js +20 -0
- package/dist/parser-N5O4IHUN.js +13 -0
- package/dist/parser-NGU3ETO6.js +16 -0
- package/dist/parser-NRAI6O25.js +19 -0
- package/dist/parser-O5J4VBII.js +11 -0
- package/dist/parser-OV7NOBW6.js +21 -0
- package/dist/parser-PQ3POX45.js +23 -0
- package/dist/parser-TFZFBVWN.js +11 -0
- package/dist/parser-TRTHDFPP.js +18 -0
- package/dist/parser-VQP2UJ6W.js +11 -0
- package/dist/parser-XDVELHRK.js +13 -0
- package/dist/parser-XKRP7QKP.js +11 -0
- package/dist/parser-Y6WTBU76.js +14 -0
- package/dist/parser-ZSDPZYQP.js +12 -0
- package/dist/renderer-2XQQQ6QR.js +28 -0
- package/dist/renderer-5NDVNDAZ.js +26 -0
- package/dist/renderer-6EEZHMH4.js +26 -0
- package/dist/renderer-6W5462RB.js +43 -0
- package/dist/renderer-7MVLWWQD.js +22 -0
- package/dist/renderer-AWWAF6XD.js +33 -0
- package/dist/renderer-BYCNMBF7.js +34 -0
- package/dist/renderer-CLJHQPBJ.js +29 -0
- package/dist/renderer-GHPZMFU2.js +15 -0
- package/dist/renderer-JGBKUCZD.js +16 -0
- package/dist/renderer-KQB7UGDS.js +19 -0
- package/dist/renderer-PGX2TKVS.js +24 -0
- package/dist/renderer-QIWVHWZO.js +15 -0
- package/dist/renderer-RPOA5YPZ.js +35 -0
- package/dist/renderer-SMIBCRVB.js +24 -0
- package/dist/renderer-T7YKC5VP.js +28 -0
- package/dist/renderer-TOCOVLHS.js +37 -0
- package/dist/renderer-UWA5XS74.js +39 -0
- package/dist/renderer-VACVQYML.js +25 -0
- package/dist/renderer-W4M6QLIJ.js +37 -0
- package/dist/renderer-WZRREQ2P.js +23 -0
- package/dist/renderer-YY2OSF6E.js +27 -0
- package/dist/renderer-Z7I3W2PP.js +24 -0
- package/dist/renderer-ZGNTUWC4.js +22 -0
- package/dist/renderer-ZTR3DER3.js +19 -0
- package/dist/renderer-radial-C32GPJQ7.js +21 -0
- package/dist/resolver-NOAA7ID7.js +13 -0
- package/dist/state-collapse-HCGD6IVJ.js +8 -0
- package/dist/state-parser-Z2V23ATR.js +18 -0
- package/dist/state-renderer-RFYHSP4K.js +34 -0
- package/dist/themes-1-CuKpeH.d.ts +908 -0
- package/package.json +19 -70
- package/dist/advanced.cjs +0 -71648
- package/dist/advanced.d.cts +0 -6571
- package/dist/auto.cjs +0 -70648
- package/dist/auto.d.cts +0 -54
- package/dist/block.cjs +0 -70208
- package/dist/block.d.cts +0 -115
- package/dist/editor.d.cts +0 -26
- package/dist/element.cjs +0 -70530
- package/dist/element.d.cts +0 -62
- package/dist/highlight.cjs +0 -852
- package/dist/highlight.d.cts +0 -49
- package/dist/index.cjs +0 -70491
- package/dist/index.d.cts +0 -626
- package/dist/pert.cjs +0 -325
- package/dist/pert.d.cts +0 -559
- package/src/advanced.ts +0 -873
- package/src/arc/parser.ts +0 -15
- package/src/arc/renderer.ts +0 -633
- package/src/auto/index.ts +0 -621
- package/src/auto/shared.ts +0 -370
- package/src/auto/styles.ts +0 -73
- package/src/block/layout.ts +0 -198
- package/src/block/renderer.ts +0 -484
- package/src/block/types.ts +0 -67
- package/src/boxes-and-lines/collapse.ts +0 -96
- package/src/boxes-and-lines/focus.ts +0 -257
- package/src/boxes-and-lines/label-placement.ts +0 -339
- package/src/boxes-and-lines/layout-grouped.ts +0 -912
- package/src/boxes-and-lines/layout-layered.ts +0 -722
- package/src/boxes-and-lines/layout-search.ts +0 -1678
- package/src/boxes-and-lines/layout.ts +0 -398
- package/src/boxes-and-lines/parser.ts +0 -1181
- package/src/boxes-and-lines/renderer.ts +0 -1465
- package/src/boxes-and-lines/types.ts +0 -66
- package/src/c4/parser.ts +0 -1158
- package/src/c4/renderer.ts +0 -2008
- package/src/c4/types.ts +0 -89
- package/src/chart-type-registry.ts +0 -529
- package/src/chart-types.ts +0 -225
- package/src/chart.ts +0 -685
- package/src/charts-d3/bar.ts +0 -338
- package/src/charts-d3/chord.ts +0 -140
- package/src/charts-d3/function.ts +0 -147
- package/src/charts-d3/funnel.ts +0 -104
- package/src/charts-d3/heatmap.ts +0 -145
- package/src/charts-d3/index.ts +0 -337
- package/src/charts-d3/interactions.ts +0 -477
- package/src/charts-d3/line.ts +0 -344
- package/src/charts-d3/mount.ts +0 -151
- package/src/charts-d3/pie.ts +0 -117
- package/src/charts-d3/polar.ts +0 -89
- package/src/charts-d3/radar.ts +0 -0
- package/src/charts-d3/sankey.ts +0 -0
- package/src/charts-d3/scatter.ts +0 -185
- package/src/charts-d3/shared.ts +0 -208
- package/src/class/layout.ts +0 -326
- package/src/class/parser.ts +0 -635
- package/src/class/renderer.ts +0 -793
- package/src/class/types.ts +0 -58
- package/src/cli-banner.ts +0 -106
- package/src/cli.ts +0 -1080
- package/src/colors-diagnostics.ts +0 -35
- package/src/colors.ts +0 -379
- package/src/completion-types.ts +0 -27
- package/src/completion.ts +0 -2668
- package/src/cycle/layout.ts +0 -1026
- package/src/cycle/parser.ts +0 -387
- package/src/cycle/renderer.ts +0 -653
- package/src/cycle/types.ts +0 -101
- package/src/d3.ts +0 -1434
- package/src/data-chart-parser.ts +0 -1007
- package/src/dgmo-router.ts +0 -296
- package/src/diagnostics-registry.ts +0 -108
- package/src/diagnostics.ts +0 -0
- package/src/dimensions.ts +0 -20
- package/src/directives-registry.ts +0 -396
- package/src/editor/dgmo.grammar +0 -76
- package/src/editor/dgmo.grammar.d.ts +0 -2
- package/src/editor/dgmo.grammar.js +0 -18
- package/src/editor/dgmo.grammar.terms.d.ts +0 -5
- package/src/editor/dgmo.grammar.terms.js +0 -35
- package/src/editor/highlight-api.ts +0 -596
- package/src/editor/highlight.ts +0 -36
- package/src/editor/index.ts +0 -27
- package/src/editor/keywords.ts +0 -128
- package/src/editor/tokens.ts +0 -30
- package/src/element/index.ts +0 -432
- package/src/embed/css.ts +0 -312
- package/src/embed/escape.ts +0 -15
- package/src/embed/index.ts +0 -280
- package/src/er/classify.ts +0 -228
- package/src/er/layout.ts +0 -530
- package/src/er/parser.ts +0 -750
- package/src/er/renderer.ts +0 -725
- package/src/er/types.ts +0 -52
- package/src/error-card.ts +0 -269
- package/src/event-line/diagnostics.ts +0 -117
- package/src/event-line/parser.ts +0 -643
- package/src/event-line/renderer.ts +0 -1742
- package/src/event-line/types.ts +0 -74
- package/src/fonts.ts +0 -3
- package/src/gantt/parser.ts +0 -1641
- package/src/gantt/renderer.ts +0 -3787
- package/src/gantt/resolver.ts +0 -172
- package/src/gantt/types.ts +0 -206
- package/src/graph/diagnostics.ts +0 -64
- package/src/graph/edge-spline.ts +0 -29
- package/src/graph/flowchart-parser.ts +0 -759
- package/src/graph/flowchart-renderer.ts +0 -817
- package/src/graph/layout.ts +0 -472
- package/src/graph/notes.ts +0 -21
- package/src/graph/state-collapse.ts +0 -78
- package/src/graph/state-parser.ts +0 -574
- package/src/graph/state-renderer.ts +0 -653
- package/src/graph/types.ts +0 -65
- package/src/index.ts +0 -261
- package/src/infra/compute.ts +0 -1385
- package/src/infra/layout.ts +0 -888
- package/src/infra/parser.ts +0 -1234
- package/src/infra/renderer.ts +0 -2534
- package/src/infra/roles.ts +0 -75
- package/src/infra/types.ts +0 -216
- package/src/infra/validation.ts +0 -201
- package/src/journey-map/layout.ts +0 -490
- package/src/journey-map/parser.ts +0 -557
- package/src/journey-map/renderer.ts +0 -1580
- package/src/journey-map/types.ts +0 -47
- package/src/kanban/mutations.ts +0 -175
- package/src/kanban/parser.ts +0 -509
- package/src/kanban/renderer.ts +0 -1449
- package/src/kanban/types.ts +0 -39
- package/src/label-layout.ts +0 -368
- package/src/map/colorize.ts +0 -54
- package/src/map/completion.ts +0 -316
- package/src/map/context-labels.ts +0 -609
- package/src/map/data/PROVENANCE.json +0 -1
- package/src/map/data/README.md +0 -40
- package/src/map/data/airport-collisions.json +0 -1
- package/src/map/data/airports.json +0 -1
- package/src/map/data/gazetteer.json +0 -1
- package/src/map/data/lakes.json +0 -1
- package/src/map/data/mountain-ranges.json +0 -1
- package/src/map/data/na-lakes.json +0 -1
- package/src/map/data/na-land.json +0 -1
- package/src/map/data/region-names.json +0 -1
- package/src/map/data/rivers.json +0 -1
- package/src/map/data/types.ts +0 -121
- package/src/map/data/us-states.json +0 -1
- package/src/map/data/water-bodies.json +0 -1
- package/src/map/data/world-coarse.json +0 -1
- package/src/map/data/world-detail.json +0 -1
- package/src/map/diagnostics.ts +0 -134
- package/src/map/dimensions.ts +0 -150
- package/src/map/geo-query.ts +0 -295
- package/src/map/geo.ts +0 -438
- package/src/map/invert.ts +0 -111
- package/src/map/layout.ts +0 -5069
- package/src/map/legend-band.ts +0 -127
- package/src/map/load-data.ts +0 -186
- package/src/map/parser.ts +0 -783
- package/src/map/renderer.ts +0 -1445
- package/src/map/resolved-types.ts +0 -160
- package/src/map/resolver.ts +0 -1146
- package/src/map/types.ts +0 -194
- package/src/mindmap/collapse.ts +0 -67
- package/src/mindmap/layout.ts +0 -649
- package/src/mindmap/parser.ts +0 -430
- package/src/mindmap/renderer.ts +0 -637
- package/src/mindmap/text-wrap.ts +0 -218
- package/src/mindmap/types.ts +0 -56
- package/src/org/collapse.ts +0 -151
- package/src/org/layout.ts +0 -1262
- package/src/org/parser.ts +0 -519
- package/src/org/renderer.ts +0 -866
- package/src/org/resolver.ts +0 -636
- package/src/palettes/atlas.ts +0 -77
- package/src/palettes/blueprint.ts +0 -73
- package/src/palettes/catppuccin.ts +0 -84
- package/src/palettes/color-utils.ts +0 -443
- package/src/palettes/index.ts +0 -67
- package/src/palettes/nord.ts +0 -67
- package/src/palettes/registry.ts +0 -114
- package/src/palettes/slate.ts +0 -73
- package/src/palettes/tidewater.ts +0 -73
- package/src/palettes/tokyo-night.ts +0 -86
- package/src/palettes/types.ts +0 -88
- package/src/pert/analyzer.ts +0 -1183
- package/src/pert/diagnostics.ts +0 -110
- package/src/pert/index.ts +0 -43
- package/src/pert/internal.ts +0 -252
- package/src/pert/layout.ts +0 -971
- package/src/pert/monte-carlo.ts +0 -446
- package/src/pert/parser.ts +0 -1606
- package/src/pert/renderer.ts +0 -4009
- package/src/pert/share-normalize.ts +0 -62
- package/src/pert/types.ts +0 -604
- package/src/pyramid/parser.ts +0 -185
- package/src/pyramid/renderer.ts +0 -768
- package/src/pyramid/types.ts +0 -28
- package/src/quadrant/parser.ts +0 -18
- package/src/quadrant/renderer.ts +0 -638
- package/src/raci/diagnostics.ts +0 -213
- package/src/raci/index.ts +0 -23
- package/src/raci/mutations.ts +0 -321
- package/src/raci/parser.ts +0 -699
- package/src/raci/renderer.ts +0 -1627
- package/src/raci/types.ts +0 -82
- package/src/raci/variants.ts +0 -320
- package/src/render.ts +0 -268
- package/src/ring/parser.ts +0 -212
- package/src/ring/renderer.ts +0 -490
- package/src/ring/types.ts +0 -27
- package/src/sequence/collapse.ts +0 -174
- package/src/sequence/parser.ts +0 -1596
- package/src/sequence/participant-inference.ts +0 -152
- package/src/sequence/renderer.ts +0 -3168
- package/src/sequence/tag-resolution.ts +0 -164
- package/src/sharing.ts +0 -211
- package/src/sitemap/collapse.ts +0 -100
- package/src/sitemap/layout.ts +0 -925
- package/src/sitemap/parser.ts +0 -755
- package/src/sitemap/renderer.ts +0 -828
- package/src/sitemap/types.ts +0 -42
- package/src/slope/parser.ts +0 -18
- package/src/slope/renderer.ts +0 -378
- package/src/swimlane/diagnostics.ts +0 -94
- package/src/swimlane/layout.ts +0 -597
- package/src/swimlane/parser.ts +0 -613
- package/src/swimlane/renderer.ts +0 -681
- package/src/swimlane/types.ts +0 -151
- package/src/tech-radar/interactive.ts +0 -1129
- package/src/tech-radar/layout.ts +0 -197
- package/src/tech-radar/parser.ts +0 -436
- package/src/tech-radar/renderer.ts +0 -1239
- package/src/tech-radar/shared.ts +0 -151
- package/src/tech-radar/types.ts +0 -86
- package/src/themes.ts +0 -22
- package/src/timeline/parser.ts +0 -472
- package/src/timeline/renderer.ts +0 -3024
- package/src/timeline/types.ts +0 -33
- package/src/timeline/viz-parser.ts +0 -21
- package/src/treemap/diagnostics.ts +0 -62
- package/src/treemap/layout-radial.ts +0 -233
- package/src/treemap/layout.ts +0 -189
- package/src/treemap/parser.ts +0 -463
- package/src/treemap/renderer-radial.ts +0 -438
- package/src/treemap/renderer.ts +0 -572
- package/src/treemap/treemap-shared.ts +0 -309
- package/src/treemap/types.ts +0 -60
- package/src/utils/arrow-markers.ts +0 -51
- package/src/utils/arrows-diagnostics.ts +0 -62
- package/src/utils/arrows.ts +0 -227
- package/src/utils/brand.ts +0 -61
- package/src/utils/card.ts +0 -183
- package/src/utils/collapse-engine/tree-edges.ts +0 -115
- package/src/utils/collapse-engine/tree.ts +0 -117
- package/src/utils/d3-helpers.ts +0 -219
- package/src/utils/d3-types.ts +0 -9
- package/src/utils/description-helpers.ts +0 -38
- package/src/utils/duration.ts +0 -312
- package/src/utils/export-container.ts +0 -41
- package/src/utils/expr-eval.ts +0 -27
- package/src/utils/fit-canvas.ts +0 -64
- package/src/utils/hover-styles.ts +0 -673
- package/src/utils/inline-markdown.ts +0 -96
- package/src/utils/legend-constants.ts +0 -48
- package/src/utils/legend-d3.ts +0 -618
- package/src/utils/legend-integration.ts +0 -107
- package/src/utils/legend-layout.ts +0 -776
- package/src/utils/legend-svg.ts +0 -214
- package/src/utils/legend-types.ts +0 -272
- package/src/utils/name-normalize.ts +0 -163
- package/src/utils/note-box/constants.ts +0 -25
- package/src/utils/note-box/index.ts +0 -11
- package/src/utils/note-box/metrics.ts +0 -90
- package/src/utils/note-box/svg.ts +0 -331
- package/src/utils/notes/bounds.ts +0 -30
- package/src/utils/notes/build.ts +0 -131
- package/src/utils/notes/index.ts +0 -18
- package/src/utils/notes/model.ts +0 -19
- package/src/utils/notes/parse.ts +0 -131
- package/src/utils/notes/place.ts +0 -177
- package/src/utils/notes/resolve.ts +0 -88
- package/src/utils/number-format.ts +0 -36
- package/src/utils/parsing.ts +0 -953
- package/src/utils/reserved-key-registry.ts +0 -239
- package/src/utils/safe-href.ts +0 -38
- package/src/utils/scaling.ts +0 -97
- package/src/utils/svg-embed.ts +0 -251
- package/src/utils/tag-groups.ts +0 -607
- package/src/utils/text-measure.ts +0 -122
- package/src/utils/title-constants.ts +0 -24
- package/src/utils/visual-conventions.ts +0 -61
- package/src/utils/wrapped-desc.ts +0 -87
- package/src/venn/parser.ts +0 -18
- package/src/venn/renderer.ts +0 -1047
- package/src/version-control/diagnostics.ts +0 -67
- package/src/version-control/parser.ts +0 -544
- package/src/version-control/renderer.ts +0 -724
- package/src/version-control/types.ts +0 -100
- package/src/visualizations/parse.ts +0 -1560
- package/src/visualizations/types.ts +0 -262
- package/src/wireframe/layout.ts +0 -479
- package/src/wireframe/parser.ts +0 -1114
- package/src/wireframe/renderer.ts +0 -1318
- package/src/wireframe/types.ts +0 -110
- package/src/wordcloud/parser.ts +0 -18
- package/src/wordcloud/renderer.ts +0 -357
|
@@ -0,0 +1,1604 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseInlineMarkdown,
|
|
3
|
+
safeHref
|
|
4
|
+
} from "./chunk-3HDBAXF5.js";
|
|
5
|
+
import {
|
|
6
|
+
renderIntegratedLegend
|
|
7
|
+
} from "./chunk-PWIHZ6NJ.js";
|
|
8
|
+
import {
|
|
9
|
+
ScaleContext
|
|
10
|
+
} from "./chunk-YYVTBZZC.js";
|
|
11
|
+
import {
|
|
12
|
+
getMaxLegendReservedHeight
|
|
13
|
+
} from "./chunk-YAA6IID3.js";
|
|
14
|
+
import {
|
|
15
|
+
FONT_FAMILY
|
|
16
|
+
} from "./chunk-6KFWC4CO.js";
|
|
17
|
+
import {
|
|
18
|
+
measureText,
|
|
19
|
+
truncateText,
|
|
20
|
+
wrapTextToWidth
|
|
21
|
+
} from "./chunk-WCT3NYCV.js";
|
|
22
|
+
import {
|
|
23
|
+
contrastText,
|
|
24
|
+
mix,
|
|
25
|
+
shapeFill
|
|
26
|
+
} from "./chunk-P6T66CCZ.js";
|
|
27
|
+
|
|
28
|
+
// src/tech-radar/renderer.ts
|
|
29
|
+
import * as d3Selection2 from "d3-selection";
|
|
30
|
+
|
|
31
|
+
// src/tech-radar/layout.ts
|
|
32
|
+
var POSITION_ORDER = [
|
|
33
|
+
"top-left",
|
|
34
|
+
"top-right",
|
|
35
|
+
"bottom-right",
|
|
36
|
+
"bottom-left"
|
|
37
|
+
];
|
|
38
|
+
function getQuadrantArc(position) {
|
|
39
|
+
switch (position) {
|
|
40
|
+
case "top-right":
|
|
41
|
+
return { startAngle: 0, endAngle: Math.PI / 2 };
|
|
42
|
+
case "top-left":
|
|
43
|
+
return { startAngle: Math.PI / 2, endAngle: Math.PI };
|
|
44
|
+
case "bottom-left":
|
|
45
|
+
return { startAngle: Math.PI, endAngle: 3 * Math.PI / 2 };
|
|
46
|
+
case "bottom-right":
|
|
47
|
+
return { startAngle: 3 * Math.PI / 2, endAngle: 2 * Math.PI };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
var BASE_BLIP_RADIUS = 12;
|
|
51
|
+
var MIN_BLIP_RADIUS = 7;
|
|
52
|
+
function computeRadarLayout(parsed, width, height, ctx) {
|
|
53
|
+
const points = [];
|
|
54
|
+
if (parsed.rings.length === 0 || parsed.quadrants.length === 0) return points;
|
|
55
|
+
const sc = ctx ?? ScaleContext.identity();
|
|
56
|
+
const sBlipRadius = Math.max(
|
|
57
|
+
MIN_BLIP_RADIUS,
|
|
58
|
+
sc.structural(BASE_BLIP_RADIUS)
|
|
59
|
+
);
|
|
60
|
+
const cx = width / 2;
|
|
61
|
+
const cy = height / 2;
|
|
62
|
+
const maxRadius = Math.min(cx, cy) * 0.88;
|
|
63
|
+
const ringCount = parsed.rings.length;
|
|
64
|
+
const ringBandWidth = maxRadius / ringCount;
|
|
65
|
+
const ringOrder = parsed.rings.map((r) => r.name);
|
|
66
|
+
const radialPadding = ringBandWidth * 0.12;
|
|
67
|
+
const angularPadding = 0.05;
|
|
68
|
+
for (const quadrant of parsed.quadrants) {
|
|
69
|
+
const quadrantIndex = POSITION_ORDER.indexOf(quadrant.position);
|
|
70
|
+
const { startAngle, endAngle } = getQuadrantArc(quadrant.position);
|
|
71
|
+
const usableArcStart = startAngle + angularPadding;
|
|
72
|
+
const usableArcEnd = endAngle - angularPadding;
|
|
73
|
+
const blipsByRing = /* @__PURE__ */ new Map();
|
|
74
|
+
for (const blip of quadrant.blips) {
|
|
75
|
+
const list = blipsByRing.get(blip.ring) ?? [];
|
|
76
|
+
list.push(blip);
|
|
77
|
+
blipsByRing.set(blip.ring, list);
|
|
78
|
+
}
|
|
79
|
+
const blipRadius = Math.max(
|
|
80
|
+
MIN_BLIP_RADIUS,
|
|
81
|
+
Math.min(sBlipRadius, (ringBandWidth - 2 * radialPadding) / 3)
|
|
82
|
+
);
|
|
83
|
+
for (const [ringName, blips] of blipsByRing) {
|
|
84
|
+
const ringIndex = ringOrder.indexOf(ringName);
|
|
85
|
+
if (ringIndex < 0) continue;
|
|
86
|
+
const rInner = ringIndex * ringBandWidth + radialPadding;
|
|
87
|
+
const rOuter = (ringIndex + 1) * ringBandWidth - radialPadding;
|
|
88
|
+
const rMid = (rInner + rOuter) / 2;
|
|
89
|
+
const usableRadial = rOuter - rInner - blipRadius * 2;
|
|
90
|
+
const arcSpan = usableArcEnd - usableArcStart;
|
|
91
|
+
const placedPoints = [];
|
|
92
|
+
for (let bi = 0; bi < blips.length; bi++) {
|
|
93
|
+
const blip = blips[bi];
|
|
94
|
+
let angle;
|
|
95
|
+
if (blips.length === 1) {
|
|
96
|
+
angle = (usableArcStart + usableArcEnd) / 2;
|
|
97
|
+
} else {
|
|
98
|
+
angle = usableArcStart + (bi + 0.5) / blips.length * arcSpan;
|
|
99
|
+
}
|
|
100
|
+
let radius;
|
|
101
|
+
if (blips.length <= 3) {
|
|
102
|
+
radius = rMid;
|
|
103
|
+
} else {
|
|
104
|
+
const radialSlots = Math.min(3, Math.ceil(blips.length / 3));
|
|
105
|
+
const slot = bi % radialSlots;
|
|
106
|
+
radius = rInner + blipRadius + slot / Math.max(1, radialSlots - 1) * usableRadial;
|
|
107
|
+
}
|
|
108
|
+
let attempts = 0;
|
|
109
|
+
while (attempts < 20) {
|
|
110
|
+
const x = cx + radius * Math.cos(angle);
|
|
111
|
+
const y = cy - radius * Math.sin(angle);
|
|
112
|
+
const overlapping = placedPoints.some((p) => {
|
|
113
|
+
const px = cx + p.radius * Math.cos(p.angle);
|
|
114
|
+
const py = cy - p.radius * Math.sin(p.angle);
|
|
115
|
+
const dx = x - px;
|
|
116
|
+
const dy = y - py;
|
|
117
|
+
return Math.sqrt(dx * dx + dy * dy) < blipRadius * 2.2;
|
|
118
|
+
});
|
|
119
|
+
if (!overlapping) break;
|
|
120
|
+
radius += blipRadius * 0.8;
|
|
121
|
+
if (radius > rOuter - blipRadius) {
|
|
122
|
+
radius = rInner + blipRadius;
|
|
123
|
+
angle += arcSpan * 0.05;
|
|
124
|
+
if (angle > usableArcEnd) angle = usableArcEnd;
|
|
125
|
+
}
|
|
126
|
+
attempts++;
|
|
127
|
+
}
|
|
128
|
+
placedPoints.push({ angle, radius });
|
|
129
|
+
points.push({
|
|
130
|
+
blip,
|
|
131
|
+
x: cx + radius * Math.cos(angle),
|
|
132
|
+
y: cy - radius * Math.sin(angle),
|
|
133
|
+
quadrantIndex,
|
|
134
|
+
ringIndex
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return points;
|
|
140
|
+
}
|
|
141
|
+
function getRadarGeometry(width, height, ringCount) {
|
|
142
|
+
const cx = width / 2;
|
|
143
|
+
const cy = height / 2;
|
|
144
|
+
const maxRadius = Math.min(cx, cy) * 0.88;
|
|
145
|
+
return { cx, cy, maxRadius, ringBandWidth: maxRadius / ringCount };
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// src/tech-radar/shared.ts
|
|
149
|
+
var DEFAULT_QUADRANT_COLORS = {
|
|
150
|
+
"top-left": "blue",
|
|
151
|
+
"top-right": "green",
|
|
152
|
+
"bottom-left": "red",
|
|
153
|
+
"bottom-right": "orange"
|
|
154
|
+
};
|
|
155
|
+
function resolveQuadrantColor(position, color, palette) {
|
|
156
|
+
const name = color ?? DEFAULT_QUADRANT_COLORS[position];
|
|
157
|
+
return palette.colors[name] ?? palette.border;
|
|
158
|
+
}
|
|
159
|
+
function renderTrendIndicator(g, trend, color, cx, cy, r, angleToCenter) {
|
|
160
|
+
g.append("circle").attr("cx", cx).attr("cy", cy).attr("r", r * 0.65).attr("fill", color);
|
|
161
|
+
if (trend === "new") {
|
|
162
|
+
g.append("circle").attr("cx", cx).attr("cy", cy).attr("r", r).attr("fill", "none").attr("stroke", color).attr("stroke-width", 1.5);
|
|
163
|
+
} else if (trend === "up" || trend === "down") {
|
|
164
|
+
const crescentAngle = trend === "up" ? angleToCenter : angleToCenter + Math.PI;
|
|
165
|
+
renderCrescent(g, cx, cy, r, crescentAngle, color);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function renderCrescent(g, cx, cy, r, angle, color) {
|
|
169
|
+
const outerR = r;
|
|
170
|
+
const halfSpan = Math.PI * 4 / 9;
|
|
171
|
+
const startAngle = angle - halfSpan;
|
|
172
|
+
const endAngle = angle + halfSpan;
|
|
173
|
+
const x1 = cx + outerR * Math.cos(startAngle);
|
|
174
|
+
const y1 = cy + outerR * Math.sin(startAngle);
|
|
175
|
+
const x2 = cx + outerR * Math.cos(endAngle);
|
|
176
|
+
const y2 = cy + outerR * Math.sin(endAngle);
|
|
177
|
+
const largeArc = halfSpan * 2 > Math.PI ? 1 : 0;
|
|
178
|
+
g.append("path").attr("d", `M${x1},${y1} A${outerR},${outerR} 0 ${largeArc},1 ${x2},${y2}`).attr("fill", "none").attr("stroke", color).attr("stroke-width", 2.5).attr("stroke-linecap", "round");
|
|
179
|
+
}
|
|
180
|
+
var DIM_OPACITY = 0.25;
|
|
181
|
+
var TREND_ITEMS = [
|
|
182
|
+
{ trend: "new", label: "New" },
|
|
183
|
+
{ trend: "up", label: "Moved in" },
|
|
184
|
+
{ trend: "down", label: "Moved out" },
|
|
185
|
+
{ trend: null, label: "No change" }
|
|
186
|
+
];
|
|
187
|
+
function createTooltip(container, palette, isDark) {
|
|
188
|
+
container.style.position = "relative";
|
|
189
|
+
const existing = container.querySelector("[data-d3-tooltip]");
|
|
190
|
+
if (existing) {
|
|
191
|
+
existing.style.display = "none";
|
|
192
|
+
return existing;
|
|
193
|
+
}
|
|
194
|
+
const tip = document.createElement("div");
|
|
195
|
+
tip.setAttribute("data-d3-tooltip", "");
|
|
196
|
+
tip.style.position = "absolute";
|
|
197
|
+
tip.style.display = "none";
|
|
198
|
+
tip.style.pointerEvents = "none";
|
|
199
|
+
tip.style.padding = "6px 10px";
|
|
200
|
+
tip.style.borderRadius = "4px";
|
|
201
|
+
tip.style.fontSize = "12px";
|
|
202
|
+
tip.style.fontFamily = FONT_FAMILY;
|
|
203
|
+
tip.style.lineHeight = "1.4";
|
|
204
|
+
tip.style.zIndex = "10";
|
|
205
|
+
tip.style.whiteSpace = "nowrap";
|
|
206
|
+
tip.style.background = palette.surface;
|
|
207
|
+
tip.style.color = palette.text;
|
|
208
|
+
tip.style.boxShadow = isDark ? "0 2px 6px rgba(0,0,0,0.3)" : "0 2px 6px rgba(0,0,0,0.12)";
|
|
209
|
+
container.appendChild(tip);
|
|
210
|
+
return tip;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// src/tech-radar/interactive.ts
|
|
214
|
+
import * as d3Selection from "d3-selection";
|
|
215
|
+
var BLIP_RADIUS = 13;
|
|
216
|
+
var BLIP_FONT_SIZE = 10;
|
|
217
|
+
var TITLE_FONT_SIZE = 16;
|
|
218
|
+
var NARROW_BREAKPOINT = 600;
|
|
219
|
+
function renderQuadrantFocus(container, parsed, quadrantPosition, palette, isDark, onClickItem, exportDims, _options) {
|
|
220
|
+
const quadrant = parsed.quadrants.find(
|
|
221
|
+
(q) => q.position === quadrantPosition
|
|
222
|
+
);
|
|
223
|
+
if (!quadrant) return;
|
|
224
|
+
container.innerHTML = "";
|
|
225
|
+
const width = exportDims?.width ?? container.clientWidth;
|
|
226
|
+
const height = exportDims?.height ?? container.clientHeight;
|
|
227
|
+
if (width <= 0 || height <= 0) return;
|
|
228
|
+
const isNarrow = width < NARROW_BREAKPOINT;
|
|
229
|
+
const qColor = resolveQuadrantColor(
|
|
230
|
+
quadrant.position,
|
|
231
|
+
quadrant.color,
|
|
232
|
+
palette
|
|
233
|
+
);
|
|
234
|
+
const titleBar = document.createElement("div");
|
|
235
|
+
titleBar.style.cssText = `
|
|
236
|
+
display: flex; align-items: baseline; gap: 8px;
|
|
237
|
+
padding: 8px 12px; font-family: ${FONT_FAMILY};
|
|
238
|
+
font-size: ${TITLE_FONT_SIZE}px; background: ${palette.bg};
|
|
239
|
+
`;
|
|
240
|
+
const titleLink = document.createElement("span");
|
|
241
|
+
titleLink.textContent = parsed.title || "Tech Radar";
|
|
242
|
+
titleLink.style.cssText = `font-weight: bold; color: ${palette.text}; cursor: pointer;`;
|
|
243
|
+
titleLink.setAttribute("data-line-number", String(parsed.titleLineNumber));
|
|
244
|
+
const sep = document.createElement("span");
|
|
245
|
+
sep.textContent = "\u203A";
|
|
246
|
+
sep.style.color = palette.border;
|
|
247
|
+
const quadrantLabel = document.createElement("span");
|
|
248
|
+
quadrantLabel.textContent = quadrant.name;
|
|
249
|
+
quadrantLabel.style.cssText = `font-weight: bold; color: ${qColor};`;
|
|
250
|
+
titleBar.appendChild(titleLink);
|
|
251
|
+
titleBar.appendChild(sep);
|
|
252
|
+
titleBar.appendChild(quadrantLabel);
|
|
253
|
+
container.appendChild(titleBar);
|
|
254
|
+
const mainLayout = document.createElement("div");
|
|
255
|
+
mainLayout.style.cssText = `
|
|
256
|
+
display: flex; flex-direction: ${isNarrow ? "column" : "row"};
|
|
257
|
+
flex: 1; min-height: 0; height: calc(100% - 40px); background: ${palette.bg};
|
|
258
|
+
`;
|
|
259
|
+
container.appendChild(mainLayout);
|
|
260
|
+
const svgContainer = document.createElement("div");
|
|
261
|
+
svgContainer.style.cssText = `
|
|
262
|
+
${isNarrow ? "height: 40%;" : "width: 50%; min-width: 200px;"}
|
|
263
|
+
flex-shrink: 0;
|
|
264
|
+
`;
|
|
265
|
+
mainLayout.appendChild(svgContainer);
|
|
266
|
+
const panel = document.createElement("div");
|
|
267
|
+
panel.style.cssText = `
|
|
268
|
+
flex: 1; overflow-y: auto; padding: 8px 12px;
|
|
269
|
+
font-family: ${FONT_FAMILY}; background: ${palette.bg};
|
|
270
|
+
`;
|
|
271
|
+
mainLayout.appendChild(panel);
|
|
272
|
+
const toggleBlip = renderHtmlPanel(
|
|
273
|
+
panel,
|
|
274
|
+
parsed,
|
|
275
|
+
quadrant,
|
|
276
|
+
qColor,
|
|
277
|
+
palette,
|
|
278
|
+
isDark,
|
|
279
|
+
container,
|
|
280
|
+
onClickItem
|
|
281
|
+
);
|
|
282
|
+
const svgWidth = svgContainer.clientWidth || (isNarrow ? width : width * 0.5);
|
|
283
|
+
const svgHeight = svgContainer.clientHeight || (isNarrow ? height * 0.4 : height - 40);
|
|
284
|
+
const svg = d3Selection.select(svgContainer).append("svg").attr("width", "100%").attr("height", "100%").attr("viewBox", `0 0 ${svgWidth} ${svgHeight}`).style("background", palette.bg);
|
|
285
|
+
const tooltip = createTooltip(container, palette, isDark);
|
|
286
|
+
renderQuarterCircle(
|
|
287
|
+
svg,
|
|
288
|
+
parsed,
|
|
289
|
+
quadrant,
|
|
290
|
+
qColor,
|
|
291
|
+
palette,
|
|
292
|
+
isDark,
|
|
293
|
+
svgWidth,
|
|
294
|
+
svgHeight,
|
|
295
|
+
palette.border,
|
|
296
|
+
tooltip,
|
|
297
|
+
container,
|
|
298
|
+
toggleBlip
|
|
299
|
+
);
|
|
300
|
+
titleLink.addEventListener("click", () => {
|
|
301
|
+
if (onClickItem) onClickItem(parsed.titleLineNumber);
|
|
302
|
+
});
|
|
303
|
+
if (_options?.activeLine) {
|
|
304
|
+
const activeLn = _options.activeLine;
|
|
305
|
+
for (const blip of quadrant.blips) {
|
|
306
|
+
const isOnBlip = blip.lineNumber === activeLn;
|
|
307
|
+
const isOnDesc = blip.description.length > 0 && activeLn > blip.lineNumber && activeLn <= blip.lineNumber + blip.description.length;
|
|
308
|
+
if (isOnBlip || isOnDesc) {
|
|
309
|
+
toggleBlip(blip.lineNumber);
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
function renderQuarterCircle(svg, parsed, quadrant, qColor, palette, isDark, width, height, mutedColor, _tooltip, rootContainer, onClickItem) {
|
|
316
|
+
const padding = 8;
|
|
317
|
+
const size = Math.min(width - padding, height - padding);
|
|
318
|
+
const maxRadius = size * 0.95;
|
|
319
|
+
const ringCount = parsed.rings.length;
|
|
320
|
+
const ringBandWidth = maxRadius / ringCount;
|
|
321
|
+
const { startAngle, endAngle } = getQuadrantArc(quadrant.position);
|
|
322
|
+
let cx, cy;
|
|
323
|
+
switch (quadrant.position) {
|
|
324
|
+
case "top-right":
|
|
325
|
+
cx = padding;
|
|
326
|
+
cy = size + padding;
|
|
327
|
+
break;
|
|
328
|
+
case "top-left":
|
|
329
|
+
cx = width - padding;
|
|
330
|
+
cy = size + padding;
|
|
331
|
+
break;
|
|
332
|
+
case "bottom-left":
|
|
333
|
+
cx = width - padding;
|
|
334
|
+
cy = padding;
|
|
335
|
+
break;
|
|
336
|
+
case "bottom-right":
|
|
337
|
+
cx = padding;
|
|
338
|
+
cy = padding;
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
const arcGen = (innerR, outerR) => `M${cx + outerR * Math.cos(startAngle)},${cy - outerR * Math.sin(startAngle)} A${outerR},${outerR} 0 0,0 ${cx + outerR * Math.cos(endAngle)},${cy - outerR * Math.sin(endAngle)} L${cx + innerR * Math.cos(endAngle)},${cy - innerR * Math.sin(endAngle)} A${innerR},${innerR} 0 0,1 ${cx + innerR * Math.cos(startAngle)},${cy - innerR * Math.sin(startAngle)} Z`;
|
|
342
|
+
for (let ri = parsed.rings.length - 1; ri >= 0; ri--) {
|
|
343
|
+
const innerR = ri * ringBandWidth;
|
|
344
|
+
const outerR = (ri + 1) * ringBandWidth;
|
|
345
|
+
const fillColor = ri % 2 === 0 ? palette.bg : mix(palette.bg, palette.border, 0.15);
|
|
346
|
+
const ringName = parsed.rings[ri].name;
|
|
347
|
+
svg.append("path").attr("d", arcGen(innerR, outerR)).attr("fill", fillColor).attr("stroke", mutedColor).attr("stroke-width", 0.5);
|
|
348
|
+
svg.append("path").attr("d", arcGen(innerR, outerR)).attr("fill", "transparent").attr("data-ring-arc", ringName).style("cursor", "pointer").on("mouseenter", () => {
|
|
349
|
+
d3Selection.select(rootContainer).selectAll("[data-ring-arc]").each(function() {
|
|
350
|
+
const el = d3Selection.select(this);
|
|
351
|
+
const isMatch = this.getAttribute("data-ring-arc") === ringName;
|
|
352
|
+
el.attr("fill", isMatch ? qColor : "transparent").attr(
|
|
353
|
+
"opacity",
|
|
354
|
+
isMatch ? 0.15 : 1
|
|
355
|
+
);
|
|
356
|
+
});
|
|
357
|
+
dimExceptRing(rootContainer, ringName);
|
|
358
|
+
}).on("mouseleave", () => {
|
|
359
|
+
d3Selection.select(rootContainer).selectAll("[data-ring-arc]").attr("fill", "transparent").attr("opacity", 1);
|
|
360
|
+
clearDim(rootContainer);
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
const ringOrder = parsed.rings.map((r) => r.name);
|
|
364
|
+
const angularPadding = 0.08;
|
|
365
|
+
const radialPadding = ringBandWidth * 0.12;
|
|
366
|
+
const usableArcStart = startAngle + angularPadding;
|
|
367
|
+
const usableArcEnd = endAngle - angularPadding;
|
|
368
|
+
const arcSpan = usableArcEnd - usableArcStart;
|
|
369
|
+
const blipsByRing = /* @__PURE__ */ new Map();
|
|
370
|
+
for (const blip of quadrant.blips) {
|
|
371
|
+
const list = blipsByRing.get(blip.ring) ?? [];
|
|
372
|
+
list.push(blip);
|
|
373
|
+
blipsByRing.set(blip.ring, list);
|
|
374
|
+
}
|
|
375
|
+
for (const [ringName, blips] of blipsByRing) {
|
|
376
|
+
const ringIndex = ringOrder.indexOf(ringName);
|
|
377
|
+
if (ringIndex < 0) continue;
|
|
378
|
+
const rInner = ringIndex * ringBandWidth + radialPadding;
|
|
379
|
+
const rOuter = (ringIndex + 1) * ringBandWidth - radialPadding;
|
|
380
|
+
const rMid = (rInner + rOuter) / 2;
|
|
381
|
+
for (let bi = 0; bi < blips.length; bi++) {
|
|
382
|
+
const blip = blips[bi];
|
|
383
|
+
const angle = blips.length === 1 ? (usableArcStart + usableArcEnd) / 2 : usableArcStart + (bi + 0.5) / blips.length * arcSpan;
|
|
384
|
+
const radius = blips.length <= 3 ? rMid : rInner + BLIP_RADIUS + bi % 3 / 2 * (rOuter - rInner - BLIP_RADIUS * 2);
|
|
385
|
+
const bx = cx + radius * Math.cos(angle);
|
|
386
|
+
const by = cy - radius * Math.sin(angle);
|
|
387
|
+
const blipGroup = svg.append("g").attr("data-line-number", blip.lineNumber).attr("data-ring", blip.ring).attr("data-trend", blip.trend ?? "stable").style("cursor", "pointer");
|
|
388
|
+
const angleToCenter = Math.atan2(cy - by, cx - bx);
|
|
389
|
+
renderTrendIndicator(
|
|
390
|
+
blipGroup,
|
|
391
|
+
blip.trend,
|
|
392
|
+
qColor,
|
|
393
|
+
bx,
|
|
394
|
+
by,
|
|
395
|
+
BLIP_RADIUS,
|
|
396
|
+
angleToCenter
|
|
397
|
+
);
|
|
398
|
+
blipGroup.append("text").attr("x", bx).attr("y", by + 3).attr("text-anchor", "middle").attr("fill", isDark ? "#000" : "#fff").attr("font-family", FONT_FAMILY).attr("font-size", BLIP_FONT_SIZE).attr("font-weight", "bold").text(blip.globalNumber);
|
|
399
|
+
const lineNum = String(blip.lineNumber);
|
|
400
|
+
blipGroup.on("mouseenter", () => {
|
|
401
|
+
blipGroup.attr(
|
|
402
|
+
"transform",
|
|
403
|
+
`translate(${bx},${by}) scale(1.5) translate(${-bx},${-by})`
|
|
404
|
+
);
|
|
405
|
+
dimExcept(rootContainer, lineNum);
|
|
406
|
+
}).on("mouseleave", () => {
|
|
407
|
+
blipGroup.attr("transform", null);
|
|
408
|
+
clearDim(rootContainer);
|
|
409
|
+
});
|
|
410
|
+
blipGroup.on("click", () => {
|
|
411
|
+
if (onClickItem) {
|
|
412
|
+
onClickItem(blip.lineNumber);
|
|
413
|
+
requestAnimationFrame(() => dimExcept(rootContainer, lineNum));
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
function dimExcept(root, lineNum) {
|
|
420
|
+
root.querySelectorAll("[data-line-number]").forEach((el) => {
|
|
421
|
+
el.style.opacity = el.getAttribute("data-line-number") === lineNum ? "1" : String(DIM_OPACITY);
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
function dimExceptRing(root, ringName) {
|
|
425
|
+
root.querySelectorAll("[data-line-number]").forEach((el) => {
|
|
426
|
+
el.style.opacity = el.getAttribute("data-ring") === ringName ? "1" : String(DIM_OPACITY);
|
|
427
|
+
});
|
|
428
|
+
root.querySelectorAll("[data-ring-group]").forEach((el) => {
|
|
429
|
+
el.style.opacity = el.getAttribute("data-ring-group") === ringName ? "1" : String(DIM_OPACITY);
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
function clearDim(root) {
|
|
433
|
+
root.querySelectorAll("[data-line-number]").forEach((el) => {
|
|
434
|
+
el.style.opacity = "1";
|
|
435
|
+
});
|
|
436
|
+
root.querySelectorAll("[data-ring-group]").forEach((el) => {
|
|
437
|
+
el.style.opacity = "1";
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
function renderHtmlPanel(panel, parsed, quadrant, qColor, palette, isDark, rootContainer, onClickItem) {
|
|
441
|
+
const ringOrder = parsed.rings.map((r) => r.name);
|
|
442
|
+
const fillColor = shapeFill(palette, qColor, isDark, {
|
|
443
|
+
solid: parsed.options["solid-fill"] === "on"
|
|
444
|
+
});
|
|
445
|
+
let expandedLineNum = null;
|
|
446
|
+
function render() {
|
|
447
|
+
panel.innerHTML = "";
|
|
448
|
+
for (const ringName of ringOrder) {
|
|
449
|
+
const blips = quadrant.blips.filter((b) => b.ring === ringName);
|
|
450
|
+
if (blips.length === 0) continue;
|
|
451
|
+
const ringGroup = document.createElement("div");
|
|
452
|
+
ringGroup.setAttribute("data-ring-group", ringName);
|
|
453
|
+
ringGroup.style.cssText = `
|
|
454
|
+
background: ${palette.surface};
|
|
455
|
+
border-radius: 8px;
|
|
456
|
+
padding: 10px;
|
|
457
|
+
margin-bottom: 12px;
|
|
458
|
+
transition: opacity 0.15s;
|
|
459
|
+
`;
|
|
460
|
+
const header = document.createElement("div");
|
|
461
|
+
header.style.cssText = `
|
|
462
|
+
font-size: 13px; font-weight: 700; color: ${palette.textMuted};
|
|
463
|
+
margin-bottom: 8px;
|
|
464
|
+
`;
|
|
465
|
+
header.textContent = ringName;
|
|
466
|
+
ringGroup.appendChild(header);
|
|
467
|
+
panel.appendChild(ringGroup);
|
|
468
|
+
for (const blip of blips) {
|
|
469
|
+
const ln = String(blip.lineNumber);
|
|
470
|
+
const isExpanded = expandedLineNum === ln;
|
|
471
|
+
const hasDesc = blip.description.length > 0;
|
|
472
|
+
const node = document.createElement("div");
|
|
473
|
+
node.setAttribute("data-line-number", ln);
|
|
474
|
+
node.setAttribute("data-ring", blip.ring);
|
|
475
|
+
node.setAttribute("data-trend", blip.trend ?? "stable");
|
|
476
|
+
node.style.cssText = `
|
|
477
|
+
background: ${fillColor}; border: 1.5px solid ${qColor};
|
|
478
|
+
border-radius: 6px; margin-bottom: 6px; cursor: pointer;
|
|
479
|
+
transition: border-width 0.1s;
|
|
480
|
+
${isExpanded ? "border-width: 2px;" : ""}
|
|
481
|
+
`;
|
|
482
|
+
const titleRow = document.createElement("div");
|
|
483
|
+
titleRow.style.cssText = `
|
|
484
|
+
display: flex; align-items: center; gap: 8px;
|
|
485
|
+
padding: 6px 10px; min-height: 28px;
|
|
486
|
+
`;
|
|
487
|
+
const indicatorSvg = document.createElementNS(
|
|
488
|
+
"http://www.w3.org/2000/svg",
|
|
489
|
+
"svg"
|
|
490
|
+
);
|
|
491
|
+
indicatorSvg.setAttribute("width", "26");
|
|
492
|
+
indicatorSvg.setAttribute("height", "26");
|
|
493
|
+
indicatorSvg.style.flexShrink = "0";
|
|
494
|
+
const indicatorG = d3Selection.select(indicatorSvg).append("g");
|
|
495
|
+
renderTrendIndicator(
|
|
496
|
+
indicatorG,
|
|
497
|
+
blip.trend,
|
|
498
|
+
qColor,
|
|
499
|
+
13,
|
|
500
|
+
13,
|
|
501
|
+
10,
|
|
502
|
+
-Math.PI / 2
|
|
503
|
+
);
|
|
504
|
+
d3Selection.select(indicatorSvg).append("text").attr("x", 13).attr("y", 16).attr("text-anchor", "middle").attr("fill", isDark ? "#000" : "#fff").attr("font-family", FONT_FAMILY).attr("font-size", 9).attr("font-weight", "bold").text(blip.globalNumber);
|
|
505
|
+
titleRow.appendChild(indicatorSvg);
|
|
506
|
+
const name = document.createElement("span");
|
|
507
|
+
name.textContent = blip.name;
|
|
508
|
+
name.style.cssText = `
|
|
509
|
+
flex: 1; font-size: 12px; font-weight: 600;
|
|
510
|
+
color: ${palette.text}; white-space: nowrap;
|
|
511
|
+
overflow: hidden; text-overflow: ellipsis;
|
|
512
|
+
`;
|
|
513
|
+
titleRow.appendChild(name);
|
|
514
|
+
node.appendChild(titleRow);
|
|
515
|
+
if (isExpanded && hasDesc) {
|
|
516
|
+
const sep = document.createElement("div");
|
|
517
|
+
sep.style.cssText = `
|
|
518
|
+
border-top: 1px solid ${qColor}; opacity: 0.3;
|
|
519
|
+
`;
|
|
520
|
+
node.appendChild(sep);
|
|
521
|
+
const descDiv = document.createElement("div");
|
|
522
|
+
descDiv.style.cssText = `
|
|
523
|
+
padding: 6px 10px 8px; font-size: 11px; line-height: 1.6;
|
|
524
|
+
color: ${palette.textMuted};
|
|
525
|
+
`;
|
|
526
|
+
descDiv.innerHTML = renderDescriptionHtml(blip.description, palette);
|
|
527
|
+
node.appendChild(descDiv);
|
|
528
|
+
}
|
|
529
|
+
node.addEventListener("mouseenter", () => {
|
|
530
|
+
dimExcept(rootContainer, ln);
|
|
531
|
+
rootContainer.querySelectorAll("svg [data-line-number]").forEach((el) => {
|
|
532
|
+
if (el.getAttribute("data-line-number") === ln) {
|
|
533
|
+
const bbox = el.getBBox?.();
|
|
534
|
+
if (bbox) {
|
|
535
|
+
const bx = bbox.x + bbox.width / 2;
|
|
536
|
+
const by = bbox.y + bbox.height / 2;
|
|
537
|
+
el.setAttribute(
|
|
538
|
+
"transform",
|
|
539
|
+
`translate(${bx},${by}) scale(1.5) translate(${-bx},${-by})`
|
|
540
|
+
);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
});
|
|
545
|
+
node.addEventListener("mouseleave", () => {
|
|
546
|
+
clearDim(rootContainer);
|
|
547
|
+
rootContainer.querySelectorAll("svg [data-line-number]").forEach((el) => {
|
|
548
|
+
el.removeAttribute("transform");
|
|
549
|
+
});
|
|
550
|
+
});
|
|
551
|
+
node.addEventListener("click", (event) => {
|
|
552
|
+
event.stopPropagation();
|
|
553
|
+
if (hasDesc) {
|
|
554
|
+
const wasExpanded = expandedLineNum === ln;
|
|
555
|
+
expandedLineNum = wasExpanded ? null : ln;
|
|
556
|
+
render();
|
|
557
|
+
if (!wasExpanded) {
|
|
558
|
+
requestAnimationFrame(() => {
|
|
559
|
+
dimExcept(rootContainer, ln);
|
|
560
|
+
rootContainer.querySelectorAll("svg [data-line-number]").forEach((el) => {
|
|
561
|
+
if (el.getAttribute("data-line-number") === ln) {
|
|
562
|
+
const bbox = el.getBBox?.();
|
|
563
|
+
if (bbox) {
|
|
564
|
+
const cbx = bbox.x + bbox.width / 2;
|
|
565
|
+
const cby = bbox.y + bbox.height / 2;
|
|
566
|
+
el.setAttribute(
|
|
567
|
+
"transform",
|
|
568
|
+
`translate(${cbx},${cby}) scale(1.5) translate(${-cbx},${-cby})`
|
|
569
|
+
);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
});
|
|
574
|
+
} else {
|
|
575
|
+
clearDim(rootContainer);
|
|
576
|
+
rootContainer.querySelectorAll("svg [data-line-number]").forEach((el) => el.removeAttribute("transform"));
|
|
577
|
+
}
|
|
578
|
+
} else if (onClickItem) {
|
|
579
|
+
onClickItem(blip.lineNumber);
|
|
580
|
+
}
|
|
581
|
+
});
|
|
582
|
+
ringGroup.appendChild(node);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
render();
|
|
587
|
+
panel.addEventListener("click", () => {
|
|
588
|
+
if (expandedLineNum) {
|
|
589
|
+
expandedLineNum = null;
|
|
590
|
+
render();
|
|
591
|
+
clearDim(rootContainer);
|
|
592
|
+
rootContainer.querySelectorAll("svg [data-line-number]").forEach((el) => el.removeAttribute("transform"));
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
return (lineNumber) => {
|
|
596
|
+
const ln = String(lineNumber);
|
|
597
|
+
const blip = quadrant.blips.find((b) => String(b.lineNumber) === ln);
|
|
598
|
+
if (blip && blip.description.length > 0) {
|
|
599
|
+
const wasExpanded = expandedLineNum === ln;
|
|
600
|
+
expandedLineNum = wasExpanded ? null : ln;
|
|
601
|
+
render();
|
|
602
|
+
const node = panel.querySelector(`[data-line-number="${ln}"]`);
|
|
603
|
+
if (node) node.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
604
|
+
if (!wasExpanded) {
|
|
605
|
+
requestAnimationFrame(() => dimExcept(rootContainer, ln));
|
|
606
|
+
} else {
|
|
607
|
+
clearDim(rootContainer);
|
|
608
|
+
rootContainer.querySelectorAll("svg [data-line-number]").forEach((el) => el.removeAttribute("transform"));
|
|
609
|
+
}
|
|
610
|
+
} else if (onClickItem) {
|
|
611
|
+
onClickItem(lineNumber);
|
|
612
|
+
}
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
function renderDescriptionHtml(lines, palette) {
|
|
616
|
+
const paragraphs = joinParagraphs(lines);
|
|
617
|
+
let html = "";
|
|
618
|
+
for (const para of paragraphs) {
|
|
619
|
+
const trimmed = para.trim();
|
|
620
|
+
const isBullet = /^[-*•]\s+/.test(trimmed);
|
|
621
|
+
const content = isBullet ? trimmed.replace(/^[-*•]\s+/, "") : trimmed;
|
|
622
|
+
const rendered = renderInlineMarkdownHtml(content, palette);
|
|
623
|
+
if (isBullet) {
|
|
624
|
+
html += `<div style="padding-left: 14px; text-indent: -10px; margin: 2px 0;">\u2022 ${rendered}</div>`;
|
|
625
|
+
} else {
|
|
626
|
+
html += `<div style="margin: 4px 0;">${rendered}</div>`;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
return html;
|
|
630
|
+
}
|
|
631
|
+
function joinParagraphs(lines) {
|
|
632
|
+
const result = [];
|
|
633
|
+
let currentPara = "";
|
|
634
|
+
for (const line of lines) {
|
|
635
|
+
const trimmed = line.trim();
|
|
636
|
+
const isBullet = /^[-*•]\s+/.test(trimmed);
|
|
637
|
+
if (isBullet) {
|
|
638
|
+
if (currentPara) {
|
|
639
|
+
result.push(currentPara);
|
|
640
|
+
currentPara = "";
|
|
641
|
+
}
|
|
642
|
+
result.push(trimmed);
|
|
643
|
+
} else if (!trimmed) {
|
|
644
|
+
if (currentPara) {
|
|
645
|
+
result.push(currentPara);
|
|
646
|
+
currentPara = "";
|
|
647
|
+
}
|
|
648
|
+
} else {
|
|
649
|
+
currentPara = currentPara ? `${currentPara} ${trimmed}` : trimmed;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
if (currentPara) result.push(currentPara);
|
|
653
|
+
return result;
|
|
654
|
+
}
|
|
655
|
+
function renderInlineMarkdownHtml(text, palette) {
|
|
656
|
+
const spans = parseInlineMarkdown(text);
|
|
657
|
+
let html = "";
|
|
658
|
+
for (const span of spans) {
|
|
659
|
+
let t = escapeHtml(span.text);
|
|
660
|
+
if (span.bold) t = `<strong>${t}</strong>`;
|
|
661
|
+
if (span.italic) t = `<em>${t}</em>`;
|
|
662
|
+
if (span.code)
|
|
663
|
+
t = `<code style="background:${palette.surface}; padding: 1px 4px; border-radius: 3px; font-size: 10px;">${t}</code>`;
|
|
664
|
+
if (span.href) {
|
|
665
|
+
const safe = safeHref(span.href);
|
|
666
|
+
if (safe !== null) {
|
|
667
|
+
t = `<a href="${escapeHtml(safe)}" target="_blank" rel="noopener noreferrer" style="color: ${palette.primary ?? palette.text}; text-decoration: underline;">${t}</a>`;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
html += t;
|
|
671
|
+
}
|
|
672
|
+
return html;
|
|
673
|
+
}
|
|
674
|
+
function escapeHtml(text) {
|
|
675
|
+
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
676
|
+
}
|
|
677
|
+
function renderQuadrantFocusForExport(container, parsed, quadrantPosition, palette, isDark, exportDims) {
|
|
678
|
+
const quadrant = parsed.quadrants.find(
|
|
679
|
+
(q) => q.position === quadrantPosition
|
|
680
|
+
);
|
|
681
|
+
if (!quadrant) return;
|
|
682
|
+
container.innerHTML = "";
|
|
683
|
+
const width = exportDims.width;
|
|
684
|
+
const height = exportDims.height;
|
|
685
|
+
const qColor = resolveQuadrantColor(
|
|
686
|
+
quadrant.position,
|
|
687
|
+
quadrant.color,
|
|
688
|
+
palette
|
|
689
|
+
);
|
|
690
|
+
const titleBar = document.createElement("div");
|
|
691
|
+
titleBar.style.cssText = `
|
|
692
|
+
display: flex; align-items: baseline; gap: 8px;
|
|
693
|
+
padding: 12px 16px; font-family: ${FONT_FAMILY};
|
|
694
|
+
font-size: ${TITLE_FONT_SIZE + 2}px; background: ${palette.bg};
|
|
695
|
+
`;
|
|
696
|
+
const titleText = document.createElement("span");
|
|
697
|
+
titleText.textContent = parsed.title || "Tech Radar";
|
|
698
|
+
titleText.style.cssText = `font-weight: bold; color: ${palette.text};`;
|
|
699
|
+
const sep = document.createElement("span");
|
|
700
|
+
sep.textContent = "\u203A";
|
|
701
|
+
sep.style.color = palette.border;
|
|
702
|
+
const quadrantLabel = document.createElement("span");
|
|
703
|
+
quadrantLabel.textContent = quadrant.name;
|
|
704
|
+
quadrantLabel.style.cssText = `font-weight: bold; color: ${qColor};`;
|
|
705
|
+
titleBar.appendChild(titleText);
|
|
706
|
+
titleBar.appendChild(sep);
|
|
707
|
+
titleBar.appendChild(quadrantLabel);
|
|
708
|
+
container.appendChild(titleBar);
|
|
709
|
+
const mainLayout = document.createElement("div");
|
|
710
|
+
mainLayout.style.cssText = `
|
|
711
|
+
display: flex; flex-direction: row;
|
|
712
|
+
height: ${height - 48}px; background: ${palette.bg};
|
|
713
|
+
`;
|
|
714
|
+
container.appendChild(mainLayout);
|
|
715
|
+
const svgContainer = document.createElement("div");
|
|
716
|
+
svgContainer.style.cssText = `width: 45%; min-width: 200px; flex-shrink: 0;`;
|
|
717
|
+
mainLayout.appendChild(svgContainer);
|
|
718
|
+
const panel = document.createElement("div");
|
|
719
|
+
panel.style.cssText = `
|
|
720
|
+
flex: 1; padding: 8px 16px;
|
|
721
|
+
font-family: ${FONT_FAMILY}; background: ${palette.bg};
|
|
722
|
+
`;
|
|
723
|
+
mainLayout.appendChild(panel);
|
|
724
|
+
renderStaticHtmlPanel(panel, parsed, quadrant, qColor, palette, isDark);
|
|
725
|
+
const svgWidth = width * 0.45;
|
|
726
|
+
const svgHeight = height - 48;
|
|
727
|
+
const svg = d3Selection.select(svgContainer).append("svg").attr("width", svgWidth).attr("height", svgHeight).attr("viewBox", `0 0 ${svgWidth} ${svgHeight}`).style("background", palette.bg);
|
|
728
|
+
renderQuarterCircleStatic(
|
|
729
|
+
svg,
|
|
730
|
+
parsed,
|
|
731
|
+
quadrant,
|
|
732
|
+
qColor,
|
|
733
|
+
palette,
|
|
734
|
+
isDark,
|
|
735
|
+
svgWidth,
|
|
736
|
+
svgHeight,
|
|
737
|
+
palette.border
|
|
738
|
+
);
|
|
739
|
+
}
|
|
740
|
+
function renderQuarterCircleStatic(svg, parsed, quadrant, qColor, palette, isDark, width, height, mutedColor) {
|
|
741
|
+
const padding = 8;
|
|
742
|
+
const size = Math.min(width - padding, height - padding);
|
|
743
|
+
const maxRadius = size * 0.95;
|
|
744
|
+
const ringCount = parsed.rings.length;
|
|
745
|
+
const ringBandWidth = maxRadius / ringCount;
|
|
746
|
+
const { startAngle, endAngle } = getQuadrantArc(quadrant.position);
|
|
747
|
+
let cx, cy;
|
|
748
|
+
switch (quadrant.position) {
|
|
749
|
+
case "top-right":
|
|
750
|
+
cx = padding;
|
|
751
|
+
cy = size + padding;
|
|
752
|
+
break;
|
|
753
|
+
case "top-left":
|
|
754
|
+
cx = width - padding;
|
|
755
|
+
cy = size + padding;
|
|
756
|
+
break;
|
|
757
|
+
case "bottom-left":
|
|
758
|
+
cx = width - padding;
|
|
759
|
+
cy = padding;
|
|
760
|
+
break;
|
|
761
|
+
case "bottom-right":
|
|
762
|
+
cx = padding;
|
|
763
|
+
cy = padding;
|
|
764
|
+
break;
|
|
765
|
+
}
|
|
766
|
+
const arcGen = (innerR, outerR) => `M${cx + outerR * Math.cos(startAngle)},${cy - outerR * Math.sin(startAngle)} A${outerR},${outerR} 0 0,0 ${cx + outerR * Math.cos(endAngle)},${cy - outerR * Math.sin(endAngle)} L${cx + innerR * Math.cos(endAngle)},${cy - innerR * Math.sin(endAngle)} A${innerR},${innerR} 0 0,1 ${cx + innerR * Math.cos(startAngle)},${cy - innerR * Math.sin(startAngle)} Z`;
|
|
767
|
+
for (let ri = parsed.rings.length - 1; ri >= 0; ri--) {
|
|
768
|
+
const innerR = ri * ringBandWidth;
|
|
769
|
+
const outerR = (ri + 1) * ringBandWidth;
|
|
770
|
+
const fillColor = ri % 2 === 0 ? palette.bg : mix(palette.bg, palette.border, 0.15);
|
|
771
|
+
svg.append("path").attr("d", arcGen(innerR, outerR)).attr("fill", fillColor).attr("stroke", mutedColor).attr("stroke-width", 0.5);
|
|
772
|
+
}
|
|
773
|
+
for (let ri = 0; ri < parsed.rings.length; ri++) {
|
|
774
|
+
const rCenter = (ri + 0.5) * ringBandWidth;
|
|
775
|
+
const midAngle = (startAngle + endAngle) / 2;
|
|
776
|
+
const labelX = cx + rCenter * Math.cos(midAngle);
|
|
777
|
+
const labelY = cy - rCenter * Math.sin(midAngle);
|
|
778
|
+
svg.append("text").attr("x", labelX).attr("y", labelY).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("fill", palette.textMuted).attr("font-family", FONT_FAMILY).attr("font-size", 11).attr("font-weight", "600").attr("opacity", 0.5).text(parsed.rings[ri].name);
|
|
779
|
+
}
|
|
780
|
+
const ringOrder = parsed.rings.map((r) => r.name);
|
|
781
|
+
const angularPadding = 0.08;
|
|
782
|
+
const radialPadding = ringBandWidth * 0.12;
|
|
783
|
+
const usableArcStart = startAngle + angularPadding;
|
|
784
|
+
const usableArcEnd = endAngle - angularPadding;
|
|
785
|
+
const arcSpan = usableArcEnd - usableArcStart;
|
|
786
|
+
const blipsByRing = /* @__PURE__ */ new Map();
|
|
787
|
+
for (const blip of quadrant.blips) {
|
|
788
|
+
const list = blipsByRing.get(blip.ring) ?? [];
|
|
789
|
+
list.push(blip);
|
|
790
|
+
blipsByRing.set(blip.ring, list);
|
|
791
|
+
}
|
|
792
|
+
for (const [ringName, blips] of blipsByRing) {
|
|
793
|
+
const ringIndex = ringOrder.indexOf(ringName);
|
|
794
|
+
if (ringIndex < 0) continue;
|
|
795
|
+
const rInner = ringIndex * ringBandWidth + radialPadding;
|
|
796
|
+
const rOuter = (ringIndex + 1) * ringBandWidth - radialPadding;
|
|
797
|
+
const rMid = (rInner + rOuter) / 2;
|
|
798
|
+
for (let bi = 0; bi < blips.length; bi++) {
|
|
799
|
+
const blip = blips[bi];
|
|
800
|
+
const angle = blips.length === 1 ? (usableArcStart + usableArcEnd) / 2 : usableArcStart + (bi + 0.5) / blips.length * arcSpan;
|
|
801
|
+
const radius = blips.length <= 3 ? rMid : rInner + BLIP_RADIUS + bi % 3 / 2 * (rOuter - rInner - BLIP_RADIUS * 2);
|
|
802
|
+
const bx = cx + radius * Math.cos(angle);
|
|
803
|
+
const by = cy - radius * Math.sin(angle);
|
|
804
|
+
const blipGroup = svg.append("g");
|
|
805
|
+
const angleToCenter = Math.atan2(cy - by, cx - bx);
|
|
806
|
+
renderTrendIndicator(
|
|
807
|
+
blipGroup,
|
|
808
|
+
blip.trend,
|
|
809
|
+
qColor,
|
|
810
|
+
bx,
|
|
811
|
+
by,
|
|
812
|
+
BLIP_RADIUS,
|
|
813
|
+
angleToCenter
|
|
814
|
+
);
|
|
815
|
+
blipGroup.append("text").attr("x", bx).attr("y", by + 3).attr("text-anchor", "middle").attr("fill", isDark ? "#000" : "#fff").attr("font-family", FONT_FAMILY).attr("font-size", BLIP_FONT_SIZE).attr("font-weight", "bold").text(blip.globalNumber);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
function renderStaticHtmlPanel(panel, parsed, quadrant, qColor, palette, isDark) {
|
|
820
|
+
const ringOrder = parsed.rings.map((r) => r.name);
|
|
821
|
+
const fillColor = shapeFill(palette, qColor, isDark, {
|
|
822
|
+
solid: parsed.options["solid-fill"] === "on"
|
|
823
|
+
});
|
|
824
|
+
for (const ringName of ringOrder) {
|
|
825
|
+
const blips = quadrant.blips.filter((b) => b.ring === ringName);
|
|
826
|
+
if (blips.length === 0) continue;
|
|
827
|
+
const ringGroup = document.createElement("div");
|
|
828
|
+
ringGroup.style.cssText = `
|
|
829
|
+
background: ${palette.surface};
|
|
830
|
+
border-radius: 8px;
|
|
831
|
+
padding: 10px;
|
|
832
|
+
margin-bottom: 12px;
|
|
833
|
+
`;
|
|
834
|
+
const header = document.createElement("div");
|
|
835
|
+
header.style.cssText = `
|
|
836
|
+
font-size: 13px; font-weight: 700; color: ${palette.textMuted};
|
|
837
|
+
margin-bottom: 8px;
|
|
838
|
+
`;
|
|
839
|
+
header.textContent = ringName;
|
|
840
|
+
ringGroup.appendChild(header);
|
|
841
|
+
panel.appendChild(ringGroup);
|
|
842
|
+
for (const blip of blips) {
|
|
843
|
+
const hasDesc = blip.description.length > 0;
|
|
844
|
+
const node = document.createElement("div");
|
|
845
|
+
node.style.cssText = `
|
|
846
|
+
background: ${fillColor}; border: 1.5px solid ${qColor};
|
|
847
|
+
border-radius: 6px; margin-bottom: 6px;
|
|
848
|
+
`;
|
|
849
|
+
const titleRow = document.createElement("div");
|
|
850
|
+
titleRow.style.cssText = `
|
|
851
|
+
display: flex; align-items: center; gap: 8px;
|
|
852
|
+
padding: 6px 10px; min-height: 28px;
|
|
853
|
+
`;
|
|
854
|
+
const indicatorSvg = document.createElementNS(
|
|
855
|
+
"http://www.w3.org/2000/svg",
|
|
856
|
+
"svg"
|
|
857
|
+
);
|
|
858
|
+
indicatorSvg.setAttribute("width", "26");
|
|
859
|
+
indicatorSvg.setAttribute("height", "26");
|
|
860
|
+
indicatorSvg.style.flexShrink = "0";
|
|
861
|
+
const indicatorG = d3Selection.select(indicatorSvg).append("g");
|
|
862
|
+
renderTrendIndicator(
|
|
863
|
+
indicatorG,
|
|
864
|
+
blip.trend,
|
|
865
|
+
qColor,
|
|
866
|
+
13,
|
|
867
|
+
13,
|
|
868
|
+
10,
|
|
869
|
+
-Math.PI / 2
|
|
870
|
+
);
|
|
871
|
+
d3Selection.select(indicatorSvg).append("text").attr("x", 13).attr("y", 16).attr("text-anchor", "middle").attr("fill", isDark ? "#000" : "#fff").attr("font-family", FONT_FAMILY).attr("font-size", 9).attr("font-weight", "bold").text(blip.globalNumber);
|
|
872
|
+
titleRow.appendChild(indicatorSvg);
|
|
873
|
+
const name = document.createElement("span");
|
|
874
|
+
name.textContent = blip.name;
|
|
875
|
+
name.style.cssText = `
|
|
876
|
+
flex: 1; font-size: 12px; font-weight: 600;
|
|
877
|
+
color: ${palette.text};
|
|
878
|
+
`;
|
|
879
|
+
titleRow.appendChild(name);
|
|
880
|
+
node.appendChild(titleRow);
|
|
881
|
+
if (hasDesc) {
|
|
882
|
+
const sepDiv = document.createElement("div");
|
|
883
|
+
sepDiv.style.cssText = `border-top: 1px solid ${qColor}; opacity: 0.3;`;
|
|
884
|
+
node.appendChild(sepDiv);
|
|
885
|
+
const descDiv = document.createElement("div");
|
|
886
|
+
descDiv.style.cssText = `
|
|
887
|
+
padding: 6px 10px 8px; font-size: 11px; line-height: 1.6;
|
|
888
|
+
color: ${palette.textMuted};
|
|
889
|
+
`;
|
|
890
|
+
descDiv.innerHTML = renderDescriptionHtml(blip.description, palette);
|
|
891
|
+
node.appendChild(descDiv);
|
|
892
|
+
}
|
|
893
|
+
ringGroup.appendChild(node);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
// src/tech-radar/renderer.ts
|
|
899
|
+
var BLIP_RADIUS2 = 12;
|
|
900
|
+
var BLIP_FONT_SIZE2 = 9;
|
|
901
|
+
var RING_LABEL_FONT_SIZE = 13;
|
|
902
|
+
var QUADRANT_LABEL_FONT_SIZE = 18;
|
|
903
|
+
var TITLE_FONT_SIZE2 = 18;
|
|
904
|
+
var LISTING_FONT_SIZE = 12;
|
|
905
|
+
var LISTING_HEADER_FONT_SIZE = 13;
|
|
906
|
+
var LISTING_TOP_MARGIN = 24;
|
|
907
|
+
var LISTING_COL_GAP = 16;
|
|
908
|
+
var LISTING_LINE_HEIGHT = 24;
|
|
909
|
+
function initRadarSvg(container, palette, exportDims) {
|
|
910
|
+
d3Selection2.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
911
|
+
const width = exportDims?.width ?? container.clientWidth;
|
|
912
|
+
const height = exportDims?.height ?? container.clientHeight;
|
|
913
|
+
if (width <= 0 || height <= 0) return null;
|
|
914
|
+
const textColor = palette.text;
|
|
915
|
+
const mutedColor = palette.border;
|
|
916
|
+
const bgColor = palette.bg;
|
|
917
|
+
const svg = d3Selection2.select(container).append("svg").attr("width", width).attr("height", height).attr("viewBox", `0 0 ${width} ${height}`).attr("preserveAspectRatio", "xMidYMid meet").style("background", bgColor);
|
|
918
|
+
return { svg, width, height, textColor, mutedColor, bgColor };
|
|
919
|
+
}
|
|
920
|
+
function renderTechRadar(container, parsed, palette, isDark, onClickItem, exportDims, viewState, options) {
|
|
921
|
+
if (parsed.quadrants.length === 0 || parsed.rings.length === 0) return;
|
|
922
|
+
if (viewState?.rq && !exportDims) {
|
|
923
|
+
renderQuadrantFocus(
|
|
924
|
+
container,
|
|
925
|
+
parsed,
|
|
926
|
+
viewState.rq,
|
|
927
|
+
palette,
|
|
928
|
+
isDark,
|
|
929
|
+
onClickItem,
|
|
930
|
+
exportDims,
|
|
931
|
+
options
|
|
932
|
+
);
|
|
933
|
+
return;
|
|
934
|
+
}
|
|
935
|
+
const directiveOn = parsed.options["show-blip-legend"] === "on";
|
|
936
|
+
const showListing = exportDims ? true : options?.showListing ?? directiveOn;
|
|
937
|
+
const init = initRadarSvg(container, palette, exportDims);
|
|
938
|
+
if (!init) return;
|
|
939
|
+
const { svg, width, height, textColor, mutedColor } = init;
|
|
940
|
+
const colCount = parsed.quadrants.length;
|
|
941
|
+
const listingIdealWidth = colCount * 200 + LISTING_COL_GAP * (colCount + 1);
|
|
942
|
+
const radarIdealWidth = 500;
|
|
943
|
+
const idealWidth = Math.max(listingIdealWidth, radarIdealWidth);
|
|
944
|
+
const ctx = exportDims ? ScaleContext.identity() : ScaleContext.from(width, idealWidth);
|
|
945
|
+
const sBlipRadius = ctx.structural(BLIP_RADIUS2);
|
|
946
|
+
const sBlipFontSize = ctx.text(BLIP_FONT_SIZE2);
|
|
947
|
+
const sRingLabelFontSize = ctx.text(RING_LABEL_FONT_SIZE);
|
|
948
|
+
const sQuadrantLabelFontSize = ctx.text(QUADRANT_LABEL_FONT_SIZE);
|
|
949
|
+
const sTitleFontSize = ctx.text(TITLE_FONT_SIZE2);
|
|
950
|
+
const sListingFontSize = ctx.text(LISTING_FONT_SIZE);
|
|
951
|
+
const sListingHeaderFontSize = ctx.text(LISTING_HEADER_FONT_SIZE);
|
|
952
|
+
const sListingTopMargin = ctx.aesthetic(LISTING_TOP_MARGIN);
|
|
953
|
+
const sListingColGap = ctx.aesthetic(LISTING_COL_GAP);
|
|
954
|
+
const sListingLineHeight = ctx.structural(LISTING_LINE_HEIGHT);
|
|
955
|
+
const sListingBlipR = ctx.structural(LISTING_BLIP_R);
|
|
956
|
+
const listingHeight = showListing ? estimateListingHeight(parsed, sListingLineHeight, sListingTopMargin) : 0;
|
|
957
|
+
const radarHeight = Math.max(
|
|
958
|
+
200,
|
|
959
|
+
height - listingHeight - (showListing ? sListingTopMargin : 0)
|
|
960
|
+
);
|
|
961
|
+
const radarWidth = width;
|
|
962
|
+
const titleY = 24;
|
|
963
|
+
const showTitle = !!parsed.title && parsed.options["no-title"] !== "on";
|
|
964
|
+
if (showTitle) {
|
|
965
|
+
svg.append("text").attr("x", radarWidth / 2).attr("y", titleY).attr("text-anchor", "middle").attr("fill", textColor).attr("font-family", FONT_FAMILY).attr("font-size", sTitleFontSize).attr("font-weight", "bold").text(parsed.title);
|
|
966
|
+
}
|
|
967
|
+
let legendReservedHeight = 0;
|
|
968
|
+
if (!exportDims && options?.onToggleListing) {
|
|
969
|
+
const legendY = showTitle ? titleY + 8 : 4;
|
|
970
|
+
const legendG = svg.append("g").attr("transform", `translate(0, ${legendY})`);
|
|
971
|
+
const legendConfig = {
|
|
972
|
+
groups: [
|
|
973
|
+
{
|
|
974
|
+
name: "Trends",
|
|
975
|
+
entries: TREND_ITEMS.map((item) => ({
|
|
976
|
+
value: item.label,
|
|
977
|
+
color: palette.textMuted
|
|
978
|
+
}))
|
|
979
|
+
}
|
|
980
|
+
],
|
|
981
|
+
position: { placement: "top-center", titleRelation: "below-title" },
|
|
982
|
+
mode: options?.exportMode ? "export" : "preview",
|
|
983
|
+
controlsGroup: {
|
|
984
|
+
toggles: [
|
|
985
|
+
{
|
|
986
|
+
id: "blip-legend",
|
|
987
|
+
type: "toggle",
|
|
988
|
+
label: "Blip Legend",
|
|
989
|
+
active: showListing,
|
|
990
|
+
onToggle: (active) => options.onToggleListing(active)
|
|
991
|
+
}
|
|
992
|
+
]
|
|
993
|
+
},
|
|
994
|
+
...options.controlsHost !== void 0 && {
|
|
995
|
+
controlsHost: options.controlsHost
|
|
996
|
+
}
|
|
997
|
+
};
|
|
998
|
+
const legendPalette = {
|
|
999
|
+
text: palette.text,
|
|
1000
|
+
textMuted: palette.textMuted,
|
|
1001
|
+
bg: palette.bg,
|
|
1002
|
+
surface: palette.surface,
|
|
1003
|
+
primary: palette.primary
|
|
1004
|
+
};
|
|
1005
|
+
const legendCallbacks = {
|
|
1006
|
+
...options.onLegendGroupToggle !== void 0 && {
|
|
1007
|
+
onGroupToggle: options.onLegendGroupToggle
|
|
1008
|
+
},
|
|
1009
|
+
...options.onToggleControlsExpand !== void 0 && {
|
|
1010
|
+
onControlsExpand: options.onToggleControlsExpand
|
|
1011
|
+
},
|
|
1012
|
+
onControlsToggle: (id, active) => {
|
|
1013
|
+
if (id === "blip-legend" && options.onToggleListing) {
|
|
1014
|
+
options.onToggleListing(active);
|
|
1015
|
+
}
|
|
1016
|
+
},
|
|
1017
|
+
onEntryHover: (_groupName, entryValue) => {
|
|
1018
|
+
if (!entryValue) {
|
|
1019
|
+
svg.selectAll("[data-trend]").style("opacity", "1");
|
|
1020
|
+
return;
|
|
1021
|
+
}
|
|
1022
|
+
const item = TREND_ITEMS.find((t) => t.label === entryValue);
|
|
1023
|
+
if (!item) return;
|
|
1024
|
+
const trendVal = item.trend ?? "stable";
|
|
1025
|
+
svg.selectAll("[data-trend]").style("opacity", function() {
|
|
1026
|
+
return this.getAttribute("data-trend") === trendVal ? "1" : String(DIM_OPACITY);
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
};
|
|
1030
|
+
renderIntegratedLegend(legendG, {
|
|
1031
|
+
...legendConfig,
|
|
1032
|
+
palette: legendPalette,
|
|
1033
|
+
isDark,
|
|
1034
|
+
width,
|
|
1035
|
+
activeGroup: options?.activeLegendGroup ?? null,
|
|
1036
|
+
...options.controlsExpanded !== void 0 && {
|
|
1037
|
+
controlsExpanded: options.controlsExpanded
|
|
1038
|
+
},
|
|
1039
|
+
callbacks: legendCallbacks
|
|
1040
|
+
});
|
|
1041
|
+
legendReservedHeight = getMaxLegendReservedHeight(legendConfig, width) + 8;
|
|
1042
|
+
}
|
|
1043
|
+
const radarTop = (showTitle ? titleY + 16 : 8) + legendReservedHeight;
|
|
1044
|
+
const radarAreaHeight = radarHeight - radarTop;
|
|
1045
|
+
const radarAreaWidth = radarWidth;
|
|
1046
|
+
const { cx, cy, maxRadius, ringBandWidth } = getRadarGeometry(
|
|
1047
|
+
radarAreaWidth,
|
|
1048
|
+
radarAreaHeight,
|
|
1049
|
+
parsed.rings.length
|
|
1050
|
+
);
|
|
1051
|
+
const offsetY = radarTop;
|
|
1052
|
+
const radarGroup = svg.append("g").attr("transform", `translate(0, ${offsetY})`);
|
|
1053
|
+
if (ctx.isBelowFloor) {
|
|
1054
|
+
svg.attr("viewBox", `0 0 ${width} ${height}`).attr("width", "100%");
|
|
1055
|
+
}
|
|
1056
|
+
for (let ri = parsed.rings.length - 1; ri >= 0; ri--) {
|
|
1057
|
+
const innerR = ri * ringBandWidth;
|
|
1058
|
+
const outerR = (ri + 1) * ringBandWidth;
|
|
1059
|
+
const fillColor = ri % 2 === 0 ? palette.bg : mix(palette.bg, palette.border, 0.15);
|
|
1060
|
+
const ringName = parsed.rings[ri].name;
|
|
1061
|
+
for (const quadrant of parsed.quadrants) {
|
|
1062
|
+
const { startAngle, endAngle } = getQuadrantArc(quadrant.position);
|
|
1063
|
+
const path = buildArcSlicePath(
|
|
1064
|
+
cx,
|
|
1065
|
+
cy,
|
|
1066
|
+
innerR,
|
|
1067
|
+
outerR,
|
|
1068
|
+
startAngle,
|
|
1069
|
+
endAngle
|
|
1070
|
+
);
|
|
1071
|
+
radarGroup.append("path").attr("d", path).attr("fill", fillColor).attr("stroke", mutedColor).attr("stroke-width", 0.5).attr("data-ring-segment", "").attr("data-quadrant", quadrant.position).attr("data-ring", ringName);
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
radarGroup.append("line").attr("x1", cx - maxRadius).attr("y1", cy).attr("x2", cx + maxRadius).attr("y2", cy).attr("stroke", mutedColor).attr("stroke-width", 1);
|
|
1075
|
+
radarGroup.append("line").attr("x1", cx).attr("y1", cy - maxRadius).attr("x2", cx).attr("y2", cy + maxRadius).attr("stroke", mutedColor).attr("stroke-width", 1);
|
|
1076
|
+
for (let ri = 0; ri < parsed.rings.length; ri++) {
|
|
1077
|
+
const rCenter = (ri + 0.5) * ringBandWidth;
|
|
1078
|
+
if (ri === 0) {
|
|
1079
|
+
radarGroup.append("text").attr("x", cx).attr("y", cy).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("fill", textColor).attr("font-family", FONT_FAMILY).attr("font-size", sRingLabelFontSize).attr("font-weight", "600").attr("opacity", 0.5).text(parsed.rings[ri].name);
|
|
1080
|
+
} else {
|
|
1081
|
+
radarGroup.append("text").attr("x", cx).attr("y", cy - rCenter).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("fill", textColor).attr("font-family", FONT_FAMILY).attr("font-size", sRingLabelFontSize).attr("font-weight", "600").attr("opacity", 0.5).text(parsed.rings[ri].name);
|
|
1082
|
+
radarGroup.append("text").attr("x", cx).attr("y", cy + rCenter).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("fill", textColor).attr("font-family", FONT_FAMILY).attr("font-size", sRingLabelFontSize).attr("font-weight", "600").attr("opacity", 0.5).text(parsed.rings[ri].name);
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
for (const quadrant of parsed.quadrants) {
|
|
1086
|
+
const qColor = resolveQuadrantColor(
|
|
1087
|
+
quadrant.position,
|
|
1088
|
+
quadrant.color,
|
|
1089
|
+
palette
|
|
1090
|
+
);
|
|
1091
|
+
const {
|
|
1092
|
+
x: labelX,
|
|
1093
|
+
y: labelY,
|
|
1094
|
+
anchor
|
|
1095
|
+
} = getQuadrantLabelPosition(quadrant.position, cx, cy, maxRadius);
|
|
1096
|
+
const labelGroup = radarGroup.append("g").attr("data-line-number", quadrant.lineNumber).style("cursor", "pointer");
|
|
1097
|
+
renderQuadrantLabel(
|
|
1098
|
+
labelGroup,
|
|
1099
|
+
quadrant.name,
|
|
1100
|
+
labelX,
|
|
1101
|
+
labelY,
|
|
1102
|
+
anchor,
|
|
1103
|
+
qColor,
|
|
1104
|
+
maxRadius * 0.9,
|
|
1105
|
+
sQuadrantLabelFontSize
|
|
1106
|
+
);
|
|
1107
|
+
}
|
|
1108
|
+
if (!exportDims) {
|
|
1109
|
+
renderRingHoverAreas(
|
|
1110
|
+
radarGroup,
|
|
1111
|
+
svg,
|
|
1112
|
+
parsed,
|
|
1113
|
+
palette,
|
|
1114
|
+
cx,
|
|
1115
|
+
cy,
|
|
1116
|
+
ringBandWidth,
|
|
1117
|
+
maxRadius
|
|
1118
|
+
);
|
|
1119
|
+
}
|
|
1120
|
+
const layoutPoints = computeRadarLayout(
|
|
1121
|
+
parsed,
|
|
1122
|
+
radarAreaWidth,
|
|
1123
|
+
radarAreaHeight,
|
|
1124
|
+
ctx
|
|
1125
|
+
);
|
|
1126
|
+
const popover = createBlipPopover(container, palette, isDark);
|
|
1127
|
+
let pinnedLineNum = null;
|
|
1128
|
+
function showBlipHighlight(lineNum, bx, by, blipGroup) {
|
|
1129
|
+
blipGroup.attr(
|
|
1130
|
+
"transform",
|
|
1131
|
+
`translate(${bx},${by}) scale(1.5) translate(${-bx},${-by})`
|
|
1132
|
+
);
|
|
1133
|
+
svg.selectAll("[data-line-number]").style("opacity", function() {
|
|
1134
|
+
return this.getAttribute("data-line-number") === lineNum ? "1" : String(DIM_OPACITY);
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1137
|
+
function clearBlipHighlight() {
|
|
1138
|
+
svg.selectAll("[data-line-number]").style("opacity", "1").attr("transform", null);
|
|
1139
|
+
}
|
|
1140
|
+
for (const point of layoutPoints) {
|
|
1141
|
+
const quadrant = parsed.quadrants.find(
|
|
1142
|
+
(q) => q.blips.includes(point.blip)
|
|
1143
|
+
);
|
|
1144
|
+
const qColor = resolveQuadrantColor(
|
|
1145
|
+
quadrant.position,
|
|
1146
|
+
quadrant.color,
|
|
1147
|
+
palette
|
|
1148
|
+
);
|
|
1149
|
+
const blipGroup = radarGroup.append("g").attr("data-line-number", point.blip.lineNumber).attr("data-quadrant", quadrant.position).attr("data-ring", point.blip.ring).attr("data-trend", point.blip.trend ?? "stable").style("cursor", "pointer");
|
|
1150
|
+
const angleToCenter = Math.atan2(cy - point.y, cx - point.x);
|
|
1151
|
+
renderTrendIndicator(
|
|
1152
|
+
blipGroup,
|
|
1153
|
+
point.blip.trend,
|
|
1154
|
+
qColor,
|
|
1155
|
+
point.x,
|
|
1156
|
+
point.y,
|
|
1157
|
+
sBlipRadius,
|
|
1158
|
+
angleToCenter
|
|
1159
|
+
);
|
|
1160
|
+
blipGroup.append("text").attr("x", point.x).attr("y", point.y + 3).attr("text-anchor", "middle").attr("fill", isDark ? "#000" : "#fff").attr("font-family", FONT_FAMILY).attr("font-size", sBlipFontSize).attr("font-weight", "bold").text(point.blip.globalNumber);
|
|
1161
|
+
const lineNum = String(point.blip.lineNumber);
|
|
1162
|
+
const bx = point.x;
|
|
1163
|
+
const by = point.y;
|
|
1164
|
+
blipGroup.on("mouseenter", (event) => {
|
|
1165
|
+
if (pinnedLineNum) return;
|
|
1166
|
+
showBlipPopover(
|
|
1167
|
+
popover,
|
|
1168
|
+
point.blip,
|
|
1169
|
+
qColor,
|
|
1170
|
+
palette,
|
|
1171
|
+
isDark,
|
|
1172
|
+
event,
|
|
1173
|
+
// Tech-radar opts out of solid-fill: blip popover stays in tinted
|
|
1174
|
+
// form so it reads consistently against the radar bg regardless of
|
|
1175
|
+
// the diagram's option setting.
|
|
1176
|
+
false
|
|
1177
|
+
);
|
|
1178
|
+
showBlipHighlight(lineNum, bx, by, blipGroup);
|
|
1179
|
+
}).on("mousemove", (event) => {
|
|
1180
|
+
if (pinnedLineNum) return;
|
|
1181
|
+
positionPopover(popover, event);
|
|
1182
|
+
}).on("mouseleave", () => {
|
|
1183
|
+
if (pinnedLineNum) return;
|
|
1184
|
+
hideBlipPopover(popover);
|
|
1185
|
+
clearBlipHighlight();
|
|
1186
|
+
});
|
|
1187
|
+
blipGroup.on("click", (event) => {
|
|
1188
|
+
event._blipClick = true;
|
|
1189
|
+
if (pinnedLineNum === lineNum) {
|
|
1190
|
+
pinnedLineNum = null;
|
|
1191
|
+
hideBlipPopover(popover);
|
|
1192
|
+
clearBlipHighlight();
|
|
1193
|
+
} else {
|
|
1194
|
+
pinnedLineNum = lineNum;
|
|
1195
|
+
showBlipPopover(
|
|
1196
|
+
popover,
|
|
1197
|
+
point.blip,
|
|
1198
|
+
qColor,
|
|
1199
|
+
palette,
|
|
1200
|
+
isDark,
|
|
1201
|
+
event,
|
|
1202
|
+
// Tech-radar opts out of solid-fill: blip popover stays in tinted
|
|
1203
|
+
// form so it reads consistently against the radar bg regardless of
|
|
1204
|
+
// the diagram's option setting.
|
|
1205
|
+
false
|
|
1206
|
+
);
|
|
1207
|
+
popover.style.pointerEvents = "auto";
|
|
1208
|
+
showBlipHighlight(lineNum, bx, by, blipGroup);
|
|
1209
|
+
}
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
svg.on("click", (event) => {
|
|
1213
|
+
if (event._blipClick) return;
|
|
1214
|
+
if (pinnedLineNum) {
|
|
1215
|
+
pinnedLineNum = null;
|
|
1216
|
+
hideBlipPopover(popover);
|
|
1217
|
+
clearBlipHighlight();
|
|
1218
|
+
}
|
|
1219
|
+
});
|
|
1220
|
+
if (options?.activeLine && !pinnedLineNum) {
|
|
1221
|
+
const activeLn = options.activeLine;
|
|
1222
|
+
for (const point of layoutPoints) {
|
|
1223
|
+
const blip = point.blip;
|
|
1224
|
+
const isOnBlip = blip.lineNumber === activeLn;
|
|
1225
|
+
const isOnDesc = blip.description.length > 0 && activeLn > blip.lineNumber && activeLn <= blip.lineNumber + blip.description.length;
|
|
1226
|
+
if (isOnBlip || isOnDesc) {
|
|
1227
|
+
const quadrant = parsed.quadrants.find((q) => q.blips.includes(blip));
|
|
1228
|
+
const qColor = resolveQuadrantColor(
|
|
1229
|
+
quadrant.position,
|
|
1230
|
+
quadrant.color,
|
|
1231
|
+
palette
|
|
1232
|
+
);
|
|
1233
|
+
const svgRect = svg.node()?.getBoundingClientRect();
|
|
1234
|
+
if (svgRect) {
|
|
1235
|
+
const fakeEvent = {
|
|
1236
|
+
clientX: svgRect.left + point.x,
|
|
1237
|
+
clientY: svgRect.top + offsetY + point.y
|
|
1238
|
+
};
|
|
1239
|
+
showBlipPopover(
|
|
1240
|
+
popover,
|
|
1241
|
+
blip,
|
|
1242
|
+
qColor,
|
|
1243
|
+
palette,
|
|
1244
|
+
isDark,
|
|
1245
|
+
fakeEvent,
|
|
1246
|
+
// Tech-radar opts out of solid-fill: blip popover stays in tinted
|
|
1247
|
+
// form so it reads consistently against the radar bg regardless of
|
|
1248
|
+
// the diagram's option setting.
|
|
1249
|
+
false
|
|
1250
|
+
);
|
|
1251
|
+
}
|
|
1252
|
+
const lineNum = String(blip.lineNumber);
|
|
1253
|
+
const blipEl = svg.select(`[data-line-number="${lineNum}"]`);
|
|
1254
|
+
if (!blipEl.empty()) {
|
|
1255
|
+
blipEl.attr(
|
|
1256
|
+
"transform",
|
|
1257
|
+
`translate(${point.x},${point.y}) scale(1.5) translate(${-point.x},${-point.y})`
|
|
1258
|
+
);
|
|
1259
|
+
}
|
|
1260
|
+
svg.selectAll("[data-line-number]").style("opacity", function() {
|
|
1261
|
+
return this.getAttribute("data-line-number") === lineNum ? "1" : String(DIM_OPACITY);
|
|
1262
|
+
});
|
|
1263
|
+
break;
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
if (showListing) {
|
|
1268
|
+
renderBlipListing(
|
|
1269
|
+
svg,
|
|
1270
|
+
parsed,
|
|
1271
|
+
palette,
|
|
1272
|
+
isDark,
|
|
1273
|
+
textColor,
|
|
1274
|
+
radarHeight + sListingTopMargin,
|
|
1275
|
+
width,
|
|
1276
|
+
onClickItem,
|
|
1277
|
+
sListingFontSize,
|
|
1278
|
+
sListingHeaderFontSize,
|
|
1279
|
+
sListingColGap,
|
|
1280
|
+
sListingLineHeight,
|
|
1281
|
+
sListingBlipR
|
|
1282
|
+
);
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
var LISTING_BLIP_R = 11;
|
|
1286
|
+
function renderBlipListing(svg, parsed, palette, isDark, textColor, startY, totalWidth, onClickItem, sListingFontSize = LISTING_FONT_SIZE, sListingHeaderFontSize = LISTING_HEADER_FONT_SIZE, sListingColGap = LISTING_COL_GAP, sListingLineHeight = LISTING_LINE_HEIGHT, sListingBlipR = LISTING_BLIP_R) {
|
|
1287
|
+
const colCount = parsed.quadrants.length;
|
|
1288
|
+
if (colCount === 0) return;
|
|
1289
|
+
const colWidth = (totalWidth - sListingColGap * (colCount + 1)) / colCount;
|
|
1290
|
+
const sortedQuadrants = [...parsed.quadrants].sort(
|
|
1291
|
+
(a, b) => POSITION_ORDER.indexOf(a.position) - POSITION_ORDER.indexOf(b.position)
|
|
1292
|
+
);
|
|
1293
|
+
for (let ci = 0; ci < sortedQuadrants.length; ci++) {
|
|
1294
|
+
const quadrant = sortedQuadrants[ci];
|
|
1295
|
+
const qColor = resolveQuadrantColor(
|
|
1296
|
+
quadrant.position,
|
|
1297
|
+
quadrant.color,
|
|
1298
|
+
palette
|
|
1299
|
+
);
|
|
1300
|
+
const colX = sListingColGap + ci * (colWidth + sListingColGap);
|
|
1301
|
+
let y = startY;
|
|
1302
|
+
const headerText = svg.append("text").attr("x", colX).attr("y", y).attr("fill", qColor).attr("font-family", FONT_FAMILY).attr("font-size", sListingHeaderFontSize).attr("font-weight", "bold").style("cursor", "pointer").text(quadrant.name);
|
|
1303
|
+
const qPos = quadrant.position;
|
|
1304
|
+
headerText.on("mouseenter", () => {
|
|
1305
|
+
svg.selectAll("[data-quadrant][data-ring]").style("opacity", function() {
|
|
1306
|
+
return this.getAttribute("data-quadrant") === qPos ? "1" : String(DIM_OPACITY);
|
|
1307
|
+
});
|
|
1308
|
+
}).on("mouseleave", () => {
|
|
1309
|
+
svg.selectAll("[data-quadrant][data-ring]").style("opacity", "1");
|
|
1310
|
+
});
|
|
1311
|
+
y += sListingLineHeight + 6;
|
|
1312
|
+
const sortedBlips = [...quadrant.blips].sort(
|
|
1313
|
+
(a, b) => a.globalNumber - b.globalNumber
|
|
1314
|
+
);
|
|
1315
|
+
for (const blip of sortedBlips) {
|
|
1316
|
+
const itemGroup = svg.append("g").attr("data-line-number", blip.lineNumber).attr("data-quadrant", quadrant.position).attr("data-ring", blip.ring).attr("data-trend", blip.trend ?? "stable").style("cursor", onClickItem ? "pointer" : "default");
|
|
1317
|
+
const blipCx = colX + sListingBlipR;
|
|
1318
|
+
const blipCy = y - sListingBlipR + 2;
|
|
1319
|
+
const trendAngle = -Math.PI / 2;
|
|
1320
|
+
renderTrendIndicator(
|
|
1321
|
+
itemGroup,
|
|
1322
|
+
blip.trend,
|
|
1323
|
+
qColor,
|
|
1324
|
+
blipCx,
|
|
1325
|
+
blipCy,
|
|
1326
|
+
sListingBlipR,
|
|
1327
|
+
trendAngle
|
|
1328
|
+
);
|
|
1329
|
+
itemGroup.append("text").attr("x", blipCx).attr("y", blipCy + 3).attr("text-anchor", "middle").attr("fill", isDark ? "#000" : "#fff").attr("font-family", FONT_FAMILY).attr("font-size", 9).attr("font-weight", "bold").text(blip.globalNumber);
|
|
1330
|
+
const textX = colX + sListingBlipR * 2 + 6;
|
|
1331
|
+
const availableWidth = colWidth - sListingBlipR * 2 - 8;
|
|
1332
|
+
const fullLabel = `${blip.name} (${blip.ring})`;
|
|
1333
|
+
const label = truncateText(fullLabel, sListingFontSize, availableWidth);
|
|
1334
|
+
itemGroup.append("text").attr("x", textX).attr("y", y).attr("fill", textColor).attr("font-family", FONT_FAMILY).attr("font-size", sListingFontSize).text(label);
|
|
1335
|
+
const ln = String(blip.lineNumber);
|
|
1336
|
+
itemGroup.on("mouseenter", () => {
|
|
1337
|
+
svg.selectAll("[data-line-number]").style("opacity", function() {
|
|
1338
|
+
const isMatch = this.getAttribute("data-line-number") === ln;
|
|
1339
|
+
if (isMatch && this.getAttribute("data-quadrant") && this.closest("g[transform]")) {
|
|
1340
|
+
const bbox = this.getBBox?.();
|
|
1341
|
+
if (bbox) {
|
|
1342
|
+
const bx = bbox.x + bbox.width / 2;
|
|
1343
|
+
const by = bbox.y + bbox.height / 2;
|
|
1344
|
+
this.setAttribute(
|
|
1345
|
+
"transform",
|
|
1346
|
+
`translate(${bx},${by}) scale(1.5) translate(${-bx},${-by})`
|
|
1347
|
+
);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
return isMatch ? "1" : String(DIM_OPACITY);
|
|
1351
|
+
});
|
|
1352
|
+
}).on("mouseleave", () => {
|
|
1353
|
+
svg.selectAll("[data-line-number]").style("opacity", "1").attr("transform", null);
|
|
1354
|
+
});
|
|
1355
|
+
if (onClickItem) {
|
|
1356
|
+
itemGroup.on("click", () => onClickItem(blip.lineNumber));
|
|
1357
|
+
}
|
|
1358
|
+
y += sListingLineHeight;
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
function renderRingHoverAreas(radarGroup, svg, parsed, palette, cx, cy, ringBandWidth, _maxRadius) {
|
|
1363
|
+
for (const quadrant of parsed.quadrants) {
|
|
1364
|
+
const { startAngle, endAngle } = getQuadrantArc(quadrant.position);
|
|
1365
|
+
const qColor = resolveQuadrantColor(
|
|
1366
|
+
quadrant.position,
|
|
1367
|
+
quadrant.color,
|
|
1368
|
+
palette
|
|
1369
|
+
);
|
|
1370
|
+
for (let ri = 0; ri < parsed.rings.length; ri++) {
|
|
1371
|
+
const innerR = ri * ringBandWidth;
|
|
1372
|
+
const outerR = (ri + 1) * ringBandWidth;
|
|
1373
|
+
const ringName = parsed.rings[ri].name;
|
|
1374
|
+
const path = buildArcSlicePath(
|
|
1375
|
+
cx,
|
|
1376
|
+
cy,
|
|
1377
|
+
innerR,
|
|
1378
|
+
outerR,
|
|
1379
|
+
startAngle,
|
|
1380
|
+
endAngle
|
|
1381
|
+
);
|
|
1382
|
+
const hitArea = radarGroup.append("path").attr("d", path).attr("fill", "transparent").style("cursor", "pointer");
|
|
1383
|
+
hitArea.on("mouseenter", () => {
|
|
1384
|
+
hitArea.attr("fill", qColor).attr("opacity", 0.15);
|
|
1385
|
+
svg.selectAll("[data-quadrant][data-ring]").style("opacity", function() {
|
|
1386
|
+
const q = this.getAttribute("data-quadrant");
|
|
1387
|
+
const r = this.getAttribute("data-ring");
|
|
1388
|
+
return q === quadrant.position && r === ringName ? "1" : String(DIM_OPACITY);
|
|
1389
|
+
});
|
|
1390
|
+
}).on("mouseleave", () => {
|
|
1391
|
+
hitArea.attr("fill", "transparent").attr("opacity", 1);
|
|
1392
|
+
svg.selectAll("[data-quadrant][data-ring]").style("opacity", "1");
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
function buildArcSlicePath(cx, cy, innerR, outerR, startAngle, endAngle) {
|
|
1398
|
+
const ox1 = cx + outerR * Math.cos(startAngle);
|
|
1399
|
+
const oy1 = cy - outerR * Math.sin(startAngle);
|
|
1400
|
+
const ox2 = cx + outerR * Math.cos(endAngle);
|
|
1401
|
+
const oy2 = cy - outerR * Math.sin(endAngle);
|
|
1402
|
+
const ix1 = cx + innerR * Math.cos(endAngle);
|
|
1403
|
+
const iy1 = cy - innerR * Math.sin(endAngle);
|
|
1404
|
+
const ix2 = cx + innerR * Math.cos(startAngle);
|
|
1405
|
+
const iy2 = cy - innerR * Math.sin(startAngle);
|
|
1406
|
+
if (innerR === 0) {
|
|
1407
|
+
return `M${cx},${cy} L${ox1},${oy1} A${outerR},${outerR} 0 0,0 ${ox2},${oy2} Z`;
|
|
1408
|
+
}
|
|
1409
|
+
return `M${ox1},${oy1} A${outerR},${outerR} 0 0,0 ${ox2},${oy2} L${ix1},${iy1} A${innerR},${innerR} 0 0,1 ${ix2},${iy2} Z`;
|
|
1410
|
+
}
|
|
1411
|
+
function estimateListingHeight(parsed, lineHeight = LISTING_LINE_HEIGHT, topMargin = LISTING_TOP_MARGIN) {
|
|
1412
|
+
const maxBlipsInQuadrant = Math.max(
|
|
1413
|
+
0,
|
|
1414
|
+
...parsed.quadrants.map((q) => q.blips.length)
|
|
1415
|
+
);
|
|
1416
|
+
return lineHeight * (maxBlipsInQuadrant + 1) + lineHeight + topMargin;
|
|
1417
|
+
}
|
|
1418
|
+
function createBlipPopover(container, _palette, isDark) {
|
|
1419
|
+
container.style.position = "relative";
|
|
1420
|
+
const existing = container.querySelector(
|
|
1421
|
+
"[data-blip-popover]"
|
|
1422
|
+
);
|
|
1423
|
+
if (existing) {
|
|
1424
|
+
existing.style.display = "none";
|
|
1425
|
+
return existing;
|
|
1426
|
+
}
|
|
1427
|
+
const el = document.createElement("div");
|
|
1428
|
+
el.setAttribute("data-blip-popover", "");
|
|
1429
|
+
el.style.position = "absolute";
|
|
1430
|
+
el.style.display = "none";
|
|
1431
|
+
el.style.pointerEvents = "none";
|
|
1432
|
+
el.style.zIndex = "20";
|
|
1433
|
+
el.style.maxWidth = "280px";
|
|
1434
|
+
el.style.fontFamily = FONT_FAMILY;
|
|
1435
|
+
el.style.fontSize = "12px";
|
|
1436
|
+
el.style.lineHeight = "1.5";
|
|
1437
|
+
el.style.borderRadius = "6px";
|
|
1438
|
+
el.style.overflow = "hidden";
|
|
1439
|
+
el.style.boxShadow = isDark ? "0 4px 12px rgba(0,0,0,0.4)" : "0 4px 12px rgba(0,0,0,0.12)";
|
|
1440
|
+
container.appendChild(el);
|
|
1441
|
+
return el;
|
|
1442
|
+
}
|
|
1443
|
+
function showBlipPopover(popover, blip, qColor, palette, isDark, event, solid) {
|
|
1444
|
+
const fillColor = shapeFill(palette, qColor, isDark, {
|
|
1445
|
+
...solid !== void 0 && { solid }
|
|
1446
|
+
});
|
|
1447
|
+
const hasDesc = blip.description.length > 0;
|
|
1448
|
+
const onFillText = contrastText(
|
|
1449
|
+
fillColor,
|
|
1450
|
+
palette.textOnFillLight,
|
|
1451
|
+
palette.textOnFillDark
|
|
1452
|
+
);
|
|
1453
|
+
let html = `<div style="background:${fillColor}; border: 1.5px solid ${qColor}; border-radius: 6px; overflow: hidden;">`;
|
|
1454
|
+
html += `<div style="padding: 8px 12px; font-weight: 600; color: ${onFillText};">${escapeHtml2(blip.name)}</div>`;
|
|
1455
|
+
if (hasDesc) {
|
|
1456
|
+
html += `<div style="border-top: 1px solid ${qColor}; opacity: 0.3;"></div>`;
|
|
1457
|
+
html += `<div style="padding: 6px 12px 8px; color: ${palette.textMuted}; font-size: 11px; line-height: 1.6;">`;
|
|
1458
|
+
const paragraphs = joinDescriptionParagraphs(blip.description);
|
|
1459
|
+
for (const para of paragraphs) {
|
|
1460
|
+
html += renderDescriptionLine(para, palette);
|
|
1461
|
+
}
|
|
1462
|
+
html += `</div>`;
|
|
1463
|
+
}
|
|
1464
|
+
html += `</div>`;
|
|
1465
|
+
popover.innerHTML = html;
|
|
1466
|
+
popover.style.display = "block";
|
|
1467
|
+
positionPopover(popover, event);
|
|
1468
|
+
}
|
|
1469
|
+
function positionPopover(popover, event) {
|
|
1470
|
+
const container = popover.parentElement;
|
|
1471
|
+
const rect = container.getBoundingClientRect();
|
|
1472
|
+
const tipW = popover.offsetWidth;
|
|
1473
|
+
const tipH = popover.offsetHeight;
|
|
1474
|
+
const cursorX = event.clientX - rect.left;
|
|
1475
|
+
const cursorY = event.clientY - rect.top;
|
|
1476
|
+
const centerX = rect.width / 2;
|
|
1477
|
+
const centerY = rect.height / 2;
|
|
1478
|
+
let left = cursorX < centerX ? cursorX + 16 : cursorX - tipW - 16;
|
|
1479
|
+
let top = cursorY < centerY ? cursorY + 16 : cursorY - tipH - 16;
|
|
1480
|
+
if (left + tipW > rect.width - 4) left = rect.width - tipW - 4;
|
|
1481
|
+
if (left < 4) left = 4;
|
|
1482
|
+
if (top + tipH > rect.height - 4) top = rect.height - tipH - 4;
|
|
1483
|
+
if (top < 4) top = 4;
|
|
1484
|
+
popover.style.left = `${left}px`;
|
|
1485
|
+
popover.style.top = `${top}px`;
|
|
1486
|
+
}
|
|
1487
|
+
function hideBlipPopover(popover) {
|
|
1488
|
+
popover.style.display = "none";
|
|
1489
|
+
popover.style.pointerEvents = "none";
|
|
1490
|
+
}
|
|
1491
|
+
function joinDescriptionParagraphs(lines) {
|
|
1492
|
+
const result = [];
|
|
1493
|
+
let currentPara = "";
|
|
1494
|
+
for (const line of lines) {
|
|
1495
|
+
const trimmed = line.trim();
|
|
1496
|
+
const isBullet = /^[-*•]\s+/.test(trimmed);
|
|
1497
|
+
if (isBullet) {
|
|
1498
|
+
if (currentPara) {
|
|
1499
|
+
result.push(currentPara);
|
|
1500
|
+
currentPara = "";
|
|
1501
|
+
}
|
|
1502
|
+
result.push(trimmed);
|
|
1503
|
+
} else if (!trimmed) {
|
|
1504
|
+
if (currentPara) {
|
|
1505
|
+
result.push(currentPara);
|
|
1506
|
+
currentPara = "";
|
|
1507
|
+
}
|
|
1508
|
+
} else {
|
|
1509
|
+
currentPara = currentPara ? `${currentPara} ${trimmed}` : trimmed;
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
if (currentPara) result.push(currentPara);
|
|
1513
|
+
return result;
|
|
1514
|
+
}
|
|
1515
|
+
function renderDescriptionLine(line, palette) {
|
|
1516
|
+
const trimmed = line.trim();
|
|
1517
|
+
const isBullet = /^[-*•]\s+/.test(trimmed);
|
|
1518
|
+
const content = isBullet ? trimmed.replace(/^[-*•]\s+/, "") : trimmed;
|
|
1519
|
+
const spans = parseInlineMarkdown(content);
|
|
1520
|
+
let spanHtml = "";
|
|
1521
|
+
for (const span of spans) {
|
|
1522
|
+
let text = escapeHtml2(span.text);
|
|
1523
|
+
if (span.bold) text = `<strong>${text}</strong>`;
|
|
1524
|
+
if (span.italic) text = `<em>${text}</em>`;
|
|
1525
|
+
if (span.code)
|
|
1526
|
+
text = `<code style="background:${palette.surface}; padding: 1px 4px; border-radius: 3px; font-size: 10px;">${text}</code>`;
|
|
1527
|
+
if (span.href) {
|
|
1528
|
+
const safe = safeHref(span.href);
|
|
1529
|
+
if (safe !== null) {
|
|
1530
|
+
text = `<a href="${escapeHtml2(safe)}" target="_blank" rel="noopener noreferrer" style="color: ${palette.primary ?? palette.text}; text-decoration: underline;">${text}</a>`;
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
spanHtml += text;
|
|
1534
|
+
}
|
|
1535
|
+
if (isBullet) {
|
|
1536
|
+
return `<div style="padding-left: 12px; text-indent: -10px; margin: 1px 0;">\u2022 ${spanHtml}</div>`;
|
|
1537
|
+
}
|
|
1538
|
+
return `<div style="margin: 2px 0;">${spanHtml}</div>`;
|
|
1539
|
+
}
|
|
1540
|
+
function escapeHtml2(text) {
|
|
1541
|
+
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1542
|
+
}
|
|
1543
|
+
function renderQuadrantLabel(g, name, x, y, anchor, color, maxWidth, baseFontSize = QUADRANT_LABEL_FONT_SIZE) {
|
|
1544
|
+
const lines = wrapTextToWidth(name, baseFontSize, maxWidth);
|
|
1545
|
+
const estimatedWidth = Math.max(
|
|
1546
|
+
...lines.map((l) => measureText(l, baseFontSize))
|
|
1547
|
+
);
|
|
1548
|
+
const fontSize = estimatedWidth > maxWidth ? Math.max(12, baseFontSize * (maxWidth / estimatedWidth)) : baseFontSize;
|
|
1549
|
+
const lineHeight = fontSize * 1.2;
|
|
1550
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1551
|
+
g.append("text").attr("x", x).attr("y", y + i * lineHeight).attr("text-anchor", anchor).attr("fill", color).attr("font-family", FONT_FAMILY).attr("font-size", fontSize).attr("font-weight", "bold").text(lines[i]);
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
function getQuadrantLabelPosition(position, cx, cy, maxRadius) {
|
|
1555
|
+
const margin = 8;
|
|
1556
|
+
switch (position) {
|
|
1557
|
+
case "top-left":
|
|
1558
|
+
return {
|
|
1559
|
+
x: cx - maxRadius + margin,
|
|
1560
|
+
y: cy - maxRadius + 16,
|
|
1561
|
+
anchor: "start"
|
|
1562
|
+
};
|
|
1563
|
+
case "top-right":
|
|
1564
|
+
return {
|
|
1565
|
+
x: cx + maxRadius - margin,
|
|
1566
|
+
y: cy - maxRadius + 16,
|
|
1567
|
+
anchor: "end"
|
|
1568
|
+
};
|
|
1569
|
+
case "bottom-left":
|
|
1570
|
+
return {
|
|
1571
|
+
x: cx - maxRadius + margin,
|
|
1572
|
+
y: cy + maxRadius - 8,
|
|
1573
|
+
anchor: "start"
|
|
1574
|
+
};
|
|
1575
|
+
case "bottom-right":
|
|
1576
|
+
return {
|
|
1577
|
+
x: cx + maxRadius - margin,
|
|
1578
|
+
y: cy + maxRadius - 8,
|
|
1579
|
+
anchor: "end"
|
|
1580
|
+
};
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
function renderTechRadarForExport(container, parsed, palette, isDark, exportDims, viewState, exportMode) {
|
|
1584
|
+
renderTechRadar(
|
|
1585
|
+
container,
|
|
1586
|
+
parsed,
|
|
1587
|
+
palette,
|
|
1588
|
+
isDark,
|
|
1589
|
+
void 0,
|
|
1590
|
+
exportDims,
|
|
1591
|
+
viewState,
|
|
1592
|
+
{ ...exportMode !== void 0 && { exportMode } }
|
|
1593
|
+
);
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
export {
|
|
1597
|
+
computeRadarLayout,
|
|
1598
|
+
getRadarGeometry,
|
|
1599
|
+
renderQuadrantFocus,
|
|
1600
|
+
renderQuadrantFocusForExport,
|
|
1601
|
+
renderTechRadar,
|
|
1602
|
+
renderTechRadarForExport
|
|
1603
|
+
};
|
|
1604
|
+
//# sourceMappingURL=chunk-4GRI7MEB.js.map
|