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

Support for partial update of parameters in :drag and :inverse #8

Closed
baku89 opened this issue Jul 12, 2020 · 2 comments
Closed

Support for partial update of parameters in :drag and :inverse #8

baku89 opened this issue Jul 12, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@baku89
Copy link
Owner

baku89 commented Jul 12, 2020

By reference to @nariakiiwatani's tweet
https://twitter.com/nariakiiwatani/status/1281937067040112640

@baku89 baku89 added the enhancement New feature or request label Jul 12, 2020
@baku89
Copy link
Owner Author

baku89 commented Jul 12, 2020

Introduced the new syntax for the return value of handle drag function. 8f6b94e

Though previously drag function always returns vector, now it should return a hash map having specific keys.

;; Suppose original function call is (+ 0 1 2).
;; Below lines show a form of the returned value of drag function
;; and how it updates a parameter

;; Update all parameters
{:params [x y z]} ;; -> (+ x y z)
[x y z] ;; shorthand

;; Partial update by enumerating tuples of [index, new-param]
{:replace [[0 x] [1 y]]} ;; -> (+ x y 2)

;; Outer brackets can be omitted if the number of parameters to replace is only one
{:replace [0 x]}  ;; -> (+ x 1 2)

@baku89
Copy link
Owner Author

baku89 commented Jul 12, 2020

And I rewrote some of the core functions with new syntax FYI

9bd6ff6

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

No branches or pull requests

1 participant