Message Boards Message Boards

CloudDeploy with DateListPlot

I try to deploy some weatherdata to the cloud but with FormFunction or FormPAge doesnt work.

CloudDeploy[
 FormPage[{"Latitude" -> "Number", "Longitude" -> "Number"}, 
  DateListPlot[{WeatherData[{#Latitude, #Longitude}, 
      "MaxWindSpeed", {{1990}, {2015}, "Month"}], 
     WeatherData[{#Latitude, #Longitude}, 
      "MaxWindSpeed", {{1990}, {2015}, "Year"}]}, Joined -> True, 
    PlotRange -> Automatic, PlotTheme -> "Web", 
    PlotLegends -> {"Monthly Maxima", "Yearly Maxima"}] &]]

The plot should be look like this:

DateListPlot[{WeatherData[{myLatitude, myLongitude}, 
   "MaxWindSpeed", {{1990}, {2015}, "Month"}], 
  WeatherData[{myLatitude, myLongitude}, 
   "MaxWindSpeed", {{1990}, {2015}, "Year"}]}, Joined -> True, 
 PlotRange -> Automatic, PlotTheme -> "Detailed", 
 PlotLegends -> {"Monthly Maxima", "Yearly Maxima"}]

WeahterData

I can deploy the plot properly with CloudDeploy, so as creating a CloudObject. But as soon as I try to force it to run as API through the FormFunction or FormPage the server answer is just text. Like this but with length of 2 pages:

Legended[Graphics[{{}, {{{}, {}, {Hue[0.67, 0.6, 0.6], Directive[PointSize[0.007333333333333334], RGBColor[0.790588, 0.201176, 0.], CapForm["Butt"], AbsoluteThickness[3]], Line[{{2.8401408^9, 64.82}, {2.8428192^9, 46.49}, {2.8452384^9, 42.41}, {2.8479168^9, 88.9}, {2.8505088^9, 46.49}, {2.8531872^9, 46.49}, {2.8557792^9, 37.04}, {2.8584576^9, 37.04}, {2.861136^9, 40.74}, {2.863728^9, 48.15}, {2.8664064^9, 40.74}, {2.8689984^9, 110.75}, {2.8716768^9, 74.08}, {2.8743552^9, 55.37}, {2.8767744^9, 55.37}, {2.8794528^9, 64.82}, {2.8820448^9, 55.37}, {2.8847232^9, 46.49}, {2.8873152^9, 46.49}, {2.8899936^9, 75.93}, {2.892672^9, 38.89}, {2.895264^9, 37.04}, {2.8979424^9, 40.74}, {2.9005344^9, 46.49}, {2.9032128^9, 40.74}, {2.9058912^9, 48.15}, {2.9083968^9, 64.82}, {2.9110752^9, 46.49}, {2.9136672^9, 59.08}, {2.9163456^9, 46.49}, {2.9189376^9, 46.49}, {2.921616^9, 42.41}, {2.9242944^9, 40.74}, {2.9268864^9, 37.04}, {2.9295648*^9, 46.49},

What can be the problem?

And why there is no any description about FormPage, ...I just found in a blog or discussion on the web but Wolfram documentation has no info about that. It is a really nice solution for cloud deployment since the server response is right below the form. So the user doesn't need to refresh, or go back or whatever with the page.

Thank you

POSTED BY: Balazs Kisfali
2 Replies

In the meantime I found the online documentation for FormPage, ...from my desktop Mathematica I still didn't find it, probably it is not updated

http://reference.wolfram.com/language/ref/FormPage.html

But my issue is still persist with DateListPlot...

POSTED BY: Balazs Kisfali

I found what caused the issue. CloudDeploy doesn't pass some options, since I had a few I had to iterate each-by-each. It is tricky but PlotTheme cannot be pass and also any PlotLegend cannot be applied. At least in my approach. So after removing these options the code was fine.

So, at the end the below code was ok to deploy to the cloud:

DateListPlot[{WeatherData[{#Latitude, #Longitude}, 
   "MaxWindSpeed", {{1990}, {2015}, "Month"}], 
  WeatherData[{#Latitude, #Longitude}, 
   "MaxWindSpeed", {{1990}, {2015}, "Year"}]}, Joined -> True, 
 PlotRange -> Automatic, ImageSize -> Large]
POSTED BY: Balazs Kisfali
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