Pixela new feature announcements: Badge display mode supported!
Hello! I’m announcing a new release today! Pixela now supports badge
display mode!
You see badges in the GitHub README, right? Displays information in badge format based on data stored in Pixela. The label uses the unit of the graph definition.
Let me explain the specifications in more detail.
Typically, the 1 box (We call it pixel
) that makes up Pixela’s graph represents a day of data, but in badge mode, 1 box represents the sum of 7 days (a week). So, just by setting this badge, you can show some frequency about your activity in the last 49 days. The color depth is also measured in seven days, relative to the other six pixels.
As for how to create the badge, the steps to create the graph are the same as usual.
- Register user — POST — /v1/users
- Define the graph — POST — /v1/users/<username>/graphs
- Post a value — POST — /v1/users/<username>/graphs/<graphID>
- Define Webhook — POST — /v1/users/<username>/webhooks
- Increment / decrement with Webhook — POST — /v1/users/<username>/webhooks/<webhookHash>
Then, You can get a badge image to request your graph with a mode=badge
query string. https://pixe.la/v1/users/pixela/graphs/alert-index.svg?mode=badge
, like this.
In the GitHub README, you might want to write markdown like this:
# foobar project
## badges
[![pixela][pixela-badge]][pixela]
...
[pixela-badge]: https://pixe.la/v1/users/pixela/graphs/alert-index.svg?mode=badge
[pixela]: https://pixe.la/v1/users/pixela/graphs/alert-index.html
If you have an OSS repository, I would be happy if you try this feature!