Permalink
Browse files

Updated version that incorporates new changes/fixes generated by Thom…

…as Burleson and John Yanarella as well as most of the non Vector-related changes previously included in the 2010.08.04 branch.

- [Change Notes](http://tinyurl.com/2daqoqs)   (Only for the Flare/flare/ project)
- [Blog Article](http://www.gridlinked.info/using-flare-visualization-with-flex/)
  • Loading branch information...
1 parent 7aac08a commit 748f6767a17edb3dedaae99bdd29dcaa2b1ccb16 @wjwillett wjwillett committed Oct 6, 2010
Showing with 8,413 additions and 6,096 deletions.
  1. +1 −1 flare.apps/.actionScriptProperties
  2. 0 flare.apps/src/flare/apps/App.as
  3. +1 −1 flare.apps/src/flare/apps/DependencyGraph.as
  4. +7 −7 flare.apps/src/flare/apps/JobVoyager.as
  5. 0 flare.apps/src/flare/apps/PackageMap.as
  6. BIN flare.apps/src/flare/apps/verdana.TTF
  7. 0 flare.apps/src/flare/widgets/FlareLogo.as
  8. 0 flare.apps/src/flare/widgets/PreLoader.as
  9. 0 flare.apps/src/flare/widgets/ProgressBar.as
  10. 0 flare.apps/src/flare/widgets/SearchBox.as
  11. 0 flare.demos/src/demos.as
  12. 0 flare.demos/src/flare/demos/Animation.as
  13. 0 flare.demos/src/flare/demos/Bars.as
  14. 0 flare.demos/src/flare/demos/Demo.as
  15. 0 flare.demos/src/flare/demos/Distortions.as
  16. 0 flare.demos/src/flare/demos/Layouts.as
  17. 0 flare.demos/src/flare/demos/Pie.as
  18. 0 flare.demos/src/flare/demos/Scatter.as
  19. 0 flare.demos/src/flare/demos/Smoke.as
  20. 0 flare.demos/src/flare/demos/Stacks.as
  21. 0 flare.demos/src/flare/demos/Timeline.as
  22. 0 flare.demos/src/flare/demos/TreeMap.as
  23. 0 flare.demos/src/flare/demos/util/GraphUtil.as
  24. 0 flare.demos/src/flare/demos/util/Link.as
  25. 0 flare.demos/src/flare/demos/util/LinkGroup.as
  26. +3 −4 flare.tests/src/flare/tests/AnimationTests.as
  27. 0 flare.tests/src/flare/tests/DataIOTests.as
  28. 0 flare.tests/src/flare/tests/DataTests.as
  29. +8 −10 flare.tests/src/flare/tests/ExpressionTests.as
  30. 0 flare.tests/src/flare/tests/MatrixTests.as
  31. +0 −44 flare.tests/src/flare/tests/SortTests.as
  32. 0 flare.tests/src/flare/tests/StringFormatTests.as
  33. 0 flare.tests/src/flare/tests/TreeTests.as
  34. 0 flare.tests/src/tests.as
  35. +2 −2 flare/src/flare/analytics/cluster/AgglomerativeCluster.as
  36. +2 −2 flare/src/flare/analytics/cluster/CommunityStructure.as
  37. +6 −8 flare/src/flare/analytics/cluster/HierarchicalCluster.as
  38. 0 flare/src/flare/analytics/cluster/MergeEdge.as
  39. +4 −10 flare/src/flare/analytics/graph/BetweennessCentrality.as
  40. 0 flare/src/flare/analytics/graph/LinkDistance.as
  41. +2 −8 flare/src/flare/analytics/graph/MaxFlowMinCut.as
  42. +2 −6 flare/src/flare/analytics/graph/ShortestPaths.as
  43. 0 flare/src/flare/analytics/graph/SpanningTree.as
  44. +14 −14 flare/src/flare/analytics/optimization/AspectRatioBanker.as
  45. 0 flare/src/flare/animate/Easing.as
  46. +10 −10 flare/src/flare/animate/FunctionSequence.as
  47. 0 flare/src/flare/animate/ISchedulable.as
  48. +4 −4 flare/src/flare/animate/Parallel.as
  49. 0 flare/src/flare/animate/Pause.as
  50. +2 −4 flare/src/flare/animate/Scheduler.as
  51. +8 −9 flare/src/flare/animate/Sequence.as
  52. 0 flare/src/flare/animate/Transition.as
  53. 0 flare/src/flare/animate/TransitionEvent.as
  54. +611 −545 flare/src/flare/animate/Transitioner.as
  55. +174 −174 flare/src/flare/animate/Tween.as
  56. 0 flare/src/flare/animate/interpolate/ArrayInterpolator.as
  57. 0 flare/src/flare/animate/interpolate/ColorInterpolator.as
  58. 0 flare/src/flare/animate/interpolate/DateInterpolator.as
  59. +0 −5 flare/src/flare/animate/interpolate/Interpolator.as
  60. 0 flare/src/flare/animate/interpolate/MatrixInterpolator.as
  61. 0 flare/src/flare/animate/interpolate/NumberInterpolator.as
  62. 0 flare/src/flare/animate/interpolate/ObjectInterpolator.as
  63. +1 −1 flare/src/flare/animate/interpolate/PointInterpolator.as
  64. 0 flare/src/flare/animate/interpolate/RectangleInterpolator.as
  65. 0 flare/src/flare/data/DataField.as
  66. +6 −6 flare/src/flare/data/DataSchema.as
  67. 0 flare/src/flare/data/DataSet.as
  68. +0 −1 flare/src/flare/data/DataSource.as
  69. +4 −4 flare/src/flare/data/DataTable.as
  70. +5 −7 flare/src/flare/data/DataUtil.as
  71. 0 flare/src/flare/data/converters/Converters.as
  72. +8 −7 flare/src/flare/data/converters/DelimitedTextConverter.as
  73. +3 −5 flare/src/flare/data/converters/GraphMLConverter.as
  74. 0 flare/src/flare/data/converters/IDataConverter.as
  75. +6 −5 flare/src/flare/data/converters/JSONConverter.as
  76. +275 −271 flare/src/flare/display/DirtySprite.as
  77. +426 −0 flare/src/flare/display/DisplaySprite.as
  78. 0 flare/src/flare/display/LineSprite.as
  79. 0 flare/src/flare/display/RectSprite.as
  80. +384 −349 flare/src/flare/display/TextSprite.as
  81. +512 −0 flare/src/flare/display/buttons/SpriteButton.as
  82. +184 −0 flare/src/flare/display/buttons/TextButton.as
  83. +105 −0 flare/src/flare/display/render/BackgroundRenderer.as
  84. +104 −0 flare/src/flare/display/render/BitmapRenderer.as
  85. +20 −0 flare/src/flare/display/render/IBackgroundRenderer.as
  86. +5 −7 flare/src/flare/flex/FlareVis.as
  87. +174 −0 flare/src/flare/flex/FlareVisualization.as
  88. 0 flare/src/flare/physics/DragForce.as
  89. 0 flare/src/flare/physics/GravityForce.as
  90. 0 flare/src/flare/physics/IForce.as
  91. +1 −1 flare/src/flare/physics/NBodyForce.as
  92. 0 flare/src/flare/physics/Particle.as
  93. +13 −13 flare/src/flare/physics/Simulation.as
  94. 0 flare/src/flare/physics/Spring.as
  95. 0 flare/src/flare/physics/SpringForce.as
  96. 0 flare/src/flare/query/AggregateExpression.as
  97. +2 −4 flare/src/flare/query/And.as
  98. +1 −1 flare/src/flare/query/Arithmetic.as
  99. +1 −1 flare/src/flare/query/Average.as
  100. 0 flare/src/flare/query/BinaryExpression.as
  101. 0 flare/src/flare/query/Comparison.as
  102. +12 −16 flare/src/flare/query/CompositeExpression.as
  103. +1 −1 flare/src/flare/query/Count.as
  104. +1 −6 flare/src/flare/query/DateUtil.as
  105. +1 −1 flare/src/flare/query/Distinct.as
  106. 0 flare/src/flare/query/Expression.as
  107. +8 −8 flare/src/flare/query/ExpressionIterator.as
  108. +3 −12 flare/src/flare/query/Fn.as
  109. 0 flare/src/flare/query/If.as
  110. 0 flare/src/flare/query/IsA.as
  111. 0 flare/src/flare/query/Literal.as
  112. 0 flare/src/flare/query/Match.as
  113. +1 −1 flare/src/flare/query/Maximum.as
  114. +1 −1 flare/src/flare/query/Minimum.as
  115. 0 flare/src/flare/query/Not.as
  116. 0 flare/src/flare/query/Or.as
  117. +11 −18 flare/src/flare/query/Query.as
  118. +3 −6 flare/src/flare/query/Range.as
  119. 0 flare/src/flare/query/StringUtil.as
  120. +1 −1 flare/src/flare/query/Sum.as
  121. 0 flare/src/flare/query/Variable.as
  122. +1 −1 flare/src/flare/query/Variance.as
  123. 0 flare/src/flare/query/Xor.as
  124. 0 flare/src/flare/query/methods/_.as
  125. 0 flare/src/flare/query/methods/add.as
  126. +1 −2 flare/src/flare/query/methods/and.as
  127. 0 flare/src/flare/query/methods/average.as
  128. 0 flare/src/flare/query/methods/count.as
  129. 0 flare/src/flare/query/methods/distinct.as
  130. 0 flare/src/flare/query/methods/div.as
  131. 0 flare/src/flare/query/methods/eq.as
  132. +1 −2 flare/src/flare/query/methods/fn.as
  133. 0 flare/src/flare/query/methods/gt.as
  134. 0 flare/src/flare/query/methods/gte.as
  135. 0 flare/src/flare/query/methods/iff.as
  136. 0 flare/src/flare/query/methods/isa.as
  137. 0 flare/src/flare/query/methods/lt.as
  138. 0 flare/src/flare/query/methods/lte.as
  139. 0 flare/src/flare/query/methods/max.as
  140. 0 flare/src/flare/query/methods/min.as
  141. 0 flare/src/flare/query/methods/mod.as
  142. 0 flare/src/flare/query/methods/mul.as
  143. 0 flare/src/flare/query/methods/neq.as
  144. 0 flare/src/flare/query/methods/not.as
  145. +1 −2 flare/src/flare/query/methods/or.as
  146. 0 flare/src/flare/query/methods/orderby.as
  147. 0 flare/src/flare/query/methods/range.as
  148. 0 flare/src/flare/query/methods/select.as
  149. 0 flare/src/flare/query/methods/stddev.as
  150. 0 flare/src/flare/query/methods/sub.as
  151. 0 flare/src/flare/query/methods/sum.as
  152. 0 flare/src/flare/query/methods/update.as
  153. 0 flare/src/flare/query/methods/variance.as
  154. 0 flare/src/flare/query/methods/where.as
  155. +1 −2 flare/src/flare/query/methods/xor.as
  156. 0 flare/src/flare/scale/IScaleMap.as
  157. 0 flare/src/flare/scale/LinearScale.as
  158. +2 −2 flare/src/flare/scale/LogScale.as
  159. +14 −14 flare/src/flare/scale/OrdinalScale.as
  160. +6 −6 flare/src/flare/scale/QuantileScale.as
  161. +2 −2 flare/src/flare/scale/QuantitativeScale.as
  162. 0 flare/src/flare/scale/RootScale.as
  163. +2 −2 flare/src/flare/scale/Scale.as
  164. 0 flare/src/flare/scale/ScaleType.as
  165. +2 −2 flare/src/flare/scale/TimeScale.as
  166. 0 flare/src/flare/util/Arrays.as
  167. +6 −12 flare/src/flare/util/Colors.as
  168. 0 flare/src/flare/util/Dates.as
  169. +428 −326 flare/src/flare/util/Displays.as
  170. 0 flare/src/flare/util/Filter.as
  171. +305 −277 flare/src/flare/util/Geometry.as
  172. 0 flare/src/flare/util/IEvaluable.as
  173. 0 flare/src/flare/util/IPredicate.as
  174. 0 flare/src/flare/util/IValueProxy.as
  175. +16 −21 flare/src/flare/util/Maths.as
  176. 0 flare/src/flare/util/Orientation.as
  177. +108 −0 flare/src/flare/util/Padding.as
  178. +4 −6 flare/src/flare/util/Property.as
  179. +558 −560 flare/src/flare/util/Shapes.as
  180. +15 −23 flare/src/flare/util/Sort.as
  181. +12 −11 flare/src/flare/util/Stats.as
  182. 0 flare/src/flare/util/Strings.as
  183. +175 −0 flare/src/flare/util/gradient/Gradient.as
  184. +121 −0 flare/src/flare/util/gradient/GradientStop.as
  185. +21 −21 flare/src/flare/util/heap/FibonacciHeap.as
  186. 0 flare/src/flare/util/heap/HeapNode.as
  187. +9 −9 flare/src/flare/util/math/DenseMatrix.as
  188. 0 flare/src/flare/util/math/IMatrix.as
  189. 0 flare/src/flare/util/math/SparseMatrix.as
  190. +20 −31 flare/src/flare/util/palette/ColorPalette.as
  191. +5 −5 flare/src/flare/util/palette/Palette.as
  192. +2 −2 flare/src/flare/util/palette/ShapePalette.as
  193. +1 −1 flare/src/flare/util/palette/SizePalette.as
  194. +498 −458 flare/src/flare/vis/Visualization.as
  195. 0 flare/src/flare/vis/axis/Axes.as
  196. +61 −55 flare/src/flare/vis/axis/Axis.as
  197. 0 flare/src/flare/vis/axis/AxisGridLine.as
  198. 0 flare/src/flare/vis/axis/AxisLabel.as
  199. 0 flare/src/flare/vis/axis/CartesianAxes.as
  200. 0 flare/src/flare/vis/controls/AnchorControl.as
  201. 0 flare/src/flare/vis/controls/ClickControl.as
  202. 0 flare/src/flare/vis/controls/Control.as
  203. +12 −12 flare/src/flare/vis/controls/ControlList.as
  204. 0 flare/src/flare/vis/controls/DragControl.as
  205. 0 flare/src/flare/vis/controls/ExpandControl.as
  206. +136 −135 flare/src/flare/vis/controls/HoverControl.as
  207. 0 flare/src/flare/vis/controls/IControl.as
  208. +213 −157 flare/src/flare/vis/controls/PanZoomControl.as
  209. +4 −6 flare/src/flare/vis/controls/SelectionControl.as
  210. +340 −270 flare/src/flare/vis/controls/TooltipControl.as
  211. +640 −617 flare/src/flare/vis/data/Data.as
  212. +11 −28 flare/src/flare/vis/data/DataList.as
  213. +236 −229 flare/src/flare/vis/data/DataSprite.as
  214. +111 −102 flare/src/flare/vis/data/EdgeSprite.as
  215. +579 −562 flare/src/flare/vis/data/NodeSprite.as
  216. +8 −8 flare/src/flare/vis/data/ScaleBinding.as
  217. 0 flare/src/flare/vis/data/Tree.as
  218. +1 −4 flare/src/flare/vis/data/TreeBuilder.as
  219. 0 flare/src/flare/vis/data/render/ArrowType.as
  220. +169 −172 flare/src/flare/vis/data/render/EdgeRenderer.as
  221. 0 flare/src/flare/vis/data/render/IRenderer.as
  222. +107 −0 flare/src/flare/vis/data/render/OrthogonalEdgeRenderer.as
  223. +13 −35 flare/src/flare/vis/data/render/ShapeRenderer.as
  224. +77 −92 flare/src/flare/vis/events/DataEvent.as
  225. 0 flare/src/flare/vis/events/SelectionEvent.as
  226. 0 flare/src/flare/vis/events/TooltipEvent.as
  227. 0 flare/src/flare/vis/events/VisualizationEvent.as
  228. +11 −27 flare/src/flare/vis/legend/Legend.as
  229. 0 flare/src/flare/vis/legend/LegendItem.as
  230. +6 −7 flare/src/flare/vis/legend/LegendRange.as
  231. 0 flare/src/flare/vis/operator/IOperator.as
  232. 0 flare/src/flare/vis/operator/Operator.as
  233. +11 −11 flare/src/flare/vis/operator/OperatorList.as
  234. +4 −6 flare/src/flare/vis/operator/OperatorSequence.as
  235. 0 flare/src/flare/vis/operator/OperatorSwitch.as
  236. 0 flare/src/flare/vis/operator/SortOperator.as
  237. 0 flare/src/flare/vis/operator/distortion/BifocalDistortion.as
  238. 0 flare/src/flare/vis/operator/distortion/Distortion.as
  239. 0 flare/src/flare/vis/operator/distortion/FisheyeDistortion.as
  240. 0 flare/src/flare/vis/operator/encoder/ColorEncoder.as
  241. 0 flare/src/flare/vis/operator/encoder/Encoder.as
  242. 0 flare/src/flare/vis/operator/encoder/PropertyEncoder.as
  243. 0 flare/src/flare/vis/operator/encoder/ShapeEncoder.as
  244. 0 flare/src/flare/vis/operator/encoder/SizeEncoder.as
  245. +4 −4 flare/src/flare/vis/operator/filter/FisheyeTreeFilter.as
  246. +5 −8 flare/src/flare/vis/operator/filter/GraphDistanceFilter.as
  247. 0 flare/src/flare/vis/operator/filter/VisibilityFilter.as
  248. +82 −13 flare/src/flare/vis/operator/label/Labeler.as
  249. 0 flare/src/flare/vis/operator/label/RadialLabeler.as
  250. +6 −6 flare/src/flare/vis/operator/label/StackedAreaLabeler.as
  251. 0 flare/src/flare/vis/operator/layout/AxisLayout.as
  252. +10 −14 flare/src/flare/vis/operator/layout/BundledEdgeRouter.as
  253. 0 flare/src/flare/vis/operator/layout/CircleLayout.as
  254. +10 −12 flare/src/flare/vis/operator/layout/CirclePackingLayout.as
  255. +2 −4 flare/src/flare/vis/operator/layout/DendrogramLayout.as
  256. 0 flare/src/flare/vis/operator/layout/ForceDirectedLayout.as
  257. 0 flare/src/flare/vis/operator/layout/IcicleTreeLayout.as
  258. +8 −10 flare/src/flare/vis/operator/layout/IndentedTreeLayout.as
  259. +1 −1 flare/src/flare/vis/operator/layout/Layout.as
  260. +6 −7 flare/src/flare/vis/operator/layout/NodeLinkTreeLayout.as
  261. 0 flare/src/flare/vis/operator/layout/PieLayout.as
  262. +7 −8 flare/src/flare/vis/operator/layout/RadialTreeLayout.as
  263. 0 flare/src/flare/vis/operator/layout/RandomLayout.as
  264. +28 −37 flare/src/flare/vis/operator/layout/StackedAreaLayout.as
  265. +13 −15 flare/src/flare/vis/operator/layout/TreeMapLayout.as
@@ -19,7 +19,7 @@
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/>
</excludedEntries>
</libraryPathEntry>
- <libraryPathEntry kind="3" linkType="1" path="${DOCUMENTS}/flare/bin/flare.swc" useDefaultLinkType="false"/>
+ <libraryPathEntry kind="3" linkType="1" path="/flare/bin/flare.swc" useDefaultLinkType="false"/>
</libraryPath>
<sourceAttachmentPath/>
</compiler>
View
No changes.
View
@@ -202,7 +202,7 @@ package flare.apps
private function showAllDeps(evt:SelectionEvent, linkType:int):void
{
// first, do a breadth-first-search to compute closure
- var q:Vector.<Object> = evt.items.slice();
+ var q:Array = evt.items.slice();
var map:Dictionary = new Dictionary();
while (q.length > 0) {
var u:NodeSprite = q.shift();
View
@@ -71,9 +71,9 @@ package flare.apps
_bar.loadURL(ldr, function():void {
// get loaded data, reshape for stacked columns
var ds:DataSet = ldr.data as DataSet;
- var dr:Vector.<Object> = reshape(ds.nodes.data, ["occupation","sex"],
+ var dr:Array = reshape(ds.nodes.data, ["occupation","sex"],
"year", "people", _cols);
- visualize(Data.fromVector(dr));
+ visualize(Data.fromArray(dr));
_bar = null;
});
}
@@ -300,7 +300,7 @@ package flare.apps
* yearly data is stored in individual rows, this method can be used to
* map each year into a column and the full time series into a single
* row. This is often needed to use the stacked area layout.
- * @param tuples an object vector of data tuples
+ * @param tuples an array of data tuples
* @param cats the category values to maintain
* @param dim the dimension upon which to pivot. The values of this
* property should correspond to the names of newly created columns.
@@ -310,12 +310,12 @@ package flare.apps
* match the values of the <code>dim</code> property.
* @param normalize a flag indicating if the data should be normalized
*/
- public static function reshape(tuples:Vector.<Object>, cats:Array, dim:String,
- measure:String, cols:Array, normalize:Boolean=true):Vector.<Object>
+ public static function reshape(tuples:Array, cats:Array, dim:String,
+ measure:String, cols:Array, normalize:Boolean=true):Array
{
var t:Object, d:Object, val:Object, name:String;
- var data:Vector.<Object> = new Vector.<Object>();
- var totals:Object = {}, names:Object = {};
+ var data:Array = [], names:Array = []
+ var totals:Object = {};
for each (val in cols) totals[val] = 0;
// create data set
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
0 flare.demos/src/demos.as 100755 → 100644
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
No changes.
View
@@ -10,7 +10,6 @@ package flare.tests
import flare.animate.interpolate.PointInterpolator;
import flare.animate.interpolate.RectangleInterpolator;
import flare.util.Arrays;
- import flare.util.Vectors;
import flare.util.Colors;
import flash.geom.Matrix;
@@ -199,15 +198,15 @@ package flare.tests
var t0:Tween = new Tween(o, 1, {a:0});
var t1:Tween = new Tween(o, 1, {a:2}); t1.id = "tween";
var t2:Tween = new Tween(o, 1, {a:3}); t2.id = "tween";
-
+
try {
t1.id = "change";
t1.id = "tween";
assertEquals("tween", t1.id);
} catch (err:Error) {
fail("id change for non-running tween caused exception.");
}
-
+
t0.play();
try {
t0.id = "change";
@@ -219,7 +218,7 @@ package flare.tests
fail("Allowed id change for running transition");
} catch (e:Error) { }
t2.play();
-
+
assertTrue(t0.running);
assertTrue(Scheduler.instance.remove(t0));
assertFalse(t1.running);
View
No changes.
View
No changes.
View
@@ -1,7 +1,5 @@
package flare.tests
{
- import flare.util.Vectors;
-
import flare.query.And;
import flare.query.Arithmetic;
import flare.query.Comparison;
@@ -219,7 +217,7 @@ package flare.tests
public function testQuery():void
{
- var dataa:Array = [
+ var data:Array = [
{val:4, cat:"a"},
{val:4, cat:"a"},
{val:4, cat:"a"},
@@ -231,9 +229,9 @@ package flare.tests
{val:2, cat:"c"},
{val:1, cat:"d"}
];
- var data:Vector.<Object> = Vectors.copyFromArray(dataa);
- var r:Vector.<Object>;
+ var r:Array;
+
r = select({count:count("cat")}).eval(data);
assertEquals(1, r.length);
assertEquals(10, r[0].count);
@@ -291,22 +289,22 @@ package flare.tests
r = where(eq(fn("sqrt","val"), 2)).eval(data);
assertEquals(3, r.length);
assertEquals("a", r[0].cat);
-
+
// -----
- dataa = [
+
+ data = [
{cat:"a", val:1}, {cat:"a", val:2},
{cat:"b", val:3}, {cat:"b", val:4},
{cat:"c", val:5}, {cat:"c", val:6},
{cat:"d", val:7}, {cat:"d", val:8}
];
- data = Vectors.copyFromArray(dataa);
r = orderby("cat", "-val").eval(data);
assertEquals(8, r.length);
assertEquals(2, r[0].val); assertEquals(1, r[1].val);
assertEquals(4, r[2].val); assertEquals(3, r[3].val);
assertEquals(6, r[4].val); assertEquals(5, r[5].val);
- assertEquals(8, r[6].val); assertEquals(7, r[7].val);
+ assertEquals(8, r[6].val); assertEquals(7, r[7].val);
r = select("cat", {sum:sum("val")}) // category + sum of values
.where(neq("cat", _("d"))) // exclude category "d"
@@ -341,7 +339,7 @@ package flare.tests
}
var q:Query = select({val:div("val",sum("val"))}).map();
- var r:Vector.<Object> = q.eval(data);
+ var r:Array = q.eval(data);
for (var i:uint=0; i<r.length; ++i) {
assertEquals(data[i].val/sums.all, r[i].val);
}
View
No changes.
View
@@ -2,7 +2,6 @@ package flare.tests
{
import flare.util.Displays;
import flare.util.Sort;
- import flare.util.Vectors;
import flash.display.Shape;
import flash.display.Sprite;
@@ -13,7 +12,6 @@ package flare.tests
{
public function SortTests() {
addTest("testSort");
- addTest("testSortVector");
addTest("testSortDisplayChildren");
}
@@ -69,48 +67,6 @@ package flare.tests
assertEquals(test.check[i], test.items[i]);
}
}
-
- public function testSortVector():void
- {
- var tests:Array = [
- {
- items:Vectors.copyFromArray([a, b, c, d, e, f, g, h]),
- check:Vectors.copyFromArray([h, g, f, e, d, c, b, a]),
- sort: Sort.$("-x")
- },
- {
- items:Vectors.copyFromArray([a, b, c, d, e, f, g, h]),
- check:Vectors.copyFromArray([g, h, e, f, c, d, a, b]),
- sort: Sort.$("-y")
- },
- {
- items:Vectors.copyFromArray([a, b, c, d, e, f, g, h]),
- check:Vectors.copyFromArray([e, f, g, h, a, b, c, d]),
- sort: Sort.$("-z", "+x")
- },
- {
- items:Vectors.copyFromArray([a, b, c, d, e, f, g, h]),
- check:Vectors.copyFromArray([b, a, d, c, f, e, h, g]),
- sort: Sort.$("y", "-x")
- },
- {
- items:Vectors.copyFromArray([a, b, c, d, e, f, g, h]),
- check:Vectors.copyFromArray([a, b, c, d, e, f, g, h]),
- sort: Sort.$("z", "y", "x")
- },
- {
- items:Vectors.copyFromArray([a, b, c, d, e, f, g, h]),
- check:Vectors.copyFromArray([g, h, e, f, c, d, a, b]),
- sort: Sort.$(["-z", "-y", "x"])
- },
- ];
-
- for each (var test:Object in tests) {
- test.items.sort(test.sort);
- for (var i:int=0; i<test.items.length; ++i)
- assertEquals(test.check[i], test.items[i]);
- }
- }
public function testSortDisplayChildren():void
{
No changes.
View
No changes.
View
0 flare.tests/src/tests.as 100755 → 100644
No changes.
@@ -65,7 +65,7 @@ package flare.analytics.cluster
private function compute(Z:IMatrix):void
{
_merges = new MergeEdge(-1, -1);
- _qvals.length = 0;
+ _qvals = [];
_size = Z.rows;
var m:MergeEdge = _merges;
@@ -75,7 +75,7 @@ package flare.analytics.cluster
// initialize matrix
var N:int = Z.rows;
- var idx:Vector.<int> = new Vector.<int>(N);
+ var idx:/*int*/Array = new Array(N);
for (i=0; i<N; ++i) {
idx[i] = i;
Z.set(i,i,Number.POSITIVE_INFINITY);
@@ -51,7 +51,7 @@ package flare.analytics.cluster
/** Computes the clustering */
private function compute(G:IMatrix):void
{
- _merges = new MergeEdge(-1, -1); _qvals.length = 0;
+ _merges = new MergeEdge(-1, -1); _qvals = [];
_size = G.rows;
var i:int, j:int, k:int, s:int, t:int, v:Number;
var Q:Number=0, Qmax:Number=0, dQ:Number, dQmax:Number=0, imax:int;
@@ -65,7 +65,7 @@ package flare.analytics.cluster
var E:MergeEdge = new MergeEdge(-1,-1);
var e:MergeEdge = E, m:MergeEdge = _merges;
var eMax:MergeEdge = new MergeEdge(0,0);
- var A:Vector.<int> = new Vector.<int>(N);
+ var A:Array = new Array(N);
for (i=0; i<N; ++i) {
A[i] = 0;
@@ -1,10 +1,8 @@
package flare.analytics.cluster
{
- import __AS3__.vec.Vector;
-
+ import flare.util.Arrays;
import flare.util.Property;
import flare.util.Sort;
- import flare.util.Vectors;
import flare.vis.data.Data;
import flare.vis.data.DataList;
import flare.vis.data.EdgeSprite;
@@ -41,7 +39,7 @@ package flare.analytics.cluster
protected var _com:Property = Property.$("props.cluster");
/** @private */
- protected var _qvals:Vector.<Object>;
+ protected var _qvals:Array;
/** @private */
protected var _merges:MergeEdge;
/** @private */
@@ -71,7 +69,7 @@ package flare.analytics.cluster
public function set sequenceField(f:String):void { _idx = Property.$(f); }
/** Computed criterion values for each merge in the cluster tree. */
- public function get criteria():Vector.<Object> { return _qvals; }
+ public function get criteria():Array { return _qvals; }
/** The cluster tree of detected community structures. The leaf nodes
* correspond to each of the nodes in the input graph, and include the
@@ -104,7 +102,7 @@ package flare.analytics.cluster
*/
public function labelNodes(merge:int=-1):void
{
- if (merge < 0) merge = Vectors.maxIndex(_qvals);
+ if (merge < 0) merge = Arrays.maxIndex(_qvals);
var com:int, idx:int;
var helper:Function = function(n:NodeSprite):void
{
@@ -174,8 +172,8 @@ package flare.analytics.cluster
delete map[j];
}
- // build and sort vector of cluster roots
- var roots:Vector.<Object> = new Vector.<Object>();
+ // build and sort array of cluster roots
+ var roots:Array = [];
for each (var n:NodeSprite in map) roots.push(n);
roots.sort(Sort.$("-props.size"));
View
No changes.
@@ -1,7 +1,5 @@
package flare.analytics.graph
{
- import __AS3__.vec.Vector;
-
import flare.animate.Transitioner;
import flare.util.Property;
import flare.vis.data.Data;
@@ -66,9 +64,8 @@ package flare.analytics.graph
si.paths = 1;
si.distance = 0;
- var stack:Vector.<NodeSprite> = new Vector.<NodeSprite>();
- var queue:Vector.<NodeSprite> = new Vector.<NodeSprite>();
- queue.push(n);
+ var stack:Array = [];
+ var queue:Array = [n];
while (queue.length > 0) {
stack.push(v = queue.shift()); si = v.props._score;
@@ -104,21 +101,18 @@ package flare.analytics.graph
} // end of class BetweennessCentrality
}
-import flare.util.Vectors;
-import __AS3__.vec.Vector;
+import flare.util.Arrays;
/** Helper class for storing intermediate centrality computations */
class Score {
public var dependency:Number = 0;
public var distance:Number = -1;
public var paths:Number = 0;
- // Doesn't want a Vector here, for some reason
public var predecessors:Array = [];
public var centrality:Number = 0;
public function reset():void {
- //Vectors.clear(predecessors);
- predecessors.length = 0;
+ Arrays.clear(predecessors);
dependency = 0;
distance = -1;
paths = 0;
No changes.
View
@@ -1,7 +1,5 @@
package flare.analytics.graph
{
- import __AS3__.vec.Vector;
-
import flare.animate.Transitioner;
import flare.util.Property;
import flare.vis.data.Data;
@@ -152,9 +150,7 @@ package flare.analytics.graph
{
_data.nodes.setProperty(_c.name, Number.MAX_VALUE);
var visited:Dictionary = new Dictionary();
- var u:NodeSprite, b:Boolean;
- var queue:Vector.<NodeSprite> = new Vector.<NodeSprite>(1);
- queue.push(_s);
+ var queue:Array = [_s], u:NodeSprite, b:Boolean;
while (queue.length > 0) {
visited[u = queue.shift()] = true;
@@ -185,9 +181,7 @@ package flare.analytics.graph
{
_data.nodes.setProperty(_k.name, 1);
var visited:Dictionary = new Dictionary();
- var u:NodeSprite, b:Boolean;
- var queue:Vector.<NodeSprite> = new Vector.<NodeSprite>(1);
- queue.push(_s);
+ var queue:Array = [_s], u:NodeSprite, b:Boolean;
while (queue.length > 0) {
visited[u = queue.shift()] = true;
Oops, something went wrong.

0 comments on commit 748f676

Please sign in to comment.