nudged | Estimate scale , rotation , and translation between two sets
kandi X-RAY | nudged Summary
kandi X-RAY | nudged Summary
In general, you can apply Nudged in any situation where you want to capture a 2D transformation based on a movement of any number of control points. See the image below for available types of transforms Nudged can estimate. Mathematically speaking, Nudged is a set of optimal least squares estimators for nonreflective similarity transformation matrices. Such transformations are affine transformations with translation, rotation, and/or uniform scaling, and without reflection or shearing. The estimation has time complexity of O(n), where n is the cardinality (size) of the point sets. In other words, Nudged solves a 2D to 2D point set registration problem (alias Procrustes superimposition) in linear time. The algorithms and their efficiency are thoroughly described in a M.Sc. thesis Advanced algorithms for manipulating 2D objects on touch screens. The development has been supported by Infant Cognition Laboratory at Tampere University where Nudged is used to correct eye tracking data. Yet, the main motivation for Nudged comes from Tapspace, a zoomable user interface library where smooth and fast scaling by touch is crucial.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of nudged
nudged Key Features
nudged Examples and Code Snippets
Community Discussions
Trending Discussions on nudged
QUESTION
I have a little game application Deal-O-Round in the Google Play Store and I submitted the same APK about 7 years ago (July 6, 2014 https://smile.amazon.com/Csaba-Toth-Deal-O-Round/dp/B00LK8VBLS/) to the Amazon Mobile Marketplace as well. The 2014 version was based on Google PlayN framework which allowed a web-based demo as well besides Android and iOS platforms. A lot of time passed and last year I re-implemented the whole game in Flutter, which also allows the build of a web-based demo besides Android and iOS.
Even more recently I got an email from Amazon with the title "[ACTION REQUIRED] App update required for target API Level compliance" which nudged me to try to refresh the APK in their store again. According to the email the Fire OS 6 releases require minimum API level 25 and Fire OS 7 will require minimum API level 28. That's great news, I refreshed my Flutter project and the Gradle upgrade bumped the min SDK API level to 23. And my current target API level is 29 as seen in my build.gradle. Everything is open source BTW.
...ANSWER
Answered 2021-Mar-30 at 18:36I went back to the page I took the screenshot from. On the first ("Amazon Fire Tablets and Phones") and the last ("Non-Amazon Devices") tab all the little question marks show a "Targeted by another APK in the current version." hint. I'll need to research that more because it sounds nonsensical. The "Amazon Fire TV" tab's hints show some minSdkVersion
(for very old devices) and also "android.hardware.touchscreen"
capability hint. My game needs touch screen, so that's not surprising and the old APK wasn't supporting those either.
Reading more about the Targeted by another APK in the current version.
hint I came across https://developer.amazon.com/docs/app-submission/publish-app-upload-apk-files.html#add_multiple_apks
"With the second APK, you can select support for devices not already selected by the first APK.". I'm not sure why the store is not able to serve automatically the more recent APK and why I have to manually toggle things, but well, that's what I'll do.
- Starting edit:
- Turning off devices for the old APK
- Turing off on the other tab for the old APK:
- Editing and turning on devices for the newer APK. Maybe this is why there's this weird thing going on, I have to decrease minSdk back from 23 to 22 to have a better coverage:
So the GET_ACCOUTNS
or USE_CREDENTIALS
is not a problem supposedly (so far). If the above doesn't help to you then also check out https://developer.amazon.com/docs/app-submission/troubleshooting-android-manifest-and-device-targeting.html
QUESTION
I am trying to manually set the coordinates of the geom_label
in ggplot. The problem is that my plot is a circle (not centred at zero)...and Im trying to figure out a way to 'expand' the x & y positions of the labels, so they are pushed out... hopefully the example below will explain what I mean.
Aside: There is a similar answer here... which does work... but Im not exactly sure what is happening in the code for that answer. I was hoping to find a relatively simple solution. Here's my problem.
If I have a data frame that looks like this:
...ANSWER
Answered 2021-Feb-25 at 03:15I figured out a solution to this problem. Following on from the method I laid out in the question... I first scale between -1 & 1 (I was scaling incorrectly in the question)
QUESTION
I'm using lxml
to generate an XML file such as the one below. The documentation and other questions (1, 2) here on Stackoverflow nudged me into the right direction. What I'm struggling with are namespace prefixes such as those in the markList
and mark
nodes.
ANSWER
Answered 2021-Feb-09 at 17:05Here is a way to do it:
QUESTION
I want to use geom_text_repel to have my labels lie as close to the edge of a pie graph as possible unless the percent is under a certain value, in which case the label should be nudged further away and connected with a line. I adapted a solution from Move labels in ggplot2 pie graph but increased the xpos values for groups above the threshold.
...ANSWER
Answered 2021-Jan-23 at 04:34I would offer the following tricks:
To overcome the first issue, use both of
geom_text_repel()
andgeom_text()
for all data, but show thelabel
ingeom_text_repel()
only for values less thanthreshold
, and showlabel
ingeom_text()
only for values more thanthreshold
.To overcome the second issue, use
hjust = 'outward'
ingeom_text()
, and adjust the value ofnudge_x
both ingeom_text()
andgeom_text_repel()
.Use
geom_segment()
to create lines connecting pie chart areas with the labels.
Here is the full code:
QUESTION
I am plotting some density curves, and I want to add a point at the mean of each group. However, I want to plot these points along the top of the density curve, not at 0. Is there a way to come up with a value of the density at the mean point within groups? code follows:
...ANSWER
Answered 2020-Dec-31 at 06:19I'm not sure if there's a way to calculate the height of the density curve at the mean value within the ggplot geom/stat functions, so I've created a couple of helper functions to do that.
dens_at_mean
calculates the height of the density curve at the mean of the data. get_mean_coords
runs dens_at_mean
by group and then scales the height values to match the y-values generated by stat_halfeye
and returns a data frame that can be passed to geom_point
.
QUESTION
EDIT FOR CLARIFICATION:
What I want:
A full screen javascript canvas which can handle touch events without those events being further interpreted by the browser, but also reserve the ability to open a new window on user action.
Examples:
- I should be able to swipe my finger around without the webpage trying to scroll
- I should be able to swipe my finger around without the contents of the webpage being nudged in any way (normally, when one scrolls to the end of a scroll region, the browser allows some additional spring-loaded buffer scrolling to signal to the user that it is the end of the scroll region).
- I should be able to pinch and pan without the webpage zooming
- etc...
The point:
I need to interpret these events accurately and in realtime MYSELF to respond to these actions WITHIN THE CANVAS. (I am doing realtime drawing via requestAnimationFrame
, allowing me to react to user events without using the DOM)
The state of things currently:
This all works perfectly (except for the ability to open a new window) because I position the canvas to be the full size of the viewport (handling any window resize events), and the canvas listens to ontouchstart
, ontouchmove
, ontouchend
, etc... events, calling evt.preventDefault()
after I have handled the user input myself. This works to ensure the canvas is ALWAYS full screen, doesn't budge, and user input is accurately given to me to handle in-game.
The Problem:
One bit of user input I need to handle is the launching of a webpage when they click the region of my canvas with a "launch my webpage" button. However, window.open(mywebpage)
doesn't work, because mobile safari only allows such an action in the callstack of a click
event. Because I rely on ontouchstart
to get responsive controls, and evt.preventDefault()
in an ontouchstart
event CANCELS the click
event from happening, I cannot launch the webpage (it gets blocked by the browser).
My attempted solutions, and why they are insufficient:
- Just use a click event rather than ontouchstart: this means I can't prevent scrolling/etc... additionally, it is not as responsive, and doesn't allow me to handle touch-and-drag events well.
- Overlay a
div
(or ana
) tag atop the canvas over the launch webpage zone, and add a click event to that: if the user clicks-and-drags starting within this tag, then it allows the page to scroll and zoom. Trying to fix this results in the same problem as before.
ORIGINAL POST:
I have a mobile application that is a full-screen canvas, which locks itself positionally (can't scroll or zoom) so that I can correctly interpret user input uninterrupted (swipes, pans, etc...).
It locks itself in by intercepting touchstart
events and calling evt.preventDefault
(as well as the meta viewport no-zoom stuff which as far as I can tell doesn't actually do anything?).
This works great, and is absolutely necessary to make a game (or game-like application) function.
The problem is that I also have a "go to this webpage" button. I can intercept the touchstart
, and use window.open(somewebpage)
, but mobile popup blockers will block it. The "rules" seem to be "the webpage will be allowed to be opened iff it is done in the call stack of a user interaction, AND that interaction is a 'click' event".
I have the first part down, but if I change the event to a click
event, the web page now interprets swipes as scrolls (and pinches as zooms, etc...). If I have both a click
and a touchstart
event, then calling evt.preventDefault()
on the touchstart
(which stops the scroll/zoom) also stops the click
event.
If I overlay a div
atop the click zone of the "launch webpage" button, then the player can scroll/zoom when their input begins in that button, which results in an unpredictable and wonky experience.
How can I launch another webpage without allowing the current webpage to scroll?
Edit: at request, here is a code snippet at least partially illustrating what I'm trying to do https://jsfiddle.net/phildo/0q8e47fk/10/. Note that in the "real" case, the canvas takes up the full width/height of the screen, and is explicitly set accordingly on screen resize.
...ANSWER
Answered 2020-Oct-09 at 21:06Show a div on top of full screen canvas element that intercepts normal click events on element canvas.
SolutionAside from click events, you need to intrrcept the following touch events:
- touchstart
- touchend
- touchmove
- touchcancel
You only preventDefault
on the canvas events so you should still be able to create a clickable/touchable element in the canvas that shows a div outside the canvas positioned with a z-index
higher than the canvas element by setting on display: block
on the div. The div should also have 100vh
and 100vw
set foe width and height respectively and be position: fixed
. The div should also have a button to hide again display: none
.
QUESTION
I am trying to position 3 elements around a circle using CSS only. I have nudged the elements into position by eye, but I am assuming there is a mathematical (PLEASE NOTE: mathematical, NOT programatic) way to determine the top
and left
numbers for each of the three elements.
The motive here is that I will be rotating the entire block, and the elements should be in the same position after each rotation.
...ANSWER
Answered 2020-Sep-01 at 14:31Unfortunately, you cannot do this without a preprocessor, for example SCSS. Thanks @Stef for the formula for the vertices of a regular triangle.
[CODE][1] [1]: https://codepen.io/BlackStar1991/pen/xxVLMVG
QUESTION
I'm using django orm with select related and it generates the query of the form:
...ANSWER
Answered 2020-Jul-10 at 15:01v13 of PostgreSQL, which should be released in the next few months, implements incremental sorting, in which it can read rows in an pre-sorted order based on prefix columns, then sorts just the ties on those prefix column(s) by the remaining column(s) in order to get a complete sort based on more columns than an index provides. I think that will do more or less what you want.
QUESTION
I'm trying to use @EnvironmentObject to control some aspects of my app. The issue I'm having is that one of my controllers can't access the environment object. I get the fatal error "No @ObservableObject of type Environment found".
I've searched other questions, and every solution I could find consisted of sending .environmentObject(myEnvironment)
to the view in question. The problem is this is not a view, and I don't seem to have that option.
Also, in my SceneDelegate I send the environmentObject to the first view, so that is not the problem.
Here is my code.
First, I created a model to declare all my environment variables
Environment
...ANSWER
Answered 2020-Jun-05 at 14:56Don't use @EnvironmentObject
in your Controller
/ViewModel
(in fact anywhere outside a View
). If you want to observe changes to Environment in your Controller you can do this:
QUESTION
I'm trying to use ggrepel::geom_text_repel
to annotate a figure in ggplot
, but can't seem to figure out how to get my desired outcome. I'm using a position_dodge()
for my x-axis, and would like to both adjust the position of the labels along the x-axis so that they don't overlap with the error bars, but also to position_dodge
the arrow heads so they continue to point at the correct place on the error bars. The problem is I can only seem to be able to do one or the other.
For example:
...ANSWER
Answered 2020-Apr-30 at 06:36It's too bad that there is not an elegant solution to solving the issue of needing to "dodge" and "nudge" at the same time. You need position=
to dodge without question, so all that is left to move the labels around is to use direction='y'
(to only allow the labels to spread out in the y direction) and set limits with xlim=
to where they can go. In essence, we want to tell the labels "stay on this side of the datapoints, and far enough away so you don't mess with my errorbars!"
The approach here is that you need multiple geom_label_repel
calls. I use a for
loop to step through each level, and since the "numeric" position of a discrete axis = the position of the level of that factor, we can programmatically "shift" the xlim=
term according to each factor to be an area just to the right of the center point of the factor.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install nudged
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page