Repository navigation
v1.13.0
Added
m-heatmap(series academic 数理・統計, purposescompare,correlation; paid packs only, not in the free pack for now): a grid of cells coloured by value, for confusion matrices, correlation matrices and attention maps. Child JSON{"rows": [labels], "cols": [labels], "values": [[…]], "unit"?, "digits"?, "highlight"?: [[row, col] or [row, col, step]]}(0-based; a row or column count that does not match the labels is an error and shows the placeholder). Colours are theme colours only, mixed withcolor-mix(in oklab, …, var(--bg)):scale="sequential"(default) from--bgtotone(termdefault,emph,accent2),scale="diverging"aroundcenter(default 0) withtoneabove andlowtone(emphdefault) below;range="[lo,hi]"fixes the scale (otherwise [min(0, smallest), largest], or symmetric around the centre). Cell colours follow the scale exactly (the colour is the data). Each cell's number is drawn in--fgor--bg, whichever has the higher computed contrast against that cell; where even that is under 4.5:1 (mid lightness) the number gets a 3 px halo in the other colour (paint-order: stroke). A legend bar on the right (min, centre, max).normalize="row"(proportions per row, confusion matrix; numbersshow="percent" | "count" | "both"),diag="on"(diagonal outlined in--fg), highlights outlined in--emph(both over a--bghalo),numbers="auto" | "on" | "off". Steps:build="rows"(one row per step; the default withnormalize="row"),"whole","cells"(the grid, then one highlight per step; the default with highlights). Labels at 26 px or 24 px, never smaller: long column labels turn vertical (rotate="auto" | "0" | "90"), and when there are too many only every k-th label is shown, with a warning; above 12×12 the cell numbers turn off automatically, with a warning, and they turn off whenever they would need less than 24 px. Row labels, column labels, the legend and the empty grid show from step 0; underctx.previewlater cells and outlines at the theme's--preview-opacity. Readable layer: a<table>of the values (the standard visually-hidden pattern: absolute, 1 px, clip, overflow hidden; highlighted cells marked); the drawing is aria-hidden. Variantsfade(0) andsweep(cells of a step from the top left, within the same step length)m-map-world(series social 社会, purposespatial; not in the free pack for now): the countries and regions of the world, the companion ofm-map-japan(docs/map-design.md). Equal Earth, central meridian 150°E (Pacific-centred only, map-design §6 2; the seam is at 30°W and a flow whose short way crosses it warns). Child JSON as inm-map-japan:regions(id= ISO alpha-3 / Natural Earth code / Japanese name, orgroup= the six regions 六州 from Natural Earth'sREGION_UN; overseas parts are coloured with the region of their geography: the overseas departments and territories フランス領ギアナ → 南アメリカ州 and レユニオン → アフリカ州, while parts of a country's own territory stay with it: ハワイ州 and アラスカ州 with the United States in 北アメリカ州, カナリア諸島 (an autonomous community) with Spain in ヨーロッパ州; Antarctica is in no region, grey, and named 南極大陸 withlabels="all"),categories(sets of countries with a legend, up to 4 series colours),values+classes(choropleth with a legend; classes as inm-map-japan),points,flows,shapes;grid="equator|graticule"; variantsfadesweepdraw; readable layer- Territory and names (map-design §4.5, §4.8; a fixed property of the data): data from Natural Earth 5.1.1's Japan point-of-view admin-0, so 北方領土・竹島・尖閣諸島 are Japan (竹島・尖閣諸島・沖ノ鳥島・南鳥島 drawn as dots of Japan); 南樺太 (south of 50°N) and the Kurils from 得撫島 north are cut out of Russia as 帰属未定地 (
XUD): ground-coloured, never coloured by a lesson, no name, with the four dashed boundary lines. Country names are the authorised-atlas names oftools/map/atlas-names.csv(15 differ from Natural Earth'sNAME_JA: 中国, 韓国, 北朝鮮, 台湾, ホンコン, …; ヴ is written with バ行 as in the atlases, dependencies too: イギリス領バージン諸島, アメリカ領バージン諸島). Taiwan is coloured with China in country colourings (regions,categories) and by its own value invalues(map-design §4.8.4) tools/map/build-world.mjs(withatlas-names.csvandworld.sha256): builds the embedded data (Visvalingam 22 km, 2 km for Japan and 帰属未定地; data block 54,568 bytes) and checks the owner of key points on the source and the final geometry;--cache <dir>downloads outside the repository.map-data-worldintools/test-all.mjschecks the block's sha256m-tree: branch labels and a highlighted path (GA item 7, owner-approved via standards). Nodebranchputs text on the link from its parent (a probability, a condition, yes/no): 24 px--fg, on the link into the child, clear of the line and of other labels (elbow: the bend moves to 20 px from the parent and the label sits on the longer last segment, above it withorient="right", beside it on the outer side withdown; the level gap widens to fit the labels anddownreserves their width beside the boxes; children are not folded into two rows;straight: beside the middle of the line on the outer side). Top-levelpath: ["root", …, "leaf"](parent to child from the root; otherwise the placeholder) is highlighted in--emph: a 6 px line traced over the link, a 4 px frame around each box it reaches, and that link'sbranchturned--emph; by default one link per step after the tree's last step (the step count grows), or all links in turn withinpathStep.pathNote(for example the product of the probabilities) appears beyond the last box (right of it withorient="right", below it withdown) at the box text size once the last link arrives; room for it is kept beyond the deepest level. The lecture view shows later steps' path at the theme's--preview-opacity. A tree without these fields renders as before (tools/test-default-variant.mjs). Demo slide 「確率の木:雨の日に遅れる確率」. Pack-visible bytes (tools/pack-bytes.mjs --base v1.11.0) +197 form-tree(one README bullet,branch?path?pathStep?pathNote?in the shape summary; details in anllm: omitblock); docs/conventions(.ja).md §2.2m-flow: decision nodes and loop-back edges for algorithm flowcharts (GA item 7, owner-approved via standards). Nodeshape: "diamond"draws a diamond inscribed in the node'sxywh(same tones,class="box"), and arrows are cut at its sides; yes/no go in the outgoing edges'labelas before. Edgeloop(true,"left","right","top","bottom";trueisrightwhen the ends are stacked vertically,bottomwhen side by side) routes an edge back to an earlier node around the outside instead of straight through boxes: it leaves and enters at the middle of that side of both boxes and runs 34 px beyond every box between the two ends (right angles), drawn from its start with the arrowhead riding its tip; itslabelgoes outside the long run (inside when outside would leave the figure),amountinside, andpulsedots follow the bends. Without these fields a lesson's DOM is byte-identical to v1.11.0 at every step in the talk and lecture views (checked on the v1.11.0 demo; m-flow has no variants, sotools/test-default-variant.mjsdoes not compare it). Demo slide 「1 から n までの和を求める手順」. Pack-visible bytes (tools/pack-bytes.mjs --base v1.11.0) −50 form-flow:shape:"diamond"(判断) andloop:true(戻る辺) named in the node and edge bullets, the details in anllm: omitblock, the shape schema unchanged; paid for by moving the colour bullet's history note (「v1.2.0 から。前は…薄かった」, not an authoring rule) into anllm: omitblockm-bars: negative values and 100 % stacked bars (GA item 7, owner-approved via standards). Negative values (bars that are not stacked): the value axis includes 0 and the bars grow from a--fgzero baseline, downwards (leftwards withorient="h") for negative values; ticks run both ways from 0 at the same interval and the 0 tick label follows the baseline; the range below 0 leaves room for the lowest bar's value label (40 px, or the label's width + 24 px across); value labels sit outside the bar end on its own side (above or right for positive values, below or left for negative ones), and so do series names. Before, a negative value drew no bar and its label fell below the axis; values that are all ≥ 0 render as before. 100 % stacked bars:stack="percent"divides each group's values by the group's total, on a 0–100 % axis (ticks with %), with each segment's share asdigits-digit % inside it, drawn only when its estimated text box (bold 24 px digit widths) fits inside the segment with at least 6 px on every side (ordinary stacks keep the v1.11.0 rule: under this rule the v1.11.0 demo would lose 「1.0」 and 「1.1」 of 卸 in 1 年目 and 2 年目, 31 and 34 px tall); the total at the bar end is not drawn (always 100 %).stackstays aboolprop ("percent"reads as true, so older releases draw an ordinary stack). Without these, a lesson's DOM is byte-identical to v1.11.0 at every step in the talk and lecture views (checked on the v1.11.0 demo; m-bars has no variants, sotools/test-default-variant.mjsdoes not compare it). Demo slide 「前の年からの増減と、答えの割合」 (both, side by side). Pack-visible bytes (tools/pack-bytes.mjs --base v1.11.0) −12 form-bars:"percent"named in the stack bullet, negative values and the details in anllm: omitblock, paid for by shortening the stack bullet's usage example
Tests
tools/test-heatmap.mjs(intools/test-all.mjs): m-heatmap's scale mapping (sequential, diverging, centre, clamping), row normalisation, the per-cell text colour and halo over full ramps (no browser), label thinning and rotation, number sizes and steps; in a browser in the default, kokugo and business themes, cell colours equal the scale exactly, every cell's number ≥ 4.5:1 against its own cell or its halo (the halo case occurs and reaches 4.5:1 against the text), fills only theme colours, steps and highlight timing, numbers off above 12×12, thinned labels ≥ 24 px with warnings, and the readable tabletools/test-contrast.mjs: a text with a 2–3 px halo (paint-order: stroke) counts against its halo colourtools/test-shape.mjs: m-heatmap's wrong-shape case (datainstead ofvalues);tools/variant-sync.mjs: m-heatmap inUSERStools/test-map-world.mjs(intools/test-all.mjs): names equal the table; at 6 heights × 5 widths and two label settings, 北方領土 lies in Japan's land, the island dots, 帰属未定地 (white, in no coloured path even with Russia coloured) and its 4 lines are drawn, the readable layer lists them once; each region coloured alone colours exactly the places on its continent (overseas departments and territories by geography; Hawaii and Alaska with the United States, the Canaries with Spain in ヨーロッパ州; Antarctica in none); 南極大陸 is named with labels="all"; no name has ヴ; Taiwan with China / by its own value; XUD refused with a warning; small elements (no error, sizes ≥ 0, inside, text ≥ 24 px); the seam warningtools/test-shape.mjs: m-map-world's wrong-shape case;tools/test-classes.mjs: its generated 4- and 5-class deck uses 47 country codes for m-map-world
Visible change
m-bars: a lesson with negative values now draws bars below a zero baseline (before: no bar, label under the axis). Lessons whose values are all ≥ 0 are byte-identical to v1.12.0 (DOM compared at every step).
Pack-visible bytes (Egatari Studio's AI pack), change since v1.12.0
Counted with node tools/pack-bytes.mjs --base v1.12.0.
- Free core:
m-bars−12,m-flow−50,m-menu+0,m-predict+0 - Free by subject (
m-curves,m-kpi,m-quad): +0 each - Kokugo (
m-gendai,m-kanbun,m-kobun): +0 each - Paid only:
m-tree+197; newm-heatmap1518,m-map-world2295; every other part +0
sha256 c4eacac92801520622c791fb2a439cbea761a42f3ce545ccefcaf0e88b60a00f egatari-components-v1.13.0.tar.gz