{"id":27015267,"url":"https://github.com/hugohow/react-native-touchable-graph","last_synced_at":"2025-04-04T14:17:42.818Z","repository":{"id":57340969,"uuid":"133254280","full_name":"hugohow/react-native-touchable-graph","owner":"hugohow","description":"React Native component for simply creating a graph :iphone: , without any iOS or Android issue of touch. ","archived":false,"fork":false,"pushed_at":"2019-03-14T08:27:03.000Z","size":4469,"stargazers_count":30,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-17T06:08:45.013Z","etag":null,"topics":["graph","react-native","victory-native"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/hugohow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-13T16:22:32.000Z","updated_at":"2021-07-12T11:22:17.000Z","dependencies_parsed_at":"2022-09-08T18:40:18.261Z","dependency_job_id":null,"html_url":"https://github.com/hugohow/react-native-touchable-graph","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/hugohow%2Freact-native-touchable-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugohow%2Freact-native-touchable-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugohow%2Freact-native-touchable-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugohow%2Freact-native-touchable-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hugohow","download_url":"https://codeload.github.com/hugohow/react-native-touchable-graph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247190219,"owners_count":20898702,"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":["graph","react-native","victory-native"],"created_at":"2025-04-04T14:17:42.258Z","updated_at":"2025-04-04T14:17:42.808Z","avatar_url":"https://github.com/hugohow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![license](https://img.shields.io/github/license/mashape/apistatus.svg)]()\n[![Version](https://img.shields.io/npm/v/react-native-touchable-graph.svg)](https://www.npmjs.com/package/react-native-touchable-graph)\n\n# react-native-touchable-graph\n\nReact Native component for simply creating a graph, without any iOS or Android issue of touch.\n\n## Motivation\n\n\u003ca href=\"https://github.com/FormidableLabs/victory-native\" target=\"_blank\"\u003eVictory Native\u003c/a\u003e is a great library, but there are tons of problems with the touch behaviour, because it is based on react-native-svg.\nThe idea is to make a wrapper which replace the touchable svg element with react native Touchable component, so you are sure that it will work great both on Android and iOS.\n\n## Example app\n\nAndroid example            |  Ios example\n:-------------------------:|:-------------------------:\n![](./AndroidGraph.gif?raw=true)  |  ![](./iosGraph.gif?raw=true)\n\n\n## Installation\n\n1. Install library and react-native-svg\n\n\t```\n\tnpm i --save victory-native react-native-svg\n\t```\n\t\n\t  Then, if victory-native version \u003e= 0.16.6 \n\n\n\t\tnpm i --save react-native-touchable-graph\n\n\n\t  else\n\n\n\t\tnpm i --save react-native-touchable-graph@0.0.138\n\n\t\n2. Link native code for SVG\n\n\t```\n\treact-native link react-native-svg\n\t```\n\n## Usage\n\nUse as follows:\n\n```jsx\n\nimport { VictoryAxis, VictoryBar, VictoryChart, VictoryArea } from 'victory-native'\nimport TouchableGraph from 'react-native-touchable-graph';\n\nconst data = [\n  { x: 1, y: 13000 },\n  { x: 2, y: 16500 },\n  { x: 3, y: 14250 },\n  { x: 4, y: 19000 }\n];\n\n\n\u003cTouchableGraph\n  onPressBar={(data) =\u003e { console.log(data) }}\n  onPressTickAxis={(data) =\u003e { console.log(data) }}\n  \u003e\n  \u003cVictoryChart\u003e\n    \u003cVictoryAxis\n      crossAxis\n      orientation=\"left\"\n    /\u003e\n    \u003cVictoryAxis \n      dependentAxis\n      crossAxis\n      orientation=\"bottom\"\n    /\u003e\n    \u003cVictoryBar\n      data={data}\n    /\u003e\n    \u003cVictoryArea\n      data={data}\n    /\u003e\n  \u003c/VictoryChart\u003e\n\u003c/TouchableGraph\u003e\n```\n\n## Props\n\nBar props :\n\n* **`barStyle`** _(Object)_ or _(Function(barData, index))_  - Bar style \n* **`onPressBar`** _(Function(barData, index))_ - Callback when a bar is tapped\n* **`renderBar`** _(Function(barData, index))_ - Custom bar\n* **`getBarDatum`** _(Function(bars))_ - Get Bars datum\n\nTick axis props :\n\n* **`tickAxisStyle`** _(Object)_ or _(Function(tickData, index))_  - Tick axis style \n* **`tickAxisTextStyle`** _(Object)_ or _(Function(tickData, index))_  - Tick axis text style \n* **`onPressTickAxis`** _(Function(tickData, index))_ - Callback when a tick axis is tapped\n* **`renderTickAxis`** _(Function(tickData, index))_ - Custom tickAxis\n* **`getTickAxisDatum`** _(Function(ticks))_ - Get Ticks axis datum\n\nOther props :\n\n* **`renderLoading`** _(Function())_ - Render a loading view when initializing\n\n## Roadmap\n\nImprove for : \n* VictoryAxis\n* VictoryBar\n* VictoryChart\n\nAdapt it for : \n* VictoryArea\n* VictoryBoxPlot\n* VictoryCandlestick\n* VictoryErrorBar\n* VictoryPie\n* VictoryPolarAxis\n* VictoryScatter\n* VictoryStack\n* VictoryVoronoi\n\nOthers : \n* Example\n* Expo Example\n* Performance\n* Tests\n\n\n## Author\n\nHugo How-Choong\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugohow%2Freact-native-touchable-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugohow%2Freact-native-touchable-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugohow%2Freact-native-touchable-graph/lists"}