Skip to content

Commit 4576b58

Browse files
committed
Expose BigNumber; improve BigNumber API & schema
Export BigNumber from the library and update chart specs/validation and AI schema to reflect its own props and defaults. BigNumber: accept nullable value prop, make mode fallback to tile defaults, normalize pushed time (Date | number), tighten ref types, and add a runtime test for unknown mode. Update chartSpecs/validationMap to remove BigNumber from common prop-bag and declare its own width/height/className/chartSize metadata. Fix SVG path generation in thresholdSparkline to avoid invalid leading L commands. Update AI schema/docs and bundle-size strings (value/ai sizes and chartSize/width/height defaults/descriptions). Misc: add BigNumber to ScaleAware demo imports/map and various formatting/exports cleanup, and adjust the examples coverage baseline. Many small whitespace/formatting tweaks across docs and exports.
1 parent f0e31d9 commit 4576b58

20 files changed

Lines changed: 296 additions & 204 deletions

.clinerules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- Install: `npm install semiotic`
55
<!-- semiotic-bundle-sizes:start -->
66
<!-- Auto-generated by scripts/sync-bundle-sizes.mjs — do not edit by hand. -->
7-
- **Use sub-path imports** — `semiotic/xy` (86KB gz), `semiotic/ordinal` (70KB gz), `semiotic/network` (64KB gz), `semiotic/geo` (52KB gz), `semiotic/realtime` (91KB gz), `semiotic/server` (122KB gz), `semiotic/utils` (22KB gz), `semiotic/recipes` (5KB gz), `semiotic/themes` (4KB gz), `semiotic/data` (3KB gz), `semiotic/value` (7KB gz), `semiotic/ai` (218KB gz). Full `semiotic` is 191KB gz.
7+
- **Use sub-path imports** — `semiotic/xy` (86KB gz), `semiotic/ordinal` (70KB gz), `semiotic/network` (64KB gz), `semiotic/geo` (52KB gz), `semiotic/realtime` (91KB gz), `semiotic/server` (122KB gz), `semiotic/utils` (22KB gz), `semiotic/recipes` (5KB gz), `semiotic/themes` (4KB gz), `semiotic/data` (3KB gz), `semiotic/value` (6KB gz), `semiotic/ai` (218KB gz). Full `semiotic` is 191KB gz.
88
<!-- semiotic-bundle-sizes:end -->
99
- CLI: `npx semiotic-ai [--schema|--compact|--examples|--doctor]` · MCP: `npx semiotic-mcp`
1010

.cursorrules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- Install: `npm install semiotic`
55
<!-- semiotic-bundle-sizes:start -->
66
<!-- Auto-generated by scripts/sync-bundle-sizes.mjs — do not edit by hand. -->
7-
- **Use sub-path imports** — `semiotic/xy` (86KB gz), `semiotic/ordinal` (70KB gz), `semiotic/network` (64KB gz), `semiotic/geo` (52KB gz), `semiotic/realtime` (91KB gz), `semiotic/server` (122KB gz), `semiotic/utils` (22KB gz), `semiotic/recipes` (5KB gz), `semiotic/themes` (4KB gz), `semiotic/data` (3KB gz), `semiotic/value` (7KB gz), `semiotic/ai` (218KB gz). Full `semiotic` is 191KB gz.
7+
- **Use sub-path imports** — `semiotic/xy` (86KB gz), `semiotic/ordinal` (70KB gz), `semiotic/network` (64KB gz), `semiotic/geo` (52KB gz), `semiotic/realtime` (91KB gz), `semiotic/server` (122KB gz), `semiotic/utils` (22KB gz), `semiotic/recipes` (5KB gz), `semiotic/themes` (4KB gz), `semiotic/data` (3KB gz), `semiotic/value` (6KB gz), `semiotic/ai` (218KB gz). Full `semiotic` is 191KB gz.
88
<!-- semiotic-bundle-sizes:end -->
99
- CLI: `npx semiotic-ai [--schema|--compact|--examples|--doctor]` · MCP: `npx semiotic-mcp`
1010

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- Install: `npm install semiotic`
55
<!-- semiotic-bundle-sizes:start -->
66
<!-- Auto-generated by scripts/sync-bundle-sizes.mjs — do not edit by hand. -->
7-
- **Use sub-path imports**`semiotic/xy` (86KB gz), `semiotic/ordinal` (70KB gz), `semiotic/network` (64KB gz), `semiotic/geo` (52KB gz), `semiotic/realtime` (91KB gz), `semiotic/server` (122KB gz), `semiotic/utils` (22KB gz), `semiotic/recipes` (5KB gz), `semiotic/themes` (4KB gz), `semiotic/data` (3KB gz), `semiotic/value` (7KB gz), `semiotic/ai` (218KB gz). Full `semiotic` is 191KB gz.
7+
- **Use sub-path imports**`semiotic/xy` (86KB gz), `semiotic/ordinal` (70KB gz), `semiotic/network` (64KB gz), `semiotic/geo` (52KB gz), `semiotic/realtime` (91KB gz), `semiotic/server` (122KB gz), `semiotic/utils` (22KB gz), `semiotic/recipes` (5KB gz), `semiotic/themes` (4KB gz), `semiotic/data` (3KB gz), `semiotic/value` (6KB gz), `semiotic/ai` (218KB gz). Full `semiotic` is 191KB gz.
88
<!-- semiotic-bundle-sizes:end -->
99
- CLI: `npx semiotic-ai [--schema|--compact|--examples|--doctor]` · MCP: `npx semiotic-mcp`
1010

.windsurfrules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- Install: `npm install semiotic`
55
<!-- semiotic-bundle-sizes:start -->
66
<!-- Auto-generated by scripts/sync-bundle-sizes.mjs — do not edit by hand. -->
7-
- **Use sub-path imports** — `semiotic/xy` (86KB gz), `semiotic/ordinal` (70KB gz), `semiotic/network` (64KB gz), `semiotic/geo` (52KB gz), `semiotic/realtime` (91KB gz), `semiotic/server` (122KB gz), `semiotic/utils` (22KB gz), `semiotic/recipes` (5KB gz), `semiotic/themes` (4KB gz), `semiotic/data` (3KB gz), `semiotic/value` (7KB gz), `semiotic/ai` (218KB gz). Full `semiotic` is 191KB gz.
7+
- **Use sub-path imports** — `semiotic/xy` (86KB gz), `semiotic/ordinal` (70KB gz), `semiotic/network` (64KB gz), `semiotic/geo` (52KB gz), `semiotic/realtime` (91KB gz), `semiotic/server` (122KB gz), `semiotic/utils` (22KB gz), `semiotic/recipes` (5KB gz), `semiotic/themes` (4KB gz), `semiotic/data` (3KB gz), `semiotic/value` (6KB gz), `semiotic/ai` (218KB gz). Full `semiotic` is 191KB gz.
88
<!-- semiotic-bundle-sizes:end -->
99
- CLI: `npx semiotic-ai [--schema|--compact|--examples|--doctor]` · MCP: `npx semiotic-mcp`
1010

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- Install: `npm install semiotic`
55
<!-- semiotic-bundle-sizes:start -->
66
<!-- Auto-generated by scripts/sync-bundle-sizes.mjs — do not edit by hand. -->
7-
- **Use sub-path imports**`semiotic/xy` (86KB gz), `semiotic/ordinal` (70KB gz), `semiotic/network` (64KB gz), `semiotic/geo` (52KB gz), `semiotic/realtime` (91KB gz), `semiotic/server` (122KB gz), `semiotic/utils` (22KB gz), `semiotic/recipes` (5KB gz), `semiotic/themes` (4KB gz), `semiotic/data` (3KB gz), `semiotic/value` (6KB gz), `semiotic/ai` (218KB gz). Full `semiotic` is 191KB gz.
7+
- **Use sub-path imports**`semiotic/xy` (86KB gz), `semiotic/ordinal` (70KB gz), `semiotic/network` (64KB gz), `semiotic/geo` (52KB gz), `semiotic/realtime` (91KB gz), `semiotic/server` (122KB gz), `semiotic/utils` (22KB gz), `semiotic/recipes` (5KB gz), `semiotic/themes` (4KB gz), `semiotic/data` (3KB gz), `semiotic/value` (6KB gz), `semiotic/ai` (222KB gz). Full `semiotic` is 191KB gz.
88
<!-- semiotic-bundle-sizes:end -->
99
- CLI: `npx semiotic-ai [--schema|--compact|--examples|--doctor]` · MCP: `npx semiotic-mcp`
1010

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ Semiotic ships 12 entry points. **Don't import from `"semiotic"` unless you need
298298
| `semiotic/themes` | **4 KB** | Theme presets only (tufte, carbon, etc.) |
299299
| `semiotic/data` | **3 KB** | bin, rollup, groupBy, pivot, fromVegaLite |
300300
| `semiotic/value` | **6 KB** | BigNumber — focal-value KPI / scorecard (SingleValueFrame POC) |
301-
| `semiotic/ai` | **218 KB** | All 42 HOCs + validation — optimized for LLM code generation |
301+
| `semiotic/ai` | **222 KB** | All 42 HOCs + validation — optimized for LLM code generation |
302302
| `semiotic` | **191 KB** | Everything below (full bundle) |
303303

304304
<!-- semiotic-bundle-sizes:end -->

ai/schema.json

Lines changed: 13 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -7540,95 +7540,24 @@
75407540
"type": "object",
75417541
"properties": {
75427542
"width": {
7543-
"type": "number",
7544-
"default": 600
7545-
},
7546-
"height": {
7547-
"type": "number",
7548-
"default": 400
7549-
},
7550-
"margin": {
7551-
"type": "object",
7552-
"description": "Object margin. A side value of \"auto\" or null leaves that side available for auto-reservation."
7553-
},
7554-
"className": {
7555-
"type": "string"
7556-
},
7557-
"title": {
7558-
"type": "string"
7559-
},
7560-
"enableHover": {
7561-
"type": "boolean",
7562-
"default": true
7563-
},
7564-
"showLegend": {
7565-
"type": "boolean"
7566-
},
7567-
"showGrid": {
7568-
"type": "boolean",
7569-
"default": false
7570-
},
7571-
"colorBy": {
7572-
"type": [
7573-
"string",
7574-
"function"
7575-
]
7576-
},
7577-
"colorScheme": {
75787543
"type": [
7579-
"string",
7580-
"array"
7544+
"number",
7545+
"string"
75817546
],
7582-
"default": "category10"
7547+
"description": "Reserved width in pixels (or any CSS length). Mode-keyed defaults: 280 (tile) / 540 (presentation) / unset (inline / thumbnail).",
7548+
"default": 280
75837549
},
7584-
"tooltip": {
7550+
"height": {
75857551
"type": [
7586-
"boolean",
7587-
"function",
7588-
"object"
7589-
]
7590-
},
7591-
"annotations": {
7592-
"type": "array",
7593-
"description": "Annotation objects to render on the chart. Each must have a `type` field. Position using your data field names (e.g. { type: \"widget\", month: \"Jan\", revenue: 500 }). Supported types: \"widget\" (arbitrary HTML/React content via foreignObject — v3 replacement for htmlAnnotationRules), \"label\" (callout with connector), \"callout\" (circle + label), \"text\" (plain label), \"y-threshold\" (horizontal reference line), \"x-threshold\" (vertical reference line), \"band\" (shaded y-region), \"enclose\" (circle around points), \"rect-enclose\" (rect around points), \"highlight\" (colored dots on filtered points), \"trend\" (regression line), \"envelope\" (upper/lower bounds), \"anomaly-band\" (mean ± stddev), \"forecast\" (extrapolated trend). Widget annotations accept: content (ReactNode), dx, dy, width, height, anchor (\"fixed\"|\"latest\"|\"sticky\"). Threshold annotations accept: value, label, color, strokeWidth, strokeDasharray. Enclose annotations accept: coordinates (array of data objects), label, color, padding.",
7594-
"items": {
7595-
"type": "object",
7596-
"properties": {
7597-
"type": {
7598-
"type": "string",
7599-
"enum": [
7600-
"widget",
7601-
"label",
7602-
"callout",
7603-
"text",
7604-
"bracket",
7605-
"y-threshold",
7606-
"x-threshold",
7607-
"band",
7608-
"enclose",
7609-
"rect-enclose",
7610-
"highlight",
7611-
"trend",
7612-
"envelope",
7613-
"anomaly-band",
7614-
"forecast"
7615-
],
7616-
"description": "Annotation type"
7617-
}
7618-
},
7619-
"required": [
7620-
"type"
7621-
]
7622-
}
7552+
"number",
7553+
"string"
7554+
],
7555+
"description": "Reserved height in pixels (or any CSS length). Mode-keyed defaults: 184 (tile) / 320 (presentation) / unset (inline / thumbnail).",
7556+
"default": 184
76237557
},
7624-
"axisExtent": {
7558+
"className": {
76257559
"type": "string",
7626-
"enum": [
7627-
"nice",
7628-
"exact"
7629-
],
7630-
"description": "Tick endpoint mode. \"nice\" rounds endpoints to readable values; \"exact\" pins the first and last tick to the actual data min and max with equidistant intermediates. Affects XY x/y axes and ordinal value axis only.",
7631-
"default": "nice"
7560+
"description": "Composed with the BEM root class on the outer container."
76327561
},
76337562
"value": {
76347563
"type": "number",
@@ -7741,7 +7670,7 @@
77417670
},
77427671
"chartSize": {
77437672
"type": "number",
7744-
"description": "Pixel size reserved for chartSlot (rendered as a square). Defaults to the card's inner height."
7673+
"description": "Pixel size reserved for chartSlot (rendered as a square). Mode-keyed defaults: 44 (tile) / 80 (presentation) — sparkline scale; pass a larger value for a hero anchor."
77457674
},
77467675
"windowSize": {
77477676
"type": "number",

ai/system-prompt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!-- semiotic-bundle-sizes:start -->
44
<!-- Auto-generated by scripts/sync-bundle-sizes.mjs — do not edit by hand. -->
5-
**Use sub-path imports**`semiotic/xy` (86KB gz), `semiotic/ordinal` (70KB gz), `semiotic/network` (64KB gz), `semiotic/geo` (52KB gz), `semiotic/realtime` (91KB gz), `semiotic/server` (122KB gz), `semiotic/utils` (22KB gz), `semiotic/recipes` (5KB gz), `semiotic/themes` (4KB gz), `semiotic/data` (3KB gz), `semiotic/value` (6KB gz), `semiotic/ai` (218KB gz). Full `semiotic` is 191KB gz.
5+
**Use sub-path imports**`semiotic/xy` (86KB gz), `semiotic/ordinal` (70KB gz), `semiotic/network` (64KB gz), `semiotic/geo` (52KB gz), `semiotic/realtime` (91KB gz), `semiotic/server` (122KB gz), `semiotic/utils` (22KB gz), `semiotic/recipes` (5KB gz), `semiotic/themes` (4KB gz), `semiotic/data` (3KB gz), `semiotic/value` (6KB gz), `semiotic/ai` (222KB gz). Full `semiotic` is 191KB gz.
66
<!-- semiotic-bundle-sizes:end -->
77

88
## Flat Array Data (`data: object[]`)

context7.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"*.spec.ts"
2424
],
2525
"rules": [
26-
"Import from sub-paths (`semiotic/xy`, `/ordinal`, `/network`, `/geo`, `/realtime`, `/server`, `/utils`, `/themes`, `/data`, `/ai`, `/recipes`), never bare `semiotic` — bare pulls the full 158KB-gz bundle.",
26+
"Import from sub-paths (`semiotic/xy`, `/ordinal`, `/network`, `/geo`, `/realtime`, `/server`, `/utils`, `/themes`, `/data`, `/ai`, `/recipes`, `/value`), never bare `semiotic` — bare pulls the full 158KB-gz bundle.",
2727
"Default to HOC charts (LineChart, BarChart, Scatterplot, ForceDirectedGraph) over Stream Frames unless the HOC doesn't expose what you need. Stream Frames pass `RealtimeNode`/`RealtimeEdge` wrappers in callbacks, not raw data.",
2828
"Push-mode charts: omit the `data` prop entirely. Never pass `data={[]}` — that is static empty data and clears the frame on every render. Use a ref and call `ref.current.push(datum)` / `pushMany(rows)` / `clear()`.",
2929
"`remove(id)` and `update(id, updater)` require an ID accessor: `pointIdAccessor` on XY/realtime charts, `dataIdAccessor` on ordinal charts, `nodeIDAccessor`/`edgeIdAccessor` for network operations.",

docs/public/llms-full.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- Install: `npm install semiotic`
55
<!-- semiotic-bundle-sizes:start -->
66
<!-- Auto-generated by scripts/sync-bundle-sizes.mjs — do not edit by hand. -->
7-
- **Use sub-path imports** — `semiotic/xy` (86KB gz), `semiotic/ordinal` (70KB gz), `semiotic/network` (64KB gz), `semiotic/geo` (52KB gz), `semiotic/realtime` (91KB gz), `semiotic/server` (122KB gz), `semiotic/utils` (22KB gz), `semiotic/recipes` (5KB gz), `semiotic/themes` (4KB gz), `semiotic/data` (3KB gz), `semiotic/value` (7KB gz), `semiotic/ai` (218KB gz). Full `semiotic` is 191KB gz.
7+
- **Use sub-path imports** — `semiotic/xy` (86KB gz), `semiotic/ordinal` (70KB gz), `semiotic/network` (64KB gz), `semiotic/geo` (52KB gz), `semiotic/realtime` (91KB gz), `semiotic/server` (122KB gz), `semiotic/utils` (22KB gz), `semiotic/recipes` (5KB gz), `semiotic/themes` (4KB gz), `semiotic/data` (3KB gz), `semiotic/value` (6KB gz), `semiotic/ai` (218KB gz). Full `semiotic` is 191KB gz.
88
<!-- semiotic-bundle-sizes:end -->
99
- CLI: `npx semiotic-ai [--schema|--compact|--examples|--doctor]` · MCP: `npx semiotic-mcp`
1010

0 commit comments

Comments
 (0)