{"id":14969977,"url":"https://github.com/peteroid/react-polygon","last_synced_at":"2025-10-26T10:31:30.463Z","repository":{"id":57342575,"uuid":"64911123","full_name":"peteroid/react-polygon","owner":"peteroid","description":"A react add-on for drawing polygons for any number of sides, as well as animation","archived":false,"fork":false,"pushed_at":"2020-04-15T22:31:27.000Z","size":500,"stargazers_count":31,"open_issues_count":4,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-31T18:28:05.919Z","etag":null,"topics":["animation","hexagon","pentagon","polygon","react","reactjs"],"latest_commit_sha":null,"homepage":"https://peteroid.github.io/react-polygon/","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/peteroid.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":"2016-08-04T07:08:31.000Z","updated_at":"2024-06-13T08:23:52.000Z","dependencies_parsed_at":"2022-09-16T03:01:38.350Z","dependency_job_id":null,"html_url":"https://github.com/peteroid/react-polygon","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/peteroid%2Freact-polygon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peteroid%2Freact-polygon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peteroid%2Freact-polygon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peteroid%2Freact-polygon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peteroid","download_url":"https://codeload.github.com/peteroid/react-polygon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238310345,"owners_count":19450842,"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":["animation","hexagon","pentagon","polygon","react","reactjs"],"created_at":"2024-09-24T13:42:47.517Z","updated_at":"2025-10-26T10:31:29.977Z","avatar_url":"https://github.com/peteroid.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Standard - JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) [![Build Status](https://travis-ci.org/peteroid/react-polygon.svg?branch=master)](https://travis-ci.org/peteroid/react-polygon) [![npm version](https://badge.fury.io/js/react-polygon.svg)](https://badge.fury.io/js/react-polygon)\n\n# [![react-polygon](https://png.icons8.com/nolan/40/ff723f/polygon.png)](https://peteroid.github.io/react-polygon/) react-polygon\nA react add-on for drawing polygons for any number of sides, as well as animation\n\n# Demo\n[https://peteroid.github.io/react-polygon/](https://peteroid.github.io/react-polygon/)\n\n# Usage\n```javascript\nnpm install react-polygon --save\n```\n\n```javascript\nimport Polygon from 'react-polygon'\n\n// add this to your components\n\u003cPolygon /\u003e\n```\n\n\n# Build your own\n```javascript\nnpm install\nnpm run webpack\n```\n\n# Props\n_name : propType = defaultValue_\n\n## Basic\n- n : number = 3\n- size : number = 50\n- fill : string = \"#ad893e\"\n- ratios : [number] = [1, 1, 1, 1, 1]\n\n## Animation\n- isAnimating : bool = true\n- duration : number = 1000\n\n## renderPoint\nYou can render extra elements on each point by passing a function to the props `renderPoint`. Here is an example for rendering a point on each vertice:\n\n```javascript\nimport React, { Component } from 'react'\nimport Polygon from 'react-polygon'\n\nclass MyPolygon extends Component {\n  myRenderPoint (point) {\n    return (\n      \u003ccircle cx={point[0]} cy={point[1]} r={5} /\u003e\n    )\n  }\n\n  render () {\n    return (\n      \u003cPolygon renderPoint={this.myRenderPoint} /\u003e\n    )\n  }\n}\n```\n\n# Credits\n- logo by [Icons8](https://icons8.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeteroid%2Freact-polygon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeteroid%2Freact-polygon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeteroid%2Freact-polygon/lists"}