{"id":16430625,"url":"https://github.com/mrfrankel/ruler","last_synced_at":"2025-04-05T19:10:19.228Z","repository":{"id":32421237,"uuid":"35998528","full_name":"MrFrankel/ruler","owner":"MrFrankel","description":"HTML5 Canvas ruler for authoring tools","archived":false,"fork":false,"pushed_at":"2021-10-20T11:26:37.000Z","size":58,"stargazers_count":225,"open_issues_count":9,"forks_count":59,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-29T18:06:39.467Z","etag":null,"topics":["ruler"],"latest_commit_sha":null,"homepage":"http://mrfrankel.github.io/ruler/","language":"JavaScript","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/MrFrankel.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":"2015-05-21T07:41:41.000Z","updated_at":"2025-03-29T04:35:01.000Z","dependencies_parsed_at":"2022-08-08T13:00:26.785Z","dependency_job_id":null,"html_url":"https://github.com/MrFrankel/ruler","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrFrankel%2Fruler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrFrankel%2Fruler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrFrankel%2Fruler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrFrankel%2Fruler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrFrankel","download_url":"https://codeload.github.com/MrFrankel/ruler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247386262,"owners_count":20930619,"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":["ruler"],"created_at":"2024-10-11T08:27:43.604Z","updated_at":"2025-04-05T19:10:19.200Z","avatar_url":"https://github.com/MrFrankel.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"ruler.js\n======\n\n### Demo\n\u003ca href=\"https://mrfrankel.github.io/ruler/\"\u003eDemo Page\u003c/a\u003e\n\n\nruler.js is an HTML5 ruler plugin that provides a set of 'photoshop' like rulers to surround the 'stage' of your authoring tools.\nNo jquery!\nNo dependencies!\n\n###Installation\n\u003chr\u003e\n\u003cbr/\u003e\n\n```terminal\nnpm install ruler.js --save\n```\n\n\u003cbr/\u003e\nThen\n\u003cbr/\u003e\n\n```html\n\u003clink rel=\"stylesheet\" href=\"node_modules/ruler.js/dist/ruler.min.css\"\u003e\n\u003cscript src=\"node_modules/ruler.js//dist/ruler.min.js\"\u003e\u003c/script\u003e\n```\n\n\u003cbr/\u003e\n\n##Getting Started\n\n\u003chr\u003e\n\u003cbr/\u003e\n\n```javascript\nvar myRuler = new ruler({\n        container: document.querySelector('#stage'),// reference to DOM element to apply rulers on\n        rulerHeight: 15, // thickness of ruler\n        fontFamily: 'arial',// font for points\n        fontSize: '7px', \n        strokeStyle: 'black',\n        lineWidth: 1,\n        enableMouseTracking: true,\n        enableToolTip: true\n    });\n```\n### Usage \n```javascript\nmyRuler.api.setPos({x:100, y:100})\n/*\nchange the left, top, positions of the rulers\n*/\nmyRuler.api.setScale(1.5);\n/*\nchange the scale of the points\n*/\nmyRuler.api.toggleRulerVisibility(true);\n/*\nhide/show rulers\n*/\nmyRuler.api.toggleGuideVisibility(true);\n/*\nhide/show guides\n*/\nmyRuler.api.clearGuides(true);\n/*\nget list of guides to store or copy\n*/\nmyRuler.api.getGuides(); // =\u003e [{dimension: number, poxX: number: posY: number}...]\n/*\nset guides from a pre stored list\n*/\nmyRuler.api.setGuides([{dimension: number, poxX: number: posY: number}...]);\n/*\nclear all guides\n*/\nmyRuler.api.destory();\n/*\nremove rulers, guides and references;\n*/\n```\n\n\nYou can also clear a guide line by double clicking on it or dragging it back to the ruler\n\n\n\n### Version\n1.0.0\n\n### Support\n\nAll latest browsers\n\n\n### Development\n\nWant to contribute? Great!\n\nruler.js uses grunt.\n```sh\n$ git clone https://github.com/MrFrankel/ruler.git\n$ npm install\n$ npm run serve\n```\n\n### Todo's\n\nWrite Tests\n\n\nLicense\n----\n\nMIT\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrfrankel%2Fruler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrfrankel%2Fruler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrfrankel%2Fruler/lists"}