Skip to content

Commit 676c041

Browse files
committed
Merge branch 'release/3.0.0'
2 parents 21a73a7 + b149015 commit 676c041

File tree

141 files changed

+20401
-15552
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+20401
-15552
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"presets": ["react-native"]
2+
"presets": ["module:metro-react-native-babel-preset"]
33
}

.flowconfig

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,55 @@
1616
; Ignore polyfills
1717
.*/Libraries/polyfills/.*
1818

19+
; Ignore metro
20+
.*/node_modules/metro/.*
21+
1922
[include]
2023

2124
[libs]
2225
node_modules/react-native/Libraries/react-native/react-native-interface.js
2326
node_modules/react-native/flow/
27+
node_modules/react-native/flow-github/
2428

2529
[options]
2630
emoji=true
2731

32+
esproposal.optional_chaining=enable
33+
esproposal.nullish_coalescing=enable
34+
2835
module.system=haste
36+
module.system.haste.use_name_reducers=true
37+
# get basename
38+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
39+
# strip .js or .js.flow suffix
40+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
41+
# strip .ios suffix
42+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
43+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
44+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
45+
module.system.haste.paths.blacklist=.*/__tests__/.*
46+
module.system.haste.paths.blacklist=.*/__mocks__/.*
47+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
48+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
2949

3050
munge_underscores=true
3151

3252
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'
3353

54+
module.file_ext=.js
55+
module.file_ext=.jsx
56+
module.file_ext=.json
57+
module.file_ext=.native.js
58+
3459
suppress_type=$FlowIssue
3560
suppress_type=$FlowFixMe
3661
suppress_type=$FlowFixMeProps
3762
suppress_type=$FlowFixMeState
38-
suppress_type=$FixMe
3963

40-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-7]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
41-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-7]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
64+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
65+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
4266
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
4367
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
4468

45-
unsafe.enable_getters_and_setters=true
46-
4769
[version]
48-
^0.57.0
70+
^0.78.0

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
# Xcode
66
#
7+
ios/
78
build/
89
*.pbxuser
910
!default.pbxuser
@@ -24,6 +25,7 @@ project.xcworkspace
2425

2526
# Android/IntelliJ
2627
#
28+
android/
2729
build/
2830
.idea
2931
.gradle
@@ -40,7 +42,6 @@ yarn-error.log
4042
buck-out/
4143
\.buckd/
4244
*.keystore
43-
!ReactNativeFusionCharts.keystore
4445

4546
# fastlane
4647
#
@@ -53,4 +54,5 @@ buck-out/
5354
*/fastlane/Preview.html
5455
*/fastlane/screenshots
5556

56-
coverage/
57+
# Bundle artifact
58+
*.jsbundle

.npmignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
android/
33
ios/
44
assets/
5-
templates/
5+
templates/
6+
docs-src/
7+
docs

README.md

Lines changed: 163 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,40 @@
1-
#### [Demos and Documentation](https://fusioncharts.github.io/react-native-fusioncharts/)
1+
A `React Native` component which provides bindings for `FusionCharts` JavaScript Charting Library. It easily adds rich and interactive charts to any `React Native` Projects.
22

3-
# react-native-fusioncharts
3+
## [Demo](https://fusioncharts.github.io/react-native-fusioncharts)
4+
5+
- Github Repo: [https://github.com/fusioncharts/react-native-fusioncharts](https://github.com/fusioncharts/react-native-fusioncharts)
6+
- Documentation: [https://www.fusioncharts.com/dev/getting-started/react-native/your-first-chart-using-react-native](https://www.fusioncharts.com/dev/getting-started/react-native/your-first-chart-using-react-native)
7+
- Support: [https://www.fusioncharts.com/contact-support](https://www.fusioncharts.com/contact-support)
8+
- FusionCharts
9+
- Official Website: [https://www.fusioncharts.com/](https://www.fusioncharts.com/)
10+
- Official NPM Package: [https://www.npmjs.com/package/fusioncharts](https://www.npmjs.com/package/fusioncharts)
11+
- Issues: [https://github.com/fusioncharts/react-native-fusioncharts/issues](https://github.com/fusioncharts/react-native-fusioncharts/issues)
12+
13+
---
14+
15+
## Table of Contents
16+
17+
- [Getting Started](#getting-started)
18+
- [Requirements](#requirements)
19+
- [Installation](#installation)
20+
- [Setup for Android](#setup-for-android)
21+
- [Setup for iOS](#setup-for-ios)
22+
- [Working with chart API](#working-with-apis)
23+
- [Working with events](#working-with-events)
24+
- [Quick Start](#quick-start)
25+
- [Going Beyond Charts](#going-beyond-charts)
26+
- [Usage and Integration of FusionTime](#usage-and-integration-of-fusionTime)
27+
- [For Contributors](#for-contributors)
28+
- [Licensing](#licensing)
429

5-
A `React Native` component which provides bindings for `FusionCharts` JavaScript Charting Library. It easily adds rich and interactive charts to any `React Native` Projects.
30+
## Getting Started
631

7-
## Installation
32+
### Requirements
33+
34+
- **Node.js**, **NPM/Yarn** installed globally in your OS.
35+
- A **react-native** application with **FusionCharts** installed in it
36+
37+
### Installation
838

939
To install `react-native-fusioncharts`, run:
1040

@@ -14,18 +44,16 @@ $ npm install --save react-native-fusioncharts
1444

1545
After installing `react-native-fusioncharts`, follow the steps below:
1646

17-
### For Android
47+
### Setup for Android
1848

1949
- Create `assets` folder in `android/app/src/main` directory if it doesn't exist.
2050
- Copy `FusionCharts` library in the `assets` folder (in most cases copy `node_modules/fusioncharts` folder).
2151
- Create a file named `fusioncharts.html` in this `assets` folder with the required `FusionCharts` module files. Find the sample html file [here](https://github.com/fusioncharts/react-native-fusioncharts/blob/master/templates/fuioncharts-tpl-android.html).
2252
- Set `libraryPath` property to the `FusionCharts` component as follows:
2353

2454
```html
25-
<FusionCharts
26-
......
27-
libraryPath={{ uri: 'file:///android_asset/fusioncharts.html' }}
28-
/>
55+
<FusionCharts ...... libraryPath={{ uri:
56+
'file:///android_asset/fusioncharts.html' }} />
2957
```
3058

3159
- Add the following script in Application's `package.json` file as follows to bundle your assets when you want to genarate a signed APK:
@@ -51,7 +79,7 @@ $ npm run prod:android
5179

5280
Click [here](https://facebook.github.io/react-native/docs/signed-apk-android) to find more information
5381

54-
### For iOS
82+
### Setup for iOS
5583

5684
- Create `assets` folder in your project root if it doesn't exist.
5785
- Copy `FusionCharts` library in this `assets` folder (requires only when the licensed version of `FusionCharts` is used).
@@ -92,7 +120,7 @@ The `--fc-library ./assets/fusioncharts` option is only required when you copied
92120
$ npm run build:assets
93121
```
94122

95-
## Getting Started
123+
## Quick Start
96124

97125
Include the `react-native-fusioncharts` library as follows:
98126

@@ -176,7 +204,7 @@ const styles = StyleSheet.create({
176204
AppRegistry.registerComponent('ReactNativeFusionCharts', () => App);
177205
```
178206

179-
## Listening to Events
207+
## Working with Events
180208

181209
In this sample we are attaching dataplotclick event in the chart.
182210

@@ -268,7 +296,7 @@ const styles = StyleSheet.create({
268296
});
269297
```
270298

271-
## Calling chart APIs
299+
## Working with APIs
272300

273301
In this sample we can change the chart type dynamically using chart APIs.
274302

@@ -428,13 +456,128 @@ const styles = StyleSheet.create({
428456
});
429457
```
430458

431-
## Unit Test
459+
## Usage and integration of FusionTime
432460

433-
```sh
434-
$ npm test
461+
From `fusioncharts@3.13.3-sr.1` and `react-native-fusioncharts@3.0.0`, You can visualize timeseries data easily on react.
462+
463+
Learn more about FusionTime [here](https://www.fusioncharts.com/fusiontime).
464+
465+
### Consider the example below for integration of FusionTime
466+
467+
```js
468+
// In App.js
469+
import React, { Component } from 'react';
470+
import { AppRegistry, StyleSheet, Text, View, Platform } from 'react-native';
471+
import FusionCharts from 'react-native-fusioncharts';
472+
473+
export default class App extends Component {
474+
constructor(props) {
475+
super(props);
476+
477+
this.state = {
478+
type: 'timeseries',
479+
width: '100%',
480+
height: '100%',
481+
dataFormat: 'json',
482+
dataSource: {
483+
data: null,
484+
caption: {
485+
text: 'Sales Analysis'
486+
},
487+
subcaption: {
488+
text: 'Grocery'
489+
},
490+
yAxis: [
491+
{
492+
plot: {
493+
value: 'Grocery Sales Value',
494+
type: 'line'
495+
},
496+
format: {
497+
prefix: '$'
498+
},
499+
title: 'Sale Value'
500+
}
501+
]
502+
},
503+
schemaJson: null,
504+
dataJson: null
505+
};
506+
507+
this.libraryPath = Platform.select({
508+
// Specify fusioncharts.html file location
509+
ios: require('./assets/fusioncharts.html'),
510+
android: { uri: 'file:///android_asset/fusioncharts.html' }
511+
});
512+
}
513+
514+
componentDidMount() {
515+
this.fetchDataAndSchema();
516+
}
517+
518+
fetchDataAndSchema() {
519+
const jsonify = res => res.json();
520+
const dFetch = fetch(
521+
'https://s3.eu-central-1.amazonaws.com/fusion.store/ft/data/line-chart-with-time-axis-data.json'
522+
).then(jsonify);
523+
// This is the remote url to fetch the schema.
524+
const sFetch = fetch(
525+
'https://s3.eu-central-1.amazonaws.com/fusion.store/ft/schema/line-chart-with-time-axis-schema.json'
526+
).then(jsonify);
527+
Promise.all([dFetch, sFetch]).then(res => {
528+
const data = res[0];
529+
const schema = res[1];
530+
console.log(data);
531+
console.log(schema);
532+
this.setState({ dataJson: data, schemaJson: schema });
533+
});
534+
}
535+
536+
render() {
537+
return (
538+
<View style={styles.container}>
539+
<Text style={styles.heading}>
540+
FusionCharts Integration with React Native
541+
</Text>
542+
<View style={styles.chartContainer}>
543+
<FusionCharts
544+
dataJson={this.state.dataJson}
545+
schemaJson={this.state.schemaJson}
546+
type={this.state.type}
547+
width={this.state.width}
548+
height={this.state.height}
549+
dataFormat={this.state.dataFormat}
550+
dataSource={this.state.dataSource}
551+
libraryPath={this.libraryPath} // set the libraryPath property
552+
/>
553+
</View>
554+
</View>
555+
);
556+
}
557+
}
558+
559+
const styles = StyleSheet.create({
560+
container: {
561+
flex: 1,
562+
padding: 10
563+
},
564+
heading: {
565+
fontSize: 20,
566+
textAlign: 'center',
567+
marginBottom: 10
568+
},
569+
chartContainer: {
570+
height: 500
571+
}
572+
});
435573
```
436574

437-
## Contributing
575+
## Going Beyond Charts
576+
577+
- Explore 20+ pre-built business specific dashboards for different industries like energy and manufacturing to business functions like sales, marketing and operations [here](https://www.fusioncharts.com/explore/dashboards).
578+
- See [Data Stories](https://www.fusioncharts.com/explore/data-stories) built using FusionCharts’ interactive JavaScript visualizations and learn how to communicate real-world narratives through underlying data to tell compelling stories.
579+
580+
## For Contributors
438581

439582
- Clone the repository.
440583
- Install dependencies
@@ -475,4 +618,6 @@ To generate release iOS app, run:
475618
$ npm run build:ios
476619
```
477620

478-
### [Demos and Documentation](https://fusioncharts.github.io/react-native-fusioncharts/)
621+
## Licensing
622+
623+
The FusionCharts React Native component is open-source and distributed under the terms of the MIT/X11 License. However, you will need to download and include FusionCharts library in your page separately, which has a [separate license](https://www.fusioncharts.com/buy).

0 commit comments

Comments
 (0)