egatari 0.6.13 → 0.6.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -1
- package/README.ja.md +46 -46
- package/bin/egatari.mjs +6 -6
- package/components.lock.json +507 -153
- package/components2.lock.json +1710 -33
- package/kit/build.mjs +3 -1
- package/kit/check-messages.mjs +23 -8
- package/kit/check.mjs +27 -15
- package/kit/core/article-messages.mjs +4 -4
- package/kit/core/article-render.mjs +1 -1
- package/kit/core/article-text.mjs +3 -1
- package/kit/core/build-core.mjs +28 -6
- package/kit/core/check-parity.mjs +3 -1
- package/kit/core/check-rules.mjs +6 -4
- package/kit/core/colab-core.mjs +3 -3
- package/kit/core/comment-core.mjs +6 -0
- package/kit/core/image-size.mjs +35 -0
- package/kit/core/layout-scan.mjs +89 -2
- package/kit/core/llm-fix.mjs +39 -6
- package/kit/core/llm-pack-assemble.mjs +5 -2
- package/kit/core/llm-pack-data.mjs +269 -83
- package/kit/core/llm-pack.mjs +3 -3
- package/kit/core/new-deck.mjs +17 -3
- package/kit/core/part-labels.mjs +9 -3
- package/kit/core/parts2.mjs +1 -1
- package/kit/core/player.mjs +18 -0
- package/kit/core/portable.mjs +44 -4
- package/kit/core/purposes.mjs +6 -3
- package/kit/core/readable-parts.mjs +42 -0
- package/kit/core/themes-lock.mjs +1 -1
- package/kit/core/tier-a.mjs +14 -2
- package/kit/deck.js +49 -2
- package/kit/instruction-version.json +1 -1
- package/kit/live.js +6 -6
- package/kit/player.json +1 -1
- package/kit/player.lock.json +2 -2
- package/kit/presenter.js +3 -1
- package/kit/readable-parts.mjs +25 -0
- package/kit/tools.js +11 -4
- package/package.json +4 -2
- package/server/dev.mjs +7 -6
- package/server/editor-ui.js +9 -4
- package/server/hints.js +22 -2
- package/tts/yomi.yaml +1 -1
- package/vendor/components/CATALOG.md +21 -14
- package/vendor/components/sha256/000cc8b85d22854d93587d53fe07585e0d9f0abee86d863c5ed1f6c53967912b/README.en.md +40 -0
- package/vendor/components/sha256/000cc8b85d22854d93587d53fe07585e0d9f0abee86d863c5ed1f6c53967912b/index.js +408 -0
- package/vendor/components/sha256/0396a1895978803ae342b7f598f187b17ead47800e8f8317a5cb041111349813/index.js +278 -0
- package/vendor/components/sha256/07b8bfd9240585ee76082632c6f9483017d46ad3c74e509e715c27294970606c/README.en.md +26 -0
- package/vendor/components/sha256/07b8bfd9240585ee76082632c6f9483017d46ad3c74e509e715c27294970606c/index.js +322 -0
- package/vendor/components/sha256/08778858e2fb42765077b50e08f848089b1d11ea394909a4f611557b94b3acf2/README.en.md +54 -0
- package/vendor/components/sha256/08778858e2fb42765077b50e08f848089b1d11ea394909a4f611557b94b3acf2/index.js +470 -0
- package/vendor/components/sha256/0a08eb254e59cb306adb32c940ffe54e88efa3c9b7ef05ee021c38995996e742/README.en.md +18 -0
- package/vendor/components/sha256/0a08eb254e59cb306adb32c940ffe54e88efa3c9b7ef05ee021c38995996e742/index.js +279 -0
- package/vendor/components/sha256/1001b3cfcd3fbc34370accbb37aa550c8cadbb54bf8e8155d417219de3797be9/README.en.md +31 -0
- package/vendor/components/sha256/1001b3cfcd3fbc34370accbb37aa550c8cadbb54bf8e8155d417219de3797be9/index.js +267 -0
- package/vendor/components/sha256/109c302247e0c62720872be35392a73bea72804b0ed421ef8ced3f030f72e537/README.en.md +53 -0
- package/vendor/components/sha256/109c302247e0c62720872be35392a73bea72804b0ed421ef8ced3f030f72e537/index.js +171 -0
- package/vendor/components/sha256/1117758820dc561f41cf9d1cc0bab8cf3173cde7771ac10a12b94c96007c0f55/index.js +268 -0
- package/vendor/components/sha256/137017ad452afe209bdff81bc02ffae99c6b60a1c4aed2383515974f65511ff2/index.js +205 -0
- package/vendor/components/sha256/1a1471ba5f68e54304825a64e736afeda421e3763cdcbcdab2e45509562a0291/index.js +607 -0
- package/vendor/components/sha256/1b15fcc12b2fa43821e6299e87aae31aa69dbbc5a0d1b80088a5d7c5f8b8f7f5/index.js +429 -0
- package/vendor/components/sha256/1cc1732d052e58f7913ee50c0fc834d896db6b00ba779164de11b442347863db/README.en.md +23 -0
- package/vendor/components/sha256/1cc1732d052e58f7913ee50c0fc834d896db6b00ba779164de11b442347863db/index.js +147 -0
- package/vendor/components/sha256/21c099461befc0d382ddfe982f2a6cd8eeb6dd731252164ac619525e4bacdf0d/index.js +242 -0
- package/vendor/components/sha256/2352e0e22460f4a3c46dca6cef27cd9c63f161a411f1cf56c75c585e9124503c/index.js +315 -0
- package/vendor/components/sha256/2564dd8096be4cb3ba43703dc76029c1ba3965b831e430597c754865df4b67f4/README.en.md +53 -0
- package/vendor/components/sha256/2564dd8096be4cb3ba43703dc76029c1ba3965b831e430597c754865df4b67f4/index.js +171 -0
- package/vendor/components/sha256/2bae0f89ba91574c6ffb654e246365acd9aaf16a7aae92d95e1bad045671fbd2/README.en.md +38 -0
- package/vendor/components/sha256/2bae0f89ba91574c6ffb654e246365acd9aaf16a7aae92d95e1bad045671fbd2/index.js +414 -0
- package/vendor/components/sha256/2c68c355d60fdc879728c39245b7cf964b193628b63e9ab87df09c6bc2bfa7d3/README.en.md +45 -0
- package/vendor/components/sha256/2c68c355d60fdc879728c39245b7cf964b193628b63e9ab87df09c6bc2bfa7d3/index.js +211 -0
- package/vendor/components/sha256/2f111b900898579b3ec1611c2110db336a46d9133171a0cbb125ee37bd1f24f8/index.js +592 -0
- package/vendor/components/sha256/2fd81df4107ecb28c0dcecfdb3fd8fb9a474b5a7e0aeb16d8c0c6b1275c3a178/README.en.md +45 -0
- package/vendor/components/sha256/2fd81df4107ecb28c0dcecfdb3fd8fb9a474b5a7e0aeb16d8c0c6b1275c3a178/index.js +211 -0
- package/vendor/components/sha256/337febae1374670413653c453feee7cec169892e130248617c6642a91678564e/README.en.md +20 -0
- package/vendor/components/sha256/337febae1374670413653c453feee7cec169892e130248617c6642a91678564e/index.js +310 -0
- package/vendor/components/sha256/38f6385118112c679b520909d677935176e0c7aa2183a877324eeb5108606eae/README.en.md +35 -0
- package/vendor/components/sha256/38f6385118112c679b520909d677935176e0c7aa2183a877324eeb5108606eae/index.js +179 -0
- package/vendor/components/sha256/3af0b84b1799fc64ec74d6da9cbd343eccd89e8a11c81bfb444562c911284442/index.js +342 -0
- package/vendor/components/sha256/3c69bf3b3c6b9f76048fbc0839b3aa9699723570086d3d44bac799230ed6de5b/index.js +121 -0
- package/vendor/components/sha256/3f2f66da34496213cf6140ae041122c31f13c77e5ee18ad11a3390fbc4a6ecca/README.en.md +37 -0
- package/vendor/components/sha256/3f2f66da34496213cf6140ae041122c31f13c77e5ee18ad11a3390fbc4a6ecca/index.js +501 -0
- package/vendor/components/sha256/41b82d13037c4597e560cf2b3adebea4495ebb4711a8bb82b1a84495839b8fc8/README.en.md +38 -0
- package/vendor/components/sha256/41b82d13037c4597e560cf2b3adebea4495ebb4711a8bb82b1a84495839b8fc8/index.js +414 -0
- package/vendor/components/sha256/4220949efd68ff86e73ee6a0920b9f5b53f445cfcd657db72ecb2b55da1cc019/README.en.md +30 -0
- package/vendor/components/sha256/4220949efd68ff86e73ee6a0920b9f5b53f445cfcd657db72ecb2b55da1cc019/index.js +305 -0
- package/vendor/components/sha256/47f7ea3e2551abb250a9f5883716791026f0f54ae9cca6d82fabdb92478c69ae/README.en.md +31 -0
- package/vendor/components/sha256/47f7ea3e2551abb250a9f5883716791026f0f54ae9cca6d82fabdb92478c69ae/index.js +236 -0
- package/vendor/components/sha256/4b515bfb3a39a6c1e2b04f235affc5bc84e74d80bfd7f9e6d9b5d84d0a9eeb57/README.en.md +21 -0
- package/vendor/components/sha256/4b515bfb3a39a6c1e2b04f235affc5bc84e74d80bfd7f9e6d9b5d84d0a9eeb57/index.js +108 -0
- package/vendor/components/sha256/4e7ba7759ddebfa5432b733e5f10abfd336ef7d6cc4d46305d5ff7d00ed3a423/README.en.md +28 -0
- package/vendor/components/sha256/4e7ba7759ddebfa5432b733e5f10abfd336ef7d6cc4d46305d5ff7d00ed3a423/index.js +213 -0
- package/vendor/components/sha256/52149f061935e65502b8353cf70285bba93ab24451d2daac26b994d3901d3864/README.en.md +35 -0
- package/vendor/components/sha256/52149f061935e65502b8353cf70285bba93ab24451d2daac26b994d3901d3864/index.js +179 -0
- package/vendor/components/sha256/5644e63364f46ee53d5f8623355149753147cdc4720e4c66fc9b8a32627e68a5/README.en.md +53 -0
- package/vendor/components/sha256/5644e63364f46ee53d5f8623355149753147cdc4720e4c66fc9b8a32627e68a5/index.js +171 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/ABCJS-ADAPTER.md +101 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/LICENSE-abcjs.txt +21 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/chords.json +89 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/doremi.json +261 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/extras.json +192 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/kaeru.json +521 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/rhythm.json +248 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/fixtures/ties.json +360 -0
- package/vendor/components/sha256/5662bea8cc48f484ccf14c5a8ac12d64b2c5ab032a26176d133ed3a8eb33a557/index.js +508 -0
- package/vendor/components/sha256/59996a56df462b36e24a928d4397c9308d9e39ad8224ebd19fb5c981608ef458/index.js +521 -0
- package/vendor/components/sha256/5afcaf27e9209a32a8a8e6667b637ea434326b76f563689552716de953c94a98/README.en.md +30 -0
- package/vendor/components/sha256/5afcaf27e9209a32a8a8e6667b637ea434326b76f563689552716de953c94a98/index.js +305 -0
- package/vendor/components/sha256/5cf9baec12bac716d9218d6fbc4f95446adf31658da62564aa403bb5bdee542e/README.en.md +30 -0
- package/vendor/components/sha256/5cf9baec12bac716d9218d6fbc4f95446adf31658da62564aa403bb5bdee542e/index.js +192 -0
- package/vendor/components/sha256/5ffac218340cc51ce842a530f6021fc916090376b243e2ad5d4c0ef48a040ce9/README.en.md +20 -0
- package/vendor/components/sha256/5ffac218340cc51ce842a530f6021fc916090376b243e2ad5d4c0ef48a040ce9/index.js +307 -0
- package/vendor/components/sha256/6084fd3102b7d450db3804120ac27aa585ab44937734d980fb50c51f39fc98a7/README.en.md +24 -0
- package/vendor/components/sha256/6084fd3102b7d450db3804120ac27aa585ab44937734d980fb50c51f39fc98a7/index.js +554 -0
- package/vendor/components/sha256/60e3e41c34034e16f9f7ee9ce6c8d669ebb753614989fc2e5e181ef295e83631/README.en.md +25 -0
- package/vendor/components/sha256/60e3e41c34034e16f9f7ee9ce6c8d669ebb753614989fc2e5e181ef295e83631/index.js +316 -0
- package/vendor/components/sha256/6156a8a03235e1ed92d3cd3ba1f40df86667059003d82e47297bd3917ef562b8/README.en.md +18 -0
- package/vendor/components/sha256/6156a8a03235e1ed92d3cd3ba1f40df86667059003d82e47297bd3917ef562b8/index.js +279 -0
- package/vendor/components/sha256/624acb997c4975ace65570b529b3ba00baa421c80ecb7fc80f392a64e8c573a7/index.js +107 -0
- package/vendor/components/sha256/62602488ee33dd4bdef8516de16da5ab27d7f7265d5041681beab80e08f1d482/index.js +97 -0
- package/vendor/components/sha256/67eaf344bddac79b74ed03fdcd70285c7b52b160e6c5ffbd6897848179aa5230/index.js +818 -0
- package/vendor/components/sha256/682c9c8871eccd19ff1264e0323a2e4c5798b0488b612ba0339c6fe85aab5914/index.js +926 -0
- package/vendor/components/sha256/6937967bbf62098aca7cef99f14f97fa11c861a12da6a1d8fe5fa55a6b4551f2/README.en.md +51 -0
- package/vendor/components/sha256/6937967bbf62098aca7cef99f14f97fa11c861a12da6a1d8fe5fa55a6b4551f2/index.js +230 -0
- package/vendor/components/sha256/72138936ed0b8fd3cb0214ae7ed250ae3f1f8b21ed6fd593544947774064ba0d/index.js +250 -0
- package/vendor/components/sha256/74c1a0f3ed1370c5003aa5770ee28cea2ce994d415680116a92fdbcd5854ba62/index.js +198 -0
- package/vendor/components/sha256/76125035eb153b98befa9c735bcd9fc4f99f774dc1d082fdae40acaadfe7d95b/index.js +818 -0
- package/vendor/components/sha256/7728cf7dde88a6688aba0ed70f23f7e21362a147beac09c1fa1a4b773e08e93b/index.js +354 -0
- package/vendor/components/sha256/7822f137d446604a83c1dbc3b40fdb455001dc55da12276ff3e7079d270dd143/README.en.md +23 -0
- package/vendor/components/sha256/7822f137d446604a83c1dbc3b40fdb455001dc55da12276ff3e7079d270dd143/index.js +289 -0
- package/vendor/components/sha256/7c2b93508a09a5dd36639ab1329ca6d00487b326c53db436b14295174dc03369/README.en.md +31 -0
- package/vendor/components/sha256/7c2b93508a09a5dd36639ab1329ca6d00487b326c53db436b14295174dc03369/index.js +236 -0
- package/vendor/components/sha256/7d50e50fbb6c5ec636b62509bd88ddaac1870e0522cf11bcc293ce924d48072d/index.js +312 -0
- package/vendor/components/sha256/82ffee434e7f2213031190f832f3a75a8cdf59554fdbc092c0b079d6b0753cad/README.en.md +42 -0
- package/vendor/components/sha256/82ffee434e7f2213031190f832f3a75a8cdf59554fdbc092c0b079d6b0753cad/index.js +549 -0
- package/vendor/components/sha256/87fc302c41b2bfeea88951ed689ec01b4dc79218c4bc69b310dc2228dfa2e153/index.js +926 -0
- package/vendor/components/sha256/8886ccd82d68dc1bbf5b7ffcef746074ce8a3d26414d55691dc5e691e4976ded/README.en.md +24 -0
- package/vendor/components/sha256/8886ccd82d68dc1bbf5b7ffcef746074ce8a3d26414d55691dc5e691e4976ded/index.js +103 -0
- package/vendor/components/sha256/89c8c16788e24df17920542ed6eb6557dea4a10e835de8fe839e439ccbba8014/index.js +69 -0
- package/vendor/components/sha256/8beed7e471fa0d6b801b5c540f69ab77220e228c58ff16b0bc2b1a6eef30800e/README.en.md +44 -0
- package/vendor/components/sha256/8beed7e471fa0d6b801b5c540f69ab77220e228c58ff16b0bc2b1a6eef30800e/index.js +304 -0
- package/vendor/components/sha256/8d9af78aef44ad2f98101c67d32473373d39725a09c923969aa621d5f5b124bb/index.js +121 -0
- package/vendor/components/sha256/8f861d71df72a82be86a3e63abf7d69bbab5aac6fa68be6e077c4e19c3519ed8/index.js +312 -0
- package/vendor/components/sha256/90415da5ad04e1944258e29c929c5de65c8152c829414e911ba55a84ac89f348/README.en.md +54 -0
- package/vendor/components/sha256/90415da5ad04e1944258e29c929c5de65c8152c829414e911ba55a84ac89f348/index.js +470 -0
- package/vendor/components/sha256/91a1e0e48e20cac705cbe6e33e66a24a2851b1dc88c5164ed906bcecba4d943f/README.en.md +24 -0
- package/vendor/components/sha256/91a1e0e48e20cac705cbe6e33e66a24a2851b1dc88c5164ed906bcecba4d943f/index.js +214 -0
- package/vendor/components/sha256/91a9353a0c3b3744765944783aa1537b3f6ff1677c67caede643cdf2f52289cf/README.en.md +33 -0
- package/vendor/components/sha256/91a9353a0c3b3744765944783aa1537b3f6ff1677c67caede643cdf2f52289cf/index.js +390 -0
- package/vendor/components/sha256/9289efef4a75afe011e54a17e34db08cfb16a450b2e0653e6a98525495cfba99/index.js +315 -0
- package/vendor/components/sha256/93256a923199ea51108cdb7491c3c96f376dbef15b64cbf1a1aa7cc5726b4970/index.js +429 -0
- package/vendor/components/sha256/94f4891971b26f5bc157ef9f7f630b1528fc7e2a4c63e84e01951a5a3f94cedc/README.en.md +24 -0
- package/vendor/components/sha256/94f4891971b26f5bc157ef9f7f630b1528fc7e2a4c63e84e01951a5a3f94cedc/index.js +550 -0
- package/vendor/components/sha256/94f4f798fdd070fc1693494e772ff479d3e694a07a0c97b6e97c3b3895cad478/README.en.md +28 -0
- package/vendor/components/sha256/94f4f798fdd070fc1693494e772ff479d3e694a07a0c97b6e97c3b3895cad478/index.js +213 -0
- package/vendor/components/sha256/95583538da2982ec5f508217a8f2821796e6a34cf755baa66f2aaeb1c6dae814/README.en.md +40 -0
- package/vendor/components/sha256/95583538da2982ec5f508217a8f2821796e6a34cf755baa66f2aaeb1c6dae814/index.js +348 -0
- package/vendor/components/sha256/97c074a5473618c65f4c23263f056870a0b7940e73475f2a1f32f68c08d8eb0f/index.js +198 -0
- package/vendor/components/sha256/98e1957b1fac2d55d9bfa6a0990ead6a2730d571c988055ca280df05a0e9ea37/README.en.md +66 -0
- package/vendor/components/sha256/98e1957b1fac2d55d9bfa6a0990ead6a2730d571c988055ca280df05a0e9ea37/index.js +984 -0
- package/vendor/components/sha256/99a26795f8b351ade4a4cbbea845aeb149c96b09fe96151edda57128082185fa/README.en.md +34 -0
- package/vendor/components/sha256/99a26795f8b351ade4a4cbbea845aeb149c96b09fe96151edda57128082185fa/index.js +244 -0
- package/vendor/components/sha256/a18b2b15d00c76462a43823b5c270c7ddd7c31794da9c236f74f20f80ec2ffdb/index.js +354 -0
- package/vendor/components/sha256/a744049fc56e0a5d5b1638bef597a4e65f99d0776a35d830a389f216f314f1bc/README.en.md +32 -0
- package/vendor/components/sha256/a744049fc56e0a5d5b1638bef597a4e65f99d0776a35d830a389f216f314f1bc/index.js +222 -0
- package/vendor/components/sha256/a979207c60fbd2a12cb557297eb0217eb098d660de684530a0f43d0d9c64e6ef/index.js +312 -0
- package/vendor/components/sha256/aba898152e40ca44e1e7bea22242bd6897a31e0254cbfd70e426907b65379af2/README.en.md +34 -0
- package/vendor/components/sha256/aba898152e40ca44e1e7bea22242bd6897a31e0254cbfd70e426907b65379af2/index.js +244 -0
- package/vendor/components/sha256/af7ed69b8969f6da14784b6e9d26e4dfd20147772ea172a99bd936a71be10fcd/index.js +278 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/ABCJS-ADAPTER.md +101 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/LICENSE-abcjs.txt +21 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/chords.json +89 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/doremi.json +261 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/extras.json +192 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/kaeru.json +521 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/rhythm.json +248 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/fixtures/ties.json +360 -0
- package/vendor/components/sha256/b08a536a07498629c026f8fc2962acda791c83a99268ac715db5e764087000e2/index.js +508 -0
- package/vendor/components/sha256/b28d136dffb03a3e855b2ff959712a143da9a84c3a4fd13a1126d7711083a2d6/README.en.md +66 -0
- package/vendor/components/sha256/b28d136dffb03a3e855b2ff959712a143da9a84c3a4fd13a1126d7711083a2d6/index.js +990 -0
- package/vendor/components/sha256/b2d9c417f258745c56c04e05dc9463a412a4978d46c3ffff2556f0b0fafbbfc2/README.en.md +24 -0
- package/vendor/components/sha256/b2d9c417f258745c56c04e05dc9463a412a4978d46c3ffff2556f0b0fafbbfc2/index.js +550 -0
- package/vendor/components/sha256/b8096d7a60609520981273673761a110e40e3bdf52a7ab5548363b20e16f6e93/index.js +404 -0
- package/vendor/components/sha256/b9e27e84b2c534b87d6da5da30ee808d7863cbd1b818082b4c11d1f8b7129b1a/README.en.md +32 -0
- package/vendor/components/sha256/b9e27e84b2c534b87d6da5da30ee808d7863cbd1b818082b4c11d1f8b7129b1a/index.js +222 -0
- package/vendor/components/sha256/bd8e3893df02411deccc1d6d7b02292ca0d59dfeddfafcf99419430981572c82/index.js +351 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/ABCJS-ADAPTER.md +101 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/LICENSE-abcjs.txt +21 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/chords.json +89 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/doremi.json +261 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/extras.json +192 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/kaeru.json +521 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/rhythm.json +248 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/fixtures/ties.json +360 -0
- package/vendor/components/sha256/c201dbc3f1f790c59cc010b3be3566daa9085754614402e9dc1296dba9e87769/index.js +508 -0
- package/vendor/components/sha256/c5226220649a5854d56ceeaea16722fe54a79b4197f71c51c4e1523bf22bec32/README.en.md +31 -0
- package/vendor/components/sha256/c5226220649a5854d56ceeaea16722fe54a79b4197f71c51c4e1523bf22bec32/index.js +267 -0
- package/vendor/components/sha256/c691f9c83d06502bf20f86df02ee5a516063d6af1e9ee8204aad8fd8c1a44a71/LICENSE-strokesvg.txt +115 -0
- package/vendor/components/sha256/c691f9c83d06502bf20f86df02ee5a516063d6af1e9ee8204aad8fd8c1a44a71/OFL.txt +93 -0
- package/vendor/components/sha256/c691f9c83d06502bf20f86df02ee5a516063d6af1e9ee8204aad8fd8c1a44a71/index.js +749 -0
- package/vendor/components/sha256/c691f9c83d06502bf20f86df02ee5a516063d6af1e9ee8204aad8fd8c1a44a71/strokes-CHANGES.md +20 -0
- package/vendor/components/sha256/c791e69e722f64146242f97acb29a341160d0c327cfe1d76307954d80e70db85/index.js +268 -0
- package/vendor/components/sha256/c8c0de41d603b61c6ec4dc1da5b50559e213dd1f3693ee5019df858016fd6daf/index.js +747 -0
- package/vendor/components/sha256/c99d4f2ab443484b9f462e405c72ea4794838b88f8823f27c606d12cbbedb996/index.js +404 -0
- package/vendor/components/sha256/cbde046e30c35db60259911a88e2ae0bedaf545e29b1da8b8ce13bc602a33c19/index.js +465 -0
- package/vendor/components/sha256/ccdd16ed76838ac9d6abb4ee695769bfecb802ae490ac91914ed68131ad04434/README.en.md +51 -0
- package/vendor/components/sha256/ccdd16ed76838ac9d6abb4ee695769bfecb802ae490ac91914ed68131ad04434/index.js +228 -0
- package/vendor/components/sha256/ce0a52fa13ae579020d1172845647daee9ba78e070736e47740f2d2feabffe7e/README.en.md +35 -0
- package/vendor/components/sha256/ce0a52fa13ae579020d1172845647daee9ba78e070736e47740f2d2feabffe7e/index.js +179 -0
- package/vendor/components/sha256/cf0985ffcd8e7cbe2175ddb9a4342b2a4aa3f322794188fc99af8789b494460d/index.js +521 -0
- package/vendor/components/sha256/cff7ed8a0e0708bcef2e13105b28810bda867251a9f205ad9c2f1a5b4f759866/LICENSE-strokesvg.txt +115 -0
- package/vendor/components/sha256/cff7ed8a0e0708bcef2e13105b28810bda867251a9f205ad9c2f1a5b4f759866/OFL.txt +93 -0
- package/vendor/components/sha256/cff7ed8a0e0708bcef2e13105b28810bda867251a9f205ad9c2f1a5b4f759866/index.js +749 -0
- package/vendor/components/sha256/cff7ed8a0e0708bcef2e13105b28810bda867251a9f205ad9c2f1a5b4f759866/strokes-CHANGES.md +20 -0
- package/vendor/components/sha256/d01dc7fd78d08dd720ed86b39d7877dc0913d72e914036088a86af2df2faee52/index.js +484 -0
- package/vendor/components/sha256/d448fec2aeb436f187875c493b1592b373c6a18274ffc64231dbe3f1b54f8cbc/README.en.md +24 -0
- package/vendor/components/sha256/d448fec2aeb436f187875c493b1592b373c6a18274ffc64231dbe3f1b54f8cbc/index.js +214 -0
- package/vendor/components/sha256/d4aa3ffb394d5db7f47081b1818958547fe164bb968df03131f9400c103b97c4/README.en.md +31 -0
- package/vendor/components/sha256/d4aa3ffb394d5db7f47081b1818958547fe164bb968df03131f9400c103b97c4/index.js +271 -0
- package/vendor/components/sha256/d582d02ceeaf1ec4d94115b806852ddb66c009788e67728ae0e08cb8d29ca546/README.en.md +25 -0
- package/vendor/components/sha256/d582d02ceeaf1ec4d94115b806852ddb66c009788e67728ae0e08cb8d29ca546/index.js +316 -0
- package/vendor/components/sha256/d75ab2c8f6c01082bfcaeaba44290367d6b49654e2bf538422b7b3e499de9acf/README.en.md +23 -0
- package/vendor/components/sha256/d75ab2c8f6c01082bfcaeaba44290367d6b49654e2bf538422b7b3e499de9acf/index.js +120 -0
- package/vendor/components/sha256/d8f5272dac33066a04ecefa9a828ca11d18dec581866899f55433573ba4472d6/README.en.md +40 -0
- package/vendor/components/sha256/d8f5272dac33066a04ecefa9a828ca11d18dec581866899f55433573ba4472d6/index.js +405 -0
- package/vendor/components/sha256/dd1ff8de877573e30635928e9abce0b1fba8dfc95a079eca86703a884d3c3d59/README.en.md +66 -0
- package/vendor/components/sha256/dd1ff8de877573e30635928e9abce0b1fba8dfc95a079eca86703a884d3c3d59/index.js +984 -0
- package/vendor/components/sha256/ddd4b9cbbc282cbb3117ff662e1a14ecdb3cc7c16072a574418ec6a6eecef4d8/index.js +107 -0
- package/vendor/components/sha256/e24a4235a661bfda4049e1c72b6c376066fcc65e27a2bdfe77942a3394726c81/README.en.md +22 -0
- package/vendor/components/sha256/e24a4235a661bfda4049e1c72b6c376066fcc65e27a2bdfe77942a3394726c81/index.js +145 -0
- package/vendor/components/sha256/e2da948daac7bfac158857877b5a6932dbd2369e73901abcef118c92dd20b725/index.js +747 -0
- package/vendor/components/sha256/e40201a655bf5c556d70fbf45b5052dd48c33fc8030b331a9d9cbc96913d02a6/README.en.md +42 -0
- package/vendor/components/sha256/e40201a655bf5c556d70fbf45b5052dd48c33fc8030b331a9d9cbc96913d02a6/index.js +268 -0
- package/vendor/components/sha256/e653a4da80f7761442dc5b504ea5b0700fd0acf1979beeff56122cfdb3d4654c/index.js +607 -0
- package/vendor/components/sha256/ea217c6821e931b2d8474bf56d38f2dcc89ec705fe1d276f313e1c7e8db2b98a/index.js +233 -0
- package/vendor/components/sha256/ea2e4e24838574f607879c7d05556281258c018331e4da3e6f3a5263173f2e99/index.js +75 -0
- package/vendor/components/sha256/eb0b402dc4738b2dca2918c7f64a4d6fc3c27b4ba419270bbe8240a3c8a77f0c/README.en.md +42 -0
- package/vendor/components/sha256/eb0b402dc4738b2dca2918c7f64a4d6fc3c27b4ba419270bbe8240a3c8a77f0c/index.js +549 -0
- package/vendor/components/sha256/f219b47f32b0a78e8f8f5dac83596acfed24dd6e8bfe3f05f8ebfb9582d64485/README.en.md +44 -0
- package/vendor/components/sha256/f219b47f32b0a78e8f8f5dac83596acfed24dd6e8bfe3f05f8ebfb9582d64485/index.js +203 -0
- package/vendor/components/sha256/f4204773037ae296786e3614b5bfd7487b0f5ba6d5cf92ce20262bb7613e1b6b/README.en.md +34 -0
- package/vendor/components/sha256/f4204773037ae296786e3614b5bfd7487b0f5ba6d5cf92ce20262bb7613e1b6b/index.js +244 -0
- package/vendor/components/sha256/fa1a09c10181456143d125d68dbbdcacde6bab2e4a2b3e573367103ce28ebf55/index.js +228 -0
- package/vendor/components/sha256/fa9c9f63d74a514636961bcb8af75063e00e39bdf85655ecf5d4d7bbc05a831a/README.en.md +51 -0
- package/vendor/components/sha256/fa9c9f63d74a514636961bcb8af75063e00e39bdf85655ecf5d4d7bbc05a831a/index.js +228 -0
- package/vendor/components/sha256/facebe095849528396ee91d7d6856cb6945ba89ca8b1f34dce488dccb29e9d40/README.en.md +23 -0
- package/vendor/components/sha256/facebe095849528396ee91d7d6856cb6945ba89ca8b1f34dce488dccb29e9d40/index.js +147 -0
- package/vendor/components/sha256/fb0a77a344098c53cc90215685cee32b0d31362a1de5b5ac0eee422ed2c3c430/README.en.md +20 -0
- package/vendor/components/sha256/fb0a77a344098c53cc90215685cee32b0d31362a1de5b5ac0eee422ed2c3c430/index.js +307 -0
- package/vendor/components/sha256/fc48e703adab4715157f8dbb0e33c8b5c00099358ae522484290a7098fda2910/README.en.md +26 -0
- package/vendor/components/sha256/fc48e703adab4715157f8dbb0e33c8b5c00099358ae522484290a7098fda2910/index.js +322 -0
- package/vendor/components-2/manifest-2.12.0.json +2348 -0
- package/vendor/components-2/manifest-2.13.0.json +2477 -0
- package/vendor/components-2/manifest-2.14.0.json +2460 -0
- package/vendor/components-2/manifest-2.14.1.json +2460 -0
- package/vendor/components-2/manifest-2.15.0.json +2460 -0
- package/vendor/egatari-spec/SOURCE.json +3 -3
- package/vendor/egatari-spec/schema/deck-meta.schema.json +15 -0
- package/vendor/egatari-spec/schema/egatari-metadata.schema.json +15 -0
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
// m-particles:状態変化の粒子モデルと、化学変化で保存される原子のモデル。
|
|
2
|
+
egatariParts.define({name: "particles", version: "2.0.2", requires: {base: "1.2.0"}, element: "m-particles"}, function(deps){
|
|
3
|
+
"use strict";
|
|
4
|
+
var base = deps.base;
|
|
5
|
+
var STATES = ["solid", "liquid", "gas"];
|
|
6
|
+
var SHAPES = ["linear", "bent", "trigonal", "tetrahedral", "chain"];
|
|
7
|
+
var MOLECULE_SHAPES = {H2O: "bent", H2S: "bent", SO2: "bent", CO2: "linear", NH3: "trigonal", CH4: "tetrahedral"};
|
|
8
|
+
var TEXT = {
|
|
9
|
+
ja: {states: ["固体", "液体", "気体"], changes: {solidliquid: "融解", liquidgas: "沸騰", liquidsolid: "凝固", gasliquid: "凝縮", solidgas: "昇華", gassolid: "昇華"}, before: "反応前", apart: "原子に分かれる", after: "反応後", atoms: "原子の数:", invalid: "データを確認してください"},
|
|
10
|
+
en: {states: ["Solid", "Liquid", "Gas"], changes: {solidliquid: "melting", liquidgas: "boiling", liquidsolid: "freezing", gasliquid: "condensation", solidgas: "sublimation", gassolid: "sublimation"}, before: "Reactants", apart: "Separate atoms", after: "Products", atoms: "Atoms: ", invalid: "Check the data"}
|
|
11
|
+
};
|
|
12
|
+
var COLORS = ["series-1", "series-2", "series-3", "series-4", "term", "accent2"];
|
|
13
|
+
// 全体が読めたときだけ採用する。括弧・電荷・係数・0・不正な桁を黙って落とさない。
|
|
14
|
+
function parseFormula(s){
|
|
15
|
+
if (typeof s !== "string" || !/^(?:[A-Z][a-z]?(?:[1-9][0-9]*)?)+$/.test(s)) throw new Error("formula " + JSON.stringify(s) + ": use element symbols and positive integer counts (no parentheses or charges)");
|
|
16
|
+
var out = [], counts = Object.create(null), re = /([A-Z][a-z]?)([1-9][0-9]*)?/g, m;
|
|
17
|
+
while ((m = re.exec(s))){
|
|
18
|
+
var n = m[2] ? +m[2] : 1;
|
|
19
|
+
if (!Number.isSafeInteger(n) || n > 24 || out.length + n > 24) throw new Error("formula " + s + ": more than 24 atoms");
|
|
20
|
+
counts[m[1]] = (counts[m[1]] || 0) + n;
|
|
21
|
+
for (var i = 0; i < n; i++) out.push(m[1]);
|
|
22
|
+
}
|
|
23
|
+
return {atoms: out, counts: counts};
|
|
24
|
+
}
|
|
25
|
+
function formulaText(s){ return s.replace(/([0-9])/g, "_$1"); }
|
|
26
|
+
function unicodeFormula(s){ return s.replace(/[0-9]/g, function(n){ return "₀₁₂₃₄₅₆₇₈₉"[+n]; }); }
|
|
27
|
+
function equation(side, format){ return side.map(function(m){ return (m.n === 1 ? "" : m.n) + format(m.formula); }).join(" + "); }
|
|
28
|
+
function hash(i){
|
|
29
|
+
var n = Math.imul(i + 1, 2654435761); n ^= n >>> 16;
|
|
30
|
+
n = Math.imul(n, 2246822507); n ^= n >>> 13; n = Math.imul(n, 3266489909); n ^= n >>> 16;
|
|
31
|
+
return (n >>> 0) / 4294967296;
|
|
32
|
+
}
|
|
33
|
+
// 正方形に近い因数の組を選ぶ。素数や容器に収まる組がない場合は最終行を中央に置く。
|
|
34
|
+
function latticeColumns(n, aspect, maxCols){
|
|
35
|
+
var ideal = Math.sqrt(n * aspect), best = 0, error = Infinity;
|
|
36
|
+
for (var c = Math.ceil(Math.sqrt(n)); c <= Math.min(maxCols || n, n > 3 ? n / 2 : n); c++) if (n % c === 0){
|
|
37
|
+
var d = Math.abs(c - ideal); if (d < error){ best = c; error = d; }
|
|
38
|
+
}
|
|
39
|
+
return Math.max(1, best || Math.min(maxCols || n, Math.ceil(ideal))); // at least 1 column, also when the box is 0 wide
|
|
40
|
+
}
|
|
41
|
+
function segmentDistance(p, a, b){
|
|
42
|
+
var dx = b.x - a.x, dy = b.y - a.y, den = dx * dx + dy * dy;
|
|
43
|
+
var u = den ? Math.max(0, Math.min(1, ((p.x - a.x) * dx + (p.y - a.y) * dy) / den)) : 0;
|
|
44
|
+
return Math.hypot(p.x - a.x - u * dx, p.y - a.y - u * dy);
|
|
45
|
+
}
|
|
46
|
+
function set(e, a, v){ v = String(v); if (e.getAttribute(a) !== v) e.setAttribute(a, v); }
|
|
47
|
+
function text(e, s){ if (e.textContent !== s) e.textContent = s; }
|
|
48
|
+
var Part = class extends base.MotionElement {
|
|
49
|
+
static partName = "particles";
|
|
50
|
+
// 先の並び方・生成物を授業で予想させる(orbit と同じ扱い)。
|
|
51
|
+
static preview = "none";
|
|
52
|
+
static steps = 2;
|
|
53
|
+
static shape = {
|
|
54
|
+
schema: {type: "object", additionalProperties: false, properties: {
|
|
55
|
+
states: {type: "array", minItems: 1, items: {type: "string", enum: STATES}},
|
|
56
|
+
substance: {type: "string"},
|
|
57
|
+
labels: {type: ["array", "object"], items: {type: ["string", "null"]}, properties: {before: {type: "string"}, apart: {type: "string"}, after: {type: "string"}, atoms: {type: "string"}}, additionalProperties: false},
|
|
58
|
+
reactants: {type: "array", minItems: 1, maxItems: 24, items: {type: "object", required: ["formula", "n"], additionalProperties: false, properties: {formula: {type: "string"}, n: {type: "integer"}, shape: {type: "string", enum: SHAPES}}}},
|
|
59
|
+
products: {type: "array", minItems: 1, maxItems: 24, items: {type: "object", required: ["formula", "n"], additionalProperties: false, properties: {formula: {type: "string"}, n: {type: "integer"}, shape: {type: "string", enum: SHAPES}}}}
|
|
60
|
+
}},
|
|
61
|
+
example: {states: ["solid", "liquid", "gas"], substance: "水"}
|
|
62
|
+
};
|
|
63
|
+
static props = {
|
|
64
|
+
mode: {type: "string", default: "state", doc: "state(状態変化)か reaction(化学変化)"},
|
|
65
|
+
count: {type: "number", default: 16, doc: "状態変化で描く粒子の数(6〜30 の整数。数と大きさは一定)"},
|
|
66
|
+
size: {type: "number", default: 28, doc: "名前・式の字の大きさ(px。24 以上)"},
|
|
67
|
+
dur: {type: "number", default: 1.2, doc: "1 ステップの動きの秒数"},
|
|
68
|
+
volume: {type: "bool", default: false, doc: "状態に合わせて容器の幅を変える(気体は広い)"},
|
|
69
|
+
motion: {type: "bool", default: true, doc: "状態変化の粒子に静止した運動の印を付ける"}
|
|
70
|
+
};
|
|
71
|
+
get data(){
|
|
72
|
+
var d = super.data;
|
|
73
|
+
// JSON がない場合だけ既定値。JSON の null や不正な型は base の shape 検査へ渡す。
|
|
74
|
+
var hasJSON = [].some.call(this.children, function(c){ return c.localName === "script" && String(c.getAttribute("type") || "").trim().toLowerCase() === "application/json"; });
|
|
75
|
+
return d === null && !hasJSON ? {} : d;
|
|
76
|
+
}
|
|
77
|
+
get steps(){ return this.plan().reaction ? 3 : this.plan().states.length - 1; }
|
|
78
|
+
duration(k){ return k >= 1 && k <= this.steps ? (Number.isFinite(this.props.dur) && this.props.dur > 0 ? this.props.dur : 1.2) : 0; }
|
|
79
|
+
plan(){
|
|
80
|
+
if (this._plan) return this._plan;
|
|
81
|
+
var d = this.data || {}, p = {reaction: this.props.mode === "reaction", states: d.states || STATES, notes: [], fatal: false};
|
|
82
|
+
if (!p.reaction){
|
|
83
|
+
if (d.reactants || d.products || (d.labels && !Array.isArray(d.labels))){ p.notes.push("state mode takes states and a labels array"); p.fatal = true; }
|
|
84
|
+
return (this._plan = p);
|
|
85
|
+
}
|
|
86
|
+
p.elements = []; p.sides = []; p.totals = [];
|
|
87
|
+
try {
|
|
88
|
+
if (!d.reactants || !d.products || Array.isArray(d.labels) || d.states || d.substance) throw new Error("reaction mode needs reactants, products and optional labels object");
|
|
89
|
+
[d.reactants, d.products].forEach(function(side){
|
|
90
|
+
var molecules = [], total = Object.create(null), N = 0;
|
|
91
|
+
side.forEach(function(m){
|
|
92
|
+
if (!Number.isSafeInteger(m.n) || m.n < 1 || m.n > 24) throw new Error("coefficient n must be an integer from 1 to 24");
|
|
93
|
+
var f = parseFormula(m.formula);
|
|
94
|
+
N += f.atoms.length * m.n;
|
|
95
|
+
if (N > 24) throw new Error("more than 24 atoms on one side (maximum conserved inventory: 24)");
|
|
96
|
+
Object.keys(f.counts).forEach(function(e){
|
|
97
|
+
if (p.elements.indexOf(e) < 0) p.elements.push(e);
|
|
98
|
+
total[e] = (total[e] || 0) + f.counts[e] * m.n;
|
|
99
|
+
});
|
|
100
|
+
for (var j = 0; j < m.n; j++) molecules.push({atoms: f.atoms.slice(), shape: m.shape || MOLECULE_SHAPES[m.formula] || (f.atoms.length <= 3 ? "linear" : "chain")});
|
|
101
|
+
});
|
|
102
|
+
p.sides.push(molecules); p.totals.push(total);
|
|
103
|
+
});
|
|
104
|
+
if (p.elements.length > 6) throw new Error("more than 6 elements");
|
|
105
|
+
p.balanced = p.elements.every(function(e){ return (p.totals[0][e] || 0) === (p.totals[1][e] || 0); });
|
|
106
|
+
p.counts = p.elements.map(function(e){ return e + " " + (p.totals[0][e] || 0) + " → " + (p.totals[1][e] || 0); });
|
|
107
|
+
if (!p.balanced) p.notes.push("unbalanced equation: " + p.counts.join(", ") + "; static comparison only");
|
|
108
|
+
p.eq = equation(d.reactants, formulaText) + " → " + equation(d.products, formulaText);
|
|
109
|
+
p.accessible = equation(d.reactants, unicodeFormula) + " → " + equation(d.products, unicodeFormula);
|
|
110
|
+
} catch (e){ p.notes.push(e.message); p.fatal = true; }
|
|
111
|
+
return (this._plan = p);
|
|
112
|
+
}
|
|
113
|
+
mount(ctx){
|
|
114
|
+
var P = this.props, p = this.plan(), self = this;
|
|
115
|
+
p.notes.forEach(function(m){ ctx.report("data", "[particles] " + m); });
|
|
116
|
+
if (["state", "reaction"].indexOf(P.mode) < 0) ctx.report("attr", "[particles] unknown mode; using state");
|
|
117
|
+
[["count", 16, function(v){ return Number.isInteger(v) && v >= 6 && v <= 30; }], ["size", 28, function(v){ return Number.isFinite(v) && v >= 24; }], ["dur", 1.2, function(v){ return Number.isFinite(v) && v > 0; }]].forEach(function(a){
|
|
118
|
+
if (!a[2](P[a[0]])){ ctx.report("attr", "[particles] invalid " + a[0] + "; using " + a[1]); P[a[0]] = a[1]; }
|
|
119
|
+
});
|
|
120
|
+
var lang = this.closest("[lang]");
|
|
121
|
+
this.T = /^ja\b/i.test((lang && lang.getAttribute("lang")) || ctx.lang || "") ? TEXT.ja : TEXT.en;
|
|
122
|
+
this.words = Object.assign({}, this.T, p.reaction ? (this.data || {}).labels : {});
|
|
123
|
+
this.style.display = "block"; this.style.position = "relative"; this.style.writingMode = "horizontal-tb";
|
|
124
|
+
this.W = this.clientWidth; this.H = this.clientHeight;
|
|
125
|
+
this.svg = base.el("svg", {viewBox: "0 0 " + this.W + " " + this.H, width: this.W, height: this.H, "aria-hidden": "true", style: "display:block"}, this);
|
|
126
|
+
this.setAttribute("role", "img");
|
|
127
|
+
if (p.fatal){ this.label(this.svg, this.W / 2, this.H / 2, this.T.invalid); if (!this.getAttribute("aria-label")) this.setAttribute("aria-label", this.T.invalid); return; }
|
|
128
|
+
if (p.reaction) this.drawReaction(ctx); else this.drawState(ctx);
|
|
129
|
+
if (!this.getAttribute("aria-label")){
|
|
130
|
+
var ja = this.T === TEXT.ja;
|
|
131
|
+
var name = p.reaction ? p.accessible + ". " + this.words.atoms + p.counts.join(ja ? "、" : ", ") :
|
|
132
|
+
((this.data || {}).substance ? this.data.substance + (ja ? "の" : " ") : "") + (ja ? "粒子のモデル:" : "particle model: ") + p.states.map(function(s, i){ return self.stateLabel(i); }).join("→") +
|
|
133
|
+
(ja ? "。粒子の数(" + P.count + ")と大きさは変わらず、間隔と動きが変わる" : ". Particle count (" + P.count + ") and size stay constant; spacing and motion change.");
|
|
134
|
+
this.setAttribute("aria-label", name);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
label(g, x, y, s, fs, anchor, tone){
|
|
138
|
+
return base.mtext(g, x, y, s, {"font-size": fs || this.props.size, "text-anchor": anchor || "middle", fill: "var(--" + (tone || "fg") + ")"});
|
|
139
|
+
}
|
|
140
|
+
checkWidth(s, fs, width, ctx){ if (base.textWidth(s, fs, {font: this, mark: true}) > width) ctx.report("size", "[particles] a label does not fit; shorten it or make the element larger"); }
|
|
141
|
+
stateLabel(i){ var d = this.data || {}, v = (d.labels || [])[i]; return v === undefined || v === null ? this.T.states[STATES.indexOf(this.plan().states[i])] : v; }
|
|
142
|
+
stateBox(s){
|
|
143
|
+
var full = Math.max(0, Math.min(this.W - 40, 700)), w = full; // 0 when the element is too narrow, never negative
|
|
144
|
+
if (this.props.volume && s !== "gas"){
|
|
145
|
+
var layerWidth = 54;
|
|
146
|
+
for (var i = 1; i < Math.ceil((this.props.count + 1) / 2); i++) layerWidth += 38.2 + 3 * hash(i + 71);
|
|
147
|
+
w = Math.min(full, Math.max(full * 0.72, layerWidth));
|
|
148
|
+
}
|
|
149
|
+
var h = Math.max(0, Math.min(this.H - 108, Math.max(240, Math.ceil(this.props.count / 6) * 50 + 40)));
|
|
150
|
+
return {x: (this.W - w) / 2, y: 44, width: w, height: h};
|
|
151
|
+
}
|
|
152
|
+
boxWidth(s){ return this.stateBox(s).width; }
|
|
153
|
+
arrangement(s){
|
|
154
|
+
var N = this.props.count, r = 19, box = this.stateBox(s), floor = box.y + box.height - r - 1.5, out = [], i;
|
|
155
|
+
if (s === "gas"){
|
|
156
|
+
// 最良候補法。格子からずらすのでなく、既存の点から最も離れた候補を採る。
|
|
157
|
+
var margin = r + 30;
|
|
158
|
+
for (i = 0; i < N; i++){
|
|
159
|
+
var best = null, score = -1;
|
|
160
|
+
for (var j = 0; j < 768; j++){
|
|
161
|
+
var seed = i * 1536 + j * 2 + 503;
|
|
162
|
+
var q = {x: box.x + margin + hash(seed) * (box.width - 2 * margin), y: box.y + margin + hash(seed + 1) * (box.height - 2 * margin)};
|
|
163
|
+
var d = out.length ? Math.min.apply(null, out.map(function(a){ return Math.hypot(q.x - a.x, q.y - a.y); })) : 1;
|
|
164
|
+
if (d > score){ score = d; best = q; }
|
|
165
|
+
if (!i) break;
|
|
166
|
+
}
|
|
167
|
+
out.push(best);
|
|
168
|
+
}
|
|
169
|
+
} else if (s === "solid"){
|
|
170
|
+
var pitch = 2 * r + 3, cols = latticeColumns(N, 1, Math.max(1, Math.floor((box.width - 2 * r - 8) / pitch) + 1));
|
|
171
|
+
for (i = 0; i < N;){
|
|
172
|
+
var row = Math.floor(i / cols), n = Math.min(cols, N - i);
|
|
173
|
+
for (var c = 0; c < n; c++, i++) out.push({x: this.W / 2 + (c - (n - 1) / 2) * pitch, y: floor - row * pitch});
|
|
174
|
+
}
|
|
175
|
+
} else {
|
|
176
|
+
// 床の列から積む。上の粒子は下の隣接する 2 粒子に接し、全ての中心間距離は 2r 以上。
|
|
177
|
+
var contact = 2 * r + 0.2;
|
|
178
|
+
var cols = Math.ceil((N + 1) / 2);
|
|
179
|
+
var row = [], x = 0;
|
|
180
|
+
for (i = 0; i < Math.min(cols, N); i++){
|
|
181
|
+
if (i){
|
|
182
|
+
var nextX = x + contact + 3 * hash(i + 71);
|
|
183
|
+
if (nextX + 2 * r + 16 > box.width + 1e-6) break;
|
|
184
|
+
x = nextX;
|
|
185
|
+
}
|
|
186
|
+
row.push({x: x, y: floor});
|
|
187
|
+
}
|
|
188
|
+
var offset = this.W / 2 - x / 2;
|
|
189
|
+
row.forEach(function(q){ q.x += offset; out.push(q); });
|
|
190
|
+
while (out.length < N && row.length > 1){
|
|
191
|
+
var next = [];
|
|
192
|
+
for (i = 0; i < row.length - 1; i++){
|
|
193
|
+
var a = row[i], b = row[i + 1], dx = b.x - a.x, dy = b.y - a.y, d = Math.hypot(dx, dy);
|
|
194
|
+
var lift = Math.sqrt(Math.max(0, contact * contact - d * d / 4));
|
|
195
|
+
next.push({x: (a.x + b.x) / 2 + dy / d * lift, y: (a.y + b.y) / 2 - dx / d * lift});
|
|
196
|
+
}
|
|
197
|
+
var need = Math.min(next.length, N - out.length), start = Math.floor((next.length - need) / 2);
|
|
198
|
+
row = next.slice(start, start + need); row.forEach(function(q){ out.push(q); });
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return out;
|
|
202
|
+
}
|
|
203
|
+
separateParticles(points, box){
|
|
204
|
+
// 補間の途中も円を重ねない。毎フレーム同じ入力から解き、前の render に依存しない。
|
|
205
|
+
for (var it = 0; it < 240; it++){
|
|
206
|
+
var moved = false;
|
|
207
|
+
for (var i = 0; i < points.length; i++) for (var j = i + 1; j < points.length; j++){
|
|
208
|
+
var a = points[i], b = points[j], dx = b.x - a.x, dy = b.y - a.y, d = Math.hypot(dx, dy);
|
|
209
|
+
if (d >= 38) continue;
|
|
210
|
+
var angle = hash(i * 31 + j) * 2 * Math.PI, ux = d > 1e-8 ? dx / d : Math.cos(angle), uy = d > 1e-8 ? dy / d : Math.sin(angle), shift = (38.02 - d) / 2;
|
|
211
|
+
a.x -= ux * shift; a.y -= uy * shift; b.x += ux * shift; b.y += uy * shift; moved = true;
|
|
212
|
+
}
|
|
213
|
+
points.forEach(function(q){ q.x = Math.max(box.x + 20.5, Math.min(box.x + box.width - 20.5, q.x)); q.y = Math.max(box.y + 20.5, Math.min(box.y + box.height - 20.5, q.y)); });
|
|
214
|
+
if (!moved) break;
|
|
215
|
+
}
|
|
216
|
+
return points;
|
|
217
|
+
}
|
|
218
|
+
transitionLabel(k){
|
|
219
|
+
if (!k) return this.stateLabel(0);
|
|
220
|
+
var p = this.plan(), change = this.T.changes[p.states[k - 1] + p.states[k]], ja = this.T === TEXT.ja;
|
|
221
|
+
return this.stateLabel(k - 1) + " → " + this.stateLabel(k) + (change ? (ja ? "(" : " (") + change + (ja ? ")" : ")") : "");
|
|
222
|
+
}
|
|
223
|
+
// 矢印の軸・矢じりの全てが、容器の中かつ他の粒子の外にある向きを選ぶ。
|
|
224
|
+
motionArrow(points, i, length, box){
|
|
225
|
+
var r = 19, p = points[i], best = null, score = -Infinity;
|
|
226
|
+
for (var n = 0; n < 72; n++){
|
|
227
|
+
var angle = (hash(i + 101) * 360 + n * 5) * Math.PI / 180, co = Math.cos(angle), si = Math.sin(angle);
|
|
228
|
+
var tip = r + 1.5 + length, local = [[r + 1.5, 0], [tip, 0], [tip - 3, -1.5], [tip - 3, 1.5]];
|
|
229
|
+
var q = local.map(function(v){ return {x: p.x + co * v[0] - si * v[1], y: p.y + si * v[0] + co * v[1]}; });
|
|
230
|
+
if (!q.every(function(v){ return v.x >= box.x + 2 && v.x <= box.x + box.width - 2 && v.y >= box.y + 2 && v.y <= box.y + box.height - 2; })) continue;
|
|
231
|
+
var segments = [[q[0], q[1]], [q[1], q[2]], [q[1], q[3]]], clearance = Infinity;
|
|
232
|
+
points.forEach(function(a, j){ if (j !== i) segments.forEach(function(seg){ clearance = Math.min(clearance, segmentDistance(a, seg[0], seg[1]) - r); }); });
|
|
233
|
+
if (clearance >= 1.2 && clearance > score){ score = clearance; best = {angle: angle * 180 / Math.PI, segments: segments, path: "M" + (r + 1.5) + ",0H" + tip + "m-3,-1.5L" + tip + ",0l-3,1.5"}; }
|
|
234
|
+
}
|
|
235
|
+
return best;
|
|
236
|
+
}
|
|
237
|
+
drawState(ctx){
|
|
238
|
+
var p = this.plan(), self = this, N = this.props.count;
|
|
239
|
+
this.particleRadius = 19; this.arrangements = {};
|
|
240
|
+
STATES.forEach(function(s){ self.arrangements[s] = self.arrangement(s); });
|
|
241
|
+
var fits = STATES.every(function(s){
|
|
242
|
+
var box = self.stateBox(s), points = self.arrangements[s];
|
|
243
|
+
return points.length === N && points.every(function(q, i){
|
|
244
|
+
return q.x - 19 >= box.x && q.x + 19 <= box.x + box.width && q.y - 19 >= box.y && q.y + 19 <= box.y + box.height &&
|
|
245
|
+
points.every(function(a, j){ return i === j || Math.hypot(q.x - a.x, q.y - a.y) >= (s === "gas" ? 2.6 * 19 : 38) - 1e-6; });
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
if (!fits) ctx.report("size", "[particles] particle model needs a larger box");
|
|
249
|
+
this.label(this.svg, this.W / 2, 29, (this.data || {}).substance || "");
|
|
250
|
+
this.box = base.el("rect", {rx: 16, fill: "none", stroke: "var(--muted)", "stroke-width": 2}, this.svg);
|
|
251
|
+
this.particles = []; this.marks = [];
|
|
252
|
+
for (var i = 0; i < N; i++){
|
|
253
|
+
var g = base.el("g", {"data-particle": i}, this.svg);
|
|
254
|
+
base.el("circle", {r: 19, fill: "var(--term)"}, g);
|
|
255
|
+
this.marks.push(base.el("path", {fill: "none", stroke: "var(--fg)", "stroke-width": 1.5}, g));
|
|
256
|
+
this.particles.push(g);
|
|
257
|
+
}
|
|
258
|
+
this.stateName = this.label(this.svg, this.W / 2, this.stateBox("gas").y + this.stateBox("gas").height + 42, "");
|
|
259
|
+
for (var k = 0; k <= this.steps; k++) self.checkWidth(this.transitionLabel(k), this.props.size, this.W - 16, ctx);
|
|
260
|
+
this.checkWidth((this.data || {}).substance || "", this.props.size, this.W - 16, ctx);
|
|
261
|
+
}
|
|
262
|
+
// 中心原子と周囲の原子を平面に置く。未知の 3 原子分子は直線にする。
|
|
263
|
+
molecule(atoms, r, shape){
|
|
264
|
+
shape = shape || (atoms.length <= 3 ? "linear" : "chain");
|
|
265
|
+
var order = atoms.map(function(_, i){ return i; }), counts = {};
|
|
266
|
+
atoms.forEach(function(e){ counts[e] = (counts[e] || 0) + 1; });
|
|
267
|
+
var radial = (shape === "bent" && atoms.length === 3) || (shape === "trigonal" && atoms.length === 4) || (shape === "tetrahedral" && atoms.length === 5);
|
|
268
|
+
if (radial || (shape === "linear" && atoms.length === 3)){
|
|
269
|
+
var center = atoms.findIndex(function(e){ return counts[e] === 1; });
|
|
270
|
+
if (center >= 0){ order.splice(order.indexOf(center), 1); order.unshift(center); }
|
|
271
|
+
}
|
|
272
|
+
var cols = shape === "linear" ? atoms.length : Math.min(6, atoms.length), out = [];
|
|
273
|
+
order.forEach(function(j, i){
|
|
274
|
+
if (radial){
|
|
275
|
+
var angle = shape === "bent" ? (i === 1 ? 5 : 1) * Math.PI / 6 : -Math.PI / 2 + (i - 1) * 2 * Math.PI / (atoms.length - 1);
|
|
276
|
+
out[j] = i ? [2 * r * Math.cos(angle), 2 * r * Math.sin(angle)] : [0, 0];
|
|
277
|
+
} else if (shape === "linear" && atoms.length === 3){
|
|
278
|
+
out[j] = [[0, 0], [-2 * r, 0], [2 * r, 0]][i];
|
|
279
|
+
} else out[j] = [(i % cols) * r * 2, Math.floor(i / cols) * r * 2];
|
|
280
|
+
});
|
|
281
|
+
var minX = Math.min.apply(null, out.map(function(a){ return a[0]; })), minY = Math.min.apply(null, out.map(function(a){ return a[1]; }));
|
|
282
|
+
return out.map(function(a){ return {x: a[0] - minX + r, y: a[1] - minY + r}; });
|
|
283
|
+
}
|
|
284
|
+
moleculeLayout(side, width, r){
|
|
285
|
+
var self = this, slots = [], rows = [], row = [], rowW = 0, rowH = 0;
|
|
286
|
+
function flush(){ if (row.length) rows.push({molecules: row, width: rowW, height: rowH}); row = []; rowW = rowH = 0; }
|
|
287
|
+
side.forEach(function(m){
|
|
288
|
+
var atoms = m.atoms, pts = self.molecule(atoms, r, m.shape), w = Math.max.apply(null, pts.map(function(q){ return q.x; })) + r, h = Math.max.apply(null, pts.map(function(q){ return q.y; })) + r;
|
|
289
|
+
if (row.length && rowW + 24 + w > width) flush();
|
|
290
|
+
row.push({atoms: atoms, points: pts, width: w, height: h}); rowW += (row.length > 1 ? 24 : 0) + w; rowH = Math.max(rowH, h);
|
|
291
|
+
});
|
|
292
|
+
flush();
|
|
293
|
+
var y = 0, maxW = 0;
|
|
294
|
+
rows.forEach(function(row){
|
|
295
|
+
var x = (width - row.width) / 2; maxW = Math.max(maxW, row.width);
|
|
296
|
+
row.molecules.forEach(function(m){
|
|
297
|
+
m.points.forEach(function(q, i){ slots.push({e: m.atoms[i], x: x + q.x, y: y + (row.height - m.height) / 2 + q.y}); });
|
|
298
|
+
x += m.width + 24;
|
|
299
|
+
});
|
|
300
|
+
y += row.height + 22;
|
|
301
|
+
});
|
|
302
|
+
return {slots: slots, width: maxW, height: y - 22};
|
|
303
|
+
}
|
|
304
|
+
separatedLayout(n, r){
|
|
305
|
+
var cols = Math.min(n, latticeColumns(n, 2.5, Math.max(1, Math.floor((this.W - 24 - 2 * r) / (3 * r + 8)) + 1))), rows = Math.ceil(n / cols), pitch = 3 * r + 8, points = [];
|
|
306
|
+
for (var i = 0; i < n;){
|
|
307
|
+
var row = Math.floor(i / cols), count = Math.min(cols, n - i);
|
|
308
|
+
for (var j = 0; j < count; j++, i++) points.push({x: (j - (count - 1) / 2) * pitch, y: row * pitch + r});
|
|
309
|
+
}
|
|
310
|
+
return {points: points, width: (cols - 1) * pitch + 2 * r, height: (rows - 1) * pitch + 2 * r};
|
|
311
|
+
}
|
|
312
|
+
atom(g, a, id){
|
|
313
|
+
var p = this.plan(), tone = COLORS[p.elements.indexOf(a.e)], group = base.el("g", id === null ? {} : {"data-atom": id, "data-element": a.e}, g);
|
|
314
|
+
base.el("circle", {r: this.radius, fill: "none", stroke: "var(--" + tone + ")", "stroke-width": 3}, group);
|
|
315
|
+
this.label(group, 0, 8, a.e, 24, "middle", tone);
|
|
316
|
+
set(group, "transform", "translate(" + a.x + " " + a.y + ")");
|
|
317
|
+
return group;
|
|
318
|
+
}
|
|
319
|
+
drawReaction(ctx){
|
|
320
|
+
var p = this.plan(), self = this, W = this.W, gutter = 112, maxSide = (W - 24 - gutter) / 2, L;
|
|
321
|
+
// 全段階で同じ半径。大きいデータだけ少し小さくし、分離時にも一半径以上の隙間を確保する。
|
|
322
|
+
for (var r = 34; r >= 24; r--){
|
|
323
|
+
var source = this.moleculeLayout(p.sides[0], maxSide, r), target = this.moleculeLayout(p.sides[1], maxSide, r), free = this.separatedLayout(source.slots.length, r);
|
|
324
|
+
var pictureH = Math.max(source.height, target.height), height = Math.max(44 + pictureH + 94, 44 + free.height);
|
|
325
|
+
L = {radius: r, source: source, target: target, free: free, pictureH: pictureH, height: height};
|
|
326
|
+
if (height <= this.H - 8 && source.width <= maxSide && target.width <= maxSide && free.width <= W - 24) break;
|
|
327
|
+
}
|
|
328
|
+
if (L.height > this.H - 8 || L.source.width > maxSide || L.target.width > maxSide || L.free.width > W - 24) ctx.report("size", "[particles] molecules need a larger element");
|
|
329
|
+
this.radius = L.radius;
|
|
330
|
+
var sideW = Math.max(L.source.width, L.target.width, base.textWidth(this.words.before, 24, {font: this}), base.textWidth(this.words.after, 24, {font: this}), 160);
|
|
331
|
+
if (sideW > maxSide) ctx.report("size", "[particles] group captions need a wider element");
|
|
332
|
+
var left = (W - 2 * sideW - gutter) / 2, top = (this.H - L.height) / 2, captionY = top + 24, pictureTop = top + 44;
|
|
333
|
+
source = this.moleculeLayout(p.sides[0], sideW, L.radius); target = this.moleculeLayout(p.sides[1], sideW, L.radius);
|
|
334
|
+
function place(layout, x){ return layout.slots.map(function(q){ return {e: q.e, x: q.x + x, y: q.y + pictureTop + (L.pictureH - layout.height) / 2}; }); }
|
|
335
|
+
this.source = place(source, left); this.target = place(target, left + sideW + gutter);
|
|
336
|
+
this.separated = L.free.points.map(function(q){ return {x: W / 2 + q.x, y: pictureTop + q.y}; });
|
|
337
|
+
this.reactionLayout = {captionY: captionY, pictureTop: pictureTop, pictureBottom: pictureTop + L.pictureH, arrowY: pictureTop + L.pictureH / 2};
|
|
338
|
+
this.beforeName = this.label(this.svg, left + sideW / 2, captionY, this.words.before, 24);
|
|
339
|
+
this.afterName = this.label(this.svg, left + sideW * 1.5 + gutter, captionY, this.words.after, 24);
|
|
340
|
+
this.stageName = this.label(this.svg, W / 2, captionY, "", 24);
|
|
341
|
+
this.arrow = base.el("path", {d: "M" + (W / 2 - 32) + "," + this.reactionLayout.arrowY + "h64m-12,-8l12,8l-12,8", fill: "none", stroke: "var(--muted)", "stroke-width": 3}, this.svg);
|
|
342
|
+
this.reference = base.el("g", {"data-reference": "reactants"}, this.svg);
|
|
343
|
+
this.source.forEach(function(a){ self.atom(self.reference, a, null); });
|
|
344
|
+
this.live = base.el("g", {}, this.svg);
|
|
345
|
+
this.atoms = this.source.map(function(a, i){ return self.atom(self.live, a, i); });
|
|
346
|
+
var queues = Object.create(null);
|
|
347
|
+
this.source.forEach(function(a, i){ (queues[a.e] || (queues[a.e] = [])).push(i); });
|
|
348
|
+
this.destinations = this.source.map(function(a){ return a; });
|
|
349
|
+
if (p.balanced) this.target.forEach(function(a){ self.destinations[queues[a.e].shift()] = a; });
|
|
350
|
+
this.productReference = base.el("g", {"data-reference": "products"}, this.svg);
|
|
351
|
+
if (!p.balanced) this.target.forEach(function(a){ self.atom(self.productReference, a, null); });
|
|
352
|
+
this.summary = base.el("g", {}, this.svg);
|
|
353
|
+
this.equationName = this.label(this.summary, W / 2, this.reactionLayout.pictureBottom + 42, p.eq);
|
|
354
|
+
this.checkWidth(p.eq, this.props.size, W - 24, ctx);
|
|
355
|
+
var sep = this.T === TEXT.ja ? "、" : ", ", countText = this.words.atoms + p.counts.join(sep);
|
|
356
|
+
this.countsLine = base.el("text", {x: W / 2, y: this.reactionLayout.pictureBottom + 86, "font-size": 24, "text-anchor": "middle", fill: "var(--fg)"}, this.summary);
|
|
357
|
+
base.el("tspan", {}, this.countsLine).textContent = this.words.atoms;
|
|
358
|
+
p.elements.forEach(function(e, i){
|
|
359
|
+
base.el("tspan", {fill: "var(--" + ((p.totals[0][e] || 0) === (p.totals[1][e] || 0) ? "fg" : "emph") + ")"}, self.countsLine).textContent = (i ? sep : "") + p.counts[i];
|
|
360
|
+
});
|
|
361
|
+
this.checkWidth(countText, 24, W - 24, ctx);
|
|
362
|
+
[this.words.before, this.words.after].forEach(function(s){ self.checkWidth(s, 24, sideW, ctx); });
|
|
363
|
+
this.checkWidth(this.words.apart, 24, W - 24, ctx);
|
|
364
|
+
}
|
|
365
|
+
render(k, t){
|
|
366
|
+
var p = this.plan(); if (!this.svg || p.fatal) return;
|
|
367
|
+
k = Math.max(0, Math.min(this.steps, k));
|
|
368
|
+
var e = k ? base.prog(t, 0, this.duration(k)) : 0, self = this;
|
|
369
|
+
if (!p.reaction){
|
|
370
|
+
var a = Math.max(0, k - 1), b = k, from = p.states[a], to = p.states[b], A = this.arrangements[from], B = this.arrangements[to];
|
|
371
|
+
var boxA = this.stateBox(from), boxB = this.stateBox(to), box = {};
|
|
372
|
+
["x", "y", "width", "height"].forEach(function(key){ box[key] = base.lerp(boxA[key], boxB[key], e); set(self.box, key, box[key]); });
|
|
373
|
+
var points = this.currentParticles = this.separateParticles(A.map(function(q, i){ return {x: base.lerp(q.x, B[i].x, e), y: base.lerp(q.y, B[i].y, e)}; }), box);
|
|
374
|
+
this.motionPaths = [];
|
|
375
|
+
this.particles.forEach(function(g, i){
|
|
376
|
+
set(g, "transform", "translate(" + points[i].x.toFixed(3) + " " + points[i].y.toFixed(3) + ")");
|
|
377
|
+
var state = e < 0.5 ? from : to, solid = state === "solid", mark = null;
|
|
378
|
+
// 密に接した内部の粒子では、短縮せず空きのある粒子だけに矢印を描く。
|
|
379
|
+
if (self.props.motion && !solid) mark = self.motionArrow(points, i, state === "gas" ? 24 : 18, box);
|
|
380
|
+
self.motionPaths.push(mark);
|
|
381
|
+
set(self.marks[i], "transform", mark ? "rotate(" + mark.angle.toFixed(3) + ")" : "");
|
|
382
|
+
set(self.marks[i], "d", !self.props.motion ? "" : solid ? "M14,-19q4,2 5,5M-14,19q-4,-2 -5,-5" : mark ? mark.path : "");
|
|
383
|
+
});
|
|
384
|
+
text(this.stateName, this.transitionLabel(k));
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
var final = k === 3 ? e : 0, visible = k === 0 ? 0 : k === 1 ? e : 1;
|
|
388
|
+
set(this.summary, "opacity", p.balanced ? final : visible);
|
|
389
|
+
set(this.live, "opacity", visible); set(this.arrow, "opacity", k >= 3 || !p.balanced ? 1 : 0);
|
|
390
|
+
set(this.reference, "opacity", p.balanced ? final : 0);
|
|
391
|
+
set(this.productReference, "opacity", p.balanced ? 0 : visible);
|
|
392
|
+
set(this.afterName, "opacity", p.balanced ? final : visible);
|
|
393
|
+
set(this.beforeName, "opacity", k === 3 || !p.balanced ? 1 : 0);
|
|
394
|
+
text(this.stageName, k === 3 || !p.balanced ? "" : k === 2 ? this.words.apart : this.words.before);
|
|
395
|
+
this.atoms.forEach(function(g, i){
|
|
396
|
+
var a = self.source[i], b = self.destinations[i], free = self.separated[i];
|
|
397
|
+
var from = k === 3 ? free : a, to = k >= 2 ? (k === 3 ? b : free) : a, q = k >= 2 ? e : 0;
|
|
398
|
+
if (!p.balanced){ from = to = a; q = 0; }
|
|
399
|
+
set(g, "transform", "translate(" + base.lerp(from.x, to.x, q).toFixed(3) + " " + base.lerp(from.y, to.y, q).toFixed(3) + ")");
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
return Part;
|
|
404
|
+
});
|