Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Odds/Probability Visualizer
#1
Ok so I don't really play the lottery but my uncle does, and I like to see odds/probability of different results.

I share the odds and before making this SIMPLE javascript tool, I would do the math myself with google calculator (just from the search bar) to figure out square size and then draw based on that in GIMP and add my own text to label it.

But then I thought I might do this more often in the future posting to forums so I thought to make this tool.

I just have to enter the odds (can be floats/decimals).
And it calculates the size to draw on javascript/html canvas for me.

First version just drew squares of predetermined colors.
But I have updated it a few times since then
and now it allows you to enter colors of your choice and description and displays the odds too.

I like it.
Then I can save the image and post like below
   

Here's the tool: tindoductran.github.io/visual-odds.html
What do you think? if anything?
Reply
#2
(06-04-2025, 10:29 PM)trandoductin Wrote: Ok so I don't really play the lottery but my uncle does, and I like to see odds/probability of different results.

I share the odds and before making this SIMPLE javascript tool, I would do the math myself with google calculator (just from the search bar) to figure out square size and then draw based on that in GIMP and add my own text to label it. 

But then I thought I might do this more often in the future posting to forums so I thought to make this tool, kind of the same way I sometimes explore useful online services where I learn more about handling payments and other tools.


I just have to enter the odds (can be floats/decimals).
And it calculates the size to draw on javascript/html canvas for me.

First version just drew squares of predetermined colors.
But I have updated it a few times since then
and now it allows you to enter colors of your choice and description and displays the odds too.

I like it.
Then I can save the image and post like below
[/url]

Here's the tool: [url=https://tindoductran.github.io/visual-odds.html]tindoductran.github.io/visual-odds.html

What do you think? if anything?
Looks neat! One thing I noticed is that nesting a smaller square inside a bigger one can skew how people read the odds a side by side layout or a 100x100 frequency grid usually makes it clearer. Would also be cool if the tool could accept 1 in N, %, or fractions and normalize them automatically, maybe even add a slider for at least once in k tries. And since you’re already drawing on canvas, exporting to SVG, or scaling PNGs by devicePixelRatio, would keep the images sharp. A color blind friendly palette plus a tiny Monte Carlo sprinkle overlay could make the odds more intuitive at a glance
Reply
#3
The odds are 1 in 8.3  in the OP. I don't understand why you need to visualize this fact? Just buy 9 plays and win? Then spend it on something and you will not have to visualize anything Smile
Reply


Forum Jump: