@diagrammo/dgmo 0.77.0 → 0.78.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/README.md +17 -13
- package/dist/advanced.d.ts +19 -12
- package/dist/advanced.js +124 -120
- package/dist/block.css +1 -1
- package/dist/block.d.ts +2 -2
- package/dist/block.js +45 -41
- package/dist/{chart-meta-Cf_jkApJ.d.ts → chart-meta-BKN2ORkc.d.ts} +2 -2
- package/dist/chart-meta.d.ts +3 -3
- package/dist/chart-meta.js +30 -29
- package/dist/charts-d3-KEQ7XVSM.js +31 -0
- package/dist/{chunk-7IATMZSA.js → chunk-26EVL454.js} +1 -25
- package/dist/{chunk-3H4PDNP4.js → chunk-2NLBIZEW.js} +2 -2
- package/dist/{chunk-BH3BQICT.js → chunk-32VR65TL.js} +63 -36
- package/dist/{chunk-N5NQIZ56.js → chunk-36UQ77JV.js} +24 -24
- package/dist/chunk-3DPOIW3W.js +10 -0
- package/dist/{chunk-3SP6G4LN.js → chunk-3GLTQZKE.js} +2 -2
- package/dist/{chunk-DY7KDZUF.js → chunk-3OWIYK52.js} +2 -2
- package/dist/{chunk-3E4YB6TY.js → chunk-3XFOE3DQ.js} +12 -7
- package/dist/{chunk-W7UBPARG.js → chunk-3ZLQM6XN.js} +2 -2
- package/dist/{chunk-5GM6BZO7.js → chunk-4AWLEWSD.js} +5 -2
- package/dist/{chunk-SWUQJ5VR.js → chunk-4IGUEGD6.js} +80 -61
- package/dist/{chunk-QOVM5VRC.js → chunk-57GSSHBR.js} +2 -2
- package/dist/{chunk-5VMUVJO4.js → chunk-5G55TS3H.js} +2 -2
- package/dist/{chunk-U4DS2ODO.js → chunk-67I3HFSF.js} +9 -9
- package/dist/{chunk-WQXD3IIN.js → chunk-6B3M6LW6.js} +10 -8
- package/dist/{chunk-TKIPK5P6.js → chunk-6PHOZBW5.js} +4 -6
- package/dist/{chunk-5PFNUDXR.js → chunk-6VTLVU7D.js} +2 -2
- package/dist/{chunk-M5JT2AU7.js → chunk-6Z2NUJSX.js} +2 -2
- package/dist/{chunk-BWJLLNUX.js → chunk-7BNRHSSF.js} +2 -2
- package/dist/{chunk-JLODGGN2.js → chunk-7NNJXYXU.js} +2 -2
- package/dist/{chunk-FTTB64OJ.js → chunk-7SMVTA7I.js} +26 -26
- package/dist/{chunk-Z7KVOVE4.js → chunk-7WTFX6OA.js} +6 -3
- package/dist/{chunk-ZM27UI5O.js → chunk-A7Y32YD6.js} +2 -2
- package/dist/{chunk-FPRMP6YA.js → chunk-AHN2CVCH.js} +10 -7
- package/dist/{chunk-N6MZSBOL.js → chunk-AN7T6VP7.js} +2 -2
- package/dist/{chunk-F4X5NVKY.js → chunk-B6PVPAS5.js} +2 -2
- package/dist/{chunk-RV5A3EGI.js → chunk-BB2ORSTF.js} +19 -18
- package/dist/{chunk-SI3PYDL4.js → chunk-BJB4YDJP.js} +21 -21
- package/dist/{chunk-FR5EVD2X.js → chunk-BPM52K3Z.js} +38 -31
- package/dist/{chunk-TI4YUUW6.js → chunk-BSREARWG.js} +29 -28
- package/dist/{chunk-F4V67JXG.js → chunk-CTERZC4K.js} +2 -2
- package/dist/{chunk-WHWUVDYK.js → chunk-CYLSQO4L.js} +6 -6
- package/dist/{chunk-J76YDS4V.js → chunk-DCPD5SHV.js} +3 -3
- package/dist/{chunk-H7BYMIVK.js → chunk-ENDB5YSV.js} +67 -27
- package/dist/{chunk-RTTZIX34.js → chunk-EOB7XVYR.js} +2 -2
- package/dist/chunk-EPDBWATV.js +38 -0
- package/dist/{chunk-TPN7RJOM.js → chunk-FJADQOFQ.js} +3 -3
- package/dist/{chunk-MG3DE3VO.js → chunk-FLMXJMMY.js} +3 -3
- package/dist/{chunk-WGC42WJU.js → chunk-FWNJDD4U.js} +6 -2
- package/dist/{chunk-S5P5Z5Y5.js → chunk-GINNZHVN.js} +2 -2
- package/dist/{chunk-LYJ53DBK.js → chunk-GJH7ZEPH.js} +41 -36
- package/dist/{chunk-2MTM4E6M.js → chunk-GQEXY7XL.js} +68 -65
- package/dist/{chunk-XFXJXLK7.js → chunk-HHHYVTVS.js} +16 -16
- package/dist/chunk-ICLB27PZ.js +11 -0
- package/dist/{chunk-QMFIZQTB.js → chunk-IDGQB6XD.js} +6 -4
- package/dist/{chunk-R3XI2VC7.js → chunk-IDJGV6VM.js} +2 -1
- package/dist/{chunk-HDLRRY3N.js → chunk-IE47TYZT.js} +177 -118
- package/dist/{chunk-FJ57274M.js → chunk-IIEI7VK5.js} +15 -1
- package/dist/{chunk-XPBJVSRY.js → chunk-IMO46ROR.js} +38 -32
- package/dist/{chunk-VRPV6QXR.js → chunk-IZTU6WVR.js} +2 -2
- package/dist/{chunk-CIWFL2LM.js → chunk-JOD2CK2M.js} +16 -14
- package/dist/{chunk-XCFIAGT7.js → chunk-JUNTVLOU.js} +16 -15
- package/dist/{chunk-RWFMOVHG.js → chunk-KAZQX2EY.js} +2 -2
- package/dist/{chunk-NHQ7HUAS.js → chunk-KGX5LIUG.js} +10 -8
- package/dist/{chunk-Q74GP3GK.js → chunk-KO6DGOOB.js} +3 -3
- package/dist/{chunk-5ZD4DDG7.js → chunk-L26M3X7K.js} +16 -13
- package/dist/{chunk-RU2HHHYA.js → chunk-LD2JSKU3.js} +12 -2
- package/dist/{chunk-OO2L2LWV.js → chunk-LEBPWFVF.js} +50 -46
- package/dist/{chunk-MU3CJPJF.js → chunk-LGI735AJ.js} +2 -2
- package/dist/{chunk-OWVDD5EC.js → chunk-LMWXBFLA.js} +2 -2
- package/dist/{chunk-6IN4F4RH.js → chunk-M3LZCDB6.js} +40 -42
- package/dist/{chunk-YT5ICQ4R.js → chunk-MFK7LF66.js} +2 -2
- package/dist/{chunk-UH5YTZN7.js → chunk-MJYFPFZT.js} +110 -20
- package/dist/{chunk-2QRIMMIH.js → chunk-N56W4R66.js} +2 -2
- package/dist/{chunk-LXXVHLTH.js → chunk-NN5IDH2I.js} +2 -2
- package/dist/{chunk-46KVXDUJ.js → chunk-NS3KIRSW.js} +2 -2
- package/dist/{chunk-LM3HY3VG.js → chunk-P2DM7Q5U.js} +2 -2
- package/dist/{chunk-DJL5PO27.js → chunk-P4SQV3XD.js} +2 -2
- package/dist/{chunk-B52RL5VV.js → chunk-P54AX5XN.js} +9 -9
- package/dist/{chunk-MZEGUDTA.js → chunk-P64NBPSK.js} +14 -14
- package/dist/{chunk-FF7LRT5L.js → chunk-PIWUZFG7.js} +33 -25
- package/dist/{chunk-SWEKCK34.js → chunk-QAPFXLAC.js} +2 -2
- package/dist/chunk-QFIXL3OK.js +68 -0
- package/dist/{chunk-KRTLS3G6.js → chunk-QVMV4KCA.js} +2 -2
- package/dist/{chunk-76LHNLGX.js → chunk-R4YGH7DJ.js} +5 -3
- package/dist/{chunk-OZOHREFQ.js → chunk-RC3FM3FE.js} +12 -13
- package/dist/{chunk-UJBP57UJ.js → chunk-RC6GGF6X.js} +2 -2
- package/dist/{chunk-S6OXNZBM.js → chunk-RHZZVIGA.js} +3 -3
- package/dist/{chunk-MS5574I7.js → chunk-RIXWLFB4.js} +2 -2
- package/dist/{chunk-D3B6YEZK.js → chunk-RUNI4OXP.js} +18 -14
- package/dist/{chunk-ICVIJLBA.js → chunk-SFSJ6XWV.js} +2 -2
- package/dist/{chunk-QBM5BURJ.js → chunk-SNBEAO4Q.js} +8 -8
- package/dist/{chunk-DSXWJAOA.js → chunk-SXD6VY7D.js} +16 -14
- package/dist/{chunk-V4NHFY22.js → chunk-TLM3I4XF.js} +16 -16
- package/dist/{chunk-3O7ZYVJV.js → chunk-TO6TWNMF.js} +19 -15
- package/dist/{chunk-CYMYZYLI.js → chunk-U2JIFCJN.js} +18 -18
- package/dist/{chunk-SSEAULA5.js → chunk-U4ND3J6C.js} +18 -14
- package/dist/{chunk-QXMHBIQG.js → chunk-UCF6TKWV.js} +51 -48
- package/dist/{chunk-RGW26UAR.js → chunk-UDYJVX6Y.js} +9 -9
- package/dist/{chunk-7CXW6EGX.js → chunk-UQY2VLUK.js} +25 -23
- package/dist/{chunk-EUVUOPRC.js → chunk-VAA7QSZ7.js} +53 -32
- package/dist/{chunk-43AJKH2U.js → chunk-VQGQF7O7.js} +12 -10
- package/dist/{chunk-DEW62ON3.js → chunk-VSPNH7LC.js} +2 -2
- package/dist/{chunk-4YER7UCV.js → chunk-VUJQ6RU6.js} +2 -2
- package/dist/{chunk-CHOK7NCJ.js → chunk-VZD3ZV4Y.js} +26 -22
- package/dist/{chunk-NCT22MOD.js → chunk-WMIKC5XO.js} +2 -2
- package/dist/{chunk-C2WH3BMS.js → chunk-X326N4GN.js} +10 -7
- package/dist/chunk-XBJJP2HN.js +37 -0
- package/dist/{chunk-7NSNE52V.js → chunk-XCR3PDFF.js} +2 -2
- package/dist/{chunk-UBDVAHGK.js → chunk-XDPJMLOH.js} +30 -27
- package/dist/{chunk-CF3I5SOG.js → chunk-YKDZ3ZRI.js} +27 -25
- package/dist/{chunk-GLREDNBA.js → chunk-YVLTNNME.js} +12 -2
- package/dist/{chunk-6ZZKEYBS.js → chunk-ZGOBAMQ2.js} +15 -13
- package/dist/{chunk-6BVAW7KI.js → chunk-ZMCFUGKO.js} +49 -42
- package/dist/clock.js +11 -5
- package/dist/completion-registry.js +2 -2
- package/dist/countdown.js +26 -20
- package/dist/{d3-BiaJtaSw.d.ts → d3-CQT5bwpb.d.ts} +1 -1
- package/dist/{dgmo-router-BwXHZ_P3.d.ts → dgmo-router-C9CsswPZ.d.ts} +1 -1
- package/dist/{dgmo-router-A3LIHT6H.js → dgmo-router-XZNCLYTV.js} +30 -29
- package/dist/{dimensions-OFF4GRFL.js → dimensions-SIZMZ4DC.js} +8 -8
- package/dist/{flowchart-renderer-BBJUPORB.js → flowchart-renderer-FDJ4QQXE.js} +15 -14
- package/dist/index.d.ts +7 -7
- package/dist/index.js +58 -43
- package/dist/{layout-Y2V3LYV7.js → layout-5DZ2LI2R.js} +2 -2
- package/dist/{layout-ZAGUFT2G.js → layout-6I6LSBUR.js} +6 -5
- package/dist/{layout-2OJ25STS.js → layout-C2SCZV5M.js} +6 -5
- package/dist/{layout-6SKHNQYO.js → layout-CHWKNE3O.js} +3 -3
- package/dist/{layout-EM4DLMAX.js → layout-K4KML2DL.js} +3 -3
- package/dist/{layout-KQUSB45X.js → layout-S53FSD6R.js} +7 -6
- package/dist/{layout-ROORJQ4X.js → layout-TCFXB5XH.js} +7 -6
- package/dist/{layout-5ILNODTP.js → layout-XK6ZD7BU.js} +6 -5
- package/dist/{layout-B5GQVXXY.js → layout-YVY72CIG.js} +7 -6
- package/dist/{layout-VUZ3MLOI.js → layout-YY6VH5XH.js} +6 -5
- package/dist/{layout-RV2T2YTT.js → layout-ZDN252GR.js} +4 -3
- package/dist/{layout-search-UOKEMER5.js → layout-search-TSV4FURP.js} +7 -6
- package/dist/{legend-constants-PLN2YHGM.js → legend-constants-SB4PLHV5.js} +3 -3
- package/dist/{palettes-54YSI3IX.js → palettes-YIPSRYXP.js} +5 -3
- package/dist/{parser-GCVSRQPY.js → parser-2BX2EJUB.js} +3 -3
- package/dist/{parser-WVE6SKB7.js → parser-3UNIPVNY.js} +3 -3
- package/dist/{parser-5XFGK5C5.js → parser-4IHIVDJD.js} +5 -5
- package/dist/{parser-ZT3PU2HT.js → parser-62VNEQRT.js} +3 -3
- package/dist/{parser-PR3OR3LO.js → parser-6JNJHQAG.js} +3 -3
- package/dist/{parser-ZXQZZK6W.js → parser-6ZFQLLVE.js} +3 -2
- package/dist/{parser-WMJEPZDC.js → parser-BOPXE6RP.js} +3 -3
- package/dist/{parser-WWRRG2DV.js → parser-DFBQ2RID.js} +3 -3
- package/dist/{parser-2GMHFSTS.js → parser-EPKXJ2RL.js} +3 -3
- package/dist/{parser-ML3LVNDV.js → parser-G7E2BURB.js} +3 -3
- package/dist/{parser-QOIZGW7I.js → parser-GFGU5ZLQ.js} +3 -3
- package/dist/{parser-L7T7FY3H.js → parser-GKZWI5SZ.js} +3 -3
- package/dist/{parser-QYAIFXLP.js → parser-HSPODF4H.js} +3 -3
- package/dist/{parser-EQ4I3TSH.js → parser-IK3FXZ7D.js} +3 -3
- package/dist/{parser-LV7PQBUG.js → parser-LJWPKRDM.js} +3 -3
- package/dist/{parser-RDBXEVI4.js → parser-OYWUBQV4.js} +3 -3
- package/dist/{parser-6FUESG4N.js → parser-PD4TP6NM.js} +3 -3
- package/dist/{parser-E3OHNNTH.js → parser-R2JHC7LQ.js} +3 -3
- package/dist/{parser-CJNP7RKR.js → parser-RMZ6YI7H.js} +3 -3
- package/dist/{parser-TA5TYZNL.js → parser-RUJNN5PK.js} +3 -3
- package/dist/{parser-UTR5WE4O.js → parser-YWE7GHW6.js} +3 -3
- package/dist/{parser-3AOMUX5D.js → parser-Z5UK6ADF.js} +3 -3
- package/dist/{parser-YWQCC33R.js → parser-ZO5YT5SV.js} +3 -3
- package/dist/renderer-5TPUPMZ7.js +26 -0
- package/dist/{renderer-2NYQDW37.js → renderer-AIVALEQR.js} +7 -7
- package/dist/renderer-AMELXBNW.js +23 -0
- package/dist/renderer-BF7FYXG3.js +25 -0
- package/dist/renderer-CRRW7LTW.js +17 -0
- package/dist/renderer-CXU2MGSC.js +27 -0
- package/dist/renderer-DI66RLAG.js +30 -0
- package/dist/renderer-E2JTYQY5.js +39 -0
- package/dist/{renderer-Y3Y7PEUS.js → renderer-FA4BTAOL.js} +7 -7
- package/dist/{renderer-G2DPKJAN.js → renderer-FFGFTIT4.js} +15 -14
- package/dist/renderer-IVAM7Z3Y.js +27 -0
- package/dist/renderer-J6HK2KOW.js +23 -0
- package/dist/renderer-J7J3OVLQ.js +39 -0
- package/dist/{renderer-GHBF5PRH.js → renderer-JC7MK7SD.js} +6 -5
- package/dist/{renderer-VF7X66SL.js → renderer-JHQC5RGJ.js} +14 -14
- package/dist/renderer-JRITSZY3.js +28 -0
- package/dist/{renderer-ANJUDBOS.js → renderer-KD5X4RIS.js} +14 -13
- package/dist/{renderer-CVWQD442.js → renderer-KWNNWCGD.js} +6 -5
- package/dist/{renderer-FTX67CYZ.js → renderer-LGMIAG6N.js} +7 -6
- package/dist/{renderer-EDVCGIQO.js → renderer-LQN3FXAP.js} +33 -32
- package/dist/renderer-LRL4SU43.js +29 -0
- package/dist/{renderer-R5HIRN2M.js → renderer-MBL64AJI.js} +6 -6
- package/dist/renderer-NA3DTAWF.js +39 -0
- package/dist/renderer-OR5QHR7X.js +31 -0
- package/dist/renderer-SBVWHQVW.js +30 -0
- package/dist/{renderer-DNFV2IQI.js → renderer-TLOSBJKW.js} +13 -13
- package/dist/{renderer-EFQSMHID.js → renderer-UDWJRRIC.js} +11 -11
- package/dist/renderer-VHK6UAW2.js +20 -0
- package/dist/{renderer-2ANDPQWC.js → renderer-W5UG2HWT.js} +5 -5
- package/dist/renderer-WOOKJOBQ.js +25 -0
- package/dist/renderer-WYNLGZRF.js +25 -0
- package/dist/{renderer-RNFECJ5D.js → renderer-Y74Y54C3.js} +8 -8
- package/dist/renderer-ZUAXGHFC.js +28 -0
- package/dist/renderer-radial-YVUDGR7C.js +21 -0
- package/dist/{state-parser-TPA67IXM.js → state-parser-CT5HQQ7E.js} +3 -3
- package/dist/state-renderer-7O3QGNJ5.js +41 -0
- package/dist/{tag-groups-BAtkq0b_.d.ts → tag-groups-BoJg3lFV.d.ts} +0 -16
- package/dist/{themes-DpsyRSO7.d.ts → themes-CXYnNA4e.d.ts} +2 -2
- package/docs/architecture-report.md +3 -3
- package/docs/language-reference.md +122 -30
- package/docs/migration-sequence-color-to-tags.md +16 -8
- package/package.json +4 -4
- package/dist/charts-d3-HMEMHSSW.js +0 -29
- package/dist/chunk-53SEVJQM.js +0 -9
- package/dist/chunk-LP7EC4MI.js +0 -16
- package/dist/chunk-YM5RMLFO.js +0 -40
- package/dist/renderer-2LDT4TUX.js +0 -25
- package/dist/renderer-2RIIIO34.js +0 -39
- package/dist/renderer-3HFU3DTO.js +0 -25
- package/dist/renderer-4BF6ILP6.js +0 -27
- package/dist/renderer-5E2AH5TO.js +0 -38
- package/dist/renderer-62SLWRYF.js +0 -27
- package/dist/renderer-D6GJ6EVK.js +0 -30
- package/dist/renderer-GZLRX764.js +0 -24
- package/dist/renderer-H2HYLFN3.js +0 -20
- package/dist/renderer-IR5655M7.js +0 -28
- package/dist/renderer-L237AOOZ.js +0 -16
- package/dist/renderer-LSJWYGOL.js +0 -39
- package/dist/renderer-LWXDMZOV.js +0 -28
- package/dist/renderer-MYSVPERC.js +0 -22
- package/dist/renderer-OL5QSZPC.js +0 -31
- package/dist/renderer-P26HH3NA.js +0 -30
- package/dist/renderer-RPZVNCTF.js +0 -26
- package/dist/renderer-SDNWZDUY.js +0 -23
- package/dist/renderer-UKHH4UWV.js +0 -25
- package/dist/renderer-radial-QNGCGKZP.js +0 -21
- package/dist/state-renderer-ELWDRXD6.js +0 -40
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
wrapDescriptionLines
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WMIKC5XO.js";
|
|
4
4
|
import {
|
|
5
5
|
renderInlineText,
|
|
6
6
|
stripInlineMarkdown
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FWNJDD4U.js";
|
|
8
8
|
import {
|
|
9
9
|
FONT_FAMILY
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ICLB27PZ.js";
|
|
11
11
|
import {
|
|
12
12
|
DAY_MS,
|
|
13
13
|
applyOrdinalTemplate,
|
|
@@ -22,41 +22,44 @@ import {
|
|
|
22
22
|
sameDay,
|
|
23
23
|
splitClockSeconds
|
|
24
24
|
} from "./chunk-WFA6IULY.js";
|
|
25
|
+
import {
|
|
26
|
+
now
|
|
27
|
+
} from "./chunk-3DPOIW3W.js";
|
|
25
28
|
import {
|
|
26
29
|
contrastText,
|
|
27
30
|
getSeriesColors,
|
|
28
31
|
mix,
|
|
29
32
|
themeBaseBg
|
|
30
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-YVLTNNME.js";
|
|
31
34
|
import {
|
|
32
35
|
resolveColor
|
|
33
36
|
} from "./chunk-XOGQY4EC.js";
|
|
34
37
|
|
|
35
38
|
// src/countdown/renderer.ts
|
|
36
39
|
import * as d3Selection from "d3-selection";
|
|
37
|
-
function bakedHero(parsed,
|
|
40
|
+
function bakedHero(parsed, now2) {
|
|
38
41
|
const resolved = parsed.resolvedMs;
|
|
39
42
|
if (resolved === null) return "\u2014";
|
|
40
43
|
const tz = parsed.tz;
|
|
41
|
-
const remaining = resolved -
|
|
44
|
+
const remaining = resolved - now2;
|
|
42
45
|
if (!parsed.rule && remaining <= 0) {
|
|
43
46
|
if (parsed.expired !== null) return parsed.expired;
|
|
44
47
|
const elapsed = -remaining;
|
|
45
48
|
if (elapsed <= 0) return "Now!";
|
|
46
49
|
if (parsed.units === "compound" || parsed.units === "human") {
|
|
47
|
-
const [a, b] = parsed.hasTime ? [resolved,
|
|
50
|
+
const [a, b] = parsed.hasTime ? [resolved, now2] : [dayStart(resolved, tz), dayStart(now2, tz)];
|
|
48
51
|
return `${formatCompound(a, b, 2, tz)} ago`;
|
|
49
52
|
}
|
|
50
53
|
const bu = parsed.units === "full" || parsed.units === "clock" ? "days" : parsed.units;
|
|
51
54
|
return `${formatCount(elapsed, { units: bu, round: parsed.round, fields: parsed.fields })} ago`;
|
|
52
55
|
}
|
|
53
|
-
if (parsed.rule && sameDay(resolved,
|
|
56
|
+
if (parsed.rule && sameDay(resolved, now2, tz))
|
|
54
57
|
return parsed.onDay ?? "Today!";
|
|
55
58
|
if (parsed.units === "human") {
|
|
56
|
-
const [hn, ht] = parsed.hasTime ? [
|
|
59
|
+
const [hn, ht] = parsed.hasTime ? [now2, resolved] : [dayStart(now2, tz), dayStart(resolved, tz)];
|
|
57
60
|
return formatHuman(hn, ht, tz).big;
|
|
58
61
|
}
|
|
59
|
-
if (parsed.units === "compound") return formatCompound(
|
|
62
|
+
if (parsed.units === "compound") return formatCompound(now2, resolved, 2, tz);
|
|
60
63
|
const bakeUnits = parsed.units === "full" || parsed.units === "clock" ? "days" : parsed.units;
|
|
61
64
|
return formatCount(Math.max(0, remaining), {
|
|
62
65
|
units: bakeUnits,
|
|
@@ -109,15 +112,15 @@ var keyOf = (ms) => {
|
|
|
109
112
|
function bandColors(palette, accent, muted, faint, isDark, fillMode) {
|
|
110
113
|
const blue = resolveColor("blue", palette) ?? mix(palette.text, palette.bg, 45);
|
|
111
114
|
const collides = accent.toLowerCase() === blue.toLowerCase();
|
|
112
|
-
const
|
|
113
|
-
const mid = mix(accent,
|
|
115
|
+
const now2 = collides ? resolveColor("teal", palette) ?? resolveColor("cyan", palette) ?? mix(palette.text, palette.bg, 55) : blue;
|
|
116
|
+
const mid = mix(accent, now2, 50);
|
|
114
117
|
return {
|
|
115
118
|
bg: palette.bg,
|
|
116
119
|
text: palette.text,
|
|
117
120
|
muted,
|
|
118
121
|
faint,
|
|
119
122
|
rule: mix(palette.text, palette.bg, 14),
|
|
120
|
-
now,
|
|
123
|
+
now: now2,
|
|
121
124
|
event: accent,
|
|
122
125
|
midSoft: mix(mid, palette.bg, 24),
|
|
123
126
|
inert: mix(palette.text, palette.bg, 7),
|
|
@@ -202,12 +205,12 @@ function monthSpan(nowMs, resolvedMs) {
|
|
|
202
205
|
}
|
|
203
206
|
var MONTH_TARGET_PX = 200;
|
|
204
207
|
function monthGridLayout(nowMs, resolvedMs, contentW) {
|
|
205
|
-
const
|
|
208
|
+
const now2 = new Date(nowMs);
|
|
206
209
|
const ev = new Date(resolvedMs);
|
|
207
210
|
const realSpan = monthSpan(nowMs, resolvedMs);
|
|
208
211
|
const shown = Math.max(realSpan, Math.round(contentW / MONTH_TARGET_PX));
|
|
209
212
|
const padBefore = Math.floor((shown - realSpan) / 2);
|
|
210
|
-
const nowMk =
|
|
213
|
+
const nowMk = now2.getFullYear() * 12 + now2.getMonth();
|
|
211
214
|
const evMk = ev.getFullYear() * 12 + ev.getMonth();
|
|
212
215
|
const loMk = Math.min(nowMk, evMk);
|
|
213
216
|
const hiMk = Math.max(nowMk, evMk);
|
|
@@ -287,9 +290,9 @@ function bandHeightFor(kind, nowMs, resolvedMs, contentW) {
|
|
|
287
290
|
}
|
|
288
291
|
}
|
|
289
292
|
function vizYears(svg, g, nowMs, resolvedMs, C) {
|
|
290
|
-
const
|
|
293
|
+
const now2 = new Date(nowMs);
|
|
291
294
|
const ev = new Date(resolvedMs);
|
|
292
|
-
const nowY =
|
|
295
|
+
const nowY = now2.getFullYear();
|
|
293
296
|
const evY = ev.getFullYear();
|
|
294
297
|
const { d0, rows } = yearsLayout(nowMs, resolvedMs);
|
|
295
298
|
const labW = 54;
|
|
@@ -310,7 +313,7 @@ function vizYears(svg, g, nowMs, resolvedMs, C) {
|
|
|
310
313
|
ry + rowH / 2,
|
|
311
314
|
Math.min(14, rowH * 0.5),
|
|
312
315
|
C.muted,
|
|
313
|
-
|
|
316
|
+
"bold",
|
|
314
317
|
"end",
|
|
315
318
|
`${dec}s`,
|
|
316
319
|
{ "dominant-baseline": "central" }
|
|
@@ -332,7 +335,7 @@ function vizYears(svg, g, nowMs, resolvedMs, C) {
|
|
|
332
335
|
ry + cellH / 2,
|
|
333
336
|
yrFont,
|
|
334
337
|
st.text,
|
|
335
|
-
|
|
338
|
+
"bold",
|
|
336
339
|
"middle",
|
|
337
340
|
String(yr),
|
|
338
341
|
{ "dominant-baseline": "central" }
|
|
@@ -342,10 +345,10 @@ function vizYears(svg, g, nowMs, resolvedMs, C) {
|
|
|
342
345
|
}
|
|
343
346
|
}
|
|
344
347
|
function vizYear(svg, g, nowMs, resolvedMs, C) {
|
|
345
|
-
const
|
|
348
|
+
const now2 = new Date(nowMs);
|
|
346
349
|
const ev = new Date(resolvedMs);
|
|
347
|
-
const y0 = Math.min(
|
|
348
|
-
const y1 = Math.max(
|
|
350
|
+
const y0 = Math.min(now2.getFullYear(), ev.getFullYear());
|
|
351
|
+
const y1 = Math.max(now2.getFullYear(), ev.getFullYear());
|
|
349
352
|
const years = [];
|
|
350
353
|
for (let y = y0; y <= y1; y++) years.push(y);
|
|
351
354
|
const R = years.length;
|
|
@@ -355,8 +358,8 @@ function vizYear(svg, g, nowMs, resolvedMs, C) {
|
|
|
355
358
|
const rowH = (g.height - rowGap * (R - 1)) / R;
|
|
356
359
|
const cellH = rowH;
|
|
357
360
|
const cellW = (g.contentW - yearW - 11 * gap) / 12;
|
|
358
|
-
const nowY =
|
|
359
|
-
const nowM =
|
|
361
|
+
const nowY = now2.getFullYear();
|
|
362
|
+
const nowM = now2.getMonth();
|
|
360
363
|
const evY = ev.getFullYear();
|
|
361
364
|
const evM = ev.getMonth();
|
|
362
365
|
const nowOrd = nowY * 12 + nowM;
|
|
@@ -369,7 +372,7 @@ function vizYear(svg, g, nowMs, resolvedMs, C) {
|
|
|
369
372
|
ry + rowH / 2,
|
|
370
373
|
Math.min(22, rowH * 0.6),
|
|
371
374
|
C.muted,
|
|
372
|
-
|
|
375
|
+
"bold",
|
|
373
376
|
"end",
|
|
374
377
|
String(yr),
|
|
375
378
|
{ "dominant-baseline": "central" }
|
|
@@ -395,19 +398,19 @@ function vizYear(svg, g, nowMs, resolvedMs, C) {
|
|
|
395
398
|
ry + cellH * 0.36,
|
|
396
399
|
mFont,
|
|
397
400
|
st.text,
|
|
398
|
-
|
|
401
|
+
"bold",
|
|
399
402
|
"middle",
|
|
400
403
|
MON_ABBR[m],
|
|
401
404
|
{ "dominant-baseline": "central" }
|
|
402
405
|
);
|
|
403
|
-
const dnum = isEv ? ev.getDate() :
|
|
406
|
+
const dnum = isEv ? ev.getDate() : now2.getDate();
|
|
404
407
|
aText(
|
|
405
408
|
svg,
|
|
406
409
|
cx,
|
|
407
410
|
ry + cellH * 0.72,
|
|
408
411
|
Math.min(14, cellW * 0.42),
|
|
409
412
|
st.text,
|
|
410
|
-
|
|
413
|
+
"bold",
|
|
411
414
|
"middle",
|
|
412
415
|
String(dnum),
|
|
413
416
|
{ "dominant-baseline": "central" }
|
|
@@ -419,7 +422,7 @@ function vizYear(svg, g, nowMs, resolvedMs, C) {
|
|
|
419
422
|
ry + cellH / 2,
|
|
420
423
|
mFont,
|
|
421
424
|
st.text,
|
|
422
|
-
|
|
425
|
+
"bold",
|
|
423
426
|
"middle",
|
|
424
427
|
MON_ABBR[m],
|
|
425
428
|
{ "dominant-baseline": "central" }
|
|
@@ -429,7 +432,7 @@ function vizYear(svg, g, nowMs, resolvedMs, C) {
|
|
|
429
432
|
});
|
|
430
433
|
}
|
|
431
434
|
function vizMonths(svg, g, nowMs, resolvedMs, C) {
|
|
432
|
-
const
|
|
435
|
+
const now2 = new Date(nowMs);
|
|
433
436
|
const ev = new Date(resolvedMs);
|
|
434
437
|
const realSpan = monthSpan(nowMs, resolvedMs);
|
|
435
438
|
const perRow = 6;
|
|
@@ -441,7 +444,7 @@ function vizMonths(svg, g, nowMs, resolvedMs, C) {
|
|
|
441
444
|
const labelH = 27;
|
|
442
445
|
const cellW = (g.contentW - gap * (perRow - 1)) / perRow;
|
|
443
446
|
const cellH = (g.height - rowGap * (rows - 1)) / rows;
|
|
444
|
-
const nowMk =
|
|
447
|
+
const nowMk = now2.getFullYear() * 12 + now2.getMonth();
|
|
445
448
|
const evMk = ev.getFullYear() * 12 + ev.getMonth();
|
|
446
449
|
const loMk = Math.min(nowMk, evMk);
|
|
447
450
|
const hiMk = Math.max(nowMk, evMk);
|
|
@@ -468,7 +471,7 @@ function vizMonths(svg, g, nowMs, resolvedMs, C) {
|
|
|
468
471
|
y + 19,
|
|
469
472
|
16,
|
|
470
473
|
st.text,
|
|
471
|
-
|
|
474
|
+
"bold",
|
|
472
475
|
"middle",
|
|
473
476
|
MON_ABBR[d.getMonth()]
|
|
474
477
|
);
|
|
@@ -483,7 +486,7 @@ function vizMonths(svg, g, nowMs, resolvedMs, C) {
|
|
|
483
486
|
anchor ? 0.5 : 0.3
|
|
484
487
|
);
|
|
485
488
|
if (anchor) {
|
|
486
|
-
const dnum = isEv ? ev.getDate() :
|
|
489
|
+
const dnum = isEv ? ev.getDate() : now2.getDate();
|
|
487
490
|
const dFont = Math.min(cellH - labelH - 6, cellW * 0.42, 44);
|
|
488
491
|
aText(
|
|
489
492
|
mt,
|
|
@@ -491,7 +494,7 @@ function vizMonths(svg, g, nowMs, resolvedMs, C) {
|
|
|
491
494
|
y + labelH + (cellH - labelH) / 2 + 1,
|
|
492
495
|
dFont,
|
|
493
496
|
st.text,
|
|
494
|
-
|
|
497
|
+
"bold",
|
|
495
498
|
"middle",
|
|
496
499
|
String(dnum),
|
|
497
500
|
{ "dominant-baseline": "central" }
|
|
@@ -541,7 +544,7 @@ function vizMonthGrid(svg, g, nowMs, resolvedMs, C) {
|
|
|
541
544
|
top + 16,
|
|
542
545
|
14,
|
|
543
546
|
C.text,
|
|
544
|
-
|
|
547
|
+
"bold",
|
|
545
548
|
"middle",
|
|
546
549
|
`${MON_ABBR[m.getMonth()]} ${m.getFullYear()}`
|
|
547
550
|
);
|
|
@@ -573,7 +576,7 @@ function vizMonthGrid(svg, g, nowMs, resolvedMs, C) {
|
|
|
573
576
|
cy + cellH / 2,
|
|
574
577
|
Math.min(16, cellH * 0.62),
|
|
575
578
|
st.text,
|
|
576
|
-
|
|
579
|
+
"bold",
|
|
577
580
|
"middle",
|
|
578
581
|
String(day),
|
|
579
582
|
{ "dominant-baseline": "central" }
|
|
@@ -633,7 +636,7 @@ function vizWeekStrip(svg, g, nowMs, resolvedMs, C) {
|
|
|
633
636
|
cellTop + 18,
|
|
634
637
|
Math.min(12, cw * 0.3),
|
|
635
638
|
st.text,
|
|
636
|
-
|
|
639
|
+
"bold",
|
|
637
640
|
"middle",
|
|
638
641
|
WD_ABBR[dt.getDay()],
|
|
639
642
|
{ "letter-spacing": "0.04em" }
|
|
@@ -655,7 +658,7 @@ function vizWeekStrip(svg, g, nowMs, resolvedMs, C) {
|
|
|
655
658
|
cellTop + (showWd ? ch * 0.6 : ch * 0.54),
|
|
656
659
|
Math.min(44, cw * 0.62),
|
|
657
660
|
st.text,
|
|
658
|
-
|
|
661
|
+
"bold",
|
|
659
662
|
"middle",
|
|
660
663
|
String(dt.getDate())
|
|
661
664
|
);
|
|
@@ -666,7 +669,7 @@ function vizWeekStrip(svg, g, nowMs, resolvedMs, C) {
|
|
|
666
669
|
cellTop + ch - 13,
|
|
667
670
|
10,
|
|
668
671
|
st.text,
|
|
669
|
-
|
|
672
|
+
"bold",
|
|
670
673
|
"middle",
|
|
671
674
|
"TODAY",
|
|
672
675
|
{ "letter-spacing": "0.04em" }
|
|
@@ -696,7 +699,7 @@ function vizToday(svg, g, resolvedMs, C) {
|
|
|
696
699
|
cy - h * 0.14,
|
|
697
700
|
14,
|
|
698
701
|
st.text,
|
|
699
|
-
|
|
702
|
+
"bold",
|
|
700
703
|
"middle",
|
|
701
704
|
MON_ABBR[ev.getMonth()].toUpperCase(),
|
|
702
705
|
{ "letter-spacing": "0.08em" }
|
|
@@ -707,7 +710,7 @@ function vizToday(svg, g, resolvedMs, C) {
|
|
|
707
710
|
cy + h * 0.22,
|
|
708
711
|
Math.min(48, h * 0.4),
|
|
709
712
|
st.text,
|
|
710
|
-
|
|
713
|
+
"bold",
|
|
711
714
|
"middle",
|
|
712
715
|
String(ev.getDate())
|
|
713
716
|
);
|
|
@@ -717,7 +720,7 @@ function vizToday(svg, g, resolvedMs, C) {
|
|
|
717
720
|
cy + h / 2 + 26,
|
|
718
721
|
13,
|
|
719
722
|
C.event,
|
|
720
|
-
|
|
723
|
+
"bold",
|
|
721
724
|
"middle",
|
|
722
725
|
"THE DAY IS HERE",
|
|
723
726
|
{ "letter-spacing": "0.12em" }
|
|
@@ -758,14 +761,14 @@ function vizClock(svg, g, nowMs, targetMs, C) {
|
|
|
758
761
|
cy + R * 0.22,
|
|
759
762
|
R * 0.62,
|
|
760
763
|
C.text,
|
|
761
|
-
|
|
764
|
+
"bold",
|
|
762
765
|
"middle",
|
|
763
766
|
pad2(gg.val),
|
|
764
767
|
{
|
|
765
768
|
"data-dgmo-gauge-val": gg.key
|
|
766
769
|
}
|
|
767
770
|
);
|
|
768
|
-
aText(svg, cx, cy + R + 22, 12, C.muted,
|
|
771
|
+
aText(svg, cx, cy + R + 22, 12, C.muted, "bold", "middle", gg.label, {
|
|
769
772
|
"letter-spacing": "0.1em"
|
|
770
773
|
});
|
|
771
774
|
});
|
|
@@ -776,7 +779,7 @@ function vizClock(svg, g, nowMs, targetMs, C) {
|
|
|
776
779
|
cy - R - 14,
|
|
777
780
|
13,
|
|
778
781
|
ahead ? C.event : C.muted,
|
|
779
|
-
|
|
782
|
+
"bold",
|
|
780
783
|
"middle",
|
|
781
784
|
ahead ? "TO GO" : "AGO",
|
|
782
785
|
{
|
|
@@ -793,7 +796,7 @@ function paintClock(sel, str, secSize, secFill) {
|
|
|
793
796
|
sel.attr("font-variant-numeric", "tabular-nums").attr("data-dgmo-cd-clock", "").attr("data-dgmo-cd-sec-size", secSize).attr("data-dgmo-cd-sec-fill", secFill).text(null);
|
|
794
797
|
sel.append("tspan").attr("data-cd-lead", "").text(lead);
|
|
795
798
|
if (sec !== null)
|
|
796
|
-
sel.append("tspan").attr("data-cd-sec", "").attr("font-size", secSize).attr("fill", secFill).attr("font-weight",
|
|
799
|
+
sel.append("tspan").attr("data-cd-sec", "").attr("font-size", secSize).attr("fill", secFill).attr("font-weight", "bold").text(sec);
|
|
797
800
|
}
|
|
798
801
|
function drawBand(svg, kind, g, nowMs, resolvedMs, C) {
|
|
799
802
|
switch (kind) {
|
|
@@ -818,20 +821,20 @@ function renderCountdown(container, parsed, palette, isDark, exportDims) {
|
|
|
818
821
|
const width = exportDims?.width ?? container.clientWidth;
|
|
819
822
|
const height = exportDims?.height ?? container.clientHeight;
|
|
820
823
|
if (width <= 0 || height <= 0) return;
|
|
821
|
-
const
|
|
824
|
+
const now2 = now();
|
|
822
825
|
const resolved = parsed.resolvedMs;
|
|
823
826
|
const label = parsed.sinceLabel ?? parsed.title ?? "";
|
|
824
827
|
const ordinal = parsed.sinceLabel !== null && parsed.rule !== null && resolved !== null ? ordinalFor(resolved, parsed.rule) : null;
|
|
825
|
-
const expiredFrozen = !parsed.rule && parsed.expired !== null && resolved !== null && resolved -
|
|
826
|
-
const bandKind = resolved === null || parsed.noVisual || expiredFrozen ? null : pickBand(
|
|
827
|
-
let hero = bakedHero(parsed,
|
|
828
|
+
const expiredFrozen = !parsed.rule && parsed.expired !== null && resolved !== null && resolved - now2 <= 0;
|
|
829
|
+
const bandKind = resolved === null || parsed.noVisual || expiredFrozen ? null : pickBand(now2, resolved, parsed.hasTime);
|
|
830
|
+
let hero = bakedHero(parsed, now2);
|
|
828
831
|
if (bandKind === "clock" && resolved !== null) {
|
|
829
|
-
const clock = formatCount(Math.abs(resolved -
|
|
832
|
+
const clock = formatCount(Math.abs(resolved - now2), {
|
|
830
833
|
units: "clock",
|
|
831
834
|
round: parsed.round,
|
|
832
835
|
fields: parsed.fields
|
|
833
836
|
});
|
|
834
|
-
hero = resolved -
|
|
837
|
+
hero = resolved - now2 < 0 ? `${clock} ago` : clock;
|
|
835
838
|
}
|
|
836
839
|
const seriesAccent = getSeriesColors(palette)[0];
|
|
837
840
|
const defaultAccent = resolveColor("red", palette) ?? seriesAccent;
|
|
@@ -864,7 +867,7 @@ function renderCountdown(container, parsed, palette, isDark, exportDims) {
|
|
|
864
867
|
const padY = Math.max(26, Math.round(width * 0.03));
|
|
865
868
|
const contentW = width - 2 * padX;
|
|
866
869
|
const leftX = padX;
|
|
867
|
-
const remainingNow = resolved === null ? 0 : Math.max(0, resolved -
|
|
870
|
+
const remainingNow = resolved === null ? 0 : Math.max(0, resolved - now2);
|
|
868
871
|
const dayCount = Math.ceil(remainingNow / DAY_MS);
|
|
869
872
|
const heroSizeStr = parsed.units === "full" ? `${dayCount > 0 ? `${dayCount}d ` : ""}00:00:00` : parsed.units === "clock" ? formatCount(remainingNow, {
|
|
870
873
|
units: "clock",
|
|
@@ -901,7 +904,7 @@ function renderCountdown(container, parsed, palette, isDark, exportDims) {
|
|
|
901
904
|
const drawText = (text, yTop, fs, fill, weight) => svg.append("text").attr("x", leftX).attr("y", yTop + fs).attr("text-anchor", "start").attr("dominant-baseline", "alphabetic").attr("fill", fill).attr("font-family", FONT_FAMILY).attr("font-size", fs).attr("font-weight", weight).text(text);
|
|
902
905
|
if (parsed.title) {
|
|
903
906
|
titleLines.forEach((tl, i) => {
|
|
904
|
-
const t = drawText(tl, y, titleFont, palette.text,
|
|
907
|
+
const t = drawText(tl, y, titleFont, palette.text, "bold");
|
|
905
908
|
if (i === 0) t.attr("data-line-number", parsed.titleLineNumber);
|
|
906
909
|
y += i < titleLines.length - 1 ? Math.round(titleFont * 1.12) : titleFont;
|
|
907
910
|
});
|
|
@@ -912,7 +915,7 @@ function renderCountdown(container, parsed, palette, isDark, exportDims) {
|
|
|
912
915
|
y += Math.round(titleFont * 0.5);
|
|
913
916
|
}
|
|
914
917
|
if (eyebrowText) {
|
|
915
|
-
drawText(eyebrowText, y, eyebrowFont, banked,
|
|
918
|
+
drawText(eyebrowText, y, eyebrowFont, banked, "bold").attr(
|
|
916
919
|
"data-dgmo-countdown-eyebrow",
|
|
917
920
|
""
|
|
918
921
|
);
|
|
@@ -922,7 +925,7 @@ function renderCountdown(container, parsed, palette, isDark, exportDims) {
|
|
|
922
925
|
const fx = parsed.rule ? leftX + 22 : leftX;
|
|
923
926
|
if (parsed.rule)
|
|
924
927
|
recurGlyph(svg, leftX + 8, y + footerFont * 0.52, 6.5, muted);
|
|
925
|
-
svg.append("text").attr("x", fx).attr("y", y + footerFont).attr("text-anchor", "start").attr("dominant-baseline", "alphabetic").attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", footerFont).attr("font-weight",
|
|
928
|
+
svg.append("text").attr("x", fx).attr("y", y + footerFont).attr("text-anchor", "start").attr("dominant-baseline", "alphabetic").attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", footerFont).attr("font-weight", "normal").attr("data-dgmo-countdown-footer", "").text(footerText);
|
|
926
929
|
y += footerFont + 8;
|
|
927
930
|
}
|
|
928
931
|
if (noteLines.length) {
|
|
@@ -932,7 +935,7 @@ function renderCountdown(container, parsed, palette, isDark, exportDims) {
|
|
|
932
935
|
if (nl.kind === "bullet-first") {
|
|
933
936
|
svg.append("text").attr("x", leftX).attr("y", y + noteFont).attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", noteFont).text("\u2022");
|
|
934
937
|
}
|
|
935
|
-
const t = svg.append("text").attr("x", bx).attr("y", y + noteFont).attr("fill", palette.text).attr("font-family", FONT_FAMILY).attr("font-size", noteFont).attr("font-weight",
|
|
938
|
+
const t = svg.append("text").attr("x", bx).attr("y", y + noteFont).attr("fill", palette.text).attr("font-family", FONT_FAMILY).attr("font-size", noteFont).attr("font-weight", "normal");
|
|
936
939
|
renderInlineText(
|
|
937
940
|
t,
|
|
938
941
|
nl.text,
|
|
@@ -943,20 +946,20 @@ function renderCountdown(container, parsed, palette, isDark, exportDims) {
|
|
|
943
946
|
}
|
|
944
947
|
y += 2;
|
|
945
948
|
}
|
|
946
|
-
drawText(`as of ${formatDateShort(
|
|
949
|
+
drawText(`as of ${formatDateShort(now2)}`, y, asofFont, faint, "normal").attr(
|
|
947
950
|
"data-dgmo-countdown-asof",
|
|
948
951
|
""
|
|
949
952
|
);
|
|
950
953
|
y += asofFont;
|
|
951
954
|
const leftBottom = y;
|
|
952
955
|
const detailFont = 18;
|
|
953
|
-
const remainingSub = resolved !== null ? resolved -
|
|
956
|
+
const remainingSub = resolved !== null ? resolved - now2 : 0;
|
|
954
957
|
const subText = resolved === null || remainingSub <= 0 ? null : parsed.units === "words" ? formatWordsDetail(remainingSub) : parsed.units === "human" && bandKind !== "clock" ? parsed.hasTime ? formatCount(remainingSub, {
|
|
955
958
|
units: "clock",
|
|
956
959
|
round: parsed.round,
|
|
957
960
|
fields: parsed.fields
|
|
958
961
|
}) : formatHuman(
|
|
959
|
-
dayStart(
|
|
962
|
+
dayStart(now2, parsed.tz),
|
|
960
963
|
dayStart(resolved, parsed.tz),
|
|
961
964
|
parsed.tz
|
|
962
965
|
).sub || null : null;
|
|
@@ -967,7 +970,7 @@ function renderCountdown(container, parsed, palette, isDark, exportDims) {
|
|
|
967
970
|
const hasBand = bandKind !== null;
|
|
968
971
|
const topSection = contentBottom;
|
|
969
972
|
const bandTop = topSection + 26;
|
|
970
|
-
const BAND_H = hasBand && resolved !== null ? Math.round(bandHeightFor(bandKind,
|
|
973
|
+
const BAND_H = hasBand && resolved !== null ? Math.round(bandHeightFor(bandKind, now2, resolved, width - 2 * padX)) : 0;
|
|
971
974
|
const bannerH = hasBand ? bandTop + BAND_H + padY : Math.max(
|
|
972
975
|
contentBottom + padY,
|
|
973
976
|
heroFont * 1.25 + 2 * padY,
|
|
@@ -988,12 +991,12 @@ function renderCountdown(container, parsed, palette, isDark, exportDims) {
|
|
|
988
991
|
svg,
|
|
989
992
|
bandKind,
|
|
990
993
|
{ left: leftX, top: bandTop, contentW: width - 2 * padX, height: BAND_H },
|
|
991
|
-
|
|
994
|
+
now2,
|
|
992
995
|
resolved,
|
|
993
996
|
bandC
|
|
994
997
|
);
|
|
995
998
|
}
|
|
996
|
-
const value = svg.append("text").attr("class", "countdown-value").attr("x", stacked ? leftX : width - padX).attr("y", heroBaseline).attr("text-anchor", stacked ? "start" : "end").attr("dominant-baseline", "alphabetic").attr("fill", accent).attr("font-family", FONT_FAMILY).attr("font-size", heroFont).attr("font-weight",
|
|
999
|
+
const value = svg.append("text").attr("class", "countdown-value").attr("x", stacked ? leftX : width - padX).attr("y", heroBaseline).attr("text-anchor", stacked ? "start" : "end").attr("dominant-baseline", "alphabetic").attr("fill", accent).attr("font-family", FONT_FAMILY).attr("font-size", heroFont).attr("font-weight", "bold").attr("data-dgmo-countdown-units", parsed.units).attr("data-dgmo-countdown-round", parsed.round).attr("data-dgmo-countdown-fields", parsed.fields.join(",")).attr("data-dgmo-countdown-expired", parsed.expired).attr("aria-label", `${parsed.title ?? "Countdown"}: ${hero}`);
|
|
997
1000
|
paintClock(value, hero, Math.round(heroFont * 0.55), bandC.now);
|
|
998
1001
|
if (parsed.rule && resolved !== null) {
|
|
999
1002
|
value.attr("data-dgmo-countdown", new Date(resolved).toISOString());
|
|
@@ -1009,7 +1012,7 @@ function renderCountdown(container, parsed, palette, isDark, exportDims) {
|
|
|
1009
1012
|
}
|
|
1010
1013
|
stampRecur(value, parsed);
|
|
1011
1014
|
if (subText) {
|
|
1012
|
-
const detailSel = svg.append("text").attr("x", stacked ? leftX : width - padX).attr("y", heroBaseline + heroFont * 0.28 + detailFont).attr("text-anchor", stacked ? "start" : "end").attr("dominant-baseline", "alphabetic").attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", detailFont).attr("font-weight",
|
|
1015
|
+
const detailSel = svg.append("text").attr("x", stacked ? leftX : width - padX).attr("y", heroBaseline + heroFont * 0.28 + detailFont).attr("text-anchor", stacked ? "start" : "end").attr("dominant-baseline", "alphabetic").attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", detailFont).attr("font-weight", "normal").attr("data-dgmo-countdown-detail", "");
|
|
1013
1016
|
paintClock(
|
|
1014
1017
|
detailSel,
|
|
1015
1018
|
subText,
|
|
@@ -1026,4 +1029,4 @@ export {
|
|
|
1026
1029
|
renderCountdown,
|
|
1027
1030
|
renderCountdownForExport
|
|
1028
1031
|
};
|
|
1029
|
-
//# sourceMappingURL=chunk-
|
|
1032
|
+
//# sourceMappingURL=chunk-GQEXY7XL.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
NODE_STROKE_WIDTH
|
|
3
|
-
} from "./chunk-FJ57274M.js";
|
|
4
1
|
import {
|
|
5
2
|
ScaleContext
|
|
6
3
|
} from "./chunk-24YPR5EH.js";
|
|
4
|
+
import {
|
|
5
|
+
NODE_STROKE_WIDTH
|
|
6
|
+
} from "./chunk-IIEI7VK5.js";
|
|
7
7
|
import {
|
|
8
8
|
TITLE_FONT_SIZE,
|
|
9
9
|
TITLE_FONT_WEIGHT,
|
|
10
10
|
TITLE_Y
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VSPNH7LC.js";
|
|
12
12
|
import {
|
|
13
13
|
FONT_FAMILY
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ICLB27PZ.js";
|
|
15
15
|
import {
|
|
16
16
|
measureText,
|
|
17
17
|
truncateText,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
contrastText,
|
|
32
32
|
mix,
|
|
33
33
|
themeBaseBg
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-YVLTNNME.js";
|
|
35
35
|
|
|
36
36
|
// src/raci/renderer.ts
|
|
37
37
|
import * as d3Selection from "d3-selection";
|
|
@@ -116,7 +116,7 @@ var COLUMN_RADIUS = 8;
|
|
|
116
116
|
var COLUMN_INSET = 8;
|
|
117
117
|
var COLUMN_BOTTOM_PAD = 14;
|
|
118
118
|
var MARKER_FONT = 14;
|
|
119
|
-
var MARKER_FONT_WEIGHT =
|
|
119
|
+
var MARKER_FONT_WEIGHT = "bold";
|
|
120
120
|
var LABEL_FONT = 13;
|
|
121
121
|
var ROLE_HEADER_FONT = 12;
|
|
122
122
|
var PHASE_FONT = 13;
|
|
@@ -372,7 +372,7 @@ function renderRaci(container, parsed, palette, isDark, handlers, exportDims) {
|
|
|
372
372
|
headerPath.attr("stroke", roleColor).attr("stroke-width", 1);
|
|
373
373
|
}
|
|
374
374
|
const cxText = roleX(i) + roleColW / 2;
|
|
375
|
-
colG.append("text").attr("class", "raci-column-label").attr("x", cxText).attr("y", headerY + sHeaderHeight / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", sRoleHeaderFont).attr("font-weight",
|
|
375
|
+
colG.append("text").attr("class", "raci-column-label").attr("x", cxText).attr("y", headerY + sHeaderHeight / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", sRoleHeaderFont).attr("font-weight", "bold").attr("fill", palette.text).text(
|
|
376
376
|
truncateText(
|
|
377
377
|
parsed.roleDisplayNames[i] ?? "",
|
|
378
378
|
sRoleHeaderFont,
|
|
@@ -519,7 +519,7 @@ function renderLegend(svg, markers, variant, x, y, mode, chipW, palette, surface
|
|
|
519
519
|
const fill2 = fillMode === "solid" ? rawColor : fillMode === "outline" ? surfaceBg : mix(rawColor, surfaceBg, TINT_PCT);
|
|
520
520
|
const stroke2 = fillMode === "solid" ? mix(rawColor, surfaceBg, 70) : rawColor;
|
|
521
521
|
chipG.append("rect").attr("x", cx).attr("y", y).attr("width", chipW).attr("height", sLegendHeight).attr("rx", sNodeRadius).attr("fill", fill2).attr("stroke", stroke2).attr("stroke-width", sNodeStrokeWidth);
|
|
522
|
-
chipG.append("text").attr("x", cx + chipW / 2).attr("y", y + sLegendHeight / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", sLegendLetterFont).attr("font-weight",
|
|
522
|
+
chipG.append("text").attr("x", cx + chipW / 2).attr("y", y + sLegendHeight / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", sLegendLetterFont).attr("font-weight", "bold").attr(
|
|
523
523
|
"fill",
|
|
524
524
|
fillMode === "solid" ? contrastText(
|
|
525
525
|
fill2,
|
|
@@ -552,7 +552,7 @@ function renderLegend(svg, markers, variant, x, y, mode, chipW, palette, surface
|
|
|
552
552
|
if (fillMode === "outline") {
|
|
553
553
|
slabRect.attr("stroke", rawColor).attr("stroke-width", 1);
|
|
554
554
|
}
|
|
555
|
-
chipG.append("text").attr("x", cx + slabPad + slabW / 2).attr("y", y + sLegendHeight / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", sLegendLetterFont).attr("font-weight",
|
|
555
|
+
chipG.append("text").attr("x", cx + slabPad + slabW / 2).attr("y", y + sLegendHeight / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", sLegendLetterFont).attr("font-weight", "bold").attr(
|
|
556
556
|
"fill",
|
|
557
557
|
fillMode === "solid" ? contrastText(
|
|
558
558
|
slabFill,
|
|
@@ -560,7 +560,7 @@ function renderLegend(svg, markers, variant, x, y, mode, chipW, palette, surface
|
|
|
560
560
|
palette.textOnFillDark
|
|
561
561
|
) : palette.text
|
|
562
562
|
).text(marker);
|
|
563
|
-
chipG.append("text").attr("x", cx + slabPad + slabW + 8).attr("y", y + sLegendHeight / 2).attr("dominant-baseline", "central").attr("font-size", sLegendLabelFont).attr("font-weight",
|
|
563
|
+
chipG.append("text").attr("x", cx + slabPad + slabW + 8).attr("y", y + sLegendHeight / 2).attr("dominant-baseline", "central").attr("font-size", sLegendLabelFont).attr("font-weight", "bold").attr("fill", palette.text).text(
|
|
564
564
|
truncateText(
|
|
565
565
|
labelText,
|
|
566
566
|
sLegendLabelFont,
|
|
@@ -586,14 +586,14 @@ function renderPhaseBar(svg, phase, x, y, width, palette, collapsed, autoColor,
|
|
|
586
586
|
const chevX = x + 12;
|
|
587
587
|
const chevY = y + sPhaseHeight / 2;
|
|
588
588
|
phaseG.append("text").attr("x", chevX).attr("y", chevY).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-family", FONT_FAMILY).attr("font-size", 9).attr("fill", palette.text).attr("opacity", 0.6).text(collapsed ? "\u25B6" : "\u25BC");
|
|
589
|
-
phaseG.append("text").attr("x", x + 26).attr("y", y + (sPhaseHeight - 4) / 2 + 2).attr("dominant-baseline", "central").attr("font-size", sPhaseFont).attr("font-weight",
|
|
589
|
+
phaseG.append("text").attr("x", x + 26).attr("y", y + (sPhaseHeight - 4) / 2 + 2).attr("dominant-baseline", "central").attr("font-size", sPhaseFont).attr("font-weight", "bold").attr("fill", palette.text).text(phase.displayName);
|
|
590
590
|
if (collapsed) {
|
|
591
591
|
const taskCount = phase.tasks.length;
|
|
592
592
|
if (taskCount > 0) {
|
|
593
593
|
const labelTextWidth = measureText(phase.displayName, sPhaseFont, {
|
|
594
594
|
bold: true
|
|
595
595
|
});
|
|
596
|
-
phaseG.append("text").attr("x", x + 26 + labelTextWidth + 10).attr("y", y + (sPhaseHeight - 4) / 2 + 2).attr("dominant-baseline", "central").attr("font-size", sPhaseFont - 1).attr("font-weight",
|
|
596
|
+
phaseG.append("text").attr("x", x + 26 + labelTextWidth + 10).attr("y", y + (sPhaseHeight - 4) / 2 + 2).attr("dominant-baseline", "central").attr("font-size", sPhaseFont - 1).attr("font-weight", "normal").attr("fill", palette.textMuted).text(`${taskCount} ${taskCount === 1 ? "task" : "tasks"}`);
|
|
597
597
|
}
|
|
598
598
|
if (!showSummary) return;
|
|
599
599
|
const alphabet = VARIANTS[variant].alphabet;
|
|
@@ -621,7 +621,7 @@ function renderPhaseBar(svg, phase, x, y, width, palette, collapsed, autoColor,
|
|
|
621
621
|
const stroke = fillMode === "solid" ? mix(rawColor, surfaceBg, 70) : rawColor;
|
|
622
622
|
const chipG = phaseG.append("g").attr("class", "raci-phase-summary");
|
|
623
623
|
chipG.append("rect").attr("x", cx).attr("y", summaryY).attr("width", sliceW).attr("height", SUMMARY_CHIP_H).attr("rx", sNodeRadius).attr("fill", fill).attr("stroke", stroke).attr("stroke-width", 1.25);
|
|
624
|
-
chipG.append("text").attr("x", cx + sliceW / 2).attr("y", summaryY + SUMMARY_CHIP_H / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", SUMMARY_LETTER_FONT).attr("font-weight",
|
|
624
|
+
chipG.append("text").attr("x", cx + sliceW / 2).attr("y", summaryY + SUMMARY_CHIP_H / 2).attr("text-anchor", "middle").attr("dominant-baseline", "central").attr("font-size", SUMMARY_LETTER_FONT).attr("font-weight", "bold").attr(
|
|
625
625
|
"fill",
|
|
626
626
|
fillMode === "solid" ? contrastText(
|
|
627
627
|
fill,
|
|
@@ -676,7 +676,7 @@ function renderTaskRow(svg, task, parsed, x, y, labelW, roleX, roleColW, palette
|
|
|
676
676
|
const tspan = textEl.append("tspan").text(seg.text);
|
|
677
677
|
if (i > 0 && segIdx === 0)
|
|
678
678
|
tspan.attr("x", labelX).attr("dy", sViolationLineHeight);
|
|
679
|
-
if (seg.bold) tspan.attr("font-weight",
|
|
679
|
+
if (seg.bold) tspan.attr("font-weight", "bold");
|
|
680
680
|
});
|
|
681
681
|
});
|
|
682
682
|
if (onClickLine) {
|
|
@@ -859,4 +859,4 @@ export {
|
|
|
859
859
|
renderRaci,
|
|
860
860
|
renderRaciForExport
|
|
861
861
|
};
|
|
862
|
-
//# sourceMappingURL=chunk-
|
|
862
|
+
//# sourceMappingURL=chunk-HHHYVTVS.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/fonts.ts
|
|
2
|
+
var FONT_FAMILY = "Inter, system-ui, Avenir, Helvetica, Arial, sans-serif";
|
|
3
|
+
var DEFAULT_FONT_NAME = "Inter";
|
|
4
|
+
var MONO_FAMILY = "ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace";
|
|
5
|
+
|
|
6
|
+
export {
|
|
7
|
+
FONT_FAMILY,
|
|
8
|
+
DEFAULT_FONT_NAME,
|
|
9
|
+
MONO_FAMILY
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=chunk-ICLB27PZ.js.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ScaleContext
|
|
3
3
|
} from "./chunk-24YPR5EH.js";
|
|
4
|
+
import {
|
|
5
|
+
HEADER_HEIGHT
|
|
6
|
+
} from "./chunk-IIEI7VK5.js";
|
|
4
7
|
import {
|
|
5
8
|
measureText,
|
|
6
9
|
truncateText
|
|
@@ -11,7 +14,7 @@ import {
|
|
|
11
14
|
import {
|
|
12
15
|
injectDefaultTagMetadata,
|
|
13
16
|
resolveTagColor
|
|
14
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-R4YGH7DJ.js";
|
|
15
18
|
|
|
16
19
|
// src/mindmap/text-wrap.ts
|
|
17
20
|
var H_PAD = 16;
|
|
@@ -149,7 +152,6 @@ function computeNodeText(label, description, depth, nodeWidth, hideDescriptions)
|
|
|
149
152
|
var ROOT_WIDTH = 180;
|
|
150
153
|
var DEPTH1_WIDTH = 150;
|
|
151
154
|
var LEAF_WIDTH = 120;
|
|
152
|
-
var SINGLE_LABEL_HEIGHT = 28;
|
|
153
155
|
var LABEL_LINE_HEIGHT = 18;
|
|
154
156
|
var DESC_LINE_HEIGHT = 14;
|
|
155
157
|
var NODE_V_PAD = 10;
|
|
@@ -530,7 +532,7 @@ function nodeHeightS(node, hideDescriptions, sc) {
|
|
|
530
532
|
hideDescriptions
|
|
531
533
|
);
|
|
532
534
|
const labelLineCount = text.labelLines.length;
|
|
533
|
-
const labelH = labelLineCount <= 1 ?
|
|
535
|
+
const labelH = labelLineCount <= 1 ? HEADER_HEIGHT : LABEL_LINE_HEIGHT * labelLineCount;
|
|
534
536
|
let h = labelH + NODE_V_PAD;
|
|
535
537
|
if (text.descLines.length > 0) {
|
|
536
538
|
h += DESC_LINE_HEIGHT * text.descLines.length + 4;
|
|
@@ -556,4 +558,4 @@ export {
|
|
|
556
558
|
computeNodeText,
|
|
557
559
|
layoutMindmap
|
|
558
560
|
};
|
|
559
|
-
//# sourceMappingURL=chunk-
|
|
561
|
+
//# sourceMappingURL=chunk-IDGQB6XD.js.map
|
|
@@ -784,6 +784,7 @@ var palettes = {
|
|
|
784
784
|
};
|
|
785
785
|
|
|
786
786
|
export {
|
|
787
|
+
DEFAULT_PALETTE_ID,
|
|
787
788
|
isValidHex,
|
|
788
789
|
registerPalette,
|
|
789
790
|
getPalette,
|
|
@@ -798,4 +799,4 @@ export {
|
|
|
798
799
|
tokyoNightPalette,
|
|
799
800
|
palettes
|
|
800
801
|
};
|
|
801
|
-
//# sourceMappingURL=chunk-
|
|
802
|
+
//# sourceMappingURL=chunk-IDJGV6VM.js.map
|