-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat] Add scatter plot with fitted lines
- Loading branch information
Showing
27 changed files
with
1,609 additions
and
123 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Resizable } from "re-resizable"; | ||
|
||
export function ResizablePlotContainer({ | ||
children, | ||
}: { | ||
children: JSX.Element; | ||
}) { | ||
return ( | ||
<div className="w-full mt-4 mb-8"> | ||
<Resizable | ||
defaultSize={{ | ||
width: '100%', | ||
height: 280, | ||
}} | ||
minHeight={280} | ||
maxHeight={600} | ||
enable={{ bottom: true, bottomRight: true, right: false }} | ||
handleComponent={{ | ||
bottomRight: ( | ||
<div className="group absolute bottom-0 right-0 h-6 w-6 cursor-se-resize"> | ||
<div className="flex h-full w-full items-center justify-center transition-colors hover:bg-gray-100/10"> | ||
<svg | ||
width="12" | ||
height="12" | ||
viewBox="0 0 12 12" | ||
className="text-gray-300 group-hover:text-gray-400" | ||
> | ||
<path | ||
d="M11 6V11H6" | ||
stroke="currentColor" | ||
strokeWidth="2" | ||
fill="none" | ||
/> | ||
</svg> | ||
</div> | ||
</div> | ||
), | ||
}} | ||
> | ||
{children} | ||
</Resizable> | ||
</div> | ||
); | ||
} |
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,11 @@ | ||
/** | ||
* Formats a number to a more human-readable format, using compact notation | ||
* @param value The number to format | ||
* @returns The formatted number | ||
*/ | ||
export const numericFormatter = (value: number): string => { | ||
return Intl.NumberFormat('en-US', { | ||
notation: 'compact', | ||
maximumFractionDigits: 1, | ||
}).format(value); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export * from './histogram'; | ||
export * from './histogram-plot'; | ||
export * from './scatterplot'; | ||
export * from './common/resizable-container'; |
Oops, something went wrong.