
Security News
Nx npm Packages Compromised in Supply Chain Attack Weaponizing AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Like this :
Or without progression state :
It can be used alone, or in Rails (tested in 4.0.4) as a view helper.
pill_chart
to your Gemfile (by adding this line: gem 'pill_chart', '~> 1.0.2'
)bundle install
into your terminal, on your rails project directoryhtml_safe
)# It will draw a simple pill, filled to `value`.
draw_pill_chart(height: 10, width: 60, value: 33, max: 100, colors: {})
# It will draw a stated pill (the color changes with the value), filled to `value`.
draw_state_pill_chart(height: 10, width: 60, value: 33, max: 100, colors: {})
Draw a simple pill at 33% ( ) in a Rails view:
<%= draw_pill_chart(width: 60, value: 33).html_safe %>
Draw a state pill at 70% ( ) in a Rails view:
<%= draw_state_pill_chart(width: 60, value: 70).html_safe %>
The max
parameter represents the maximum value.
For example, a value of 60
and a max of 120
will fill the half of the pill.
You can pass custom colors in a hash to the colors
parameter.
The color's default values are :
colors = {
"background" => "#eee", # the background colour
"foreground" => "#999", # the pill color when it's a simple pill (not a state pill)
"low" => "#AD6D6D", # the pill color under 20% when it's a state pill
"medium" => "#C59663", # the pill color between 20 and 40% when it's a state pill
"high" => "#ADC563", # the pill color between 40 and 70% when it's a state pill
"full" => "#92C447" # the pill color between 70 and 100% when it's a state pill
}
# Create a new SimplePillChart object, with theses parameters
elt = PillChart::SimplePillChart.new(height, width, value, max, :simple, colors)
# Run the pill method to generate the svg content
elt.pill
FAQs
Unknown package
We found that pill_chart demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.