Skip to main content
1 of 2
halirutan
  • 113.4k
  • 7
  • 266
  • 479

Just Set dist[[1]] to your output inside Manipulate. Putting additionally a Dynamic to your plots let's you see the change live. So after evaluating all your definitions from the first code-block, you could do something like

Column[{
  Manipulate[
   distToMean[[1]] = (Flatten@
       allTeamAverageStats[[Flatten@
          Position[
           Total[{v1, v2, v3, v4, v5, v6, v7, v8, v9, v10}/
                Total@{v1, v2, v3, v4, v5, v6, v7, v8, v9, 
                  v10} (allTeamAverageStats[[#]] - rosterRAMean)/
                rosterRASD] & /@ Range[792], 
           Max[Total[{v1, v2, v3, v4, v5, v6, v7, v8, v9, v10}/
                 Total@{v1, v2, v3, v4, v5, v6, v7, v8, v9, 
                   v10} (allTeamAverageStats[[#]] - rosterRAMean)/
                 rosterRASD] & /@ Range[792]]]]]) - rosterRAMean, {v1,
     Range[.1, 1, .1]}, {v2, Range[.1, 1, .1]}, {v3, 
    Range[.1, 1, .1]}, {v4, Range[.1, 1, .1]}, {v5, 
    Range[.1, 1, .1]}, {v6, Range[.1, 1, .1]}, {v7, 
    Range[.1, 1, .1]}, {v8, Range[.1, 1, .1]}, {v9, 
    Range[.1, 1, .1]}, {v10, Range[.1, 1, .1]}, 
   ControlType -> Manipulator],
  Dynamic[
   Show[Function[attributes, 
      Graphics[{Blend[{{-Max[Abs[distToMean[[1]]]], Red}, {0, 
           LightRed}, {0, LightGreen}, {+Max[Abs[distToMean[[1]]]], 
           Green}}, distToMean[[1]][[attributes]]], 
        Rectangle[{If[distToMean[[1]][[attributes]] < 0, 
           distToMean[[1]][[attributes]]*10, 0], 
          attributes - 1}, {If[distToMean[[1]][[attributes]] < 0, 0, 
           distToMean[[1]][[attributes]]*10], attributes}], 
        PlotRange -> {{-6, 6}, {0, 10}}}, AspectRatio -> 16/9, 
       Epilog -> {Black, Thickness[.05], Line[{{0, 0}, {0, 11}}]}]] /@
      Range[10], Frame -> False, FrameTicks -> False]]
  }]

Note: This is far from being good programming style but for a test it should be fine.

halirutan
  • 113.4k
  • 7
  • 266
  • 479