Skip to content

Instantly share code, notes, and snippets.

@lenagroeger
Created August 28, 2012 19:04
Show Gist options
  • Save lenagroeger/3502514 to your computer and use it in GitHub Desktop.
Save lenagroeger/3502514 to your computer and use it in GitHub Desktop.
generating start dates for bars on a horizontal timeline
data.each do |row|
el=<<-HTML
<div class="drones-bar" style="width:#{(row["duration"].to_f/5)}px; margin-left: #{(row["days_from_start"].to_f/5)}px;" data-id="#{row["number"]}"><p class="deaths"><a href="#{row["link"]}">"#{row["deaths"]}"</a></p></div>
HTML
html << el
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment