Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Victory is a collection of composable React components for building interactive data visualizations. It provides a wide range of chart types and is designed to be highly customizable and easy to use.
Line Chart
Victory allows you to create line charts easily. The code sample demonstrates how to create a simple line chart using VictoryLine and VictoryChart components.
const data = [
{ x: 1, y: 2 },
{ x: 2, y: 3 },
{ x: 3, y: 5 },
{ x: 4, y: 4 },
{ x: 5, y: 7 }
];
<VictoryChart>
<VictoryLine data={data} />
</VictoryChart>
Bar Chart
Victory makes it simple to create bar charts. The code sample shows how to create a bar chart using VictoryBar and VictoryChart components.
const data = [
{ x: 'A', y: 2 },
{ x: 'B', y: 3 },
{ x: 'C', y: 5 },
{ x: 'D', y: 4 },
{ x: 'E', y: 7 }
];
<VictoryChart>
<VictoryBar data={data} />
</VictoryChart>
Pie Chart
VictoryPie component allows you to create pie charts. The code sample demonstrates how to create a pie chart with different categories.
const data = [
{ x: 'Cats', y: 35 },
{ x: 'Dogs', y: 40 },
{ x: 'Birds', y: 25 }
];
<VictoryPie data={data} />
Scatter Plot
VictoryScatter component is used to create scatter plots. The code sample shows how to create a scatter plot using VictoryScatter and VictoryChart components.
const data = [
{ x: 1, y: 2 },
{ x: 2, y: 3 },
{ x: 3, y: 5 },
{ x: 4, y: 4 },
{ x: 5, y: 7 }
];
<VictoryChart>
<VictoryScatter data={data} />
</VictoryChart>
Recharts is a Redefined chart library built with React and D3. It provides a set of composable chart components that are easy to use and highly customizable. Compared to Victory, Recharts has a more extensive set of chart types and is known for its performance and ease of integration.
Nivo provides a rich set of dataviz components, built on top of D3 and React. It offers a wide range of chart types and is highly customizable. Nivo is known for its beautiful and responsive charts, and it provides a variety of themes and styles out of the box. Compared to Victory, Nivo offers more advanced features and better aesthetics.
React wrapper for Chart.js, a popular JavaScript charting library. It provides a simple way to create charts using Chart.js in React applications. Compared to Victory, react-chartjs-2 is more lightweight and leverages the powerful Chart.js library for rendering charts.
$ npm install victory --save
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"));
VictoryPie
component will be rendered, and you should see:
For detailed documentation and examples please see Victory Documentation
Projects using Victory should also depend on React and prop-types.
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!
36.4.0 (2022-05-10)
Added the ability to add victory charts title and desc props for better accessibility by @shankstee in https://github.com/FormidableLabs/victory/pull/2199
Bump axios from 0.19.2 to 0.21.2 in /docs by @dependabot in https://github.com/FormidableLabs/victory/pull/2188
Bump cross-fetch from 3.1.4 to 3.1.5 by @dependabot in https://github.com/FormidableLabs/victory/pull/2206
add style interface to SliceProps type by @heythisispaul in https://github.com/FormidableLabs/victory/pull/2212
Add jest and react testing library tests for victory-line and victory-area by @becca-bailey in https://github.com/FormidableLabs/victory/pull/2196
fix typos in scale prop documentation by @heythisispaul in https://github.com/FormidableLabs/victory/pull/2218
Bump cross-fetch from 3.1.4 to 3.1.5 by @dependabot in https://github.com/FormidableLabs/victory/pull/2213
Bump cross-fetch from 3.1.4 to 3.1.5 in /demo/rn by @dependabot in https://github.com/FormidableLabs/victory/pull/2207
add box plot jest/rtl tests by @heythisispaul in https://github.com/FormidableLabs/victory/pull/2225
jest and rtl unit tests for bar components by @heythisispaul in https://github.com/FormidableLabs/victory/pull/2216
Add victory-vendor package for d3 dependencies by @becca-bailey in https://github.com/FormidableLabs/victory/pull/2204
Vendor in d3 libraries to new package victory-vendor
and upgrade. Our CommonJS path now uses transpiled versions of the d3-*
libraries while our ESM path continues to use the real underlying dependencies.
import <name> from "victory-<pkg>"
.FAQs
Data viz for React
The npm package victory receives a total of 47,578 weekly downloads. As such, victory popularity was classified as popular.
We found that victory demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 20 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.