The following is a toy version of my actual code. Both the CDF and the notebook versions of the code run smoothly. It all goes south when it gets deployed on the cloud!
wrapper = Manipulate[
main[s1, s2, s3],
{{s1, 95, "Slider 1"}, 1, 99, 1},
{{s2, 5, "Slider 2"}, 1, 99, 1},
{{s3, 50, "Slider 3"}, 1, 99, 1},
ControlType -> Slider,
Initialization :> (
func1[s1Val_: 0.95, s2Val_: 0.05] := Module[{},
RandomReal[{0, 1}, 2]
];
func2[s3Val_, s1Val_: 0.95, s2Val_: 0.05] := Module[{},
{
{
{"Res1", 10^6 RandomReal[]},
{"Res2", 10^6 RandomReal[]},
{"Res3", 10^6 RandomReal[]},
{"Res4", 10^6 RandomReal[]}
},
Table[{ToExpression[StringJoin["Res5", ToString[i]]],
RandomReal[]}, {i, 1, 10}],
Table[{ToExpression[StringJoin["Res6", ToString[i]]],
RandomReal[]}, {i, 1, 5}],
Table[{ToExpression[StringJoin["Res7", ToString[i]]],
10^6 RandomReal[]}, {i, 1, 5}]
}
];
func3[x_] := Which[
x === Res71, RGBColor[{0., 0.4918, 0.7778}],
x === Res72, RGBColor[{1., 0.1799, 0.1111}],
x === Res73, RGBColor[{1., 0.2222, 0.2523}],
x === Res74, RGBColor[{0.3011, 0.6667, 0.}],
True, Gray
];
main[s1Val_, s2Val_, s3Val_] :=
Module[{list1, val1, array1, grid1, grid2, tmp, chart},
list1 = func1[s1Val, s2Val];
val1 = Rescale[s3Val, {0, 1}, list1];
array1 = func2[val1, s1Val, s2Val];
grid1 =
Grid[Prepend[
Reverse /@
MapAt[N[10^-3 Round[10^3 #/10^3]] &,
array1[[1]], {All, 2}], {Style[
"some \!\(\*SuperscriptBox[\(text\), \(2\)]\)", Bold,
Smaller], Null}], Alignment -> Right];
grid2 =
Grid[Prepend[
array1[[4]], {Null, Style["some text", Bold, Underlined]}],
Alignment -> Right];
tmp = (array1[[4]] // Reverse // Transpose);
chart =
PieChart3D[tmp[[2]], ChartLabels -> tmp[[1]],
ChartStyle -> (func3 /@ tmp[[1]]), ImageSize -> Medium,
PlotLabel -> Style["some text", Larger, Bold],
SectorOrigin -> {Automatic, 1}];
Column[{chart,
Grid[{{grid2, grid1}}, Dividers -> {{False, True}, False}],
Framed[Style["some text", 11, Bold, Darker[Blue]]]}, Center]
];
),
SaveDefinitions -> True,
SynchronousInitialization -> False,
Deployed -> True
];
CDFDeploy[
ToFileName[NotebookDirectory[], "test.cdf"],
wrapper,
WindowSize -> {1100, 1000},
Method -> "Standalone",
Target -> "CDFPlayer",
Deployed -> True
]
CloudDeploy[
ExportForm[wrapper, "CloudCDF"],
Permissions -> "Public"
]