{"_id":"@astrologer/charts","_rev":"2-35c4eca7f641cab72abaf5e0865e14f8","name":"@astrologer/charts","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@astrologer/charts","version":"1.0.0","_id":"@astrologer/charts@1.0.0","maintainers":[{"name":"astronaughty","email":"astronaughty@astrologer.com.br"}],"dist":{"shasum":"ca67863fb67efcd5c683bd82fd4a8a2bee0f2eb7","tarball":"https://registry.npmjs.org/@astrologer/charts/-/charts-1.0.0.tgz","fileCount":150,"integrity":"sha512-N0oME3caE8RiPkDa7O8qODYpXvjGVna/1gNhS6hadXpiim8x1sgQRTAr9K9T/vOfzTKpSCu+a+Ny+79Syb7MpA==","signatures":[{"sig":"MEQCIE+XfBw9vTMoo/5oBGJ58QzETZQuA7DsTy7DphxIVNkOAiBUaRH6tCN6yn0SZGTufnu6ld1Kd14DfkqPoak1QCmb8w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":697191},"main":"dist/index.js","type":"module","_from":"file:astrologer-charts-1.0.0.tgz","types":"dist/index.d.ts","scripts":{"test":"vitest run","build":"tsc"},"_npmUser":{"name":"astronaughty","email":"astronaughty@astrologer.com.br"},"_resolved":"/private/var/folders/89/rr48tk552d912vdwq39bd3bw0000gn/T/76f243f4883a6fb06b4e82d5b5c62d47/astrologer-charts-1.0.0.tgz","_integrity":"sha512-N0oME3caE8RiPkDa7O8qODYpXvjGVna/1gNhS6hadXpiim8x1sgQRTAr9K9T/vOfzTKpSCu+a+Ny+79Syb7MpA==","_npmVersion":"10.9.4","description":"A powerful, declarative SVG rendering engine for astrological charts. This package allows you to generate high-quality, customizable vector graphics for Natal, Transit, Synastry, and completely custom chart layouts.","directories":{},"_nodeVersion":"22.21.1","dependencies":{"@astrologer/astro-core":"1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.16","typescript":"^5.9.3","@types/node":"^25.0.3","@swisseph/node":"^1.2.1"},"_npmOperationalInternal":{"tmp":"tmp/charts_1.0.0_1769774637914_0.15320204101434687","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@astrologer/charts","version":"1.0.1","type":"module","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/intellecat/AstroCore.git","directory":"packages/charts"},"dependencies":{"@astrologer/astro-core":"1.0.1"},"devDependencies":{"@swisseph/node":"^1.2.1","@types/node":"^25.0.8","typescript":"^5.9.3","vitest":"^4.0.16"},"scripts":{"build":"tsc","test":"vitest run"},"_id":"@astrologer/charts@1.0.1","description":"A powerful, declarative SVG rendering engine for astrological charts. This package allows you to generate high-quality, customizable vector graphics for Natal, Transit, Synastry, and completely custom chart layouts.","bugs":{"url":"https://github.com/intellecat/AstroCore/issues"},"homepage":"https://github.com/intellecat/AstroCore#readme","_integrity":"sha512-vFdQaS6F4/c1x8IVRekot0fButYF5c8nnE2qLvJy4AIOIUL8q4l3lmRf5VIyP2ePeDYNTpLatX/oeJGqGhjGFw==","_resolved":"/tmp/651d2c4b15be61b14288f9ccfda3744f/astrologer-charts-1.0.1.tgz","_from":"file:astrologer-charts-1.0.1.tgz","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-vFdQaS6F4/c1x8IVRekot0fButYF5c8nnE2qLvJy4AIOIUL8q4l3lmRf5VIyP2ePeDYNTpLatX/oeJGqGhjGFw==","shasum":"97cb4ca6ee8434060e401c895207b727fcdd3cee","tarball":"https://registry.npmjs.org/@astrologer/charts/-/charts-1.0.1.tgz","fileCount":72,"unpackedSize":144722,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@astrologer%2fcharts@1.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCox7819WO4vWpUO6nIaZjWRfN9i40kOvcDRF0/ggoh2AIhAIBX4cZU/7BcSfdCdixvuKQWrziNhjTbU1qY0lycpXiq"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bbe99060-4f93-4263-b3c2-9dc9aad81d19"}},"directories":{},"maintainers":[{"name":"astronaughty","email":"astronaughty@astrologer.com.br"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/charts_1.0.1_1770117184065_0.25416217504187677"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-30T12:03:57.823Z","modified":"2026-02-03T11:13:04.580Z","1.0.0":"2026-01-30T12:03:58.135Z","1.0.1":"2026-02-03T11:13:04.261Z"},"description":"A powerful, declarative SVG rendering engine for astrological charts. This package allows you to generate high-quality, customizable vector graphics for Natal, Transit, Synastry, and completely custom chart layouts.","maintainers":[{"name":"astronaughty","email":"astronaughty@astrologer.com.br"}],"readme":"# @astrologer/charts\n\nA powerful, declarative SVG rendering engine for astrological charts. This package allows you to generate high-quality, customizable vector graphics for Natal, Transit, Synastry, and completely custom chart layouts.\n\n## Installation\n\n```bash\npnpm install @astrologer/charts @astrologer/astro-core\n```\n\n## Quick Start\n\nThe simplest way to use the library is via the high-level factory functions.\n\n**Note:** You must initialize the core library with an ephemeris engine first.\n\n```typescript\nimport { natalChart, transitChart, synastryChart } from '@astrologer/charts';\nimport { setSwissEphemeris } from '@astrologer/astro-core';\nimport * as swe from '@swisseph/node'; // or @swisseph/browser\n\n// Initialize Core\nsetSwissEphemeris(swe);\n\nconst input = {\n  date: '2026-01-01T12:00:00Z',\n  location: { latitude: 40.7128, longitude: -74.0060 }\n};\n\n// 1. Generate a Natal Chart SVG string\nconst svg = natalChart(input);\n\n// 2. Generate a Transit Chart (Bi-Wheel)\nconst transitInput = { date: new Date(), location: input.location };\nconst transitSvg = transitChart(input, transitInput);\n\n// 3. Generate a Synastry Chart (Bi-Wheel)\nconst partnerInput = { ... };\nconst synastrySvg = synastryChart(input, partnerInput);\n```\n\n---\n\n## Styling System\n\nThis library uses a **CSS-first** styling approach. The SVG output contains semantic class names and CSS variables, allowing for complete visual customization without changing JavaScript code.\n\n### Default Theme\nBy default, charts render with a clean, light theme.\n\n### Dark Mode / Custom Themes\nYou can load a custom CSS file by passing it to the low-level `createChart` function, or by simply embedding the CSS in your HTML where the SVG is rendered.\n\n**Key CSS Variables (The Palette):**\n```css\n:root {\n  /* Backgrounds */\n  --astro-color-bg: #ffffff;\n  --astro-color-paper: #ffffff;\n  --astro-color-text: #333333;\n\n  /* Planets */\n  --astro-color-sun: #FFD700;\n  --astro-color-moon: #909090;\n  /* ... mercury, venus, mars, etc. */\n\n  /* Aspects */\n  --astro-color-aspect-conj: #FFD700;\n  --astro-color-aspect-square: #FF0000;\n  --astro-color-aspect-trine: #32CD32;\n  \n  /* Elements */\n  --astro-color-fire: #e44d2e;\n  --astro-color-earth: #955e1c;\n  /* ... */\n}\n```\n\n**Semantic CSS Classes:**\n| Class | Description |\n|---|---|\n| `.astro-chart` | The root SVG element. |\n| `.astro-zodiac-ring` | The circles bordering the zodiac. |\n| `.astro-zodiac-glyph` | The sign symbols (Aries, Taurus...). |\n| `.astro-zodiac-sign-bg` | The colored background arcs for signs. |\n| `.astro-house-line` | Lines separating houses. |\n| `.astro-planet-symbol` | The planetary glyphs. |\n| `.astro-planet-degree` | The text showing planet degrees. |\n| `.astro-aspect-line` | Lines drawn in the center for aspects. |\n\n---\n\n## Advanced: Custom Chart Layouts\n\nFor full control over the layout (radii, rings, components), use the `createChart` engine. This is an **IoC (Inversion of Control)** system where you define the visual architecture.\n\n```typescript\nimport { createChart, ChartDefinition } from '@astrologer/charts/src/visuals/core/engine';\nimport { calculateChart, setSwissEphemeris } from '@astrologer/astro-core';\nimport * as swe from '@swisseph/node';\n\nsetSwissEphemeris(swe);\n\nconst data = calculateChart({ ... });\n\nconst myLayout: ChartDefinition = {\n  width: 800,\n  height: 800,\n  // Optional: Array of CSS file paths to inject\n  themes: ['/path/to/my-dark-theme.css'], \n  components: [\n    // 1. Draw a background circle\n    { type: 'circle', props: { radius: 300, fill: 'var(--astro-color-paper)' } },\n    \n    // 2. Draw the Zodiac Wheel\n    { \n      type: 'zodiacWheel', \n      props: { \n        outerRadius: 300, \n        innerRadius: 260, \n        symbolRadius: 280,\n        showSignBackgrounds: true \n      } \n    },\n    \n    // 3. Draw a Planet Ring inside\n    { \n      type: 'planetRing', \n      props: { \n        symbolRadius: 230,\n        degreeRadius: 210,\n        tickStartRadius: 260, // Connects to Zodiac\n        tickLength: 10\n      } \n    }\n  ]\n};\n\nconst customSvg = createChart(myLayout, data);\n```\n\n### Component Reference\n\n#### `zodiacWheel`\nRenders the 12 signs of the zodiac.\n- `outerRadius` (number): Outer boundary.\n- `innerRadius` (number): Inner boundary.\n- `symbolRadius` (number): Radius where glyphs are placed.\n- `showSignBackgrounds` (boolean): Fill sign sectors with element colors.\n\n#### `planetRing`\nStandard ring for planetary positions. Adapts to Natal (inward ticks) or Transit (outward ticks) based on geometry.\n- `symbolRadius` (number): Center of planet glyphs.\n- `tickStartRadius` (number): Where the tick line starts.\n- `tickLength` (number): Length of the tick line towards the symbol.\n- `degreeRadius` (number): Position of degree text.\n- `showMinutes` (boolean): Show minutes (e.g., 15° 30').\n- `minuteRadius` (number): Optional radius for minutes text.\n- `showZodiacSign` (boolean): Show sign glyph between degree and minute.\n- `zodiacSignRadius` (number): Optional radius for that sign glyph.\n- `avoidHouses` (boolean): If true, shifts planets to avoid overlapping house cusps.\n\n#### `stackedPlanetRing`\nA specialized ring for Synastry or crowded charts that stacks planets radially to avoid collisions.\n- `symbolStartRadius` (number): Baseline radius.\n- `orbitStep` (number): Distance between stacked orbits.\n\n#### `houseLines`\nRenders the 12 house cusps.\n- `radius` (number): Start of the line (usually center-side).\n- `endRadius` (number): End of the line (usually zodiac-side).\n- `showLabels` (boolean): Show house numbers.\n- `angleLabelRadius` (number): Position for ASC/MC labels.\n\n#### `aspectLines`\nRenders aspect lines in the center.\n- `radius` (number): The boundary radius where lines attach.\n- `showAspectSymbol` (boolean): Draw the aspect glyph (square, trine) in the middle of the line.","readmeFilename":"README.md","homepage":"https://github.com/intellecat/AstroCore#readme","repository":{"type":"git","url":"git+https://github.com/intellecat/AstroCore.git","directory":"packages/charts"},"bugs":{"url":"https://github.com/intellecat/AstroCore/issues"}}