dynamic-readme-elements

command module
v0.0.0-...-6f776b1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 2 Imported by: 0

README

Dynamic README Elements

This project provides a Go API using the Gin framework for generating customizable SVG progress bars, with options for both linear and circular styles.

Features

  • Linear Progress Bar: Generates a horizontal bar to visually represent progress. Customizable in size and fill percentage.
  • Circular Progress Bar: Creates a circular or "donut" style progress indicator. Size and progress fill are adjustable.
  • Waffle Progress Chart: Displays progress in a grid or 'waffle' format. Offers customization in grid size, square count, and filled percentage.
  • Calendar Progress Chart: Shows a monthly calendar view with specific days marked to indicate progress. Customizable by year, month, and progress days.

Getting Started

Prerequisites
  • Go (version 1.15 or later)
  • Gin web framework
Installation
  1. Clone the repository:
    git clone https://github.com/2ajoyce/dynamic-readme-elements.git
    
  2. Navigate to the project directory:
    cd dynamic-readme-elements
    
  3. Run the server:
    go run main.go
    

Usage

Generate SVG progress bars by accessing the endpoints with specific query parameters:

Linear Progress Bar
  • Endpoint: /progress/bar
  • Parameters: width, height, percentage
  • Example: http://localhost:8080/progress/bar?width=100&height=25&percentage=72

Linear Progress Bar

Circular Progress Bar
  • Endpoint: /progress/circle
  • Parameters: size, percentage
  • Example: http://localhost:8080/progress/circle?size=100&percentage=72

Circular Progress Bar

Waffle Progress Chart
  • Endpoint: /progress/waffle
  • Parameters: width, numberOfSquares,percentage
  • Example: http://localhost:8080/progress/waffle?width=100&numberOfSquares=114&percentage=72

Waffle Progress Chart

Calendar Progress Chart
  • Endpoint: /calendar
  • Parameters: year, month, progressDays (optional; comma-separated list of days)
  • Default: Defaults to the current year and month if not provided.
  • Example: http://localhost:8080/calendar?year=2023&month=1&progressDays=2,15,20

Calendar Progress Chart

Customization

Each progress indicator type offers specific customization options through query parameters:

  • Linear Progress Bar: Adjust the width, height, and percentage to control the bar's dimensions and progress.
  • Circular Progress Bar: Modify the size for the diameter and percentage for progress representation.
  • Waffle Progress Chart: Change the width to control the overall size, numberOfSquares for grid density, and percentage for filled squares.
  • Calendar Progress Chart: Set year, month, and optionally progressDays to display progress on specific days of a month.

Acknowledgments

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL