1
0
Fork 0

remove opinionated changes from react-components

This commit is contained in:
Enoch Riese 2023-06-06 13:24:20 -05:00
parent 1ea470aa87
commit 5905e999a1
4 changed files with 6 additions and 13 deletions

View file

@ -1,4 +1,4 @@
import { forwardRef } from 'react'
import React, { forwardRef } from 'react'
export const Group = forwardRef((props, ref) => (
<g {...props} ref={ref}>

View file

@ -1,4 +1,4 @@
import { forwardRef } from 'react'
import React, { forwardRef } from 'react'
// Components that can be swizzled
import { Svg as DefaultSvg } from './svg.mjs'
import { Defs as DefaultDefs } from './defs.mjs'

View file

@ -1,3 +1,5 @@
import React from 'react'
export const getProps = (obj) => {
/** I can't believe it but there seems to be no method on NPM todo this */
const cssKey = (key) => {
@ -36,16 +38,6 @@ export const getProps = (obj) => {
return props
}
export const dx = (pointA, pointB) => pointB.x - pointA.x
export const dy = (pointA, pointB) => pointB.y - pointA.y
export const rad2deg = (radians) => radians * 57.29577951308232
export const angle = (pointA, pointB) => {
let rad = Math.atan2(-1 * dy(pointA, pointB), dx(pointA, pointB))
while (rad < 0) rad += 2 * Math.PI
return rad2deg(rad)
}
export const withinPartBounds = (point, part) =>
point.x >= part.topLeft.x &&
point.x <= part.bottomRight.x &&