remove opinionated changes from react-components
This commit is contained in:
parent
1ea470aa87
commit
5905e999a1
4 changed files with 6 additions and 13 deletions
|
@ -1,4 +1,4 @@
|
|||
import { forwardRef } from 'react'
|
||||
import React, { forwardRef } from 'react'
|
||||
|
||||
export const Group = forwardRef((props, ref) => (
|
||||
<g {...props} ref={ref}>
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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 &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue