reactive-md 0.3.0 → 0.4.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/CHANGELOG-ch.md +96 -0
- package/CHANGELOG.md +96 -40
- package/CONTRIBUTING-ch.md +62 -0
- package/CONTRIBUTING.md +64 -61
- package/README-ch.md +122 -0
- package/README-en.md +146 -0
- package/README.md +146 -88
- package/SECURITY-ch.md +80 -0
- package/SECURITY.md +80 -68
- package/THIRD_PARTY_NOTICES.md +85 -1
- package/bin/reactive-md.mjs +40 -0
- package/cli/args.mjs +181 -0
- package/cli/assets.mjs +390 -0
- package/cli/build.mjs +268 -0
- package/cli/document.mjs +130 -0
- package/cli/errors.mjs +61 -0
- package/cli/fs-utils.mjs +133 -0
- package/cli/glob.mjs +203 -0
- package/cli/help.mjs +138 -0
- package/cli/lint.mjs +177 -0
- package/cli/main.mjs +55 -0
- package/cli/migrate.mjs +368 -0
- package/cli/package.mjs +209 -0
- package/dist-library/reactive-md-react.js +3603 -1690
- package/dist-library/reactive-md.css +1 -1
- package/dist-library/reactive-md.js +1798 -4
- package/dist-library/runtime-DtjdPXxJ.js +15410 -0
- package/dist-library/types/index.d.ts +1 -0
- package/dist-library/types/local/LocalDocumentView.d.ts +66 -3
- package/dist-library/types/local/authoring.d.ts +63 -0
- package/dist-library/types/local/collection-functions.d.ts +4 -0
- package/dist-library/types/local/colors.d.ts +2 -0
- package/dist-library/types/local/compiler.d.ts +3 -3
- package/dist-library/types/local/computations.d.ts +53 -0
- package/dist-library/types/local/data-functions.d.ts +22 -0
- package/dist-library/types/local/data-table.d.ts +65 -0
- package/dist-library/types/local/dates.d.ts +2 -0
- package/dist-library/types/local/dependencies.d.ts +31 -0
- package/dist-library/types/local/diagnostics.d.ts +1450 -0
- package/dist-library/types/local/expression.d.ts +13 -3
- package/dist-library/types/local/formatting.d.ts +41 -0
- package/dist-library/types/local/heading-anchors.d.ts +17 -0
- package/dist-library/types/local/i18n.d.ts +18 -0
- package/dist-library/types/local/index.d.ts +18 -1
- package/dist-library/types/local/limits.d.ts +33 -1
- package/dist-library/types/local/locale.d.ts +1 -0
- package/dist-library/types/local/math.d.ts +6 -1
- package/dist-library/types/local/parser.d.ts +10 -4
- package/dist-library/types/local/render-types.d.ts +5 -1
- package/dist-library/types/local/retention.d.ts +23 -0
- package/dist-library/types/local/schema.d.ts +25 -3
- package/dist-library/types/local/source-migration.d.ts +35 -0
- package/dist-library/types/local/state.d.ts +80 -0
- package/dist-library/types/local/text-length.d.ts +13 -0
- package/dist-library/types/local/theme.d.ts +30 -0
- package/dist-library/types/local/types.d.ts +120 -4
- package/dist-library/types/local/validation.d.ts +32 -0
- package/dist-library/types/local/version.d.ts +1 -1
- package/dist-library/types/local/worker.d.ts +82 -0
- package/dist-library/types/react/index.d.ts +4 -1
- package/dist-library/types/shareable.d.ts +64 -0
- package/dist-standalone/reactive-md-standalone.css +2 -0
- package/dist-standalone/reactive-md-standalone.js +57 -0
- package/docs/author-tools-ch.md +56 -0
- package/docs/author-tools-en.md +56 -0
- package/docs/compatibility-ch.md +103 -0
- package/docs/compatibility-en.md +103 -0
- package/docs/component-development-ch.md +210 -0
- package/docs/component-development-en.md +210 -0
- package/docs/component-protocol-ch.md +710 -0
- package/docs/component-protocol-en.md +710 -0
- package/docs/computations-formatting-ch.md +87 -0
- package/docs/computations-formatting-en.md +87 -0
- package/docs/constraints-collections-ch.md +84 -0
- package/docs/constraints-collections-en.md +84 -0
- package/docs/diagnostics-counting-ch.md +84 -0
- package/docs/diagnostics-counting-en.md +84 -0
- package/docs/local-components-v2-ch.md +138 -0
- package/docs/local-components-v2-en.md +104 -0
- package/docs/{local-guide.md → local-guide-ch.md} +961 -936
- package/docs/local-guide-en.md +961 -0
- package/docs/local-integration-ch.md +363 -0
- package/docs/local-integration-en.md +363 -0
- package/docs/{local-interaction-syntax.md → local-interaction-syntax-ch.md} +485 -437
- package/docs/local-interaction-syntax-en.md +483 -0
- package/docs/performance-ch.md +76 -0
- package/docs/performance-en.md +76 -0
- package/docs/release-0.4.0-ch.md +89 -0
- package/docs/release-0.4.0-en.md +89 -0
- package/docs/releasing-ch.md +101 -0
- package/docs/releasing-en.md +101 -0
- package/docs/shareable-export-ch.md +205 -0
- package/docs/shareable-export-en.md +207 -0
- package/docs/source-versioning-ch.md +159 -0
- package/docs/source-versioning-en.md +159 -0
- package/docs/theme-protocol-ch.md +107 -0
- package/docs/theme-protocol-en.md +107 -0
- package/examples/conformance/README.md +53 -11
- package/examples/conformance/component-protocol-1.json +482 -0
- package/examples/conformance/component-protocol-1.schema.json +76 -0
- package/examples/conformance/history/v0.3.1/catalog.reactive.md +20 -0
- package/examples/conformance/history/v0.3.1/charts.reactive.md +73 -0
- package/examples/conformance/history/v0.3.1/checklist.reactive.md +32 -0
- package/examples/conformance/history/v0.3.1/comparison.reactive.md +47 -0
- package/examples/conformance/history/v0.3.1/components.reactive.md +44 -0
- package/examples/conformance/history/v0.3.1/counter.reactive.md +7 -0
- package/examples/conformance/history/v0.3.1/diagnostics.reactive.md +54 -0
- package/examples/conformance/history/v0.3.1/diagram.reactive.md +44 -0
- package/examples/conformance/history/v0.3.1/gallery.reactive.md +61 -0
- package/examples/conformance/history/v0.3.1/local-draft-1.json +50 -0
- package/examples/conformance/history/v0.3.1/parameters.reactive.md +36 -0
- package/examples/conformance/history/v0.3.1/planning.reactive.md +24 -0
- package/examples/conformance/history/v0.3.1/pricing.reactive.md +20 -0
- package/examples/conformance/history/v0.3.1/provenance.json +72 -0
- package/examples/conformance/local-draft-1.json +50 -49
- package/examples/conformance/local-draft-2.json +212 -0
- package/examples/integration/README.md +45 -29
- package/examples/integration/core/index.mjs +32 -19
- package/examples/integration/react/index.html +1 -1
- package/examples/integration/react/main.jsx +5 -5
- package/examples/integration/worker/index.html +19 -0
- package/examples/integration/worker/main.js +61 -0
- package/examples/integration/worker/package.json +13 -0
- package/examples/integration/worker/worker.js +3 -0
- package/examples/local/README.md +72 -66
- package/examples/local/catalog.reactive.md +14 -14
- package/examples/local/charts.reactive.md +73 -73
- package/examples/local/checklist.reactive.md +19 -19
- package/examples/local/comparison.reactive.md +23 -23
- package/examples/local/components.reactive.md +20 -20
- package/examples/local/counter.reactive.md +4 -4
- package/examples/local/diagnostics.reactive.md +25 -25
- package/examples/local/diagram.reactive.md +20 -20
- package/examples/local/gallery.reactive.md +31 -31
- package/examples/local/parameters.reactive.md +19 -19
- package/examples/local/planning.reactive.md +15 -15
- package/examples/local/pricing.reactive.md +10 -10
- package/examples/local/recipes/invoice-zh.reactive.md +36 -0
- package/examples/local/recipes/invoice.reactive.md +36 -0
- package/examples/local/recipes/workshop-zh.reactive.md +33 -0
- package/examples/local/recipes/workshop.reactive.md +33 -0
- package/examples/local/showcase/README.md +25 -0
- package/examples/local/showcase/explore.reactive.md +102 -0
- package/examples/local/showcase/flow.reactive.md +86 -0
- package/examples/local/showcase/forms.reactive.md +126 -0
- package/examples/local/showcase/functions.reactive.md +119 -0
- package/examples/local/showcase/layout.reactive.md +100 -0
- package/examples/local/showcase/statistics.reactive.md +108 -0
- package/examples/local/showcase/tasks.reactive.md +89 -0
- package/examples/local/showcase/zh/explore.reactive.md +102 -0
- package/examples/local/showcase/zh/flow.reactive.md +86 -0
- package/examples/local/showcase/zh/forms.reactive.md +126 -0
- package/examples/local/showcase/zh/functions.reactive.md +119 -0
- package/examples/local/showcase/zh/layout.reactive.md +100 -0
- package/examples/local/showcase/zh/statistics.reactive.md +108 -0
- package/examples/local/showcase/zh/tasks.reactive.md +89 -0
- package/examples/local/zh/catalog.reactive.md +20 -0
- package/examples/local/zh/charts.reactive.md +73 -0
- package/examples/local/zh/checklist.reactive.md +32 -0
- package/examples/local/zh/comparison.reactive.md +47 -0
- package/examples/local/zh/components.reactive.md +44 -0
- package/examples/local/zh/counter.reactive.md +7 -0
- package/examples/local/zh/diagnostics.reactive.md +54 -0
- package/examples/local/zh/diagram.reactive.md +44 -0
- package/examples/local/zh/gallery.reactive.md +61 -0
- package/examples/local/zh/parameters.reactive.md +36 -0
- package/examples/local/zh/planning.reactive.md +24 -0
- package/examples/local/zh/pricing.reactive.md +20 -0
- package/package.json +90 -75
- package/README.en.md +0 -75
- package/dist-library/runtime-D4phFXOr.js +0 -10937
- package/docs/compatibility.md +0 -67
- package/docs/local-integration.md +0 -193
- package/docs/performance.md +0 -30
- package/docs/releasing.md +0 -92
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Find components in the document
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Type "visual", "input" or another keyword into the search box above the table. Click a column name to sort, and use the paging controls to move between pages.
|
|
4
4
|
|
|
5
|
-
<panel title="
|
|
6
|
-
<table label="
|
|
7
|
-
|
|
|
5
|
+
<panel title="Local component catalog">
|
|
6
|
+
<table label="Component catalog" page-size="4">
|
|
7
|
+
| Name | Category | Purpose |
|
|
8
8
|
| --- | --- | --- |
|
|
9
|
-
| slider |
|
|
10
|
-
| toggle |
|
|
11
|
-
| choices |
|
|
12
|
-
| chart |
|
|
13
|
-
| plot |
|
|
14
|
-
| diagram |
|
|
15
|
-
| checklist |
|
|
16
|
-
| timer |
|
|
9
|
+
| slider | Input | Drag to adjust a number |
|
|
10
|
+
| toggle | Input | Flip a switch |
|
|
11
|
+
| choices | Input | Pick from a few options |
|
|
12
|
+
| chart | Visual | Turn a Markdown table into a chart |
|
|
13
|
+
| plot | Visual | Draw a function with LaTeX |
|
|
14
|
+
| diagram | Visual | Select nodes to explore explanations |
|
|
15
|
+
| checklist | Content | Tick off completed items |
|
|
16
|
+
| timer | Utility | Start, pause and reset a countdown |
|
|
17
17
|
</table>
|
|
18
18
|
</panel>
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
The catalog data lives in this document. Searching filters the table directly, and restoring the defaults clears the query and returns to the original order.
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
<chart title="
|
|
6
|
-
|
|
|
7
|
-
| --- | ---: | ---: |
|
|
8
|
-
|
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
</chart>
|
|
13
|
-
|
|
14
|
-
##
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<panel title="
|
|
19
|
-
<number bind="P" label="
|
|
20
|
-
<number bind="m" label="
|
|
21
|
-
<slider bind="r" label="
|
|
22
|
-
<slider bind="t" label="
|
|
23
|
-
</panel>
|
|
24
|
-
|
|
25
|
-
<plot min="0" max="{{ t }}" label="
|
|
26
|
-
$$
|
|
27
|
-
y =
|
|
28
|
-
\begin{cases}
|
|
29
|
-
P + 12mx, & r = 0 \\
|
|
30
|
-
P\left(1+\frac{r}{1200}\right)^{12x}
|
|
31
|
-
+ m\frac{\left(1+\frac{r}{1200}\right)^{12x}-1}{r/1200}, & r \ne 0
|
|
32
|
-
\end{cases}
|
|
33
|
-
$$
|
|
34
|
-
</plot>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
##
|
|
39
|
-
|
|
40
|
-
<grid>
|
|
41
|
-
<card title="
|
|
42
|
-
<chart kind="donut" title="
|
|
43
|
-
|
|
|
44
|
-
| --- | ---: |
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
</chart>
|
|
50
|
-
</card>
|
|
51
|
-
|
|
52
|
-
<card title="
|
|
53
|
-
<chart kind="scatter" title="
|
|
54
|
-
|
|
|
55
|
-
| ---: | ---: |
|
|
56
|
-
| 150 | 120 |
|
|
57
|
-
| 200 | 230 |
|
|
58
|
-
| 220 | 180 |
|
|
59
|
-
| 120 | 90 |
|
|
60
|
-
</chart>
|
|
61
|
-
</card>
|
|
62
|
-
</grid>
|
|
63
|
-
|
|
64
|
-
##
|
|
65
|
-
|
|
66
|
-
<slider bind="people" label="
|
|
67
|
-
|
|
68
|
-
<chart title="
|
|
69
|
-
|
|
|
70
|
-
| --- | ---: |
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
</chart>
|
|
1
|
+
# Charts follow their inputs
|
|
2
|
+
|
|
3
|
+
## Comparing several budget series
|
|
4
|
+
|
|
5
|
+
<chart title="Actual cost vs budget" y-label="USD">
|
|
6
|
+
| Category | Actual cost | Budget |
|
|
7
|
+
| --- | ---: | ---: |
|
|
8
|
+
| Content | 120 | 150 |
|
|
9
|
+
| Visual | 230 | 200 |
|
|
10
|
+
| Interaction | 180 | 220 |
|
|
11
|
+
| Testing | 90 | 120 |
|
|
12
|
+
</chart>
|
|
13
|
+
|
|
14
|
+
## Savings curve
|
|
15
|
+
|
|
16
|
+
Deposit a fixed amount at the end of every month, compounded monthly at a fixed annual rate. $P$ is the initial amount, $m$ is the monthly deposit, and $r$ is the annual rate in percent.
|
|
17
|
+
|
|
18
|
+
<panel title="Adjust savings parameters">
|
|
19
|
+
<number bind="P" label="Initial amount" initial="10000" min="0" step="100">
|
|
20
|
+
<number bind="m" label="Monthly deposit" initial="500" min="0" step="100">
|
|
21
|
+
<slider bind="r" label="Annual rate (%)" initial="5" min="0" max="10" step="0.5">
|
|
22
|
+
<slider bind="t" label="Years" initial="20" min="1" max="40">
|
|
23
|
+
</panel>
|
|
24
|
+
|
|
25
|
+
<plot min="0" max="{{ t }}" label="Savings growth" x-label="Years" y-label="Amount">
|
|
26
|
+
$$
|
|
27
|
+
y =
|
|
28
|
+
\begin{cases}
|
|
29
|
+
P + 12mx, & r = 0 \\
|
|
30
|
+
P\left(1+\frac{r}{1200}\right)^{12x}
|
|
31
|
+
+ m\frac{\left(1+\frac{r}{1200}\right)^{12x}-1}{r/1200}, & r \ne 0
|
|
32
|
+
\end{cases}
|
|
33
|
+
$$
|
|
34
|
+
</plot>
|
|
35
|
+
|
|
36
|
+
Move the pointer to the end of the curve to read the balance at the end of year {{ t }}. Set the annual rate to 0 to compare growth from deposits alone.
|
|
37
|
+
|
|
38
|
+
## Shares and scatter
|
|
39
|
+
|
|
40
|
+
<grid>
|
|
41
|
+
<card title="Cost share">
|
|
42
|
+
<chart kind="donut" title="Share of actual cost">
|
|
43
|
+
| Category | Actual cost |
|
|
44
|
+
| --- | ---: |
|
|
45
|
+
| Content | 120 |
|
|
46
|
+
| Visual | 230 |
|
|
47
|
+
| Interaction | 180 |
|
|
48
|
+
| Testing | 90 |
|
|
49
|
+
</chart>
|
|
50
|
+
</card>
|
|
51
|
+
|
|
52
|
+
<card title="Budget vs actual">
|
|
53
|
+
<chart kind="scatter" title="Budget scatter" x="Budget" y="Actual" x-label="Budget" y-label="Actual">
|
|
54
|
+
| Budget | Actual |
|
|
55
|
+
| ---: | ---: |
|
|
56
|
+
| 150 | 120 |
|
|
57
|
+
| 200 | 230 |
|
|
58
|
+
| 220 | 180 |
|
|
59
|
+
| 120 | 90 |
|
|
60
|
+
</chart>
|
|
61
|
+
</card>
|
|
62
|
+
</grid>
|
|
63
|
+
|
|
64
|
+
## Charts read the same parameters
|
|
65
|
+
|
|
66
|
+
<slider bind="people" label="People" initial="2" min="1" max="20">
|
|
67
|
+
|
|
68
|
+
<chart title="Plan cost by headcount" y-label="USD">
|
|
69
|
+
| Plan | Monthly cost |
|
|
70
|
+
| --- | ---: |
|
|
71
|
+
| Basic | {{ people * 20 }} |
|
|
72
|
+
| Pro | {{ people * 35 }} |
|
|
73
|
+
</chart>
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Organize a walkthrough with a checklist
|
|
2
2
|
|
|
3
|
-
<panel title="
|
|
4
|
-
<checklist bind="done" label="
|
|
5
|
-
- [x]
|
|
6
|
-
- [ ]
|
|
7
|
-
- [ ]
|
|
3
|
+
<panel title="Walkthrough checklist">
|
|
4
|
+
<checklist bind="done" label="Complete these steps">
|
|
5
|
+
- [x] Read the source document
|
|
6
|
+
- [ ] Adjust parameters and watch the results
|
|
7
|
+
- [ ] Try it at phone width
|
|
8
8
|
</checklist>
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Done: **{{ len(done) }} / 3**.
|
|
11
11
|
|
|
12
|
-
<progress label="
|
|
12
|
+
<progress label="Completion" value="{{ len(done) / 3 * 100 }}">
|
|
13
13
|
|
|
14
14
|
<if when="{{ len(done) == 3 }}">
|
|
15
|
-
<alert tone="success" title="
|
|
16
|
-
|
|
15
|
+
<alert tone="success" title="Walkthrough complete">
|
|
16
|
+
You have read the source, tried the interactions and checked the narrow layout.
|
|
17
17
|
</alert>
|
|
18
18
|
</if>
|
|
19
19
|
</panel>
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Search, sorting and paging
|
|
22
22
|
|
|
23
|
-
<table label="
|
|
24
|
-
|
|
|
23
|
+
<table label="Component price examples" page-size="3">
|
|
24
|
+
| Name | Category | Price |
|
|
25
25
|
| --- | --- | ---: |
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
26
|
+
| Document | Basic | 20 |
|
|
27
|
+
| Parameter panel | Input | 45 |
|
|
28
|
+
| Chart | Visual | 80 |
|
|
29
|
+
| Diagram | Visual | 65 |
|
|
30
|
+
| Checklist | Basic | 30 |
|
|
31
|
+
| Plan | Utility | 35 |
|
|
32
32
|
</table>
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Side by side, easier to compare
|
|
2
2
|
|
|
3
|
-
<panel title="
|
|
4
|
-
<toggle bind="annual" label="
|
|
3
|
+
<panel title="Payment method">
|
|
4
|
+
<toggle bind="annual" label="Pay annually and save 20%">
|
|
5
5
|
</panel>
|
|
6
6
|
|
|
7
7
|
<grid>
|
|
8
|
-
<card title="
|
|
9
|
-
|
|
8
|
+
<card title="Basic plan">
|
|
9
|
+
For individuals and small projects.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
**{{ annual ? 80 : 100 }} USD per month**.
|
|
12
12
|
|
|
13
|
-
<badge
|
|
13
|
+
<badge>Local documents</badge>
|
|
14
14
|
</card>
|
|
15
15
|
|
|
16
|
-
<card title="
|
|
17
|
-
|
|
16
|
+
<card title="Pro plan">
|
|
17
|
+
For teams that need collaboration and room to grow.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
**{{ annual ? 160 : 200 }} USD per month**.
|
|
20
20
|
|
|
21
|
-
<badge tone="success"
|
|
21
|
+
<badge tone="success">More components</badge>
|
|
22
22
|
</card>
|
|
23
23
|
</grid>
|
|
24
24
|
|
|
25
|
-
<tabs label="
|
|
26
|
-
<tab label="
|
|
27
|
-
|
|
|
25
|
+
<tabs label="Plan details">
|
|
26
|
+
<tab label="Feature comparison">
|
|
27
|
+
| Capability | Basic plan | Pro plan |
|
|
28
28
|
| --- | --- | --- |
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
29
|
+
| Parameter adjustment | Included | Included |
|
|
30
|
+
| Text binding | Included | Included |
|
|
31
|
+
| Content organization | Basic layout | Charts and diagrams |
|
|
32
32
|
</tab>
|
|
33
33
|
|
|
34
|
-
<tab label="
|
|
35
|
-
|
|
34
|
+
<tab label="Buying advice">
|
|
35
|
+
Choose a plan for what you need, then compare how the billing cycle changes the cost.
|
|
36
36
|
</tab>
|
|
37
37
|
</tabs>
|
|
38
38
|
|
|
39
39
|
<accordion>
|
|
40
|
-
<disclosure label="
|
|
41
|
-
|
|
40
|
+
<disclosure label="How is the cost calculated?">
|
|
41
|
+
Annual billing applies a 20% discount to the monthly list price, and the equivalent monthly cost is shown above.
|
|
42
42
|
</disclosure>
|
|
43
43
|
|
|
44
|
-
<disclosure label="
|
|
45
|
-
|
|
44
|
+
<disclosure label="Can I switch at any time?">
|
|
45
|
+
Toggle the switch above to compare the two billing cycles. This is a local calculation example.
|
|
46
46
|
</disclosure>
|
|
47
47
|
</accordion>
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Organize interactions with content
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Hover over <tooltip text="When an input changes, the related text and charts update automatically.">reactive bindings</tooltip>, or focus it with the keyboard to read the explanation.
|
|
4
4
|
|
|
5
|
-
<panel title="
|
|
6
|
-
<radio-group bind="preference" label="
|
|
7
|
-
<option value="concise"
|
|
8
|
-
<option value="detailed"
|
|
5
|
+
<panel title="Reading preferences">
|
|
6
|
+
<radio-group bind="preference" label="Explanation style">
|
|
7
|
+
<option value="concise">Concise</option>
|
|
8
|
+
<option value="detailed">Detailed</option>
|
|
9
9
|
</radio-group>
|
|
10
10
|
</panel>
|
|
11
11
|
|
|
12
12
|
<if when="{{ preference == 'concise' }}">
|
|
13
|
-
|
|
13
|
+
Name the input and reference it in the prose.
|
|
14
14
|
</if>
|
|
15
15
|
|
|
16
16
|
<if when="{{ preference == 'detailed' }}">
|
|
17
|
-
|
|
17
|
+
Name an input parameter with `bind` and read it with `{{ }}` to compute results. When readers adjust a control, the related content updates immediately.
|
|
18
18
|
</if>
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Read at your own pace
|
|
21
21
|
|
|
22
|
-
<accordion label="
|
|
23
|
-
<disclosure label="
|
|
24
|
-
|
|
22
|
+
<accordion label="Reading order">
|
|
23
|
+
<disclosure label="Understand the parameters" open>
|
|
24
|
+
Find what readers can change, such as headcount, unit price or amplitude.
|
|
25
25
|
</disclosure>
|
|
26
26
|
|
|
27
|
-
<disclosure label="
|
|
28
|
-
|
|
27
|
+
<disclosure label="Write down the relationship">
|
|
28
|
+
Connect inputs and results with an expression, for example `{{ people * 100 }}`.
|
|
29
29
|
</disclosure>
|
|
30
30
|
|
|
31
|
-
<disclosure label="
|
|
32
|
-
|
|
31
|
+
<disclosure label="Choose how to present it">
|
|
32
|
+
Use prose for a single result, charts for comparisons, and function curves for mathematical relationships.
|
|
33
33
|
</disclosure>
|
|
34
34
|
</accordion>
|
|
35
35
|
|
|
36
|
-
<alert title="
|
|
37
|
-
|
|
36
|
+
<alert title="Keep exploring">
|
|
37
|
+
Switch the option above and watch the explanation change.
|
|
38
38
|
</alert>
|
|
39
39
|
|
|
40
|
-
<badge tone="success"
|
|
40
|
+
<badge tone="success">Local interaction</badge>
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
|
44
|
-
>
|
|
44
|
+
> Headings, blockquotes, links and images still follow Markdown. Components only handle the parts that need interaction.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Counter
|
|
2
2
|
|
|
3
|
-
<counter bind="count" label="
|
|
3
|
+
<counter bind="count" label="Current value">
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The prose can read it too: **{{ count }}**.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Use the component's own plus, minus and reset buttons.
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Diagnostics example
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This document intentionally keeps errors to exercise the diagnostic messages. Start with the other documents in this folder for correct examples.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Reference to a misspelled parameter name
|
|
6
6
|
|
|
7
|
-
<slider bind="seats" label="
|
|
7
|
+
<slider bind="seats" label="People" initial="2" min="1" max="20">
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Current headcount: {{ seat }}.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Duplicate initial declaration
|
|
12
12
|
|
|
13
|
-
<number bind="seats" label="
|
|
13
|
+
<number bind="seats" label="Another headcount input" initial="3" min="1" max="20">
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Initial value out of range
|
|
16
16
|
|
|
17
|
-
<slider bind="ratio" label="
|
|
17
|
+
<slider bind="ratio" label="Ratio" initial="12" min="0" max="10">
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Condition type error
|
|
20
20
|
|
|
21
21
|
<if when="{{ seats }}">
|
|
22
|
-
|
|
22
|
+
This needs a boolean condition, such as seats greater than 5.
|
|
23
23
|
</if>
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## Unknown tag
|
|
26
26
|
|
|
27
|
-
<slidr label="
|
|
27
|
+
<slidr label="Misspelled slider" />
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## Event outside the local interaction language
|
|
30
30
|
|
|
31
|
-
<counter label="
|
|
31
|
+
<counter label="Counter" on-click="increment">
|
|
32
32
|
|
|
33
|
-
##
|
|
33
|
+
## Missing node
|
|
34
34
|
|
|
35
|
-
<diagram label="
|
|
36
|
-
<node id="input" label="
|
|
37
|
-
|
|
35
|
+
<diagram label="Broken edge">
|
|
36
|
+
<node id="input" label="Input">
|
|
37
|
+
This is the only node.
|
|
38
38
|
</node>
|
|
39
39
|
<edge from="input" to="missing">
|
|
40
40
|
</diagram>
|
|
41
41
|
|
|
42
|
-
##
|
|
42
|
+
## Unsupported math structure
|
|
43
43
|
|
|
44
|
-
<plot label="
|
|
44
|
+
<plot label="Integrals are not part of the plot grammar">
|
|
45
45
|
$$ y = \int_0^x t^2\,dt $$
|
|
46
46
|
</plot>
|
|
47
47
|
|
|
48
|
-
##
|
|
48
|
+
## Invalid chart data
|
|
49
49
|
|
|
50
|
-
<chart title="
|
|
51
|
-
|
|
|
50
|
+
<chart title="Units mixed into a numeric column">
|
|
51
|
+
| Item | Cost |
|
|
52
52
|
| --- | ---: |
|
|
53
|
-
|
|
|
53
|
+
| Content | 20 USD |
|
|
54
54
|
</chart>
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Make explanations explorable
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Click a node or use the keyboard to select a step and read its description.
|
|
4
4
|
|
|
5
|
-
<diagram bind="selected" initial="input" label="
|
|
6
|
-
<node id="input" label="
|
|
7
|
-
|
|
5
|
+
<diagram bind="selected" initial="input" label="Reactive state flow">
|
|
6
|
+
<node id="input" label="Input">
|
|
7
|
+
Readers change parameters with sliders, switches and text fields.
|
|
8
8
|
</node>
|
|
9
9
|
|
|
10
|
-
<node id="compute" label="
|
|
11
|
-
|
|
10
|
+
<node id="compute" label="Compute">
|
|
11
|
+
Formulas that depend on those parameters are recalculated.
|
|
12
12
|
</node>
|
|
13
13
|
|
|
14
|
-
<node id="view" label="
|
|
15
|
-
|
|
14
|
+
<node id="view" label="View">
|
|
15
|
+
Prose, charts and hints update with the result.
|
|
16
16
|
</node>
|
|
17
17
|
|
|
18
|
-
<edge from="input" to="compute" label="
|
|
19
|
-
<edge from="compute" to="view" label="
|
|
18
|
+
<edge from="input" to="compute" label="Parameter change">
|
|
19
|
+
<edge from="compute" to="view" label="Updated result">
|
|
20
20
|
</diagram>
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Current step: {{ selected == 'input' ? 'Input' : selected == 'compute' ? 'Compute' : 'View' }}.
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## Change parameters and watch the curve
|
|
25
25
|
|
|
26
|
-
<panel title="
|
|
27
|
-
<slider bind="a" label="
|
|
28
|
-
<slider bind="f" label="
|
|
26
|
+
<panel title="Sine wave parameters">
|
|
27
|
+
<slider bind="a" label="Amplitude" initial="1" min="0" max="3" step="0.5">
|
|
28
|
+
<slider bind="f" label="Frequency parameter" initial="1" min="0.5" max="3" step="0.5">
|
|
29
29
|
</panel>
|
|
30
30
|
|
|
31
|
-
<plot min="0" max="12.56" label="
|
|
31
|
+
<plot min="0" max="12.56" label="Sine wave" x-label="x" y-label="Displacement">
|
|
32
32
|
$$ y = a\sin(fx) $$
|
|
33
33
|
</plot>
|
|
34
34
|
|
|
35
35
|
<if when="{{ a == 0 }}">
|
|
36
|
-
|
|
36
|
+
The amplitude is zero, so the curve lies flat on the horizontal axis.
|
|
37
37
|
</if>
|
|
38
38
|
|
|
39
|
-
##
|
|
39
|
+
## Overlay two curves
|
|
40
40
|
|
|
41
|
-
<plot min="-5" max="5" label="
|
|
41
|
+
<plot min="-5" max="5" label="Parabola and line">
|
|
42
42
|
$$ y = x^2 $$
|
|
43
43
|
$$ y = 2x + 1 $$
|
|
44
44
|
</plot>
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Common component gallery
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Inputs and live results
|
|
4
4
|
|
|
5
|
-
<panel title="
|
|
6
|
-
<input bind="name" label="
|
|
7
|
-
<number bind="quantity" label="
|
|
5
|
+
<panel title="Describe your plan">
|
|
6
|
+
<input bind="name" label="Name" initial="Alex" placeholder="Enter a name">
|
|
7
|
+
<number bind="quantity" label="Quantity" initial="3" min="1" max="20">
|
|
8
8
|
|
|
9
|
-
<select bind="plan" label="
|
|
10
|
-
<option value="basic"
|
|
11
|
-
<option value="pro"
|
|
9
|
+
<select bind="plan" label="Plan" initial="pro">
|
|
10
|
+
<option value="basic">Basic</option>
|
|
11
|
+
<option value="pro">Pro</option>
|
|
12
12
|
</select>
|
|
13
13
|
|
|
14
|
-
<toggle bind="annual" label="
|
|
15
|
-
<toggle bind="express" label="
|
|
16
|
-
<slider bind="budgetLevel" label="
|
|
14
|
+
<toggle bind="annual" label="Annual billing (20% off)">
|
|
15
|
+
<toggle bind="express" label="Show express checklist" initial="true">
|
|
16
|
+
<slider bind="budgetLevel" label="Budget level" initial="50" step="10">
|
|
17
17
|
</panel>
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Hello, **{{ name }}**.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Estimated cost: **{{ round(quantity * 80 * (plan == 'pro' ? 1 : 0.8) * (annual ? 0.8 : 1)) }} USD**.
|
|
22
22
|
|
|
23
23
|
<if when="{{ quantity >= 5 }}">
|
|
24
|
-
<badge tone="success"
|
|
24
|
+
<badge tone="success">Team tier reached</badge>
|
|
25
25
|
</if>
|
|
26
26
|
|
|
27
|
-
|
|
|
27
|
+
| Condition | Current choice |
|
|
28
28
|
| --- | --- |
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
29
|
+
| Plan | {{ plan == 'pro' ? 'Pro' : 'Basic' }} |
|
|
30
|
+
| Annual billing | {{ annual ? 'On' : 'Off' }} |
|
|
31
|
+
| Budget level | {{ budgetLevel }} |
|
|
32
32
|
|
|
33
33
|
<if when="{{ express }}">
|
|
34
|
-
<checklist label="
|
|
35
|
-
- [x]
|
|
36
|
-
- [ ]
|
|
34
|
+
<checklist label="Express preparation">
|
|
35
|
+
- [x] Express checklist shown
|
|
36
|
+
- [ ] Confirm the delivery time
|
|
37
37
|
</checklist>
|
|
38
38
|
</if>
|
|
39
39
|
|
|
40
|
-
##
|
|
40
|
+
## Components that work on their own
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
These components do not expose parameters to the prose, so they omit bind.
|
|
43
43
|
|
|
44
44
|
<grid>
|
|
45
|
-
<card title="
|
|
46
|
-
<counter label="
|
|
45
|
+
<card title="People counter">
|
|
46
|
+
<counter label="Participants" initial="2" min="1" max="20">
|
|
47
47
|
</card>
|
|
48
48
|
|
|
49
|
-
<card title="
|
|
50
|
-
<timer label="
|
|
49
|
+
<card title="Short focus">
|
|
50
|
+
<timer label="One-minute countdown">
|
|
51
51
|
</card>
|
|
52
52
|
</grid>
|
|
53
53
|
|
|
54
|
-
##
|
|
54
|
+
## Show code as-is
|
|
55
55
|
|
|
56
56
|
```markdown
|
|
57
|
-
<slider bind="example" label="
|
|
58
|
-
|
|
57
|
+
<slider bind="example" label="Example parameter">
|
|
58
|
+
Current value: {{ example }}.
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
The code above is displayed as an example only and does not create a control.
|