{"_id":"@affino/charts-core","_rev":"3-c8a6e811e0531e4e61e9382b8fb09eed","name":"@affino/charts-core","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@affino/charts-core","version":"0.1.0","keywords":["affino","charts","headless","core"],"author":{"name":"Anton Pavlov","email":"a.pavlov@affino.dev"},"license":"MIT","_id":"@affino/charts-core@0.1.0","maintainers":[{"name":"affino","email":"anton.pavlov.personal@gmail.com"}],"homepage":"https://github.com/affinio/affinio/tree/main/packages/charts-core#readme","bugs":{"url":"https://github.com/affinio/affinio/issues"},"dist":{"shasum":"e68b369cfb3f34352f552ca1e5444a8f34edee0c","tarball":"https://registry.npmjs.org/@affino/charts-core/-/charts-core-0.1.0.tgz","fileCount":42,"integrity":"sha512-sdsmItRkaA+XDFup+0THEHV60B/q0UiNw+iCSWNQPvdCkG8dSiFowwcZjK4FwZid8y7JoKT0qlrTaK2phzYOlQ==","signatures":[{"sig":"MEQCIBOS2NGg0LhRgQrnwCi+fRxro6+bhPWwLXBcMixgXuDGAiBS9lMCzdgfHI3vp+6FHNreehKGCFjtan9Lx+jtpuc6oQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61466},"main":"dist/index.js","type":"module","_from":"file:affino-charts-core-0.1.0.tgz","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run --config ./vitest.config.ts","build":"tsc -p tsconfig.json","type-check":"tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit"},"_npmUser":{"name":"affino","email":"anton.pavlov.personal@gmail.com"},"_resolved":"/tmp/b565ccc3dcda8cdde5be1559bf44359a/affino-charts-core-0.1.0.tgz","_integrity":"sha512-sdsmItRkaA+XDFup+0THEHV60B/q0UiNw+iCSWNQPvdCkG8dSiFowwcZjK4FwZid8y7JoKT0qlrTaK2phzYOlQ==","repository":{"url":"git+https://github.com/affinio/affinio.git","type":"git","directory":"packages/charts-core"},"_npmVersion":"10.8.2","description":"Headless chart core types and utilities for Affino chart features","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/charts-core_0.1.0_1779187082690_0.7391857873537","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@affino/charts-core","version":"0.1.1","keywords":["affino","charts","headless","core"],"author":{"name":"Anton Pavlov","email":"a.pavlov@affino.dev"},"license":"MIT","_id":"@affino/charts-core@0.1.1","maintainers":[{"name":"affino","email":"anton.pavlov.personal@gmail.com"}],"homepage":"https://github.com/affinio/datagrid/tree/main/packages/charts-core#readme","bugs":{"url":"https://github.com/affinio/datagrid/issues"},"dist":{"shasum":"522b6b8d4e356f4b8cc80043d7f20f32d87ba55f","tarball":"https://registry.npmjs.org/@affino/charts-core/-/charts-core-0.1.1.tgz","fileCount":45,"integrity":"sha512-2Y3840Vtpy2qvv66geZRCsPsEbw5Vh0MaqUnwxv/jGNHvbONCWizl+HHi5LDO3OVurkq5eWFrBheGa8PYvU93g==","signatures":[{"sig":"MEQCIGhxTPpyAuQ0Eal+DkHJcnv1zL1FVJ3JZEbDHnOPAS/eAiAWVMlSpliT7V7QvolOcC9zhopScfRO3+86RbzNk/cBmQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":77994},"main":"dist/index.js","type":"module","_from":"file:affino-charts-core-0.1.1.tgz","types":"dist/index.d.ts","module":"dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run --config ./vitest.config.ts","build":"tsc -p tsconfig.json","type-check":"tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit"},"_npmUser":{"name":"affino","email":"anton.pavlov.personal@gmail.com"},"_resolved":"/tmp/87a47f30175044c09f210bbdd8ee3a37/affino-charts-core-0.1.1.tgz","_integrity":"sha512-2Y3840Vtpy2qvv66geZRCsPsEbw5Vh0MaqUnwxv/jGNHvbONCWizl+HHi5LDO3OVurkq5eWFrBheGa8PYvU93g==","repository":{"url":"git+https://github.com/affinio/datagrid.git","type":"git","directory":"packages/charts-core"},"_npmVersion":"10.9.8","description":"Headless chart core types and utilities for Affino chart features","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/charts-core_0.1.1_1788210106914_0.4690027890149906","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@affino/charts-core","version":"0.1.2","author":{"name":"Anton Pavlov","email":"a.pavlov@affino.dev"},"type":"module","description":"Headless chart core types and utilities for Affino chart features","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"main":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"scripts":{"build":"tsc -p tsconfig.json","type-check":"tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit","test":"vitest run --config ./vitest.config.ts"},"repository":{"type":"git","url":"git+https://github.com/affinio/datagrid.git","directory":"packages/charts-core"},"homepage":"https://github.com/affinio/datagrid/tree/main/packages/charts-core#readme","license":"MIT","keywords":["affino","charts","headless","core"],"devDependencies":{"vitest":"^4.0.18"},"bugs":{"url":"https://github.com/affinio/datagrid/issues"},"module":"dist/index.js","gitHead":"da97452200ea7dfa9806d106ddcbac1b5e330cfe","_id":"@affino/charts-core@0.1.2","_nodeVersion":"22.23.2","_npmVersion":"12.0.2","dist":{"integrity":"sha512-Pcd0AUrbqiWiYBZ1ecRfuIsN9/yIJqxTazoNS7gzCjDtkCH7tMfjC9aP9z1GXKGy+qQnUErQgw5aljhUqcW+0Q==","shasum":"25ebeffc42fbcafa1c2ac226f002ac76cc9fc720","tarball":"https://registry.npmjs.org/@affino/charts-core/-/charts-core-0.1.2.tgz","fileCount":44,"unpackedSize":79158,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDMc00Xc3v9oucS5JlhCpxwkJQSKMapjI0LB/lo6e9B/AIgO6meY6brJsdpdGBdhL4YnyVh2Eqh1PeYjkwI0+x2bdU="}]},"_npmUser":{"name":"affino","email":"anton.pavlov.personal@gmail.com"},"directories":{},"maintainers":[{"name":"affino","email":"anton.pavlov.personal@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/charts-core_0.1.2_1788817897737_0.3000315677045893"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-19T10:38:02.598Z","modified":"2026-09-07T21:51:38.031Z","0.1.0":"2026-05-19T10:38:02.867Z","0.1.1":"2026-08-31T21:01:47.063Z","0.1.2":"2026-09-07T21:51:37.844Z"},"bugs":{"url":"https://github.com/affinio/datagrid/issues"},"author":{"name":"Anton Pavlov","email":"a.pavlov@affino.dev"},"license":"MIT","homepage":"https://github.com/affinio/datagrid/tree/main/packages/charts-core#readme","keywords":["affino","charts","headless","core"],"repository":{"type":"git","url":"git+https://github.com/affinio/datagrid.git","directory":"packages/charts-core"},"description":"Headless chart core types and utilities for Affino chart features","maintainers":[{"name":"affino","email":"anton.pavlov.personal@gmail.com"}],"readme":"# @affino/charts-core\n\nHeadless, renderer-independent chart geometry and public data contracts for Affino charts. The package has no runtime dependencies and does not calculate financial metrics.\n\n## Time-series API\n\n```ts\nimport {\n  createTimeSeriesChartGeometry,\n  resolveTimeSeriesTooltip,\n  type TimeSeries,\n  type TimeSeriesChartOptions,\n  type TimeSeriesPoint,\n} from \"@affino/charts-core\"\n\nconst series: TimeSeries[] = [\n  {\n    id: \"balance\",\n    label: \"Balance\",\n    data: [{ time: Date.UTC(2026, 0, 1), value: 10_000 }],\n  },\n  {\n    id: \"equity\",\n    label: \"Equity\",\n    data: [{ time: Date.UTC(2026, 0, 1), value: 9_940 }],\n  },\n]\n\nconst options: TimeSeriesChartOptions = {\n  series,\n  size: { width: 800, height: 360 },\n  timeAxis: { locale: \"en-GB\" },\n  yAxis: { format: value => value.toFixed(2) },\n}\n\nconst geometry = createTimeSeriesChartGeometry(options)\nconst tooltip = resolveTimeSeriesTooltip(series, Date.UTC(2026, 0, 1))\n```\n\n`TimeSeriesPoint.time` is a UTC Unix timestamp in milliseconds. Formatting always uses `Intl.DateTimeFormat` with `timeZone: \"UTC\"`; applications can provide `timeAxis.format(timestamp)` or UTC-safe `formatOptions`. Tick intervals and counts respond to plot width and cover intraday through multi-year spans.\n\nAll visible series share one time domain, numeric value domain, plot area, and tick model. `presentation.type` supports `\"line\"` and `\"area\"`. Area geometry uses zero as its baseline and naturally supports an underwater/drawdown presentation.\n\n## Indexed interaction lookup\n\nUse `createTimeSeriesTooltipResolver(series)` when resolving more than one pointer/focus update. It builds the sorted union of visible timestamps once, resolves nearest X with binary search, and returns exact values for visible series at that X:\n\n~~~ts\nconst resolver = createTimeSeriesTooltipResolver(series)\nconst tooltip = resolver.resolve(pointerTimestamp)\n~~~\n\n`resolveNearestTimeSeriesTimestamp()` uses actual timestamp distance. Exact matches win, bounds clamp to the first/last timestamp, and an equal-distance tie chooses the earlier timestamp. Missing series observations are omitted; no interpolation is performed.\n\n## Input contract\n\n- Empty series and single-point series are supported.\n- Values and timestamps must be finite numbers. `NaN`, `Infinity`, and `null` are rejected.\n- Each series must be strictly timestamp-sorted; duplicate and unsorted timestamps are rejected.\n- Series ids must be unique and labels must be non-empty.\n- Missing points are represented by omission. Nullable points are not supported in V1.\n- Input arrays and points are never mutated.\n- No downsampling or decimation is performed. Geometry contains every supplied point.\n\n`validateTimeSeries()` exposes the same validation used by geometry and tooltip helpers.\n\n## Other public geometry\n\nThe package also exports generic bar, line, area, histogram, pie, scatter, band-scale, numeric-scale, layout, and metric-model helpers. `createBarChartGeometry()` includes zero by default and places positive and negative bars around the baseline. Histogram geometry is already public and remains a binned numeric-data primitive, not a financial calculation API.\n\n## Package boundary\n\n`@affino/charts-core` owns data validation, domains, scales, ticks, tooltip lookup, and geometry. `@affino/charts-vue` owns SVG/DOM rendering, interaction, responsive observation, accessibility, legends, tooltips, crosshair presentation, and themes.\n","readmeFilename":"README.md"}