Coder Social home page Coder Social logo

elben / planjure Goto Github PK

View Code? Open in Web Editor NEW
121.0 121.0 7.0 397 KB

:checkered_flag:Path-planning algorithms (Dijkstra, A*, etc); a study in ClojureScript, Om and core.async.

Home Page: http://elbenshira.com/p/planjure

Clojure 94.05% CSS 3.30% HTML 2.65%

planjure's People

Contributors

elben avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

planjure's Issues

Better random world generator

Should create islands. Perhaps create the brush first, then the random world generator can just be random brushes.

Extract library from demo

planjure.plan should be independent of demo.

  • Extract demo namespace to planjure.demo.*
  • Use cljx to compile planjure.plan to both target platforms.

Redraw only the difference on world update

The slow part about re-drawing the world (mostly noticeable on large world) is the tight loop through each element in world. What we need to do is only draw the difference.

So we can have a difference hash that only contains the updated rows/cols:

{row-idx-0 {col-idx-0 3
            col-idx-1 5 ...}
 row-idx-1 { ... }
 ...}

Break out to library and UI demo

Break out planjure.plan to its own library. Perhaps use that project that compiles to cljs and clj, then include the cljs version into the demo.

Draw better path vectors

Path vectors should look continuous, with knowledge to render proper direction and (on corner changes) curves.

Update path as world updates

  • A checkbox that, when clicked, will update the path as the world updates.
  • Check box is turned on automatically.
  • If slow, perhaps update path every N updates to :world, or every S seconds.

Speed up large world updates

Right now, brushing across large world is very slow. Probably due to update-world and update-row making new vecs instead of using assoc on the old ones.

  • Use better cursors instead of the whole app-state
  • Sum up times inside of update-world versus inside of the re-draw function for canvas.

Optimize components by passing in specific cursors

In our components, we often pass in the whole appstate. This means IRender is called every time the app state changes. This is often unnecessary and can cause slowdown.

Refactor components to only accept the cursor(s) necessary to render that component.

Brush size

Should be able to select brush size. Drawing brush should make a spray, where center has highest cost, spreading outward like a gaussian kernel.

Not re-planning on history change

Because we don't set :world through update-world-state!. We need to move this (and plan-chan) to its own module, perhaps appstate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.