Skip to content

Commit

Permalink
feat(circle-packing): expose hooks to be able to build fully custom c…
Browse files Browse the repository at this point in the history
…harts
  • Loading branch information
plouc authored and wyze committed Apr 26, 2021
1 parent 6f8a4ca commit 03433b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/circle-packing/src/CircleSvg.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { animated } from 'react-spring'
import { CircleProps } from './types'
import { useBoundMouseHandlers } from './hooks'
import { useNodeMouseHandlers } from './hooks'

export const CircleSvg = <RawDatum,>({
node,
Expand All @@ -11,7 +11,7 @@ export const CircleSvg = <RawDatum,>({
onMouseLeave,
onClick,
}: CircleProps<RawDatum>) => {
const handlers = useBoundMouseHandlers<RawDatum>(node, {
const handlers = useNodeMouseHandlers<RawDatum>(node, {
onMouseEnter,
onMouseMove,
onMouseLeave,
Expand Down
2 changes: 1 addition & 1 deletion packages/circle-packing/src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export const useCirclePackingLabels = <RawDatum>({
}, [labels, filter])
}

export const useBoundMouseHandlers = <RawDatum>(
export const useNodeMouseHandlers = <RawDatum>(
node: ComputedDatum<RawDatum>,
{ onMouseEnter, onMouseMove, onMouseLeave, onClick }: MouseHandlers<RawDatum>
): Partial<
Expand Down
1 change: 1 addition & 0 deletions packages/circle-packing/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export * from './CirclePackingCanvas'
export * from './ResponsiveCirclePackingCanvas'
export * from './types'
export * from './props'
export * from './hooks'

0 comments on commit 03433b0

Please sign in to comment.