From dc4a4d2f9a338e3d3560c514b0c97cb8bfea36b1 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Fri, 29 Sep 2017 13:03:48 -0400 Subject: Added axes to condition diagram --- app/helpers/pokeviewer/pokemon_helper.rb | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'app/helpers') diff --git a/app/helpers/pokeviewer/pokemon_helper.rb b/app/helpers/pokeviewer/pokemon_helper.rb index de2d815..f29fc35 100644 --- a/app/helpers/pokeviewer/pokemon_helper.rb +++ b/app/helpers/pokeviewer/pokemon_helper.rb @@ -52,9 +52,18 @@ module Pokeviewer [center_x + x_offset, center_y + y_offset] end - svg.polygon points: outline.map { |point| point * "," } * " ", class: "pkcv-outline" + svg.polygon( + points: outline.map { |point| point * "," } * " ", + class: "pkcv-outline") points = data.map do |c| + svg.line( + x1: center_x, + y1: center_y, + x2: center_x + radius * Math.cos(angle), + y2: center_y + radius * Math.sin(angle), + class: "pkcv-line") + datapoint = c[1] datapoint = 0.01 if datapoint < 1 datapoint /= 10.0 @@ -68,11 +77,13 @@ module Pokeviewer [center_x + x_offset, center_y + y_offset] end - svg.polygon points: points.map { |point| point * "," } * " ", class: "pkcv-data" + svg.polygon( + points: points.map { |point| point * "," } * " ", + class: "pkcv-data") tag.svg(svg.to_s.html_safe, - viewBox: "0 -30 410 430", - width: 410, + viewBox: "-80 -30 570 430", + width: 300, class: "pokemon-condition") end -- cgit 1.4.1