Skip to content

Commit

Permalink
merge both compute value
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette committed Sep 17, 2024
1 parent 460cf5f commit e665a1e
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 203 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { useZoom } from '../ZoomProvider/useZoom';
import { createAxisFilterMapper, createGetAxisFilters } from './createAxisFilterMapper';

const { computeValue } = cartesianProviderUtils;
const { computeAxisValue } = cartesianProviderUtils;

export interface CartesianProviderProProps extends CartesianProviderProps {}

Expand Down Expand Up @@ -66,7 +66,7 @@ function CartesianProviderPro(props: CartesianProviderProProps) {

const xValues = React.useMemo(
() =>
computeValue({
computeAxisValue({
drawingArea,
formattedSeries,
axis: xAxis,
Expand All @@ -81,7 +81,7 @@ function CartesianProviderPro(props: CartesianProviderProProps) {

const yValues = React.useMemo(
() =>
computeValue({
computeAxisValue({
drawingArea,
formattedSeries,
axis: yAxis,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react';
import { useDrawingArea } from '../../hooks/useDrawingArea';
import { useSeries } from '../../hooks/useSeries';
import { CartesianContext } from './CartesianContext';
import { computeValue } from './computeValue';
import { computeAxisValue } from '../computeAxisValue';
import { useXExtremumGetter } from '../PluginProvider/useXExtremumGetter';
import { useYExtremumGetter } from '../PluginProvider';
import { CartesianProviderProps } from './Cartesian.types';
Expand All @@ -18,7 +18,7 @@ function CartesianProvider(props: CartesianProviderProps) {

const xValues = React.useMemo(
() =>
computeValue({
computeAxisValue({
drawingArea,
formattedSeries,
axis: xAxis,
Expand All @@ -30,7 +30,7 @@ function CartesianProvider(props: CartesianProviderProps) {

const yValues = React.useMemo(
() =>
computeValue({
computeAxisValue({
drawingArea,
formattedSeries,
axis: yAxis,
Expand Down
4 changes: 2 additions & 2 deletions packages/x-charts/src/context/CartesianProvider/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { computeValue } from './computeValue';
import { computeAxisValue } from '../computeAxisValue';

export * from './CartesianProvider';
export * from './CartesianContext';
export * from './useCartesianContext';
export * from './Cartesian.types';

const cartesianProviderUtils = {
computeValue,
computeAxisValue,
};

export { cartesianProviderUtils };
6 changes: 3 additions & 3 deletions packages/x-charts/src/context/PolarProvider/PolarProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from 'react';
import { useDrawingArea } from '../../hooks/useDrawingArea';
import { useSeries } from '../../hooks/useSeries';
import { PolarContext } from './PolarContext';
import { computeValue } from './computeValue';
import { computeAxisValue } from '../computeAxisValue';
import { useRadiusExtremumGetter } from '../PluginProvider/useRadiusExtremumGetter';
import { useRotationExtremumGetter } from '../PluginProvider/useRotationExtremumGetter';
import { PolarProviderProps } from './Polar.types';
Expand All @@ -18,7 +18,7 @@ function PolarProvider(props: PolarProviderProps) {

const rotationValues = React.useMemo(
() =>
computeValue({
computeAxisValue({
drawingArea,
formattedSeries,
axis: rotationAxis,
Expand All @@ -30,7 +30,7 @@ function PolarProvider(props: PolarProviderProps) {

const radiusValues = React.useMemo(
() =>
computeValue({
computeAxisValue({
drawingArea,
formattedSeries,
axis: radiusAxis,
Expand Down
168 changes: 0 additions & 168 deletions packages/x-charts/src/context/PolarProvider/computeValue.ts

This file was deleted.

Empty file.
Loading

0 comments on commit e665a1e

Please sign in to comment.