{"id":14990155,"url":"https://github.com/chrisburnell/svg-sparkline","last_synced_at":"2026-02-01T22:09:38.867Z","repository":{"id":218328957,"uuid":"746134155","full_name":"chrisburnell/svg-sparkline","owner":"chrisburnell","description":"A Web Component for building an SVG Sparkline.","archived":false,"fork":false,"pushed_at":"2025-10-22T17:42:03.000Z","size":149,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T09:36:22.506Z","etag":null,"topics":["custom-element","custom-elements","customelement","customelements","javascript","sparkline","web-component","web-components","webcomponent","webcomponents"],"latest_commit_sha":null,"homepage":"https://chrisburnell.com/svg-sparkline/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrisburnell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"chrisburnell","buy_me_a_coffee":"chrisburnell"}},"created_at":"2024-01-21T06:40:52.000Z","updated_at":"2025-10-24T09:19:40.000Z","dependencies_parsed_at":"2024-02-06T13:03:39.040Z","dependency_job_id":"2db232eb-4476-4e04-a3a7-c96550b8017d","html_url":"https://github.com/chrisburnell/svg-sparkline","commit_stats":null,"previous_names":["chrisburnell/svg-sparkline"],"tags_count":25,"template":false,"template_full_name":"daviddarnes/component-template","purl":"pkg:github/chrisburnell/svg-sparkline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisburnell%2Fsvg-sparkline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisburnell%2Fsvg-sparkline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisburnell%2Fsvg-sparkline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisburnell%2Fsvg-sparkline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisburnell","download_url":"https://codeload.github.com/chrisburnell/svg-sparkline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisburnell%2Fsvg-sparkline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28992731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T22:01:47.507Z","status":"ssl_error","status_checked_at":"2026-02-01T21:58:37.335Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["custom-element","custom-elements","customelement","customelements","javascript","sparkline","web-component","web-components","webcomponent","webcomponents"],"created_at":"2024-09-24T14:19:35.512Z","updated_at":"2026-02-01T22:09:38.838Z","avatar_url":"https://github.com/chrisburnell.png","language":"JavaScript","funding_links":["https://github.com/sponsors/chrisburnell","https://buymeacoffee.com/chrisburnell"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg alt=\"examples of the SVG Sparkline web component\" src=\"assets/svg-sparkline.png?raw=true\" width=\"460\" height=\"285.5\"\u003e\n\u003c/div\u003e\n\n# `svg-sparkline`\n\nA Web Component that builds an SVG Sparkline.\n\n**[Demo](https://chrisburnell.github.io/svg-sparkline/demo.html)** | **[Further reading](https://chrisburnell.com/svg-sparkline/)**\n\n## Examples\n\n### General usage example\n\n```html\n\u003cscript type=\"module\" src=\"svg-sparkline.js\"\u003e\u003c/script\u003e\n\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\"\u003e\u003c/svg-sparkline\u003e\n```\n\n### With curve\n\n```html\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\" curve=\"true\"\u003e\u003c/svg-sparkline\u003e\n```\n\n### Start and End labels\n\n```html\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\" start-label=\"Start\" end-label=\"End\"\u003e\u003c/svg-sparkline\u003e\n```\n\n### Animated\n\n```html\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\" animate=\"true\"\u003e\u003c/svg-sparkline\u003e\n```\n\n### Defined Animation Duration\n\n```html\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\" animate=\"true\" animation-duration=\"2s\"\u003e\u003c/svg-sparkline\u003e\n```\n\n### Defined Animation Delay\n\n```html\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\" animate=\"true\" animation-delay=\"2s\"\u003e\u003c/svg-sparkline\u003e\n```\n\n### Defined color\n\n```html\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\" color=\"purple\"\u003e\u003c/svg-sparkline\u003e\n```\n\n### With gradient\n\n```html\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\" gradient=\"true\"\u003e\u003c/svg-sparkline\u003e\n```\n\n### Defined gradient color\n\n```html\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\" gradient=\"true\" gradient-color=\"rebeccapurple\"\u003e\u003c/svg-sparkline\u003e\n```\n\n### Filled\n\n```html\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\" fill=\"true\"\u003e\u003c/svg-sparkline\u003e\n```\n\n### Defined fill color\n\n```html\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\" fill=\"true\" fill-color=\"rebeccapurple\"\u003e\u003c/svg-sparkline\u003e\n```\n\n### Defined endpoint color\n\n```html\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\" endpoint-color=\"red\"\u003e\u003c/svg-sparkline\u003e\n```\n\n### Defined endpoint radius\n\n```html\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\" endpoint-radius=\"12\"\u003e\u003c/svg-sparkline\u003e\n```\n\n### Without endpoint\n\n```html\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\" endpoint=\"false\"\u003e\u003c/svg-sparkline\u003e\n```\n\n### Defined line/stroke width\n\n```html\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\" stroke-width=\"6\"\u003e\u003c/svg-sparkline\u003e\n```\n\n### Defined width and height\n\n```html\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\" width=\"300\" height=\"100\"\u003e\u003c/svg-sparkline\u003e\n```\n\n### Set a custom title\n\n```html\n\u003csvg-sparkline values=\"8,3,2,7,9,1,5,6,4,0,0,10,10,3,8,2,7,1,9\" title=\"Sparkline with a custom title\"\u003e\u003c/svg-sparkline\u003e\n```\n\n## Features\n\nThis Web Component builds a sparkline based on the required `values` attribute.\n\n## Installation\n\nYou have a few options (choose one of these):\n\n1. Install via [npm](https://www.npmjs.com/package/@chrisburnell/svg-sparkline): `npm install @chrisburnell/svg-sparkline`\n1. [Download the source manually from GitHub](https://github.com/chrisburnell/svg-sparkline/releases) into your project.\n1. Skip this step and use the script directly via a 3rd party CDN (not recommended for production use)\n\n### Usage\n\nMake sure you include the `\u003cscript\u003e` in your project (choose one of these):\n\n```html\n\u003c!-- Host yourself --\u003e\n\u003cscript type=\"module\" src=\"svg-sparkline.js\"\u003e\u003c/script\u003e\n```\n\n```html\n\u003c!-- 3rd party CDN, not recommended for production use --\u003e\n\u003cscript\n  type=\"module\"\n  src=\"https://www.unpkg.com/@chrisburnell/svg-sparkline/svg-sparkline.js\"\n\u003e\u003c/script\u003e\n```\n\n```html\n\u003c!-- 3rd party CDN, not recommended for production use --\u003e\n\u003cscript\n  type=\"module\"\n  src=\"https://esm.sh/@chrisburnell/svg-sparkline\"\n\u003e\u003c/script\u003e\n```\n\n## Credit\n\nWith thanks to the following people:\n\n- [David Darnes](https://darn.es) for creating this [Web Component repo template](https://github.com/daviddarnes/component-template)\n- [Jeremy Keith](https://adactio.com) for inspiring me to build my own sparklines based on his [Canvas sparklines](https://adactio.com/journal/5941)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisburnell%2Fsvg-sparkline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisburnell%2Fsvg-sparkline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisburnell%2Fsvg-sparkline/lists"}