{"id":25739643,"url":"https://github.com/anthonykrivonos/react-native-touchmap","last_synced_at":"2025-05-08T20:53:45.118Z","repository":{"id":57340972,"uuid":"178922190","full_name":"anthonykrivonos/react-native-touchmap","owner":"anthonykrivonos","description":"☝️Simple, free, and lightweight heatmap component to track touches in your React Native app!","archived":false,"fork":false,"pushed_at":"2019-04-02T05:19:28.000Z","size":103,"stargazers_count":7,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-20T04:18:06.026Z","etag":null,"topics":["analytics","heatmap","metrics","node","react","react-native","reactnative","touches","touchmap","user-experience","user-interface"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-native-touchmap","language":"TypeScript","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/anthonykrivonos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-01T18:24:04.000Z","updated_at":"2021-01-26T05:46:40.000Z","dependencies_parsed_at":"2022-09-08T18:40:18.458Z","dependency_job_id":null,"html_url":"https://github.com/anthonykrivonos/react-native-touchmap","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/anthonykrivonos%2Freact-native-touchmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonykrivonos%2Freact-native-touchmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonykrivonos%2Freact-native-touchmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anthonykrivonos%2Freact-native-touchmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anthonykrivonos","download_url":"https://codeload.github.com/anthonykrivonos/react-native-touchmap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253149380,"owners_count":21861717,"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":["analytics","heatmap","metrics","node","react","react-native","reactnative","touches","touchmap","user-experience","user-interface"],"created_at":"2025-02-26T08:29:20.353Z","updated_at":"2025-05-08T20:53:45.082Z","avatar_url":"https://github.com/anthonykrivonos.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ☝️ react-native-touchmap\n\nSimple, free, and lightweight heatmap component to track touches in your React Native app!\n\n\u003cimg style=\"width: 40%; margin-right:10%\" alt=\"exported\" src=\"https://media.giphy.com/media/3WvhUQxywKu5vFGvkG/giphy.gif\" /\u003e\n\u003cimg style=\"width: 40%; border: solid 2px red;\" alt=\"exported\" src=\"https://i.imgur.com/dN87VFo.png\" /\u003e\n\n## Getting Started\n\n1. Run `npm install react-native-touchmap` or `yarn add react-native-touchmap` to add this dependency to your project.\n2. Wrap your app's **root component** in the `\u003cTouchmap\u003e` tag.\n3. Export the output however you want!\n\n## The `\u003cTouchmap\u003e` Component\n\nBelow is a **complete** implementation.\n```\n/** Reference variable within your component: */\ntouchmap:Touchmap = null\n\n/** Inside render(): */\n\u003cTouchmap\n    style={s.yourStyle}\n    debug={true}\n    sessionOnly={true}\n    ref={r =\u003e this.touchmap = r}\n\u003e\n    ...\n\u003c/Touchmap\u003e\n```\n\u003cspan style=\"background:teal;font-size: 18pt;\"\u003e\n\u003cspan style=\"color:red;\"\u003eT\u003c/span\u003e\u003cspan style=\"color:orange;\"\u003eh\u003c/span\u003e\u003cspan style=\"color:yellow;\"\u003ea\u003c/span\u003e\u003cspan style=\"color:white;\"\u003et\u003c/span\u003e\u003cspan style=\"color:blue;\"\u003e'\u003c/span\u003e\u003cspan style=\"color:indigo;\"\u003es\u003c/span\u003e\u003cspan style=\"color:red;\"\u003e \u003c/span\u003e\u003cspan style=\"color:violet;\"\u003ei\u003c/span\u003e\u003cspan style=\"color:red;\"\u003et\u003c/span\u003e\u003cspan style=\"color:orange;\"\u003e!\u003c/span\u003e\u003c/span\u003e\n\n### Props\n\n|  | Values | Description |\n|:-----------:|:---------------:|:----------------------------------------------------------------------------------------------:|\n| `style` | {}, [], # | Style of the Touchmap container. |\n| `debug` | true/false | Display debugging features such as red border, version number, and 'View' and 'Clear' options? |\n| `sessionOnly` | true/false | Export touches for only the current session? |\n| `ref` | Touchmap object | Reference available functions `raw`, `clear`, and `export` from a property variable. |\n| `children` | nodes | Child nodes of the Touchmap. Usually the root component of the app. |\n\n### Ref Functions\n\n`clear:()=\u003evoid`\nClears all touches from every session.\n\n`raw:()=\u003eArray\u003cTouchSession\u003e`\nReturns a list of `TouchSession` objects, if you want to parse touches yourself.\n\n`export()=\u003estring`\nReturns an encoded string of the image created. This may be used as a `uri` in an image component or can be handled as an image.\n\n### Type Definitions\n\n```\n/** Multiple touch events constituting a session of having the app running. */\nexport interface TouchSession {\n    /** Unique string identifier of the touch session. */\n    id: string;\n    /** Start time of this session. */\n    startTime: Date;\n    /** End time of this session. Optional because crashes might not register an end time. */\n    endTime?: Date;\n    /** An array of touches during this session. */\n    touches: Array\u003cTouchMeta\u003e\n    /** Size of the device. */\n    deviceSize: DeviceSize;\n}\n\n/** Single touch event object. */\nexport interface TouchMeta {\n    /** Coordinates of the touch. */\n    coordinates: TouchCoordinates;\n    /** Start time of this touch. */\n    startTime: Date;\n    /** End time of this session. Optional because touches may be canceled. */\n    endTime?: Date;\n    /** Duration of the touch, in milliseconds. */\n    duration?: number;\n}\n\n/** Simple coordinates interface. */\nexport interface TouchCoordinates {\n    /** x-coordinate of the touch. */\n    x: number;\n    /** y-coordinate of the touch. */\n    y: number;\n}\n\n/** Simple device size interface. */\nexport interface DeviceSize {\n    /** Width of the device, in pixels. */\n    width: number;\n    /** Height of the device, in pixels. */\n    height: number;\n}\n```\n\n## Contributing\n\nIf you'd like to improve and/or expand the content of this library, feel free to submit pull requests. If you experience any issues with this code, please let me know promptly.\n\n## Authors\n\n* **Anthony Krivonos** - *Developer* - [Portfolio](https://anthonykrivonos.com)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n\n## Acknowledgments\n\n* Vicki Shao for all the support and flames! 🔥","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonykrivonos%2Freact-native-touchmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanthonykrivonos%2Freact-native-touchmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanthonykrivonos%2Freact-native-touchmap/lists"}