Skip to content

cljfx/exploration-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exploration template for playing with cljfx

This is a simple setup that aims to lure you into the depths make it easy to start using cljfx. Just clone it, boot up a repl and start hacking!

Cloning

git clone https://github.com/cljfx/exploration-template.git cljfx-exploration
cd cljfx-exploration

Booting up a repl

If leiningen is your tool of choice for Clojure, you can use your favorite editor/IDE to jack in using provided project.clj. If you prefer clj, you can use provided deps.edn.

Starting hacking

Open src/cljfx/exploration.clj file and evaluate it: it will open a window managed by cljfx using state in an atom. You can use (fx-help) (see comments at the bottom of the file) to learn a bit more about cljfx/javafx.

Useful links

Exploration idea

If you don't have anything in particular in mind, you could try building an app that generates a sequence of random numbers and shows them as a line chart:

  1. Add a :button with a :text and :on-action handler that puts a sequence of random numbers to state atom;
  2. Add a chart that shows this sequence of random numbers (see chart examples);

You can use layout containers like :v-box or :h-box to place UI elements like charts and buttons next to each other.

For extra points, instead of a button that generates series of random numbers you can use a text field to input a number and generate Collatz Conjecture sequence from that number. The Collatz Conjecture can be summarized as follows:

Take any positive integer n. If n is even, divide n by 2. If n is odd, multiply n by 3 and add 1. Repeat the process until 1 is reached. The conjecture states that no matter which number you start with, you will always reach 1 eventually.

About

A setup for playing with cljfx

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published