-
Notifications
You must be signed in to change notification settings - Fork 27
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
when using a function to generate an angle for a point, it expects radians, not degrees #250
Comments
Is this an error in Tangram JS logic? Agree we should document the current state regardless, just wondering if there's another Tangram JS issue to file here? @meetar |
I would expect degrees, so if that's not current behavior, we should fix.
…On Mon, Jun 25, 2018 at 5:18 PM, Nathaniel V. KELSO < ***@***.***> wrote:
Is this an error in Tangram JS logic? Agree we should document the current
state regardless, just wondering if there's another Tangram JS issue to
file here? @meetar <https://github.com/meetar>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#250 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABBXWZ0OGNYwWIeKwa5Znq01ttzHsIBks5uAVO_gaJpZM4U22Yp>
.
|
It looks like if you assign
So this could be something as simple as the function returning a string? |
The behavior should be normalized (to degrees) nonetheless. But that's a
good clue.
…On Mon, Jun 25, 2018 at 5:44 PM, burritojustice ***@***.***> wrote:
It looks like if you assign angle a string, it assumes it's radians, but
if you give it a number, it assumes degrees:
angle: "3.14" vs angle: 180 vs angle: "180"
So this could be something as simple as the function returning a string?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#250 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABBXbglMd-oIPb58ddCFmEANNExjsJtks5uAVmkgaJpZM4U22Yp>
.
|
Root issue is addressed in Tangram JS here: tangrams/tangram#652 Note this does NOT change static string behavior like @matteblair do you agree and does this reflect ES behavior? |
The behavior you're describing sounds reasonable to me, I think it's unlikely that someone would quote a number literal for What I'm observing in Tangram ES now is that both number and string literals (e.g. |
Got it. Yeah I also realized, the question with string representations of numbers is way more pervasive than this -- probably any (or many) parameters on the JS side that expect numbers. So I believe we should keep that as-is, with strict types (again I don't think this is a practical issue given YAML does this well), and we wouldn't want to just change behavior for this one parameter. Given differing JS vs. ES behavior, that seems like "undefined behavior" for going outside the documented value types for the parameter. Sounds like if ES is updated to handle numbers returned as angles, we're in alignment on the expected/documented functionality anyway. |
Yep, the issue with stringiness of scalars applies in other places as well. The documentation for |
https://github.com/tangrams/tangram-docs/blob/gh-pages/pages/draw.md#angle
when returning a value for
angle
with a function, it looks like it expect radians, not degrees.returning 180 does not point south, while pi/2 does...
Note that passing degrees without a function, e.g.
angle: 180,
works as expected.The text was updated successfully, but these errors were encountered: