-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(circle-packing): add support for custom circle component to SVG …
…and HTML implementations
- Loading branch information
Showing
13 changed files
with
184 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/circle-packing/src/ResponsiveCirclePackingHtml.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react' | ||
import { ResponsiveWrapper } from '@nivo/core' | ||
import { CirclePackingHtmlProps } from './types' | ||
import { CirclePackingHtml } from './CirclePackingHtml' | ||
|
||
type ResponsiveCirclePackingHtmlProps<RawDatum> = Partial< | ||
Omit<CirclePackingHtmlProps<RawDatum>, 'data' | 'width' | 'height'> | ||
> & | ||
Pick<CirclePackingHtmlProps<RawDatum>, 'data'> | ||
|
||
export const ResponsiveCirclePackingHtml = <RawDatum,>( | ||
props: ResponsiveCirclePackingHtmlProps<RawDatum> | ||
) => ( | ||
<ResponsiveWrapper> | ||
{({ width, height }: { width: number; height: number }) => ( | ||
<CirclePackingHtml<RawDatum> width={width} height={height} {...props} /> | ||
)} | ||
</ResponsiveWrapper> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.