drag

D3 forceSimulation and dragging, what is node.fx/node.fy?

别等时光非礼了梦想. 提交于 2019-12-23 06:14:06
问题 For d3 force layouts that include drag functionality with d3-drag, it seems that the functions called on each drag event modify d.fx / d.fy , eg: function dragged(d) { d.fx = d3.event.x; d.fy = d3.event.y; } The drag start event often bases d.fx / d.fy on d.x / d.y while the end event sets d.fx / d.fy to null . Where does d.fx / d.fy come from and why does it get used on elements that are being dragged? Is this built into d3 or d3-force in some way? Where is it assigned to the element being

Drag-able button in iOS iPhone such that it repositions itself in its orignal position after touch ended.

被刻印的时光 ゝ 提交于 2019-12-23 05:35:11
问题 I am making an app where there are different buttons for different colors, if i drag this color button on a specific view its color must change to this button's color and the color button should reposition in its orignal location. I tried various methods like touches began and touches ended but it doesn't seem to solve my issue. I also tried customized methods which fire on various uicontrolstate but it didnt work as well. plz help me out with this. 回答1: I think you use touchesBegan

Drag ImageView Or Bitmap Upon Touch

喜欢而已 提交于 2019-12-23 04:50:21
问题 I currently have something working where I can drag a box horizontally on the screen (what I want it to do). However, it works when you click ANYWHERE on the screen, and I want it to work only when the box has been clicked. I have tried implementing this in different ways, and I've looked all over the place and still remain lost. Can anybody help? I also can't figure out how a bitmap is placed (I'm using a bitmap right now as I can't for the life of me figure out how to implement the

how to detect which side of 3d cube was clicked?

删除回忆录丶 提交于 2019-12-23 04:04:21
问题 I am writing a small 3d "engine" in canvas.. not really an engine, but more of an application based on code from Eric Pascarello's demo (hit number "7" a few times to see it rotating) it's all going very nice, I even added sorting by average z-value for each plane ("side") - so that I can use a body made of several cubes so that close to camera shapes are drawn last. now, I want to detect which side was clicked, when a mouse clickes the canvas. something like this hints: each side is defined

Java Application : mouseDragged Event isn't Executed Often Enough

谁说胖子不能爱 提交于 2019-12-23 01:52:08
问题 Is there a way to make the mouseDragged Event be called more Often ( In my Case, Drawing a Color? I need it for Smooth Drawing, because right now, if you move too fast, it doesn't Draw All my Path. Also, I have an 2D Array Storing the Color of the Pixel, so that's also Problematic if I try to solve by problem by another Way, that's why I thought Increasing the mouseDragged Frequency would be the Best thing to Do Thanks 回答1: If you want smooth drawing, you'd likely have to interpolate the data

Two 'calls' to drag events in d3

限于喜欢 提交于 2019-12-22 10:57:35
问题 I'm using the force-directed layout in d3 and I'm running into a bit of a snag in development. var circle = svg.append("svg:g").selectAll("circle") .data(force.nodes()) .enter().append("svg:circle") .attr("r", function( d ) { return d.fValue; }) .style('fill', function( d ) { return strokeColor( d.name ); }) .call(force.drag); Basically, I want to add more event listeners to the 'drag' behavior defined by force.drag - namely, I want to make sure that the nodes change color on drag (not on

Trigger Mouse Dragging in jQuery UI

最后都变了- 提交于 2019-12-22 10:25:35
问题 Using jQuery 1.2.x and jQuery UI 1.5.x, one was able to trigger dragging manually like so: jQuery("#myDiv").mousedown(function(ev) { target = jQuery(ev.target); if (target.hasClass("drag-me")) { target.draggable({ helper: "clone", start: function() { console.log("drag start"); }, stop: function() { jQuery(this).draggable("destroy"); } }).trigger("mousedown.draggable", [ev]); } }); It is applied to the following HTML: <div id="myDiv"> <div class="drag-me"></div> <div class="drag-me"></div>

Android - Creating Resizable View

↘锁芯ラ 提交于 2019-12-22 06:39:32
问题 I am currently working on a Dashboard with movable and resizable views. The problem I have now is that I want to resize the view by touch gestures. Therefore, I thought of a Point which I add to a view on selection, which can be dragged to resize the selected view. This is similar to the resizing procedure on the Android Homescreen. Even after a long research, I could not come up with a solution on how to overlay another view, which has its own DragListener. I could imagine putting the

How to drag files from c# winforms app to outlook message

孤街浪徒 提交于 2019-12-22 06:39:13
问题 I'm trying to drag one or more files from my application to an outlook mail-message. If I drag to my desktop the files are copied to the desktop as expected, but when dragging into a new outlook 2013 mail message, nothing happens... Only when I drag explicitly to the 'attachments textbox' do they appear, this is not helpful because the attachment-textbox isn't shown by default. I don't understand why when I drag file(s) from my desktop to the mail I can just drop them and the attachment-text

How can I only run an AJAX call on change when the mouse (or finger) is no longer dragging?

前提是你 提交于 2019-12-22 00:36:08
问题 I have series of interactive sliders that change calculated values. The calculations run on every tiny move of a dragged handle (via mousedown or touch drag event). I need to update a database with the values but would prefer only to grab the values after the user "drops" the handle. How can I determine if a finger or mouse is down, in order to skip the AJAX call? function handleIsBeingDragged() { // calculations based on all the input values here // pseudo-code to check for mouseup event if