├── .babelrc ├── .buckconfig ├── .editorconfig ├── .eslintrc ├── .flowconfig ├── .github ├── issue_template.md └── pull_request_template.md ├── .gitignore ├── .npmignore ├── .npmrc ├── .watchmanconfig ├── CHANGELOG.md ├── License.md ├── README.md ├── circle.yml ├── docs ├── _config.yml ├── bar │ └── index.md ├── images │ └── chart-screenshots.png ├── index.md ├── pie │ └── index.md ├── radar │ └── index.md ├── scatterplot │ └── index.md ├── smoothline │ └── index.md ├── stockline │ └── index.md └── tree │ └── index.md ├── example ├── .babelrc ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── app.json ├── index.android.js ├── index.ios.js ├── ios │ ├── example-tvOS │ │ └── Info.plist │ ├── example-tvOSTests │ │ └── Info.plist │ ├── example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── example-tvOS.xcscheme │ │ │ └── example.xcscheme │ ├── example │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ ├── exampleTests │ │ ├── Info.plist │ │ └── exampleTests.m │ └── project.pbxproj ├── package.json └── src │ ├── App.js │ ├── Home.js │ ├── Menu.js │ ├── bar │ └── BarChartColumnBasic.js │ ├── pie │ ├── PieChartBasic.js │ └── PieChartBasicAnimation.js │ ├── radar │ └── RadarChartBasic.js │ ├── scatterplot │ └── ScatterplotChartBasic.js │ ├── smoothline │ ├── SmoothLineChartBasic.js │ ├── SmoothLineChartRegions.js │ └── SmoothLineChartRegionsExtended.js │ ├── stockline │ ├── StockLineChartBasic.js │ ├── StockLineChartDynamicLineRendering.js │ ├── StockLineChartDynamicTickLabels.js │ ├── StockLineChartGesture.js │ └── StockLineChartStaticTickLabels.js │ └── tree │ └── TreeChartBasic.js ├── package-lock.json ├── package.json └── src ├── Axis.js ├── Bar.js ├── GridAxis.js ├── Line.js ├── Pie.js ├── Radar.js ├── Scatterplot.js ├── SmoothLine.js ├── StockLine.js ├── Tree.js ├── __mocks__ └── react-native-svg.js ├── __tests__ ├── SmoothLine │ ├── SmoothLineBasic-test.js │ ├── SmoothLineRegions-test.js │ ├── SmoothLineRegionsExtended-test.js │ └── __snapshots__ │ │ ├── SmoothLineBasic-test.js.snap │ │ ├── SmoothLineRegions-test.js.snap │ │ └── SmoothLineRegionsExtended-test.js.snap ├── pie │ ├── PieBasic-test.js │ └── __snapshots__ │ │ └── PieBasic-test.js.snap ├── scatterplot │ ├── ScatterplotBasic-test.js │ └── __snapshots__ │ │ └── ScatterplotBasic-test.js.snap └── stockline │ ├── StockLineBasic-test.js │ ├── StockLineDynamicTickLabels-test.js │ ├── StockLineStaticTickLabels-test.js │ └── __snapshots__ │ ├── StockLineBasic-test.js.snap │ ├── StockLineDynamicTickLabels-test.js.snap │ └── StockLineStaticTickLabels-test.js.snap ├── index.js └── util.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } 4 | -------------------------------------------------------------------------------- /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "globals": { 4 | "requestAnimationFrame": true 5 | }, 6 | "rules": { 7 | "indent": [ 8 | "error", 9 | 2, 10 | {"SwitchCase": 1} 11 | ], 12 | "quotes": [ 13 | "error", 14 | "single", 15 | "avoid-escape" 16 | ], 17 | "linebreak-style": [ 18 | "error", 19 | "unix" 20 | ], 21 | "semi": [ 22 | "error", 23 | "never" 24 | ], 25 | "comma-dangle": 0, 26 | "no-var": 1, 27 | 28 | "react/jsx-boolean-value": [1,"always"], 29 | "react/jsx-no-undef": 1, 30 | "react/jsx-uses-react": 1, 31 | "react/jsx-uses-vars": 1, 32 | "react/no-danger": 1, 33 | "react/no-deprecated": 1, 34 | "react/no-did-mount-set-state": 1, 35 | "react/no-did-update-set-state": 1, 36 | "react/no-unknown-property": 1, 37 | "react/react-in-jsx-scope": 1, 38 | "react/require-extension": 1, 39 | "react/sort-comp": 1, 40 | "react/prefer-es6-class": 1, 41 | 42 | "react-native/no-unused-styles": 2, 43 | "react-native/split-platform-components": 2, 44 | }, 45 | "env": { 46 | "es6": true, 47 | "node": true, 48 | "jasmine": true, 49 | "jest": true 50 | }, 51 | "extends": "eslint:recommended", 52 | "ecmaFeatures": { 53 | "jsx": true, 54 | "experimentalObjectRestSpread": true 55 | }, 56 | "plugins": [ 57 | "react", 58 | "react-native", 59 | "babel" 60 | ] 61 | } 62 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | # We fork some components by platform. 4 | .*/*.web.js 5 | .*/*.android.js 6 | 7 | # Some modules have their own node_modules with overlap 8 | .*/node_modules/node-haste/.* 9 | 10 | # Ugh 11 | .*/node_modules/babel.* 12 | .*/node_modules/babylon.* 13 | .*/node_modules/invariant.* 14 | 15 | # Ignore react and fbjs where there are overlaps, but don't ignore 16 | # anything that react-native relies on 17 | .*/node_modules/fbjs/lib/Map.js 18 | .*/node_modules/fbjs/lib/fetch.js 19 | .*/node_modules/fbjs/lib/ExecutionEnvironment.js 20 | .*/node_modules/fbjs/lib/ErrorUtils.js 21 | 22 | # Flow has a built-in definition for the 'react' module which we prefer to use 23 | # over the currently-untyped source 24 | .*/node_modules/react/react.js 25 | .*/node_modules/react/lib/React.js 26 | .*/node_modules/react/lib/ReactDOM.js 27 | 28 | .*/__mocks__/.* 29 | .*/__tests__/.* 30 | 31 | .*/commoner/test/source/widget/share.js 32 | 33 | # Ignore commoner tests 34 | .*/node_modules/commoner/test/.* 35 | 36 | # See https://github.com/facebook/flow/issues/442 37 | .*/react-tools/node_modules/commoner/lib/reader.js 38 | 39 | # Ignore jest 40 | .*/node_modules/jest-cli/.* 41 | 42 | # Ignore Website 43 | .*/website/.* 44 | 45 | # Ignore generators 46 | .*/local-cli/generator.* 47 | 48 | # Ignore BUCK generated folders 49 | .*\.buckd/ 50 | 51 | .*/node_modules/is-my-json-valid/test/.*\.json 52 | .*/node_modules/iconv-lite/encodings/tables/.*\.json 53 | .*/node_modules/y18n/test/.*\.json 54 | .*/node_modules/spdx-license-ids/spdx-license-ids.json 55 | .*/node_modules/spdx-exceptions/index.json 56 | .*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json 57 | .*/node_modules/resolve/lib/core.json 58 | .*/node_modules/jsonparse/samplejson/.*\.json 59 | .*/node_modules/json5/test/.*\.json 60 | .*/node_modules/ua-parser-js/test/.*\.json 61 | .*/node_modules/builtin-modules/builtin-modules.json 62 | .*/node_modules/binary-extensions/binary-extensions.json 63 | .*/node_modules/url-regex/tlds.json 64 | .*/node_modules/joi/.*\.json 65 | .*/node_modules/isemail/.*\.json 66 | .*/node_modules/tr46/.*\.json 67 | 68 | 69 | [include] 70 | 71 | [libs] 72 | node_modules/react-native/Libraries/react-native/react-native-interface.js 73 | node_modules/react-native/flow 74 | flow/ 75 | 76 | [options] 77 | module.system=haste 78 | 79 | esproposal.class_static_fields=enable 80 | esproposal.class_instance_fields=enable 81 | 82 | munge_underscores=true 83 | 84 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 85 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\)$' -> 'RelativeImageStub' 86 | 87 | suppress_type=$FlowIssue 88 | suppress_type=$FlowFixMe 89 | suppress_type=$FixMe 90 | 91 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-2]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 92 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-2]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 93 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 94 | 95 | [version] 96 | ^0.22.0 97 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | Before filing an issue please ensure the following boxes are checked, if applicable: 2 | 3 | - [ ] I have searched for existing issues 4 | - [ ] I have provided detailed instructions that can reproduce the issue (including code and data necessary) 5 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Thank you for contributing a pull request. 2 | 3 | Please ensure that you have signed the [CLA](https://docs.google.com/forms/d/19LpBBjykHPox18vrZvBbZUcK6gQTj7qv1O5hCduAZFU/viewform). 4 | 5 | - [ ] I have signed the CLA 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | .history 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Coverage tools 12 | lib-cov 13 | coverage 14 | coverage.html 15 | .cover* 16 | 17 | # Dependency directory 18 | node_modules 19 | 20 | # Example build directory 21 | example/dist 22 | 23 | # Editor and other tmp files 24 | *.swp 25 | *.un~ 26 | *.iml 27 | *.ipr 28 | *.iws 29 | *.sublime-* 30 | .idea/ 31 | *.DS_Store 32 | 33 | util/watchman-update-example-src/watchman-update-example-src.sh 34 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # node.js 25 | # 26 | node_modules/ 27 | npm-debug.log 28 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | tag-version-prefix="" -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ** Capital One built this project to help our engineers as well as users in the react native community. We have decided to focus on alternatives to react native, and, unfortunately, we are no longer able to fully support the project. We have archived the project oas of Mar 1 2018 where it will be available in a read-only state. Feel free to fork the project and maintain your own version. ** 2 | 3 | 4 | react-native-pathjs-charts 5 | ======================= 6 | 7 | [![npm version](https://badge.fury.io/js/react-native-pathjs-charts.svg)](https://badge.fury.io/js/react-native-pathjs-charts) 8 | 9 | This library is a cross-platform (iOS/Android) library of charts/graphs using [react-native-svg](https://github.com/magicismight/react-native-svg) and [paths-js](https://github.com/andreaferretti/paths-js) based on the excellent work done by Roman Samec in the [react-pathjs-chart](https://github.com/rsamec/react-pathjs-chart) library. The project is an early attempt at providing a ubiquitous solution for charts & graphs for React Native that offer a unified view across devices. 10 | 11 | Components include Pie charts, Bar charts, Smoothline charts, Stockline charts, Scatterplots, Tree graphs and Radar graphs. Since Paths-Js makes no assumptions about rendering, this library is perfect for using SVG path objects to render custom charts easily. 12 | 13 | This library is in its early stages, but I welcome contributors who would like to help make this the charting solution for React Native. Many of our mobile experiences need to create dashboards. Up to now, we've only been seeing libraries that are native bridges. Wouldn't it be great to have a cross platform solution that just worked? 14 | 15 | ![](https://github.com/capitalone/react-native-pathjs-charts/wiki/images/chart-screenshots.png) 16 | 17 | ## Installation 18 | 19 | To add the library to your React Native project: 20 | 21 | ``` 22 | npm install react-native-pathjs-charts --save 23 | react-native link react-native-svg 24 | ``` 25 | 26 | For further information on usage, see the [docs](https://capitalone.github.io/react-native-pathjs-charts/) 27 | 28 | 29 | ## Current Features 30 | 31 | + Pie, Bar, Smoothline, Stockline, Scatterplot, Tree and Radar graphs 32 | + Configuration of format, labels, colors, axis, ticks, lines 33 | + No touch support (yet) 34 | + No animations (yet) 35 | + Chart information configurable based on data parameters which specify which variables are accessors 36 | + Rendering works on iOS/Android 37 | + No native dependencies for linking (except linking required by [react-native-svg](https://github.com/magicismight/react-native-svg)) 38 | 39 | ## Example Application 40 | 41 | To run the example application (from a cloned repo): 42 | 43 | ``` 44 | cd example 45 | npm install 46 | react-native link react-native-svg 47 | react-native run-ios 48 | # or 49 | react-native run-android 50 | ``` 51 | 52 | ### Developing and Testing With The Example App 53 | 54 | As you are working on changing src files in this library and testing those changes against the example app, it is necessary to copy files to example/node_modules/react-native-pathjs-charts each time a change is made. To automate this, a `sync-rnpc` script has been added that will create a background process to watch for src file changes and automatically copy them. To enable this: 55 | 56 | ``` 57 | cd example 58 | npm run sync-rnpc 59 | ``` 60 | 61 | ## Todo 62 | 63 | For this library to really shine, there are a lot of improvements to be made. Here are some of my top ideas: 64 | + Add basic animations to draw the charts 65 | + Add touch functionality (as the react-native-svg library adds touch features) 66 | + Add the ability to absolutely position regular React-Native views in relation to SVG chart elements 67 | + More chart types 68 | + More axis controls (to control scale) 69 | + Add View component support to allow custom components instead of message when no data appears 70 | + Events 71 | + More documentation, information on configuration 72 | + Extended examples 73 | + Bug fixing, unit testing, cleanup 74 | + CICD pipeline with confirmed build success 75 | 76 | 77 | ## Contributing 78 | 79 | Contributors: 80 | We welcome your interest in Capital One’s Open Source Projects (the “Project”). Any Contributor to the project must accept and sign a CLA indicating agreement to the license terms. Except for the license granted in this CLA to Capital One and to recipients of software distributed by Capital One, you reserve all right, title, and interest in and to your contributions; this CLA does not impact your rights to use your own contributions for any other purpose. 81 | 82 | [Link to CLA](https://docs.google.com/forms/d/19LpBBjykHPox18vrZvBbZUcK6gQTj7qv1O5hCduAZFU/viewform) 83 | 84 | This project adheres to the [Open Source Code of Conduct](http://www.capitalone.io/codeofconduct/). By participating, you are expected to honor this code. 85 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | node: 3 | version: v6.1.0 4 | 5 | dependencies: 6 | pre: 7 | - echo -e "$NPM_USER\n$NPM_PASS\n$NPM_EMAIL" | npm login 8 | - npm --version 9 | - node --version 10 | post: 11 | - npm test -- --version 12 | 13 | test: 14 | override: 15 | - npm test 16 | 17 | deployment: 18 | release: 19 | tag: /[0-9]+(\.[0-9]+)*/ 20 | commands: 21 | - npm publish 22 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal -------------------------------------------------------------------------------- /docs/bar/index.md: -------------------------------------------------------------------------------- 1 | # Bar Charts 2 | 3 | Basic Column Chart 4 | ```javascript 5 | render() { 6 | let data = [ 7 | [{ 8 | "v": 49, 9 | "name": "apple" 10 | }, { 11 | "v": 42, 12 | "name": "apple" 13 | }], 14 | [{ 15 | "v": 69, 16 | "name": "banana" 17 | }, { 18 | "v": 62, 19 | "name": "banana" 20 | }], 21 | [{ 22 | "v": 29, 23 | "name": "grape" 24 | }, { 25 | "v": 15, 26 | "name": "grape" 27 | }] 28 | ] 29 | 30 | let options = { 31 | width: 300, 32 | height: 300, 33 | margin: { 34 | top: 20, 35 | left: 25, 36 | bottom: 50, 37 | right: 20 38 | }, 39 | color: '#2980B9', 40 | gutter: 20, 41 | animate: { 42 | type: 'oneByOne', 43 | duration: 200, 44 | fillTransition: 3 45 | }, 46 | axisX: { 47 | showAxis: true, 48 | showLines: true, 49 | showLabels: true, 50 | showTicks: true, 51 | zeroAxis: false, 52 | orient: 'bottom', 53 | label: { 54 | fontFamily: 'Arial', 55 | fontSize: 8, 56 | fontWeight: true, 57 | fill: '#34495E' 58 | } 59 | }, 60 | axisY: { 61 | showAxis: true, 62 | showLines: true, 63 | showLabels: true, 64 | showTicks: true, 65 | zeroAxis: false, 66 | orient: 'left', 67 | label: { 68 | fontFamily: 'Arial', 69 | fontSize: 8, 70 | fontWeight: true, 71 | fill: '#34495E' 72 | } 73 | } 74 | } 75 | 76 | return ( 77 | 78 | 79 | 80 | ) 81 | } 82 | ``` 83 | -------------------------------------------------------------------------------- /docs/images/chart-screenshots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capitalone/react-native-pathjs-charts/857d4478dbb5d6b1b9f008e252d7be96e21fc390/docs/images/chart-screenshots.png -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | ![]({{ site.baseurl }}{% link images/chart-screenshots.png %}) 2 | 3 | Chart Types 4 | - [Bar Charts]({{ site.baseurl }}{% link bar/index.md %}) 5 | - [Pie Charts]({{ site.baseurl }}{% link pie/index.md %}) 6 | - [Radar Charts]({{ site.baseurl }}{% link radar/index.md %}) 7 | - [Scatterplot Charts]({{ site.baseurl }}{% link scatterplot/index.md %}) 8 | - [SmoothLine Charts]({{ site.baseurl }}{% link smoothline/index.md %}) 9 | - [StockLine Charts]({{ site.baseurl }}{% link stockline/index.md %}) 10 | - [Tree Charts]({{ site.baseurl }}{% link tree/index.md %}) 11 | -------------------------------------------------------------------------------- /docs/pie/index.md: -------------------------------------------------------------------------------- 1 | # Pie Charts 2 | 3 | Basic Pie Chart 4 | ```javascript 5 | render() { 6 | let data = [{ 7 | "name": "Washington", 8 | "population": 7694980 9 | }, { 10 | "name": "Oregon", 11 | "population": 2584160 12 | }, { 13 | "name": "Minnesota", 14 | "population": 6590667 15 | }, { 16 | "name": "Alaska", 17 | "population": 7284698 18 | }] 19 | 20 | let options = { 21 | margin: { 22 | top: 20, 23 | left: 20, 24 | right: 20, 25 | bottom: 20 26 | }, 27 | width: 350, 28 | height: 350, 29 | color: '#2980B9', 30 | r: 50, 31 | R: 150, 32 | legendPosition: 'topLeft', 33 | animate: { 34 | type: 'oneByOne', 35 | duration: 200, 36 | fillTransition: 3 37 | }, 38 | label: { 39 | fontFamily: 'Arial', 40 | fontSize: 8, 41 | fontWeight: true, 42 | color: '#ECF0F1' 43 | } 44 | } 45 | 46 | return ( 47 | 48 | 52 | 53 | ) 54 | } 55 | 56 | ``` 57 | -------------------------------------------------------------------------------- /docs/radar/index.md: -------------------------------------------------------------------------------- 1 | # Radar Charts 2 | 3 | Basic Radar Chart 4 | ```javascript 5 | render() { 6 | let data = [{ 7 | "speed": 74, 8 | "balance": 29, 9 | "explosives": 40, 10 | "energy": 40, 11 | "flexibility": 30, 12 | "agility": 25, 13 | "endurance": 44 14 | }] 15 | 16 | let options = { 17 | width: 290, 18 | height: 290, 19 | margin: { 20 | top: 20, 21 | left: 20, 22 | right: 30, 23 | bottom: 20 24 | }, 25 | r: 150, 26 | max: 100, 27 | fill: "#2980B9", 28 | stroke: "#2980B9", 29 | animate: { 30 | type: 'oneByOne', 31 | duration: 200 32 | }, 33 | label: { 34 | fontFamily: 'Arial', 35 | fontSize: 14, 36 | fontWeight: true, 37 | fill: '#34495E' 38 | } 39 | } 40 | 41 | return ( 42 | 43 | 44 | 45 | ) 46 | } 47 | ``` 48 | -------------------------------------------------------------------------------- /docs/scatterplot/index.md: -------------------------------------------------------------------------------- 1 | # Scatterplot Charts 2 | 3 | Basic Scatterplot Chart 4 | ```javascript 5 | render() { 6 | let data = [ 7 | [{ 8 | "title": "Amapá", 9 | "rating": 4.47, 10 | "episode": 0 11 | }, { 12 | "title": "Santa Catarina", 13 | "rating": 3.3, 14 | "episode": 1 15 | }, { 16 | "title": "Minas Gerais", 17 | "rating": 6.46, 18 | "episode": 2 19 | }, { 20 | "title": "Amazonas", 21 | "rating": 3.87, 22 | "episode": 3 23 | }, { 24 | "title": "Mato Grosso do Sul", 25 | "rating": 2.8, 26 | "episode": 4 27 | }, { 28 | "title": "Mato Grosso do Sul", 29 | "rating": 2.05, 30 | "episode": 5 31 | }, { 32 | "title": "Tocantins", 33 | "rating": 7.28, 34 | "episode": 6 35 | }, { 36 | "title": "Roraima", 37 | "rating": 5.23, 38 | "episode": 7 39 | }, { 40 | "title": "Roraima", 41 | "rating": 7.76, 42 | "episode": 8 43 | }, { 44 | "title": "Amazonas", 45 | "rating": 2.26, 46 | "episode": 9 47 | }, { 48 | "title": "Mato Grosso do Sul", 49 | "rating": 2.46, 50 | "episode": 10 51 | }, { 52 | "title": "Santa Catarina", 53 | "rating": 7.59, 54 | "episode": 11 55 | }, { 56 | "title": "Acre", 57 | "rating": 3.74, 58 | "episode": 12 59 | }, { 60 | "title": "Amapá", 61 | "rating": 5.03, 62 | "episode": 13 63 | }, { 64 | "title": "Paraíba", 65 | "rating": 4.16, 66 | "episode": 14 67 | }, { 68 | "title": "Mato Grosso", 69 | "rating": 0.81, 70 | "episode": 15 71 | }, { 72 | "title": "Rio de Janeiro", 73 | "rating": 3.01, 74 | "episode": 16 75 | }, { 76 | "title": "Rio de Janeiro", 77 | "rating": 0, 78 | "episode": 17 79 | }, { 80 | "title": "Distrito Federal", 81 | "rating": 5.46, 82 | "episode": 18 83 | }, { 84 | "title": "São Paulo", 85 | "rating": 9.71, 86 | "episode": 19 87 | }, { 88 | "title": "Mato Grosso", 89 | "rating": 7.9, 90 | "episode": 20 91 | }, { 92 | "title": "Tocantins", 93 | "rating": 4.2, 94 | "episode": 21 95 | }, { 96 | "title": "Amapá", 97 | "rating": 6, 98 | "episode": 22 99 | }, { 100 | "title": "Paraná", 101 | "rating": 7.99, 102 | "episode": 23 103 | }, { 104 | "title": "Mato Grosso do Sul", 105 | "rating": 1.07, 106 | "episode": 24 107 | }, { 108 | "title": "Tocantins", 109 | "rating": 1.42, 110 | "episode": 25 111 | }, { 112 | "title": "Paraná", 113 | "rating": 5.94, 114 | "episode": 26 115 | }, { 116 | "title": "Maranhão", 117 | "rating": 3.17, 118 | "episode": 27 119 | }, { 120 | "title": "Maranhão", 121 | "rating": 1.58, 122 | "episode": 28 123 | }, { 124 | "title": "Rondônia", 125 | "rating": 6.12, 126 | "episode": 29 127 | }, { 128 | "title": "Roraima", 129 | "rating": 7.28, 130 | "episode": 30 131 | }, { 132 | "title": "Mato Grosso", 133 | "rating": 4.74, 134 | "episode": 31 135 | }, { 136 | "title": "Roraima", 137 | "rating": 1.47, 138 | "episode": 32 139 | }, { 140 | "title": "Alagoas", 141 | "rating": 9, 142 | "episode": 33 143 | }, { 144 | "title": "Amazonas", 145 | "rating": 0.43, 146 | "episode": 34 147 | }, { 148 | "title": "Mato Grosso do Sul", 149 | "rating": 8.61, 150 | "episode": 35 151 | }, { 152 | "title": "Tocantins", 153 | "rating": 0.6, 154 | "episode": 36 155 | }, { 156 | "title": "Maranhão", 157 | "rating": 9.62, 158 | "episode": 37 159 | }, { 160 | "title": "Rio de Janeiro", 161 | "rating": 4.79, 162 | "episode": 38 163 | }, { 164 | "title": "Santa Catarina", 165 | "rating": 7.71, 166 | "episode": 39 167 | }, { 168 | "title": "Piauí", 169 | "rating": 3.83, 170 | "episode": 40 171 | }, { 172 | "title": "Pernambuco", 173 | "rating": 8.19, 174 | "episode": 41 175 | }, { 176 | "title": "Bahia", 177 | "rating": 6.98, 178 | "episode": 42 179 | }, { 180 | "title": "Minas Gerais", 181 | "rating": 4.52, 182 | "episode": 43 183 | }] 184 | ] 185 | 186 | let options = { 187 | width: 290, 188 | height: 290, 189 | r: 2, 190 | margin: { 191 | top: 20, 192 | left: 40, 193 | bottom: 30, 194 | right: 30 195 | }, 196 | fill: "#2980B9", 197 | stroke: "#3E90F0", 198 | animate: { 199 | type: 'delayed', 200 | duration: 200 201 | }, 202 | label: { 203 | fontFamily: 'Arial', 204 | fontSize: 8, 205 | fontWeight: true, 206 | fill: '#34495E' 207 | }, 208 | axisX: { 209 | showAxis: true, 210 | showLines: true, 211 | showLabels: true, 212 | showTicks: true, 213 | zeroAxis: false, 214 | orient: 'bottom', 215 | label: { 216 | fontFamily: 'Arial', 217 | fontSize: 8, 218 | fontWeight: true, 219 | fill: '#34495E' 220 | } 221 | }, 222 | axisY: { 223 | showAxis: true, 224 | showLines: true, 225 | showLabels: true, 226 | showTicks: true, 227 | zeroAxis: false, 228 | orient: 'left', 229 | label: { 230 | fontFamily: 'Arial', 231 | fontSize: 8, 232 | fontWeight: true, 233 | fill: '#34495E' 234 | } 235 | } 236 | } 237 | 238 | return ( 239 | 240 | 241 | 242 | ) 243 | } 244 | ``` 245 | -------------------------------------------------------------------------------- /docs/smoothline/index.md: -------------------------------------------------------------------------------- 1 | # SmoothLine Charts 2 | 3 | Basic SmoothLine Chart 4 | ```javascript 5 | render() { 6 | let data = [ 7 | [{ 8 | "x": -10, 9 | "y": -1000 10 | }, { 11 | "x": -9, 12 | "y": -729 13 | }, { 14 | "x": -8, 15 | "y": -512 16 | }, { 17 | "x": -7, 18 | "y": -343 19 | }, { 20 | "x": -6, 21 | "y": -216 22 | }, { 23 | "x": -5, 24 | "y": -125 25 | }, { 26 | "x": -4, 27 | "y": -64 28 | }, { 29 | "x": -3, 30 | "y": -27 31 | }, { 32 | "x": -2, 33 | "y": -8 34 | }, { 35 | "x": -1, 36 | "y": -1 37 | }, { 38 | "x": 0, 39 | "y": 0 40 | }, { 41 | "x": 1, 42 | "y": 1 43 | }, { 44 | "x": 2, 45 | "y": 8 46 | }, { 47 | "x": 3, 48 | "y": 27 49 | }, { 50 | "x": 4, 51 | "y": 64 52 | }, { 53 | "x": 5, 54 | "y": 125 55 | }, { 56 | "x": 6, 57 | "y": 216 58 | }, { 59 | "x": 7, 60 | "y": 343 61 | }, { 62 | "x": 8, 63 | "y": 512 64 | }, { 65 | "x": 9, 66 | "y": 729 67 | }, { 68 | "x": 10, 69 | "y": 1000 70 | }], 71 | [{ 72 | "x": -10, 73 | "y": 100 74 | }, { 75 | "x": -9, 76 | "y": 81 77 | }, { 78 | "x": -8, 79 | "y": 64 80 | }, { 81 | "x": -7, 82 | "y": 49 83 | }, { 84 | "x": -6, 85 | "y": 36 86 | }, { 87 | "x": -5, 88 | "y": 25 89 | }, { 90 | "x": -4, 91 | "y": 16 92 | }, { 93 | "x": -3, 94 | "y": 9 95 | }, { 96 | "x": -2, 97 | "y": 4 98 | }, { 99 | "x": -1, 100 | "y": 1 101 | }, { 102 | "x": 0, 103 | "y": 0 104 | }, { 105 | "x": 1, 106 | "y": 1 107 | }, { 108 | "x": 2, 109 | "y": 4 110 | }, { 111 | "x": 3, 112 | "y": 9 113 | }, { 114 | "x": 4, 115 | "y": 16 116 | }, { 117 | "x": 5, 118 | "y": 25 119 | }, { 120 | "x": 6, 121 | "y": 36 122 | }, { 123 | "x": 7, 124 | "y": 49 125 | }, { 126 | "x": 8, 127 | "y": 64 128 | }, { 129 | "x": 9, 130 | "y": 81 131 | }, { 132 | "x": 10, 133 | "y": 100 134 | }] 135 | ] 136 | 137 | let options = { 138 | width: 280, 139 | height: 280, 140 | color: '#2980B9', 141 | margin: { 142 | top: 20, 143 | left: 45, 144 | bottom: 25, 145 | right: 20 146 | }, 147 | animate: { 148 | type: 'delayed', 149 | duration: 200 150 | }, 151 | axisX: { 152 | showAxis: true, 153 | showLines: true, 154 | showLabels: true, 155 | showTicks: true, 156 | zeroAxis: false, 157 | orient: 'bottom', 158 | label: { 159 | fontFamily: 'Arial', 160 | fontSize: 14, 161 | fontWeight: true, 162 | fill: '#34495E' 163 | } 164 | }, 165 | axisY: { 166 | showAxis: true, 167 | showLines: true, 168 | showLabels: true, 169 | showTicks: true, 170 | zeroAxis: false, 171 | orient: 'left', 172 | label: { 173 | fontFamily: 'Arial', 174 | fontSize: 14, 175 | fontWeight: true, 176 | fill: '#34495E' 177 | } 178 | } 179 | } 180 | 181 | return ( 182 | 183 | 184 | 185 | ) 186 | } 187 | ``` 188 | -------------------------------------------------------------------------------- /docs/stockline/index.md: -------------------------------------------------------------------------------- 1 | # StockLine Charts 2 | 3 | Basic StockLine Chart 4 | ```javascript 5 | render() { 6 | let data = [ 7 | [{ 8 | "x": 0, 9 | "y": 47782 10 | }, { 11 | "x": 1, 12 | "y": 48497 13 | }, { 14 | "x": 2, 15 | "y": 77128 16 | }, { 17 | "x": 3, 18 | "y": 73413 19 | }, { 20 | "x": 4, 21 | "y": 58257 22 | }, { 23 | "x": 5, 24 | "y": 40579 25 | }, { 26 | "x": 6, 27 | "y": 72893 28 | }, { 29 | "x": 7, 30 | "y": 60663 31 | }, { 32 | "x": 8, 33 | "y": 15715 34 | }, { 35 | "x": 9, 36 | "y": 40305 37 | }, { 38 | "x": 10, 39 | "y": 68592 40 | }, { 41 | "x": 11, 42 | "y": 95664 43 | }, { 44 | "x": 12, 45 | "y": 17908 46 | }, { 47 | "x": 13, 48 | "y": 22838 49 | }, { 50 | "x": 14, 51 | "y": 32153 52 | }, { 53 | "x": 15, 54 | "y": 56594 55 | }, { 56 | "x": 16, 57 | "y": 76348 58 | }, { 59 | "x": 17, 60 | "y": 46222 61 | }, { 62 | "x": 18, 63 | "y": 59304 64 | }], 65 | [{ 66 | "x": 0, 67 | "y": 132189 68 | }, { 69 | "x": 1, 70 | "y": 61705 71 | }, { 72 | "x": 2, 73 | "y": 154976 74 | }, { 75 | "x": 3, 76 | "y": 81304 77 | }, { 78 | "x": 4, 79 | "y": 172572 80 | }, { 81 | "x": 5, 82 | "y": 140656 83 | }, { 84 | "x": 6, 85 | "y": 148606 86 | }, { 87 | "x": 7, 88 | "y": 53010 89 | }, { 90 | "x": 8, 91 | "y": 110783 92 | }, { 93 | "x": 9, 94 | "y": 196446 95 | }, { 96 | "x": 10, 97 | "y": 117057 98 | }, { 99 | "x": 11, 100 | "y": 186765 101 | }, { 102 | "x": 12, 103 | "y": 174908 104 | }, { 105 | "x": 13, 106 | "y": 75247 107 | }, { 108 | "x": 14, 109 | "y": 192894 110 | }, { 111 | "x": 15, 112 | "y": 150356 113 | }, { 114 | "x": 16, 115 | "y": 180360 116 | }, { 117 | "x": 17, 118 | "y": 175697 119 | }, { 120 | "x": 18, 121 | "y": 114967 122 | }], 123 | [{ 124 | "x": 0, 125 | "y": 125797 126 | }, { 127 | "x": 1, 128 | "y": 256656 129 | }, { 130 | "x": 2, 131 | "y": 222260 132 | }, { 133 | "x": 3, 134 | "y": 265642 135 | }, { 136 | "x": 4, 137 | "y": 263902 138 | }, { 139 | "x": 5, 140 | "y": 113453 141 | }, { 142 | "x": 6, 143 | "y": 289461 144 | }, { 145 | "x": 7, 146 | "y": 293850 147 | }, { 148 | "x": 8, 149 | "y": 206079 150 | }, { 151 | "x": 9, 152 | "y": 240859 153 | }, { 154 | "x": 10, 155 | "y": 152776 156 | }, { 157 | "x": 11, 158 | "y": 297282 159 | }, { 160 | "x": 12, 161 | "y": 175177 162 | }, { 163 | "x": 13, 164 | "y": 169233 165 | }, { 166 | "x": 14, 167 | "y": 237827 168 | }, { 169 | "x": 15, 170 | "y": 242429 171 | }, { 172 | "x": 16, 173 | "y": 218230 174 | }, { 175 | "x": 17, 176 | "y": 161511 177 | }, { 178 | "x": 18, 179 | "y": 153227 180 | }] 181 | ] 182 | let options = { 183 | width: 250, 184 | height: 250, 185 | color: '#2980B9', 186 | margin: { 187 | top: 10, 188 | left: 35, 189 | bottom: 30, 190 | right: 10 191 | }, 192 | animate: { 193 | type: 'delayed', 194 | duration: 200 195 | }, 196 | axisX: { 197 | showAxis: true, 198 | showLines: true, 199 | showLabels: true, 200 | showTicks: true, 201 | zeroAxis: false, 202 | orient: 'bottom', 203 | tickValues: [], 204 | label: { 205 | fontFamily: 'Arial', 206 | fontSize: 8, 207 | fontWeight: true, 208 | fill: '#34495E' 209 | } 210 | }, 211 | axisY: { 212 | showAxis: true, 213 | showLines: true, 214 | showLabels: true, 215 | showTicks: true, 216 | zeroAxis: false, 217 | orient: 'left', 218 | tickValues: [], 219 | label: { 220 | fontFamily: 'Arial', 221 | fontSize: 8, 222 | fontWeight: true, 223 | fill: '#34495E' 224 | } 225 | } 226 | } 227 | 228 | return ( 229 | 230 | 231 | 232 | ) 233 | } 234 | ``` 235 | -------------------------------------------------------------------------------- /docs/tree/index.md: -------------------------------------------------------------------------------- 1 | # Tree Charts 2 | 3 | Basic Tree Chart 4 | ```javascript 5 | render() { 6 | let data = { 7 | "name": "Root", 8 | "children": [{ 9 | "name": "Santa Catarina", 10 | "children": [{ 11 | "name": "Tromp" 12 | }, { 13 | "name": "Thompson" 14 | }, { 15 | "name": "Ryan" 16 | }] 17 | }, { 18 | "name": "Acre", 19 | "children": [{ 20 | "name": "Dicki" 21 | }, { 22 | "name": "Armstrong" 23 | }, { 24 | "name": "Nitzsche" 25 | }] 26 | }] 27 | } 28 | 29 | let options = { 30 | margin: { 31 | top: 20, 32 | left: 50, 33 | right: 80, 34 | bottom: 20 35 | }, 36 | width: 200, 37 | height: 200, 38 | fill: "#2980B9", 39 | stroke: "#3E90F0", 40 | r: 2, 41 | animate: { 42 | type: 'oneByOne', 43 | duration: 200, 44 | fillTransition: 3 45 | }, 46 | label: { 47 | fontFamily: 'Arial', 48 | fontSize: 8, 49 | fontWeight: true, 50 | fill: '#34495E' 51 | } 52 | } 53 | 54 | return ( 55 | 56 | 57 | 58 | ) 59 | } 60 | ``` 61 | -------------------------------------------------------------------------------- /example/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } 4 | -------------------------------------------------------------------------------- /example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /example/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | 16 | ; Ignore polyfills 17 | .*/Libraries/polyfills/.* 18 | 19 | [include] 20 | 21 | [libs] 22 | node_modules/react-native/Libraries/react-native/react-native-interface.js 23 | node_modules/react-native/flow/ 24 | 25 | [options] 26 | emoji=true 27 | 28 | module.system=haste 29 | 30 | experimental.strict_type_args=true 31 | 32 | munge_underscores=true 33 | 34 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 35 | 36 | suppress_type=$FlowIssue 37 | suppress_type=$FlowFixMe 38 | suppress_type=$FlowFixMeProps 39 | suppress_type=$FlowFixMeState 40 | suppress_type=$FixMe 41 | 42 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 43 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 44 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 45 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 46 | 47 | unsafe.enable_getters_and_setters=true 48 | 49 | [version] 50 | ^0.56.0 51 | -------------------------------------------------------------------------------- /example/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /example/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] 15 | lib_deps.append(':' + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.example", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.example", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # TextLayoutBuilder uses a non-public Android constructor within StaticLayout. 54 | # See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. 55 | -dontwarn android.text.StaticLayout 56 | 57 | # okhttp 58 | 59 | -keepattributes Signature 60 | -keepattributes *Annotation* 61 | -keep class okhttp3.** { *; } 62 | -keep interface okhttp3.** { *; } 63 | -dontwarn okhttp3.** 64 | 65 | # okio 66 | 67 | -keep class sun.misc.Unsafe { *; } 68 | -dontwarn java.nio.file.* 69 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 70 | -dontwarn okio.** 71 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "example"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.horcrux.svg.SvgPackage; 7 | import com.facebook.react.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.shell.MainReactPackage; 10 | import com.facebook.soloader.SoLoader; 11 | 12 | import java.util.Arrays; 13 | import java.util.List; 14 | 15 | public class MainApplication extends Application implements ReactApplication { 16 | 17 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 18 | @Override 19 | public boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | return Arrays.asList( 26 | new MainReactPackage(), 27 | new SvgPackage() 28 | ); 29 | } 30 | }; 31 | 32 | @Override 33 | public ReactNativeHost getReactNativeHost() { 34 | return mReactNativeHost; 35 | } 36 | 37 | @Override 38 | public void onCreate() { 39 | super.onCreate(); 40 | SoLoader.init(this, /* native exopackage */ false); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capitalone/react-native-pathjs-charts/857d4478dbb5d6b1b9f008e252d7be96e21fc390/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capitalone/react-native-pathjs-charts/857d4478dbb5d6b1b9f008e252d7be96e21fc390/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capitalone/react-native-pathjs-charts/857d4478dbb5d6b1b9f008e252d7be96e21fc390/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capitalone/react-native-pathjs-charts/857d4478dbb5d6b1b9f008e252d7be96e21fc390/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | example 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.3' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/capitalone/react-native-pathjs-charts/857d4478dbb5d6b1b9f008e252d7be96e21fc390/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 6 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /example/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /example/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'example' 2 | include ':react-native-svg' 3 | project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android') 4 | 5 | include ':app' 6 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "displayName": "example" 4 | } -------------------------------------------------------------------------------- /example/index.android.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2016 Capital One Services, LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and limitations under the License. 14 | */ 15 | 16 | 'use strict'; 17 | 18 | import React, { AppRegistry } from 'react-native'; 19 | import App from './src/App'; 20 | 21 | AppRegistry.registerComponent('example', () => App); 22 | -------------------------------------------------------------------------------- /example/index.ios.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2016 Capital One Services, LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and limitations under the License. 14 | */ 15 | 16 | 'use strict'; 17 | 18 | import React, { AppRegistry } from 'react-native'; 19 | import App from './src/App'; 20 | 21 | AppRegistry.registerComponent('example', () => App); 22 | -------------------------------------------------------------------------------- /example/ios/example-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /example/ios/example-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /example/ios/example/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import 13 | #import 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"example" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /example/ios/example/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /example/ios/example/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UIViewControllerBasedStatusBarAppearance 40 | 41 | NSLocationWhenInUseUsageDescription 42 | 43 | NSAppTransportSecurity 44 | 45 | 46 | NSExceptionDomains 47 | 48 | localhost 49 | 50 | NSExceptionAllowsInsecureHTTPLoads 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /example/ios/example/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /example/ios/exampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/exampleTests/exampleTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import 14 | #import 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface exampleTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation exampleTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "sync-rnpc": "rm -rf ./node_modules/react-native-pathjs-charts; sane '/usr/bin/rsync -v -a --exclude .git --exclude example --exclude node_modules ../ ./node_modules/react-native-pathjs-charts/' .. --glob='{**/*.json,**/*.js}'" 8 | }, 9 | "dependencies": { 10 | "moment": "^2.17.1", 11 | "react": "16.0.0", 12 | "react-native": "0.50.3", 13 | "react-native-pathjs-charts": "file:../", 14 | "react-native-side-menu": "^1.0.0", 15 | "react-navigation": "^1.0.0-beta.9" 16 | }, 17 | "devDependencies": { 18 | "babel-polyfill": "^6.22.0", 19 | "sane": "^1.4.1" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /example/src/App.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2016 Capital One Services, LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and limitations under the License. 14 | 15 | SPDX-Copyright: Copyright (c) Capital One Services, LLC 16 | SPDX-License-Identifier: Apache-2.0 17 | */ 18 | 19 | 'use strict' 20 | 21 | import React, { Component } from 'react'; 22 | import { AppRegistry, Text, StyleSheet, View, Button } from 'react-native' 23 | import { StackNavigator} from 'react-navigation'; 24 | import SideMenu from 'react-native-side-menu' 25 | 26 | import BarChartColumnBasic from './bar/BarChartColumnBasic' 27 | 28 | import PieChartBasic from './pie/PieChartBasic' 29 | import PieChartBasicAnimation from './pie/PieChartBasicAnimation' 30 | 31 | import StockLineChartBasic from './stockline/StockLineChartBasic' 32 | import StockLineChartStaticTickLabels from './stockline/StockLineChartStaticTickLabels' 33 | import StockLineChartDynamicTickLabels from './stockline/StockLineChartDynamicTickLabels' 34 | import StockLineChartDynamicLineRendering from './stockline/StockLineChartDynamicLineRendering' 35 | import StockLineChartGesture from './stockline/StockLineChartGesture' 36 | 37 | import SmoothLineChartBasic from './smoothline/SmoothLineChartBasic' 38 | import SmoothLineChartRegions from './smoothline/SmoothLineChartRegions' 39 | import SmoothLineChartRegionsExtended from './smoothline/SmoothLineChartRegionsExtended' 40 | 41 | import ScatterplotChartBasic from './scatterplot/ScatterplotChartBasic' 42 | 43 | import RadarChartBasic from './radar/RadarChartBasic' 44 | 45 | import TreeChartBasic from './tree/TreeChartBasic' 46 | 47 | import Home from './Home' 48 | 49 | const styles = StyleSheet.create({ 50 | container: { 51 | flex: 1, 52 | justifyContent: 'center', 53 | alignItems: 'center', 54 | backgroundColor: '#f7f7f7', 55 | }, 56 | }); 57 | 58 | class HomeScreen extends React.Component { 59 | static navigationOptions = { 60 | title: 'RNPC Example App', 61 | }; 62 | render() { 63 | const { navigate } = this.props.navigation; 64 | return ( 65 | 66 |