expressive-charts 0.12.0 → 1.0.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.
@@ -11,8 +11,16 @@ const GAITS = [
11
11
  "step",
12
12
  "slide"
13
13
  ];
14
- const LINECAPS = ["butt", "round"];
15
- const LINEJOINS = ["miter", "round"];
14
+ const LINECAPS = [
15
+ "butt",
16
+ "round",
17
+ "square"
18
+ ];
19
+ const LINEJOINS = [
20
+ "miter",
21
+ "round",
22
+ "bevel"
23
+ ];
16
24
  const FILL_RULES = ["nonzero", "evenodd"];
17
25
  const PATH_DATA = /^\s*[Mm][MmLlHhVvCcSsQqTtAaZz0-9eE.,+\-\s]*$/;
18
26
  function defineIcon(spec) {
@@ -70,8 +78,8 @@ function checkShape(shape, field, fail, finite) {
70
78
  if (value !== void 0 && (typeof value !== "string" || value === "")) fail(`${field}.${paint}`, `must be a colour, got ${String(value)}`);
71
79
  }
72
80
  if (shape.width !== void 0 && finite(`${field}.width`, shape.width) < 0) fail(`${field}.width`, `can't be negative, got ${shape.width}`);
73
- if (shape.linecap !== void 0 && !LINECAPS.includes(shape.linecap)) fail(`${field}.linecap`, `must be butt or round, got ${String(shape.linecap)}`);
74
- if (shape.linejoin !== void 0 && !LINEJOINS.includes(shape.linejoin)) fail(`${field}.linejoin`, `must be miter or round, got ${String(shape.linejoin)}`);
81
+ if (shape.linecap !== void 0 && !LINECAPS.includes(shape.linecap)) fail(`${field}.linecap`, `must be butt, round or square, got ${String(shape.linecap)}`);
82
+ if (shape.linejoin !== void 0 && !LINEJOINS.includes(shape.linejoin)) fail(`${field}.linejoin`, `must be miter, round or bevel, got ${String(shape.linejoin)}`);
75
83
  if (shape.fillRule !== void 0 && !FILL_RULES.includes(shape.fillRule)) fail(`${field}.fillRule`, `must be nonzero or evenodd, got ${String(shape.fillRule)}`);
76
84
  for (const key of [
77
85
  "opacity",
@@ -1 +1 @@
1
- {"version":3,"file":"sport.cjs","names":["n"],"sources":["../../src/core/geometry/path-data.ts","../../src/icons/define.ts","../../src/icons/sport/index.ts"],"sourcesContent":["// SVG path data for segments: M, L, A and Z only, with numbers rounded to 0.001 px.\n\nimport type { Point } from \"../contracts/geometry\";\nimport { pointOn, polar, type PathSegment } from \"./segment\";\n\n/** A coordinate for path data: rounded to 0.001, with no \"-0\". */\nexport function formatNumber(value: number): string {\n const rounded = Math.round(value * 1000) / 1000;\n return rounded === 0 ? \"0\" : String(rounded);\n}\n\nexport function moveTo(point: Point): string {\n return `M${formatNumber(point.x)},${formatNumber(point.y)}`;\n}\n\n/**\n * Commands that draw a segment from fraction `u0` to `u1` of its length, assuming the pen is already\n * at the `u0` point. Arcs are split into pieces of at most half a turn, so the large-arc flag is\n * always 0 and a full circle still draws.\n */\nexport function drawTo(segment: PathSegment, u0 = 0, u1 = 1): string {\n if (segment.kind === \"line\") {\n const p = u1 === 1 ? segment.to : pointOn(segment, u1);\n return `L${formatNumber(p.x)},${formatNumber(p.y)}`;\n }\n const from = segment.start + segment.sweep * u0;\n const turn = segment.sweep * (u1 - u0);\n const pieces = Math.max(1, Math.ceil(Math.abs(turn) / Math.PI - 1e-9));\n const r = formatNumber(segment.radius);\n const clockwise = turn >= 0 ? 1 : 0;\n let d = \"\";\n for (let i = 1; i <= pieces; i++) {\n const p = polar(segment.center, segment.radius, from + (turn * i) / pieces);\n d += `A${r},${r} 0 0 ${clockwise} ${formatNumber(p.x)},${formatNumber(p.y)}`;\n }\n return d;\n}\n\n/**\n * Path data for a run of connected segments. Zero-length segments draw nothing. A closed run ends\n * with Z, which also replaces a final straight segment back to the start.\n */\nexport function pathData(segments: readonly PathSegment[], closed = false): string {\n const first = segments[0];\n if (!first) return \"\";\n let count = segments.length;\n if (closed) {\n while (count > 0 && segments[count - 1]!.length <= 0) count--;\n if (count > 0 && segments[count - 1]!.kind === \"line\") count--;\n }\n let d = moveTo(pointOn(first, 0));\n for (let i = 0; i < count; i++) {\n const segment = segments[i]!;\n if (segment.length > 0) d += drawTo(segment);\n }\n return closed ? `${d}Z` : d;\n}\n","// defineIcon: fills an icon's defaults and checks every field, so effects can rely on all of them.\n\nimport type { Icon, IconShape, Point, Rect } from \"../core\";\n\n/** What defineIcon takes: an Icon whose pivot, footprint and size are optional. */\nexport type IconSpec = Omit<Icon, \"footprint\" | \"pivot\" | \"size\"> & Partial<Pick<Icon, \"footprint\" | \"pivot\" | \"size\">>;\n\nconst GAITS: readonly string[] = [\"roll\", \"step\", \"slide\"];\nconst LINECAPS: readonly string[] = [\"butt\", \"round\"];\nconst LINEJOINS: readonly string[] = [\"miter\", \"round\"];\nconst FILL_RULES: readonly string[] = [\"nonzero\", \"evenodd\"];\n/** Path data: commands, numbers, separators. Anything else (markup, url(), quotes) is a mistake. */\nconst PATH_DATA = /^\\s*[Mm][MmLlHhVvCcSsQqTtAaZz0-9eE.,+\\-\\s]*$/;\n\n/**\n * Makes an icon from its parts. Shapes are drawn facing +x, up towards −y, in px at the icon's\n * natural size. Defaults: `pivot` is the anchor, `footprint` reaches from the anchor to the box's\n * edges, `size` is the box's width and `radius` half its height. Bad input throws a RangeError\n * naming the field. The icon and its parts are frozen, since one icon is shared by every run.\n */\nexport function defineIcon(spec: IconSpec): Icon {\n const name = spec?.name;\n if (typeof name !== \"string\" || name === \"\") throw new TypeError(`defineIcon needs a non-empty string name, got ${JSON.stringify(name)}.`);\n const fail = (field: string, problem: string): never => {\n throw new RangeError(`defineIcon: \"${name}\" ${field} ${problem}.`);\n };\n const finite = (field: string, value: unknown): number =>\n typeof value === \"number\" && Number.isFinite(value) ? value : fail(field, `must be a finite number, got ${String(value)}`);\n const positive = (field: string, value: unknown): number => (finite(field, value) > 0 ? (value as number) : fail(field, `must be more than 0, got ${String(value)}`));\n const point = (field: string, value: Point | undefined): Point =>\n value && typeof value === \"object\" ? freeze({ x: finite(`${field}.x`, value.x), y: finite(`${field}.y`, value.y) }) : fail(field, \"must be a point { x, y }\");\n\n if (!Array.isArray(spec.shapes) || spec.shapes.length === 0) fail(\"shapes\", \"must be a non-empty array\");\n const shapes = spec.shapes.map((shape, i) => checkShape(shape, `shapes[${i}]`, fail, finite));\n\n const b = spec.box;\n if (!b || typeof b !== \"object\") fail(\"box\", \"must be a rectangle { x, y, width, height }\");\n const box: Rect = freeze({ x: finite(\"box.x\", b.x), y: finite(\"box.y\", b.y), width: positive(\"box.width\", b.width), height: positive(\"box.height\", b.height) });\n\n const anchor = point(\"anchor\", spec.anchor);\n const pivot = spec.pivot === undefined ? anchor : point(\"pivot\", spec.pivot);\n const footprint = spec.footprint ?? [Math.max(0, anchor.x - box.x), Math.max(0, box.x + box.width - anchor.x)];\n if (!Array.isArray(footprint) || footprint.length !== 2) fail(\"footprint\", \"must be [behind, ahead]\");\n footprint.forEach((reach, i) => {\n if (finite(`footprint[${i}]`, reach) < 0) fail(`footprint[${i}]`, `can't be negative, got ${reach}`);\n });\n const size = spec.size === undefined ? box.width : positive(\"size\", spec.size);\n const radius = spec.radius === undefined ? box.height / 2 : positive(\"radius\", spec.radius);\n if (spec.gait !== undefined && !GAITS.includes(spec.gait)) fail(\"gait\", `must be roll, step or slide, got ${String(spec.gait)}`);\n if (spec.upright !== undefined && typeof spec.upright !== \"boolean\") fail(\"upright\", `must be true or false, got ${String(spec.upright)}`);\n\n return freeze({\n name,\n shapes: freeze(shapes),\n box,\n size,\n anchor,\n pivot,\n footprint: freeze([footprint[0], footprint[1]] as const),\n ...(spec.gait !== undefined ? { gait: spec.gait } : {}),\n radius,\n ...(spec.upright !== undefined ? { upright: spec.upright } : {})\n });\n}\n\nfunction checkShape(\n shape: IconShape,\n field: string,\n fail: (field: string, problem: string) => never,\n finite: (field: string, value: unknown) => number\n): IconShape {\n if (!shape || typeof shape !== \"object\") fail(field, \"must be a shape { d, fill?, stroke?, … }\");\n if (typeof shape.d !== \"string\" || !PATH_DATA.test(shape.d)) fail(`${field}.d`, \"must be path data starting with a move\");\n if (shape.clip !== undefined && (typeof shape.clip !== \"string\" || !PATH_DATA.test(shape.clip))) fail(`${field}.clip`, \"must be path data starting with a move\");\n for (const paint of [\"fill\", \"stroke\"] as const) {\n const value = shape[paint];\n if (value !== undefined && (typeof value !== \"string\" || value === \"\")) fail(`${field}.${paint}`, `must be a colour, got ${String(value)}`);\n }\n if (shape.width !== undefined && finite(`${field}.width`, shape.width) < 0) fail(`${field}.width`, `can't be negative, got ${shape.width}`);\n if (shape.linecap !== undefined && !LINECAPS.includes(shape.linecap)) fail(`${field}.linecap`, `must be butt or round, got ${String(shape.linecap)}`);\n if (shape.linejoin !== undefined && !LINEJOINS.includes(shape.linejoin)) fail(`${field}.linejoin`, `must be miter or round, got ${String(shape.linejoin)}`);\n if (shape.fillRule !== undefined && !FILL_RULES.includes(shape.fillRule)) fail(`${field}.fillRule`, `must be nonzero or evenodd, got ${String(shape.fillRule)}`);\n for (const key of [\"opacity\", \"fillOpacity\", \"strokeOpacity\"] as const) {\n const opacity = shape[key] === undefined ? 1 : finite(`${field}.${key}`, shape[key]);\n if (opacity < 0 || opacity > 1) fail(`${field}.${key}`, `must be from 0 to 1, got ${opacity}`);\n }\n const copy: { -readonly [K in keyof IconShape]: IconShape[K] } = { d: shape.d };\n for (const key of [\"fill\", \"stroke\", \"width\", \"linecap\", \"linejoin\", \"clip\", \"fillRule\", \"opacity\", \"fillOpacity\", \"strokeOpacity\"] as const) {\n if (shape[key] !== undefined) (copy as Record<string, unknown>)[key] = shape[key];\n }\n return freeze(copy);\n}\n\nconst freeze = <T>(value: T): T => Object.freeze(value);\n","// The sport icon pack, an optional entry point: import { sport } from \"expressive-charts/icons/sport\",\n// then registerIcons(sport), or pass soccerBall and cleat to travel() directly. Both are converted\n// from the prototype in demo/lab.html and drawn in fixed colours (a white ball is white in any theme).\n\nimport type { Icon } from \"../../core\";\n// From its own file, not the geometry's index, so this entry doesn't carry the builders.\nimport { formatNumber as n } from \"../../core/geometry/path-data\";\nimport { defineIcon } from \"../define\";\n\nconst BALL_R = 8.5;\nconst INK = \"#1d1c1a\";\n\nconst circle = (r: number): string => `M${r},0A${r},${r} 0 0 1 ${-r},0A${r},${r} 0 0 1 ${r},0Z`;\nconst polar = (r: number, a: number): string => `${n(r * Math.sin(a))},${n(-r * Math.cos(a))}`;\n\n/** A regular pentagon around (cx, cy), its first corner `rotation` radians clockwise from 12 o'clock. */\nfunction pentagon(cx: number, cy: number, r: number, rotation: number): string {\n let d = \"\";\n for (let i = 0; i < 5; i++) {\n const a = rotation + (i * 2 * Math.PI) / 5;\n d += `${i ? \"L\" : \"M\"}${n(cx + r * Math.sin(a))},${n(cy - r * Math.cos(a))}`;\n }\n return `${d}Z`;\n}\n\n/** The five seams and five outer panels, one per spoke. */\nfunction panels(): { seams: string; patches: string } {\n let seams = \"\";\n let patches = pentagon(0, 0, 3.3, 0);\n for (let i = 0; i < 5; i++) {\n const a = (i * 2 * Math.PI) / 5;\n seams += `M${polar(3.3, a)}L${polar(8.8 * 0.78, a)}`;\n patches += pentagon(8.8 * 1.08 * Math.sin(a), -8.8 * 1.08 * Math.cos(a), 3.1, a + Math.PI);\n }\n return { seams, patches };\n}\n\n/** Centred on the walk; rolls about its centre. */\nexport const soccerBall: Icon = /* @__PURE__ */ (() => {\n const { seams, patches } = panels();\n return defineIcon({\n name: \"soccer-ball\",\n shapes: [\n { d: circle(BALL_R), fill: \"#ffffff\" },\n // The outer panels hang over the edge, so they're clipped to the ball.\n { d: patches, fill: INK, clip: circle(BALL_R) },\n { d: seams, stroke: INK, width: 1 },\n { d: circle(BALL_R - 0.5), stroke: INK, width: 1 }\n ],\n box: { x: -BALL_R, y: -BALL_R, width: 2 * BALL_R, height: 2 * BALL_R },\n anchor: { x: 0, y: 0 },\n pivot: { x: 0, y: 0 },\n footprint: [BALL_R, BALL_R],\n gait: \"roll\",\n radius: BALL_R\n });\n})();\n\nconst STUDS = [4, 9, 16.5, 21.5]\n .map((x) => `M${n(x + 0.6)},0L${n(x + 1.6)},0A0.6,0.6 0 0 1 ${n(x + 2.2)},0.6L${n(x + 2.2)},2A0.6,0.6 0 0 1 ${n(x + 1.6)},2.6L${n(x + 0.6)},2.6A0.6,0.6 0 0 1 ${x},2L${x},0.6A0.6,0.6 0 0 1 ${n(x + 0.6)},0Z`)\n .join(\"\");\n\n/**\n * A boot with its toe pointing +x. Its heel sits at the start of the walk, raised 6 px so the boot is\n * centred in a bar; it tilts about the ball of the foot. Upright: on a walk heading left it's\n * mirrored, so the sole stays down.\n */\nexport const cleat: Icon = /* @__PURE__ */ defineIcon({\n name: \"cleat\",\n shapes: [\n {\n d: \"M1.5,-1.5L1.5,-11Q1.5,-14 4.5,-14L9.5,-14Q11.5,-14 12.5,-11.5L14.5,-8Q21.5,-7.2 24.5,-4.4Q26.6,-2.2 24.6,0L3,0Q1.5,0 1.5,-1.5Z\",\n fill: \"#24221f\",\n stroke: \"#ffffff\",\n width: 0.9,\n linejoin: \"round\"\n },\n { d: \"M7,-3L12,-9.5M10,-3L15,-8.3\", stroke: \"#ffffff\", width: 1.4, linecap: \"round\" },\n { d: \"M12.3,-11L14.7,-11.6M13.3,-9.6L15.7,-10.1\", stroke: \"#bdbab2\", width: 0.8, linecap: \"round\" },\n { d: STUDS, fill: \"#24221f\", stroke: \"#ffffff\", width: 0.6 }\n ],\n box: { x: 0, y: -14.5, width: 26, height: 17.5 },\n size: 26,\n anchor: { x: 0, y: -6 },\n pivot: { x: 13, y: -4 },\n footprint: [0, 26],\n gait: \"step\",\n upright: true\n});\n\n/** Both icons, for registerIcons(sport). */\nexport const sport: readonly Icon[] = /* @__PURE__ */ Object.freeze([soccerBall, cleat]);\n"],"mappings":";;;AAMA,SAAgB,aAAa,OAAuB;CAClD,MAAM,UAAU,KAAK,MAAM,QAAQ,GAAI,IAAI;CAC3C,OAAO,YAAY,IAAI,MAAM,OAAO,OAAO;AAC7C;;ACFA,MAAM,QAA2B;CAAC;CAAQ;CAAQ;AAAO;AACzD,MAAM,WAA8B,CAAC,QAAQ,OAAO;AACpD,MAAM,YAA+B,CAAC,SAAS,OAAO;AACtD,MAAM,aAAg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;CACA,KAAK;EAAE,GAAG;EAAG,GAAG;EAAO,OAAO;EAAI,QAAQ;CAAK;CAC/C,MAAM;CACN,QAAQ;EAAE,GAAG;EAAG,GAAG;CAAG;CACtB,OAAO;EAAE,GAAG;EAAI,GAAG;CAAG;CACtB,WAAW,CAAC,GAAG,EAAE;CACjB,MAAM;CACN,SAAS;AACX,CAAC;AAGD,MAAa,QAAyC,uBAAO,OAAO,CAAC,YAAY,KAAK,CAAC"}
1
+ {"version":3,"file":"sport.cjs","names":["n"],"sources":["../../src/core/geometry/path-data.ts","../../src/icons/define.ts","../../src/icons/sport/index.ts"],"sourcesContent":["// SVG path data for segments: M, L, A and Z only, with numbers rounded to 0.001 px.\n\nimport type { Point } from \"../contracts/geometry\";\nimport { pointOn, polar, type PathSegment } from \"./segment\";\n\n/** A coordinate for path data: rounded to 0.001, with no \"-0\". */\nexport function formatNumber(value: number): string {\n const rounded = Math.round(value * 1000) / 1000;\n return rounded === 0 ? \"0\" : String(rounded);\n}\n\nexport function moveTo(point: Point): string {\n return `M${formatNumber(point.x)},${formatNumber(point.y)}`;\n}\n\n/**\n * Commands that draw a segment from fraction `u0` to `u1` of its length, assuming the pen is already\n * at the `u0` point. Arcs are split into pieces of at most half a turn, so the large-arc flag is\n * always 0 and a full circle still draws.\n */\nexport function drawTo(segment: PathSegment, u0 = 0, u1 = 1): string {\n if (segment.kind === \"line\") {\n const p = u1 === 1 ? segment.to : pointOn(segment, u1);\n return `L${formatNumber(p.x)},${formatNumber(p.y)}`;\n }\n const from = segment.start + segment.sweep * u0;\n const turn = segment.sweep * (u1 - u0);\n const pieces = Math.max(1, Math.ceil(Math.abs(turn) / Math.PI - 1e-9));\n const r = formatNumber(segment.radius);\n const clockwise = turn >= 0 ? 1 : 0;\n let d = \"\";\n for (let i = 1; i <= pieces; i++) {\n const p = polar(segment.center, segment.radius, from + (turn * i) / pieces);\n d += `A${r},${r} 0 0 ${clockwise} ${formatNumber(p.x)},${formatNumber(p.y)}`;\n }\n return d;\n}\n\n/**\n * Path data for a run of connected segments. Zero-length segments draw nothing. A closed run ends\n * with Z, which also replaces a final straight segment back to the start.\n */\nexport function pathData(segments: readonly PathSegment[], closed = false): string {\n const first = segments[0];\n if (!first) return \"\";\n let count = segments.length;\n if (closed) {\n while (count > 0 && segments[count - 1]!.length <= 0) count--;\n if (count > 0 && segments[count - 1]!.kind === \"line\") count--;\n }\n let d = moveTo(pointOn(first, 0));\n for (let i = 0; i < count; i++) {\n const segment = segments[i]!;\n if (segment.length > 0) d += drawTo(segment);\n }\n return closed ? `${d}Z` : d;\n}\n","// defineIcon: fills an icon's defaults and checks every field, so effects can rely on all of them.\n\nimport type { Icon, IconShape, Point, Rect } from \"../core\";\n\n/** What defineIcon takes: an Icon whose pivot, footprint and size are optional. */\nexport type IconSpec = Omit<Icon, \"footprint\" | \"pivot\" | \"size\"> & Partial<Pick<Icon, \"footprint\" | \"pivot\" | \"size\">>;\n\nconst GAITS: readonly string[] = [\"roll\", \"step\", \"slide\"];\nconst LINECAPS: readonly string[] = [\"butt\", \"round\", \"square\"];\nconst LINEJOINS: readonly string[] = [\"miter\", \"round\", \"bevel\"];\nconst FILL_RULES: readonly string[] = [\"nonzero\", \"evenodd\"];\n/** Path data: commands, numbers, separators. Anything else (markup, url(), quotes) is a mistake. */\nconst PATH_DATA = /^\\s*[Mm][MmLlHhVvCcSsQqTtAaZz0-9eE.,+\\-\\s]*$/;\n\n/**\n * Makes an icon from its parts. Shapes are drawn facing +x, up towards −y, in px at the icon's\n * natural size. Defaults: `pivot` is the anchor, `footprint` reaches from the anchor to the box's\n * edges, `size` is the box's width and `radius` half its height. Bad input throws a RangeError\n * naming the field. The icon and its parts are frozen, since one icon is shared by every run.\n */\nexport function defineIcon(spec: IconSpec): Icon {\n const name = spec?.name;\n if (typeof name !== \"string\" || name === \"\") throw new TypeError(`defineIcon needs a non-empty string name, got ${JSON.stringify(name)}.`);\n const fail = (field: string, problem: string): never => {\n throw new RangeError(`defineIcon: \"${name}\" ${field} ${problem}.`);\n };\n const finite = (field: string, value: unknown): number =>\n typeof value === \"number\" && Number.isFinite(value) ? value : fail(field, `must be a finite number, got ${String(value)}`);\n const positive = (field: string, value: unknown): number => (finite(field, value) > 0 ? (value as number) : fail(field, `must be more than 0, got ${String(value)}`));\n const point = (field: string, value: Point | undefined): Point =>\n value && typeof value === \"object\" ? freeze({ x: finite(`${field}.x`, value.x), y: finite(`${field}.y`, value.y) }) : fail(field, \"must be a point { x, y }\");\n\n if (!Array.isArray(spec.shapes) || spec.shapes.length === 0) fail(\"shapes\", \"must be a non-empty array\");\n const shapes = spec.shapes.map((shape, i) => checkShape(shape, `shapes[${i}]`, fail, finite));\n\n const b = spec.box;\n if (!b || typeof b !== \"object\") fail(\"box\", \"must be a rectangle { x, y, width, height }\");\n const box: Rect = freeze({ x: finite(\"box.x\", b.x), y: finite(\"box.y\", b.y), width: positive(\"box.width\", b.width), height: positive(\"box.height\", b.height) });\n\n const anchor = point(\"anchor\", spec.anchor);\n const pivot = spec.pivot === undefined ? anchor : point(\"pivot\", spec.pivot);\n const footprint = spec.footprint ?? [Math.max(0, anchor.x - box.x), Math.max(0, box.x + box.width - anchor.x)];\n if (!Array.isArray(footprint) || footprint.length !== 2) fail(\"footprint\", \"must be [behind, ahead]\");\n footprint.forEach((reach, i) => {\n if (finite(`footprint[${i}]`, reach) < 0) fail(`footprint[${i}]`, `can't be negative, got ${reach}`);\n });\n const size = spec.size === undefined ? box.width : positive(\"size\", spec.size);\n const radius = spec.radius === undefined ? box.height / 2 : positive(\"radius\", spec.radius);\n if (spec.gait !== undefined && !GAITS.includes(spec.gait)) fail(\"gait\", `must be roll, step or slide, got ${String(spec.gait)}`);\n if (spec.upright !== undefined && typeof spec.upright !== \"boolean\") fail(\"upright\", `must be true or false, got ${String(spec.upright)}`);\n\n return freeze({\n name,\n shapes: freeze(shapes),\n box,\n size,\n anchor,\n pivot,\n footprint: freeze([footprint[0], footprint[1]] as const),\n ...(spec.gait !== undefined ? { gait: spec.gait } : {}),\n radius,\n ...(spec.upright !== undefined ? { upright: spec.upright } : {})\n });\n}\n\nfunction checkShape(\n shape: IconShape,\n field: string,\n fail: (field: string, problem: string) => never,\n finite: (field: string, value: unknown) => number\n): IconShape {\n if (!shape || typeof shape !== \"object\") fail(field, \"must be a shape { d, fill?, stroke?, … }\");\n if (typeof shape.d !== \"string\" || !PATH_DATA.test(shape.d)) fail(`${field}.d`, \"must be path data starting with a move\");\n if (shape.clip !== undefined && (typeof shape.clip !== \"string\" || !PATH_DATA.test(shape.clip))) fail(`${field}.clip`, \"must be path data starting with a move\");\n for (const paint of [\"fill\", \"stroke\"] as const) {\n const value = shape[paint];\n if (value !== undefined && (typeof value !== \"string\" || value === \"\")) fail(`${field}.${paint}`, `must be a colour, got ${String(value)}`);\n }\n if (shape.width !== undefined && finite(`${field}.width`, shape.width) < 0) fail(`${field}.width`, `can't be negative, got ${shape.width}`);\n if (shape.linecap !== undefined && !LINECAPS.includes(shape.linecap)) fail(`${field}.linecap`, `must be butt, round or square, got ${String(shape.linecap)}`);\n if (shape.linejoin !== undefined && !LINEJOINS.includes(shape.linejoin)) fail(`${field}.linejoin`, `must be miter, round or bevel, got ${String(shape.linejoin)}`);\n if (shape.fillRule !== undefined && !FILL_RULES.includes(shape.fillRule)) fail(`${field}.fillRule`, `must be nonzero or evenodd, got ${String(shape.fillRule)}`);\n for (const key of [\"opacity\", \"fillOpacity\", \"strokeOpacity\"] as const) {\n const opacity = shape[key] === undefined ? 1 : finite(`${field}.${key}`, shape[key]);\n if (opacity < 0 || opacity > 1) fail(`${field}.${key}`, `must be from 0 to 1, got ${opacity}`);\n }\n const copy: { -readonly [K in keyof IconShape]: IconShape[K] } = { d: shape.d };\n for (const key of [\"fill\", \"stroke\", \"width\", \"linecap\", \"linejoin\", \"clip\", \"fillRule\", \"opacity\", \"fillOpacity\", \"strokeOpacity\"] as const) {\n if (shape[key] !== undefined) (copy as Record<string, unknown>)[key] = shape[key];\n }\n return freeze(copy);\n}\n\nconst freeze = <T>(value: T): T => Object.freeze(value);\n","// The sport icon pack, an optional entry point: import { sport } from \"expressive-charts/icons/sport\",\n// then registerIcons(sport), or pass soccerBall and cleat to travel() directly. Both are converted\n// from the prototype in demo/lab.html and drawn in fixed colours (a white ball is white in any theme).\n\nimport type { Icon } from \"../../core\";\n// From its own file, not the geometry's index, so this entry doesn't carry the builders.\nimport { formatNumber as n } from \"../../core/geometry/path-data\";\nimport { defineIcon } from \"../define\";\n\nconst BALL_R = 8.5;\nconst INK = \"#1d1c1a\";\n\nconst circle = (r: number): string => `M${r},0A${r},${r} 0 0 1 ${-r},0A${r},${r} 0 0 1 ${r},0Z`;\nconst polar = (r: number, a: number): string => `${n(r * Math.sin(a))},${n(-r * Math.cos(a))}`;\n\n/** A regular pentagon around (cx, cy), its first corner `rotation` radians clockwise from 12 o'clock. */\nfunction pentagon(cx: number, cy: number, r: number, rotation: number): string {\n let d = \"\";\n for (let i = 0; i < 5; i++) {\n const a = rotation + (i * 2 * Math.PI) / 5;\n d += `${i ? \"L\" : \"M\"}${n(cx + r * Math.sin(a))},${n(cy - r * Math.cos(a))}`;\n }\n return `${d}Z`;\n}\n\n/** The five seams and five outer panels, one per spoke. */\nfunction panels(): { seams: string; patches: string } {\n let seams = \"\";\n let patches = pentagon(0, 0, 3.3, 0);\n for (let i = 0; i < 5; i++) {\n const a = (i * 2 * Math.PI) / 5;\n seams += `M${polar(3.3, a)}L${polar(8.8 * 0.78, a)}`;\n patches += pentagon(8.8 * 1.08 * Math.sin(a), -8.8 * 1.08 * Math.cos(a), 3.1, a + Math.PI);\n }\n return { seams, patches };\n}\n\n/** Centred on the walk; rolls about its centre. */\nexport const soccerBall: Icon = /* @__PURE__ */ (() => {\n const { seams, patches } = panels();\n return defineIcon({\n name: \"soccer-ball\",\n shapes: [\n { d: circle(BALL_R), fill: \"#ffffff\" },\n // The outer panels hang over the edge, so they're clipped to the ball.\n { d: patches, fill: INK, clip: circle(BALL_R) },\n { d: seams, stroke: INK, width: 1 },\n { d: circle(BALL_R - 0.5), stroke: INK, width: 1 }\n ],\n box: { x: -BALL_R, y: -BALL_R, width: 2 * BALL_R, height: 2 * BALL_R },\n anchor: { x: 0, y: 0 },\n pivot: { x: 0, y: 0 },\n footprint: [BALL_R, BALL_R],\n gait: \"roll\",\n radius: BALL_R\n });\n})();\n\nconst STUDS = [4, 9, 16.5, 21.5]\n .map((x) => `M${n(x + 0.6)},0L${n(x + 1.6)},0A0.6,0.6 0 0 1 ${n(x + 2.2)},0.6L${n(x + 2.2)},2A0.6,0.6 0 0 1 ${n(x + 1.6)},2.6L${n(x + 0.6)},2.6A0.6,0.6 0 0 1 ${x},2L${x},0.6A0.6,0.6 0 0 1 ${n(x + 0.6)},0Z`)\n .join(\"\");\n\n/**\n * A boot with its toe pointing +x. Its heel sits at the start of the walk, raised 6 px so the boot is\n * centred in a bar; it tilts about the ball of the foot. Upright: on a walk heading left it's\n * mirrored, so the sole stays down.\n */\nexport const cleat: Icon = /* @__PURE__ */ defineIcon({\n name: \"cleat\",\n shapes: [\n {\n d: \"M1.5,-1.5L1.5,-11Q1.5,-14 4.5,-14L9.5,-14Q11.5,-14 12.5,-11.5L14.5,-8Q21.5,-7.2 24.5,-4.4Q26.6,-2.2 24.6,0L3,0Q1.5,0 1.5,-1.5Z\",\n fill: \"#24221f\",\n stroke: \"#ffffff\",\n width: 0.9,\n linejoin: \"round\"\n },\n { d: \"M7,-3L12,-9.5M10,-3L15,-8.3\", stroke: \"#ffffff\", width: 1.4, linecap: \"round\" },\n { d: \"M12.3,-11L14.7,-11.6M13.3,-9.6L15.7,-10.1\", stroke: \"#bdbab2\", width: 0.8, linecap: \"round\" },\n { d: STUDS, fill: \"#24221f\", stroke: \"#ffffff\", width: 0.6 }\n ],\n box: { x: 0, y: -14.5, width: 26, height: 17.5 },\n size: 26,\n anchor: { x: 0, y: -6 },\n pivot: { x: 13, y: -4 },\n footprint: [0, 26],\n gait: \"step\",\n upright: true\n});\n\n/** Both icons, for regist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,CAAC,CAC7B,KAAK,MAAM,IAAIA,aAAE,IAAI,EAAG,EAAE,KAAKA,aAAE,IAAI,GAAG,EAAE,mBAAmBA,aAAE,IAAI,GAAG,EAAE,OAAOA,aAAE,IAAI,GAAG,EAAE,mBAAmBA,aAAE,IAAI,GAAG,EAAE,OAAOA,aAAE,IAAI,EAAG,EAAE,qBAAqB,EAAE,KAAK,EAAE,qBAAqBA,aAAE,IAAI,EAAG,EAAE,IAAI,CAAC,CAC7M,KAAK,EAmBC;GAAO,MAAM;GAAW,QAAQ;GAAW,OAAO;EAAI;CAC7D;CACA,KAAK;EAAE,GAAG;EAAG,GAAG;EAAO,OAAO;EAAI,QAAQ;CAAK;CAC/C,MAAM;CACN,QAAQ;EAAE,GAAG;EAAG,GAAG;CAAG;CACtB,OAAO;EAAE,GAAG;EAAI,GAAG;CAAG;CACtB,WAAW,CAAC,GAAG,EAAE;CACjB,MAAM;CACN,SAAS;AACX,CAAC;AAGD,MAAa,QAAyC,uBAAO,OAAO,CAAC,YAAY,KAAK,CAAC"}
@@ -1,4 +1,4 @@
1
- import { I as Icon } from "../index-CmnxlWkB.cjs";
1
+ import { I as Icon } from "../index-DLdz-1iE.cjs";
2
2
  /** Centred on the walk; rolls about its centre. */
3
3
  export declare const soccerBall: Icon;
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { d as Icon } from "../drawing-OmQV-0BB.js";
1
+ import { d as Icon } from "../drawing-qGmuUkoL.js";
2
2
  /** Centred on the walk; rolls about its centre. */
3
3
  export declare const soccerBall: Icon;
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { n as formatNumber } from "../path-data-Cfjk04X8.js";
2
- import { t as defineIcon } from "../define-DeZLs1h7.js";
2
+ import { t as defineIcon } from "../define-ClDM4DNz.js";
3
3
  // src/icons/sport/index.ts
4
4
  const BALL_R = 8.5;
5
5
  const INK = "#1d1c1a";
@@ -309,9 +309,9 @@ interface IconShape {
309
309
  /** Stroke width in icon units, so it scales with the icon. Default 1. */
310
310
  readonly width?: number;
311
311
  /** Default "butt". */
312
- readonly linecap?: "butt" | "round";
312
+ readonly linecap?: "butt" | "round" | "square";
313
313
  /** Default "miter". */
314
- readonly linejoin?: "miter" | "round";
314
+ readonly linejoin?: "miter" | "round" | "bevel";
315
315
  /** Path data, in icon units, that clips this shape (the ball's panel pattern). */
316
316
  readonly clip?: string;
317
317
  /** Default "nonzero". "evenodd" leaves a hole where the path's parts overlap, as solid icon sets draw them. */
@@ -370,7 +370,8 @@ interface Paint {
370
370
  readonly stroke?: Color;
371
371
  readonly width?: number;
372
372
  readonly opacity?: number;
373
- readonly linecap?: "butt" | "round";
373
+ /** Default "butt". A path's joins are always round. */
374
+ readonly linecap?: "butt" | "round" | "square";
374
375
  /**
375
376
  * The key of one of the mark's segments (`segment.key`). In this paint, "mark" and "mark-strong"
376
377
  * are that segment's colours. Unset, or a key the mark hasn't, they're the mark's own, as without it.