@xiee/utils 1.14.34 → 1.14.36
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/css/article.css +1 -3
- package/css/article.min.css +1 -1
- package/css/article.min.css.map +1 -1
- package/css/book.css +0 -3
- package/css/book.min.css +1 -1
- package/css/book.min.css.map +1 -1
- package/css/default.css +1 -1
- package/css/default.min.css +1 -1
- package/css/default.min.css.map +1 -1
- package/js/g2-patches.js +10 -3
- package/js/g2-patches.min.js +1 -1
- package/js/g2-patches.min.js.map +1 -1
- package/package.json +1 -1
package/css/article.css
CHANGED
|
@@ -121,9 +121,8 @@ div:not(.body):has(> table) { overflow-x: auto; }
|
|
|
121
121
|
padding: 1em;
|
|
122
122
|
position: initial;
|
|
123
123
|
float: none;
|
|
124
|
-
columns: 2;
|
|
125
124
|
}
|
|
126
|
-
.side { width: 100%; }
|
|
125
|
+
.side { width: 100%; max-height: none; }
|
|
127
126
|
:is(main, .body) .side {
|
|
128
127
|
padding: 0 2em;
|
|
129
128
|
color: darkslategray;
|
|
@@ -147,7 +146,6 @@ div:not(.body):has(> table) { overflow-x: auto; }
|
|
|
147
146
|
body:not(.pagesjs) {
|
|
148
147
|
padding: initial;
|
|
149
148
|
main, .body { padding: 0 .5em 0; }
|
|
150
|
-
#TOC { columns: 1; }
|
|
151
149
|
:not(pre) > code { word-break: break-word; }
|
|
152
150
|
.quote-left, .quote-right {
|
|
153
151
|
width: inherit;
|
package/css/article.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:root{--side-width:200px;--side-gap:2em;--side-margin:calc(0px - var(--side-width) - var(--side-gap))}body,blockquote,.side{background:#fafafa}.body,.body~.appendix,.frontmatter,.fullwidth,.embed-left,.embed-right{background:#fff;margin-top:2em;padding:1em;box-shadow:0 0 8px #ccc}.appendix,.footnotes,.body .side{font-size:.9em}.body~.appendix,.frontmatter{background:0 0}.appendix h2{border-bottom:1px dashed #666}#TOC{top:0}.bg-number{color:#fff;background:#789;border-radius:5px;padding:1px 5px}div:not(.body):has(>table){overflow-x:auto}.side{width:var(--side-width);max-height:100vh;margin:0 auto;overflow:auto}.side-left{float:left;clear:left;margin-left:var(--side-margin);&:not(.body>*){margin-left:calc(var(--side-margin) + 1em)}position:sticky}.side-right{float:right;clear:right;margin-right:var(--side-margin)}.quote-left,.quote-right{width:45%}.embed-left,.embed-right{margin-top:auto;padding:0}.quote-left,.embed-left{float:left;margin-right:1em}.quote-right,.embed-right{float:right;margin-left:1em}.embed-left{margin-left:var(--side-margin)}.embed-right{margin-right:var(--side-margin)}:is(.side,.embed-left,.embed-right)>:first-child{margin-top:0}:is(.embed-left,.embed-right)>:last-child{margin-bottom:0}:is(.quote-left,.quote-right){&>:first-child{padding-top:.1px}&>:last-child{padding-bottom:.1px}}.fullwidth{float:left;background:#fff;min-width:100%;max-width:calc(100vw - 2em);margin:1em 0 1em 50%;transform:translate(-50%);& *{max-width:calc(100vw - 4em);margin:auto 0}& :is(figcaption,.caption){width:800px;margin-left:calc(50% - 400px);padding:1em 1em 0}}.fullscroll{& *{max-width:initial}&,& figure,& .figure{overflow-x:auto}}@media (width>=1264.02px){#TOC.side{& .active{color:#32cd32}& li li .active{border-left:3px solid;margin-left:calc(-1em - 3px);padding-left:1em}&:has(.active) li:not(:has(.active)) ul{display:none}}.note-ref{cursor:pointer}.note-ref:hover+.side{z-index:1;box-sizing:content-box;background:#f8f8f8;margin-left:1em;padding:.5em;display:inline-block;position:absolute}}@media (width<=1264px){body:not(.pagesjs){& #TOC{position:initial;float:none;
|
|
1
|
+
:root{--side-width:200px;--side-gap:2em;--side-margin:calc(0px - var(--side-width) - var(--side-gap))}body,blockquote,.side{background:#fafafa}.body,.body~.appendix,.frontmatter,.fullwidth,.embed-left,.embed-right{background:#fff;margin-top:2em;padding:1em;box-shadow:0 0 8px #ccc}.appendix,.footnotes,.body .side{font-size:.9em}.body~.appendix,.frontmatter{background:0 0}.appendix h2{border-bottom:1px dashed #666}#TOC{top:0}.bg-number{color:#fff;background:#789;border-radius:5px;padding:1px 5px}div:not(.body):has(>table){overflow-x:auto}.side{width:var(--side-width);max-height:100vh;margin:0 auto;overflow:auto}.side-left{float:left;clear:left;margin-left:var(--side-margin);&:not(.body>*){margin-left:calc(var(--side-margin) + 1em)}position:sticky}.side-right{float:right;clear:right;margin-right:var(--side-margin)}.quote-left,.quote-right{width:45%}.embed-left,.embed-right{margin-top:auto;padding:0}.quote-left,.embed-left{float:left;margin-right:1em}.quote-right,.embed-right{float:right;margin-left:1em}.embed-left{margin-left:var(--side-margin)}.embed-right{margin-right:var(--side-margin)}:is(.side,.embed-left,.embed-right)>:first-child{margin-top:0}:is(.embed-left,.embed-right)>:last-child{margin-bottom:0}:is(.quote-left,.quote-right){&>:first-child{padding-top:.1px}&>:last-child{padding-bottom:.1px}}.fullwidth{float:left;background:#fff;min-width:100%;max-width:calc(100vw - 2em);margin:1em 0 1em 50%;transform:translate(-50%);& *{max-width:calc(100vw - 4em);margin:auto 0}& :is(figcaption,.caption){width:800px;margin-left:calc(50% - 400px);padding:1em 1em 0}}.fullscroll{& *{max-width:initial}&,& figure,& .figure{overflow-x:auto}}@media (width>=1264.02px){#TOC.side{& .active{color:#32cd32}& li li .active{border-left:3px solid;margin-left:calc(-1em - 3px);padding-left:1em}&:has(.active) li:not(:has(.active)) ul{display:none}}.note-ref{cursor:pointer}.note-ref:hover+.side{z-index:1;box-sizing:content-box;background:#f8f8f8;margin-left:1em;padding:.5em;display:inline-block;position:absolute}}@media (width<=1264px){body:not(.pagesjs){& #TOC{position:initial;float:none;border:1px solid #eee;border-radius:5px;padding:1em}& .side{width:100%;max-height:none}& :is(main,.body) .side{color:#2f4f4f;padding:0 2em}& .side-left,& .side-right{clear:both;background:0 0;margin:1em auto}& :not(.note-ref)+.side{float:none}& .footnote-ref+.footnotes{float:left}& .side>:last-child{margin-bottom:0}& .embed-left,& .embed-right{float:inherit;margin:auto;padding:1em}}}@media (width<=800px){body:not(.pagesjs){padding:initial;& main,& .body{padding:0 .5em}& :not(pre)>code{word-break:break-word}& .quote-left,& .quote-right{width:inherit;float:inherit;margin:auto}& .fullwidth{margin:initial;transform:initial;float:none;min-width:initial;background:0 0;border:none;& :is(figcaption,.caption){margin:initial;padding:initial}&:not(.fullscroll) *{max-width:100%}}}}@media print{body{background:0 0}}
|
|
2
2
|
/*# sourceMappingURL=article.min.css.map */
|
package/css/article.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,sGAKA,yCACA,0IAMA,gDACA,4CACA,2CACA,WACA,wEAMA,2CAGA,2EAMA,gEAIE,0DAGS,gBAEX,oEAKA,mCACA,mDAIA,oDAIA,sDAIA,2CACA,6CACA,8DACA,0DACA,8BACE,gCACA,mCAIF,gIAOE,8CAIA,wFAMF,YACE,sBACA,sCAGF,0BACE,UACE,wBAGA,oFAKA,sDAIF,yBACA,+IAUF,uBACE,mBACE,
|
|
1
|
+
{"version":3,"mappings":"AAAA,sGAKA,yCACA,0IAMA,gDACA,4CACA,2CACA,WACA,wEAMA,2CAGA,2EAMA,gEAIE,0DAGS,gBAEX,oEAKA,mCACA,mDAIA,oDAIA,sDAIA,2CACA,6CACA,8DACA,0DACA,8BACE,gCACA,mCAIF,gIAOE,8CAIA,wFAMF,YACE,sBACA,sCAGF,0BACE,UACE,wBAGA,oFAKA,sDAIF,yBACA,+IAUF,uBACE,mBACE,uFAOA,mCACA,oDAIA,qEAKA,mCACA,sCACA,oCACA,qEAOJ,sBACE,mCAEE,8BACA,uCACA,qEAKA,sGAOE,0DAIA,uCAKN,aACE","sources":["article.css"],"sourcesContent":[":root {\n --side-width: 200px;\n --side-gap: 2em;\n --side-margin: calc(0px - var(--side-width) - var(--side-gap));\n}\nbody, blockquote, .side { background: #fafafa; }\n.body, .body ~ .appendix, .frontmatter, .fullwidth, .embed-left, .embed-right {\n margin-top: 2em;\n padding: 1em;\n box-shadow: 0 0 8px #ccc;\n background: #fff;\n}\n.appendix, .footnotes, .body .side { font-size: .9em; }\n.body ~ .appendix, .frontmatter { background: none; }\n.appendix h2 { border-bottom: 1px dashed #666; }\n#TOC { top: 0; }\n.bg-number {\n padding: 1px 5px;\n border-radius: 5px;\n background: lightslategray;\n color: #fff;\n}\ndiv:not(.body):has(> table) { overflow-x: auto; }\n\n/* left/right elements*/\n.side {\n width: var(--side-width);\n margin: 0 auto;\n max-height: 100vh;\n overflow: auto;\n}\n.side-left {\n float: left;\n clear: left;\n margin-left: var(--side-margin);\n &:not(.body > *) {\n margin-left: calc(var(--side-margin) + 1em);\n }\n position: sticky;\n}\n.side-right {\n float: right;\n clear: right;\n margin-right: var(--side-margin);\n}\n.quote-left, .quote-right { width: 45%; }\n.embed-left, .embed-right {\n margin-top: auto;\n padding: 0;\n}\n.quote-left, .embed-left {\n float: left;\n margin-right: 1em;\n}\n.quote-right, .embed-right {\n float: right;\n margin-left: 1em;\n}\n.embed-left { margin-left: var(--side-margin); }\n.embed-right { margin-right: var(--side-margin); }\n:is(.side, .embed-left, .embed-right) > :first-child { margin-top: 0; }\n:is(.embed-left, .embed-right) > :last-child { margin-bottom: 0; }\n:is(.quote-left, .quote-right) {\n & > :first-child { padding-top: .1px; }\n & > :last-child { padding-bottom: .1px; }\n}\n\n/* wide elements */\n.fullwidth {\n max-width: calc(100vw - 2em);\n margin: 1em 0 1em 50%;\n transform: translateX(-50%);\n float: left;\n min-width: 100%;\n background: #fff;\n & * {\n max-width: calc(100vw - 4em);\n margin: auto 0;\n }\n & :is(figcaption, .caption) {\n margin-left: calc(50% - 400px);\n width: 800px;\n padding: 1em 1em 0;\n }\n}\n.fullscroll {\n & * { max-width: initial; }\n &, & figure, & .figure { overflow-x: auto; }\n}\n\n@media (min-width: 1264.02px) {\n #TOC.side {\n .active {\n color: limegreen;\n }\n li li .active {\n border-left: 3px solid;\n margin-left: calc(-1em - 3px);\n padding-left: 1em;\n }\n &:has(.active) li:not(:has(.active)) ul {\n display: none;\n }\n }\n .note-ref { cursor: pointer; }\n .note-ref:hover + .side {\n display: inline-block;\n background: #f8f8f8;\n position: absolute;\n z-index: 1;\n margin-left: 1em;\n padding: .5em;\n box-sizing: content-box;\n }\n}\n@media (max-width: 1264px) {\n body:not(.pagesjs) {\n #TOC {\n border: 1px solid #eee;\n border-radius: 5px;\n padding: 1em;\n position: initial;\n float: none;\n }\n .side { width: 100%; max-height: none; }\n :is(main, .body) .side {\n padding: 0 2em;\n color: darkslategray;\n }\n .side-left, .side-right {\n clear: both;\n margin: 1em auto;\n background: none;\n }\n :not(.note-ref) + .side { float: none; }\n .footnote-ref + .footnotes { float: left; }\n .side > :last-child { margin-bottom: 0; }\n .embed-left, .embed-right {\n float: inherit;\n margin: auto;\n padding: 1em;\n }\n }\n}\n@media (max-width: 800px) {\n body:not(.pagesjs) {\n padding: initial;\n main, .body { padding: 0 .5em 0; }\n :not(pre) > code { word-break: break-word; }\n .quote-left, .quote-right {\n width: inherit;\n float: inherit;\n margin: auto;\n }\n .fullwidth {\n margin: initial;\n transform: initial;\n float: none;\n min-width: initial;\n background: none;\n border: none;\n & :is(figcaption, .caption) {\n margin: initial;\n padding: initial;\n }\n &:not(.fullscroll) * { max-width: 100%; }\n }\n }\n}\n\n@media print {\n body {\n background: none;\n }\n}\n"],"names":[]}
|
package/css/book.css
CHANGED
package/css/book.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
body{font-family:Palatino,Georgia,serif;font-size:1em}.footnotes,code,.side,.body .side,.chapter-toc{font-size:.85em}.frontmatter,.chapter{min-height:calc(100vh - 1em)}.frontmatter{background:#fff;padding-bottom:0;&>div{background:#ebf6f9;margin:0 -1em;padding:1em}& .title{margin-top:-1em;padding:20vh 1em 1em}}@media (width>=1264.02px){body:not(.pagesjs) .chapter-toc{display:none}}.chapter-toc{border:1px solid #eee;border-radius:5px;margin-bottom:2em;padding:1em
|
|
1
|
+
body{font-family:Palatino,Georgia,serif;font-size:1em}.footnotes,code,.side,.body .side,.chapter-toc{font-size:.85em}.frontmatter,.chapter{min-height:calc(100vh - 1em)}.frontmatter{background:#fff;padding-bottom:0;&>div{background:#ebf6f9;margin:0 -1em;padding:1em}& .title{margin-top:-1em;padding:20vh 1em 1em}}@media (width>=1264.02px){body:not(.pagesjs) .chapter-toc{display:none}}.chapter-toc{border:1px solid #eee;border-radius:5px;margin-bottom:2em;padding:1em}.chapter:not(.appendix) .main-number{&:before{content:"Chapter "}&:after{content:none}}.chapter h1{border-bottom:1px solid;margin:1em auto 3em;&:has(+.epigraph){margin-bottom:2em}}h1 .section-number{border-bottom:4px solid;margin-bottom:-4px;display:inline-block}.body h2{border-bottom-style:dashed}.pagesjs .pagesjs-page:first-child:has(.frontmatter){padding:0;& .pagesjs-header,& .pagesjs-footer{display:none}& .frontmatter{padding:var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);height:100%;margin:0;& .title{margin-top:calc(0px - var(--paper-margin-top))}&>div{margin:0 calc(0px - var(--paper-margin-right)) 0 calc(0px - var(--paper-margin-left))}}}
|
|
2
2
|
/*# sourceMappingURL=book.min.css.map */
|
package/css/book.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,sDAIA,+DAGA,mDAGA,8CAKE,mDAKA,+CAKF,0BACE,8CAIF,
|
|
1
|
+
{"version":3,"mappings":"AAAA,sDAIA,+DAGA,mDAGA,8CAKE,mDAKA,+CAKF,0BACE,8CAIF,mFAMA,qCACE,4BAGA,sBAIF,wDAGE,qCAIF,mFAKA,oCAGA,+DAEE,iDAGA,kJAIE,wDAGA","sources":["book.css"],"sourcesContent":["body {\n font-size: 1em;\n font-family: Palatino, Georgia, serif;\n}\n.footnotes, code, .side, .body .side, .chapter-toc {\n font-size: .85em;\n}\n.frontmatter, .chapter {\n min-height: calc(100vh - 1em);\n}\n.frontmatter {\n background-image: radial-gradient(#b6cee2 1px, #fff 1px);\n background-size: 2em 2em;\n background: #fff;\n padding-bottom: 0;\n & > div {\n margin: 0 -1em;\n background: #ebf6f9;\n padding: 1em;\n }\n & .title {\n padding: 20vh 1em 1em;\n margin-top: -1em;\n }\n}\n@media (min-width: 1264.02px) {\n body:not(.pagesjs) .chapter-toc {\n display: none;\n }\n}\n.chapter-toc {\n border: 1px solid #eee;\n border-radius: 5px;\n padding: 1em;\n margin-bottom: 2em;\n}\n.chapter:not(.appendix) .main-number {\n &::before {\n content: \"Chapter \";\n }\n &::after {\n content: none;\n }\n}\n.chapter h1 {\n margin: 1em auto 3em;\n border-bottom: 1px solid;\n &:has(+ .epigraph) {\n margin-bottom: 2em;\n }\n}\nh1 .section-number {\n display: inline-block;\n border-bottom: 4px solid;\n margin-bottom: -4px;\n}\n.body h2 { border-bottom-style: dashed; }\n/* TODO: style for h1.part and printing */\n\n.pagesjs .pagesjs-page:first-child:has(.frontmatter) {\n padding: 0;\n .pagesjs-header, .pagesjs-footer {\n display: none;\n }\n .frontmatter {\n margin: 0;\n padding: var(--paper-margin-top) var(--paper-margin-right) var(--paper-margin-bottom) var(--paper-margin-left);\n height: 100%;\n .title {\n margin-top: calc(0px - var(--paper-margin-top));\n }\n & > div {\n margin: 0 calc(0px - var(--paper-margin-right)) 0 calc(0px - var(--paper-margin-left));\n }\n }\n}\n"],"names":[]}
|
package/css/default.css
CHANGED
|
@@ -54,7 +54,7 @@ hr, .footnotes::before { border: 1px dashed #ddd; }
|
|
|
54
54
|
.frontmatter { text-align: center; }
|
|
55
55
|
#TOC {
|
|
56
56
|
a { text-decoration: none; }
|
|
57
|
-
ul { list-style: none; padding-left: 1em; }
|
|
57
|
+
ul { list-style: none; padding-left: 1em; columns: 24em; }
|
|
58
58
|
& > ul { padding: 0; }
|
|
59
59
|
ul ul { border-left: 1px solid lightsteelblue; }
|
|
60
60
|
}
|
package/css/default.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
body{-webkit-print-color-adjust:exact;print-color-adjust:exact;max-width:800px;margin:auto;padding:1em;font-family:sans-serif;line-height:1.5}body,.abstract,code,.footnotes,footer,#refs,.caption{font-size:.9em}li li{font-size:.95em}ul:has(li>input[type=checkbox]){padding-left:1em;list-style:none}*,:before,:after{box-sizing:border-box}a{color:#4682b4}pre,img{max-width:100%}pre{white-space:pre-wrap;word-break:break-word}pre code{padding:1em;display:block;overflow-x:auto}code{font-family:DejaVu Sans Mono,Droid Sans Mono,Lucida Console,Consolas,Monaco,monospace}:not(pre,th)>code,code[class],div>.caption{background:#f8f8f8}pre>code:is(:not([class]),.language-plain,.language-none,.plain),.box,.figure,.table{background:inherit;border:1px solid #eee}pre>code{&.message{border-color:#9eeaf9}&.warning{background:#fff3cd;border-color:#fff3cd}&.error{background:#f8d7da;border-color:#f8d7da}}.fenced-chunk{border-left:1px solid #666}.code-fence{opacity:.4;border:1px dashed #666;border-left:2px solid;&:hover{opacity:inherit}}.box,.figure,.table,table{margin:1em auto}div>.caption{padding:1px 1em}.figure{& p:has(img,svg),& pre:has(svg){text-align:center}}.flex-col{justify-content:space-between;display:flex}table{&:only-child:not(.table>*){margin:auto}& th,& td{font-variant-numeric:tabular-nums;padding:5px}& thead,& tfoot,& tr:nth-child(2n){background:#f5f5f5}& thead th{border-bottom:1px solid #ddd}&:not(.datatable-table){border-top:1px solid #666;border-bottom:1px solid #666}}blockquote{color:#666;border-left:.5em solid #eee;margin:0;padding:1px 1em}hr,.footnotes:before{border:1px dashed #ddd}.frontmatter{text-align:center}#TOC{& a{text-decoration:none}& ul{padding-left:1em;list-style:none}&>ul{padding:0}& ul ul{border-left:1px solid #b0c4de}}.body h2{border-bottom:1px solid #666}.body .appendix,.appendix~h2{border-bottom-style:dashed}.main-number:after{content:"."}span[class^=ref-number-]{font-weight:700}.ref-number-fig:after,.ref-number-tab:after{content:":"}.cross-ref-chp:before{content:"Chapter "}.cross-ref-sec:before{content:"Section "}.cross-ref-apd:before{content:"Appendix "}.cross-ref-fig:before,.ref-number-fig:before{content:"Figure "}.cross-ref-tab:before,.ref-number-tab:before{content:"Table "}.cross-ref-eqn:before,.MathJax_ref:has(mjx-mtext>mjx-c+mjx-c):before{content:"Equation "}.abstract,#refs{&:before{margin:1em auto;font-weight:700;display:block}}.abstract:before{content:"Abstract";text-align:center}#refs:before{content:"Bibliography";font-size:1.5em}.ref-paren-open:before{content:"("}.ref-paren-close:after{content:")"}.ref-semicolon:after{content:"; "}.ref-and:after{content:" and "}.ref-et-al:after{content:" et al.";font-style:italic}.footnote-ref a{&:before{content:"["}&:after{content:"]"}}section.footnotes{margin-top:2em;&:before{content:"";max-width:20em;display:block}}.fade{opacity:.6;background:repeating-linear-gradient(135deg,#fff,#fff 30px,#ddd 32px 32px)}@media print{body{max-width:100%}tr,img{break-inside:avoid}}@media only screen and (width>=992px){body:not(.pagesjs) pre:has(.line-numbers):not(:hover){white-space:pre}}
|
|
1
|
+
body{-webkit-print-color-adjust:exact;print-color-adjust:exact;max-width:800px;margin:auto;padding:1em;font-family:sans-serif;line-height:1.5}body,.abstract,code,.footnotes,footer,#refs,.caption{font-size:.9em}li li{font-size:.95em}ul:has(li>input[type=checkbox]){padding-left:1em;list-style:none}*,:before,:after{box-sizing:border-box}a{color:#4682b4}pre,img{max-width:100%}pre{white-space:pre-wrap;word-break:break-word}pre code{padding:1em;display:block;overflow-x:auto}code{font-family:DejaVu Sans Mono,Droid Sans Mono,Lucida Console,Consolas,Monaco,monospace}:not(pre,th)>code,code[class],div>.caption{background:#f8f8f8}pre>code:is(:not([class]),.language-plain,.language-none,.plain),.box,.figure,.table{background:inherit;border:1px solid #eee}pre>code{&.message{border-color:#9eeaf9}&.warning{background:#fff3cd;border-color:#fff3cd}&.error{background:#f8d7da;border-color:#f8d7da}}.fenced-chunk{border-left:1px solid #666}.code-fence{opacity:.4;border:1px dashed #666;border-left:2px solid;&:hover{opacity:inherit}}.box,.figure,.table,table{margin:1em auto}div>.caption{padding:1px 1em}.figure{& p:has(img,svg),& pre:has(svg){text-align:center}}.flex-col{justify-content:space-between;display:flex}table{&:only-child:not(.table>*){margin:auto}& th,& td{font-variant-numeric:tabular-nums;padding:5px}& thead,& tfoot,& tr:nth-child(2n){background:#f5f5f5}& thead th{border-bottom:1px solid #ddd}&:not(.datatable-table){border-top:1px solid #666;border-bottom:1px solid #666}}blockquote{color:#666;border-left:.5em solid #eee;margin:0;padding:1px 1em}hr,.footnotes:before{border:1px dashed #ddd}.frontmatter{text-align:center}#TOC{& a{text-decoration:none}& ul{columns:24em;padding-left:1em;list-style:none}&>ul{padding:0}& ul ul{border-left:1px solid #b0c4de}}.body h2{border-bottom:1px solid #666}.body .appendix,.appendix~h2{border-bottom-style:dashed}.main-number:after{content:"."}span[class^=ref-number-]{font-weight:700}.ref-number-fig:after,.ref-number-tab:after{content:":"}.cross-ref-chp:before{content:"Chapter "}.cross-ref-sec:before{content:"Section "}.cross-ref-apd:before{content:"Appendix "}.cross-ref-fig:before,.ref-number-fig:before{content:"Figure "}.cross-ref-tab:before,.ref-number-tab:before{content:"Table "}.cross-ref-eqn:before,.MathJax_ref:has(mjx-mtext>mjx-c+mjx-c):before{content:"Equation "}.abstract,#refs{&:before{margin:1em auto;font-weight:700;display:block}}.abstract:before{content:"Abstract";text-align:center}#refs:before{content:"Bibliography";font-size:1.5em}.ref-paren-open:before{content:"("}.ref-paren-close:after{content:")"}.ref-semicolon:after{content:"; "}.ref-and:after{content:" and "}.ref-et-al:after{content:" et al.";font-style:italic}.footnote-ref a{&:before{content:"["}&:after{content:"]"}}section.footnotes{margin-top:2em;&:before{content:"";max-width:20em;display:block}}.fade{opacity:.6;background:repeating-linear-gradient(135deg,#fff,#fff 30px,#ddd 32px 32px)}@media print{body{max-width:100%}tr,img{break-inside:avoid}}@media only screen and (width>=992px){body:not(.pagesjs) pre:has(.line-numbers):not(:hover){white-space:pre}}
|
|
2
2
|
/*# sourceMappingURL=default.min.css.map */
|
package/css/default.min.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"mappings":"AAAA,8IASA,oEACA,sBACA,iEACA,uCACA,gBACA,uBACA,+CACA,mDACA,2FACA,8DACA,8HACA,SACE,+BACA,kDACA,iDAEF,yCACA,oEAIE,yBAEF,0CACA,6BACA,QAAU,mDACV,qDACA,MACE,uCACA,wDACA,sDACA,wCACA,gFAKF,2EAMA,4CACA,+BACA,KACE,yBACA,
|
|
1
|
+
{"version":3,"mappings":"AAAA,8IASA,oEACA,sBACA,iEACA,uCACA,gBACA,uBACA,+CACA,mDACA,2FACA,8DACA,8HACA,SACE,+BACA,kDACA,iDAEF,yCACA,oEAIE,yBAEF,0CACA,6BACA,QAAU,mDACV,qDACA,MACE,uCACA,wDACA,sDACA,wCACA,gFAKF,2EAMA,4CACA,+BACA,KACE,yBACA,mDACA,eACA,uCAEF,sCACA,wDACA,+BACA,yCACA,wDACA,yCACA,yCACA,0CACA,+DACA,8DACA,yFACA,gBACE,wDAEF,sDACA,oDACA,mCACA,mCACA,kCACA,+BACA,qDACA,gBACE,qBACA,qBAEF,iCAEE,kDAEF,4FAIA,aACE,oBACA,2BAEF,sCACE","sources":["default.css"],"sourcesContent":["body {\n font-family: sans-serif;\n max-width: 800px;\n margin: auto;\n padding: 1em;\n line-height: 1.5;\n print-color-adjust: exact;\n -webkit-print-color-adjust: exact;\n}\nbody, .abstract, code, .footnotes, footer, #refs, .caption { font-size: .9em; }\nli li { font-size: .95em; }\nul:has(li > input[type=\"checkbox\"]) { list-style: none; padding-left: 1em; }\n*, :before, :after { box-sizing: border-box; }\na { color: steelblue; }\npre, img { max-width: 100%; }\npre { white-space: pre-wrap; word-break: break-word; }\npre code { display: block; padding: 1em; overflow-x: auto; }\ncode { font-family: 'DejaVu Sans Mono', 'Droid Sans Mono', 'Lucida Console', Consolas, Monaco, monospace; }\n:not(pre, th) > code, code[class], div > .caption { background: #f8f8f8; }\npre > code:is(:not([class]), .language-plain, .language-none, .plain), .box, .figure, .table { background: inherit; border: 1px solid #eee; }\npre > code {\n &.message { border-color: #9eeaf9; }\n &.warning { background: #fff3cd; border-color: #fff3cd; }\n &.error { background: #f8d7da; border-color: #f8d7da; }\n}\n.fenced-chunk { border-left: 1px solid #666; }\n.code-fence {\n opacity: .4;\n border: 1px dashed #666;\n border-left: 2px solid;\n &:hover { opacity: inherit; }\n}\n.box, .figure, .table, table { margin: 1em auto; }\ndiv > .caption { padding: 1px 1em; }\n.figure { p:has(img, svg), pre:has(svg) { text-align: center; } }\n.flex-col { display: flex; justify-content: space-between; }\ntable {\n &:only-child:not(.table > *) { margin: auto; }\n th, td { padding: 5px; font-variant-numeric: tabular-nums; }\n thead, tfoot, tr:nth-child(even) { background: whitesmoke; }\n thead th { border-bottom: 1px solid #ddd; }\n &:not(.datatable-table) {\n border-top: 1px solid #666;\n border-bottom: 1px solid #666;\n }\n}\nblockquote {\n color: #666;\n margin: 0;\n padding: 1px 1em;\n border-left: .5em solid #eee;\n}\nhr, .footnotes::before { border: 1px dashed #ddd; }\n.frontmatter { text-align: center; }\n#TOC {\n a { text-decoration: none; }\n ul { list-style: none; padding-left: 1em; columns: 24em; }\n & > ul { padding: 0; }\n ul ul { border-left: 1px solid lightsteelblue; }\n}\n.body h2 { border-bottom: 1px solid #666; }\n.body .appendix, .appendix ~ h2 { border-bottom-style: dashed; }\n.main-number::after { content: \".\"; }\nspan[class^=\"ref-number-\"] { font-weight: bold; }\n.ref-number-fig::after, .ref-number-tab::after { content: \":\"; }\n.cross-ref-chp::before { content: \"Chapter \"; }\n.cross-ref-sec::before { content: \"Section \"; }\n.cross-ref-apd::before { content: \"Appendix \"; }\n.cross-ref-fig::before, .ref-number-fig::before { content: \"Figure \"; }\n.cross-ref-tab::before, .ref-number-tab::before { content: \"Table \"; }\n.cross-ref-eqn::before, .MathJax_ref:has(mjx-mtext > mjx-c + mjx-c)::before { content: \"Equation \"; }\n.abstract, #refs {\n &::before { display: block; margin: 1em auto; font-weight: bold; }\n}\n.abstract::before { content: \"Abstract\"; text-align: center; }\n#refs::before { content: \"Bibliography\"; font-size: 1.5em; }\n.ref-paren-open::before { content: \"(\"; }\n.ref-paren-close::after { content: \")\"; }\n.ref-semicolon::after { content: \"; \"; }\n.ref-and::after { content: \" and \"; }\n.ref-et-al::after { content: \" et al.\"; font-style: italic; }\n.footnote-ref a {\n &::before { content: \"[\"; }\n &::after { content: \"]\"; }\n}\nsection.footnotes {\n margin-top: 2em;\n &::before { content: \"\"; display: block; max-width: 20em; }\n}\n.fade {\n background: repeating-linear-gradient(135deg, white, white 30px, #ddd 32px, #ddd 32px);\n opacity: 0.6;\n}\n@media print {\n body { max-width: 100%; }\n tr, img { break-inside: avoid; }\n}\n@media only screen and (min-width: 992px) {\n body:not(.pagesjs) pre:has(.line-numbers):not(:hover) { white-space: pre; }\n}\n"],"names":[]}
|
package/js/g2-patches.js
CHANGED
|
@@ -57,9 +57,16 @@ G2.register("data.column", (options) => {
|
|
|
57
57
|
// Re-register in G2's internal library so charts pick up the patched theme.
|
|
58
58
|
// The registry key is 'theme.light', 'theme.classicDark', etc.
|
|
59
59
|
const key = "theme." + name[0].toLowerCase() + name.slice(1);
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
|
|
60
|
+
// Previously, we used structuredClone on the theme object, but G2's Academy
|
|
61
|
+
// theme contains function values (like gridFilter) that can't be
|
|
62
|
+
// structurally cloned. To fix it, we wrote a recursive clone that copies
|
|
63
|
+
// functions by reference:
|
|
64
|
+
const safeClone = v => {
|
|
65
|
+
if (v === null || typeof v !== 'object') return v;
|
|
66
|
+
if (Array.isArray(v)) return v.map(safeClone);
|
|
67
|
+
return Object.fromEntries(Object.entries(v).map(([k, x]) => [k, safeClone(x)]));
|
|
68
|
+
};
|
|
69
|
+
const cloneFn = (...args) => safeClone(patched(...args));
|
|
63
70
|
G2[name] = cloneFn;
|
|
64
71
|
try { G2.register(key, cloneFn); } catch (_) {}
|
|
65
72
|
}
|
package/js/g2-patches.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
G2.register("data.column",e=>{const{value:t}=e;return async()=>{let e=t;if("string"==typeof t){const o=await fetch(t);e=await o.json()}const o=Object.keys(e);return 0===o.length?[]:Array.isArray(e[o[0]])?e[o[0]].map((t,r)=>o.reduce((t,o)=>(t[o]=e[o][r],t),{})):[e]}}),(()=>{const e=4/3,t=/[fF]ontSize$/,o=e=>e&&"object"==typeof e&&!Array.isArray(e),r=n=>{if(o(n))for(const[s,
|
|
1
|
+
G2.register("data.column",e=>{const{value:t}=e;return async()=>{let e=t;if("string"==typeof t){const o=await fetch(t);e=await o.json()}const o=Object.keys(e);return 0===o.length?[]:Array.isArray(e[o[0]])?e[o[0]].map((t,r)=>o.reduce((t,o)=>(t[o]=e[o][r],t),{})):[e]}}),(()=>{const e=4/3,t=/[fF]ontSize$/,o=e=>e&&"object"==typeof e&&!Array.isArray(e),r=n=>{if(o(n))for(const[s,a]of Object.entries(n))o(a)?r(a):"number"==typeof a&&t.test(s)&&(n[s]=a*e)},n=t=>{if(r(t),o(t.legendCategory)&&"number"==typeof t.legendCategory.itemMarkerSize&&(t.legendCategory.itemMarkerSize*=e),o(t.point))for(const e of Object.values(t.point))o(e)&&"number"==typeof e.r&&(e.r=4);return o(t.axis)&&(t.axis.gridStrokeOpacity=.25),t.inset=16,t};for(const e of["Light","Dark","Classic","ClassicDark","Academy"]){const t=G2[e];if("function"!=typeof t)continue;let o;const r=(...e)=>o??=n(t(...e)),s="theme."+e[0].toLowerCase()+e.slice(1),a=e=>null===e||"object"!=typeof e?e:Array.isArray(e)?e.map(a):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,a(t)])),c=(...e)=>a(r(...e));G2[e]=c;try{G2.register(s,c)}catch(e){}}const s=()=>(e,t)=>{if(void 0!==t.encode.size)return[e,t];const o=[];for(const t of e)o[t]=4;return[e,{...t,encode:{...t.encode,size:{type:"column",value:o,visual:!0}}}]};s.props={};const a=G2.corelib();for(const e of["mark.point","mark.beeswarm"])for(const[t,o]of(a[e]?.props?.postInference??[]).entries())o.type===G2.MaybeSize&&(a[e].props.postInference[t]={type:s});for(const e of["mark.point","mark.beeswarm"]){const t=a[e];if(!t?.props?.shape)continue;t.props.defaultShape="point";const o=Object.fromEntries(Object.entries(t.props.shape).sort(([e],[t])=>/^hollow/.test(e)-/^hollow/.test(t)));t.props.shape=o;for(const e of t.props.channels||[])"shape"===e.name&&(e.range=Object.keys(o))}const c=G2.graphlib?.()??{};for(const t of["mark.sankey","mark.chord","mark.treemap"]){const o=c[t];if("function"!=typeof o)continue;const r=function(...t){const r=o.apply(this,t);for(const t of Array.isArray(r)?r:[r])if(Array.isArray(t?.labels))for(const o of t.labels)"number"==typeof o?.fontSize&&(o.fontSize*=e);return r};r.props=o.props;try{G2.register(t,r)}catch(e){}}})();
|
|
2
2
|
//# sourceMappingURL=g2-patches.min.js.map
|
package/js/g2-patches.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["G2","register","options","value","async","d","resp","fetch","json","keys","Object","length","Array","isArray","map","_","i","reduce","row","key","FONT_SCALE","FONT_RE","isObj","v","scaleFontSizes","obj","entries","test","patchTheme","theme","legendCategory","itemMarkerSize","point","style","values","r","axis","gridStrokeOpacity","inset","name","original","cache","patched","args","toLowerCase","slice","
|
|
1
|
+
{"version":3,"names":["G2","register","options","value","async","d","resp","fetch","json","keys","Object","length","Array","isArray","map","_","i","reduce","row","key","FONT_SCALE","FONT_RE","isObj","v","scaleFontSizes","obj","entries","test","patchTheme","theme","legendCategory","itemMarkerSize","point","style","values","r","axis","gridStrokeOpacity","inset","name","original","cache","patched","args","toLowerCase","slice","safeClone","fromEntries","k","x","cloneFn","CustomMaybeSize","I","mark","undefined","encode","size","type","visual","props","lib","corelib","e","postInference","MaybeSize","shape","defaultShape","newShape","sort","a","b","ch","channels","range","graphLib","graphlib","orig","wrapped","result","apply","this","m","labels","l","fontSize"],"sources":["g2-patches.js"],"mappings":"AACAA,GAAGC,SAAS,cAAgBC,IAC1B,MAAMC,MAAEA,GAAUD,EAClB,OAAOE,UACL,IAAIC,EAAIF,EAER,GAAqB,iBAAVA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