{"id":15024644,"url":"https://github.com/jimeh87/pencil","last_synced_at":"2026-01-18T17:33:21.636Z","repository":{"id":34304376,"uuid":"175929657","full_name":"Jimeh87/pencil","owner":"Jimeh87","description":"A Canvas mouse / touch detection directive for Angular. It uses Bresenham's Line Drawing Algorithm to insure a smooth draw.","archived":false,"fork":false,"pushed_at":"2023-01-07T03:51:19.000Z","size":1648,"stargazers_count":2,"open_issues_count":21,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-05T19:17:54.419Z","etag":null,"topics":["angular","canvas","library"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jimeh87.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-16T05:18:40.000Z","updated_at":"2021-02-22T19:45:47.000Z","dependencies_parsed_at":"2023-01-15T06:15:46.560Z","dependency_job_id":null,"html_url":"https://github.com/Jimeh87/pencil","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jimeh87%2Fpencil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jimeh87%2Fpencil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jimeh87%2Fpencil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jimeh87%2Fpencil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jimeh87","download_url":"https://codeload.github.com/Jimeh87/pencil/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247386274,"owners_count":20930618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["angular","canvas","library"],"created_at":"2024-09-24T20:00:40.982Z","updated_at":"2026-01-18T17:33:21.606Z","avatar_url":"https://github.com/Jimeh87.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pencil\n\nA Canvas mouse / touch detection directive for Angular. It uses Bresenham's Line Drawing Algorithm to ensure a smooth draw.\n\n## Demo\n\n[StackBlitz Demo](https://stackblitz.com/edit/pencil-sample)\n\n\n## Latest Version\n\n@jimeh87/pencil@1.0.2\n\n## Setup\n\nAdd dependency `@jimeh87/pencil`\n\nnpm:\n```shell\nnpm install --save @jimeh87/pencil\n```\n\nyarn:\n```shell\nyarn add @jimeh87/pencil\n```\n\nAdd the `PencilModule` to your application module\n\n```js\nimport { PencilModule } from '@jimeh87/pencil';\n\n@NgModule({\n  ...\n  imports: [PencilModule, ...],\n  ...\n})\nexport class YourAppModule {\n}\n```\n\nAdd the directive to your canvas:\n```html\n\u003ccanvas (jrPencil)=\"onDraw($event)\"\n        style=\"width: 500px; height: 500px\"\u003e\n\u003c/canvas\u003e\n```\n\n```js\nexport class AppComponent {\n\n  onDraw(point: { x: number, y: number }) {\n    console.log(point);\n  }\n\n}\n```\n\n## API\n\n### Pencil Directive\n\n#### Selector \n`[jrPencil]`\n\n##### Properties\n| Property                                                                                | Description                                                                            | Example                                                                                   |\n|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|\n| @Output('jrPencil') pencilPositionEvent = new EventEmitter\u003c{ x: number, y: number }\u003e(); | Emits mouse coordinates when `mousedown` or `touchstart` until `mouseup` or `touchend` | ``` \u003ccanvas (jrPencil)=\"onDraw($event)\"\u003e\u003c/canvas\u003e  ```                                    |\n| @Output() pencilUp = new EventEmitter\u003cvoid\u003e();                                          | Emits event when `mouseup` or `touchend`                                               | ``` \u003ccanvas (jrPencil)=\"onDraw($event)\"          (pencilUp)=\"onPencilUp()\"\u003e\u003c/canvas\u003e  ``` |\n| @Input()  pencilDisabled = false;                                                       | disables pencil directive                                                              | ``` \u003ccanvas (jrPencil)=\"onDraw($event)\"         [pencilDisabled]=\"true\"\u003e\u003c/canvas\u003e ```     |\n\n## Usage\n\n* [https://gameoflife.xyz](https://gameoflife.xyz)\n\n## Development\n\n### Publishing\n\nRun `yarn build` and then in `./dist/pencil` run `yarn publish` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimeh87%2Fpencil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimeh87%2Fpencil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimeh87%2Fpencil/lists"}