{"_id":"@ascii-graphs/core","_rev":"2-6f92448057b39c87e2096959f51a4433","name":"@ascii-graphs/core","dist-tags":{"next":"0.1.0-alpha.0","latest":"0.1.0"},"versions":{"0.1.0-alpha.0":{"name":"@ascii-graphs/core","version":"0.1.0-alpha.0","keywords":["ascii","charts","graphs","terminal","cli","email","unicode"],"author":{"name":"Juan Víctor Izquierdo"},"license":"MIT","_id":"@ascii-graphs/core@0.1.0-alpha.0","maintainers":[{"name":"izquierdojv","email":"izquierdojv@gmail.com"}],"homepage":"https://github.com/juanviizquierdo/ascii_graphs#readme","bugs":{"url":"https://github.com/juanviizquierdo/ascii_graphs/issues"},"dist":{"shasum":"f43d852e8aac471b681413068a1765f20cd095ae","tarball":"https://registry.npmjs.org/@ascii-graphs/core/-/core-0.1.0-alpha.0.tgz","fileCount":5,"integrity":"sha512-KExA0isI33nJ9oqpV5eaIL8O+4OCsQvZxDNGPg5ql4dK//G2VVKyejXtraH3CB717g/Fdu3Eix4L7l7LkruOlg==","signatures":[{"sig":"MEUCIApZGtJkZCVAaJEotmG3qAhQ5kAp2oTDyD3QXnWr9wyZAiEA5Ov0uhPR8foBaColmmPVkL+erfxL6scpTQgcR48l2rM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":497700},"main":"./dist/index.js","type":"module","_from":"file:/tmp/ascii-graphs-publish.iTScbw/ascii-graphs-core-0.1.0-alpha.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"build":"tsup src/index.ts --format esm --dts --clean","typecheck":"tsc --noEmit"},"_npmUser":{"name":"izquierdojv","email":"izquierdojv@gmail.com"},"_resolved":"/tmp/ascii-graphs-publish.iTScbw/ascii-graphs-core-0.1.0-alpha.0.tgz","_integrity":"sha512-KExA0isI33nJ9oqpV5eaIL8O+4OCsQvZxDNGPg5ql4dK//G2VVKyejXtraH3CB717g/Fdu3Eix4L7l7LkruOlg==","repository":{"url":"git+https://github.com/juanviizquierdo/ascii_graphs.git","type":"git"},"_npmVersion":"11.6.2","description":"Target-neutral layout engine for portable ASCII charts","directories":{},"sideEffects":false,"_nodeVersion":"25.2.1","dependencies":{"string-width":"^7.2.0"},"publishConfig":{"tag":"next","access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/core_0.1.0-alpha.0_1786545124912_0.20440268993880206","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"_id":"@ascii-graphs/core@0.1.0","bugs":{"url":"https://github.com/juanviizquierdo/ascii_graphs/issues"},"dist":{"shasum":"62e53d5b52945c6aaf68c30f4010e521d482188c","tarball":"https://registry.npmjs.org/@ascii-graphs/core/-/core-0.1.0.tgz","fileCount":5,"integrity":"sha512-jVGdEwOor9mNX7VWyv3ScH+isU5B6DXKoT5xumrWhuCfFKo0ZWHfO+5C179msazzJnUz/vFEHbuhdVyMexjAtA==","signatures":[{"sig":"MEQCIDoWQm3/pCucnpZW4ruZpNlHMQcKrP6YxbVaaIlRzZQ+AiABvl9oyK9RB7HC4UuAmurm8JofxcwFur/tVZLb3cqBwg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICzW0/RDsFwgY/1wFp4G1XFFSNcqNdNvZaZX4fpp9brIAiBprNG6uKFS9x3hiMfr6jiXwuaXeG4k6xelNSlZBLkEwQ=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ascii-graphs%2fcore@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":507223},"main":"./dist/index.js","name":"@ascii-graphs/core","type":"module","_from":"file:/home/runner/work/ascii_graphs/ascii_graphs/artifacts/ascii-graphs-core-0.1.0.tgz","types":"./dist/index.d.ts","author":{"name":"Juan Víctor Izquierdo"},"engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"gitHead":"a29f15ab1ec7ab8ee4a5ce57364e0ca311ec3a78","license":"MIT","scripts":{"build":"tsup src/index.ts --format esm --dts --clean","typecheck":"tsc --noEmit"},"version":"0.1.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:a97eee2f-4fd0-4a0a-bdce-944e2b945a12"}},"homepage":"https://github.com/juanviizquierdo/ascii_graphs#readme","keywords":["ascii","charts","graphs","terminal","cli","email","unicode"],"_resolved":"/home/runner/work/ascii_graphs/ascii_graphs/artifacts/ascii-graphs-core-0.1.0.tgz","_integrity":"sha512-jVGdEwOor9mNX7VWyv3ScH+isU5B6DXKoT5xumrWhuCfFKo0ZWHfO+5C179msazzJnUz/vFEHbuhdVyMexjAtA==","repository":{"url":"git+https://github.com/juanviizquierdo/ascii_graphs.git","type":"git"},"_npmVersion":"11.19.1","description":"Target-neutral layout engine for portable ASCII charts","directories":{},"maintainers":[{"name":"izquierdojv","email":"izquierdojv@gmail.com"}],"sideEffects":false,"_nodeVersion":"24.19.0","dependencies":{"string-width":"^7.2.0"},"publishConfig":{"tag":"latest","access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","typescript":"^5.8.3"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_0.1.0_1787900253569_0.3702350634461413"}}},"time":{"created":"2026-08-12T14:32:04.665Z","modified":"2026-08-28T06:57:34.252Z","0.1.0-alpha.0":"2026-08-12T14:32:05.055Z","0.1.0":"2026-08-28T06:57:33.692Z"},"bugs":{"url":"https://github.com/juanviizquierdo/ascii_graphs/issues"},"author":{"name":"Juan Víctor Izquierdo"},"license":"MIT","homepage":"https://github.com/juanviizquierdo/ascii_graphs#readme","keywords":["ascii","charts","graphs","terminal","cli","email","unicode"],"repository":{"url":"git+https://github.com/juanviizquierdo/ascii_graphs.git","type":"git"},"description":"Target-neutral layout engine for portable ASCII charts","maintainers":[{"name":"izquierdojv","email":"izquierdojv@gmail.com"}],"readme":"# `@ascii-graphs/core`\n\nValidated, renderer-neutral ASCII and Unicode chart layouts for terminals,\nbrowsers, email, logs, and documentation.\n\n```sh\npnpm add @ascii-graphs/core @ascii-graphs/renderer-text\n```\n\n```ts\nimport { bar, layout } from \"@ascii-graphs/core\";\nimport { renderText } from \"@ascii-graphs/renderer-text\";\n\nconst grid = layout(\n  bar({\n    title: \"Monthly revenue\",\n    data: [\n      { label: \"Jan\", value: 42 },\n      { label: \"Feb\", value: 68 },\n      { label: \"Mar\", value: 91 },\n    ],\n  }),\n  { width: 42, charset: \"unicode\" },\n);\n\nconsole.log(renderText(grid));\n```\n\nThe core package has no DOM, terminal, or filesystem dependency. It produces a\nsemantic `CellGrid` that can be rendered as text, Markdown, ANSI, HTML, email,\nor Confluence ADF.\n\n## Partition capacity bands\n\nUse `partition({ mode: \"icicle\", root })` for top-down limits, allocations, and\nusage. Every level shares the root's numeric scale, so children remain aligned\nbeneath their parent and unused capacity stays blank:\n\n```ts\nimport { layout, partition } from \"@ascii-graphs/core\";\nimport { renderMarkdown } from \"@ascii-graphs/renderer-text\";\n\nconst grid = layout(\n  partition({\n    mode: \"icicle\",\n    root: {\n      label: \"Capacity\",\n      value: 100,\n      color: \"positive\",\n      children: [\n        {\n          label: \"Allocated\",\n          value: 60,\n          color: \"series2\",\n          children: [{ label: \"Used\", value: 35, color: \"series3\" }],\n        },\n        { label: \"Reserve\", value: 40, color: \"muted\" },\n      ],\n    },\n  }),\n  { width: 60, charset: \"unicode\" },\n);\n\nconsole.log(renderMarkdown(grid));\n```\n\nAn explicit `value` is the node's capacity, not an extra amount to add to its\nchildren. If omitted, it is the sum of its children (or `1` for a leaf).\nChildren may use less than their parent's capacity; exceeding it throws a\n`RangeError`. Zero values take no space. Widths round to whole columns, so very\nsmall nodes may disappear visually, but remain in the source data table.\n\nIcicle bands have borders and centered labels. Set `labelAlign` to `\"left\"`,\n`\"center\"`, or `\"right\"`; labels truncate to fit without changing proportions.\nThe default height is three rows per hierarchy level, plus two for an optional\ntitle. An explicit layout height must provide at least that many rows.\n\nEach node's optional `color` accepts `muted`, `accent`, `positive`, `negative`,\nor `series1`–`series4`. HTML and ANSI apply it to borders and labels; these are\noutlined bands, not solid background fills. Confluence `mode: \"richText\"` also\ncolors those glyphs, though Confluence controls fonts and wrapping. Text,\nMarkdown, and Confluence code snippets preserve the shape without color.\nRenderer themes can map the tokens to custom colors.\n\nIcicle grids also include `bands` metadata: full labels, semantic colors, and\ninteger `[start, end)` intervals grouped by hierarchy level. The Confluence\nrenderer can use it with `mode: \"table\"` to generate solid colored cells and\npreserve capacity gaps. Its generic `mode: \"richText\"` reads ordinary cell\nstyles instead and supports every chart without this metadata. Other renderers\nignore this optional metadata; there is no change to their character output.\n\nExisting `flame` (the default mode) and `sunburst` layouts keep their original\nweighting behavior. Node colors work in all three modes; `labelAlign` also works\nin flame mode, where the default remains `\"left\"`. Sunburst does not support\n`labelAlign`.\n\nSee the [compute-capacity example](../../examples/charts/partition.md) for a\ncomplete JSON request usable by LLM document workflows.\n\nRequires Node.js 20 or newer. Licensed under MIT.\n","readmeFilename":"README.md"}