{"id":26662855,"url":"https://github.com/speciesfilegroup/svg_radial_menu","last_synced_at":"2025-03-25T14:18:44.804Z","repository":{"id":57140279,"uuid":"352195246","full_name":"SpeciesFileGroup/svg_radial_menu","owner":"SpeciesFileGroup","description":"A generic radial menu in SVG","archived":false,"fork":false,"pushed_at":"2021-09-30T17:25:43.000Z","size":117,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-04-26T05:23:34.075Z","etag":null,"topics":[],"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/SpeciesFileGroup.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":"2021-03-27T22:55:52.000Z","updated_at":"2021-09-30T17:21:07.000Z","dependencies_parsed_at":"2022-09-04T22:10:33.915Z","dependency_job_id":null,"html_url":"https://github.com/SpeciesFileGroup/svg_radial_menu","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpeciesFileGroup%2Fsvg_radial_menu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpeciesFileGroup%2Fsvg_radial_menu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpeciesFileGroup%2Fsvg_radial_menu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SpeciesFileGroup%2Fsvg_radial_menu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SpeciesFileGroup","download_url":"https://codeload.github.com/SpeciesFileGroup/svg_radial_menu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245476707,"owners_count":20621699,"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":[],"created_at":"2025-03-25T14:18:44.091Z","updated_at":"2025-03-25T14:18:44.771Z","avatar_url":"https://github.com/SpeciesFileGroup.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SVG Radial Menu\n\nA simple SVG radial menu\n\n## How to run on localhost\n\nFirst install dependencies:\n\n```sh\nnpm install\n```\n\nTo run in dev mode mode:\n\n```sh\nnpm run dev\n```\n\nThen go to http://localhost:5173\n\n## Installation\n\nWith NPM\n\n```bash\nnpm install @sfg/svg-radial-menu\n```\n\n## Quick start\n\n### Example\n\n```html\n\u003cdiv id=\"svg-menu-container\"\u003e\u003c/div\u003e\n```\n\n```javascript\nimport RadialMenu from '@sfg/svg-radial-menu'\n\nconst element = document.querySelector('#svg-menu-container')\nconst myMenu = new RadialMenu(element, options)\n```\n\n### Options object\n\n```javascript\n{\n  width: 500,     // SVG width\n  height: 500,    // SVG height\n  margin: 2,      // Space between slices\n  centerSize: 30, // Size for empty space in the middle of the radial\n  rotateAngle: 0,  // Start radial angle, default = 0\n\n  svgAttributes: { // SVG attributes\n    class: 'radial-menu'\n    ...\n  },\n\n  svgSliceAttributes: { // default SVG attributes for all slices\n    fontSize: 11,\n    fontFamily: 'Arial',\n    ...\n  },\n\n  slices: [{\n    label: 'Example',\n    name: 'example', // (Optional) Assign a name/id to the slice, useful to identify it on event trigger\n    link: 'http://taxonworks.org', // (Optional) parameter, it will make the slice work as a link\n    radius: 50, // (Optional) Set the slice radius\n    icon: { // (Optional) Adds an icon to the slice\n      width: 20,\n      height: 20,\n      url: '' // url or base64 image\n    },\n    slices: [ // Add another level to the menu\n      {\n        label: '6',\n        name: 'examples counts',\n        size: 26, // (Optional) Set the slice size\n        svgAttributes: {\n          color: '#FFFFFF',\n          fill: '#006ebf'\n        }\n      }\n    ]\n  ],\n\n  middleButton: { // Middle button\n    name: center,\n    radius: 28,\n    name: 'middle',\n    svgAttributes: {\n      ...\n    }\n    icon: {\n      ...\n    }\n  },\n}\n```\n\n### Events\n\n#### click, dblclick, contextmenu, mousedown, mouseup\n\n```javascript\nimport RadialMenu from '@sfg/svg-radial-menu'\n\nconst element = document.querySelector('#svg-menu-container')\nconst myMenu.on('click', function (event) {\n  console.log('Clicked!')\n})\n```\n\nEvents are triggered when a slice or middle button is clicked providing the following data:\n\n```typescript\n{\n  event: PointerEvent,\n  name: string,\n  SegmentObject: Slice | MiddleButton\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspeciesfilegroup%2Fsvg_radial_menu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspeciesfilegroup%2Fsvg_radial_menu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspeciesfilegroup%2Fsvg_radial_menu/lists"}