shoes / shoes3

a tiny graphical app kit for ruby
http://walkabout.mvmanila.com
Other
181 stars 19 forks source link

Radar/Spider/Net Charts #288

Closed ccoupe closed 7 years ago

ccoupe commented 8 years ago

Here's the latest view on radar charts. Just draws the radial axes and the label of max value of that column. It draws the label poorly but we talk about 'better' after the image. radar-2

In gruft and other source code I've looked at, our chart_series is equivalent to a row and the value inside the rows are columns. Radar and the like, like to draw/compute down columns. Shoes currently has no API to specify some things for that orientation that users might find useful. In the example above, the labels shown are the computed max (down the columns) but before we can scale and and draw some data points and connected lines, they need to be scaled between min and max. What's the value at the center for each? Compute min? 0? Something else? Can it be specified by the user and if so, how?

IanTrudel commented 8 years ago

for (i = max-1; i >=0; i--) seems to be correct.

IanTrudel commented 8 years ago

What is label_radius ? It seems to mean label margin, as in the margin around the label, which would be consistent with other Shoes styling names.

ccoupe commented 8 years ago

Read the commit comment . It is not a margin (measured in pixels). It's subtle and debatable which is better - a radius* multiplier or a radius+margin. I'm fairly certain that people that need this tweaking of position can handle a multiplier. Using a margin would on depend their font choice size (a future feature it we keep digging deeper and deeper) Inconvenient. Drawing a larger chart size would require tweaking of label_radius to get them where wanted, Inconvenient.

Perhaps we can have both with a few extra days of work.. At the moment, I'd prefer to ship something soon, and find out if anyone cares enough to complain with practical usage.

IanTrudel commented 8 years ago

I did read the commit comment but it only made sense after you explain it here. Always some concern about future backward compatibility and naming convention but label_radius could do for now.

It should be noted that we should have a label_margin in the future that is actually independent of chart size as you mention larger chart means tweaking label_radius. It could be inconvenient if one simply maximize a window, Shoes code redrawing bigger but then also need to adjust label_radius.

At the moment, I'd prefer to ship something soon, and find out if anyone cares enough to complain with practical usage.

Agreed.

ccoupe commented 8 years ago

Updated the wiki. Getting everything into the manual will be challenge.

IanTrudel commented 8 years ago

Updated the wiki.

The wiki page is very good.

Getting everything into the manual will be challenge.

Maybe someday #213 will see the day of light and we can use markdown directly, where wiki and manual will be totally compatible. 🍔

ccoupe commented 8 years ago

Considering, #293, it would be nice if we did have the e-book thing. We can get more a modern mingw for Windows so we can get better full_text gem, if we give up RubyInstaller /devkit compatibility. RubyInstaller is a pretty low key project.

We've got to face Ruby 2.3 and ruby 2.4 changes at the C level and the relentless march of updated dependent libraries. Probably Shoes 3.3.3.

IanTrudel commented 8 years ago

Considering, #293, it would be nice if we did have the e-book thing.

I've been busy and no free time to work on this. It's actually not overly difficult. Though some concerns about the Picky: it is working well but not actively maintained. One of the many problems with so many API these days, isn't it?

We can get more a modern mingw for Windows so we can get better full_text gem, if we give up RubyInstaller /devkit compatibility. RubyInstaller is a pretty low key project.

My understanding is that RubyInstaller has alternatives as far as using Ruby goes but it is the only one to provide a fully working devkit on Windows. It would come to sense that if we would not rely on RubyInstaller Devkit, we come with a solution that can survive us, ensuring Shoes future (or at least easy for anyone to pick up where Shoes will be left off).

If you feel strongly against RubyInstaller, open an issue and let's talk about pros, cons, and potential solutions.

ccoupe commented 8 years ago

Actually, there is an earlier about Rubyinstaller, #281.

dredknight commented 7 years ago

Here is a fun custom chart that I did by using progress bar. Is there a way to make progress bar go vertical instead of horizontal?

Shoes.app do

    def bar bar, dif
        anim=every(0.025) do |count|
            bar.fraction=count*(dif/(20-(15-0.75*count)))
            count == 20 ? anim.stop : nil
        end
    end

    flow width: 30, height: 200 do
        subtitle "Y", top: 90
    end
    for i in 0..9 do
        bar ( progress left: 30, top: 20+20*i, width: 150, height: 5 ), (rand(100).to_f/100)
    end
    stack top: 200, left: 0, width: 200 do
        subtitle "X", align: "center"
    end
end
passenger94 commented 7 years ago

Yes !! Cool !! No vertical progress bar that i'm aware of but you can probably create some funky ones from scratch with shapes for example

IanTrudel commented 7 years ago

@dredknight very nice sample!

What do you need vertical progress bar for? If you feel strongly about it, open a new issue with a detailed description and tag it with enhancement. Otherwise you may give a try to @passenger94 's idea. Shouldn't be too hard - it's a box in a box. :)))

dredknight commented 7 years ago

Thanks @BackOrder and @passenger94 ! I was just messing with it nothing too special for the moment. I will definitely check the forms sometimes.

ccoupe commented 7 years ago

Closed in Shoes 3.3.2