├── .babelrc
├── .builderrc
├── .editorconfig
├── .eslintignore
├── .eslintrc
├── .gitignore
├── .npmignore.publishr
├── .travis.yml
├── LICENSE.txt
├── README.md
├── config
└── webpack.config.standalone.js
├── demo-native
├── .babelrc
├── .buckconfig
├── .flowconfig
├── .gitignore
├── .watchmanconfig
├── README.md
├── android
│ ├── app
│ │ ├── BUCK
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── victorycomposeddemo
│ │ │ │ ├── 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
├── index.android.js
├── index.ios.js
├── ios
│ ├── VictoryComposedDemo.xcodeproj
│ │ ├── project.pbxproj
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── VictoryComposedDemo.xcscheme
│ ├── VictoryComposedDemo
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Base.lproj
│ │ │ └── LaunchScreen.xib
│ │ ├── Images.xcassets
│ │ │ └── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ ├── Info.plist
│ │ └── main.m
│ └── VictoryComposedDemoTests
│ │ ├── Info.plist
│ │ └── VictoryComposedDemoTests.m
├── package.json
└── src
│ ├── main.js
│ └── picker.js
├── demo
├── app.js
├── components
│ └── victory-composed-demo.js
└── index.html
├── docs
├── api.md
├── index.md
├── standalone.md
└── themes.md
├── package.json
├── src
├── components
│ └── formidable-charts
│ │ ├── area-chart.js
│ │ ├── bar-chart.js
│ │ ├── line-chart.js
│ │ ├── pie-chart.js
│ │ ├── scatter-chart.js
│ │ └── standalone.js
├── index.js
├── standalone.js
├── themes
│ ├── bright
│ │ ├── composed-area.js
│ │ ├── composed-axis.js
│ │ ├── composed-bar.js
│ │ ├── composed-chart.js
│ │ ├── composed-line.js
│ │ ├── composed-pie.js
│ │ ├── composed-scatter.js
│ │ ├── index.js
│ │ └── theme.js
│ ├── danceparty
│ │ ├── composed-area.js
│ │ ├── composed-axis.js
│ │ ├── composed-bar.js
│ │ ├── composed-chart.js
│ │ ├── composed-line.js
│ │ ├── composed-pie.js
│ │ ├── composed-scatter.js
│ │ ├── index.js
│ │ └── theme.js
│ ├── dark
│ │ ├── composed-area.js
│ │ ├── composed-axis.js
│ │ ├── composed-bar.js
│ │ ├── composed-chart.js
│ │ ├── composed-line.js
│ │ ├── composed-pie.js
│ │ ├── composed-scatter.js
│ │ ├── index.js
│ │ └── theme.js
│ ├── index.js
│ └── simple
│ │ ├── composed-area.js
│ │ ├── composed-axis.js
│ │ ├── composed-bar.js
│ │ ├── composed-chart.js
│ │ ├── composed-line.js
│ │ ├── composed-pie.js
│ │ ├── composed-scatter.js
│ │ ├── index.js
│ │ └── theme.js
└── victory
│ ├── victory-chart.android.js
│ ├── victory-chart.ios.js
│ ├── victory-chart.js
│ ├── victory-core.android.js
│ ├── victory-core.ios.js
│ ├── victory-core.js
│ ├── victory-pie.android.js
│ ├── victory-pie.ios.js
│ └── victory-pie.js
└── test
├── .eslintrc
└── client
├── main.js
├── spec
└── components
│ └── victory-composed
│ └── victory-standalone.spec.js
└── test.html
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "builder-victory-component/config/babel/.babelrc"
3 | }
--------------------------------------------------------------------------------
/.builderrc:
--------------------------------------------------------------------------------
1 | ---
2 | archetypes:
3 | - builder-victory-component
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # 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 | max_line_length = 100
12 |
13 | [*.md]
14 | trim_trailing_whitespace = false
15 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | docs/build/
2 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | ---
2 | extends: ./node_modules/builder-victory-component/config/eslint/.eslintrc-source
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ### SublimeText ###
2 | *.sublime-workspace
3 |
4 | ### OSX ###
5 | .AppleDouble
6 | .DS_Store
7 | .LSOverride
8 | Icon
9 |
10 | # Thumbnails
11 | ._*
12 |
13 | # Files that might appear on external disk
14 | .Spotlight-V100
15 | .Trashes
16 |
17 | ### Windows ###
18 | # Windows image file caches
19 | ehthumbs.db
20 | Thumbs.db
21 |
22 | # Folder config file
23 | Desktop.ini
24 |
25 | # Recycle Bin used on file shares
26 | $RECYCLE.BIN/
27 |
28 | # App specific
29 | .tmp
30 | bower_components
31 | coverage
32 | docs/build
33 | dist
34 | lib
35 | node_modules
36 | npm-debug.log*
--------------------------------------------------------------------------------
/.npmignore.publishr:
--------------------------------------------------------------------------------
1 | /*
2 | !/dist
3 | dist/*.map
4 | !/lib
5 | !/docs
6 | !/src
7 | !LICENSE.txt
8 | !CHANGELOG.md
9 | !README.md
10 | !package.json
11 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 |
3 | node_js:
4 | # - "0.12" TODO: fails with babel-presets-react-native
5 | # https://github.com/FormidableLabs/victory/issues/291
6 | - "4.2"
7 | - "5.0"
8 |
9 | sudo: true
10 |
11 | branches:
12 | only:
13 | - master
14 |
15 | before_install:
16 | # GUI for real browsers.
17 | - export DISPLAY=:99.0
18 | - sh -e /etc/init.d/xvfb start
19 |
20 | # Install npmv3 because of postinstall bugs in npmv2:
21 | # See https://github.com/FormidableLabs/victory/issues/98
22 | - npm install -g npm@3
23 |
24 | script:
25 | - npm --version
26 | - node_modules/.bin/builder run check-ci
27 |
28 | # Prune deps to just production and ensure we can still build
29 | - npm prune --production
30 | - node_modules/.bin/builder run build
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Formidable Labs
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
formidable-charts
2 |
3 |
4 | Ready-made composed Victory Components!
5 |
6 |
7 | ***
8 |
9 | 
10 |
11 | - [Getting Started](docs/index.md)
12 | - [API Documentation](docs/api.md)
13 | - [Themes](docs/themes.md)
14 | - [Standalone](docs/standalone.md)
15 | - [Development](#development)
16 | - [Contributing](#contributing)
17 | - [_IMPORTANT_](#important)
18 |
19 | ## Getting Started
20 |
21 | `formidable-charts` is a set of composed, pre-styled Victory components that can be used to display rich, interactive charts. Our theming system not only supports style based theming, but behavioral/compositional theming as well.
22 |
23 | 1. Add `formidable-charts` to your project
24 |
25 | ```sh
26 | npm install formidable-charts --save
27 | ```
28 |
29 | For React Native, you'll need `-native` and `react-native-svg`:
30 |
31 | ```sh
32 | npm install -native formidable-charts react-native-svg --save
33 | react-native link react-native-svg
34 | ```
35 |
36 | 2. Add your first `formidable-charts` component:
37 |
38 | ```js
39 | import React, { Component } from 'react';
40 | import { render } from 'react-dom';
41 | import { LineChart } from 'formidable-charts';
42 |
43 | class MyLineChart extends Component {
44 | render() {
45 | return (
46 |
47 | );
48 | }
49 | }
50 |
51 | render(, document.getElementById('app'));
52 | ```
53 | 3. Explore the API and try out the various possible components and configurations and their themes!
54 |
55 | ## Development
56 |
57 | ```sh
58 | # Run the demo app server
59 | $ npm start
60 |
61 | # Open the demo app
62 | $ open http://localhost:3000
63 |
64 | # Run tests
65 | $ npm test
66 | ```
67 |
68 | For more on the development environment, see [DEVELOPMENT](https://github.com/FormidableLabs/builder-victory-component/blob/master/dev/DEVELOPMENT.md) in the project builder archetype.
69 |
70 | ## Contributing
71 |
72 | Please review our [Code of Conduct](https://github.com/FormidableLabs/builder-victory-component/blob/master/CONTRIBUTING.md#contributor-covenant-code-of-conduct) before contributing.
73 |
74 | For a detailed contribution guide, please see [CONTRIBUTING](https://github.com/FormidableLabs/builder-victory-component/blob/master/dev/CONTRIBUTING.md) in the project builder archetype.
75 |
76 | ## _IMPORTANT_
77 |
78 | This project is in a pre-release state. We're hard at work fixing bugs and improving the API. Be prepared for breaking changes!
79 |
--------------------------------------------------------------------------------
/config/webpack.config.standalone.js:
--------------------------------------------------------------------------------
1 |
2 | "use strict";
3 |
4 | var path = require('path');
5 | var webpack = require('webpack');
6 | var LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
7 |
8 | var paths = {
9 | source: path.resolve('src'),
10 | output: path.resolve('dist'),
11 | pkg: path.resolve('package.json')
12 | }
13 |
14 | module.exports = {
15 | cache: true,
16 | context: paths.source,
17 | entry: "./standalone.js",
18 |
19 | output: {
20 | path: paths.output,
21 | filename: "formidable-charts-standalone.js",
22 | library: "FormidableCharts",
23 | libraryTarget: "umd"
24 | },
25 |
26 | resolve: {
27 | modulesDirectories: ['src', 'node_modules'],
28 | extensions: ["", ".js", ".jsx"]
29 | },
30 |
31 | plugins: [
32 | new webpack.DefinePlugin({
33 | "process.env": {
34 | NODE_ENV: JSON.stringify("production")
35 | }
36 | }),
37 | new webpack.optimize.UglifyJsPlugin(),
38 | new LodashModuleReplacementPlugin({
39 | "currying": true,
40 | "flattening": true,
41 | "paths": true,
42 | "placeholders": true,
43 | "shorthands": true
44 | }),
45 | new webpack.SourceMapDevToolPlugin("[file].map"),
46 | new webpack.optimize.DedupePlugin(),
47 | new webpack.optimize.OccurrenceOrderPlugin(),
48 | ],
49 |
50 | module: {
51 | loaders: [
52 | {
53 | test: /\.js?$/,
54 | exclude: /node_modules/,
55 | loader: 'babel-loader'
56 | }
57 | ]
58 | }
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/demo-native/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["react-native"]
3 | }
--------------------------------------------------------------------------------
/demo-native/.buckconfig:
--------------------------------------------------------------------------------
1 |
2 | [android]
3 | target = Google Inc.:Google APIs:23
4 |
5 | [maven_repositories]
6 | central = https://repo1.maven.org/maven2
7 |
--------------------------------------------------------------------------------
/demo-native/.flowconfig:
--------------------------------------------------------------------------------
1 | [ignore]
2 |
3 | # We fork some components by platform.
4 | .*/*[.]android.js
5 |
6 | # Ignore templates with `@flow` in header
7 | .*/local-cli/generator.*
8 |
9 | # Ignore malformed json
10 | .*/node_modules/y18n/test/.*\.json
11 |
12 | # Ignore the website subdir
13 | /website/.*
14 |
15 | # Ignore BUCK generated dirs
16 | /\.buckd/
17 |
18 | # Ignore unexpected extra @providesModule
19 | .*/node_modules/commoner/test/source/widget/share.js
20 |
21 | # Ignore duplicate module providers
22 | # For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root
23 | .*/Libraries/react-native/React.js
24 | .*/Libraries/react-native/ReactNative.js
25 | .*/node_modules/jest-runtime/build/__tests__/.*
26 |
27 | [include]
28 |
29 | [libs]
30 | node_modules/react-native/Libraries/react-native/react-native-interface.js
31 | node_modules/react-native/flow
32 | flow/
33 |
34 | [options]
35 | module.system=haste
36 |
37 | esproposal.class_static_fields=enable
38 | esproposal.class_instance_fields=enable
39 |
40 | experimental.strict_type_args=true
41 |
42 | munge_underscores=true
43 |
44 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
45 | 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'
46 |
47 | suppress_type=$FlowIssue
48 | suppress_type=$FlowFixMe
49 | suppress_type=$FixMe
50 |
51 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-2]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
52 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-2]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
53 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
54 |
55 | unsafe.enable_getters_and_setters=true
56 |
57 | [version]
58 | ^0.32.0
59 |
--------------------------------------------------------------------------------
/demo-native/.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/IJ
26 | #
27 | *.iml
28 | .idea
29 | .gradle
30 | local.properties
31 |
32 | # node.js
33 | #
34 | node_modules/
35 | npm-debug.log
36 |
37 | # BUCK
38 | buck-out/
39 | \.buckd/
40 | android/app/libs
41 | android/keystores/debug.keystore
42 |
--------------------------------------------------------------------------------
/demo-native/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/demo-native/README.md:
--------------------------------------------------------------------------------
1 | ## `victory-composed` React Native Demo App
2 |
3 | ```sh
4 | cd demo-native
5 | npm install
6 | react-native run-ios
7 | react-native run-android
8 | ```
9 |
--------------------------------------------------------------------------------
/demo-native/android/app/BUCK:
--------------------------------------------------------------------------------
1 | import re
2 |
3 | # To learn about Buck see [Docs](https://buckbuild.com/).
4 | # To run your application with Buck:
5 | # - install Buck
6 | # - `npm start` - to start the packager
7 | # - `cd android`
8 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
9 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
10 | # - `buck install -r android/app` - compile, install and run application
11 | #
12 |
13 | lib_deps = []
14 | for jarfile in glob(['libs/*.jar']):
15 | name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile)
16 | lib_deps.append(':' + name)
17 | prebuilt_jar(
18 | name = name,
19 | binary_jar = jarfile,
20 | )
21 |
22 | for aarfile in glob(['libs/*.aar']):
23 | name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile)
24 | lib_deps.append(':' + name)
25 | android_prebuilt_aar(
26 | name = name,
27 | aar = aarfile,
28 | )
29 |
30 | android_library(
31 | name = 'all-libs',
32 | exported_deps = lib_deps
33 | )
34 |
35 | android_library(
36 | name = 'app-code',
37 | srcs = glob([
38 | 'src/main/java/**/*.java',
39 | ]),
40 | deps = [
41 | ':all-libs',
42 | ':build_config',
43 | ':res',
44 | ],
45 | )
46 |
47 | android_build_config(
48 | name = 'build_config',
49 | package = 'com.victorycomposeddemo',
50 | )
51 |
52 | android_resource(
53 | name = 'res',
54 | res = 'src/main/res',
55 | package = 'com.victorycomposeddemo',
56 | )
57 |
58 | android_binary(
59 | name = 'app',
60 | package_type = 'debug',
61 | manifest = 'src/main/AndroidManifest.xml',
62 | keystore = '//android/keystores:debug',
63 | deps = [
64 | ':app-code',
65 | ],
66 | )
67 |
--------------------------------------------------------------------------------
/demo-native/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 | * and bundleReleaseJsAndAssets).
8 | * These basically call `react-native bundle` with the correct arguments during the Android build
9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 | * bundle directly from the development server. Below you can see all the possible configurations
11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 | *
14 | * project.ext.react = [
15 | * // the name of the generated asset file containing your JS bundle
16 | * bundleAssetName: "index.android.bundle",
17 | *
18 | * // the entry file for bundle generation
19 | * entryFile: "index.android.js",
20 | *
21 | * // whether to bundle JS and assets in debug mode
22 | * bundleInDebug: false,
23 | *
24 | * // whether to bundle JS and assets in release mode
25 | * bundleInRelease: true,
26 | *
27 | * // whether to bundle JS and assets in another build variant (if configured).
28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
29 | * // The configuration property can be in the following formats
30 | * // 'bundleIn${productFlavor}${buildType}'
31 | * // 'bundleIn${buildType}'
32 | * // bundleInFreeDebug: true,
33 | * // bundleInPaidRelease: true,
34 | * // bundleInBeta: true,
35 | *
36 | * // the root of your project, i.e. where "package.json" lives
37 | * root: "../../",
38 | *
39 | * // where to put the JS bundle asset in debug mode
40 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
41 | *
42 | * // where to put the JS bundle asset in release mode
43 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
44 | *
45 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
46 | * // require('./image.png')), in debug mode
47 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
48 | *
49 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
50 | * // require('./image.png')), in release mode
51 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
52 | *
53 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
54 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
55 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
56 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
57 | * // for example, you might want to remove it from here.
58 | * inputExcludes: ["android/**", "ios/**"],
59 | *
60 | * // override which node gets called and with what additional arguments
61 | * nodeExecutableAndArgs: ["node"]
62 | *
63 | * // supply additional arguments to the packager
64 | * extraPackagerArgs: []
65 | * ]
66 | */
67 |
68 | apply from: "../../node_modules/react-native/react.gradle"
69 |
70 | /**
71 | * Set this to true to create two separate APKs instead of one:
72 | * - An APK that only works on ARM devices
73 | * - An APK that only works on x86 devices
74 | * The advantage is the size of the APK is reduced by about 4MB.
75 | * Upload all the APKs to the Play Store and people will download
76 | * the correct one based on the CPU architecture of their device.
77 | */
78 | def enableSeparateBuildPerCPUArchitecture = false
79 |
80 | /**
81 | * Run Proguard to shrink the Java bytecode in release builds.
82 | */
83 | def enableProguardInReleaseBuilds = false
84 |
85 | android {
86 | compileSdkVersion 23
87 | buildToolsVersion "23.0.1"
88 |
89 | defaultConfig {
90 | applicationId "com.victorycomposeddemo"
91 | minSdkVersion 16
92 | targetSdkVersion 22
93 | versionCode 1
94 | versionName "1.0"
95 | ndk {
96 | abiFilters "armeabi-v7a", "x86"
97 | }
98 | }
99 | splits {
100 | abi {
101 | reset()
102 | enable enableSeparateBuildPerCPUArchitecture
103 | universalApk false // If true, also generate a universal APK
104 | include "armeabi-v7a", "x86"
105 | }
106 | }
107 | buildTypes {
108 | release {
109 | minifyEnabled enableProguardInReleaseBuilds
110 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
111 | }
112 | }
113 | // applicationVariants are e.g. debug, release
114 | applicationVariants.all { variant ->
115 | variant.outputs.each { output ->
116 | // For each separate APK per architecture, set a unique version code as described here:
117 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
118 | def versionCodes = ["armeabi-v7a":1, "x86":2]
119 | def abi = output.getFilter(OutputFile.ABI)
120 | if (abi != null) { // null for the universal-debug, universal-release variants
121 | output.versionCodeOverride =
122 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
123 | }
124 | }
125 | }
126 | }
127 |
128 | dependencies {
129 | compile project(':react-native-svg')
130 | compile fileTree(dir: "libs", include: ["*.jar"])
131 | compile "com.android.support:appcompat-v7:23.0.1"
132 | compile "com.facebook.react:react-native:+" // From node_modules
133 | }
134 |
135 | // Run this once to be able to run the application with BUCK
136 | // puts all compile dependencies into folder libs for BUCK to use
137 | task copyDownloadableDepsToLibs(type: Copy) {
138 | from configurations.compile
139 | into 'libs'
140 | }
141 |
--------------------------------------------------------------------------------
/demo-native/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 | # okhttp
54 |
55 | -keepattributes Signature
56 | -keepattributes *Annotation*
57 | -keep class okhttp3.** { *; }
58 | -keep interface okhttp3.** { *; }
59 | -dontwarn okhttp3.**
60 |
61 | # okio
62 |
63 | -keep class sun.misc.Unsafe { *; }
64 | -dontwarn java.nio.file.*
65 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
66 | -dontwarn okio.**
67 |
--------------------------------------------------------------------------------
/demo-native/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/demo-native/android/app/src/main/java/com/victorycomposeddemo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.victorycomposeddemo;
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 "VictoryComposedDemo";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/demo-native/android/app/src/main/java/com/victorycomposeddemo/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.victorycomposeddemo;
2 |
3 | import android.app.Application;
4 | import android.util.Log;
5 |
6 | import com.facebook.react.ReactApplication;
7 | import com.horcrux.svg.RNSvgPackage;
8 | import com.facebook.react.ReactInstanceManager;
9 | import com.facebook.react.ReactNativeHost;
10 | import com.facebook.react.ReactPackage;
11 | import com.facebook.react.shell.MainReactPackage;
12 |
13 | import java.util.Arrays;
14 | import java.util.List;
15 |
16 | public class MainApplication extends Application implements ReactApplication {
17 |
18 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
19 | @Override
20 | protected boolean getUseDeveloperSupport() {
21 | return BuildConfig.DEBUG;
22 | }
23 |
24 | @Override
25 | protected List getPackages() {
26 | return Arrays.asList(
27 | new MainReactPackage(),
28 | new RNSvgPackage()
29 | );
30 | }
31 | };
32 |
33 | @Override
34 | public ReactNativeHost getReactNativeHost() {
35 | return mReactNativeHost;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/demo-native/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FormidableLabs/formidable-charts/8e307cf633f93b7dae9a509d7d619b52bc293315/demo-native/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo-native/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FormidableLabs/formidable-charts/8e307cf633f93b7dae9a509d7d619b52bc293315/demo-native/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo-native/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FormidableLabs/formidable-charts/8e307cf633f93b7dae9a509d7d619b52bc293315/demo-native/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo-native/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FormidableLabs/formidable-charts/8e307cf633f93b7dae9a509d7d619b52bc293315/demo-native/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo-native/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | VictoryComposedDemo
3 |
4 |
--------------------------------------------------------------------------------
/demo-native/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/demo-native/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:1.3.1'
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 |
--------------------------------------------------------------------------------
/demo-native/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 |
--------------------------------------------------------------------------------
/demo-native/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FormidableLabs/formidable-charts/8e307cf633f93b7dae9a509d7d619b52bc293315/demo-native/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/demo-native/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.4-all.zip
6 |
--------------------------------------------------------------------------------
/demo-native/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 |
--------------------------------------------------------------------------------
/demo-native/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 |
--------------------------------------------------------------------------------
/demo-native/android/keystores/BUCK:
--------------------------------------------------------------------------------
1 | keystore(
2 | name = 'debug',
3 | store = 'debug.keystore',
4 | properties = 'debug.keystore.properties',
5 | visibility = [
6 | 'PUBLIC',
7 | ],
8 | )
9 |
--------------------------------------------------------------------------------
/demo-native/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 |
--------------------------------------------------------------------------------
/demo-native/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'VictoryComposedDemo'
2 |
3 | include ':app'
4 | include ':react-native-svg'
5 | project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
6 |
--------------------------------------------------------------------------------
/demo-native/index.android.js:
--------------------------------------------------------------------------------
1 | //@flow
2 |
3 | import { AppRegistry } from 'react-native';
4 | import VictoryComposedDemo from './src/main';
5 |
6 | AppRegistry.registerComponent('VictoryComposedDemo', () => VictoryComposedDemo);
7 |
--------------------------------------------------------------------------------
/demo-native/index.ios.js:
--------------------------------------------------------------------------------
1 | //@flow
2 |
3 | import { AppRegistry } from 'react-native';
4 | import VictoryComposedDemo from './src/main';
5 |
6 | AppRegistry.registerComponent('VictoryComposedDemo', () => VictoryComposedDemo);
7 |
--------------------------------------------------------------------------------
/demo-native/ios/VictoryComposedDemo.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 | /* Begin PBXBuildFile section */
9 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
10 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
11 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };
12 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };
13 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };
14 | 00E356F31AD99517003FC87E /* VictoryComposedDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* VictoryComposedDemoTests.m */; };
15 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; };
16 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; };
17 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; };
18 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
19 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
20 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
21 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
22 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
23 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
24 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
25 | 82199C1A6D4A4C698AEB6655 /* libRNSVG.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DE0BA9F5DD0546FDAAAD7B07 /* libRNSVG.a */; };
26 | /* End PBXBuildFile section */
27 |
28 | /* Begin PBXContainerItemProxy section */
29 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = {
30 | isa = PBXContainerItemProxy;
31 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
32 | proxyType = 2;
33 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
34 | remoteInfo = RCTActionSheet;
35 | };
36 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = {
37 | isa = PBXContainerItemProxy;
38 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
39 | proxyType = 2;
40 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
41 | remoteInfo = RCTGeolocation;
42 | };
43 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = {
44 | isa = PBXContainerItemProxy;
45 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
46 | proxyType = 2;
47 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676;
48 | remoteInfo = RCTImage;
49 | };
50 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = {
51 | isa = PBXContainerItemProxy;
52 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
53 | proxyType = 2;
54 | remoteGlobalIDString = 58B511DB1A9E6C8500147676;
55 | remoteInfo = RCTNetwork;
56 | };
57 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = {
58 | isa = PBXContainerItemProxy;
59 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
60 | proxyType = 2;
61 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7;
62 | remoteInfo = RCTVibration;
63 | };
64 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
65 | isa = PBXContainerItemProxy;
66 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
67 | proxyType = 1;
68 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
69 | remoteInfo = VictoryComposedDemo;
70 | };
71 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = {
72 | isa = PBXContainerItemProxy;
73 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
74 | proxyType = 2;
75 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
76 | remoteInfo = RCTSettings;
77 | };
78 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = {
79 | isa = PBXContainerItemProxy;
80 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
81 | proxyType = 2;
82 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A;
83 | remoteInfo = RCTWebSocket;
84 | };
85 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = {
86 | isa = PBXContainerItemProxy;
87 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
88 | proxyType = 2;
89 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
90 | remoteInfo = React;
91 | };
92 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = {
93 | isa = PBXContainerItemProxy;
94 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
95 | proxyType = 2;
96 | remoteGlobalIDString = 134814201AA4EA6300B7C361;
97 | remoteInfo = RCTLinking;
98 | };
99 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = {
100 | isa = PBXContainerItemProxy;
101 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
102 | proxyType = 2;
103 | remoteGlobalIDString = 58B5119B1A9E6C1200147676;
104 | remoteInfo = RCTText;
105 | };
106 | /* End PBXContainerItemProxy section */
107 |
108 | /* Begin PBXFileReference section */
109 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.jsbundle; path = main.jsbundle; sourceTree = ""; };
110 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = ../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj; sourceTree = ""; };
111 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = ../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj; sourceTree = ""; };
112 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = ../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj; sourceTree = ""; };
113 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = ../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj; sourceTree = ""; };
114 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = ../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj; sourceTree = ""; };
115 | 00E356EE1AD99517003FC87E /* VictoryComposedDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = VictoryComposedDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
116 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
117 | 00E356F21AD99517003FC87E /* VictoryComposedDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VictoryComposedDemoTests.m; sourceTree = ""; };
118 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = ../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj; sourceTree = ""; };
119 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = ../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj; sourceTree = ""; };
120 | 13B07F961A680F5B00A75B9A /* VictoryComposedDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = VictoryComposedDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
121 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = VictoryComposedDemo/AppDelegate.h; sourceTree = ""; };
122 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = VictoryComposedDemo/AppDelegate.m; sourceTree = ""; };
123 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
124 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = VictoryComposedDemo/Images.xcassets; sourceTree = ""; };
125 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = VictoryComposedDemo/Info.plist; sourceTree = ""; };
126 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = VictoryComposedDemo/main.m; sourceTree = ""; };
127 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = ../node_modules/react-native/React/React.xcodeproj; sourceTree = ""; };
128 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = ../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj; sourceTree = ""; };
129 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../node_modules/react-native/Libraries/Text/RCTText.xcodeproj; sourceTree = ""; };
130 | 0F06BA66B96042AE8A7B37EC /* RNSVG.xcodeproj */ = {isa = PBXFileReference; name = "RNSVG.xcodeproj"; path = "../node_modules/react-native-svg/ios/RNSVG.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
131 | DE0BA9F5DD0546FDAAAD7B07 /* libRNSVG.a */ = {isa = PBXFileReference; name = "libRNSVG.a"; path = "libRNSVG.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
132 | /* End PBXFileReference section */
133 |
134 | /* Begin PBXFrameworksBuildPhase section */
135 | 00E356EB1AD99517003FC87E /* Frameworks */ = {
136 | isa = PBXFrameworksBuildPhase;
137 | buildActionMask = 2147483647;
138 | files = (
139 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */,
140 | );
141 | runOnlyForDeploymentPostprocessing = 0;
142 | };
143 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
144 | isa = PBXFrameworksBuildPhase;
145 | buildActionMask = 2147483647;
146 | files = (
147 | 146834051AC3E58100842450 /* libReact.a in Frameworks */,
148 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
149 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,
150 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */,
151 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */,
152 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */,
153 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */,
154 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
155 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
156 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
157 | 82199C1A6D4A4C698AEB6655 /* libRNSVG.a in Frameworks */,
158 | );
159 | runOnlyForDeploymentPostprocessing = 0;
160 | };
161 | /* End PBXFrameworksBuildPhase section */
162 |
163 | /* Begin PBXGroup section */
164 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = {
165 | isa = PBXGroup;
166 | children = (
167 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */,
168 | );
169 | name = Products;
170 | sourceTree = "";
171 | };
172 | 00C302B61ABCB90400DB3ED1 /* Products */ = {
173 | isa = PBXGroup;
174 | children = (
175 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */,
176 | );
177 | name = Products;
178 | sourceTree = "";
179 | };
180 | 00C302BC1ABCB91800DB3ED1 /* Products */ = {
181 | isa = PBXGroup;
182 | children = (
183 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */,
184 | );
185 | name = Products;
186 | sourceTree = "";
187 | };
188 | 00C302D41ABCB9D200DB3ED1 /* Products */ = {
189 | isa = PBXGroup;
190 | children = (
191 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */,
192 | );
193 | name = Products;
194 | sourceTree = "";
195 | };
196 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = {
197 | isa = PBXGroup;
198 | children = (
199 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */,
200 | );
201 | name = Products;
202 | sourceTree = "";
203 | };
204 | 00E356EF1AD99517003FC87E /* VictoryComposedDemoTests */ = {
205 | isa = PBXGroup;
206 | children = (
207 | 00E356F21AD99517003FC87E /* VictoryComposedDemoTests.m */,
208 | 00E356F01AD99517003FC87E /* Supporting Files */,
209 | );
210 | path = VictoryComposedDemoTests;
211 | sourceTree = "";
212 | };
213 | 00E356F01AD99517003FC87E /* Supporting Files */ = {
214 | isa = PBXGroup;
215 | children = (
216 | 00E356F11AD99517003FC87E /* Info.plist */,
217 | );
218 | name = "Supporting Files";
219 | sourceTree = "";
220 | };
221 | 139105B71AF99BAD00B5F7CC /* Products */ = {
222 | isa = PBXGroup;
223 | children = (
224 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */,
225 | );
226 | name = Products;
227 | sourceTree = "";
228 | };
229 | 139FDEE71B06529A00C62182 /* Products */ = {
230 | isa = PBXGroup;
231 | children = (
232 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */,
233 | );
234 | name = Products;
235 | sourceTree = "";
236 | };
237 | 13B07FAE1A68108700A75B9A /* VictoryComposedDemo */ = {
238 | isa = PBXGroup;
239 | children = (
240 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */,
241 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
242 | 13B07FB01A68108700A75B9A /* AppDelegate.m */,
243 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
244 | 13B07FB61A68108700A75B9A /* Info.plist */,
245 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
246 | 13B07FB71A68108700A75B9A /* main.m */,
247 | );
248 | name = VictoryComposedDemo;
249 | sourceTree = "";
250 | };
251 | 146834001AC3E56700842450 /* Products */ = {
252 | isa = PBXGroup;
253 | children = (
254 | 146834041AC3E56700842450 /* libReact.a */,
255 | );
256 | name = Products;
257 | sourceTree = "";
258 | };
259 | 78C398B11ACF4ADC00677621 /* Products */ = {
260 | isa = PBXGroup;
261 | children = (
262 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */,
263 | );
264 | name = Products;
265 | sourceTree = "";
266 | };
267 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
268 | isa = PBXGroup;
269 | children = (
270 | 146833FF1AC3E56700842450 /* React.xcodeproj */,
271 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,
272 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,
273 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */,
274 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */,
275 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,
276 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */,
277 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
278 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
279 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
280 | 0F06BA66B96042AE8A7B37EC /* RNSVG.xcodeproj */,
281 | );
282 | name = Libraries;
283 | sourceTree = "";
284 | };
285 | 832341B11AAA6A8300B99B32 /* Products */ = {
286 | isa = PBXGroup;
287 | children = (
288 | 832341B51AAA6A8300B99B32 /* libRCTText.a */,
289 | );
290 | name = Products;
291 | sourceTree = "";
292 | };
293 | 83CBB9F61A601CBA00E9B192 = {
294 | isa = PBXGroup;
295 | children = (
296 | 13B07FAE1A68108700A75B9A /* VictoryComposedDemo */,
297 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
298 | 00E356EF1AD99517003FC87E /* VictoryComposedDemoTests */,
299 | 83CBBA001A601CBA00E9B192 /* Products */,
300 | );
301 | indentWidth = 2;
302 | sourceTree = "";
303 | tabWidth = 2;
304 | };
305 | 83CBBA001A601CBA00E9B192 /* Products */ = {
306 | isa = PBXGroup;
307 | children = (
308 | 13B07F961A680F5B00A75B9A /* VictoryComposedDemo.app */,
309 | 00E356EE1AD99517003FC87E /* VictoryComposedDemoTests.xctest */,
310 | );
311 | name = Products;
312 | sourceTree = "";
313 | };
314 | /* End PBXGroup section */
315 |
316 | /* Begin PBXNativeTarget section */
317 | 00E356ED1AD99517003FC87E /* VictoryComposedDemoTests */ = {
318 | isa = PBXNativeTarget;
319 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "VictoryComposedDemoTests" */;
320 | buildPhases = (
321 | 00E356EA1AD99517003FC87E /* Sources */,
322 | 00E356EB1AD99517003FC87E /* Frameworks */,
323 | 00E356EC1AD99517003FC87E /* Resources */,
324 | );
325 | buildRules = (
326 | );
327 | dependencies = (
328 | 00E356F51AD99517003FC87E /* PBXTargetDependency */,
329 | );
330 | name = VictoryComposedDemoTests;
331 | productName = VictoryComposedDemoTests;
332 | productReference = 00E356EE1AD99517003FC87E /* VictoryComposedDemoTests.xctest */;
333 | productType = "com.apple.product-type.bundle.unit-test";
334 | };
335 | 13B07F861A680F5B00A75B9A /* VictoryComposedDemo */ = {
336 | isa = PBXNativeTarget;
337 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "VictoryComposedDemo" */;
338 | buildPhases = (
339 | 13B07F871A680F5B00A75B9A /* Sources */,
340 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
341 | 13B07F8E1A680F5B00A75B9A /* Resources */,
342 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
343 | );
344 | buildRules = (
345 | );
346 | dependencies = (
347 | );
348 | name = VictoryComposedDemo;
349 | productName = "Hello World";
350 | productReference = 13B07F961A680F5B00A75B9A /* VictoryComposedDemo.app */;
351 | productType = "com.apple.product-type.application";
352 | };
353 | /* End PBXNativeTarget section */
354 |
355 | /* Begin PBXProject section */
356 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
357 | isa = PBXProject;
358 | attributes = {
359 | LastUpgradeCheck = 610;
360 | ORGANIZATIONNAME = Facebook;
361 | TargetAttributes = {
362 | 00E356ED1AD99517003FC87E = {
363 | CreatedOnToolsVersion = 6.2;
364 | TestTargetID = 13B07F861A680F5B00A75B9A;
365 | };
366 | };
367 | };
368 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "VictoryComposedDemo" */;
369 | compatibilityVersion = "Xcode 3.2";
370 | developmentRegion = English;
371 | hasScannedForEncodings = 0;
372 | knownRegions = (
373 | en,
374 | Base,
375 | );
376 | mainGroup = 83CBB9F61A601CBA00E9B192;
377 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
378 | projectDirPath = "";
379 | projectReferences = (
380 | {
381 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */;
382 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
383 | },
384 | {
385 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */;
386 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */;
387 | },
388 | {
389 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */;
390 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
391 | },
392 | {
393 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */;
394 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */;
395 | },
396 | {
397 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */;
398 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */;
399 | },
400 | {
401 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */;
402 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */;
403 | },
404 | {
405 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */;
406 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
407 | },
408 | {
409 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */;
410 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */;
411 | },
412 | {
413 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */;
414 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
415 | },
416 | {
417 | ProductGroup = 146834001AC3E56700842450 /* Products */;
418 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
419 | },
420 | );
421 | projectRoot = "";
422 | targets = (
423 | 13B07F861A680F5B00A75B9A /* VictoryComposedDemo */,
424 | 00E356ED1AD99517003FC87E /* VictoryComposedDemoTests */,
425 | );
426 | };
427 | /* End PBXProject section */
428 |
429 | /* Begin PBXReferenceProxy section */
430 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = {
431 | isa = PBXReferenceProxy;
432 | fileType = archive.ar;
433 | path = libRCTActionSheet.a;
434 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */;
435 | sourceTree = BUILT_PRODUCTS_DIR;
436 | };
437 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = {
438 | isa = PBXReferenceProxy;
439 | fileType = archive.ar;
440 | path = libRCTGeolocation.a;
441 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */;
442 | sourceTree = BUILT_PRODUCTS_DIR;
443 | };
444 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = {
445 | isa = PBXReferenceProxy;
446 | fileType = archive.ar;
447 | path = libRCTImage.a;
448 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */;
449 | sourceTree = BUILT_PRODUCTS_DIR;
450 | };
451 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = {
452 | isa = PBXReferenceProxy;
453 | fileType = archive.ar;
454 | path = libRCTNetwork.a;
455 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */;
456 | sourceTree = BUILT_PRODUCTS_DIR;
457 | };
458 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = {
459 | isa = PBXReferenceProxy;
460 | fileType = archive.ar;
461 | path = libRCTVibration.a;
462 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */;
463 | sourceTree = BUILT_PRODUCTS_DIR;
464 | };
465 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = {
466 | isa = PBXReferenceProxy;
467 | fileType = archive.ar;
468 | path = libRCTSettings.a;
469 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */;
470 | sourceTree = BUILT_PRODUCTS_DIR;
471 | };
472 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = {
473 | isa = PBXReferenceProxy;
474 | fileType = archive.ar;
475 | path = libRCTWebSocket.a;
476 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */;
477 | sourceTree = BUILT_PRODUCTS_DIR;
478 | };
479 | 146834041AC3E56700842450 /* libReact.a */ = {
480 | isa = PBXReferenceProxy;
481 | fileType = archive.ar;
482 | path = libReact.a;
483 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;
484 | sourceTree = BUILT_PRODUCTS_DIR;
485 | };
486 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {
487 | isa = PBXReferenceProxy;
488 | fileType = archive.ar;
489 | path = libRCTLinking.a;
490 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */;
491 | sourceTree = BUILT_PRODUCTS_DIR;
492 | };
493 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = {
494 | isa = PBXReferenceProxy;
495 | fileType = archive.ar;
496 | path = libRCTText.a;
497 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;
498 | sourceTree = BUILT_PRODUCTS_DIR;
499 | };
500 | /* End PBXReferenceProxy section */
501 |
502 | /* Begin PBXResourcesBuildPhase section */
503 | 00E356EC1AD99517003FC87E /* Resources */ = {
504 | isa = PBXResourcesBuildPhase;
505 | buildActionMask = 2147483647;
506 | files = (
507 | );
508 | runOnlyForDeploymentPostprocessing = 0;
509 | };
510 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
511 | isa = PBXResourcesBuildPhase;
512 | buildActionMask = 2147483647;
513 | files = (
514 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
515 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
516 | );
517 | runOnlyForDeploymentPostprocessing = 0;
518 | };
519 | /* End PBXResourcesBuildPhase section */
520 |
521 | /* Begin PBXShellScriptBuildPhase section */
522 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
523 | isa = PBXShellScriptBuildPhase;
524 | buildActionMask = 2147483647;
525 | files = (
526 | );
527 | inputPaths = (
528 | );
529 | name = "Bundle React Native code and images";
530 | outputPaths = (
531 | );
532 | runOnlyForDeploymentPostprocessing = 0;
533 | shellPath = /bin/sh;
534 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
535 | showEnvVarsInLog = 1;
536 | };
537 | /* End PBXShellScriptBuildPhase section */
538 |
539 | /* Begin PBXSourcesBuildPhase section */
540 | 00E356EA1AD99517003FC87E /* Sources */ = {
541 | isa = PBXSourcesBuildPhase;
542 | buildActionMask = 2147483647;
543 | files = (
544 | 00E356F31AD99517003FC87E /* VictoryComposedDemoTests.m in Sources */,
545 | );
546 | runOnlyForDeploymentPostprocessing = 0;
547 | };
548 | 13B07F871A680F5B00A75B9A /* Sources */ = {
549 | isa = PBXSourcesBuildPhase;
550 | buildActionMask = 2147483647;
551 | files = (
552 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
553 | 13B07FC11A68108700A75B9A /* main.m in Sources */,
554 | );
555 | runOnlyForDeploymentPostprocessing = 0;
556 | };
557 | /* End PBXSourcesBuildPhase section */
558 |
559 | /* Begin PBXTargetDependency section */
560 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
561 | isa = PBXTargetDependency;
562 | target = 13B07F861A680F5B00A75B9A /* VictoryComposedDemo */;
563 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
564 | };
565 | /* End PBXTargetDependency section */
566 |
567 | /* Begin PBXVariantGroup section */
568 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
569 | isa = PBXVariantGroup;
570 | children = (
571 | 13B07FB21A68108700A75B9A /* Base */,
572 | );
573 | name = LaunchScreen.xib;
574 | path = VictoryComposedDemo;
575 | sourceTree = "";
576 | };
577 | /* End PBXVariantGroup section */
578 |
579 | /* Begin XCBuildConfiguration section */
580 | 00E356F61AD99517003FC87E /* Debug */ = {
581 | isa = XCBuildConfiguration;
582 | buildSettings = {
583 | BUNDLE_LOADER = "$(TEST_HOST)";
584 | GCC_PREPROCESSOR_DEFINITIONS = (
585 | "DEBUG=1",
586 | "$(inherited)",
587 | );
588 | INFOPLIST_FILE = VictoryComposedDemoTests/Info.plist;
589 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
590 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
591 | PRODUCT_NAME = "$(TARGET_NAME)";
592 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/VictoryComposedDemo.app/VictoryComposedDemo";
593 | LIBRARY_SEARCH_PATHS = (
594 | "$(inherited)",
595 | "\"$(SRCROOT)/$(TARGET_NAME)\"",
596 | );
597 | };
598 | name = Debug;
599 | };
600 | 00E356F71AD99517003FC87E /* Release */ = {
601 | isa = XCBuildConfiguration;
602 | buildSettings = {
603 | BUNDLE_LOADER = "$(TEST_HOST)";
604 | COPY_PHASE_STRIP = NO;
605 | INFOPLIST_FILE = VictoryComposedDemoTests/Info.plist;
606 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
607 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
608 | PRODUCT_NAME = "$(TARGET_NAME)";
609 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/VictoryComposedDemo.app/VictoryComposedDemo";
610 | LIBRARY_SEARCH_PATHS = (
611 | "$(inherited)",
612 | "\"$(SRCROOT)/$(TARGET_NAME)\"",
613 | );
614 | };
615 | name = Release;
616 | };
617 | 13B07F941A680F5B00A75B9A /* Debug */ = {
618 | isa = XCBuildConfiguration;
619 | buildSettings = {
620 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
621 | CURRENT_PROJECT_VERSION = 1;
622 | DEAD_CODE_STRIPPING = NO;
623 | HEADER_SEARCH_PATHS = (
624 | "$(inherited)",
625 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
626 | "$(SRCROOT)/../node_modules/react-native/React/**",
627 | "$(SRCROOT)/../node_modules/react-native-svg/ios/**",
628 | );
629 | INFOPLIST_FILE = "VictoryComposedDemo/Info.plist";
630 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
631 | OTHER_LDFLAGS = (
632 | "$(inherited)",
633 | "-ObjC",
634 | "-lc++",
635 | );
636 | PRODUCT_NAME = VictoryComposedDemo;
637 | VERSIONING_SYSTEM = "apple-generic";
638 | };
639 | name = Debug;
640 | };
641 | 13B07F951A680F5B00A75B9A /* Release */ = {
642 | isa = XCBuildConfiguration;
643 | buildSettings = {
644 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
645 | CURRENT_PROJECT_VERSION = 1;
646 | HEADER_SEARCH_PATHS = (
647 | "$(inherited)",
648 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
649 | "$(SRCROOT)/../node_modules/react-native/React/**",
650 | "$(SRCROOT)/../node_modules/react-native-svg/ios/**",
651 | );
652 | INFOPLIST_FILE = "VictoryComposedDemo/Info.plist";
653 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
654 | OTHER_LDFLAGS = (
655 | "$(inherited)",
656 | "-ObjC",
657 | "-lc++",
658 | );
659 | PRODUCT_NAME = VictoryComposedDemo;
660 | VERSIONING_SYSTEM = "apple-generic";
661 | };
662 | name = Release;
663 | };
664 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
665 | isa = XCBuildConfiguration;
666 | buildSettings = {
667 | ALWAYS_SEARCH_USER_PATHS = NO;
668 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
669 | CLANG_CXX_LIBRARY = "libc++";
670 | CLANG_ENABLE_MODULES = YES;
671 | CLANG_ENABLE_OBJC_ARC = YES;
672 | CLANG_WARN_BOOL_CONVERSION = YES;
673 | CLANG_WARN_CONSTANT_CONVERSION = YES;
674 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
675 | CLANG_WARN_EMPTY_BODY = YES;
676 | CLANG_WARN_ENUM_CONVERSION = YES;
677 | CLANG_WARN_INT_CONVERSION = YES;
678 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
679 | CLANG_WARN_UNREACHABLE_CODE = YES;
680 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
681 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
682 | COPY_PHASE_STRIP = NO;
683 | ENABLE_STRICT_OBJC_MSGSEND = YES;
684 | GCC_C_LANGUAGE_STANDARD = gnu99;
685 | GCC_DYNAMIC_NO_PIC = NO;
686 | GCC_OPTIMIZATION_LEVEL = 0;
687 | GCC_PREPROCESSOR_DEFINITIONS = (
688 | "DEBUG=1",
689 | "$(inherited)",
690 | );
691 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
692 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
693 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
694 | GCC_WARN_UNDECLARED_SELECTOR = YES;
695 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
696 | GCC_WARN_UNUSED_FUNCTION = YES;
697 | GCC_WARN_UNUSED_VARIABLE = YES;
698 | HEADER_SEARCH_PATHS = (
699 | "$(inherited)",
700 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
701 | "$(SRCROOT)/../node_modules/react-native/React/**",
702 | "$(SRCROOT)/../node_modules/react-native-svg/ios/**",
703 | );
704 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
705 | MTL_ENABLE_DEBUG_INFO = YES;
706 | ONLY_ACTIVE_ARCH = YES;
707 | SDKROOT = iphoneos;
708 | };
709 | name = Debug;
710 | };
711 | 83CBBA211A601CBA00E9B192 /* Release */ = {
712 | isa = XCBuildConfiguration;
713 | buildSettings = {
714 | ALWAYS_SEARCH_USER_PATHS = NO;
715 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
716 | CLANG_CXX_LIBRARY = "libc++";
717 | CLANG_ENABLE_MODULES = YES;
718 | CLANG_ENABLE_OBJC_ARC = YES;
719 | CLANG_WARN_BOOL_CONVERSION = YES;
720 | CLANG_WARN_CONSTANT_CONVERSION = YES;
721 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
722 | CLANG_WARN_EMPTY_BODY = YES;
723 | CLANG_WARN_ENUM_CONVERSION = YES;
724 | CLANG_WARN_INT_CONVERSION = YES;
725 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
726 | CLANG_WARN_UNREACHABLE_CODE = YES;
727 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
728 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
729 | COPY_PHASE_STRIP = YES;
730 | ENABLE_NS_ASSERTIONS = NO;
731 | ENABLE_STRICT_OBJC_MSGSEND = YES;
732 | GCC_C_LANGUAGE_STANDARD = gnu99;
733 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
734 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
735 | GCC_WARN_UNDECLARED_SELECTOR = YES;
736 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
737 | GCC_WARN_UNUSED_FUNCTION = YES;
738 | GCC_WARN_UNUSED_VARIABLE = YES;
739 | HEADER_SEARCH_PATHS = (
740 | "$(inherited)",
741 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
742 | "$(SRCROOT)/../node_modules/react-native/React/**",
743 | "$(SRCROOT)/../node_modules/react-native-svg/ios/**",
744 | );
745 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
746 | MTL_ENABLE_DEBUG_INFO = NO;
747 | SDKROOT = iphoneos;
748 | VALIDATE_PRODUCT = YES;
749 | };
750 | name = Release;
751 | };
752 | /* End XCBuildConfiguration section */
753 |
754 | /* Begin XCConfigurationList section */
755 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "VictoryComposedDemoTests" */ = {
756 | isa = XCConfigurationList;
757 | buildConfigurations = (
758 | 00E356F61AD99517003FC87E /* Debug */,
759 | 00E356F71AD99517003FC87E /* Release */,
760 | );
761 | defaultConfigurationIsVisible = 0;
762 | defaultConfigurationName = Release;
763 | };
764 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "VictoryComposedDemo" */ = {
765 | isa = XCConfigurationList;
766 | buildConfigurations = (
767 | 13B07F941A680F5B00A75B9A /* Debug */,
768 | 13B07F951A680F5B00A75B9A /* Release */,
769 | );
770 | defaultConfigurationIsVisible = 0;
771 | defaultConfigurationName = Release;
772 | };
773 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "VictoryComposedDemo" */ = {
774 | isa = XCConfigurationList;
775 | buildConfigurations = (
776 | 83CBBA201A601CBA00E9B192 /* Debug */,
777 | 83CBBA211A601CBA00E9B192 /* Release */,
778 | );
779 | defaultConfigurationIsVisible = 0;
780 | defaultConfigurationName = Release;
781 | };
782 | /* End XCConfigurationList section */
783 | };
784 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
785 | }
786 |
--------------------------------------------------------------------------------
/demo-native/ios/VictoryComposedDemo.xcodeproj/xcshareddata/xcschemes/VictoryComposedDemo.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
75 |
77 |
83 |
84 |
85 |
86 |
87 |
88 |
94 |
96 |
102 |
103 |
104 |
105 |
107 |
108 |
111 |
112 |
113 |
--------------------------------------------------------------------------------
/demo-native/ios/VictoryComposedDemo/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 |
--------------------------------------------------------------------------------
/demo-native/ios/VictoryComposedDemo/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 "RCTBundleURLProvider.h"
13 | #import "RCTRootView.h"
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:@"VictoryComposedDemo"
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 |
--------------------------------------------------------------------------------
/demo-native/ios/VictoryComposedDemo/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 |
--------------------------------------------------------------------------------
/demo-native/ios/VictoryComposedDemo/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 | }
--------------------------------------------------------------------------------
/demo-native/ios/VictoryComposedDemo/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 | NSTemporaryExceptionAllowsInsecureHTTPLoads
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/demo-native/ios/VictoryComposedDemo/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 |
--------------------------------------------------------------------------------
/demo-native/ios/VictoryComposedDemoTests/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 |
--------------------------------------------------------------------------------
/demo-native/ios/VictoryComposedDemoTests/VictoryComposedDemoTests.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 "RCTLog.h"
14 | #import "RCTRootView.h"
15 |
16 | #define TIMEOUT_SECONDS 600
17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
18 |
19 | @interface VictoryComposedDemoTests : XCTestCase
20 |
21 | @end
22 |
23 | @implementation VictoryComposedDemoTests
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 = [[[[UIApplication sharedApplication] 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 |
--------------------------------------------------------------------------------
/demo-native/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "VictoryComposedDemo",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "start": "node node_modules/react-native/local-cli/cli.js start",
7 | "test": "jest"
8 | },
9 | "dependencies": {
10 | "react": "15.3.2",
11 | "react-native": "0.35.0",
12 | "react-native-svg": "^4.3.1",
13 | "victory-native": "^0.3.0",
14 | "victory-composed": "git+https://github.com/formidable/victory-composed.git"
15 | },
16 | "jest": {
17 | "preset": "jest-react-native"
18 | },
19 | "devDependencies": {
20 | "babel-jest": "16.0.0",
21 | "babel-preset-react-native": "1.9.0",
22 | "jest": "16.0.1",
23 | "jest-react-native": "16.0.0",
24 | "react-test-renderer": "15.3.2"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/demo-native/src/main.js:
--------------------------------------------------------------------------------
1 | /*eslint-disable no-use-before-define, max-len, react/prop-types*/
2 | import React from "react";
3 | import {
4 | Text,
5 | View,
6 | StyleSheet,
7 | ScrollView,
8 | Platform,
9 | Dimensions,
10 | StatusBar,
11 | TouchableOpacity
12 | } from "react-native";
13 |
14 | import {
15 | VictoryStandalone,
16 | VictoryAreaChart,
17 | VictoryBarChart,
18 | VictoryLineChart,
19 | VictoryScatterChart,
20 | VictoryPieChart,
21 | Themes
22 | } from "victory-composed";
23 |
24 | import Picker from "./picker";
25 |
26 | const random = (min, max) => Math.floor(Math.random() * (max - min + 1) + min);
27 | const componentWidth = Dimensions.get("window").width;
28 | const types = ["line", "area", "scatter"];
29 |
30 | const components = [
31 | "area",
32 | "bar",
33 | "line",
34 | //"pie",
35 | "scatter",
36 | "composed"
37 | ];
38 |
39 | const themes = {
40 | "bright": {
41 | backgroundColor: "#eee",
42 | accentColor: "#666",
43 | statusBarColor: "default"
44 | },
45 | "simple": {
46 | backgroundColor: "white",
47 | accentColor: "black",
48 | statusBarColor: "default"
49 | },
50 | "dark": {
51 | backgroundColor: "black",
52 | accentColor: "#9b59b6",
53 | statusBarColor: "light-content"
54 | },
55 | "danceparty": {
56 | backgroundColor: "black",
57 | accentColor: "#abe537",
58 | statusBarColor: "light-content"
59 | }
60 | };
61 |
62 | const ComponentDemos = {
63 | composed: (props) => (
64 | {
70 | const type = random(0, 2);
71 | return {
72 | type: types[type],
73 | data: data.data
74 | };
75 | })}
76 | />
77 | ),
78 | line: (props) => (
79 |
85 | ),
86 | area: (props) => (
87 |
95 | ),
96 | bar: (props) => (
97 |
103 | ),
104 | scatter: (props) => (
105 |
112 | ),
113 | pie: (props) => (
114 |
121 | )
122 | };
123 |
124 | export default class Wrapper extends React.Component {
125 | constructor(props) {
126 | super(props);
127 |
128 | this.state = {
129 | theme: "bright",
130 | background: themes.bright.backgroundColor,
131 | component: "area",
132 | data: this.generateNewData()
133 | };
134 |
135 | this.handleNewData = this.handleNewData.bind(this);
136 | this.handleThemeChange = this.handleThemeChange.bind(this);
137 | this.handleComponentChange = this.handleComponentChange.bind(this);
138 | }
139 | generateNewData() {
140 | const seriesCount = random(2, 5);
141 | const pointCount = random(3, 6);
142 |
143 | let series = [];
144 |
145 | for (let a = 0; a < seriesCount; a++) {
146 | let data = [];
147 | for (let b = 0; b < pointCount; b++) {
148 | data = data.concat({ x: b + 5, y: random(1, 10)});
149 | }
150 | series = series.concat({ data });
151 | }
152 |
153 | return series;
154 | }
155 | handleNewData() {
156 | this.setState({
157 | data: this.generateNewData()
158 | });
159 | }
160 | handleThemeChange(theme) {
161 | this.setState({ theme });
162 | if (Platform.OS === "ios") {
163 | StatusBar.setBarStyle(themes[theme].statusBarColor);
164 | }
165 | }
166 | handleComponentChange(component) {
167 | this.setState({ component });
168 | }
169 | render() {
170 | const ComponentPreview = ComponentDemos[this.state.component];
171 | const { backgroundColor, accentColor } = themes[this.state.theme];
172 | return (
173 |
174 |
175 |
176 |
177 |
184 |
191 |
192 |
196 |
197 | Generate random data
198 |
199 |
200 |
201 |
202 | );
203 | }
204 | }
205 |
206 | const styles = StyleSheet.create({
207 | container: {
208 | flex: 1,
209 | paddingTop: 40
210 | },
211 | controls: {
212 | padding: 10
213 | },
214 | options: {
215 | flex: 1,
216 | flexDirection: "row"
217 | },
218 | button: {
219 | margin: 10,
220 | padding: 10,
221 | alignItems: "center"
222 | },
223 | buttonText: {
224 | fontSize: 18
225 | }
226 | });
227 |
--------------------------------------------------------------------------------
/demo-native/src/picker.js:
--------------------------------------------------------------------------------
1 | /*eslint-disable no-use-before-define, max-len*/
2 | import React from "react";
3 | import {
4 | Text,
5 | View,
6 | StyleSheet,
7 | TouchableOpacity
8 | } from "react-native";
9 |
10 | /*
11 | * A simple list picker component - nothing to see here!
12 | */
13 | export default ({
14 | options,
15 | selectedOption,
16 | selectedChanged,
17 | backgroundColor,
18 | accentColor
19 | }) => (
20 |
21 | {options.map((option) => (
22 | selectedChanged(option)}
25 | style={[styles.option, { backgroundColor: option === selectedOption ? accentColor : backgroundColor }]}
26 | >
27 |
28 | {option}
29 |
30 |
31 | ))}
32 |
33 | );
34 |
35 | const styles = StyleSheet.create({
36 | options: {
37 | flex: 1,
38 | padding: 10
39 | },
40 | option: {
41 | padding: 5,
42 | alignItems: "flex-start",
43 | justifyContent: "center"
44 | },
45 | text: {
46 | fontSize: 18
47 | }
48 | });
49 |
--------------------------------------------------------------------------------
/demo/app.js:
--------------------------------------------------------------------------------
1 | /*global document:false */
2 | import React from "react";
3 | import ReactDOM from "react-dom";
4 | import VictoryComposedDemo from "./components/victory-composed-demo";
5 |
6 | const content = document.getElementById("content");
7 |
8 | const App = React.createClass({
9 | propTypes: {
10 | children: React.PropTypes.element
11 | },
12 |
13 | render() {
14 | return (
15 |
16 |
17 |
18 | );
19 | }
20 | });
21 |
22 | ReactDOM.render((
23 |
24 | ), content);
25 |
--------------------------------------------------------------------------------
/demo/components/victory-composed-demo.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | import React from "react";
3 |
4 | import {
5 | Standalone,
6 | AreaChart,
7 | BarChart,
8 | LineChart,
9 | ScatterChart,
10 | PieChart,
11 | Themes
12 | } from "../../src";
13 |
14 | function random(min, max) {
15 | return Math.floor(Math.random() * (max - min + 1) + min);
16 | }
17 |
18 | const types = ["line", "area", "scatter"];
19 |
20 | const ComponentDemos = {
21 | composedStandalone: (props) => (
22 | {
27 | const type = random(0,2);
28 | return {
29 | type: types[type],
30 | data: data.data
31 | };
32 | })}
33 | />
34 | ),
35 | lineChart: (props) => (
36 |
41 | ),
42 | areaChart: (props) => (
43 |
50 | ),
51 | barChart: (props) => (
52 |
57 | ),
58 | scatterChart: (props) => (
59 |
65 | ),
66 | pieChart: (props) => (
67 |
73 | )
74 | };
75 |
76 | export default class Wrapper extends React.Component {
77 | constructor(props) {
78 | super(props);
79 |
80 | this.state = {
81 | theme: "bright",
82 | component: "areaChart",
83 | data: this.generateNewData()
84 | };
85 |
86 | this.handleNewData = this.handleNewData.bind(this);
87 | this.handleThemeChange = this.handleThemeChange.bind(this);
88 | this.handleComponentChange = this.handleComponentChange.bind(this);
89 | }
90 | generateNewData() {
91 | const seriesCount = random(2,5);
92 | const pointCount = random(3,6);
93 |
94 | let series = [];
95 |
96 | for(let a = 0; a < seriesCount; a++) {
97 | let data = [];
98 | for(let b = 0; b < pointCount; b++) {
99 | data = data.concat({ x: b + 5, y: random(1, 10)})
100 | }
101 | series = series.concat({ data: data });
102 | }
103 |
104 | return series;
105 | }
106 | handleNewData() {
107 | this.setState({
108 | data: this.generateNewData()
109 | });
110 | }
111 | handleThemeChange(e) {
112 | this.setState({
113 | theme: e.target.value
114 | });
115 | }
116 | handleComponentChange(e) {
117 | this.setState({
118 | component: e.target.value
119 | });
120 | }
121 | render() {
122 | const ComponentPreview = ComponentDemos[this.state.component];
123 | return (
124 |
125 |
140 |
157 |
158 |
159 |
160 |
161 |
162 | );
163 | }
164 | }
165 |
--------------------------------------------------------------------------------
/demo/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 | Demo
10 |
11 |
12 |
37 |
38 |
39 |
40 |
43 |
44 |
If you can see this, something is broken (or JS is not enabled)!!.
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/docs/api.md:
--------------------------------------------------------------------------------
1 | # API Documentation
2 |
3 | ## Common Props
4 |
5 | The following is a list of common props shared by each chart, with the exception of PieChart where noted.
6 |
7 | ### categories
8 |
9 | `oneOfType(shape({ x: arrayOf(string), y: arrayOf(string) }), arrayOf(string))`
10 |
11 | The categories prop specifies how categorical data for a chart should be ordered. This prop should be given as an array of string values, or an object with these arrays of values specified for x and y. If this prop is not set, categorical data will be plotted in the order it was given in the data array.
12 |
13 | >Not applicable to PieChart
14 |
15 | Examples: `["dogs", "cats", "mice"], { x: ["dogs","cats"], y: ["mice","birds"]}`
16 |
17 | ---
18 |
19 | ### domain
20 |
21 | `oneOfType(shape({ x: arrayOf(number), y: arrayOf(number) }), arrayOf(number))`
22 |
23 | The domain prop describes the range of values your chart will include. This prop can be given as a array of the minimum and maximum expected values for your chart, or as an object that specifies separate arrays for x and y. If this prop is not provided, a domain will be calculated from data, or other available information.
24 |
25 | >Not applicable to PieChart
26 |
27 |
28 | Examples: `[-1, 1], {x: [0, 100], y: [0, 1]}`
29 |
30 | ---
31 |
32 | ### domainPadding
33 |
34 | `oneOfType(shape({ x: number, y: number }), number))`
35 |
36 | The domainPadding prop specifies a number of pixels of padding to add to the beginning and end of a domain. This prop is useful for explicitly spacing ticks farther from the origin to prevent crowding. This prop should be given as an object with numbers specified for x and y.
37 |
38 | >Not applicable to PieChart
39 |
40 | Examples: `20, { x: 5, y: 10 }`
41 |
42 | ---
43 |
44 | ### height
45 |
46 | `number`
47 |
48 | The height prop specifies the height of the svg viewBox of the chart container. This value should be given as a number of pixels.
49 |
50 | ---
51 |
52 | ### subtitle
53 |
54 | `string`
55 |
56 | The subtitle for your chart. This value should be a string.
57 |
58 | ---
59 |
60 | ### theme
61 |
62 | `object`
63 |
64 | This prop specifies which theme to use for your chart. See the themes section of the documentation for available themes and how to add them.
65 |
66 | Example `Themes.simple`
67 |
68 | ---
69 |
70 | ### title
71 |
72 | `string`
73 |
74 | The title for your chart. This value should be a string.
75 |
76 | ---
77 |
78 | ### width
79 |
80 | `number`
81 |
82 | The width props specifies the width of the svg viewBox of the chart container. This value should be given as a number of pixels.
83 |
84 | ---
85 |
86 | ### xAxis
87 |
88 | `object`
89 |
90 | This prop specifies a set of props to pass to the x axis. Valid props can be found in the documentation for the [VictoryAxis component](https://formidable.com/open-source/victory/docs/victory-axis#props) from the Victory library.
91 |
92 | >Not applicable to PieChart
93 |
94 | Example `{ name: "test" }`
95 |
96 | ---
97 |
98 | ### yAxis
99 |
100 | `object`
101 |
102 | This prop specifies a set of props to pass to the y axis. Valid props can be found in the documentation for the [VictoryAxis component](https://formidable.com/open-source/victory/docs/victory-axis#props) from the Victory library.
103 |
104 | >Not applicable to PieChart
105 |
106 | Example `{ scale: "time" }`
107 |
108 | ----
109 |
110 | ## AreaChart
111 |
112 | ---
113 |
114 | ### interpolation
115 |
116 | `string`
117 |
118 | The interpolation prop determines how data points should be connected when plotting a line. The following values are valid:
119 |
120 | *"basis", "basisClosed", "basisOpen", "bundle", "cardinal", "cardinalClosed", "cardinalOpen", "catmullRom", "catmullRomClosed", "catmullRomOpen", "linear", "linearClosed", "monotoneX", "monotoneY", "natural", "radial", "step", "stepAfter", "stepBefore"*
121 |
122 | ---
123 |
124 | ### series
125 |
126 | `arrayOf(object)`
127 |
128 | The series prop allows you to provide data series to your chart. Each object in the series array is representative of a subset of the properties found in the documentation or the [VictoryArea component](https://formidable.com/open-source/victory/docs/victory-area) from the Victory library.
129 |
130 | The series child object shape is as follows:
131 |
132 | ```
133 | {
134 | data: oneOfType(array, object),
135 | samples: number,
136 | style: object,
137 | x: oneOfType(string, func),
138 | y: oneOfType(string, func)
139 | }
140 | ```
141 |
142 | Example `[{ data: [{ x: 0, y: 1 }] ] }, { data: [ [2,3], [4 ,5] ] }]`
143 |
144 | ---
145 |
146 | ### stacked
147 |
148 | `bool`
149 |
150 | The stacked prop is a boolean value that determines whether to stack your area chart series.
151 |
152 | ----
153 |
154 | ## BarChart
155 |
156 | ---
157 |
158 | ### horizontal
159 |
160 | `bool`
161 |
162 | The horizontal prop is a boolean value that determines whether to display your bar chart series horizontally.
163 |
164 | ---
165 |
166 | ### labels
167 |
168 | `func`
169 |
170 | The labels prop defines labels that will appear above each bar in your bar chart. This prop should be given as a function of data.
171 |
172 | Example `(datum) => datum.y`
173 |
174 | ---
175 |
176 | ### offset
177 |
178 | `number`
179 |
180 | The offset prop controls the spacing between each series of bars in a group.
181 |
182 | ---
183 |
184 | ### series
185 |
186 | `arrayOf(object)`
187 |
188 | The series prop allows you to provide data series to your chart. Each object in the series array is representative of a subset of the properties found in the documentation for the [VictoryBar component](https://formidable.com/open-source/victory/docs/victory-bar) from the Victory library.
189 |
190 | The series child object shape is as follows:
191 |
192 | ```
193 | {
194 | data: oneOfType(array, object),
195 | style: object,
196 | x: oneOfType(string, func),
197 | y: oneOfType(string, func)
198 | }
199 | ```
200 |
201 | Example `[{ data: [{ x: 0, y: 1 }] ] }, { data: [ [2,3], [4 ,5] ] }]`
202 |
203 | ---
204 |
205 | ### stacked
206 |
207 | `bool`
208 |
209 | The stacked prop is a boolean value that determines whether to stack your bar chart series.
210 |
211 | ----
212 |
213 | ## LineChart
214 |
215 | ### interpolation
216 |
217 | `string`
218 |
219 | The interpolation prop determines how data points should be connected when plotting a line. The following values are valid:
220 |
221 | *"basis", "basisClosed", "basisOpen", "bundle", "cardinal", "cardinalClosed", "cardinalOpen", "catmullRom", "catmullRomClosed", "catmullRomOpen", "linear", "linearClosed", "monotoneX", "monotoneY", "natural", "radial", "step", "stepAfter", "stepBefore"*
222 |
223 | ---
224 |
225 | ### series
226 |
227 | `arrayOf(object)`
228 |
229 | The series prop allows you to provide data series to your chart. Each object in the series array is representative of a subset of the properties found in the documentation for the [VictoryLine component](https://formidable.com/open-source/victory/docs/victory-line) from the Victory library.
230 |
231 | The series child object shape is as follows:
232 |
233 | ```
234 | {
235 | data: oneOfType(array, object),
236 | samples: number,
237 | style: object,
238 | x: oneOfType(string, func),
239 | y: oneOfType(string, func)
240 | }
241 | ```
242 |
243 | Example `[{ data: [{ x: 0, y: 1 }] ] }, { data: [ [2,3], [4 ,5] ] }]`
244 |
245 | ----
246 |
247 | ## ScatterChart
248 |
249 | ### labels
250 |
251 | `func`
252 |
253 | The labels prop defines labels that will appear above each bar in your bar chart. This prop should be given as a function of data.
254 |
255 | Example `(datum) => datum.y`
256 |
257 | ---
258 |
259 | ### series
260 |
261 | `arrayOf(object)`
262 |
263 | The series prop allows you to provide data series to your chart. Each object in the series array is representative of a subset of the properties found in the documentation for the [VictoryScatter component](https://formidable.com/open-source/victory/docs/victory-scatter) from the Victory library.
264 |
265 | The series child object shape is as follows:
266 |
267 | ```
268 | {
269 | bubbleProperty: string,
270 | data: oneOfType(array, object),
271 | samples: number,
272 | size: number,
273 | symbol: oneOfType(string, func),
274 | style: object,
275 | x: oneOfType(string, func),
276 | y: oneOfType(string, func)
277 | }
278 | ```
279 |
280 | Example `[{ data: [{ x: 0, y: 1 }] ] }, { data: [ [2,3], [4 ,5] ] }]`
281 |
282 | ---
283 |
284 | ### size
285 |
286 | `oneOfType(number, func)`
287 |
288 | The size prop determines how to scale each data point
289 |
290 | Example `3`
291 |
292 | ---
293 |
294 | ### symbol
295 |
296 | `oneOfType(string, func)`
297 |
298 | The symbol prop determines which symbol should be drawn to represent data points.
299 |
300 | Valid string values: `"circle", "diamond", "plus", "square", "star", "triangleDown", "triangleUp"`
301 |
302 | Example `"circle"`
303 |
304 | ----
305 |
306 | ## PieChart
307 |
308 | ### cornerRadius
309 |
310 | `number`
311 |
312 | Set the cornerRadius for every dataComponent (`Slice` by default) within Pie.
313 |
314 | ----
315 |
316 | ### endAngle
317 |
318 | `number`
319 |
320 | The overall end angle of the pie in degrees. This prop is used in conjunction with startAngle to create a pie that spans only a segment of a circle.
321 |
322 | ----
323 |
324 | ### innerRadius
325 |
326 | `number`
327 |
328 | When creating a donut chart, this prop determines the number of pixels between the center of the chart and the inner edge of a donut. When this prop is set to zero a regular pie chart is rendered.
329 |
330 | ----
331 |
332 | ### labels
333 |
334 | `oneOfType(arrayOf(string), func)`
335 |
336 | The labels prop defines labels that will appear above each bar in your bar chart. This prop should be given as a function of data or an array of strings.
337 |
338 | Example `(datum) => datum.y`
339 |
340 | ---
341 |
342 | ### padAngle
343 |
344 | `number`
345 |
346 | The padAngle prop determines the amount of separation between adjacent data slices in number of degrees
347 |
348 | ---
349 |
350 | ### startAngle
351 |
352 | `number`
353 |
354 | The overall start angle of the pie in degrees. This prop is used in conjunction with endAngle to create a pie that spans only a segment of a circle.
355 |
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | # Introduction to FormidableCharts
2 |
3 | ## Getting Started
4 |
5 | `formidable-charts` is a set of composed, pre-styled components from our [Victory](https://www.formidable.com/open-source/victory) library that can be used to display rich, interactive charts. Our theming system not only supports style based theming, but behavioral and compositional theming as well.
6 |
7 | 1. Add `formidable-charts` to your project
8 |
9 | ```sh
10 | npm install formidable-charts --save
11 | ```
12 |
13 | For React Native, you'll need `-native` and `react-native-svg`:
14 |
15 | ```sh
16 | npm install -native formidable-charts react-native-svg --save
17 | react-native link react-native-svg
18 | ```
19 |
20 | 2. Add your first `formidable-charts` component:
21 |
22 | ```js
23 | import React, { Component } from 'react';
24 | import { render } from 'react-dom';
25 | import { LineChart } from 'formidable-charts';
26 |
27 | class MyLineChart extends Component {
28 | render() {
29 | return (
30 |
31 | );
32 | }
33 | }
34 |
35 | render(, document.getElementById('app'));
36 | ```
37 | 3. Explore the API docs and try out the various possible components and configurations and their themes!
38 |
39 | ## Contributing
40 |
41 | Please review our [Code of Conduct](https://github.com/FormidableLabs/builder-victory-component/blob/master/CONTRIBUTING.md#contributor-covenant-code-of-conduct) before contributing.
42 |
43 | For a detailed contribution guide, please see [the contribution guide](https://github.com/FormidableLabs/builder-victory-component/blob/master/dev/CONTRIBUTING.md) in the project builder archetype. To read more on the development environment, see [the development guide](https://github.com/FormidableLabs/builder-victory-component/blob/master/dev/DEVELOPMENT.md).
44 |
--------------------------------------------------------------------------------
/docs/standalone.md:
--------------------------------------------------------------------------------
1 | # Standalone
2 |
3 | `formidable-charts` also provides a vanilla JS standalone library!
4 |
5 | You can start using it by including the lib from:
6 |
7 | `https://unpkg.com/formidable-charts/dist/formidable-charts-standalone.js`
8 |
9 | Next, you can create a new chart instance:
10 |
11 | ```js
12 | var chartContainer = document.getElementById("container");
13 |
14 | var myChart = new FormidableCharts(chartContainer, {
15 | title: "My Chart",
16 | subtitle: "is amazing",
17 | series: [{
18 | type: "area",
19 | data: [{x: 0, y: 1}, {x: 1, y: 2}]
20 | }],
21 | theme: "bright"
22 | }
23 | ```
24 |
25 | After you've created a chart, you can update it using the `setOptions` method:
26 |
27 | ```js
28 | myChart.setOptions({
29 | series: [{
30 | type: "area",
31 | data: [{x: 10, y: 15}, {x: 20, y: 25}]
32 | }]
33 | });
34 | ```
35 |
36 | ## API
37 |
38 | ### VictoryStandalone(element, options)
39 |
40 | The top level `VictoryStandalone` function creates a new instance of a `VictoryStandalone` chart. The first argument is the DOM element where you want the chart to mount. The second argument is an options object.
41 |
42 | ## Options
43 |
44 | ### domain
45 |
46 | `oneOfType(shape({ x: arrayOf(number), y: arrayOf(number) }), arrayOf(number))`
47 |
48 | The domain option describes the range of values your chart will include. This option can be given as a array of the minimum and maximum expected values for your chart, or as an object that specifies separate arrays for x and y. If this option is not provided, a domain will be calculated from data, or other available information.
49 |
50 |
51 | Examples: `[-1, 1], {x: [0, 100], y: [0, 1]}`
52 |
53 | ---
54 |
55 | ### domainPadding
56 |
57 | `oneOfType(shape({ x: number, y: number }), number))`
58 |
59 | The domainPadding option specifies a number of pixels of padding to add to the beginning and end of a domain. This option is useful for explicitly spacing ticks farther from the origin to prevent crowding. This option should be given as an object with numbers specified for x and y.
60 |
61 | Examples: `20, { x: 5, y: 10 }`
62 |
63 | ---
64 |
65 | ### height
66 |
67 | `number`
68 |
69 | The height option specifies the height of the svg viewBox of the chart container. This value should be given as a number of pixels.
70 |
71 | ---
72 |
73 | ### series
74 |
75 | `arrayOf(object)`
76 |
77 | The series option allows you to provide data series to your chart. The series option accepts an array of object, where each object represents a plot of data. At a minimum, this object must contain a `type` and a `data` key:
78 |
79 | ```js
80 | {
81 | type: "area"
82 | data: [{x: 1, y: 1}]
83 | }
84 | ```
85 |
86 | Valid values for `type` are "area", "bar", "line" and "scatter". Additionally, you can stack "bar" and "area" types by nesting within a "stack" type, shown in the example below:
87 |
88 | ```js
89 | {
90 | type: "stack"
91 | data: [{
92 | type: "area"
93 | data: [{x: 1, y: 1}]
94 | }, {
95 | type: "area"
96 | data: [{x: 2, y: 1}]
97 | }]
98 | }
99 | ```
100 |
101 | You can also group "bar" types, using a "group" nest:
102 |
103 | ```js
104 | {
105 | type: "group"
106 | data: [{
107 | type: "bar"
108 | data: [{x: 1, y: 1}]
109 | }, {
110 | type: "bar"
111 | data: [{x: 2, y: 1}]
112 | }]
113 | }
114 | ```
115 |
116 | Any additional options provided in the data object are mapped directly to the rendered data type, and you can review what options exist for each type in the main API documention.
117 |
118 | ---
119 |
120 | ### subtitle
121 |
122 | `string`
123 |
124 | The subtitle for your chart. This value should be a string.
125 |
126 | ---
127 |
128 | ### theme
129 |
130 | `object`
131 |
132 | This option specifies which theme to use for your chart. See the themes section of the documentation for available themes and how to add them.
133 |
134 | Example `Themes.simple`
135 |
136 | ---
137 |
138 | ### title
139 |
140 | `string`
141 |
142 | The title for your chart. This value should be a string.
143 |
144 | ---
145 |
146 | ### width
147 |
148 | `number`
149 |
150 | The width options specifies the width of the svg viewBox of the chart container. This value should be given as a number of pixels.
151 |
152 | ---
153 |
154 | ### xAxis
155 |
156 | `object`
157 |
158 | This option specifies a set of options to pass to the x axis. Valid options can be found in the documentation for the [VictoryAxis component](https://formidable.com/open-source/victory/docs/victory-axis#options) from the Victory library.
159 |
160 | >Not applicable to PieChart
161 |
162 | Example `{ name: "test" }`
163 |
164 | ---
165 |
166 | ### yAxis
167 |
168 | `object`
169 |
170 | This option specifies a set of options to pass to the y axis. Valid options can be found in the documentation for the [VictoryAxis component](https://formidable.com/open-source/victory/docs/victory-axis#options) from the Victory library.
171 |
172 | >Not applicable to PieChart
173 |
174 | Example `{ scale: "time" }`
175 |
176 | ----
--------------------------------------------------------------------------------
/docs/themes.md:
--------------------------------------------------------------------------------
1 | # Themes
2 |
3 | `formidable-charts` has a set of beautiful preset themes ready to go. We default to the `simple` theme, but if you want to try out the whole set, here's how:
4 |
5 | ```js
6 | import { LineChart, Themes } from "formidable-charts";
7 |
8 | class MyChart extends Component {
9 | render() {
10 | return (
11 |
12 | )
13 | }
14 | }
15 | ```
16 |
17 | Right now we have 4 themes you can choose from:
18 |
19 | `bright` - A bright, fun theme.
20 |
21 | 
22 |
23 | `simple` - A simple, yet elegant theme.
24 |
25 | 
26 |
27 | `dark` - Uh oh who turned the lights out. A dark theme for your charts.
28 |
29 | 
30 |
31 | `danceparty` - Use this one carefully. You might have too much fun.
32 |
33 | 
34 |
35 | Keep your eyes peeled, there are more themes on the way!
36 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "formidable-charts",
3 | "version": "0.0.7",
4 | "description": "Top level composed component for Victory",
5 | "main": "lib/index.js",
6 | "react-native": "src/index.js",
7 | "repository": {
8 | "type": "git",
9 | "url": "https://github.com/formidablelabs/formidable-charts.git"
10 | },
11 | "author": "Ken Wheeler",
12 | "license": "MIT",
13 | "bugs": {
14 | "url": "https://github.com/formidablelabs/formidable-charts/issues"
15 | },
16 | "homepage": "https://github.com/formidablelabs/formidable-charts",
17 | "engineStrict": true,
18 | "engines": {
19 | "npm": ">=3.0.0"
20 | },
21 | "scripts": {
22 | "postinstall": "cd lib || builder run npm:postinstall",
23 | "preversion": "builder run npm:preversion",
24 | "postversion": "builder run npm:postversion",
25 | "postpublish": "builder run npm:postpublish",
26 | "start": "builder run hot",
27 | "standalone": "webpack --config config/webpack.config.standalone.js",
28 | "test": "builder run check",
29 | "benchmark": "builder run check-perf",
30 | "version": "builder run npm:version",
31 | "docs-build-static": "echo 'Static docs generation for victory-chart is not supported.'"
32 | },
33 | "dependencies": {
34 | "builder": "^3.1.0",
35 | "builder-victory-component": "^3.1.0",
36 | "victory-chart": "^14.0.4",
37 | "victory-core": "^10.0.3",
38 | "victory-pie": "^8.0.0"
39 | },
40 | "devDependencies": {
41 | "builder-victory-component-dev": "^3.1.0",
42 | "chai": "^3.5.0",
43 | "ecology": "^1.6.1",
44 | "enzyme": "^2.4.1",
45 | "file-loader": "^0.9.0",
46 | "formidable-landers": "^5.1.1",
47 | "lodash-webpack-plugin": "^0.10.3",
48 | "mocha": "^3.1.0",
49 | "radium": "^0.18.1",
50 | "react": "^15.3.2",
51 | "react-addons-test-utils": "^15.3.2",
52 | "react-dom": "^15.3.2",
53 | "react-router": "^2.8.1",
54 | "sinon": "^1.17.6",
55 | "sinon-chai": "^2.8.0"
56 | },
57 | "publishr": {
58 | "dependencies": [
59 | "^builder"
60 | ],
61 | "files": {
62 | ".npmignore": ".npmignore.publishr"
63 | }
64 | },
65 | "sideEffects": false
66 | }
67 |
--------------------------------------------------------------------------------
/src/components/formidable-charts/area-chart.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from "react";
2 |
3 | import {
4 | VictoryStack
5 | } from "../../victory/victory-chart";
6 |
7 | import {
8 | VictoryLabel,
9 | VictoryContainer
10 | } from "../../victory/victory-core";
11 |
12 | import Themes from "../../themes";
13 |
14 | export default class AreaChart extends React.Component {
15 | static displayName = "AreaChart";
16 |
17 | static propTypes = {
18 | categories: PropTypes.oneOfType([
19 | PropTypes.shape({
20 | x: PropTypes.arrayOf(PropTypes.string),
21 | y: PropTypes.arrayOf(PropTypes.string)
22 | }),
23 | PropTypes.arrayOf(PropTypes.string)
24 | ]),
25 | domain: PropTypes.oneOfType([
26 | PropTypes.arrayOf(PropTypes.number),
27 | PropTypes.shape({
28 | x: PropTypes.arrayOf(PropTypes.number),
29 | y: PropTypes.arrayOf(PropTypes.number)
30 | })
31 | ]),
32 | domainPadding: PropTypes.oneOfType([
33 | PropTypes.number,
34 | PropTypes.shape({
35 | x: PropTypes.number,
36 | y: PropTypes.number
37 | })
38 | ]),
39 | height: PropTypes.number,
40 | interpolation: PropTypes.oneOf([
41 | "basis", "basisClosed", "basisOpen", "bundle", "cardinal", "cardinalClosed", "cardinalOpen",
42 | "catmullRom", "catmullRomClosed", "catmullRomOpen", "linear", "linearClosed", "monotoneX",
43 | "monotoneY", "natural", "radial", "step", "stepAfter", "stepBefore"
44 | ]),
45 | series: PropTypes.arrayOf(
46 | PropTypes.shape({
47 | data: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
48 | name: PropTypes.string,
49 | samples: PropTypes.number,
50 | style: PropTypes.object,
51 | x: PropTypes.oneOfType([
52 | PropTypes.string,
53 | PropTypes.func
54 | ]),
55 | y: PropTypes.oneOfType([
56 | PropTypes.string,
57 | PropTypes.func
58 | ])
59 | })
60 | ),
61 | stacked: PropTypes.bool,
62 | subtitle: PropTypes.string,
63 | theme: PropTypes.shape({
64 | area: PropTypes.func,
65 | axis: PropTypes.func,
66 | bar: PropTypes.func,
67 | chart: PropTypes.func,
68 | line: PropTypes.func,
69 | pie: PropTypes.func,
70 | scatter: PropTypes.func,
71 | theme: PropTypes.object
72 | }),
73 | title: PropTypes.string,
74 | width: PropTypes.number,
75 | xAxis: PropTypes.object,
76 | yAxis: PropTypes.object
77 | };
78 |
79 | static defaultProps = {
80 | height: 300,
81 | theme: Themes.simple,
82 | series: [{
83 | y: (data) => Math.sin(2 * Math.PI * data.x),
84 | samples: 10
85 | }],
86 | width: 450
87 | };
88 |
89 | getRenderableProps(serie, index) {
90 | const props = {};
91 | // Key = type + index
92 | props.key = `area-${index}`;
93 |
94 | props.samples = serie.samples;
95 | props.x = serie.x || undefined;
96 | props.y = serie.y || undefined;
97 |
98 | props.interpolation = this.props.interpolation;
99 |
100 | // Add data if available
101 | props.data = serie.data || undefined;
102 |
103 | // Get color
104 | const { theme } = this.props.theme;
105 | const colors = theme.group.colorScale;
106 |
107 | props.theme = theme;
108 | props.seriesColor = colors[index % colors.length];
109 | props.style = serie.style;
110 |
111 | return props;
112 | }
113 |
114 | renderContainer() {
115 | // Get VictoryChart & theme from theme prop
116 | const { chart: Chart, theme } = this.props.theme;
117 | // Pull out relevant props
118 | const {
119 | height,
120 | width,
121 | domain,
122 | domainPadding,
123 | title,
124 | subtitle
125 | } = this.props;
126 |
127 | return (
128 |
134 | }
135 | height={height}
136 | width={width}
137 | domain={domain}
138 | domainPadding={domainPadding}
139 | theme={theme}
140 | padding={{
141 | top: this.props.subtitle || this.props.title ? 75 : 25,
142 | left: 50,
143 | bottom: 50,
144 | right: 50
145 | }}
146 | style={{...theme.chart.style, parent: {
147 | ...theme.chart.style.parent,
148 | paddingTop: 25
149 | }}}
150 | >
151 |
161 |
162 |
176 |
177 | {this.renderAxis("xAxis")}
178 | {this.renderAxis("yAxis", {dependentAxis: true})}
179 |
180 | {this.props.stacked ? (
181 |
182 | {this.renderSeries(this.props.series)}
183 |
184 | ) : this.renderSeries(this.props.series)}
185 |
186 |
187 | );
188 | }
189 |
190 | renderAxis(key, options) {
191 | const { axis } = this.props.theme;
192 | const axisProps = this.props[key];
193 | return axis({...options, ...axisProps});
194 | }
195 |
196 | renderSeries(series) {
197 | // Create empty elements array
198 | let elements = [];
199 |
200 | // For each series
201 | series.forEach((serie, index) => {
202 | const renderComposition = this.props.theme.area;
203 | // Get reduced prop set to pass to child
204 | const targetProps = this.getRenderableProps(serie, index);
205 | // Concat new elements onto elements array
206 | elements = elements.concat(renderComposition(targetProps));
207 | });
208 |
209 | return elements;
210 | }
211 |
212 | render() {
213 | // Render container
214 | return this.renderContainer();
215 | }
216 | }
217 |
--------------------------------------------------------------------------------
/src/components/formidable-charts/bar-chart.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from "react";
2 |
3 | import {
4 | VictoryGroup,
5 | VictoryStack
6 | } from "../../victory/victory-chart";
7 |
8 | import {
9 | VictoryLabel,
10 | VictoryContainer
11 | } from "../../victory/victory-core";
12 |
13 | import Themes from "../../themes";
14 |
15 | export default class BarChart extends React.Component {
16 | static displayName = "BarChart";
17 |
18 | static propTypes = {
19 | categories: PropTypes.oneOfType([
20 | PropTypes.shape({
21 | x: PropTypes.arrayOf(PropTypes.string),
22 | y: PropTypes.arrayOf(PropTypes.string)
23 | }),
24 | PropTypes.arrayOf(PropTypes.string)
25 | ]),
26 | domain: PropTypes.oneOfType([
27 | PropTypes.arrayOf(PropTypes.number),
28 | PropTypes.shape({
29 | x: PropTypes.arrayOf(PropTypes.number),
30 | y: PropTypes.arrayOf(PropTypes.number)
31 | })
32 | ]),
33 | domainPadding: PropTypes.oneOfType([
34 | PropTypes.number,
35 | PropTypes.shape({
36 | x: PropTypes.number,
37 | y: PropTypes.number
38 | })
39 | ]),
40 | horizontal: PropTypes.bool,
41 | labels: PropTypes.oneOfType([
42 | PropTypes.func,
43 | PropTypes.arrayOf(PropTypes.string)
44 | ]),
45 | height: PropTypes.number,
46 | offset: PropTypes.number,
47 | series: PropTypes.arrayOf(
48 | PropTypes.shape({
49 | labels: PropTypes.oneOfType([
50 | PropTypes.func,
51 | PropTypes.arrayOf(PropTypes.string)
52 | ]),
53 | data: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
54 | name: PropTypes.string,
55 | style: PropTypes.object,
56 | x: PropTypes.oneOfType([
57 | PropTypes.string,
58 | PropTypes.func
59 | ]),
60 | y: PropTypes.oneOfType([
61 | PropTypes.string,
62 | PropTypes.func
63 | ])
64 | })
65 | ),
66 | stacked: PropTypes.bool,
67 | subtitle: PropTypes.string,
68 | theme: PropTypes.shape({
69 | area: PropTypes.func,
70 | axis: PropTypes.func,
71 | bar: PropTypes.func,
72 | chart: PropTypes.func,
73 | line: PropTypes.func,
74 | pie: PropTypes.func,
75 | scatter: PropTypes.func,
76 | theme: PropTypes.object
77 | }),
78 | title: PropTypes.string,
79 | width: PropTypes.number,
80 | xAxis: PropTypes.object,
81 | yAxis: PropTypes.object
82 | };
83 |
84 | static defaultProps = {
85 | height: 300,
86 | theme: Themes.simple,
87 | series: [{
88 | data: [
89 | {x: 1, y: 3},
90 | {x: 3, y: 6},
91 | {x: 5, y: 9}
92 | ]
93 | }],
94 | offset: 15,
95 | width: 450
96 | };
97 |
98 | getRenderableProps(serie, index) {
99 | const props = {};
100 | // Key = type + index
101 | props.key = `bar-${index}`;
102 |
103 | props.x = serie.x || undefined;
104 | props.y = serie.y || undefined;
105 |
106 | // Add data if available
107 | props.data = serie.data || undefined;
108 |
109 | // Get color
110 | const { theme } = this.props.theme;
111 | const colors = theme.group.colorScale;
112 |
113 | props.theme = theme;
114 | props.seriesColor = colors[index % colors.length];
115 | props.style = serie.style;
116 |
117 | return props;
118 | }
119 |
120 | renderContainer() {
121 | // Get VictoryChart & theme from theme prop
122 | const { chart: Chart, theme } = this.props.theme;
123 | // Pull out relevant props
124 | const {
125 | height,
126 | width,
127 | domain,
128 | domainPadding,
129 | title,
130 | subtitle
131 | } = this.props;
132 |
133 | return (
134 |
140 | }
141 | height={height}
142 | width={width}
143 | domain={domain}
144 | domainPadding={domainPadding}
145 | theme={theme}
146 | padding={{
147 | top: this.props.subtitle || this.props.title ? 75 : 25,
148 | left: 50,
149 | bottom: 50,
150 | right: 50
151 | }}
152 | style={{...theme.chart.style, parent: {
153 | ...theme.chart.style.parent,
154 | paddingTop: 25
155 | }}}
156 | >
157 |
167 |
168 |
182 |
183 | {this.renderAxis("xAxis")}
184 | {this.renderAxis("yAxis", {dependentAxis: true})}
185 |
186 | {this.renderGroup()}
187 |
188 |
189 | );
190 | }
191 |
192 | renderAxis(key, options) {
193 | const { axis } = this.props.theme;
194 | const axisProps = this.props[key];
195 | return axis({...options, ...axisProps});
196 | }
197 |
198 | renderGroup() {
199 | if (this.props.stacked === true) {
200 | return (
201 |
202 | {this.renderSeries(this.props.series)}
203 |
204 | );
205 | } else {
206 | return (
207 |
208 | {this.renderSeries(this.props.series)}
209 |
210 | );
211 | }
212 | }
213 |
214 | renderSeries(series) {
215 | // Create empty elements array
216 | let elements = [];
217 |
218 | // For each series
219 | series.forEach((serie, index) => {
220 | const renderComposition = this.props.theme.bar;
221 | // Get reduced prop set to pass to child
222 | const targetProps = this.getRenderableProps(serie, index);
223 | // Concat new elements onto elements array
224 | elements = elements.concat(renderComposition(targetProps));
225 | });
226 |
227 | return elements;
228 | }
229 |
230 | render() {
231 | // Render container
232 | return this.renderContainer();
233 | }
234 | }
235 |
--------------------------------------------------------------------------------
/src/components/formidable-charts/line-chart.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from "react";
2 |
3 | import {
4 | VictoryLabel,
5 | VictoryContainer
6 | } from "../../victory/victory-core";
7 |
8 | import Themes from "../../themes";
9 |
10 | export default class LineChart extends React.Component {
11 | static displayName = "LineChart";
12 |
13 | static propTypes = {
14 | categories: PropTypes.oneOfType([
15 | PropTypes.shape({
16 | x: PropTypes.arrayOf(PropTypes.string),
17 | y: PropTypes.arrayOf(PropTypes.string)
18 | }),
19 | PropTypes.arrayOf(PropTypes.string)
20 | ]),
21 | domain: PropTypes.oneOfType([
22 | PropTypes.arrayOf(PropTypes.number),
23 | PropTypes.shape({
24 | x: PropTypes.arrayOf(PropTypes.number),
25 | y: PropTypes.arrayOf(PropTypes.number)
26 | })
27 | ]),
28 | domainPadding: PropTypes.oneOfType([
29 | PropTypes.number,
30 | PropTypes.shape({
31 | x: PropTypes.number,
32 | y: PropTypes.number
33 | })
34 | ]),
35 | height: PropTypes.number,
36 | interpolation: PropTypes.oneOf([
37 | "basis", "basisClosed", "basisOpen", "bundle", "cardinal", "cardinalClosed", "cardinalOpen",
38 | "catmullRom", "catmullRomClosed", "catmullRomOpen", "linear", "linearClosed", "monotoneX",
39 | "monotoneY", "natural", "radial", "step", "stepAfter", "stepBefore"
40 | ]),
41 | series: PropTypes.arrayOf(
42 | PropTypes.shape({
43 | data: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
44 | samples: PropTypes.number,
45 | style: PropTypes.object,
46 | x: PropTypes.oneOfType([
47 | PropTypes.string,
48 | PropTypes.func
49 | ]),
50 | y: PropTypes.oneOfType([
51 | PropTypes.string,
52 | PropTypes.func
53 | ])
54 | })
55 | ),
56 | subtitle: PropTypes.string,
57 | theme: PropTypes.shape({
58 | area: PropTypes.func,
59 | axis: PropTypes.func,
60 | bar: PropTypes.func,
61 | chart: PropTypes.func,
62 | line: PropTypes.func,
63 | pie: PropTypes.func,
64 | scatter: PropTypes.func,
65 | theme: PropTypes.object
66 | }),
67 | title: PropTypes.string,
68 | width: PropTypes.number,
69 | xAxis: PropTypes.object,
70 | yAxis: PropTypes.object
71 | };
72 |
73 | static defaultProps = {
74 | height: 300,
75 | theme: Themes.simple,
76 | series: [{
77 | y: (data) => Math.sin(2 * Math.PI * data.x),
78 | samples: 10
79 | }],
80 | width: 450
81 | };
82 |
83 | getRenderableProps(serie, index) {
84 | const props = {};
85 | // Key = type + index
86 | props.key = `line-${index}`;
87 |
88 | props.samples = serie.samples;
89 | props.x = serie.x || undefined;
90 | props.y = serie.y || undefined;
91 |
92 | props.categories = this.props.categories;
93 | props.interpolation = this.props.interpolation;
94 | props.style = serie.style;
95 |
96 | // Add data if available
97 | props.data = serie.data || undefined;
98 |
99 | // Get color
100 | const { theme } = this.props.theme;
101 | const colors = theme.group.colorScale;
102 |
103 | props.theme = theme;
104 | props.seriesColor = colors[index % colors.length];
105 |
106 | return props;
107 | }
108 |
109 | renderContainer() {
110 | // Get VictoryChart & theme from theme prop
111 | const { chart: Chart, theme } = this.props.theme;
112 | // Pull out relevant props
113 | const {
114 | height,
115 | width,
116 | domain,
117 | domainPadding,
118 | title,
119 | subtitle
120 | } = this.props;
121 |
122 | return (
123 |
129 | }
130 | height={height}
131 | width={width}
132 | domain={domain}
133 | domainPadding={domainPadding}
134 | theme={theme}
135 | padding={{
136 | top: this.props.subtitle || this.props.title ? 75 : 25,
137 | left: 50,
138 | bottom: 50,
139 | right: 50
140 | }}
141 | style={{...theme.chart.style, parent: {
142 | ...theme.chart.style.parent,
143 | paddingTop: 25
144 | }}}
145 | >
146 |
156 |
157 |
171 |
172 | {this.renderAxis("xAxis")}
173 | {this.renderAxis("yAxis", {dependentAxis: true})}
174 |
175 | {this.renderSeries(this.props.series)}
176 |
177 |
178 | );
179 | }
180 |
181 | renderAxis(key, options) {
182 | const { axis } = this.props.theme;
183 | const axisProps = this.props[key];
184 | return axis({...options, ...axisProps});
185 | }
186 |
187 | renderSeries(series) {
188 | // Create empty elements array
189 | let elements = [];
190 |
191 | // For each series
192 | series.forEach((serie, index) => {
193 | const renderComposition = this.props.theme.line;
194 | // Get reduced prop set to pass to child
195 | const targetProps = this.getRenderableProps(serie, index);
196 | // Concat new elements onto elements array
197 | elements = elements.concat(renderComposition(targetProps));
198 | });
199 |
200 | return elements;
201 | }
202 |
203 | render() {
204 | // Render container
205 | return this.renderContainer();
206 | }
207 | }
208 |
--------------------------------------------------------------------------------
/src/components/formidable-charts/pie-chart.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from "react";
2 |
3 | import {
4 | VictoryLabel,
5 | VictoryContainer
6 | } from "../../victory/victory-core";
7 |
8 | import Themes from "../../themes";
9 |
10 | export default class PieChart extends React.Component {
11 | static displayName = "PieChart";
12 |
13 | static propTypes = {
14 | cornerRadius: PropTypes.number,
15 | data: PropTypes.array,
16 | endAngle: PropTypes.number,
17 | height: PropTypes.number,
18 | innerRadius: PropTypes.number,
19 | labels: PropTypes.oneOfType([
20 | PropTypes.func,
21 | PropTypes.arrayOf(PropTypes.string)
22 | ]),
23 | padAngle: PropTypes.number,
24 | startAngle: PropTypes.number,
25 | subtitle: PropTypes.string,
26 | theme: PropTypes.shape({
27 | area: PropTypes.func,
28 | axis: PropTypes.func,
29 | bar: PropTypes.func,
30 | chart: PropTypes.func,
31 | line: PropTypes.func,
32 | pie: PropTypes.func,
33 | scatter: PropTypes.func,
34 | theme: PropTypes.object
35 | }),
36 | title: PropTypes.string,
37 | width: PropTypes.number,
38 | x: PropTypes.oneOfType([
39 | PropTypes.func,
40 | PropTypes.number,
41 | PropTypes.string,
42 | PropTypes.arrayOf(PropTypes.string)
43 | ]),
44 | y: PropTypes.oneOfType([
45 | PropTypes.func,
46 | PropTypes.number,
47 | PropTypes.string,
48 | PropTypes.arrayOf(PropTypes.string)
49 | ])
50 | };
51 |
52 | static defaultProps = {
53 | data: [
54 | {x: "A", y: 10},
55 | {x: "B", y: 3},
56 | {x: "C", y: 6}
57 | ],
58 | height: 300,
59 | theme: Themes.simple,
60 | width: 450
61 | };
62 |
63 | getRenderableProps() {
64 | const { title, subtitle, theme, ...renderableProps } = this.props;
65 | // Add data if available
66 | renderableProps.key = "pie";
67 | renderableProps.standalone = false;
68 | renderableProps.padding = {
69 | top: this.props.subtitle || this.props.title ? 75 : 25,
70 | left: 50,
71 | bottom: 50,
72 | right: 50
73 | };
74 |
75 | // Get color
76 | const { theme: styleTheme } = this.props.theme;
77 | renderableProps.theme = styleTheme;
78 |
79 | return renderableProps;
80 | }
81 |
82 | renderContainer() {
83 | // Get VictoryChart & theme from theme prop
84 | const { theme } = this.props.theme;
85 | // Pull out relevant props
86 | const {
87 | height,
88 | width,
89 | title,
90 | subtitle
91 | } = this.props;
92 |
93 | return (
94 |
104 |
114 |
115 |
129 |
130 | {this.renderPie()}
131 |
132 |
133 | );
134 | }
135 |
136 | renderPie() {
137 | // Get function based upon type
138 | const renderComposition = this.props.theme.pie;
139 | // Get reduced prop set to pass to child
140 | const targetProps = this.getRenderableProps();
141 | return renderComposition(targetProps);
142 | }
143 |
144 | render() {
145 | // Render container
146 | return this.renderContainer();
147 | }
148 | }
149 |
--------------------------------------------------------------------------------
/src/components/formidable-charts/scatter-chart.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from "react";
2 |
3 | import {
4 | VictoryLabel,
5 | VictoryContainer
6 | } from "../../victory/victory-core";
7 |
8 | import Themes from "../../themes";
9 |
10 | export default class ScatterChart extends React.Component {
11 | static displayName = "ScatterChart";
12 |
13 | static propTypes = {
14 | categories: PropTypes.oneOfType([
15 | PropTypes.shape({
16 | x: PropTypes.arrayOf(PropTypes.string),
17 | y: PropTypes.arrayOf(PropTypes.string)
18 | }),
19 | PropTypes.arrayOf(PropTypes.string)
20 | ]),
21 | domain: PropTypes.oneOfType([
22 | PropTypes.arrayOf(PropTypes.number),
23 | PropTypes.shape({
24 | x: PropTypes.arrayOf(PropTypes.number),
25 | y: PropTypes.arrayOf(PropTypes.number)
26 | })
27 | ]),
28 | domainPadding: PropTypes.oneOfType([
29 | PropTypes.number,
30 | PropTypes.shape({
31 | x: PropTypes.number,
32 | y: PropTypes.number
33 | })
34 | ]),
35 | height: PropTypes.number,
36 | series: PropTypes.arrayOf(
37 | PropTypes.shape({
38 | bubbleProperty: PropTypes.string,
39 | data: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
40 | labels: PropTypes.oneOfType([
41 | PropTypes.func,
42 | PropTypes.arrayOf(PropTypes.string)
43 | ]),
44 | samples: PropTypes.number,
45 | size: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
46 | style: PropTypes.object,
47 | symbol: PropTypes.oneOfType([
48 | PropTypes.oneOf([
49 | "circle", "diamond", "plus", "square", "star", "triangleDown", "triangleUp"
50 | ]),
51 | PropTypes.func
52 | ]),
53 | x: PropTypes.oneOfType([
54 | PropTypes.string,
55 | PropTypes.func
56 | ]),
57 | y: PropTypes.oneOfType([
58 | PropTypes.string,
59 | PropTypes.func
60 | ])
61 | })
62 | ),
63 | size: PropTypes.oneOfType([PropTypes.number, PropTypes.func]),
64 | subtitle: PropTypes.string,
65 | symbol: PropTypes.oneOfType([
66 | PropTypes.oneOf([
67 | "circle", "diamond", "plus", "square", "star", "triangleDown", "triangleUp"
68 | ]),
69 | PropTypes.func
70 | ]),
71 | theme: PropTypes.shape({
72 | area: PropTypes.func,
73 | axis: PropTypes.func,
74 | bar: PropTypes.func,
75 | chart: PropTypes.func,
76 | line: PropTypes.func,
77 | pie: PropTypes.func,
78 | scatter: PropTypes.func,
79 | theme: PropTypes.object
80 | }),
81 | title: PropTypes.string,
82 | width: PropTypes.number,
83 | xAxis: PropTypes.object,
84 | yAxis: PropTypes.object
85 | };
86 |
87 | static defaultProps = {
88 | height: 300,
89 | theme: Themes.simple,
90 | series: [{
91 | y: (data) => Math.sin(2 * Math.PI * data.x),
92 | samples: 10
93 | }],
94 | size: 4,
95 | width: 450
96 | };
97 |
98 | getRenderableProps(serie, index) {
99 | // Key = type + index
100 | const props = {
101 | key: `scatter-${index}`
102 | };
103 |
104 | props.bubbleProperty = serie.bubbleProperty || undefined;
105 | props.categories = this.props.categories;
106 | props.samples = serie.samples || undefined;
107 | props.size = serie.size || this.props.size;
108 | props.symbol = serie.symbol || this.props.symbol || undefined;
109 |
110 | props.x = serie.x || undefined;
111 | props.y = serie.y || undefined;
112 |
113 | // Add data if available
114 | props.data = serie.data || undefined;
115 |
116 | // Get color
117 | const { theme } = this.props.theme;
118 | const colors = theme.group.colorScale;
119 |
120 | props.theme = theme;
121 | props.seriesColor = colors[index % colors.length];
122 | props.style = serie.style;
123 |
124 | return props;
125 | }
126 |
127 | renderContainer() {
128 | // Get VictoryChart & theme from theme prop
129 | const { chart: Chart, theme } = this.props.theme;
130 | // Pull out relevant props
131 | const {
132 | height,
133 | width,
134 | domain,
135 | domainPadding,
136 | title,
137 | subtitle
138 | } = this.props;
139 |
140 | return (
141 |
147 | }
148 | height={height}
149 | width={width}
150 | domain={domain}
151 | domainPadding={domainPadding}
152 | theme={theme}
153 | padding={{
154 | top: this.props.subtitle || this.props.title ? 75 : 25,
155 | left: 50,
156 | bottom: 50,
157 | right: 50
158 | }}
159 | style={{...theme.chart.style, parent: {
160 | ...theme.chart.style.parent,
161 | paddingTop: 25
162 | }}}
163 | >
164 |
174 |
175 |
189 |
190 | {this.renderAxis("xAxis")}
191 | {this.renderAxis("yAxis", {dependentAxis: true})}
192 |
193 | {this.renderSeries(this.props.series)}
194 |
195 |
196 | );
197 | }
198 |
199 | renderAxis(key, options) {
200 | const { axis } = this.props.theme;
201 | const axisProps = this.props[key];
202 | return axis({...options, ...axisProps});
203 | }
204 |
205 | renderSeries(series) {
206 | // Create empty elements array
207 | let elements = [];
208 |
209 | // For each series
210 | series.forEach((serie, index) => {
211 | const renderComposition = this.props.theme.scatter;
212 | // Get reduced prop set to pass to child
213 | const targetProps = this.getRenderableProps(serie, index);
214 | // Concat new elements onto elements array
215 | elements = elements.concat(renderComposition(targetProps));
216 | });
217 |
218 | return elements;
219 | }
220 |
221 | render() {
222 | // Render container
223 | return this.renderContainer();
224 | }
225 | }
226 |
--------------------------------------------------------------------------------
/src/components/formidable-charts/standalone.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from "react";
2 |
3 | import {
4 | VictoryGroup,
5 | VictoryStack
6 | } from "../../victory/victory-chart";
7 |
8 | import {
9 | VictoryLabel,
10 | VictoryContainer
11 | } from "../../victory/victory-core";
12 |
13 | import Themes from "../../themes";
14 |
15 | export default class Standalone extends React.Component {
16 | static displayName = "Standalone";
17 |
18 | static propTypes = {
19 | domain: PropTypes.oneOfType([
20 | PropTypes.arrayOf(PropTypes.number),
21 | PropTypes.shape({
22 | x: PropTypes.arrayOf(PropTypes.number),
23 | y: PropTypes.arrayOf(PropTypes.number)
24 | })
25 | ]),
26 | domainPadding: PropTypes.oneOfType([
27 | PropTypes.number,
28 | PropTypes.shape({
29 | x: PropTypes.number,
30 | y: PropTypes.number
31 | })
32 | ]),
33 | height: PropTypes.number,
34 | labelFormat: PropTypes.func,
35 | series: PropTypes.arrayOf(
36 | PropTypes.shape({
37 | data: PropTypes.oneOfType([PropTypes.array, PropTypes.object]),
38 | name: PropTypes.string,
39 | style: PropTypes.object,
40 | type: PropTypes.string,
41 | x: PropTypes.oneOfType([
42 | PropTypes.string,
43 | PropTypes.func
44 | ]),
45 | y: PropTypes.oneOfType([
46 | PropTypes.string,
47 | PropTypes.func
48 | ])
49 | })
50 | ),
51 | subtitle: PropTypes.string,
52 | theme: PropTypes.shape({
53 | area: PropTypes.func,
54 | axis: PropTypes.func,
55 | bar: PropTypes.func,
56 | chart: PropTypes.func,
57 | line: PropTypes.func,
58 | pie: PropTypes.func,
59 | scatter: PropTypes.func,
60 | theme: PropTypes.object
61 | }),
62 | title: PropTypes.string,
63 | width: PropTypes.number,
64 | xAxis: PropTypes.object,
65 | yAxis: PropTypes.object
66 | };
67 |
68 | static defaultProps = {
69 | height: 300,
70 | theme: Themes.simple,
71 | series: [{
72 | y: (data) => Math.sin(2 * Math.PI * data.x),
73 | type: "line"
74 | }],
75 | width: 450
76 | };
77 |
78 | getRenderableProps(serie, type, index) {
79 | const { theme, ...renderableProps } = serie;
80 | // Key = type + index
81 | renderableProps.key = `${type}-${index}`;
82 |
83 | // Get color
84 | const { theme: styleTheme } = this.props.theme;
85 | const colors = styleTheme.group.colorScale;
86 |
87 | renderableProps.theme = styleTheme;
88 | renderableProps.seriesColor = colors[index % colors.length];
89 |
90 | return renderableProps;
91 | }
92 |
93 | renderContainer() {
94 | // Get VictoryChart & theme from theme prop
95 | const { chart: Chart, theme } = this.props.theme;
96 | // Pull out relevant props
97 | const {
98 | height,
99 | width,
100 | domain,
101 | domainPadding,
102 | title,
103 | subtitle
104 | } = this.props;
105 |
106 | return (
107 |
113 | }
114 | height={height}
115 | width={width}
116 | domain={domain}
117 | domainPadding={domainPadding}
118 | theme={theme}
119 | padding={{
120 | top: this.props.subtitle || this.props.title ? 75 : 25,
121 | left: 50,
122 | bottom: 50,
123 | right: 50
124 | }}
125 | style={{...theme.chart.style, parent: {
126 | ...theme.chart.style.parent,
127 | paddingTop: 25
128 | }}}
129 | >
130 | {this.props.title &&
131 | }
141 |
142 | {this.props.subtitle &&
143 | }
157 |
158 | {this.renderAxis("xAxis")}
159 | {this.renderAxis("yAxis", {dependentAxis: true})}
160 |
161 | {this.renderSeries(this.props.series)}
162 |
163 |
164 | );
165 | }
166 |
167 | renderAxis(key, options) {
168 | const { axis } = this.props.theme;
169 | const axisProps = this.props[key];
170 | return axis({...options, ...axisProps});
171 | }
172 |
173 | renderSeries(series) {
174 | // Create empty elements array
175 | let elements = [];
176 |
177 | // For each series
178 | series.forEach((serie, index) => {
179 | // Default type to line
180 | const type = serie.type || "line";
181 |
182 | if (type !== "stack" && type !== "group") {
183 | // Get function based upon type
184 | const renderComposition = this.props.theme[type];
185 | // Get reduced prop set to pass to child
186 | const targetProps = this.getRenderableProps(serie, type, index);
187 | // Concat new elements onto elements array
188 | elements = elements.concat(renderComposition(targetProps));
189 | } else if (type === "stack") {
190 | elements = elements.concat([
191 |
192 | {this.renderSeries(serie.data)}
193 |
194 | ]);
195 | } else if (type === "group") {
196 | elements = elements.concat([
197 |
198 | {this.renderSeries(serie.data)}
199 |
200 | ]);
201 | }
202 | });
203 |
204 | return elements;
205 | }
206 |
207 | render() {
208 | // Render container
209 | return this.renderContainer();
210 | }
211 | }
212 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | export {
2 | default as Standalone
3 | } from "./components/formidable-charts/standalone";
4 |
5 | export {
6 | default as AreaChart
7 | } from "./components/formidable-charts/area-chart";
8 |
9 | export {
10 | default as BarChart
11 | } from "./components/formidable-charts/bar-chart";
12 |
13 | export {
14 | default as LineChart
15 | } from "./components/formidable-charts/line-chart";
16 |
17 | export {
18 | default as PieChart
19 | } from "./components/formidable-charts/pie-chart";
20 |
21 | export {
22 | default as ScatterChart
23 | } from "./components/formidable-charts/scatter-chart";
24 |
25 | export {
26 | default as Themes
27 | } from "./themes";
28 |
--------------------------------------------------------------------------------
/src/standalone.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom";
3 | import { Standalone, Themes } from "./index";
4 |
5 | module.exports = class Victory {
6 | constructor(dom, options) {
7 | this.props = options || {};
8 | this.props.theme = this.resolveTheme(this.props);
9 | this.dom = dom;
10 | this.node = ReactDOM.render(, this.dom);
11 | }
12 | resolveTheme(props) {
13 | const theme = props.theme || "simple";
14 | return Themes[theme];
15 | }
16 | setOptions(data) {
17 | this.props = {...this.props, ...data};
18 | ReactDOM.render(, this.dom);
19 | }
20 | };
21 |
22 |
--------------------------------------------------------------------------------
/src/themes/bright/composed-area.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import {
4 | VictoryArea,
5 | VictoryGroup,
6 | VictoryVoronoiTooltip
7 | } from "../../victory/victory-chart";
8 |
9 | import { VictoryTooltip } from "../../victory/victory-core";
10 |
11 | export default (props) => ([
12 |
13 | {
26 | return [
27 | {
28 | mutation: (lastProps) => {
29 | return {
30 | style: {
31 | ...lastProps.style,
32 | opacity: 1
33 | }
34 | };
35 | }
36 | }
37 | ];
38 | },
39 | onMouseOut: () => {
40 | return [
41 | {
42 | mutation: (lastProps) => {
43 | return {
44 | style: {
45 | ...lastProps.style,
46 | opacity: 0.75
47 | }
48 | };
49 | }
50 | }
51 | ];
52 | }
53 | }
54 | }]}
55 | animate={{
56 | duration: 500,
57 | onLoad: {
58 | duration: 500
59 | }
60 | }}
61 | />
62 | `${d.y}`}
65 | labelComponent={
66 |
70 | }
71 | />
72 |
73 | ]);
74 |
--------------------------------------------------------------------------------
/src/themes/bright/composed-axis.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { VictoryAxis } from "../../victory/victory-chart";
4 |
5 | export default (props) => (
6 |
7 | );
8 |
--------------------------------------------------------------------------------
/src/themes/bright/composed-bar.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { VictoryBar } from "../../victory/victory-chart";
4 |
5 | import { VictoryTooltip } from "../../victory/victory-core";
6 |
7 | export default (props) => ([
8 | d.y)}
15 | labelComponent={}
16 | animate={{
17 | duration: 500,
18 | onLoad: {
19 | duration: 500
20 | }
21 | }}
22 | {...props}
23 | />
24 | ]);
25 |
--------------------------------------------------------------------------------
/src/themes/bright/composed-chart.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from "react";
2 |
3 | import { VictoryChart } from "../../victory/victory-chart";
4 |
5 | export default class ComposedWrapper extends React.Component {
6 | static propTypes = {
7 | children: PropTypes.node
8 | };
9 |
10 | render() {
11 | return {this.props.children};
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/themes/bright/composed-line.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import {
4 | VictoryLine,
5 | VictoryScatter,
6 | VictoryGroup,
7 | VictoryVoronoiTooltip
8 | } from "../../victory/victory-chart";
9 |
10 | import { VictoryTooltip } from "../../victory/victory-core";
11 |
12 | export default (props) => ([
13 |
14 |
28 |
45 | `${d.y}`}
48 | labelComponent={
49 |
53 | }
54 | />
55 |
56 | ]);
57 |
--------------------------------------------------------------------------------
/src/themes/bright/composed-pie.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { VictoryPie } from "../../victory/victory-pie";
4 |
5 | export default (props) => ([
6 |
15 | ]);
16 |
--------------------------------------------------------------------------------
/src/themes/bright/composed-scatter.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { VictoryScatter } from "../../victory/victory-chart";
4 |
5 | import { VictoryTooltip } from "../../victory/victory-core";
6 |
7 | export default (props) => ([
8 | d.y)}
18 | labelComponent={}
19 | animate={{
20 | duration: 500,
21 | onLoad: {
22 | duration: 500
23 | }
24 | }}
25 | />
26 | ]);
27 |
--------------------------------------------------------------------------------
/src/themes/bright/index.js:
--------------------------------------------------------------------------------
1 | import ComposedArea from "./composed-area";
2 | import ComposedAxis from "./composed-axis";
3 | import ComposedBar from "./composed-bar";
4 | import ComposedChart from "./composed-chart";
5 | import ComposedLine from "./composed-line";
6 | import ComposedPie from "./composed-pie";
7 | import ComposedScatter from "./composed-scatter";
8 |
9 | import theme from "./theme";
10 |
11 | export default {
12 | area: ComposedArea,
13 | axis: ComposedAxis,
14 | bar: ComposedBar,
15 | chart: ComposedChart,
16 | line: ComposedLine,
17 | pie: ComposedPie,
18 | scatter: ComposedScatter,
19 | theme
20 | };
21 |
--------------------------------------------------------------------------------
/src/themes/bright/theme.js:
--------------------------------------------------------------------------------
1 | // *
2 | // * Colors
3 | // *
4 | const colors = [
5 | "#0074D9",
6 | "#2ECC40",
7 | "#FF851B",
8 | "#FFDC00",
9 | "#7FDBFF",
10 | "#01FF70",
11 | "#FF4136",
12 | "#B10DC9",
13 | "#39CCCC"
14 | ];
15 |
16 | const primary = "#555";
17 | // *
18 | // * Typography
19 | // *
20 | const sansSerif = "'Gill Sans', 'Gill Sans MT', Calibri, sans-serif";
21 | const letterSpacing = "normal";
22 | const fontSize = 16;
23 | // *
24 | // * Layout
25 | // *
26 | const baseProps = {
27 | width: 450,
28 | height: 300,
29 | padding: 50,
30 | colorScale: colors
31 | };
32 | // *
33 | // * Labels
34 | // *
35 | const baseLabelStyles = {
36 | fontFamily: sansSerif,
37 | fontSize,
38 | letterSpacing,
39 | padding: 10,
40 | fill: primary,
41 | stroke: "transparent"
42 | };
43 |
44 | const centeredLabelStyles = { textAnchor: "middle", ...baseLabelStyles };
45 | // *
46 | // * Strokes
47 | // *
48 | const strokeDasharray = "2, 2";
49 | const strokeLinecap = "round";
50 | const strokeLinejoin = "round";
51 |
52 | export default {
53 | area: {
54 | style: {
55 | data: {
56 | opacity: 0.85,
57 | fill: primary
58 | },
59 | labels: centeredLabelStyles
60 | },
61 | ...baseProps
62 | },
63 | axis: {
64 | style: {
65 | axis: {
66 | fill: "transparent",
67 | stroke: primary,
68 | strokeWidth: 1,
69 | strokeLinecap,
70 | strokeLinejoin
71 | },
72 | axisLabel: {
73 | ...centeredLabelStyles,
74 | padding: 25
75 | },
76 | grid: {
77 | fill: "transparent",
78 | stroke: primary,
79 | opacity: 0.25,
80 | strokeDasharray,
81 | strokeLinecap,
82 | strokeLinejoin
83 | },
84 | ticks: {
85 | fill: "transparent",
86 | padding: 10,
87 | size: 1,
88 | stroke: "transparent"
89 | },
90 | tickLabels: baseLabelStyles
91 | },
92 | ...baseProps
93 | },
94 | bar: {
95 | style: {
96 | data: {
97 | opacity: 0.85,
98 | fill: primary,
99 | padding: 10,
100 | stroke: "transparent",
101 | strokeWidth: 0,
102 | width: 8
103 | },
104 | labels: baseLabelStyles
105 | },
106 | ...baseProps
107 | },
108 | candlestick: {
109 | style: {
110 | data: {
111 | opacity: 0.85,
112 | stroke: primary,
113 | strokeWidth: 1
114 | },
115 | labels: centeredLabelStyles
116 | },
117 | candleColors: {
118 | positive: "#ffffff",
119 | negative: primary
120 | },
121 | ...baseProps
122 | },
123 | chart: {
124 | style: {
125 | parent: {
126 | background: "#f1f1f1"
127 | }
128 | },
129 | ...baseProps
130 | },
131 | errorbar: {
132 | style: {
133 | data: {
134 | opacity: 0.85,
135 | fill: "transparent",
136 | stroke: primary,
137 | strokeWidth: 2
138 | },
139 | labels: centeredLabelStyles
140 | },
141 | ...baseProps
142 | },
143 | group: {
144 | colorScale: colors,
145 | ...baseProps
146 | },
147 | line: {
148 | style: {
149 | data: {
150 | opacity: 0.85,
151 | fill: "transparent",
152 | stroke: primary,
153 | strokeWidth: 2
154 | },
155 | labels: {
156 | ...baseLabelStyles,
157 | textAnchor: "start"
158 | }
159 | },
160 | ...baseProps
161 | },
162 | pie: {
163 | style: {
164 | data: {
165 | opacity: 0.85,
166 | padding: 10,
167 | stroke: "transparent",
168 | strokeWidth: 1
169 | },
170 | labels: {
171 | ...baseLabelStyles,
172 | padding: 20
173 | }
174 | },
175 | colorScale: colors,
176 | width: 400,
177 | height: 400,
178 | padding: 50
179 | },
180 | scatter: {
181 | style: {
182 | data: {
183 | opacity: 0.85,
184 | fill: primary,
185 | stroke: "transparent",
186 | strokeWidth: 0
187 | },
188 | labels: centeredLabelStyles
189 | },
190 | ...baseProps
191 | },
192 | stack: {
193 | colorScale: colors,
194 | ...baseProps
195 | },
196 | tooltip: {
197 | padding: 10,
198 | style: {
199 | data: {
200 | fill: "transparent",
201 | stroke: "transparent",
202 | strokeWidth: 0
203 | },
204 | labels: centeredLabelStyles,
205 | flyout: {
206 | stroke: primary,
207 | strokeWidth: 1,
208 | fill: "#333333"
209 | }
210 | },
211 | flyoutProps: {
212 | cornerRadius: 2,
213 | pointerLength: 0
214 | }
215 | },
216 | voronoi: {
217 | style: {
218 | data: {
219 | fill: "transparent",
220 | stroke: "transparent",
221 | strokeWidth: 0
222 | },
223 | labels: centeredLabelStyles
224 | },
225 | ...baseProps
226 | }
227 | };
228 |
--------------------------------------------------------------------------------
/src/themes/danceparty/composed-area.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import {
4 | VictoryArea,
5 | VictoryGroup,
6 | VictoryVoronoiTooltip
7 | } from "../../victory/victory-chart";
8 |
9 | import { VictoryTooltip } from "../../victory/victory-core";
10 |
11 | export default (props) => ([
12 |
13 | {
26 | return [
27 | {
28 | mutation: (lastProps) => {
29 | return {
30 | style: {
31 | ...lastProps.style,
32 | opacity: 1
33 | }
34 | };
35 | }
36 | }
37 | ];
38 | },
39 | onMouseOut: () => {
40 | return [
41 | {
42 | mutation: (lastProps) => {
43 | return {
44 | style: {
45 | ...lastProps.style,
46 | opacity: 0.75
47 | }
48 | };
49 | }
50 | }
51 | ];
52 | }
53 | }
54 | }]}
55 | animate={{
56 | duration: 500,
57 | onLoad: {
58 | duration: 500
59 | }
60 | }}
61 | />
62 | `${d.y}`}
65 | labelComponent={
66 |
70 | }
71 | />
72 |
73 | ]);
74 |
--------------------------------------------------------------------------------
/src/themes/danceparty/composed-axis.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { VictoryAxis } from "../../victory/victory-chart";
4 |
5 | export default (props) => (
6 |
7 | );
8 |
--------------------------------------------------------------------------------
/src/themes/danceparty/composed-bar.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { VictoryBar } from "../../victory/victory-chart";
4 |
5 | import { VictoryTooltip } from "../../victory/victory-core";
6 |
7 | export default (props) => ([
8 | d.y)}
15 | labelComponent={}
16 | animate={{
17 | duration: 500,
18 | onLoad: {
19 | duration: 500
20 | }
21 | }}
22 | {...props}
23 | />
24 | ]);
25 |
--------------------------------------------------------------------------------
/src/themes/danceparty/composed-chart.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from "react";
2 |
3 | import { VictoryChart } from "../../victory/victory-chart";
4 |
5 | export default class ComposedWrapper extends React.Component {
6 | static propTypes = {
7 | children: PropTypes.node
8 | };
9 |
10 | render() {
11 | return {this.props.children};
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/themes/danceparty/composed-line.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import {
4 | VictoryLine,
5 | VictoryScatter,
6 | VictoryGroup,
7 | VictoryVoronoiTooltip
8 | } from "../../victory/victory-chart";
9 |
10 | import { VictoryTooltip } from "../../victory/victory-core";
11 |
12 | export default (props) => ([
13 |
14 |
28 |
45 | `${d.y}`}
48 | labelComponent={
49 |
53 | }
54 | />
55 |
56 | ]);
57 |
--------------------------------------------------------------------------------
/src/themes/danceparty/composed-pie.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { VictoryPie } from "../../victory/victory-pie";
4 |
5 | export default (props) => ([
6 |
15 | ]);
16 |
--------------------------------------------------------------------------------
/src/themes/danceparty/composed-scatter.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { VictoryScatter } from "../../victory/victory-chart";
4 |
5 | import { VictoryTooltip } from "../../victory/victory-core";
6 |
7 | export default (props) => ([
8 | d.y)}
18 | labelComponent={}
19 | animate={{
20 | duration: 500,
21 | onLoad: {
22 | duration: 500
23 | }
24 | }}
25 | />
26 | ]);
27 |
--------------------------------------------------------------------------------
/src/themes/danceparty/index.js:
--------------------------------------------------------------------------------
1 | import ComposedArea from "./composed-area";
2 | import ComposedAxis from "./composed-axis";
3 | import ComposedBar from "./composed-bar";
4 | import ComposedChart from "./composed-chart";
5 | import ComposedLine from "./composed-line";
6 | import ComposedPie from "./composed-pie";
7 | import ComposedScatter from "./composed-scatter";
8 |
9 | import theme from "./theme";
10 |
11 | export default {
12 | area: ComposedArea,
13 | axis: ComposedAxis,
14 | bar: ComposedBar,
15 | chart: ComposedChart,
16 | line: ComposedLine,
17 | pie: ComposedPie,
18 | scatter: ComposedScatter,
19 | theme
20 | };
21 |
--------------------------------------------------------------------------------
/src/themes/danceparty/theme.js:
--------------------------------------------------------------------------------
1 | // *
2 | // * Colors
3 | // *
4 | const colors = [
5 | "#AAFF00",
6 | "#FFAA00",
7 | "#FF00AA",
8 | "#AA00FF",
9 | "#FFFB00",
10 | "#FA023C",
11 | "#CC37C2",
12 | "#46E4BC",
13 | "#00AAFF"
14 | ];
15 |
16 | const primary = "#ff00ff";
17 | // *
18 | // * Typography
19 | // *
20 | const sansSerif = "'Courier New',Courier,'Lucida Sans Typewriter','Lucida Typewriter',monospace";
21 | const letterSpacing = "normal";
22 | const fontSize = 14;
23 | // *
24 | // * Layout
25 | // *
26 | const baseProps = {
27 | width: 450,
28 | height: 300,
29 | padding: 50,
30 | colorScale: colors
31 | };
32 | // *
33 | // * Labels
34 | // *
35 | const baseLabelStyles = {
36 | fontFamily: sansSerif,
37 | fontSize,
38 | letterSpacing,
39 | padding: 10,
40 | fill: primary,
41 | stroke: "transparent"
42 | };
43 |
44 | const centeredLabelStyles = { textAnchor: "middle", ...baseLabelStyles };
45 | // *
46 | // * Strokes
47 | // *
48 | const strokeLinecap = "round";
49 | const strokeLinejoin = "round";
50 |
51 | export default {
52 | area: {
53 | style: {
54 | data: {
55 | opacity: 0.85,
56 | fill: primary
57 | },
58 | labels: centeredLabelStyles
59 | },
60 | ...baseProps
61 | },
62 | axis: {
63 | style: {
64 | axis: {
65 | fill: "transparent",
66 | stroke: primary,
67 | strokeWidth: 1,
68 | strokeLinecap,
69 | strokeLinejoin
70 | },
71 | axisLabel: {
72 | ...centeredLabelStyles,
73 | padding: 25
74 | },
75 | grid: {
76 | fill: "transparent",
77 | stroke: "transparent",
78 | opacity: 0.25,
79 | strokeLinecap,
80 | strokeLinejoin
81 | },
82 | ticks: {
83 | fill: "transparent",
84 | padding: 10,
85 | size: 1,
86 | stroke: "transparent"
87 | },
88 | tickLabels: baseLabelStyles
89 | },
90 | ...baseProps
91 | },
92 | bar: {
93 | style: {
94 | data: {
95 | opacity: 0.85,
96 | fill: primary,
97 | padding: 10,
98 | stroke: "transparent",
99 | strokeWidth: 0,
100 | width: 8
101 | },
102 | labels: baseLabelStyles
103 | },
104 | ...baseProps
105 | },
106 | candlestick: {
107 | style: {
108 | data: {
109 | opacity: 0.85,
110 | stroke: primary,
111 | strokeWidth: 1
112 | },
113 | labels: centeredLabelStyles
114 | },
115 | candleColors: {
116 | positive: "#ffffff",
117 | negative: primary
118 | },
119 | ...baseProps
120 | },
121 | chart: {
122 | style: {
123 | parent: {
124 | background: "#000"
125 | }
126 | },
127 | ...baseProps
128 | },
129 | errorbar: {
130 | style: {
131 | data: {
132 | opacity: 0.85,
133 | fill: "transparent",
134 | stroke: primary,
135 | strokeWidth: 2
136 | },
137 | labels: centeredLabelStyles
138 | },
139 | ...baseProps
140 | },
141 | group: {
142 | colorScale: colors,
143 | ...baseProps
144 | },
145 | line: {
146 | style: {
147 | data: {
148 | opacity: 0.85,
149 | fill: "transparent",
150 | stroke: primary,
151 | strokeWidth: 2
152 | },
153 | labels: {
154 | ...baseLabelStyles,
155 | textAnchor: "start"
156 | }
157 | },
158 | ...baseProps
159 | },
160 | pie: {
161 | style: {
162 | data: {
163 | opacity: 0.85,
164 | padding: 10,
165 | stroke: "transparent",
166 | strokeWidth: 1
167 | },
168 | labels: {
169 | ...baseLabelStyles,
170 | padding: 20
171 | }
172 | },
173 | colorScale: colors,
174 | width: 400,
175 | height: 400,
176 | padding: 50
177 | },
178 | scatter: {
179 | style: {
180 | data: {
181 | opacity: 0.85,
182 | fill: primary,
183 | stroke: "transparent",
184 | strokeWidth: 0
185 | },
186 | labels: centeredLabelStyles
187 | },
188 | ...baseProps
189 | },
190 | stack: {
191 | colorScale: colors,
192 | ...baseProps
193 | },
194 | tooltip: {
195 | padding: 10,
196 | style: {
197 | data: {
198 | fill: "transparent",
199 | stroke: "primary",
200 | strokeWidth: 0
201 | },
202 | labels: centeredLabelStyles,
203 | flyout: {
204 | stroke: primary,
205 | strokeWidth: 1,
206 | fill: "#000"
207 | }
208 | },
209 | flyoutProps: {
210 | cornerRadius: 2,
211 | pointerLength: 0
212 | }
213 | },
214 | voronoi: {
215 | style: {
216 | data: {
217 | fill: "transparent",
218 | stroke: "transparent",
219 | strokeWidth: 0
220 | },
221 | labels: centeredLabelStyles
222 | },
223 | ...baseProps
224 | }
225 | };
226 |
--------------------------------------------------------------------------------
/src/themes/dark/composed-area.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import {
4 | VictoryArea,
5 | VictoryGroup,
6 | VictoryVoronoiTooltip
7 | } from "../../victory/victory-chart";
8 |
9 | import { VictoryTooltip } from "../../victory/victory-core";
10 |
11 | export default (props) => ([
12 |
13 | {
26 | return [
27 | {
28 | mutation: (lastProps) => {
29 | return {
30 | style: {
31 | ...lastProps.style,
32 | opacity: 1
33 | }
34 | };
35 | }
36 | }
37 | ];
38 | },
39 | onMouseOut: () => {
40 | return [
41 | {
42 | mutation: (lastProps) => {
43 | return {
44 | style: {
45 | ...lastProps.style,
46 | opacity: 0.75
47 | }
48 | };
49 | }
50 | }
51 | ];
52 | }
53 | }
54 | }]}
55 | animate={{
56 | duration: 500,
57 | onLoad: {
58 | duration: 500
59 | }
60 | }}
61 | />
62 | `${d.y}`}
65 | labelComponent={
66 |
70 | }
71 | />
72 |
73 | ]);
74 |
--------------------------------------------------------------------------------
/src/themes/dark/composed-axis.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { VictoryAxis } from "../../victory/victory-chart";
4 |
5 | export default (props) => (
6 |
7 | );
8 |
--------------------------------------------------------------------------------
/src/themes/dark/composed-bar.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { VictoryBar } from "../../victory/victory-chart";
4 |
5 | import { VictoryTooltip } from "../../victory/victory-core";
6 |
7 | export default (props) => ([
8 | d.y)}
15 | labelComponent={}
16 | animate={{
17 | duration: 500,
18 | onLoad: {
19 | duration: 500
20 | }
21 | }}
22 | {...props}
23 | />
24 | ]);
25 |
--------------------------------------------------------------------------------
/src/themes/dark/composed-chart.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from "react";
2 |
3 | import { VictoryChart } from "../../victory/victory-chart";
4 |
5 | export default class ComposedWrapper extends React.Component {
6 | static propTypes = {
7 | children: PropTypes.node
8 | };
9 |
10 | render() {
11 | return {this.props.children};
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/themes/dark/composed-line.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import {
4 | VictoryLine,
5 | VictoryScatter,
6 | VictoryGroup,
7 | VictoryVoronoiTooltip
8 | } from "../../victory/victory-chart";
9 |
10 | import { VictoryTooltip } from "../../victory/victory-core";
11 |
12 | export default (props) => ([
13 |
14 |
28 |
45 | `${d.y}`}
48 | labelComponent={
49 |
53 | }
54 | />
55 |
56 | ]);
57 |
--------------------------------------------------------------------------------
/src/themes/dark/composed-pie.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { VictoryPie } from "../../victory/victory-pie";
4 |
5 | export default (props) => ([
6 |
15 | ]);
16 |
--------------------------------------------------------------------------------
/src/themes/dark/composed-scatter.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { VictoryScatter } from "../../victory/victory-chart";
4 |
5 | import { VictoryTooltip } from "../../victory/victory-core";
6 |
7 | export default (props) => ([
8 | d.y)}
18 | labelComponent={}
19 | animate={{
20 | duration: 500,
21 | onLoad: {
22 | duration: 500
23 | }
24 | }}
25 | />
26 | ]);
27 |
--------------------------------------------------------------------------------
/src/themes/dark/index.js:
--------------------------------------------------------------------------------
1 | import ComposedArea from "./composed-area";
2 | import ComposedAxis from "./composed-axis";
3 | import ComposedBar from "./composed-bar";
4 | import ComposedChart from "./composed-chart";
5 | import ComposedLine from "./composed-line";
6 | import ComposedPie from "./composed-pie";
7 | import ComposedScatter from "./composed-scatter";
8 |
9 | import theme from "./theme";
10 |
11 | export default {
12 | area: ComposedArea,
13 | axis: ComposedAxis,
14 | bar: ComposedBar,
15 | chart: ComposedChart,
16 | line: ComposedLine,
17 | pie: ComposedPie,
18 | scatter: ComposedScatter,
19 | theme
20 | };
21 |
--------------------------------------------------------------------------------
/src/themes/dark/theme.js:
--------------------------------------------------------------------------------
1 | // *
2 | // * Colors
3 | // *
4 | const colors = [
5 | "#e74c3c",
6 | "#3498db",
7 | "#f1c40f",
8 | "#9b59b6",
9 | "#e67e22",
10 | "#1abc9c",
11 | "#95a5a6",
12 | "#34495e"
13 | ];
14 |
15 | const primary = "#aaa";
16 | // *
17 | // * Typography
18 | // *
19 | const sansSerif =
20 | "'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Geneva, Verdana, sans-serif";
21 | const letterSpacing = "normal";
22 | const fontSize = 14;
23 | // *
24 | // * Layout
25 | // *
26 | const baseProps = {
27 | width: 450,
28 | height: 300,
29 | padding: 50,
30 | colorScale: colors
31 | };
32 | // *
33 | // * Labels
34 | // *
35 | const baseLabelStyles = {
36 | fontFamily: sansSerif,
37 | fontSize,
38 | letterSpacing,
39 | padding: 10,
40 | fill: primary,
41 | stroke: "transparent"
42 | };
43 |
44 | const centeredLabelStyles = { textAnchor: "middle", ...baseLabelStyles };
45 | // *
46 | // * Strokes
47 | // *
48 | const strokeDasharray = "10, 5";
49 | const strokeLinecap = "round";
50 | const strokeLinejoin = "round";
51 |
52 | export default {
53 | area: {
54 | style: {
55 | data: {
56 | opacity: 0.85,
57 | fill: primary
58 | },
59 | labels: centeredLabelStyles
60 | },
61 | ...baseProps
62 | },
63 | axis: {
64 | style: {
65 | axis: {
66 | fill: "transparent",
67 | stroke: primary,
68 | strokeWidth: 1,
69 | strokeLinecap,
70 | strokeLinejoin
71 | },
72 | axisLabel: {
73 | ...centeredLabelStyles,
74 | padding: 25
75 | },
76 | grid: {
77 | fill: "transparent",
78 | stroke: primary,
79 | opacity: 0.25,
80 | strokeDasharray,
81 | strokeLinecap,
82 | strokeLinejoin
83 | },
84 | ticks: {
85 | fill: "transparent",
86 | padding: 10,
87 | size: 1,
88 | stroke: "transparent"
89 | },
90 | tickLabels: baseLabelStyles
91 | },
92 | ...baseProps
93 | },
94 | bar: {
95 | style: {
96 | data: {
97 | opacity: 0.85,
98 | fill: primary,
99 | padding: 10,
100 | stroke: "transparent",
101 | strokeWidth: 0,
102 | width: 8
103 | },
104 | labels: baseLabelStyles
105 | },
106 | ...baseProps
107 | },
108 | candlestick: {
109 | style: {
110 | data: {
111 | opacity: 0.85,
112 | stroke: primary,
113 | strokeWidth: 1
114 | },
115 | labels: centeredLabelStyles
116 | },
117 | candleColors: {
118 | positive: "#ffffff",
119 | negative: primary
120 | },
121 | ...baseProps
122 | },
123 | chart: {
124 | style: {
125 | parent: {
126 | background: "#222222"
127 | }
128 | },
129 | ...baseProps
130 | },
131 | errorbar: {
132 | style: {
133 | data: {
134 | opacity: 0.85,
135 | fill: "transparent",
136 | stroke: primary,
137 | strokeWidth: 2
138 | },
139 | labels: centeredLabelStyles
140 | },
141 | ...baseProps
142 | },
143 | group: {
144 | colorScale: colors,
145 | ...baseProps
146 | },
147 | line: {
148 | style: {
149 | data: {
150 | opacity: 0.85,
151 | fill: "transparent",
152 | stroke: primary,
153 | strokeWidth: 2
154 | },
155 | labels: {
156 | ...baseLabelStyles,
157 | textAnchor: "start"
158 | }
159 | },
160 | ...baseProps
161 | },
162 | pie: {
163 | style: {
164 | data: {
165 | opacity: 0.85,
166 | padding: 10,
167 | stroke: "transparent",
168 | strokeWidth: 1
169 | },
170 | labels: {
171 | ...baseLabelStyles,
172 | padding: 20
173 | }
174 | },
175 | colorScale: colors,
176 | width: 400,
177 | height: 400,
178 | padding: 50
179 | },
180 | scatter: {
181 | style: {
182 | data: {
183 | opacity: 0.85,
184 | fill: primary,
185 | stroke: "transparent",
186 | strokeWidth: 0
187 | },
188 | labels: centeredLabelStyles
189 | },
190 | ...baseProps
191 | },
192 | stack: {
193 | colorScale: colors,
194 | ...baseProps
195 | },
196 | tooltip: {
197 | padding: 10,
198 | style: {
199 | data: {
200 | fill: "transparent",
201 | stroke: "transparent",
202 | strokeWidth: 0
203 | },
204 | labels: centeredLabelStyles,
205 | flyout: {
206 | stroke: primary,
207 | strokeWidth: 1,
208 | fill: "#333333"
209 | }
210 | },
211 | flyoutProps: {
212 | cornerRadius: 2,
213 | pointerLength: 0
214 | }
215 | },
216 | voronoi: {
217 | style: {
218 | data: {
219 | fill: "transparent",
220 | stroke: "transparent",
221 | strokeWidth: 0
222 | },
223 | labels: centeredLabelStyles
224 | },
225 | ...baseProps
226 | }
227 | };
228 |
--------------------------------------------------------------------------------
/src/themes/index.js:
--------------------------------------------------------------------------------
1 | import simple from "./simple";
2 | import dark from "./dark";
3 | import danceparty from "./danceparty";
4 | import bright from "./bright";
5 |
6 | export default {
7 | simple,
8 | dark,
9 | danceparty,
10 | bright
11 | };
12 |
--------------------------------------------------------------------------------
/src/themes/simple/composed-area.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import {
4 | VictoryArea,
5 | VictoryGroup,
6 | VictoryVoronoiTooltip
7 | } from "../../victory/victory-chart";
8 |
9 | import { VictoryTooltip } from "../../victory/victory-core";
10 |
11 | export default (props) => ([
12 |
13 | {
26 | return [
27 | {
28 | mutation: (lastProps) => {
29 | return {
30 | style: {
31 | ...lastProps.style,
32 | opacity: 1
33 | }
34 | };
35 | }
36 | }
37 | ];
38 | },
39 | onMouseOut: () => {
40 | return [
41 | {
42 | mutation: (lastProps) => {
43 | return {
44 | style: {
45 | ...lastProps.style,
46 | opacity: 0.75
47 | }
48 | };
49 | }
50 | }
51 | ];
52 | }
53 | }
54 | }]}
55 | animate={{
56 | duration: 500,
57 | onLoad: {
58 | duration: 500
59 | }
60 | }}
61 | />
62 | `${d.y}`}
65 | labelComponent={
66 |
70 | }
71 | />
72 |
73 | ]);
74 |
--------------------------------------------------------------------------------
/src/themes/simple/composed-axis.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { VictoryAxis } from "../../victory/victory-chart";
4 |
5 | export default (props) => (
6 |
7 | );
8 |
--------------------------------------------------------------------------------
/src/themes/simple/composed-bar.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { VictoryBar } from "../../victory/victory-chart";
4 |
5 | import { VictoryTooltip } from "../../victory/victory-core";
6 |
7 | export default (props) => ([
8 | d.y)}
15 | labelComponent={}
16 | animate={{
17 | duration: 500,
18 | onLoad: {
19 | duration: 500
20 | }
21 | }}
22 | {...props}
23 | />
24 | ]);
25 |
--------------------------------------------------------------------------------
/src/themes/simple/composed-chart.js:
--------------------------------------------------------------------------------
1 | import React, { PropTypes } from "react";
2 |
3 | import { VictoryChart } from "../../victory/victory-chart";
4 |
5 | export default class ComposedWrapper extends React.Component {
6 | static propTypes = {
7 | children: PropTypes.node
8 | };
9 |
10 | render() {
11 | return {this.props.children};
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/themes/simple/composed-line.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import {
4 | VictoryLine,
5 | VictoryScatter,
6 | VictoryGroup,
7 | VictoryVoronoiTooltip
8 | } from "../../victory/victory-chart";
9 |
10 | import { VictoryTooltip } from "../../victory/victory-core";
11 |
12 | export default (props) => ([
13 |
14 |
28 |
45 | `${d.y}`}
48 | labelComponent={
49 |
53 | }
54 | />
55 |
56 | ]);
57 |
--------------------------------------------------------------------------------
/src/themes/simple/composed-pie.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { VictoryPie } from "../../victory/victory-pie";
4 |
5 | export default (props) => ([
6 |
15 | ]);
16 |
--------------------------------------------------------------------------------
/src/themes/simple/composed-scatter.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | import { VictoryScatter } from "../../victory/victory-chart";
4 |
5 | import { VictoryTooltip } from "../../victory/victory-core";
6 |
7 | export default (props) => ([
8 | d.y)}
18 | labelComponent={}
19 | animate={{
20 | duration: 500,
21 | onLoad: {
22 | duration: 500
23 | }
24 | }}
25 | />
26 | ]);
27 |
--------------------------------------------------------------------------------
/src/themes/simple/index.js:
--------------------------------------------------------------------------------
1 | import ComposedArea from "./composed-area";
2 | import ComposedAxis from "./composed-axis";
3 | import ComposedBar from "./composed-bar";
4 | import ComposedChart from "./composed-chart";
5 | import ComposedLine from "./composed-line";
6 | import ComposedPie from "./composed-pie";
7 | import ComposedScatter from "./composed-scatter";
8 |
9 | import theme from "./theme";
10 |
11 | export default {
12 | area: ComposedArea,
13 | axis: ComposedAxis,
14 | bar: ComposedBar,
15 | chart: ComposedChart,
16 | line: ComposedLine,
17 | pie: ComposedPie,
18 | scatter: ComposedScatter,
19 | theme
20 | };
21 |
--------------------------------------------------------------------------------
/src/themes/simple/theme.js:
--------------------------------------------------------------------------------
1 | // *
2 | // * Colors
3 | // *
4 | const colors = [
5 | "#4DD0E1",
6 | "#9575CD",
7 | "#FF6E40",
8 | "#00E676",
9 | "#80D8FF",
10 | "#FFEE58",
11 | "#FFA000",
12 | "#4CAF50",
13 | "#2979FF"
14 | ];
15 |
16 | const primary = "#333";
17 | // *
18 | // * Typography
19 | // *
20 | const sansSerif = "Futura, 'Trebuchet MS', Arial, sans-serif";
21 | const letterSpacing = "normal";
22 | const fontSize = 14;
23 | // *
24 | // * Layout
25 | // *
26 | const baseProps = {
27 | width: 450,
28 | height: 300,
29 | padding: 50,
30 | colorScale: colors
31 | };
32 | // *
33 | // * Labels
34 | // *
35 | const baseLabelStyles = {
36 | fontFamily: sansSerif,
37 | fontSize,
38 | letterSpacing,
39 | padding: 10,
40 | fill: primary,
41 | stroke: "transparent"
42 | };
43 |
44 | const centeredLabelStyles = { textAnchor: "middle", ...baseLabelStyles };
45 | // *
46 | // * Strokes
47 | // *
48 | const strokeLinecap = "round";
49 | const strokeLinejoin = "round";
50 |
51 | export default {
52 | area: {
53 | style: {
54 | data: {
55 | opacity: 0.85,
56 | fill: primary
57 | },
58 | labels: centeredLabelStyles
59 | },
60 | ...baseProps
61 | },
62 | axis: {
63 | style: {
64 | axis: {
65 | fill: "transparent",
66 | stroke: primary,
67 | strokeWidth: 1,
68 | strokeLinecap,
69 | strokeLinejoin
70 | },
71 | axisLabel: {
72 | ...centeredLabelStyles,
73 | padding: 25
74 | },
75 | grid: {
76 | fill: "transparent",
77 | stroke: "transparent",
78 | opacity: 0.25,
79 | strokeLinecap,
80 | strokeLinejoin
81 | },
82 | ticks: {
83 | fill: "transparent",
84 | padding: 10,
85 | size: 1,
86 | stroke: "transparent"
87 | },
88 | tickLabels: baseLabelStyles
89 | },
90 | ...baseProps
91 | },
92 | bar: {
93 | style: {
94 | data: {
95 | opacity: 0.85,
96 | fill: primary,
97 | padding: 10,
98 | stroke: "transparent",
99 | strokeWidth: 0,
100 | width: 8
101 | },
102 | labels: baseLabelStyles
103 | },
104 | ...baseProps
105 | },
106 | candlestick: {
107 | style: {
108 | data: {
109 | opacity: 0.85,
110 | stroke: primary,
111 | strokeWidth: 1
112 | },
113 | labels: centeredLabelStyles
114 | },
115 | candleColors: {
116 | positive: "#ffffff",
117 | negative: primary
118 | },
119 | ...baseProps
120 | },
121 | chart: {
122 | style: {
123 | parent: {
124 | background: "transparent"
125 | }
126 | },
127 | ...baseProps
128 | },
129 | errorbar: {
130 | style: {
131 | data: {
132 | opacity: 0.85,
133 | fill: "transparent",
134 | stroke: primary,
135 | strokeWidth: 2
136 | },
137 | labels: centeredLabelStyles
138 | },
139 | ...baseProps
140 | },
141 | group: {
142 | colorScale: colors,
143 | ...baseProps
144 | },
145 | line: {
146 | style: {
147 | data: {
148 | opacity: 0.85,
149 | fill: "transparent",
150 | stroke: primary,
151 | strokeWidth: 2
152 | },
153 | labels: {
154 | ...baseLabelStyles,
155 | textAnchor: "start"
156 | }
157 | },
158 | ...baseProps
159 | },
160 | pie: {
161 | style: {
162 | data: {
163 | opacity: 0.85,
164 | padding: 10,
165 | stroke: "transparent",
166 | strokeWidth: 1
167 | },
168 | labels: {
169 | ...baseLabelStyles,
170 | padding: 20
171 | }
172 | },
173 | colorScale: colors,
174 | width: 400,
175 | height: 400,
176 | padding: 50
177 | },
178 | scatter: {
179 | style: {
180 | data: {
181 | opacity: 0.85,
182 | fill: primary,
183 | stroke: "transparent",
184 | strokeWidth: 0
185 | },
186 | labels: centeredLabelStyles
187 | },
188 | ...baseProps
189 | },
190 | stack: {
191 | colorScale: colors,
192 | ...baseProps
193 | },
194 | tooltip: {
195 | padding: 10,
196 | style: {
197 | data: {
198 | fill: "transparent",
199 | stroke: "transparent",
200 | strokeWidth: 0
201 | },
202 | labels: centeredLabelStyles,
203 | flyout: {
204 | stroke: primary,
205 | strokeWidth: 1,
206 | fill: "#333333"
207 | }
208 | },
209 | flyoutProps: {
210 | cornerRadius: 2,
211 | pointerLength: 0
212 | }
213 | },
214 | voronoi: {
215 | style: {
216 | data: {
217 | fill: "transparent",
218 | stroke: "transparent",
219 | strokeWidth: 0
220 | },
221 | labels: centeredLabelStyles
222 | },
223 | ...baseProps
224 | }
225 | };
226 |
--------------------------------------------------------------------------------
/src/victory/victory-chart.android.js:
--------------------------------------------------------------------------------
1 | module.exports = require("victory-chart-native");
2 |
--------------------------------------------------------------------------------
/src/victory/victory-chart.ios.js:
--------------------------------------------------------------------------------
1 | export * from "victory-chart-native";
2 |
--------------------------------------------------------------------------------
/src/victory/victory-chart.js:
--------------------------------------------------------------------------------
1 | export * from "victory-chart";
2 |
--------------------------------------------------------------------------------
/src/victory/victory-core.android.js:
--------------------------------------------------------------------------------
1 | export * from "victory-core-native";
2 |
--------------------------------------------------------------------------------
/src/victory/victory-core.ios.js:
--------------------------------------------------------------------------------
1 | export * from "victory-core-native";
2 |
--------------------------------------------------------------------------------
/src/victory/victory-core.js:
--------------------------------------------------------------------------------
1 | export * from "victory-core";
2 |
--------------------------------------------------------------------------------
/src/victory/victory-pie.android.js:
--------------------------------------------------------------------------------
1 | export * from "victory-pie-native";
2 |
--------------------------------------------------------------------------------
/src/victory/victory-pie.ios.js:
--------------------------------------------------------------------------------
1 | export * from "victory-pie-native";
2 |
--------------------------------------------------------------------------------
/src/victory/victory-pie.js:
--------------------------------------------------------------------------------
1 | export * from "victory-pie";
2 |
--------------------------------------------------------------------------------
/test/.eslintrc:
--------------------------------------------------------------------------------
1 | ---
2 | extends: ../node_modules/builder-victory-component/config/eslint/.eslintrc-test
--------------------------------------------------------------------------------
/test/client/main.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Test setup for client-side tests.
3 | *
4 | * Intended for:
5 | * - Karma tests: `builder run test-frontend`
6 | * - Browser tests: `http://localhost:3000/test/client/test.html`
7 | */
8 | /*globals window:false*/
9 | const chai = require("chai");
10 | const sinonChai = require("sinon-chai");
11 |
12 | // --------------------------------------------------------------------------
13 | // Chai / Sinon / Mocha configuration.
14 | // --------------------------------------------------------------------------
15 | // Exports
16 | window.expect = chai.expect;
17 |
18 | // Plugins
19 | chai.use(sinonChai);
20 |
21 | // Mocha (part of static include).
22 | window.mocha.setup({
23 | ui: "bdd",
24 | bail: false,
25 | timeout: 5000
26 | });
27 |
28 | // --------------------------------------------------------------------------
29 | // Bootstrap
30 | // --------------------------------------------------------------------------
31 | // Use webpack to include all app code _except_ the entry point so we can get
32 | // code coverage in the bundle, whether tested or not.
33 | const srcReq = require.context("src", true, /\.js?$/);
34 | srcReq.keys().filter((d) => {
35 | return d.indexOf(".ios.") === -1 && d.indexOf(".android.") === -1;
36 | }).map(srcReq);
37 |
38 | // Use webpack to infer and `require` tests automatically.
39 | const testsReq = require.context(".", true, /\.spec.js?$/);
40 | testsReq.keys().map(testsReq);
41 |
42 | // Only start mocha in browser.
43 | if (!window.__karma__) {
44 | window.mocha.run();
45 | }
46 |
--------------------------------------------------------------------------------
/test/client/spec/components/victory-composed/victory-standalone.spec.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Client tests
3 | */
4 | /*eslint-disable max-nested-callbacks */
5 | /* eslint no-unused-expressions: 0 */
6 |
7 | import React from "react";
8 | import { mount } from "enzyme";
9 | import { Standalone } from "src";
10 |
11 | describe("components/formidable-charts", () => {
12 | describe("default component rendering", () => {
13 | it("renders an svg with the correct width and height", () => {
14 | const wrapper = mount(
15 |
16 | );
17 | const svg = wrapper.find("svg");
18 | expect(svg.prop("style").width).to.equal("100%");
19 | expect(svg.prop("style").height).to.equal("auto");
20 | });
21 |
22 | it("renders an svg with the correct viewBox", () => {
23 | const wrapper = mount(
24 |
25 | );
26 | const svg = wrapper.find("svg");
27 | const viewBoxValue =
28 | `0 0 ${450} ${300}`;
29 | expect(svg.prop("viewBox")).to.equal(viewBoxValue);
30 | });
31 | });
32 | });
33 |
--------------------------------------------------------------------------------
/test/client/test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Frontend Tests
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------