
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
commit-graph
Advanced tools
The Commit Graph package is a React component designed to visualize commit graphs in an interactive and informative way, showcasing commit history within a repository. This package supports dynamic loading and visualization of commit history, including features like pagination to manage large datasets efficiently.
CommitGraph
is utilized by DoltHub to visualize database commit log histories.
Install the Commit Graph package via npm:
npm install commit-graph
To use the CommitGraph component in your React application, import it and pass your commit and branch head data as props:
import React from "react";
import CommitGraph from "commit-graph";
const MyComponent = () => {
// Your commit and branch head data arrays
const commits = [
{
hash: 'commit-hash',
ownerName: 'repository-owner',
repoName: 'repository-name',
committer:
{
displayName: 'committer-displayName',
}
message: 'commit-message',
parents: ['parent-commit-hash-1', 'parent-commit-hash-2'],
committedAt: timestamp,
commitLink: 'https://github.com/repository-owner/repository-name/main/commit-hash',
}
];
const branchHeads = [
{
branchName: "branch-name-1",
headCommitHash: "commit-hash-1",
},
{
branchName: "branch-name-2",
headCommitHash: "commit-hash-2",
branchLink:"https://github.com/repository-owner/repository-name/main",
},
];
return (
<CommitGraph
commits={commits}
branchHeads={branchHeads}
graphStyle={{
commitSpacing: 50,
branchSpacing: 20,
branchColors: ["#FF0000", "#00FF00", "#0000FF"],
nodeRadius: 2,
}}
/>
);
};
export default MyComponent;
The CommitGraph
component accepts the following props:
commits
(array)An array of commit objects representing the commit history. Each commit object should have the following properties:
hash
(string): The unique hash identifier of the commit.ownerName
(string): The name of the repository owner.repoName
(string): The name of the repository.committer
(object): The person who made the commit, it has following properties:
username
(string)displayName
(string)emailAddress
(string)message
(string): The commit message.parents
(array of strings): An array of commit hashes representing the parent commits.committedAt
(timestamp): The timestamp when the commit was made.commitLink
(string, optional): the external link to the commit.branchHeads
(array)An array of branch head objects representing the branch heads in the commit graph. Each branch head object should have the following properties:
branchName
(string): The name of the branch.headCommitHash
(string): The commit hash at the head of the branch.branchLink
(string, optional): The link to the branch.graphStyle
(object, optional)An optional object specifying the styling options for the commit graph. The graphStyle
object should have the following properties:
commitSpacing
(number): The vertical spacing between commits.branchSpacing
(number): The horizontal spacing between branches.branchColors
(array of strings): An array of colors to be used for different branches. Default: ['#FF0000', '#00FF00', '#0000FF']
.nodeRadius
(number): The radius of the commit node circles.CommitGraph
supports dynamic data loading and can seamlessly integrate with pagination libraries such as react-infinite-scroller
for efficient handling of large commit histories. Here's an example of how to implement pagination with CommitGraph
:
First, install react-infinite-scroller
:
npm install react-infinite-scroller
Then, you can integrate InfiniteScroll with CommitGraph in your component:
import React from "react";
import { CommitGraph } from "commit-graph";
import InfiniteScroll from "react-infinite-scroller";
<InfiniteScroll
loadMore={async () => loadMore()}
hasMore={ hasMore}
useWindow={false}
initialLoad={false}
loader={
<div>
Loading graph...
</div>
}
getScrollParent={() => document.getElementById("main-content")}
>
<CommitGraph
commits={commits}
branchHeads={branchHeads}
/>
</InfiniteScroll>;
Explore the Commit Graph component and its features by running storybook:
npm run storybook
[1.7.0] -- 2024-03-04
-- Bump Dependencies
FAQs
A React component to visualize a commit graph.
The npm package commit-graph receives a total of 370 weekly downloads. As such, commit-graph popularity was classified as not popular.
We found that commit-graph demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.