Skip to content

Commit

Permalink
Merge branch 'main' into ts-migrate/victory-native
Browse files Browse the repository at this point in the history
  • Loading branch information
KenanYusuf authored Jan 31, 2024
2 parents bcce09b + ddf9158 commit b538937
Show file tree
Hide file tree
Showing 82 changed files with 625 additions and 347 deletions.
34 changes: 0 additions & 34 deletions .changeset/brave-cycles-matter.md

This file was deleted.

6 changes: 3 additions & 3 deletions docs/src/content/introduction/native.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ scope: null

# Getting Started with Victory Native

> These docs are for the legacy versions of Victory Native. If you're looking for Victory Native XL docs, please [see here]
(https://formidable.com/open-source/victory-native/).
> These docs are for the legacy versions of Victory Native. Victory Native XL is our rewrite of Victory Native designed specifically for React Native. Please [see here for more information]
(https://formidable.com/open-source/victory-native/). If you would like to continue to use this version of Victory with React Native, follow the legacy guide below.

In this guide, we’ll show you how to get started with Victory Native and the React Native SVG dependency running in your React Native app for iOS and Android.

Expand All @@ -22,7 +22,7 @@ Victory Native is compatible with React Native 0.50 or higher.
To add Victory Native to your React Native app install `victory-native`.

```bash
$ yarn add victory-native # or npm install --save victory-native
$ yarn add victory-native@legacy # or npm install --save victory-native@legacy
```

#### 2. Add React Native SVG to your app
Expand Down
8 changes: 8 additions & 0 deletions packages/victory-area/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# victory-area

## 36.8.5

### Patch Changes

- Replace instances of lodash.assign with Object.assign ([#2757](https://github.com/FormidableLabs/victory/pull/2757))

* Replace instances of lodash.range with equivalent native code ([#2760](https://github.com/FormidableLabs/victory/pull/2760))

## 36.8.4

## 36.8.3
Expand Down
6 changes: 3 additions & 3 deletions packages/victory-area/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "victory-area",
"version": "36.8.4",
"version": "36.8.5",
"description": "Area Component for Victory",
"keywords": [
"data visualization",
Expand All @@ -22,8 +22,8 @@
"dependencies": {
"lodash": "^4.17.19",
"prop-types": "^15.8.1",
"victory-core": "^36.8.4",
"victory-vendor": "^36.8.4"
"victory-core": "^36.8.5",
"victory-vendor": "^36.8.5"
},
"peerDependencies": {
"react": ">=16.6.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/victory-area/src/victory-area.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { fireEvent, render, screen } from "@testing-library/react";
import { range } from "lodash";
import React from "react";
import { Area, VictoryArea, VictoryAreaProps } from "victory-area";
import { VictoryChart } from "victory-chart";
import { Helpers } from "victory-core";
import { curveCatmullRom } from "victory-vendor/d3-shape";
import { calculateD3Path } from "../../../test/helpers/svg";

Expand Down Expand Up @@ -115,7 +115,7 @@ describe("components/victory-area", () => {
scale: "linear",
interpolation: "linear",
sortKey: "x",
data: range(5)
data: Helpers.range(5)
// eslint-disable-next-line max-nested-callbacks
.map((i) => ({ x: i, y: i, y0: 0 }))
.reverse(),
Expand Down Expand Up @@ -145,7 +145,7 @@ describe("components/victory-area", () => {
interpolation: "linear",
sortKey: "x",
sortOrder: "descending",
data: range(5)
data: Helpers.range(5)
.map((i) => ({ x: i, y: i, y0: 0 }))
.reverse(),
};
Expand Down
6 changes: 6 additions & 0 deletions packages/victory-axis/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# victory-axis

## 36.8.5

### Patch Changes

- Replace instances of lodash.assign with Object.assign ([#2757](https://github.com/FormidableLabs/victory/pull/2757))

## 36.8.4

## 36.8.3
Expand Down
4 changes: 2 additions & 2 deletions packages/victory-axis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "victory-axis",
"version": "36.8.4",
"version": "36.8.5",
"description": "Axis Component for Victory",
"keywords": [
"data visualization",
Expand All @@ -22,7 +22,7 @@
"dependencies": {
"lodash": "^4.17.19",
"prop-types": "^15.8.1",
"victory-core": "^36.8.4"
"victory-core": "^36.8.5"
},
"peerDependencies": {
"react": ">=16.6.0"
Expand Down
8 changes: 8 additions & 0 deletions packages/victory-bar/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# victory-bar

## 36.8.5

### Patch Changes

- Replace instances of lodash.assign with Object.assign ([#2757](https://github.com/FormidableLabs/victory/pull/2757))

* Replace instances of lodash.range with equivalent native code ([#2760](https://github.com/FormidableLabs/victory/pull/2760))

## 36.8.4

## 36.8.3
Expand Down
6 changes: 3 additions & 3 deletions packages/victory-bar/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "victory-bar",
"version": "36.8.4",
"version": "36.8.5",
"description": "Bar Component for Victory",
"keywords": [
"data visualization",
Expand All @@ -22,8 +22,8 @@
"dependencies": {
"lodash": "^4.17.19",
"prop-types": "^15.8.1",
"victory-core": "^36.8.4",
"victory-vendor": "^36.8.4"
"victory-core": "^36.8.5",
"victory-vendor": "^36.8.5"
},
"peerDependencies": {
"react": ">=16.6.0"
Expand Down
21 changes: 12 additions & 9 deletions packages/victory-bar/src/victory-bar.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as React from "react";
import { render, fireEvent, screen } from "@testing-library/react";
import { range } from "lodash";
import { VictoryChart } from "victory-chart";
import { Bar, VictoryBar } from "victory-bar";
import { Helpers } from "victory-core";

import { isBar, getBarHeight } from "../../../test/helpers";

describe("components/victory-bar", () => {
Expand Down Expand Up @@ -70,14 +71,14 @@ describe("components/victory-bar", () => {

describe("rendering data", () => {
it("renders bars for {x, y} shaped data (default)", () => {
const data = range(10).map((i) => ({ x: i, y: i }));
const data = Helpers.range(10).map((i) => ({ x: i, y: i }));
const { container } = render(<VictoryBar data={data} />);
const bars = container.querySelectorAll("path");
expect(bars.length).toEqual(10);
});

it("renders ordered bars when sortKey is passed", () => {
const data = range(5)
const data = Helpers.range(5)
.map((i) => ({ x: i, y: i }))
.reverse();
const { container } = render(<VictoryBar data={data} sortKey="x" />);
Expand All @@ -94,7 +95,7 @@ describe("components/victory-bar", () => {
});

it("renders reverse ordered bars when sortOrder is descending", () => {
const data = range(5)
const data = Helpers.range(5)
.map((i) => ({ x: i, y: i }))
.reverse();
const { container } = render(
Expand All @@ -112,14 +113,16 @@ describe("components/victory-bar", () => {
});

it("renders bars for array-shaped data", () => {
const data = range(20).map((i) => [i, i]);
const data = Helpers.range(20).map((i) => [i, i]);
const { container } = render(<VictoryBar data={data} x={0} y={1} />);
const bars = container.querySelectorAll("path");
expect(bars).toHaveLength(20);
});

it("renders bars for deeply-nested data", () => {
const data = range(8).map((i) => ({ a: { b: [{ x: i, y: i }] } }));
const data = Helpers.range(8).map((i) => ({
a: { b: [{ x: i, y: i }] },
}));
const { container } = render(
<VictoryBar data={data} x="a.b[0].x" y="a.b[0].y" />,
);
Expand All @@ -128,7 +131,7 @@ describe("components/victory-bar", () => {
});

it("renders bars values with null accessor", () => {
const data = range(8);
const data = Helpers.range(8);
const { container } = render(
// @ts-expect-error "'null' is not assignable to 'x'"
<VictoryBar data={data} x={null} y={null} />,
Expand Down Expand Up @@ -249,14 +252,14 @@ describe("components/victory-bar", () => {

describe("accessibility", () => {
it("adds an aria role to each bar in the series", () => {
const data = range(10).map((y, x) => ({ x, y }));
const data = Helpers.range(10).map((y, x) => ({ x, y }));
render(<VictoryBar data={data} />);
const presentationElements = screen.getAllByRole("presentation");
expect(presentationElements).toHaveLength(11); // bars plus container
});

it("applies aria-label and tabIndex to the Bar primitive", () => {
const data = range(5, 11).map((y, x) => ({ y, x }));
const data = Helpers.range(5, 11).map((y, x) => ({ y, x }));
const { container } = render(
<VictoryBar
data={data}
Expand Down
6 changes: 6 additions & 0 deletions packages/victory-box-plot/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# victory-box-plot

## 36.8.5

### Patch Changes

- Replace instances of lodash.assign with Object.assign ([#2757](https://github.com/FormidableLabs/victory/pull/2757))

## 36.8.4

## 36.8.3
Expand Down
8 changes: 4 additions & 4 deletions packages/victory-box-plot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "victory-box-plot",
"version": "36.8.4",
"version": "36.8.5",
"description": "Box Plot Component for Victory",
"keywords": [
"data visualization",
Expand All @@ -22,15 +22,15 @@
"dependencies": {
"lodash": "^4.17.19",
"prop-types": "^15.8.1",
"victory-core": "^36.8.4",
"victory-vendor": "^36.8.4"
"victory-core": "^36.8.5",
"victory-vendor": "^36.8.5"
},
"peerDependencies": {
"react": ">=16.6.0"
},
"devDependencies": {
"victory-box-plot": "*",
"victory-chart": "^36.8.4"
"victory-chart": "^36.8.5"
},
"publishConfig": {
"provenance": true
Expand Down
6 changes: 6 additions & 0 deletions packages/victory-brush-container/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# victory-brush-container

## 36.8.5

### Patch Changes

- Replace instances of lodash.assign with Object.assign ([#2757](https://github.com/FormidableLabs/victory/pull/2757))

## 36.8.4

## 36.8.3
Expand Down
4 changes: 2 additions & 2 deletions packages/victory-brush-container/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "victory-brush-container",
"version": "36.8.4",
"version": "36.8.5",
"description": "Interactive Brush Component for Victory",
"keywords": [
"data visualization",
Expand All @@ -23,7 +23,7 @@
"lodash": "^4.17.19",
"prop-types": "^15.8.1",
"react-fast-compare": "^3.2.0",
"victory-core": "^36.8.4"
"victory-core": "^36.8.5"
},
"peerDependencies": {
"react": ">=16.6.0"
Expand Down
6 changes: 6 additions & 0 deletions packages/victory-brush-line/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# victory-brush-line

## 36.8.5

### Patch Changes

- Replace instances of lodash.assign with Object.assign ([#2757](https://github.com/FormidableLabs/victory/pull/2757))

## 36.8.4

## 36.8.3
Expand Down
4 changes: 2 additions & 2 deletions packages/victory-brush-line/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "victory-brush-line",
"version": "36.8.4",
"version": "36.8.5",
"description": "Interactive Brush Line Component for Victory",
"keywords": [
"data visualization",
Expand All @@ -23,7 +23,7 @@
"lodash": "^4.17.19",
"prop-types": "^15.8.1",
"react-fast-compare": "^3.2.0",
"victory-core": "^36.8.4"
"victory-core": "^36.8.5"
},
"peerDependencies": {
"react": ">=16.6.0"
Expand Down
8 changes: 8 additions & 0 deletions packages/victory-candlestick/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# victory-candlestick

## 36.8.5

### Patch Changes

- Replace instances of lodash.assign with Object.assign ([#2757](https://github.com/FormidableLabs/victory/pull/2757))

* Replace instances of lodash.range with equivalent native code ([#2760](https://github.com/FormidableLabs/victory/pull/2760))

## 36.8.4

## 36.8.3
Expand Down
8 changes: 4 additions & 4 deletions packages/victory-candlestick/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "victory-candlestick",
"version": "36.8.4",
"version": "36.8.5",
"description": "Candlestick Component for Victory",
"keywords": [
"data visualization",
Expand All @@ -22,14 +22,14 @@
"dependencies": {
"lodash": "^4.17.19",
"prop-types": "^15.8.1",
"victory-core": "^36.8.4"
"victory-core": "^36.8.5"
},
"peerDependencies": {
"react": ">=16.6.0"
},
"devDependencies": {
"victory-vendor": "^36.8.4",
"victory-chart": "^36.8.4",
"victory-vendor": "^36.8.5",
"victory-chart": "^36.8.5",
"victory-candlestick": "*"
},
"publishConfig": {
Expand Down
Loading

0 comments on commit b538937

Please sign in to comment.