FormidableLabs/victory

Name: victory

Owner: Formidable

Description: A collection of composable React components for building interactive data visualizations

Created: 2015-07-02 22:36:50.0

Updated: 2018-01-18 08:57:42.0

Pushed: 2018-01-16 23:02:17.0

Homepage: http://formidable.com/open-source/victory/

Size: 12508

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Travis Status Join the chat at https://gitter.im/FormidableLabs/victory

Victory

an ecosystem of composable React components for building interactive data visualizations.

animation

Getting started
  1. Add Victory to your project:

    m install victory --save
    
  2. Add your first Victory component:

    rt React, { Component } from 'react';
    rt { render } from 'react-dom';
    rt { VictoryPie } from 'victory';
    
    s PieChart extends Component {
    er() {
    turn (
    <VictoryPie />
    
    
    
    
    er(<PieChart />, document.getElementById('app'));
    
  3. VictoryPie component will be rendered, and you should see:

pie

Requirements

Projects using Victory should also depend on React and prop-types.

Victory Native

Want to use Victory with React Native? Check out victory-native Victory Native shares most of its code with Victory, and has a nearly identical api!

Contributing

The victory repo aggregates stable victory components that are developed in other repos. The victory repo is only updated with new releases, but the following repos are under very active development.

victory-core victory-chart victory-pie

Please review our Code of Conduct before contributing.

For a detailed contribution guide, please see CONTRIBUTING in the project builder archetype.

one the Victory repo
t clone git@github.com:FormidableLabs/victory.git
 victory

n the demo app server
m start

en the demo app
en http://localhost:3000

n checks (lint and tests)
m test
Multi-repo development

Victory uses lank for multi-repo development. Use a lank workflow to test changes in victory dependencies. Here's an example of setting up lank to test changes in victory-core from victory-chart

First, make sure that all of your Victory repos are siblings in the same directory

stall lank globally
m install -g lank

Victory repos are already configured with appropriate .lankrc and lank scripts. To test changes in victory-core from victory-chart:

n all commands from the root of `victory-chart`
 victory-chart

n `lank link` to remove `victory-core` from node_modules
nk link

tch for changes to lanked repos. Leave this process running in its own terminal window
m run lank-watch

n a dev server with your lanked repos. In a new terminal window...
m run lank-run

Refresh your browser to pick up changes.

For more on the development environment, see DEVELOPMENT in the project builder archetype.

Important

This project is in alpha release. We're hard at work fixing bugs and improving the API. Be prepared for breaking changes!

SEMVER Minor version bumps should be considered breaking changes until we hit v1.0.0. Patches can be considered safe.

Caveats git installs using npm 2 may fail in postinstall. If you are consuming Victory via git installs please use npm >=3.0.0

Issues
Jest Snapshots

If you want to use Jest snapshot testing with Victory, you may encounter a problem where the Jest snapshot changes every time, due to a randomly generated clipId being used for a VictoryClipContainer group component. The solution to this is to set a static clipId on your VictoryClipContainer.

For example, when creating a VictoryLine component, you can pass a groupComponent prop:

toryLine
oupComponent={<VictoryClipContainer clipId={1} />}

Now the clipId attached to your VictoryLine component will always be the same, and your snapshot will not change with each test run.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.