@diagrammo/dgmo 0.50.2 → 0.52.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/.cursorrules +15 -19
- package/.github/copilot-instructions.md +15 -19
- package/.windsurfrules +15 -19
- package/SKILL.md +15 -19
- package/dist/advanced.d.ts +155 -65
- package/dist/advanced.js +231 -189
- package/dist/{analyzer-UYKBXAKR.js → analyzer-BJ54GIFB.js} +3 -3
- package/dist/auto.css +31 -8
- package/dist/auto.d.ts +6 -0
- package/dist/auto.js +171 -133
- package/dist/auto.mjs +3062 -1478
- package/dist/block.css +28 -8
- package/dist/block.js +138 -72
- package/dist/charts-d3-MXEP6BNP.js +26 -0
- package/dist/{chunk-3YPY3OXD.js → chunk-3HF5YEFJ.js} +17 -7
- package/dist/{chunk-4MJ7M6YL.js → chunk-3HGU63UY.js} +14 -13
- package/dist/chunk-3LK5DNED.js +35 -0
- package/dist/{chunk-3Y2DRD7S.js → chunk-3QD7VP3U.js} +9 -4
- package/dist/{chunk-6BFZKBGD.js → chunk-3YRPZ7ZZ.js} +2 -2
- package/dist/{chunk-WW32K72E.js → chunk-44VCIPHF.js} +25 -21
- package/dist/{chunk-TN35C5KM.js → chunk-4AQRFDXL.js} +2 -2
- package/dist/{chunk-HHXOONLX.js → chunk-4B5YISOR.js} +38 -1
- package/dist/{chunk-PGEGPSCZ.js → chunk-4IHAV6O7.js} +2 -2
- package/dist/{chunk-7L3R6I3U.js → chunk-4UNQ6X24.js} +10 -7
- package/dist/{chunk-O7NUCTFU.js → chunk-4YFKQ5WT.js} +7 -4
- package/dist/{chunk-5WFIYXQ6.js → chunk-5223KXFD.js} +122 -242
- package/dist/{chunk-PFHVU7UA.js → chunk-5BHJZH62.js} +3 -3
- package/dist/{chunk-QYTPPDAO.js → chunk-5HILBT7X.js} +2 -2
- package/dist/{chunk-GKC3HILQ.js → chunk-5NGAO4QK.js} +27 -4
- package/dist/{chunk-IAEC4KLA.js → chunk-5QKQSSPO.js} +2 -2
- package/dist/{chunk-DSWVNQVS.js → chunk-5RP7JRVP.js} +4 -59
- package/dist/{chunk-MCZ5LBZD.js → chunk-5SEVICBT.js} +8 -8
- package/dist/{chunk-GBE54KY6.js → chunk-6EJITS44.js} +8 -5
- package/dist/{chunk-BBGDM4NQ.js → chunk-6HQH6JZE.js} +35 -16
- package/dist/{chunk-66NVRO4K.js → chunk-6LBQ7ELG.js} +17 -18
- package/dist/{chunk-4XK3FLFB.js → chunk-6NYWYNBI.js} +3 -3
- package/dist/{chunk-VBYSIOOY.js → chunk-75G3Q4DK.js} +3 -3
- package/dist/{chunk-3NODSS6A.js → chunk-77FGAVZC.js} +13 -10
- package/dist/{chunk-6IAA2QQ2.js → chunk-7BIZCTAX.js} +2 -2
- package/dist/{chunk-TWQUYVP3.js → chunk-7DF4J4RL.js} +4 -4
- package/dist/{chunk-66RUL3XF.js → chunk-7KINELPI.js} +111 -49
- package/dist/{chunk-L3UHP6TD.js → chunk-7L4UJOY6.js} +1 -2
- package/dist/{chunk-QJP6PG7F.js → chunk-7QE3XMRK.js} +19 -18
- package/dist/{chunk-P7CE7LXL.js → chunk-AAXZDUOV.js} +18 -17
- package/dist/{chunk-SXRTRMEE.js → chunk-AL672HNE.js} +3 -3
- package/dist/chunk-APKUAJ2L.js +220 -0
- package/dist/{chunk-SCHXJTZL.js → chunk-ARGMQ3H4.js} +2 -2
- package/dist/{chunk-HEVYAHLW.js → chunk-AUIM2NVH.js} +5 -5
- package/dist/{chunk-3LH5CLP4.js → chunk-BKVOYV6I.js} +143 -6
- package/dist/{chunk-RZ6YKEUJ.js → chunk-BPIZNB5O.js} +17 -15
- package/dist/{chunk-QROYX7TT.js → chunk-BPY242XU.js} +6 -4
- package/dist/{chunk-OTAL43EH.js → chunk-BRENJ2BQ.js} +39 -3
- package/dist/{chunk-FA6K3FWM.js → chunk-CCNDLW7Z.js} +44 -22
- package/dist/{chunk-2KGXHFYK.js → chunk-CIRFIL4M.js} +49 -29
- package/dist/chunk-DAOFNU6J.js +283 -0
- package/dist/{chunk-QJJZSROI.js → chunk-DYWQFQJP.js} +48 -38
- package/dist/{chunk-XEGTMVYY.js → chunk-EMLPOL77.js} +15 -8
- package/dist/{chunk-NWED7CYO.js → chunk-FHGVORFO.js} +29 -25
- package/dist/{chunk-U2HGPLZS.js → chunk-FQ7HTV52.js} +17 -2
- package/dist/{chunk-H73FP42Q.js → chunk-FQMUHRVC.js} +70 -31
- package/dist/{chunk-BTUTZMPT.js → chunk-FT3ZYWET.js} +108 -42
- package/dist/{chunk-T5SHNNGP.js → chunk-FUPF2UYQ.js} +92 -34
- package/dist/{chunk-3XPUDB7B.js → chunk-FY5MSZAP.js} +279 -39
- package/dist/{chunk-M5RXSRO2.js → chunk-GCYTI3DE.js} +42 -33
- package/dist/{chunk-DN66GPY5.js → chunk-GJFAMOGK.js} +24 -3
- package/dist/{chunk-F2L5GCQ4.js → chunk-GU46PPT3.js} +3 -3
- package/dist/{chunk-6IUAK7RZ.js → chunk-H6PI3KJT.js} +2 -2
- package/dist/{chunk-ONA5KPV3.js → chunk-H7KENAZO.js} +18 -14
- package/dist/{chunk-SQLNBA64.js → chunk-HBPDFCQY.js} +3 -3
- package/dist/{chunk-SCQ5VPUF.js → chunk-HFMYN6N2.js} +2 -2
- package/dist/{chunk-FJUNPCYI.js → chunk-HHKO6SKY.js} +2 -2
- package/dist/{chunk-DZXYF2F5.js → chunk-HQQNCY7W.js} +21 -8
- package/dist/{chunk-7TV5Y53Y.js → chunk-HWX6ZHF3.js} +3 -3
- package/dist/{chunk-3P2DKJCG.js → chunk-ICPJPQ5C.js} +2 -2
- package/dist/{chunk-VUJGMJE6.js → chunk-IM6PDDCE.js} +4 -4
- package/dist/{chunk-JJUOHGX2.js → chunk-INE5YJBZ.js} +13 -8
- package/dist/{chunk-HTMN2Z6U.js → chunk-J6QROYDA.js} +58 -11
- package/dist/{chunk-NX4EQS3U.js → chunk-J76PIKAT.js} +2 -2
- package/dist/{chunk-SVTI362O.js → chunk-J7KJR3R6.js} +129 -109
- package/dist/{chunk-JEUJOX5X.js → chunk-J7TLCB2Q.js} +2 -2
- package/dist/{chunk-O7WP4ZD4.js → chunk-JED6ZDEE.js} +2 -2
- package/dist/{chunk-J6K7RP6P.js → chunk-JRCOYRRH.js} +19 -7
- package/dist/{chunk-7QKLIMRZ.js → chunk-K2I2XOZD.js} +46 -51
- package/dist/{chunk-EAMEADTV.js → chunk-K4EOKJA6.js} +96 -24
- package/dist/{chunk-5OWVC2A6.js → chunk-KGVZ5VGH.js} +13 -10
- package/dist/{chunk-DFTFPYUD.js → chunk-LBMS4AW6.js} +22 -21
- package/dist/{chunk-VVW3F3MD.js → chunk-LGT3PZCJ.js} +27 -19
- package/dist/{chunk-OMNGQPEZ.js → chunk-LTXOLDUZ.js} +9 -6
- package/dist/{chunk-Q4V4XQWV.js → chunk-MUE65OTD.js} +5 -4
- package/dist/{chunk-5GJYGP5Z.js → chunk-MUVJ57EP.js} +14 -18
- package/dist/{chunk-CLD2OKV7.js → chunk-MX2EY5Y7.js} +2 -2
- package/dist/{chunk-OTQKUHRS.js → chunk-NNS4E7CW.js} +6 -4
- package/dist/{chunk-NNAAJVBU.js → chunk-NR5HCAUD.js} +1 -1
- package/dist/{chunk-KFZYNWWO.js → chunk-ONU3U4GL.js} +4 -4
- package/dist/{chunk-YNRDWYZP.js → chunk-OQKP2X3D.js} +170 -51
- package/dist/{chunk-AHGF2YYA.js → chunk-OTOHI4JO.js} +2 -2
- package/dist/{chunk-EOFPYPAU.js → chunk-P3NRSSUU.js} +51 -11
- package/dist/{chunk-QXKWYZNR.js → chunk-PRI2OD4E.js} +10 -3
- package/dist/{chunk-U6EQI3U6.js → chunk-QBZYACOG.js} +3 -3
- package/dist/{chunk-C2CVAM3U.js → chunk-QGATPIPX.js} +170 -91
- package/dist/{chunk-PZFVK3IH.js → chunk-QHXCAEMX.js} +8 -5
- package/dist/{chunk-BH3UYK36.js → chunk-QJMKPUYK.js} +15 -5
- package/dist/{chunk-HQCHYB5F.js → chunk-QOOUC2J5.js} +2 -2
- package/dist/{chunk-Z6XJQ6KO.js → chunk-QVENJMNX.js} +2 -2
- package/dist/{chunk-IUMPEA64.js → chunk-QZX5S6R3.js} +4 -4
- package/dist/{chunk-I7F2A35O.js → chunk-R3YSD62R.js} +25 -47
- package/dist/{chunk-NU3XLTGP.js → chunk-REJAIQ5S.js} +4 -4
- package/dist/{chunk-2C56LEML.js → chunk-ROOE4R4Y.js} +8 -5
- package/dist/{chunk-XHVV4NVW.js → chunk-RT7ACF77.js} +12 -2
- package/dist/{chunk-I2WKW7C7.js → chunk-SMRFPVLQ.js} +3 -3
- package/dist/{chunk-VDOOQZUD.js → chunk-SWSIKFEB.js} +4 -4
- package/dist/{chunk-HLJVEAOF.js → chunk-T4A4TSTJ.js} +19 -45
- package/dist/{chunk-KHEYDLMT.js → chunk-TJVLKNGR.js} +20 -10
- package/dist/{chunk-GL5UZ6NY.js → chunk-TPFKKXCB.js} +3 -3
- package/dist/{chunk-X6EZPSW6.js → chunk-TTIM6YTT.js} +31 -21
- package/dist/{chunk-BCYVE3N5.js → chunk-TYS6CSS5.js} +2 -2
- package/dist/{chunk-T4VOVZT5.js → chunk-UBLHQTLV.js} +15 -14
- package/dist/{chunk-3LKM6FMW.js → chunk-UNURMIQO.js} +2 -2
- package/dist/{chunk-TSA237IM.js → chunk-VILVLS7P.js} +5 -3
- package/dist/{chunk-HGN652MU.js → chunk-VL2O2F3W.js} +2 -2
- package/dist/{chunk-3XGZF2QJ.js → chunk-VQOCMUWI.js} +39 -28
- package/dist/{chunk-P6T66CCZ.js → chunk-WBM7ZNDI.js} +3 -2
- package/dist/{chunk-CMCR5WBW.js → chunk-WBRZJOEC.js} +3 -3
- package/dist/{chunk-5LWQH6QV.js → chunk-WCT3NYCV.js} +1 -1
- package/dist/{chunk-C4GQDB5L.js → chunk-WRNFDFPU.js} +2 -2
- package/dist/{chunk-6HJBFVLO.js → chunk-XD6ZYURY.js} +9 -4
- package/dist/{chunk-C63UWAKM.js → chunk-Y2ZE3MSG.js} +2 -2
- package/dist/{chunk-7UEMZREK.js → chunk-YAA6IID3.js} +2 -2
- package/dist/{chunk-F7BFXWNQ.js → chunk-YIBAWQGJ.js} +7 -4
- package/dist/{chunk-PH5X4GIP.js → chunk-YTMTPUH4.js} +8 -5
- package/dist/{chunk-3UIKSPFB.js → chunk-Z5QVYKR7.js} +11 -3
- package/dist/{chunk-KQ57MHRO.js → chunk-ZEF5M5MB.js} +155 -87
- package/dist/{chunk-LE4MYMLI.js → chunk-ZJV7GYR4.js} +6 -6
- package/dist/{chunk-XJLKLU4D.js → chunk-ZNWAYU6N.js} +11 -7
- package/dist/cli.cjs +165 -148
- package/dist/clock.js +105 -25
- package/dist/countdown.js +208 -82
- package/dist/dgmo-router-X7ZGAPIE.js +86 -0
- package/dist/dimensions-45H6JQEY.js +22 -0
- package/dist/editor.js +17 -2
- package/dist/element.d.ts +6 -0
- package/dist/element.js +172 -134
- package/dist/element.mjs +3026 -1463
- package/dist/{flowchart-parser-OE4WHLTF.js → flowchart-parser-UKELHBSB.js} +4 -4
- package/dist/{flowchart-renderer-GPCSMTOR.js → flowchart-renderer-MNCDS7MV.js} +10 -10
- package/dist/highlight.d.ts +21 -1
- package/dist/highlight.js +106 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +59 -57
- package/dist/{layout-FWODLIMP.js → layout-2L3WMRYU.js} +6 -6
- package/dist/{layout-7SKMFYHL.js → layout-46N4JJYK.js} +5 -5
- package/dist/{layout-7H4H46CS.js → layout-7QXCNOVS.js} +3 -3
- package/dist/layout-A4XWNVID.js +14 -0
- package/dist/{layout-46366KBT.js → layout-A5UHRWVH.js} +3 -3
- package/dist/{layout-NXG63LWH.js → layout-AM2JWW3X.js} +4 -4
- package/dist/{layout-DC4TVXER.js → layout-EE6GE46Y.js} +5 -5
- package/dist/{layout-FGQWRYYW.js → layout-F4WO357A.js} +3 -3
- package/dist/layout-G23F7LDH.js +9 -0
- package/dist/{layout-QNUQLEHU.js → layout-GM4UGR7B.js} +5 -4
- package/dist/{layout-7MZ5NF2N.js → layout-GQQJXNYH.js} +5 -5
- package/dist/{layout-5BG6DFCU.js → layout-IIE2S5FK.js} +6 -6
- package/dist/{layout-34CLNICW.js → layout-OAC4PEAC.js} +5 -5
- package/dist/layout-VMCRX66I.js +14 -0
- package/dist/{layout-PUQCB6AN.js → layout-ZDOSXL5G.js} +7 -7
- package/dist/{layout-search-QS44PI5R.js → layout-search-55FU6HD3.js} +6 -157
- package/dist/map-data/gazetteer.json +1 -1
- package/dist/{palettes-PRJ2RI6D.js → palettes-UDLZ2SA4.js} +2 -2
- package/dist/{parser-D5VILGN2.js → parser-2ECN6JA2.js} +4 -4
- package/dist/{parser-LWKKBNSA.js → parser-4WTIHM5J.js} +3 -3
- package/dist/{parser-DFFEDKHH.js → parser-5H2BTSJQ.js} +3 -3
- package/dist/{parser-4NO6VZ6S.js → parser-75KVXUNS.js} +4 -4
- package/dist/{parser-VKOJM7KS.js → parser-774AC53T.js} +4 -4
- package/dist/{parser-IBWNAPY4.js → parser-BE4YCSRU.js} +3 -3
- package/dist/{parser-4AI5ZN5F.js → parser-CNGUQUQI.js} +3 -3
- package/dist/{parser-36HVKU5U.js → parser-DEUUSQIN.js} +7 -6
- package/dist/{parser-H3XEPFPV.js → parser-DQAFLUJB.js} +4 -4
- package/dist/{parser-5OXGPNBF.js → parser-EYCKNKQA.js} +5 -5
- package/dist/{parser-TGQZJ5OT.js → parser-FXISIU6A.js} +4 -4
- package/dist/{parser-JJR52VAT.js → parser-GTB4XC7P.js} +5 -5
- package/dist/{parser-AGVYTQXV.js → parser-GVEPAUSD.js} +4 -4
- package/dist/{parser-WAV5JRPT.js → parser-HSQGTY4G.js} +4 -4
- package/dist/{parser-YS7TOS2K.js → parser-HVKRINUS.js} +3 -3
- package/dist/{parser-W4PQUGX3.js → parser-J5MIEYO4.js} +5 -5
- package/dist/parser-KMZIXLDZ.js +13 -0
- package/dist/{parser-HYRTF3DO.js → parser-LJHXWSXU.js} +3 -3
- package/dist/{parser-KCR2WS3V.js → parser-PT3W72G5.js} +4 -4
- package/dist/{parser-CVMEDULU.js → parser-SBJQDPHL.js} +4 -4
- package/dist/{parser-RZPVAQVX.js → parser-SUWWWCMX.js} +4 -3
- package/dist/{parser-TXND652E.js → parser-SXDRNZOA.js} +4 -4
- package/dist/parser-UMILOW3M.js +14 -0
- package/dist/{parser-RV4M6AS2.js → parser-UP3AZ367.js} +4 -4
- package/dist/{parser-IJBMRXMC.js → parser-WHPRV3X5.js} +5 -5
- package/dist/{parser-MPCE5JBG.js → parser-WX3UODSJ.js} +4 -4
- package/dist/{parser-K3XXLMUW.js → parser-XCIEN3KN.js} +4 -4
- package/dist/{parser-AXKBDGNO.js → parser-XIRTUMVN.js} +5 -5
- package/dist/{parser-B5FVS7O6.js → parser-YKCGIG45.js} +3 -3
- package/dist/{parser-PSA4UBSP.js → parser-YKYMQG3B.js} +4 -4
- package/dist/{parser-MTOMTWTD.js → parser-ZGM2OJ6Y.js} +6 -5
- package/dist/{parser-CSFUN3CT.js → parser-ZL5QUFVH.js} +5 -4
- package/dist/pert.d.ts +2 -2
- package/dist/{renderer-PPIHO5FI.js → renderer-3F7OS2AX.js} +14 -13
- package/dist/{renderer-SBS3YWU5.js → renderer-4QB4K7Q3.js} +9 -9
- package/dist/{renderer-GHPZMFU2.js → renderer-5DAKMIU2.js} +3 -3
- package/dist/{renderer-R2WNIC2C.js → renderer-5H4SY7YY.js} +9 -9
- package/dist/{renderer-DAXMXIKD.js → renderer-5PIQPFOX.js} +5 -4
- package/dist/{renderer-45PSOL3E.js → renderer-6MU37QF5.js} +6 -6
- package/dist/renderer-AQVMWJ4M.js +27 -0
- package/dist/{renderer-A5VE5BCI.js → renderer-BDDW6K7N.js} +9 -9
- package/dist/{renderer-AUW2BE6G.js → renderer-BNB3VIDY.js} +10 -10
- package/dist/{renderer-4ITCHBT7.js → renderer-CQY6ATOS.js} +6 -6
- package/dist/{renderer-6OKF44KS.js → renderer-CVW75CXL.js} +15 -15
- package/dist/{renderer-7RH2SI3B.js → renderer-DT4XRFEP.js} +5 -4
- package/dist/{renderer-B5TBNZJE.js → renderer-ERHBSTQT.js} +9 -9
- package/dist/{renderer-HVCU2C3Z.js → renderer-HSHHVYWF.js} +5 -4
- package/dist/renderer-IDPVUFNB.js +28 -0
- package/dist/renderer-ILX6BGKR.js +21 -0
- package/dist/renderer-JP663HKG.js +22 -0
- package/dist/{renderer-KS7YZJE2.js → renderer-KNFTTOBL.js} +11 -11
- package/dist/{renderer-2AZ5HJFK.js → renderer-MVUZBESR.js} +5 -5
- package/dist/{renderer-QAOBLRXV.js → renderer-N4EBR2FV.js} +11 -11
- package/dist/{renderer-P5ROYQGU.js → renderer-NHO46CT2.js} +4 -4
- package/dist/{renderer-NGXZTRK6.js → renderer-NO2QJ5LZ.js} +10 -10
- package/dist/{renderer-FPE3J5VZ.js → renderer-OGFV5RXX.js} +12 -12
- package/dist/{renderer-ODUUOPVT.js → renderer-PDLESJMS.js} +15 -15
- package/dist/renderer-T4MTNINC.js +24 -0
- package/dist/renderer-TOUGFGTM.js +24 -0
- package/dist/{renderer-BSR2O2H6.js → renderer-U3KPD43Y.js} +14 -13
- package/dist/{renderer-JCCHNECZ.js → renderer-X334IJU2.js} +10 -10
- package/dist/{renderer-5DSEWF74.js → renderer-Y5OAMOCR.js} +9 -9
- package/dist/{renderer-5KVCNMOJ.js → renderer-YONAKAJU.js} +5 -3
- package/dist/{renderer-7SD6MSBS.js → renderer-YWMI6Y2U.js} +12 -12
- package/dist/{renderer-2QPMJ2DA.js → renderer-ZWIH4WDW.js} +10 -10
- package/dist/renderer-radial-7CGZMVMS.js +21 -0
- package/dist/{resolver-FHBCO3PL.js → resolver-EMTGNR3D.js} +4 -3
- package/dist/{state-parser-3REXRK3R.js → state-parser-BATWAID2.js} +4 -4
- package/dist/{state-renderer-XYLNRWXR.js → state-renderer-3FKZJ3LP.js} +10 -10
- package/dist/{themes-PdPR1-hC.d.ts → themes-32xj5ZTW.d.ts} +27 -0
- package/docs/ai-integration.md +15 -19
- package/docs/language-reference.md +106 -21
- package/gallery/fixtures/clock.dgmo +3 -3
- package/gallery/fixtures/countdown-tz.dgmo +5 -0
- package/package.json +1 -1
- package/dist/charts-d3-MUW3LTML.js +0 -26
- package/dist/dgmo-router-CE2G67FV.js +0 -84
- package/dist/dimensions-OTBKC5M6.js +0 -22
- package/dist/layout-6RDJHS6E.js +0 -9
- package/dist/layout-J36454XU.js +0 -14
- package/dist/layout-LD6XTLD6.js +0 -14
- package/dist/parser-4WQQQXCG.js +0 -13
- package/dist/parser-O4HIUN6G.js +0 -13
- package/dist/renderer-CYB4LK3G.js +0 -22
- package/dist/renderer-FF24KZCI.js +0 -24
- package/dist/renderer-FYSVXL7M.js +0 -28
- package/dist/renderer-HDCCZURL.js +0 -24
- package/dist/renderer-PSMMZCKH.js +0 -21
- package/dist/renderer-UYMQQCJK.js +0 -24
- package/dist/renderer-radial-F7X5F2VU.js +0 -21
|
@@ -1,177 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildSwatches
|
|
3
|
+
} from "./chunk-3LK5DNED.js";
|
|
4
|
+
import {
|
|
5
|
+
fixedParts,
|
|
6
|
+
formatTime,
|
|
7
|
+
handAngles,
|
|
8
|
+
rampColor,
|
|
9
|
+
sunLine,
|
|
10
|
+
workStatus,
|
|
11
|
+
zoneParts
|
|
12
|
+
} from "./chunk-APKUAJ2L.js";
|
|
1
13
|
import {
|
|
2
14
|
FONT_FAMILY
|
|
3
15
|
} from "./chunk-6KFWC4CO.js";
|
|
4
16
|
import {
|
|
17
|
+
contrastText,
|
|
5
18
|
mix,
|
|
6
19
|
themeBaseBg
|
|
7
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-WBM7ZNDI.js";
|
|
8
21
|
import {
|
|
9
22
|
resolveColor
|
|
10
23
|
} from "./chunk-TLVIHFRO.js";
|
|
11
24
|
|
|
12
25
|
// src/clock/renderer.ts
|
|
13
26
|
import * as d3Selection from "d3-selection";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var CLOCK_RAMP = [
|
|
17
|
-
[0, "#3d478f"],
|
|
18
|
-
[4, "#4a4d8c"],
|
|
19
|
-
[6, "#c98a6b"],
|
|
20
|
-
[8, "#d9a441"],
|
|
21
|
-
[11, "#e0b23c"],
|
|
22
|
-
[13, "#4f96c4"],
|
|
23
|
-
[16, "#cc7a33"],
|
|
24
|
-
[19, "#8a5aa0"],
|
|
25
|
-
[24, "#3d478f"]
|
|
26
|
-
];
|
|
27
|
-
function hexLerp(a, b, t) {
|
|
28
|
-
const pa = [1, 3, 5].map((i) => parseInt(a.slice(i, i + 2), 16));
|
|
29
|
-
const pb = [1, 3, 5].map((i) => parseInt(b.slice(i, i + 2), 16));
|
|
30
|
-
const c = pa.map(
|
|
31
|
-
(v, i) => Math.round(v + (pb[i] - v) * t).toString(16).padStart(2, "0")
|
|
32
|
-
);
|
|
33
|
-
return `#${c.join("")}`;
|
|
34
|
-
}
|
|
35
|
-
function rampColor(h) {
|
|
36
|
-
const hh = (h % 24 + 24) % 24;
|
|
37
|
-
for (let i = 0; i < CLOCK_RAMP.length - 1; i++) {
|
|
38
|
-
const [h0, c0] = CLOCK_RAMP[i];
|
|
39
|
-
const [h1, c1] = CLOCK_RAMP[i + 1];
|
|
40
|
-
if (hh >= h0 && hh <= h1) return hexLerp(c0, c1, (hh - h0) / (h1 - h0));
|
|
41
|
-
}
|
|
42
|
-
return CLOCK_RAMP[0][1];
|
|
43
|
-
}
|
|
44
|
-
var SOON_MIN = 60;
|
|
45
|
-
var RAD = Math.PI / 180;
|
|
46
|
-
var DAY_MS = 864e5;
|
|
47
|
-
var J1970 = 2440588;
|
|
48
|
-
var J2000 = 2451545;
|
|
49
|
-
function zoneParts(zone, nowMs) {
|
|
50
|
-
const d = new Date(nowMs);
|
|
51
|
-
try {
|
|
52
|
-
const o = {};
|
|
53
|
-
new Intl.DateTimeFormat("en-US", {
|
|
54
|
-
timeZone: zone,
|
|
55
|
-
hour12: false,
|
|
56
|
-
hour: "2-digit",
|
|
57
|
-
minute: "2-digit",
|
|
58
|
-
second: "2-digit",
|
|
59
|
-
weekday: "short"
|
|
60
|
-
}).formatToParts(d).forEach((x) => {
|
|
61
|
-
o[x.type] = x.value;
|
|
62
|
-
});
|
|
63
|
-
const off = new Intl.DateTimeFormat("en-US", {
|
|
64
|
-
timeZone: zone,
|
|
65
|
-
timeZoneName: "shortOffset"
|
|
66
|
-
}).formatToParts(d).find((x) => x.type === "timeZoneName");
|
|
67
|
-
return {
|
|
68
|
-
h: parseInt(o["hour"], 10) % 24,
|
|
69
|
-
m: parseInt(o["minute"], 10),
|
|
70
|
-
s: parseInt(o["second"], 10),
|
|
71
|
-
weekday: o["weekday"],
|
|
72
|
-
offsetLabel: off ? off.value.replace("GMT", "UTC") : ""
|
|
73
|
-
};
|
|
74
|
-
} catch {
|
|
75
|
-
return {
|
|
76
|
-
h: d.getUTCHours(),
|
|
77
|
-
m: d.getUTCMinutes(),
|
|
78
|
-
s: d.getUTCSeconds(),
|
|
79
|
-
weekday: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"][d.getUTCDay()],
|
|
80
|
-
offsetLabel: "UTC"
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
function pad2(n) {
|
|
85
|
-
return n < 10 ? "0" + n : String(n);
|
|
86
|
-
}
|
|
87
|
-
function formatTime(h, m, s, hours12) {
|
|
88
|
-
const sec = pad2(s);
|
|
89
|
-
if (hours12) {
|
|
90
|
-
const ap = h < 12 ? "am" : "pm";
|
|
91
|
-
let hr = h % 12;
|
|
92
|
-
if (hr === 0) hr = 12;
|
|
93
|
-
return { main: `${hr}:${pad2(m)}`, sec, ap };
|
|
94
|
-
}
|
|
95
|
-
return { main: `${pad2(h)}:${pad2(m)}`, sec, ap: "" };
|
|
96
|
-
}
|
|
97
|
-
function fmtDelta(ms) {
|
|
98
|
-
const m = Math.max(0, Math.round(ms / 6e4));
|
|
99
|
-
if (m < 90) return `${m}m`;
|
|
100
|
-
return `${Math.floor(m / 60)}h ${m % 60}m`;
|
|
101
|
-
}
|
|
102
|
-
function workStatus(parts, work) {
|
|
103
|
-
if (!work) return null;
|
|
104
|
-
const min = parts.h * 60 + parts.m;
|
|
105
|
-
if (!work.days[parts.weekday]) return { cls: "off", text: "Weekend" };
|
|
106
|
-
if (min < work.startMin) {
|
|
107
|
-
const d = work.startMin - min;
|
|
108
|
-
return {
|
|
109
|
-
cls: d <= SOON_MIN ? "soon" : "off",
|
|
110
|
-
text: `starts in ${fmtDelta(d * 6e4)}`
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
if (min < work.endMin) {
|
|
114
|
-
return { cls: "ok", text: `${fmtDelta((work.endMin - min) * 6e4)} left` };
|
|
115
|
-
}
|
|
116
|
-
return {
|
|
117
|
-
cls: "off",
|
|
118
|
-
text: `ended ${fmtDelta((min - work.endMin) * 6e4)} ago`
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function toJulian(ms) {
|
|
122
|
-
return ms / DAY_MS - 0.5 + J1970;
|
|
123
|
-
}
|
|
124
|
-
function fromJulian(j) {
|
|
125
|
-
return (j + 0.5 - J1970) * DAY_MS;
|
|
126
|
-
}
|
|
127
|
-
function sunTimes(nowMs, lat, lon) {
|
|
128
|
-
const lw = -lon * RAD;
|
|
129
|
-
const phi = lat * RAD;
|
|
130
|
-
const J = toJulian(nowMs);
|
|
131
|
-
const n = Math.round(J - J2000 - 9e-4 - lw / (2 * Math.PI));
|
|
132
|
-
const Jn = J2000 + 9e-4 + lw / (2 * Math.PI) + n;
|
|
133
|
-
const M = (357.5291 + 0.98560028 * (Jn - J2000)) * RAD;
|
|
134
|
-
const C = (1.9148 * Math.sin(M) + 0.02 * Math.sin(2 * M) + 3e-4 * Math.sin(3 * M)) * RAD;
|
|
135
|
-
const L = M + C + Math.PI + 102.9372 * RAD;
|
|
136
|
-
const Jt = Jn + 53e-4 * Math.sin(M) - 69e-4 * Math.sin(2 * L);
|
|
137
|
-
const dec = Math.asin(Math.sin(L) * Math.sin(23.44 * RAD));
|
|
138
|
-
const cw = (Math.sin(-0.833 * RAD) - Math.sin(phi) * Math.sin(dec)) / (Math.cos(phi) * Math.cos(dec));
|
|
139
|
-
if (cw > 1) return { polar: "night" };
|
|
140
|
-
if (cw < -1) return { polar: "day" };
|
|
141
|
-
const w = Math.acos(cw);
|
|
142
|
-
const Jset = J2000 + 9e-4 + (w + lw) / (2 * Math.PI) + n + 53e-4 * Math.sin(M) - 69e-4 * Math.sin(2 * L);
|
|
143
|
-
return {
|
|
144
|
-
sunriseMs: fromJulian(Jt - (Jset - Jt)),
|
|
145
|
-
sunsetMs: fromJulian(Jset)
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
function sunLine(nowMs, lat, lon) {
|
|
149
|
-
const t = sunTimes(nowMs, lat, lon);
|
|
150
|
-
if (t.polar) {
|
|
151
|
-
return {
|
|
152
|
-
up: t.polar === "day",
|
|
153
|
-
text: t.polar === "day" ? "midnight sun" : "polar night"
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
if (nowMs < t.sunriseMs) {
|
|
157
|
-
return { up: false, text: `sunrise in ${fmtDelta(t.sunriseMs - nowMs)}` };
|
|
158
|
-
}
|
|
159
|
-
if (nowMs < t.sunsetMs) {
|
|
160
|
-
return { up: true, text: `sunset in ${fmtDelta(t.sunsetMs - nowMs)}` };
|
|
161
|
-
}
|
|
162
|
-
const tm = sunTimes(nowMs + DAY_MS, lat, lon);
|
|
163
|
-
if (tm.polar) return { up: false, text: "sunrise in \u2014" };
|
|
164
|
-
return { up: false, text: `sunrise in ${fmtDelta(tm.sunriseMs - nowMs)}` };
|
|
27
|
+
function partsFor(entry, now) {
|
|
28
|
+
return entry.kind === "fixed" ? fixedParts(entry.fixedOffsetMin ?? 0, now) : zoneParts(entry.zone, now);
|
|
165
29
|
}
|
|
166
|
-
function handAngles(h, m, s) {
|
|
167
|
-
return {
|
|
168
|
-
hour: (h % 12 + m / 60) * 30,
|
|
169
|
-
minute: (m + s / 60) * 6,
|
|
170
|
-
second: s * 6
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
// src/clock/renderer.ts
|
|
175
30
|
var PLACE_ACCENTS = [
|
|
176
31
|
"blue",
|
|
177
32
|
"green",
|
|
@@ -275,34 +130,18 @@ function daysLabel(days) {
|
|
|
275
130
|
return "Mon\u2013Fri";
|
|
276
131
|
return on.join(", ");
|
|
277
132
|
}
|
|
278
|
-
function buildSwatches(palette, muted) {
|
|
279
|
-
const bg = palette.bg;
|
|
280
|
-
const day = resolveColor("orange", palette) ?? "#d98a1f";
|
|
281
|
-
const night = resolveColor("blue", palette) ?? "#4864b0";
|
|
282
|
-
const ok = resolveColor("green", palette) ?? "#3f9e59";
|
|
283
|
-
const soon = resolveColor("orange", palette) ?? "#c9761a";
|
|
284
|
-
return {
|
|
285
|
-
day,
|
|
286
|
-
night,
|
|
287
|
-
dayTint: mix(day, bg, 14),
|
|
288
|
-
nightTint: mix(night, bg, 14),
|
|
289
|
-
ok,
|
|
290
|
-
soon,
|
|
291
|
-
off: muted,
|
|
292
|
-
okSoft: mix(ok, bg, 14),
|
|
293
|
-
soonSoft: mix(soon, bg, 14),
|
|
294
|
-
offSoft: mix(muted, bg, 16),
|
|
295
|
-
// Sundown indicator: a yellow sun by day, a blue moon by night.
|
|
296
|
-
sunIcon: resolveColor("yellow", palette) ?? "#f4b400",
|
|
297
|
-
moonIcon: night
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
133
|
function renderClock(container, parsed, palette, isDark, exportDims) {
|
|
301
134
|
d3Selection.select(container).selectAll(":not([data-d3-tooltip])").remove();
|
|
302
135
|
const avail = exportDims?.width ?? container.clientWidth;
|
|
303
136
|
const heightHint = exportDims?.height ?? container.clientHeight;
|
|
304
137
|
if (avail <= 0) return;
|
|
305
|
-
const
|
|
138
|
+
const cardM = 8;
|
|
139
|
+
const baseWidth = Math.min(720, Math.max(460, avail));
|
|
140
|
+
const COL_MIN_W = 190;
|
|
141
|
+
const width = exportDims?.width ?? (parsed.columns ? Math.max(
|
|
142
|
+
baseWidth,
|
|
143
|
+
COL_MIN_W * Math.max(1, parsed.entries.length) + 2 * cardM
|
|
144
|
+
) : baseWidth);
|
|
306
145
|
const now = Date.now();
|
|
307
146
|
const baseBg = themeBaseBg(palette, isDark);
|
|
308
147
|
const muted = mix(palette.text, baseBg, 55);
|
|
@@ -316,8 +155,7 @@ function renderClock(container, parsed, palette, isDark, exportDims) {
|
|
|
316
155
|
const rowH = 84;
|
|
317
156
|
const svg = d3Selection.select(container).append("svg").attr("width", width).attr("preserveAspectRatio", "xMidYMid meet").attr("xmlns", "http://www.w3.org/2000/svg").attr("role", "img").attr("aria-label", `${parsed.title ?? "Clock"} \u2014 world clocks`).style("font-family", FONT_FAMILY);
|
|
318
157
|
const bgRect = svg.append("rect").attr("width", width).attr("fill", palette.bg);
|
|
319
|
-
const
|
|
320
|
-
const card = svg.append("rect").attr("x", cardM).attr("y", cardM).attr("width", width - 2 * cardM).attr("rx", 14).attr("fill", cardFill).attr("stroke", mix(palette.text, palette.bg, 40)).attr("stroke-width", 1);
|
|
158
|
+
const card = svg.append("rect").attr("x", cardM).attr("y", cardM).attr("width", width - 2 * cardM).attr("rx", 14).attr("fill", parsed.fillMode === "outline" ? baseBg : cardFill).attr("stroke", mix(palette.text, palette.bg, 40)).attr("stroke-width", 1);
|
|
321
159
|
clipSeq += 1;
|
|
322
160
|
const clipId = `dgmo-clock-clip-${clipSeq}`;
|
|
323
161
|
const clipRect = svg.append("clipPath").attr("id", clipId).append("rect").attr("x", cardM).attr("y", cardM).attr("width", width - 2 * cardM).attr("rx", 14);
|
|
@@ -345,6 +183,8 @@ function renderClock(container, parsed, palette, isDark, exportDims) {
|
|
|
345
183
|
line2,
|
|
346
184
|
tick: mix(palette.text, palette.bg, 35),
|
|
347
185
|
cardFill,
|
|
186
|
+
baseBg,
|
|
187
|
+
fillMode: parsed.fillMode,
|
|
348
188
|
sw,
|
|
349
189
|
palette
|
|
350
190
|
};
|
|
@@ -357,7 +197,7 @@ function renderClock(container, parsed, palette, isDark, exportDims) {
|
|
|
357
197
|
if (parsed.face === "digital") {
|
|
358
198
|
let secW = 0;
|
|
359
199
|
for (const e of parsed.entries) {
|
|
360
|
-
const p =
|
|
200
|
+
const p = partsFor(e, now);
|
|
361
201
|
const t = formatTime(p.h, p.m, p.s, parsed.hours12);
|
|
362
202
|
mainW = Math.max(mainW, estWidth(t.main, 48));
|
|
363
203
|
secW = Math.max(secW, estWidth(`:${t.sec}`, 16), estWidth(t.ap, 16));
|
|
@@ -386,11 +226,14 @@ function renderClock(container, parsed, palette, isDark, exportDims) {
|
|
|
386
226
|
bgRect.attr("height", bannerH);
|
|
387
227
|
card.attr("height", bannerH - 2 * cardM);
|
|
388
228
|
}
|
|
229
|
+
function zoneFillMode(entry, parsed, col) {
|
|
230
|
+
return entry.color || parsed.colorBy === "place" ? col.fillMode : void 0;
|
|
231
|
+
}
|
|
389
232
|
function drawRow(svg, entry, index, parsed, now, rowTop, rowH, geom, col) {
|
|
390
233
|
const { padX } = geom;
|
|
391
234
|
const { text, muted, line2, tick, sw, cardFill } = col;
|
|
392
235
|
const center = rowTop + rowH / 2;
|
|
393
|
-
const parts =
|
|
236
|
+
const parts = partsFor(entry, now);
|
|
394
237
|
const hasCoords = entry.lat !== null && entry.lon !== null;
|
|
395
238
|
const sun = parsed.sun && hasCoords ? sunLine(now, entry.lat, entry.lon) : null;
|
|
396
239
|
const up = sun ? sun.up : parts.h >= 6 && parts.h < 18;
|
|
@@ -413,13 +256,16 @@ function drawRow(svg, entry, index, parsed, now, rowTop, rowH, geom, col) {
|
|
|
413
256
|
});
|
|
414
257
|
const rightBlockW = 178;
|
|
415
258
|
const rightColLeft = geom.rightX - rightBlockW;
|
|
259
|
+
const fm = zoneFillMode(entry, parsed, col);
|
|
416
260
|
const g = svg.append("g").attr("data-line-number", entry.lineNumber);
|
|
417
261
|
if (auto) {
|
|
418
|
-
g.append("rect").attr("x", 9).attr("y", rowTop).attr("width", geom.width - 18).attr("height", rowH).attr("fill", auto.laneTint);
|
|
262
|
+
g.append("rect").attr("data-dgmo-clock-lane", "").attr("x", 9).attr("y", rowTop).attr("width", geom.width - 18).attr("height", rowH).attr("fill", fm === "outline" ? col.baseBg : auto.laneTint);
|
|
419
263
|
}
|
|
420
264
|
g.attr("data-dgmo-clock", "").attr("data-dgmo-clock-zone", entry.zone).attr("data-dgmo-clock-face", parsed.face).attr("data-dgmo-clock-hours12", parsed.hours12 ? "1" : "0").attr("data-dgmo-clock-sun", sun ? "1" : "0").attr("data-dgmo-clock-c-day", sw.day).attr("data-dgmo-clock-c-night", sw.night).attr("data-dgmo-clock-c-day-soft", sw.dayTint).attr("data-dgmo-clock-c-night-soft", sw.nightTint).attr("data-dgmo-clock-c-ok", sw.ok).attr("data-dgmo-clock-c-soon", sw.soon).attr("data-dgmo-clock-c-off", sw.off).attr("data-dgmo-clock-c-ok-soft", sw.okSoft).attr("data-dgmo-clock-c-soon-soft", sw.soonSoft).attr("data-dgmo-clock-c-off-soft", sw.offSoft);
|
|
421
265
|
if (entry.lat !== null) g.attr("data-dgmo-clock-lat", entry.lat);
|
|
422
266
|
if (entry.lon !== null) g.attr("data-dgmo-clock-lon", entry.lon);
|
|
267
|
+
if (entry.kind === "fixed")
|
|
268
|
+
g.attr("data-dgmo-clock-fixed-offset", entry.fixedOffsetMin ?? 0);
|
|
423
269
|
if (parsed.work) {
|
|
424
270
|
g.attr("data-dgmo-clock-work-start", parsed.work.startMin).attr("data-dgmo-clock-work-end", parsed.work.endMin).attr(
|
|
425
271
|
"data-dgmo-clock-work-days",
|
|
@@ -428,15 +274,18 @@ function drawRow(svg, entry, index, parsed, now, rowTop, rowH, geom, col) {
|
|
|
428
274
|
}
|
|
429
275
|
const contentLeft = padX + 4;
|
|
430
276
|
const timeColor = auto?.solid ?? text;
|
|
431
|
-
const faceFill = auto ? mix(auto.solid, cardFill, 20) : stTint;
|
|
277
|
+
const faceFill = auto && fm === "outline" ? col.baseBg : auto && fm === "solid" ? auto.solid : auto ? mix(auto.solid, cardFill, 20) : stTint;
|
|
432
278
|
const ringColor = auto?.solid ?? line2;
|
|
433
|
-
const
|
|
279
|
+
const handInk = auto && fm === "solid" ? contrastText(
|
|
280
|
+
auto.solid,
|
|
281
|
+
col.palette.textOnFillLight,
|
|
282
|
+
col.palette.textOnFillDark
|
|
283
|
+
) : text;
|
|
284
|
+
const accentColor = auto && fm === "solid" ? handInk : auto?.solid ?? stColor;
|
|
434
285
|
if (auto) {
|
|
435
|
-
g.attr("data-dgmo-clock-auto-solid", auto.solid).attr(
|
|
436
|
-
"data-dgmo-clock-auto-face",
|
|
437
|
-
faceFill
|
|
438
|
-
);
|
|
286
|
+
g.attr("data-dgmo-clock-auto-solid", auto.solid).attr("data-dgmo-clock-auto-face", faceFill).attr("data-dgmo-clock-auto-mode", parsed.colorBy).attr("data-dgmo-clock-cardfill", cardFill);
|
|
439
287
|
}
|
|
288
|
+
if (fm) g.attr("data-dgmo-clock-fill-mode", fm);
|
|
440
289
|
if (parsed.face === "analog") {
|
|
441
290
|
const size = rowH - 20;
|
|
442
291
|
const fx = contentLeft;
|
|
@@ -449,8 +298,8 @@ function drawRow(svg, entry, index, parsed, now, rowTop, rowH, geom, col) {
|
|
|
449
298
|
fg.append("line").attr("x1", 50 + 39 * Math.sin(a)).attr("y1", 50 - 39 * Math.cos(a)).attr("x2", 50 + 46 * Math.sin(a)).attr("y2", 50 - 46 * Math.cos(a)).attr("stroke", tick).attr("stroke-width", 1.8);
|
|
450
299
|
}
|
|
451
300
|
const ang = handAngles(parts.h, parts.m, parts.s);
|
|
452
|
-
fg.append("line").attr("data-dgmo-clock-hand", "h").attr("x1", 50).attr("y1", 50).attr("x2", 50).attr("y2", 28).attr("stroke",
|
|
453
|
-
fg.append("line").attr("data-dgmo-clock-hand", "m").attr("x1", 50).attr("y1", 50).attr("x2", 50).attr("y2", 17).attr("stroke",
|
|
301
|
+
fg.append("line").attr("data-dgmo-clock-hand", "h").attr("x1", 50).attr("y1", 50).attr("x2", 50).attr("y2", 28).attr("stroke", handInk).attr("stroke-width", 4).attr("stroke-linecap", "round").attr("transform", `rotate(${ang.hour} 50 50)`);
|
|
302
|
+
fg.append("line").attr("data-dgmo-clock-hand", "m").attr("x1", 50).attr("y1", 50).attr("x2", 50).attr("y2", 17).attr("stroke", handInk).attr("stroke-width", 2.6).attr("stroke-linecap", "round").attr("transform", `rotate(${ang.minute} 50 50)`);
|
|
454
303
|
fg.append("line").attr("data-dgmo-clock-hand", "s").attr("x1", 50).attr("y1", 55).attr("x2", 50).attr("y2", 14).attr("stroke", accentColor).attr("stroke-width", 1.3).attr("stroke-linecap", "round").attr("transform", `rotate(${ang.second} 50 50)`);
|
|
455
304
|
fg.append("circle").attr("data-dgmo-clock-center", "").attr("cx", 50).attr("cy", 50).attr("r", 2.6).attr("fill", accentColor);
|
|
456
305
|
} else {
|
|
@@ -497,7 +346,8 @@ function drawRow(svg, entry, index, parsed, now, rowTop, rowH, geom, col) {
|
|
|
497
346
|
const textX = rightColLeft + 20;
|
|
498
347
|
const textMax = geom.rightX - textX;
|
|
499
348
|
const lines = [];
|
|
500
|
-
if (entry.
|
|
349
|
+
if (entry.kind === "fixed") lines.push({ kind: "fixed" });
|
|
350
|
+
else if (entry.label !== entry.place) lines.push({ kind: "place" });
|
|
501
351
|
if (status) lines.push({ kind: "avail" });
|
|
502
352
|
if (sun) lines.push({ kind: "sun" });
|
|
503
353
|
const lh = 23;
|
|
@@ -509,21 +359,33 @@ function drawRow(svg, entry, index, parsed, now, rowTop, rowH, geom, col) {
|
|
|
509
359
|
g.append("text").attr("x", textX).attr("y", yy).attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", 14).attr("font-weight", 500).text(ellipsize(entry.place, 14, textMax));
|
|
510
360
|
} else if (ln.kind === "avail" && status) {
|
|
511
361
|
const stCol = status.cls === "ok" ? sw.ok : status.cls === "soon" ? sw.soon : sw.off;
|
|
512
|
-
|
|
513
|
-
if (status.cls === "off")
|
|
514
|
-
dot.attr("fill", "none").attr("stroke", stCol).attr("stroke-width", 1.6);
|
|
515
|
-
else dot.attr("fill", stCol).attr("stroke", "none");
|
|
362
|
+
drawStatusClock(g, iconX, yy - 5, 5, stCol);
|
|
516
363
|
g.append("text").attr("data-dgmo-clock-status", "").attr("x", textX).attr("y", yy).attr("fill", stCol).attr("font-family", FONT_FAMILY).attr("font-size", 14).attr("font-weight", 600).text(ellipsize(status.text, 14, textMax));
|
|
517
364
|
} else if (ln.kind === "sun" && sun) {
|
|
518
365
|
drawSunMoon(g, iconX, yy - 5, up, sw, 1.25);
|
|
519
366
|
g.append("text").attr("data-dgmo-clock-sun-line", "").attr("x", textX).attr("y", yy).attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", 13.5).text(ellipsize(sun.text, 13.5, textMax));
|
|
367
|
+
} else if (ln.kind === "fixed") {
|
|
368
|
+
drawFixedGlyph(g, iconX, yy - 5, muted);
|
|
369
|
+
g.append("text").attr("x", textX).attr("y", yy).attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", 13.5).text(ellipsize(`${entry.place} \xB7 no DST`, 13.5, textMax));
|
|
520
370
|
}
|
|
521
371
|
});
|
|
522
372
|
}
|
|
373
|
+
function drawFixedGlyph(parent, cx, cy, color) {
|
|
374
|
+
const g = parent.append("g").attr("transform", `translate(${cx},${cy})`);
|
|
375
|
+
for (let k = 0; k < 3; k++) {
|
|
376
|
+
const a = k * 60 * Math.PI / 180;
|
|
377
|
+
g.append("line").attr("x1", -4 * Math.cos(a)).attr("y1", -4 * Math.sin(a)).attr("x2", 4 * Math.cos(a)).attr("y2", 4 * Math.sin(a)).attr("stroke", color).attr("stroke-width", 1.2).attr("stroke-linecap", "round");
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
function drawStatusClock(parent, cx, cy, r, color) {
|
|
381
|
+
parent.append("circle").attr("data-dgmo-clock-status-icon", "").attr("cx", cx).attr("cy", cy).attr("r", r).attr("fill", color);
|
|
382
|
+
}
|
|
523
383
|
function bakeAnchors(g, entry, parsed, sun, sw) {
|
|
524
384
|
g.attr("data-dgmo-clock", "").attr("data-dgmo-clock-zone", entry.zone).attr("data-dgmo-clock-face", parsed.face).attr("data-dgmo-clock-hours12", parsed.hours12 ? "1" : "0").attr("data-dgmo-clock-sun", sun ? "1" : "0").attr("data-dgmo-clock-c-day", sw.day).attr("data-dgmo-clock-c-night", sw.night).attr("data-dgmo-clock-c-day-soft", sw.dayTint).attr("data-dgmo-clock-c-night-soft", sw.nightTint).attr("data-dgmo-clock-c-ok", sw.ok).attr("data-dgmo-clock-c-soon", sw.soon).attr("data-dgmo-clock-c-off", sw.off).attr("data-dgmo-clock-c-ok-soft", sw.okSoft).attr("data-dgmo-clock-c-soon-soft", sw.soonSoft).attr("data-dgmo-clock-c-off-soft", sw.offSoft);
|
|
525
385
|
if (entry.lat !== null) g.attr("data-dgmo-clock-lat", entry.lat);
|
|
526
386
|
if (entry.lon !== null) g.attr("data-dgmo-clock-lon", entry.lon);
|
|
387
|
+
if (entry.kind === "fixed")
|
|
388
|
+
g.attr("data-dgmo-clock-fixed-offset", entry.fixedOffsetMin ?? 0);
|
|
527
389
|
if (parsed.work) {
|
|
528
390
|
g.attr("data-dgmo-clock-work-start", parsed.work.startMin).attr("data-dgmo-clock-work-end", parsed.work.endMin).attr(
|
|
529
391
|
"data-dgmo-clock-work-days",
|
|
@@ -538,10 +400,12 @@ function drawColumns(body, parsed, now, top, geom, col) {
|
|
|
538
400
|
const colW = (width - 2 * cardM) / n;
|
|
539
401
|
const tints = [];
|
|
540
402
|
let maxBottom = top;
|
|
403
|
+
const deferred = [];
|
|
404
|
+
let detailTop = top;
|
|
541
405
|
parsed.entries.forEach((entry, i) => {
|
|
542
406
|
const x0 = cardM + i * colW;
|
|
543
407
|
const cx = x0 + colW / 2;
|
|
544
|
-
const parts =
|
|
408
|
+
const parts = partsFor(entry, now);
|
|
545
409
|
const hasCoords = entry.lat !== null && entry.lon !== null;
|
|
546
410
|
const sun = parsed.sun && hasCoords ? sunLine(now, entry.lat, entry.lon) : null;
|
|
547
411
|
const up = sun ? sun.up : parts.h >= 6 && parts.h < 18;
|
|
@@ -562,22 +426,26 @@ function drawColumns(body, parsed, now, top, geom, col) {
|
|
|
562
426
|
palette: col.palette,
|
|
563
427
|
cardFill
|
|
564
428
|
});
|
|
429
|
+
const fm = zoneFillMode(entry, parsed, col);
|
|
565
430
|
const timeColor = auto?.solid ?? text;
|
|
566
|
-
const faceFill = auto ? mix(auto.solid, cardFill, 20) : stTint;
|
|
431
|
+
const faceFill = auto && fm === "outline" ? col.baseBg : auto && fm === "solid" ? auto.solid : auto ? mix(auto.solid, cardFill, 20) : stTint;
|
|
567
432
|
const ringColor = auto?.solid ?? line2;
|
|
568
|
-
const
|
|
433
|
+
const handInk = auto && fm === "solid" ? contrastText(
|
|
434
|
+
auto.solid,
|
|
435
|
+
col.palette.textOnFillLight,
|
|
436
|
+
col.palette.textOnFillDark
|
|
437
|
+
) : text;
|
|
438
|
+
const accentColor = auto && fm === "solid" ? handInk : auto?.solid ?? stColor;
|
|
439
|
+
const g = body.append("g").attr("data-line-number", entry.lineNumber);
|
|
440
|
+
bakeAnchors(g, entry, parsed, sun, sw);
|
|
569
441
|
if (auto)
|
|
570
442
|
tints.push(
|
|
571
|
-
|
|
443
|
+
g.append("rect").attr("data-dgmo-clock-lane", "").attr("x", x0).attr("y", top).attr("width", colW).attr("fill", fm === "outline" ? col.baseBg : auto.laneTint)
|
|
572
444
|
);
|
|
573
|
-
const g = body.append("g").attr("data-line-number", entry.lineNumber);
|
|
574
|
-
bakeAnchors(g, entry, parsed, sun, sw);
|
|
575
445
|
if (auto) {
|
|
576
|
-
g.attr("data-dgmo-clock-auto-solid", auto.solid).attr(
|
|
577
|
-
"data-dgmo-clock-auto-face",
|
|
578
|
-
faceFill
|
|
579
|
-
);
|
|
446
|
+
g.attr("data-dgmo-clock-auto-solid", auto.solid).attr("data-dgmo-clock-auto-face", faceFill).attr("data-dgmo-clock-auto-mode", parsed.colorBy).attr("data-dgmo-clock-cardfill", cardFill);
|
|
580
447
|
}
|
|
448
|
+
if (fm) g.attr("data-dgmo-clock-fill-mode", fm);
|
|
581
449
|
let cy = top + (parsed.face === "analog" ? 22 : 36);
|
|
582
450
|
const innerW = colW - 16;
|
|
583
451
|
if (parsed.face === "analog") {
|
|
@@ -593,24 +461,26 @@ function drawColumns(body, parsed, now, top, geom, col) {
|
|
|
593
461
|
fg.append("line").attr("x1", 50 + 39 * Math.sin(a)).attr("y1", 50 - 39 * Math.cos(a)).attr("x2", 50 + 46 * Math.sin(a)).attr("y2", 50 - 46 * Math.cos(a)).attr("stroke", tick).attr("stroke-width", 1.8);
|
|
594
462
|
}
|
|
595
463
|
const ang = handAngles(parts.h, parts.m, parts.s);
|
|
596
|
-
fg.append("line").attr("data-dgmo-clock-hand", "h").attr("x1", 50).attr("y1", 50).attr("x2", 50).attr("y2", 28).attr("stroke",
|
|
597
|
-
fg.append("line").attr("data-dgmo-clock-hand", "m").attr("x1", 50).attr("y1", 50).attr("x2", 50).attr("y2", 17).attr("stroke",
|
|
464
|
+
fg.append("line").attr("data-dgmo-clock-hand", "h").attr("x1", 50).attr("y1", 50).attr("x2", 50).attr("y2", 28).attr("stroke", handInk).attr("stroke-width", 4).attr("stroke-linecap", "round").attr("transform", `rotate(${ang.hour} 50 50)`);
|
|
465
|
+
fg.append("line").attr("data-dgmo-clock-hand", "m").attr("x1", 50).attr("y1", 50).attr("x2", 50).attr("y2", 17).attr("stroke", handInk).attr("stroke-width", 2.6).attr("stroke-linecap", "round").attr("transform", `rotate(${ang.minute} 50 50)`);
|
|
598
466
|
fg.append("line").attr("data-dgmo-clock-hand", "s").attr("x1", 50).attr("y1", 55).attr("x2", 50).attr("y2", 14).attr("stroke", accentColor).attr("stroke-width", 1.3).attr("stroke-linecap", "round").attr("transform", `rotate(${ang.second} 50 50)`);
|
|
599
467
|
fg.append("circle").attr("data-dgmo-clock-center", "").attr("cx", 50).attr("cy", 50).attr("r", 2.6).attr("fill", accentColor);
|
|
600
468
|
cy += size + 6;
|
|
601
469
|
} else {
|
|
602
|
-
const sf =
|
|
603
|
-
const
|
|
470
|
+
const sf = 22;
|
|
471
|
+
const gap = 11;
|
|
472
|
+
const cap = 0.7;
|
|
473
|
+
const tf = fitFont(ts.main, 54, innerW - 30 - gap, 20);
|
|
604
474
|
const mainW = [...ts.main].reduce(
|
|
605
475
|
(w, c) => w + tf * (c === ":" ? 0.334 : 0.6),
|
|
606
476
|
0
|
|
607
477
|
);
|
|
608
478
|
const stackW = Math.max(estWidth(`:${ts.sec}`, sf), estWidth(ts.ap, sf));
|
|
609
|
-
const gLeft = cx - (mainW +
|
|
479
|
+
const gLeft = cx - (mainW + gap + stackW) / 2;
|
|
610
480
|
const baseY = cy + tf * 0.34;
|
|
611
481
|
g.append("text").attr("data-dgmo-clock-digital", "").attr("data-dgmo-clock-digital-part", "main").attr("x", gLeft).attr("y", baseY).attr("fill", timeColor).attr("font-family", FONT_FAMILY).attr("font-size", tf).attr("font-weight", 600).attr("textLength", mainW).attr("lengthAdjust", "spacing").style("font-variant-numeric", "tabular-nums").text(ts.main);
|
|
612
|
-
const stackX = gLeft + mainW +
|
|
613
|
-
g.append("text").attr("data-dgmo-clock-digital-part", "sec").attr("x", stackX).attr("y", baseY - tf *
|
|
482
|
+
const stackX = gLeft + mainW + gap;
|
|
483
|
+
g.append("text").attr("data-dgmo-clock-digital-part", "sec").attr("x", stackX).attr("y", baseY - tf * cap + sf * cap).attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", sf).attr("font-weight", 500).text(`:${ts.sec}`);
|
|
614
484
|
if (ts.ap)
|
|
615
485
|
g.append("text").attr("data-dgmo-clock-digital-part", "ap").attr("x", stackX).attr("y", baseY).attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", sf).attr("font-weight", 500).text(ts.ap);
|
|
616
486
|
cy += tf + 8;
|
|
@@ -635,34 +505,49 @@ function drawColumns(body, parsed, now, top, geom, col) {
|
|
|
635
505
|
);
|
|
636
506
|
cy += alines.length * alh + 12;
|
|
637
507
|
const kinds = [];
|
|
638
|
-
if (entry.
|
|
508
|
+
if (entry.kind === "fixed") kinds.push("fixed");
|
|
509
|
+
else if (entry.label !== entry.place) kinds.push("place");
|
|
639
510
|
if (status) kinds.push("avail");
|
|
640
511
|
if (sun) kinds.push("sun");
|
|
641
512
|
const iconX = x0 + 16;
|
|
642
513
|
const textX = x0 + 28;
|
|
643
514
|
const tmax = colW - 40;
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
515
|
+
deferred.push({
|
|
516
|
+
kinds: kinds.length,
|
|
517
|
+
draw: (startY) => {
|
|
518
|
+
kinds.forEach((kind, j) => {
|
|
519
|
+
const yy = startY + j * 20;
|
|
520
|
+
if (kind === "place") {
|
|
521
|
+
g.append("path").attr("transform", `translate(${iconX},${yy - 4})`).attr("d", "M0,4 L-2.3,-0.6 A2.6,2.6 0 1 1 2.3,-0.6 Z").attr("fill", muted);
|
|
522
|
+
g.append("text").attr("x", textX).attr("y", yy).attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", 12).text(ellipsize(entry.place, 12, tmax));
|
|
523
|
+
} else if (kind === "avail" && status) {
|
|
524
|
+
const stCol = status.cls === "ok" ? sw.ok : status.cls === "soon" ? sw.soon : sw.off;
|
|
525
|
+
drawStatusClock(g, iconX, yy - 4, 4, stCol);
|
|
526
|
+
g.append("text").attr("data-dgmo-clock-status", "").attr("x", textX).attr("y", yy).attr("fill", stCol).attr("font-family", FONT_FAMILY).attr("font-size", 12).attr("font-weight", 600).text(ellipsize(status.text, 12, tmax));
|
|
527
|
+
} else if (kind === "sun" && sun) {
|
|
528
|
+
drawSunMoon(g, iconX, yy - 4, up, sw, 1);
|
|
529
|
+
g.append("text").attr("data-dgmo-clock-sun-line", "").attr("x", textX).attr("y", yy).attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", 11.5).text(ellipsize(sun.text, 11.5, tmax));
|
|
530
|
+
} else if (kind === "fixed") {
|
|
531
|
+
drawFixedGlyph(g, iconX, yy - 4, muted);
|
|
532
|
+
g.append("text").attr("x", textX).attr("y", yy).attr("fill", muted).attr("font-family", FONT_FAMILY).attr("font-size", 11.5).text(ellipsize(`${entry.place} \xB7 no DST`, 11.5, tmax));
|
|
533
|
+
}
|
|
534
|
+
});
|
|
659
535
|
}
|
|
660
536
|
});
|
|
661
|
-
|
|
537
|
+
if (cy > detailTop) detailTop = cy;
|
|
538
|
+
});
|
|
539
|
+
deferred.forEach((d) => {
|
|
540
|
+
d.draw(detailTop);
|
|
541
|
+
const bottom = d.kinds ? detailTop + (d.kinds - 1) * 20 + 8 : detailTop;
|
|
662
542
|
if (bottom > maxBottom) maxBottom = bottom;
|
|
663
543
|
});
|
|
664
544
|
const colBodyH = maxBottom - top + 14;
|
|
665
545
|
tints.forEach((r) => r.attr("height", colBodyH));
|
|
546
|
+
const dividerColor = mix(col.palette.text, col.palette.bg, 40);
|
|
547
|
+
for (let i = 1; i < n; i++) {
|
|
548
|
+
const x = cardM + i * colW;
|
|
549
|
+
body.append("line").attr("data-dgmo-clock-col-divider", "").attr("x1", x).attr("x2", x).attr("y1", top).attr("y2", top + colBodyH).attr("stroke", dividerColor).attr("stroke-width", 1);
|
|
550
|
+
}
|
|
666
551
|
return top + colBodyH + cardM;
|
|
667
552
|
}
|
|
668
553
|
function renderClockForExport(container, parsed, palette, isDark, exportDims) {
|
|
@@ -670,12 +555,7 @@ function renderClockForExport(container, parsed, palette, isDark, exportDims) {
|
|
|
670
555
|
}
|
|
671
556
|
|
|
672
557
|
export {
|
|
673
|
-
zoneParts,
|
|
674
|
-
formatTime,
|
|
675
|
-
workStatus,
|
|
676
|
-
sunLine,
|
|
677
|
-
handAngles,
|
|
678
558
|
renderClock,
|
|
679
559
|
renderClockForExport
|
|
680
560
|
};
|
|
681
|
-
//# sourceMappingURL=chunk-
|
|
561
|
+
//# sourceMappingURL=chunk-5223KXFD.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mix
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WBM7ZNDI.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveTagColor,
|
|
6
6
|
tagAttrKey
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HHKO6SKY.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveColor
|
|
10
10
|
} from "./chunk-TLVIHFRO.js";
|
|
@@ -164,4 +164,4 @@ export {
|
|
|
164
164
|
formatPct,
|
|
165
165
|
buildLegend
|
|
166
166
|
};
|
|
167
|
-
//# sourceMappingURL=chunk-
|
|
167
|
+
//# sourceMappingURL=chunk-5BHJZH62.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-6KFWC4CO.js";
|
|
9
9
|
import {
|
|
10
10
|
getSeriesColors
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WBM7ZNDI.js";
|
|
12
12
|
import {
|
|
13
13
|
resolveColor
|
|
14
14
|
} from "./chunk-TLVIHFRO.js";
|
|
@@ -399,4 +399,4 @@ export {
|
|
|
399
399
|
renderVersionControl,
|
|
400
400
|
renderVersionControlForExport
|
|
401
401
|
};
|
|
402
|
-
//# sourceMappingURL=chunk-
|
|
402
|
+
//# sourceMappingURL=chunk-5HILBT7X.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MAP_DIRECTIVE_KEY_SET
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FQ7HTV52.js";
|
|
4
4
|
import {
|
|
5
5
|
AUTO_TAG_COLOR_SENTINEL,
|
|
6
6
|
finalizeAutoTagColors,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
stripDefaultModifier,
|
|
9
9
|
tagAttrKey,
|
|
10
10
|
validateTagGroupNames
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HHKO6SKY.js";
|
|
12
12
|
import {
|
|
13
13
|
parseInArrowLabel
|
|
14
14
|
} from "./chunk-FFUN5D66.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
peelRampColors,
|
|
20
20
|
splitNameAndMeta,
|
|
21
21
|
withTagAliases
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-BRENJ2BQ.js";
|
|
23
23
|
import {
|
|
24
24
|
formatDgmoError,
|
|
25
25
|
makeDgmoError
|
|
@@ -299,6 +299,17 @@ function parseMap(content, palette) {
|
|
|
299
299
|
case "no-cluster-pois":
|
|
300
300
|
d.noClusterPois = true;
|
|
301
301
|
break;
|
|
302
|
+
// ── Clock channel (BL-122). Activation is the per-POI `clock` flag (see
|
|
303
|
+
// handlePoi); `hours`/`days` are the global availability window, stored
|
|
304
|
+
// raw and parsed at resolve. ──
|
|
305
|
+
case "hours":
|
|
306
|
+
dup(d.clockHours);
|
|
307
|
+
d.clockHours = value;
|
|
308
|
+
break;
|
|
309
|
+
case "days":
|
|
310
|
+
dup(d.clockDays);
|
|
311
|
+
d.clockDays = value;
|
|
312
|
+
break;
|
|
302
313
|
}
|
|
303
314
|
}
|
|
304
315
|
function handleTag(trimmed, line) {
|
|
@@ -386,6 +397,17 @@ function parseMap(content, palette) {
|
|
|
386
397
|
line,
|
|
387
398
|
"Coordinates are positional, not `at:` \u2014 write `poi <lat> <lon>`."
|
|
388
399
|
);
|
|
400
|
+
let clockFlag = false;
|
|
401
|
+
rest = rest.replace(/(?<=^|[\s,])clock(?=[\s,]|$)/, () => {
|
|
402
|
+
clockFlag = true;
|
|
403
|
+
return "";
|
|
404
|
+
});
|
|
405
|
+
if (clockFlag) {
|
|
406
|
+
const colon = rest.indexOf(":");
|
|
407
|
+
if (colon >= 0)
|
|
408
|
+
rest = rest.slice(0, colon).replace(/,/g, " ") + rest.slice(colon);
|
|
409
|
+
rest = rest.replace(/^[\s,]+|[\s,]+$/g, "").replace(/\s{2,}/g, " ").trim();
|
|
410
|
+
}
|
|
389
411
|
const split = splitNameAndMeta(
|
|
390
412
|
rest,
|
|
391
413
|
registry(),
|
|
@@ -401,6 +423,7 @@ function parseMap(content, palette) {
|
|
|
401
423
|
const label = meta["label"];
|
|
402
424
|
if (label !== void 0) delete meta["label"];
|
|
403
425
|
const poi = { pos, tags, meta, lineNumber: line };
|
|
426
|
+
if (clockFlag || meta["clock"] !== void 0) poi.clock = true;
|
|
404
427
|
if (split.alias) poi.alias = split.alias;
|
|
405
428
|
if (label !== void 0) poi.label = label;
|
|
406
429
|
if (split.color) poi.color = split.color;
|
|
@@ -610,4 +633,4 @@ export {
|
|
|
610
633
|
looksLikeMap,
|
|
611
634
|
parseMap
|
|
612
635
|
};
|
|
613
|
-
//# sourceMappingURL=chunk-
|
|
636
|
+
//# sourceMappingURL=chunk-5NGAO4QK.js.map
|