From 29032076704a7e187c7c5ddd71a037fb62af6f12 Mon Sep 17 00:00:00 2001 From: Loewy Date: Tue, 9 Jan 2024 15:42:38 -0800 Subject: [PATCH] remove custom grid --- .env | 2 ++ App.tsx | 18 ------------------ component/custom-grid.tsx | 8 ++++---- 3 files changed, 6 insertions(+), 22 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..7e0a5f8 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +# .env.development +API_URI=https://api-dev.railbird.ai/graphql diff --git a/App.tsx b/App.tsx index efda426..6a47ac6 100644 --- a/App.tsx +++ b/App.tsx @@ -2,30 +2,12 @@ import React from "react"; import { Text } from "react-native"; import ClientProvider from "./graphql/client"; import ShotsContainer from "./component/shot"; -import { CustomGrid } from "./component/custom-grid"; - -import * as scale from 'd3-scale'; - -// TODO: restructure into object -const graphHeight = 300; -const innerGraphRowContainerPadding = 10; -const xAxisMarginTop = -15; -const topInset = 30; -const adjustedGraphHeight = graphHeight - innerGraphRowContainerPadding - xAxisMarginTop - topInset; - -// Usable for mock testing -const domain = [0, 140]; -const range = [adjustedGraphHeight, 30]; - -export const defaultTicks = [0, 20, 40, 60, 80, 100, 120, 140]; -export const defaultScaleLinear = scale.scaleLinear().domain(domain).range(range); const App: React.FC = () => { return ( test - ); }; diff --git a/component/custom-grid.tsx b/component/custom-grid.tsx index 45595f0..453f749 100644 --- a/component/custom-grid.tsx +++ b/component/custom-grid.tsx @@ -1,16 +1,16 @@ import React from 'react'; import { G, Line } from 'react-native-svg'; -import * as scale from 'd3-scale' +import { ScaleLinear } from 'd3-scale' import { colors } from '../styles'; -type scaleFunction = (value: number) => number; +type scaleFunction = ScaleLinear; interface CustomGridProps { y: scaleFunction; - ticks: number[]; + ticks: Array; } -export const CustomGrid: React.FC = ({ y, ticks }: Partial) => { +export const CustomGrid: React.FC = ({ y, ticks }) => { const [firstTick, ...remainingTicks] = ticks; const dashArray = [1, 3]; const strokeSolidWidth = 0.2;