-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
moved main app logic to cljc #1
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comments to key points
(let [label-offset -10 ;; TODO | ||
] | ||
[:g.axis | ||
{:transform (css-str [(rotate angle begin-x begin-y) (translate begin-x begin-y)])} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks interesting, but seems to add a bit of complexity
Not sure it's a gain here and in the func declarations above ^
It's a fine-looking interpolation though, better than 'format'
(defn make-state [] | ||
spec*) | ||
|
||
(defn update-top-speeds [state {n :n}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If data to be spec-generated, we'll have a 'seed' with some cornerstone for spec-generation parameters that we'll change
e.g. :number-of-entities
That change will trigger re-generation of fine-to-consume by chart logic data
[charting-around.core :as c] | ||
[charting-around.views :as v])) | ||
|
||
(defn root-view |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally I'm against any ahead of time architecture, generalization (in code, ns)
ns architecture may make thinking less consuming, as we switch to context and are spared of constant need filtering of relevant information, but in pre-mature separation there is not much to filter, but a ns dependency to manage (those tasty ns-require conflicts and need to connect nses)
Trying to keep it simple until tradeoff worth it for sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's about move to .cljc too: - interop, + ns, + connect ns, + ugly syntax if we do need interop
reason?
|
||
(defn ready-axis [{:keys [domain] :as axis} [[begin-x begin-y] [end-x end-y] :as coords]] | ||
(let [displacement [(- end-x begin-x) (- end-y begin-y)] | ||
range (js/Math.hypot (first displacement) (second displacement))] | ||
range (Math/hypot (first displacement) (second displacement))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool
separated view/app into separate namespaces, moved non-CLJS-specific code to .cljc