Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

moved main app logic to cljc #1

wants to merge 2 commits into from

Conversation

Hendekagon
Copy link

separated view/app into separate namespaces, moved non-CLJS-specific code to .cljc

Copy link
Owner

@andrewzhurov andrewzhurov left a 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)])}
Copy link
Owner

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}]
Copy link
Owner

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
Copy link
Owner

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

Copy link
Owner

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))]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants