{"_id":"@douganderson444/calendar-activity-heatmap","name":"@douganderson444/calendar-activity-heatmap","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.3":{"name":"@douganderson444/calendar-activity-heatmap","version":"1.0.3","devDependencies":{"@sveltejs/adapter-auto":"^2.0.0","@sveltejs/adapter-static":"^2.0.0","@sveltejs/kit":"^1.5.0","@sveltejs/package":"^1.0.2","@vitest/coverage-c8":"^0.28.4","globby":"^13.1.3","prettier":"^2.8.0","prettier-plugin-svelte":"^2.8.1","rollup-plugin-svelte":"^7.1.0","rollup-plugin-terser":"^7.0.2","svelte":"^3.54.0","svelte-check":"^3.0.1","svelte-preprocess":"^5.0.1","tslib":"^2.4.1","typescript":"^4.9.3","vite":"^4.0.0","vitest":"^0.28.4"},"type":"module","license":"MIT","keywords":["svelte","component","calendar","heatmap","activity","activity-heatmap","activity-calendar","activity-calendar-heatmap"],"exports":{"./package.json":"./package.json","./esm/Heatmap.svelte":"./esm/Heatmap.svelte.js","./esm":"./esm/index.js","./esm/SvelteHeatmap.svelte":"./esm/SvelteHeatmap.svelte.js","./Heatmap.svelte":"./Heatmap.svelte",".":"./index.js","./utils/date.spec":"./utils/date.spec.js","./utils/date":"./utils/date.js","./utils/heatmap.spec":"./utils/heatmap.spec.js","./utils/heatmap":"./utils/heatmap.js","./views/Cell.svelte":"./views/Cell.svelte","./views/Month.svelte":"./views/Month.svelte","./views/Week.svelte":"./views/Week.svelte"},"svelte":"./index.js","types":"./index.d.ts","gitHead":"f0c8bf55b247d18e8550670edd917861169f4fca","description":"[![npm](https://img.shields.io/npm/v/calendar-activity-heatmap.svg)](https://www.npmjs.com/package/@douganderson444/calendar-activity-heatmap)","_id":"@douganderson444/calendar-activity-heatmap@1.0.3","_nodeVersion":"18.5.0","_npmVersion":"8.13.2","dist":{"integrity":"sha512-R6aSgp11AC+B9Aw2gr46832/31a4Gl98Q7XESBJY9YhFR5hnn19KhmhP+q4h7xwW/klzNFV8zjelyHYeTchIcA==","shasum":"086fcf8ab23019486d34fd4fa07a4fbc43a0ff0b","tarball":"https://registry.npmjs.org/@douganderson444/calendar-activity-heatmap/-/calendar-activity-heatmap-1.0.3.tgz","fileCount":25,"unpackedSize":66057,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2Yeqkncv/nJ9k2NylrwYeZ2Q3+FBH2+EokkVDjK8H3wIgS3Fgbn4wJZXYkkfDphKEAsUc4qK6F+RkJdNvVmRaA2Y="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4lviACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBbg/+I82fFUPbhlh64wEmgC+Ju+tnmOVD/bomHtFuhkWzZGmEr1iI\r\nFZvFkeX2dhZv9z13YOEc6sMtCxRtb/Z+FG2vjnxtYVHt4iWkUECPhfotVi23\r\n22ylaXolZXdsbiDa+IWsnlmIBxJ/DhVKYX5tUD8nrj9PrcVzsCUAe7HxUUay\r\nH7i/RcGqhSNaPd5GNlRUeW5fJbDBEqkqy90gieWR7bzFlQC3ZBCLnWsinQeQ\r\n5kYwck7vWZMbv0vRNuGxKM5hcDxH9Gikv3jk9zDDDYF1+C4kyUfzYjAG9l5g\r\nEBO7Dh/7E6JJD0SBYBms3/OVaUEmJxMUOVq92a0lNx6aKFx7HDKoHSs2221t\r\nvDW+7JSuAJ203d3R1ZIDOsrogU8+yFkokGsCDq+/Z4PgwkcanvqakV3usR5K\r\nLoRIdGu0oq8ie7Ri90ic5LUJVS6Yy4yA3F8BZmsNsGHpoOY/0FzxHJH0O/Dm\r\nQzL/wRKr0hq0BMJYY497MpEiOmK1epLHawGMwc3VWmPhCbQT7hHquoW5AlOg\r\np6ob/yWhEGtclHuJmkAOCZy0AUL3OL1uc3GIVWVIBWCddC1C8IRhqQIocKr/\r\nnNz4ypwYwEOtZ5ST33CXV/kbBOKf2W/Xynt1NItBk5xy+GZsmuw7ZO0MuG5i\r\nU3DtwJYsejDx++IPjQPMSq73dwE0ayRgh3A=\r\n=hU2y\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"douganderson444","email":"douganderson444@gmail.com"},"directories":{},"maintainers":[{"name":"douganderson444","email":"douganderson444@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/calendar-activity-heatmap_1.0.3_1675779042483_0.8323782532760373"},"_hasShrinkwrap":false}},"time":{"created":"2023-02-07T14:10:42.395Z","1.0.3":"2023-02-07T14:10:42.661Z","modified":"2023-02-07T14:10:42.799Z"},"maintainers":[{"name":"douganderson444","email":"douganderson444@gmail.com"}],"description":"[![npm](https://img.shields.io/npm/v/calendar-activity-heatmap.svg)](https://www.npmjs.com/package/@douganderson444/calendar-activity-heatmap)","keywords":["svelte","component","calendar","heatmap","activity","activity-heatmap","activity-calendar","activity-calendar-heatmap"],"license":"MIT","readme":"# Calendar Activity Heatmap\n\n[![npm](https://img.shields.io/npm/v/calendar-activity-heatmap.svg)](https://www.npmjs.com/package/@douganderson444/calendar-activity-heatmap)\n\nA light weight and customizable version of GitHub's contribution graph.\n\n<b>Built with ❤️ using SvelteKit 1.0.0.</b>\n\n[![Heatmap examples](https://user-images.githubusercontent.com/7980426/78958159-27d55280-7a9c-11ea-9b08-8b5d7df31d7a.png)](https://svelte-heatmap.netlify.app/)\n\n## 📦 Installation\n\nThe recommended way to install this package is through NPM.\n\n```bash\nnpm install @douganderson444/calendar-activity-heatmap\n```\n\n## <img src=\"./static/svelte-logo.svg\" width=\"14px\"> Svelte Example Usage\n\n```svelte\n<!-- ./src/routes/+page.svelte -->\n<script>\n  import Heatmap from '@douganderson444/calendar-activity-heatmap';\n\n  let data =  new Array(365).fill().map((x, offset) => {\n\tconst date = new Date();\n\tdate.setDate(date.getDate() - offset);\n\treturn { date, value: Math.floor(Math.random() * 10) };\n});\n\n</script>\n\n<Heatmap data={data}>\n```\n\n## 🚀 Vanilla JS usage\n\nTo create a heatmap, pass `props` and a `target` to the constructor.\n\n```js\nimport Heatmap from '@douganderson444/calendar-activity-heatmap/esm';\n\nlet data = new Array(365).fill().map((x, offset) => {\n\tconst date = new Date();\n\tdate.setDate(date.getDate() - offset);\n\treturn { date, value: getRand10() };\n});\n\nconst heatmap = new Heatmap({\n\tprops: {\n\t\tdata,\n\t\tallowOverflow: true\n\t\t// other props here as desired\n\t},\n\ttarget: getElementById('heatmap')\n});\n\n// ... in the HTML:\n\n<div id=\"heatmap\" />;\n```\n\nTo remove the component, call `$destroy`.\n\n```js\nheatmap.$destroy();\n```\n\nSee the [Svelte documentation](https://svelte.dev/docs#Client-side_component_API) for more information.\n\n## ⚙️ Optional Properties (Props)\n\n> **Note:** Date values for `data`, `startDate`, and `endDate` should be [JavaScript `Date` objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) objects, or a value compatible with the Date constructor.\n\n##### `allowOverflow: boolean`\n\nRenders cells that fall outside the `startDate` to `endDate` range. Defaults to `false`.\n\n##### `cellGap: number`\n\nDefines the space between cells.\n\n##### `cellRadius: number`\n\nDefines the radius of each cell. This should be a number relative to the `cellSize`, or a string representing a percentage such as `'50%'`.\n\n##### `cellSize: number`\n\nDefines the size of each cell.\n\n##### `colors: string[]`\n\nArray of CSS colors to use for the chart, ordered from lowest to highest. Default colors match GitHub's contribution graph with `['#c6e48b', '#7bc96f', '#239a3b', '#196127']`.\n\n##### `data: { date: Date | string | number; value: number }[]`\n\nArray of objects containing the chart data. These objects should be in the shape of `{ date, value }`.\n\n##### `dayLabelWidth: number`\n\nHorizontal space to allocate for day labels. If this is `0`, day labels will not be rendered.\n\n##### `dayLabels: string[]`\n\nArray of strings to use for day labels. Defaults to `['', 'Mon', '', 'Web', '', 'Fri', '']`.\n\n##### `fontColor: string`\n\nLabel font color. Defaults to `#333`.\n\n##### `fontFamily: string`\n\nLabel font family. Defaults to `sans-serif`.\n\n##### `fontSize: number`\n\nLabel font size. Defaults to `8`.\n\n##### `emptyColor: string`\n\nCSS color to use for cells with no value.\n\n##### `monthGap: number`\n\nDefines the space between months when `view` is set to `monthly`.\n\n##### `monthLabelHeight: number`\n\nVertical space to allocate for month labels. If this is `0`, month labels will not be rendered.\n\n##### `monthLabels: string[]`\n\nArray of strings to use for month labels. Defaults to `['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']`.\n\n##### `startDate: Date | string | number`\n\nDate object representing the first day of the graph. If omitted, this will default to the first day of the `month` or `year`, based on the current `view`.\n\n##### `endDate: Date | string | number`\n\nDate object represending the last day of the graph. If omitted, this will default to the last day of the current `month` or `year`, depending on the current `view`.\n\n##### `view: 'monthly' | 'yearly'`\n\nDetermines how the chart should be displayed. Supported values are `monthly` and `yearly`, defaults to `yearly`.\n\n## 📄 License\n\n[MIT](https://github.com/scottbedard/svelte-heatmap/blob/master/LICENSE)\n\nUpdates Copyright (c) 2023 Doug Anderson\n\nOriginal work Copyright (c) 2017 Scott Bedard\n","readmeFilename":"README.md"}