plotleaf 0.0.0-stage → 0.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 plotleaf contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,140 @@
1
- # Temporary Holding Version
1
+ # plotleaf
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Beautiful, interactive reports from Markdown and prepared JSON. Built for coding agents.
4
+
5
+ **The agent does the thinking. We do the rendering.**
6
+
7
+ [Source](https://github.com/LoueeD/plotleaf) · [Issues](https://github.com/LoueeD/plotleaf/issues) · [Verification](https://github.com/LoueeD/plotleaf/actions/workflows/ci.yml) · [Contributing](https://github.com/LoueeD/plotleaf/blob/main/CONTRIBUTING.md)
8
+
9
+ A report is one Markdown file, optionally accompanied by local JSON datasets. No application, configuration file, account, database or hosted service. Export one HTML file that keeps working offline.
10
+
11
+ ## Status
12
+
13
+ The initial MVP includes validation, live preview/reload, self-contained HTML export and a generated component specification. All bundled examples use fictional data.
14
+
15
+ Version **0.2.0** adds donut charts and prepared funnel/progress views to the Markdown report language.
16
+
17
+ Implemented components: responsive grids, metrics/comparisons, line/area/bar/donut charts, prepared funnel/progress stages, literal chart targets, sortable/formatted tables and callouts. Reports support light/dark system preference, native chart-data disclosures and responsive layouts. Filters, rich table cells, maps and reusable compositions remain planned increments.
18
+
19
+ ## Quick start
20
+
21
+ Requires Node 22 or newer. Create `report.md` and any referenced JSON files, then run the CLI directly. No application setup or Bun installation is needed:
22
+
23
+ ```bash
24
+ npx plotleaf report.md
25
+ npx plotleaf dev report.md --no-open --port 3000
26
+ npx plotleaf validate report.md --json
27
+ npx plotleaf build report.md --out ./exports/report.html
28
+ npx plotleaf schema
29
+ ```
30
+
31
+ `plotleaf report.md` is an alias for `dev`. `build` defaults to `report.html` beside the source. Relative dataset paths resolve from the Markdown file's directory; an explicit `--out` resolves from the caller's working directory. Exports contain no preview connection and need no source files at viewing time.
32
+
33
+ ## A report
34
+
35
+ ```markdown
36
+ ---
37
+ title: Team adoption
38
+ description: Usage and growth from prepared data.
39
+ ---
40
+
41
+ # Team adoption
42
+
43
+ An overview of active teams and their recent growth.
44
+
45
+ :::grid{columns="2"}
46
+ ::metric{label="Teams" value="1492" comparison="34% vs previous quarter" direction="up" sentiment="positive"}
47
+ ::metric{label="Conversion" value="0.103" format="percent"}
48
+ :::
49
+
50
+ ::area{data="./usage.json" x="date" y="teams" xType="date" title="Active teams" target="1600" targetLabel="Target"}
51
+
52
+ :::table{data="./plans.json" title="By plan"}
53
+ ::column{field="plan" label="Plan"}
54
+ ::column{field="teams" label="Teams" format="number"}
55
+ ::column{field="change" label="Δ QoQ" format="percent" sign="always" semantics="higher-is-better"}
56
+ :::
57
+ ```
58
+
59
+ `usage.json`:
60
+
61
+ ```json
62
+ [
63
+ { "date": "2026-11-01", "teams": 1410 },
64
+ { "date": "2026-11-02", "teams": 1492 }
65
+ ]
66
+ ```
67
+
68
+ `plans.json`:
69
+
70
+ ```json
71
+ [
72
+ { "plan": "Pro", "teams": 884, "change": 0.41 },
73
+ { "plan": "Team", "teams": 432, "change": 0.22 },
74
+ { "plan": "Free", "teams": 176, "change": 0.09 }
75
+ ]
76
+ ```
77
+
78
+ Attributes are literal values, not JavaScript. Keep leaf directives on one line and close containers explicitly. Use a longer outer fence (`::::grid`) when nesting another container, such as a table. Use Markdown headings and rules for sections/dividers.
79
+
80
+ Numbers, comparisons, trends and findings are prepared by the author. `percent` uses ratios (`0.12` → 12%); `percentage-points` uses point values (`0.8` → 0.8 pt); `currency:GBP` uses major units. Whole currency amounts omit `.00`; nonzero cents retain two decimal places. Formatting is `en-GB`; date display is UTC. An increase does not imply positive business sentiment.
81
+
82
+ Use `schema` for current property schemas, child rules and input limits. The installed package includes `schema/components.json`, generated from the validation registry, and `skills/plotleaf/SKILL.md`, a reusable report-authoring guide. Public examples under `examples/storefront/`, `examples/adoption/` and `examples/onboarding/` contain only fictional data.
83
+
84
+ ## Donut and funnel
85
+
86
+ ```markdown
87
+ ::donut{data="./plans.json" category="plan" value="teams" title="Teams by plan"}
88
+ ::funnel{data="./funnel.json" stage="stage" value="teams" total="baseline" share="share" status="status" title="Funnel by stage"}
89
+ ```
90
+
91
+ Donuts accept up to eight unique, nonblank categories with nonnegative numeric values. Prepare mutually exclusive parts of one whole. Zero values stay in the legend/table; an all-zero dataset shows an empty state. Categories remain in source order and are never grouped automatically.
92
+
93
+ Funnel data supplies each stage explicitly, for example `{"stage":"Activated","teams":25,"baseline":100,"share":0.25,"status":"below-target"}`. `total` maps the positive denominator; `share` maps a ratio from 0 to 1 and must agree with `value / total` within 0.0005. Status is optional and is never inferred: supported values are `on-target`, `below-target`, `at-risk` and `neutral`. Stages stay in source order, with a limit of 20. Native meters, text status and full data disclosures work without JavaScript.
94
+
95
+ Try the fictional `examples/onboarding/report.md` from a source checkout. See [M3 contracts and tradeoffs](https://github.com/LoueeD/plotleaf/blob/main/docs/m3-visualizations.md).
96
+
97
+ ## Data and security boundaries
98
+
99
+ Prepare JSON arrays of flat scalar records. Charts preserve input order and do not calculate, join or aggregate data. Date/number x values must be unique and increasing; line/area nulls are gaps and bar nulls are errors. Tables sort raw typed values. Explicit table columns also select the fields exported; an inferred table includes every source field.
100
+
101
+ Local JSON must stay within the report directory, including after resolving symlinks. Raw HTML, remote assets/data, executable components and report-authored code are rejected. Script/data escaping, sanitization, size limits and safe output writes are part of compilation. Invalid reports do not replace an existing export.
102
+
103
+ Charts and sorting require JavaScript. Prose, metrics, tables and native chart-data disclosures remain usable without it. All data included in an export is readable by recipients; hiding a value is not redaction. Prepare sensitive datasets before rendering.
104
+
105
+ ## Source development
106
+
107
+ Use Bun 1.4.4 for development and Node 22+ for the published CLI/runtime checks:
108
+
109
+ ```bash
110
+ bun install --frozen-lockfile
111
+ bun run build
112
+
113
+ node dist/cli.js examples/storefront/report.md
114
+ node dist/cli.js validate examples/storefront/report.md --json
115
+ node dist/cli.js build examples/storefront/report.md
116
+ ```
117
+
118
+ The first CLI command opens a browser and watches the Markdown and referenced JSON. Add `--no-open` to print the URL without launching a browser. Ctrl-C stops the server. A failed edit shows diagnostics and recovers after you fix it.
119
+
120
+ Open `examples/storefront/report.html` after export, or try the narrative example in `examples/adoption/report.md`.
121
+
122
+ ## Development and verification
123
+
124
+ ```bash
125
+ bun run typecheck # official TypeScript reference check
126
+ bun run typecheck:tsrs # candidate Rust checker; fast preset disabled
127
+ bun run build # Node CLI, fixed browser assets and component spec
128
+ bun test # core tests; CLI integration explicitly runs Node
129
+ bun run test:consumer # temporary npm/npx install, no Bun on consumer PATH
130
+ node node_modules/@playwright/test/cli.js install chromium webkit
131
+ bun run test:browser # real Chromium/WebKit checks
132
+ ```
133
+
134
+ Build before running integration tests. Consumer checks need npm/registry access on the first run; they accept `PLOTLEAF_OFFLINE=1` once dependencies are cached. `PLOTLEAF_NODE` selects the Node executable used by integration/browser tests. No JavaScript bundling happens while compiling a user's report.
135
+
136
+ Bun builds a Node-target ESM executable and browser-target IIFE assets. The browser graph contains modular ECharts and plain TypeScript, with no UI framework. TSRS is a development-only candidate; official TypeScript checking remains authoritative. Engine guidance and planning notes belong to the source checkout and are excluded from the npm artifact.
137
+
138
+ MIT licensed. Bundled chart licenses/notices are retained in the package and exported HTML.
139
+
140
+ See [CONTRIBUTING.md](https://github.com/LoueeD/plotleaf/blob/main/CONTRIBUTING.md) for the platform matrix and contribution workflow. The `v0.1.0` source tag reproduces the published npm archive; subsequent source changes require a new package version before release. Renderer releases require the owner's manual visual review of the running preview, in addition to automated checks.
@@ -0,0 +1,304 @@
1
+ plotleaf
2
+ MIT License
3
+
4
+ Copyright (c) 2026 plotleaf contributors
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
23
+
24
+
25
+ ────────────────────────────────────────
26
+
27
+ echarts 6.1.0
28
+
29
+ Apache License
30
+ Version 2.0, January 2004
31
+ http://www.apache.org/licenses/
32
+
33
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
34
+
35
+ 1. Definitions.
36
+
37
+ "License" shall mean the terms and conditions for use, reproduction,
38
+ and distribution as defined by Sections 1 through 9 of this document.
39
+
40
+ "Licensor" shall mean the copyright owner or entity authorized by
41
+ the copyright owner that is granting the License.
42
+
43
+ "Legal Entity" shall mean the union of the acting entity and all
44
+ other entities that control, are controlled by, or are under common
45
+ control with that entity. For the purposes of this definition,
46
+ "control" means (i) the power, direct or indirect, to cause the
47
+ direction or management of such entity, whether by contract or
48
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
49
+ outstanding shares, or (iii) beneficial ownership of such entity.
50
+
51
+ "You" (or "Your") shall mean an individual or Legal Entity
52
+ exercising permissions granted by this License.
53
+
54
+ "Source" form shall mean the preferred form for making modifications,
55
+ including but not limited to software source code, documentation
56
+ source, and configuration files.
57
+
58
+ "Object" form shall mean any form resulting from mechanical
59
+ transformation or translation of a Source form, including but
60
+ not limited to compiled object code, generated documentation,
61
+ and conversions to other media types.
62
+
63
+ "Work" shall mean the work of authorship, whether in Source or
64
+ Object form, made available under the License, as indicated by a
65
+ copyright notice that is included in or attached to the work
66
+ (an example is provided in the Appendix below).
67
+
68
+ "Derivative Works" shall mean any work, whether in Source or Object
69
+ form, that is based on (or derived from) the Work and for which the
70
+ editorial revisions, annotations, elaborations, or other modifications
71
+ represent, as a whole, an original work of authorship. For the purposes
72
+ of this License, Derivative Works shall not include works that remain
73
+ separable from, or merely link (or bind by name) to the interfaces of,
74
+ the Work and Derivative Works thereof.
75
+
76
+ "Contribution" shall mean any work of authorship, including
77
+ the original version of the Work and any modifications or additions
78
+ to that Work or Derivative Works thereof, that is intentionally
79
+ submitted to Licensor for inclusion in the Work by the copyright owner
80
+ or by an individual or Legal Entity authorized to submit on behalf of
81
+ the copyright owner. For the purposes of this definition, "submitted"
82
+ means any form of electronic, verbal, or written communication sent
83
+ to the Licensor or its representatives, including but not limited to
84
+ communication on electronic mailing lists, source code control systems,
85
+ and issue tracking systems that are managed by, or on behalf of, the
86
+ Licensor for the purpose of discussing and improving the Work, but
87
+ excluding communication that is conspicuously marked or otherwise
88
+ designated in writing by the copyright owner as "Not a Contribution."
89
+
90
+ "Contributor" shall mean Licensor and any individual or Legal Entity
91
+ on behalf of whom a Contribution has been received by Licensor and
92
+ subsequently incorporated within the Work.
93
+
94
+ 2. Grant of Copyright License. Subject to the terms and conditions of
95
+ this License, each Contributor hereby grants to You a perpetual,
96
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
97
+ copyright license to reproduce, prepare Derivative Works of,
98
+ publicly display, publicly perform, sublicense, and distribute the
99
+ Work and such Derivative Works in Source or Object form.
100
+
101
+ 3. Grant of Patent License. Subject to the terms and conditions of
102
+ this License, each Contributor hereby grants to You a perpetual,
103
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
104
+ (except as stated in this section) patent license to make, have made,
105
+ use, offer to sell, sell, import, and otherwise transfer the Work,
106
+ where such license applies only to those patent claims licensable
107
+ by such Contributor that are necessarily infringed by their
108
+ Contribution(s) alone or by combination of their Contribution(s)
109
+ with the Work to which such Contribution(s) was submitted. If You
110
+ institute patent litigation against any entity (including a
111
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
112
+ or a Contribution incorporated within the Work constitutes direct
113
+ or contributory patent infringement, then any patent licenses
114
+ granted to You under this License for that Work shall terminate
115
+ as of the date such litigation is filed.
116
+
117
+ 4. Redistribution. You may reproduce and distribute copies of the
118
+ Work or Derivative Works thereof in any medium, with or without
119
+ modifications, and in Source or Object form, provided that You
120
+ meet the following conditions:
121
+
122
+ (a) You must give any other recipients of the Work or
123
+ Derivative Works a copy of this License; and
124
+
125
+ (b) You must cause any modified files to carry prominent notices
126
+ stating that You changed the files; and
127
+
128
+ (c) You must retain, in the Source form of any Derivative Works
129
+ that You distribute, all copyright, patent, trademark, and
130
+ attribution notices from the Source form of the Work,
131
+ excluding those notices that do not pertain to any part of
132
+ the Derivative Works; and
133
+
134
+ (d) If the Work includes a "NOTICE" text file as part of its
135
+ distribution, then any Derivative Works that You distribute must
136
+ include a readable copy of the attribution notices contained
137
+ within such NOTICE file, excluding those notices that do not
138
+ pertain to any part of the Derivative Works, in at least one
139
+ of the following places: within a NOTICE text file distributed
140
+ as part of the Derivative Works; within the Source form or
141
+ documentation, if provided along with the Derivative Works; or,
142
+ within a display generated by the Derivative Works, if and
143
+ wherever such third-party notices normally appear. The contents
144
+ of the NOTICE file are for informational purposes only and
145
+ do not modify the License. You may add Your own attribution
146
+ notices within Derivative Works that You distribute, alongside
147
+ or as an addendum to the NOTICE text from the Work, provided
148
+ that such additional attribution notices cannot be construed
149
+ as modifying the License.
150
+
151
+ You may add Your own copyright statement to Your modifications and
152
+ may provide additional or different license terms and conditions
153
+ for use, reproduction, or distribution of Your modifications, or
154
+ for any such Derivative Works as a whole, provided Your use,
155
+ reproduction, and distribution of the Work otherwise complies with
156
+ the conditions stated in this License.
157
+
158
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
159
+ any Contribution intentionally submitted for inclusion in the Work
160
+ by You to the Licensor shall be under the terms and conditions of
161
+ this License, without any additional terms or conditions.
162
+ Notwithstanding the above, nothing herein shall supersede or modify
163
+ the terms of any separate license agreement you may have executed
164
+ with Licensor regarding such Contributions.
165
+
166
+ 6. Trademarks. This License does not grant permission to use the trade
167
+ names, trademarks, service marks, or product names of the Licensor,
168
+ except as required for reasonable and customary use in describing the
169
+ origin of the Work and reproducing the content of the NOTICE file.
170
+
171
+ 7. Disclaimer of Warranty. Unless required by applicable law or
172
+ agreed to in writing, Licensor provides the Work (and each
173
+ Contributor provides its Contributions) on an "AS IS" BASIS,
174
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
175
+ implied, including, without limitation, any warranties or conditions
176
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
177
+ PARTICULAR PURPOSE. You are solely responsible for determining the
178
+ appropriateness of using or redistributing the Work and assume any
179
+ risks associated with Your exercise of permissions under this License.
180
+
181
+ 8. Limitation of Liability. In no event and under no legal theory,
182
+ whether in tort (including negligence), contract, or otherwise,
183
+ unless required by applicable law (such as deliberate and grossly
184
+ negligent acts) or agreed to in writing, shall any Contributor be
185
+ liable to You for damages, including any direct, indirect, special,
186
+ incidental, or consequential damages of any character arising as a
187
+ result of this License or out of the use or inability to use the
188
+ Work (including but not limited to damages for loss of goodwill,
189
+ work stoppage, computer failure or malfunction, or any and all
190
+ other commercial damages or losses), even if such Contributor
191
+ has been advised of the possibility of such damages.
192
+
193
+ 9. Accepting Warranty or Additional Liability. While redistributing
194
+ the Work or Derivative Works thereof, You may choose to offer,
195
+ and charge a fee for, acceptance of support, warranty, indemnity,
196
+ or other liability obligations and/or rights consistent with this
197
+ License. However, in accepting such obligations, You may act only
198
+ on Your own behalf and on Your sole responsibility, not on behalf
199
+ of any other Contributor, and only if You agree to indemnify,
200
+ defend, and hold each Contributor harmless for any liability
201
+ incurred by, or claims asserted against, such Contributor by reason
202
+ of your accepting any such warranty or additional liability.
203
+
204
+ END OF TERMS AND CONDITIONS
205
+
206
+ APPENDIX: How to apply the Apache License to your work.
207
+
208
+ To apply the Apache License to your work, attach the following
209
+ boilerplate notice, with the fields enclosed by brackets "[]"
210
+ replaced with your own identifying information. (Don't include
211
+ the brackets!) The text should be enclosed in the appropriate
212
+ comment syntax for the file format. We also recommend that a
213
+ file or class name and description of purpose be included on the
214
+ same "printed page" as the copyright notice for easier
215
+ identification within third-party archives.
216
+
217
+ Copyright [yyyy] [name of copyright owner]
218
+
219
+ Licensed under the Apache License, Version 2.0 (the "License");
220
+ you may not use this file except in compliance with the License.
221
+ You may obtain a copy of the License at
222
+
223
+ http://www.apache.org/licenses/LICENSE-2.0
224
+
225
+ Unless required by applicable law or agreed to in writing, software
226
+ distributed under the License is distributed on an "AS IS" BASIS,
227
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
228
+ See the License for the specific language governing permissions and
229
+ limitations under the License.
230
+
231
+
232
+
233
+
234
+
235
+ ========================================================================
236
+ Apache ECharts Subcomponents:
237
+
238
+ The Apache ECharts project contains subcomponents with separate copyright
239
+ notices and license terms. Your use of the source code for these
240
+ subcomponents is also subject to the terms and conditions of the following
241
+ licenses.
242
+
243
+ BSD 3-Clause (d3.js):
244
+ The following files embed [d3.js](https://github.com/d3/d3) BSD 3-Clause:
245
+ `/src/chart/treemap/treemapLayout.ts`,
246
+ `/src/chart/tree/layoutHelper.ts`,
247
+ `/src/chart/graph/forceHelper.ts`,
248
+ `/src/util/number.ts`
249
+ See `/licenses/LICENSE-d3` for details of the license.
250
+
251
+ Apache ECharts
252
+ Copyright 2017-2026 The Apache Software Foundation
253
+
254
+ This product includes software developed at
255
+ The Apache Software Foundation (https://www.apache.org/).
256
+
257
+ ────────────────────────────────────────
258
+
259
+ zrender 6.1.0
260
+ BSD 3-Clause License
261
+
262
+ Copyright (c) 2017, Baidu Inc.
263
+ All rights reserved.
264
+
265
+ Redistribution and use in source and binary forms, with or without
266
+ modification, are permitted provided that the following conditions are met:
267
+
268
+ * Redistributions of source code must retain the above copyright notice, this
269
+ list of conditions and the following disclaimer.
270
+
271
+ * Redistributions in binary form must reproduce the above copyright notice,
272
+ this list of conditions and the following disclaimer in the documentation
273
+ and/or other materials provided with the distribution.
274
+
275
+ * Neither the name of the copyright holder nor the names of its
276
+ contributors may be used to endorse or promote products derived from
277
+ this software without specific prior written permission.
278
+
279
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
280
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
281
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
282
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
283
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
284
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
285
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
286
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
287
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
288
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
289
+
290
+ ────────────────────────────────────────
291
+
292
+ tslib 2.3.0
293
+ Copyright (c) Microsoft Corporation.
294
+
295
+ Permission to use, copy, modify, and/or distribute this software for any
296
+ purpose with or without fee is hereby granted.
297
+
298
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
299
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
300
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
301
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
302
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
303
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
304
+ PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1 @@
1
+ (()=>{var d=new Intl.Collator("en-GB",{numeric:!0,sensitivity:"base"});for(let a of document.querySelectorAll("table[data-plotleaf-table]")){let r=a.tBodies[0];if(!r)continue;let i=[...r.rows],s=-1,n=!1;for(let o of a.querySelectorAll("thead button[data-column]"))o.disabled=!1,o.addEventListener("click",()=>{let u=Number(o.dataset.column);n=s===u?!n:!1,s=u;let c=i.map((e,t)=>({row:e,index:t,value:JSON.parse(e.cells[u]?.dataset.raw??"null")}));c.sort((e,t)=>{if(e.value===null||t.value===null)return e.value===t.value?e.index-t.index:e.value===null?1:-1;let l=typeof e.value==="number"&&typeof t.value==="number"?e.value-t.value:d.compare(String(e.value),String(t.value));return(n?-l:l)||e.index-t.index}),r.replaceChildren(...c.map((e)=>e.row)),a.querySelectorAll("thead th").forEach((e)=>{let t=e.contains(o);e.setAttribute("aria-sort",t?n?"descending":"ascending":"none");let l=e.querySelector(".sort-indicator");if(l)l.textContent=t?n?"↓":"↑":"↕"})})}})();