newrelic / nr1-observability-maps

NR1 Observability Maps allows you to create an observability map based on any of the data available in New Relic.
https://discuss.newrelic.com/t/nr1-observability-maps-nerdpack/93091
Apache License 2.0
12 stars 11 forks source link

Nodes are bounced back when they are dragged around #62

Closed aries-zhang closed 3 years ago

aries-zhang commented 3 years ago

Description

Nodes are bounced back when they are dragged around. Also after the change eventually succeeds, sometimes the destination is not the desired location where the node is dragged to.

Steps to Reproduce

  1. Simulate a slow network
  2. Drag any nodes on a map

Expected Behaviour

Nodes should be following the cursor.

Relevant Logs / Console output

N/A

Your Environment

Additional context

In older versions of observability maps, the position change happens right after mouse left button is released, however, at the moment, it does not happen until the network communication finishes, which creates a weird situation that the nodes are bouncing back constantly.

What makes it un-usable is that now users can not drag and drop smoothly if their network is slow. They are forced to wait until each change finishes, to get a view where next node should be dragged to, and is big time waster.

aries-zhang commented 3 years ago

Believe it is always a problem to fight against a slow network, but what if the status of the whole map could be stored in local, and finally sent back to server when users choose to end editing? It might help solve the conflict between real-time editing and slow network communication.

Anyway, just food for thought.

aswanson-nr commented 3 years ago

The code to handle a smooth drag & drop experience was intentionally commented out, you can view it here https://github.com/newrelic/nr1-observability-maps/blob/main/nerdlets/observability-maps-nerdlet/components/map/map.js#L60

@Kav91 Can you provide anymore information as to why this change was made?

Kav91 commented 3 years ago

@aswanson-nr When I was originally implementing it I had some issues with the behaviour of the graph package going between two objects and things going out of sync one of which was also related to slow networks. So I intentionally removed it some time ago. So it is per design currently.

I do want to re-implement the feature to improve usability. I'll see if I can put something together this week to go out with another catalog update otherwise we'll have to schedule it for later.