Coder Social home page Coder Social logo

krissalvador27 / victory Goto Github PK

View Code? Open in Web Editor NEW

This project forked from formidablelabs/victory

0.0 2.0 0.0 12.5 MB

A collection of composable React components for building interactive data visualizations

Home Page: http://formidable.com/open-source/victory/

License: MIT License

JavaScript 93.67% HTML 6.33%

victory's Introduction

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:
$ npm install victory --save
  1. Add your first Victory component:
import React, { Component } from 'react';
import { render } from 'react-dom';
import { VictoryPie } from 'victory';

class PieChart extends Component {
  render() {
    return (
      <VictoryPie />
    );
  }
}

render(<PieChart />, document.getElementById('app'));
  1. 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.

# Clone the Victory repo
$ git clone [email protected]:FormidableLabs/victory.git
$ cd victory

# Run the demo app server
$ npm start

# Open the demo app
$ open http://localhost:3000

# Run checks (lint and tests)
$ npm 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

# Install lank globally
$ npm install -g lank

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

# Run all commands from the root of `victory-chart`
$ cd victory-chart

# Run `lank link` to remove `victory-core` from node_modules
$ lank link

# Watch for changes to lanked repos. Leave this process running in its own terminal window
$ npm run lank-watch

# Run a dev server with your lanked repos. In a new terminal window...
$ npm 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:

<VictoryLine
  groupComponent={<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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.