Message Boards Message Boards

2
|
7933 Views
|
6 Replies
|
8 Total Likes
View groups...
Share
Share this post:

Do Dynamic locators work on the cloud?

Posted 7 years ago

In Stephen Wolfram's book (Elementary Introduction...) he says "...in a web page you'll be able to use active sliders... though they'll run slower than if they were directly on your computer" (1st ed., p.218). Fair enough, but I wonder if other objects such as dynamic locators actually work on the cloud at all. I just deployed a notebook with a dynamic locator which should move when dragged, but it simply doesn't seem to work at all. Sliders work, although somewhat slow, as expected.

POSTED BY: Tomas Garza
6 Replies

Thank you, John. This functionality is not really key for my use, though it would be nice to have. I hope something will come out in the future.

POSTED BY: Tomas Garza
Posted 7 years ago
POSTED BY: John Pacey

Ok, so it´s better to forget about dynamic locators on the cloud. Thanks, anyway.

POSTED BY: Tomas Garza
POSTED BY: Tomas Garza

The problem is that only locator is handled client side and everything is sent to the cloud for a new polygon. In general it may be possible to make simple primitives work client side but I haven't heard any news about that from WRI.

POSTED BY: Kuba Podkalicki

A support for Locator on WPC is limited but exists. From my experience the only way to make it work is to use LocatorPane or to use Manipulate with its variable having Locator control type.

Also, Arrow[{{0, 0}, Dynamic@x}] won't work out of the box, you need to have whole Graphics wrapped with Dynamic, otherwise it won't update.

So while on a desktop this works:

DynamicModule[{x = {1, 1}},
 Graphics[{Gray, Arrow[{{0, 0}, Dynamic@x}], Locator@Dynamic@x}, PlotRange -> 1, Frame -> True]
 ]

it won't on a cloud and you need:

Manipulate[
  Graphics[{Gray, Arrow[{{0, 0}, x}]}, PlotRange -> 1, Frame -> True],
  {{x, {1, 1}}, Locator}
] // CloudDeploy[#, Permissions -> "Public"] &

(*notice no Dynamic on x, instead the body of the manipulate is taking care about updates*)

or

CloudDeploy[
   DynamicModule[{x = {1, 1}},
     LocatorPane[Dynamic[x], 
       Dynamic@Graphics[{Gray, Circle[], Arrow[{{0, 0}, x}]}]]
  ], Permissions -> "Public"
]
POSTED BY: Kuba Podkalicki
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract