{"_id":"@aravindhanak07/opcharts","name":"@aravindhanak07/opcharts","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@aravindhanak07/opcharts","version":"1.0.0","description":"A lightweight React chart library","type":"module","publishConfig":{"access":"public"},"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"vite","build":"tsup","typecheck":"tsc --noEmit","prepare":"npm run build","test":"echo \"Error: no test specified\" && exit 1"},"keywords":["react","charts","svg","data-visualization"],"author":"","license":"ISC","peerDependencies":{"react":">=18","react-dom":">=18"},"devDependencies":{"@types/react":"^19.2.14","@types/react-dom":"^19.2.3","react":"^19.2.6","react-dom":"^19.2.6","tsup":"^8.5.1","typescript":"^6.0.3","vite":"^8.0.13"},"_id":"@aravindhanak07/opcharts@1.0.0","_nodeVersion":"22.17.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-4cuZ7A7Gk6zTZkbvDBaj/8wmwwuTVavzIIdlUQeWbI1temMXtsYsvHmuua65enVNa12Imk62CGeLssXPasD+Hw==","shasum":"9f31333612947cfda359e99eddaede43916ea7aa","tarball":"https://registry.npmjs.org/@aravindhanak07/opcharts/-/opcharts-1.0.0.tgz","fileCount":8,"unpackedSize":57108,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGUGT9W+S+Sx5GJZ3M5EzAzKDGqu5GObWIPBCN1fJtrFAiEA2ydGhdk/Ozq6R5hh9NhU3Ha4HyaTDJBEt6oeMkC7F/U="}]},"_npmUser":{"name":"aravindhanak07","email":"aravindhofficial96@gmail.com"},"directories":{},"maintainers":[{"name":"aravindhanak07","email":"aravindhofficial96@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/opcharts_1.0.0_1779099734065_0.38625404053559453"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-18T10:22:13.972Z","1.0.0":"2026-05-18T10:22:14.224Z","modified":"2026-05-18T10:22:14.422Z"},"maintainers":[{"name":"aravindhanak07","email":"aravindhofficial96@gmail.com"}],"description":"A lightweight React chart library","keywords":["react","charts","svg","data-visualization"],"license":"ISC","readme":"# @aravindhanak07/opcharts\n\nA lightweight React + SVG chart library. Currently ships with `BarChart` and `PieChart`.\n\n## Install\n\n```bash\nnpm install @aravindhanak07/opcharts\n```\n\n### Peer dependencies\n\nYour app must already have these installed:\n\n- `react` >= 18\n- `react-dom` >= 18\n\n## Usage\n\n```tsx\nimport { BarChart, PieChart } from \"@aravindhanak07/opcharts\";\n\nconst sales = [\n  { label: \"Jan\", value: 30 },\n  { label: \"Feb\", value: 80 },\n  { label: \"Mar\", value: 45 },\n];\n\nconst traffic = [\n  { label: \"Direct\", value: 35 },\n  { label: \"Search\", value: 50 },\n  { label: \"Social\", value: 25 },\n];\n\nexport function Dashboard() {\n  return (\n    <>\n      <BarChart data={sales} width={560} height={300} showLegend />\n      <PieChart data={traffic} width={360} height={360} />\n    </>\n  );\n}\n```\n\n## API\n\n### `<BarChart />`\n\n| Prop | Type | Default | Description |\n|---|---|---|---|\n| `data` | `{ label: string; value: number }[]` | — | Required. One bar per item. |\n| `width` | `number` | `500` | SVG width in px. |\n| `height` | `number` | `300` | SVG height in px. |\n| `showLegend` | `boolean` | `false` | Render a legend below the chart. |\n| `colors` | `string[]` | default palette | Custom palette (cycled per bar). |\n\n### `<PieChart />`\n\n| Prop | Type | Default | Description |\n|---|---|---|---|\n| `data` | `{ label: string; value: number }[]` | — | Required. One slice per item. |\n| `width` | `number` | `360` | SVG width in px. |\n| `height` | `number` | `360` | SVG height in px. |\n| `showLegend` | `boolean` | `true` | Render a legend below the chart. |\n| `colors` | `string[]` | default palette | Custom palette (cycled per slice). |\n\nBoth charts include a built-in hover tooltip.\n\n### Lower-level exports\n\nAlso exported for advanced use:\n\n- `Legend`, `Tooltip` — the components used internally\n- `defaultPalette`, `getColor` — color helpers\n- `linearScale`, `niceMax`, `arcPath`, `polarToCartesian` — scaling/geometry helpers\n\n## Local development\n\n```bash\nnpm install\nnpm run dev        # Vite playground at http://localhost:5173\nnpm run build      # build dist/ (esm + cjs + dts)\nnpm run typecheck  # tsc --noEmit\n```\n","readmeFilename":"README.md","_rev":"1-1a5cd80f9760ae4eea703b196a0f22e4"}