flex开发包二——flare

   教程网址: http://flare.prefuse.org/tutorial

  好玩的效果:

  smoke

   flex开发包二——flare_第1张图片

         见过一个lib,好像可以产生fire效果,没用过不过感觉应该和这个差不多

Layout

    可以表现多种层次关系:  tree  indent  dendrogram Sunburst

flex开发包二——flare_第2张图片

flex开发包二——flare_第3张图片

  TreeeMap

flex开发包二——flare_第4张图片

Scater

flex开发包二——flare_第5张图片

Bars

可以实现图形的实时变化,不知道fusionchart是否支持

flex开发包二——flare_第6张图片

类库介绍

analytics: operators for computing statistics and analyzing data
animate: tools for creating animations
data: methods for reading and writing data sets
display: DisplayObject types that extend those provided by flash.display
flex: a wrapper for embedding Flare visualizations in Flex applications
physics: a physics engine for physical effects or force-directed layout
query: a query processor for ActionScript objects
scale: classes for handling data scales, such as linear, log, and time scales
util: a set of utility classes providing commonly needed functions
vis: the flare visualization components and operators

动画基础

        the tween can be sequence and parallel, It can set tween easing with different function in Easing class
Batch animations with transitioners
        transitioners适用于对集合或数组元素同时动画的情况 ,可以使用tween和Parallel实现相同功能,但Transitioner更简单,不需要和动画打交道,只需要设置结果值;而且可以重用。
       t.$(item1).x = 50;  使用$设置属性
       the transitioner provides a layer of indirection for updating object properties – these updates can be collected and then animated, or applied immediately.
       you can create methods that update values using a transitioner, and then later control whether or not you want those values updated.

Visualization:

Data:

 对应Visualization中药显示的数据
 可以从两个来源生成Data:DataSet和对象构成的数组,还可以使用工具支持 json , graphXML,tab分割的csv数据
 使用DataSource载入远端对象,支持格式“tab” , “json” , “graphml”,个人觉得前后台使用Json进行通信对flare可能更合适,使用Json.decode转换为对象数组,
 作用:1) as input to a Visualization that is responsible for processing the DataSprite instances and adding them to the Flash display list. 2)使用TreePolicy和TreeEdgeWight构造spanning tree
 有nodes和edges会返回相应的List,对这两个list提供了visit函数,此外setProperties和setProperty可以批量更新属性,其有一可选参数为transioner设置动画效果。setDefault可设置默认属性
 Data和Tree:如果要构造严格的树形结构,我觉得使用Tree就足够了,而且通过addChild函数添加节点,都不需要添加edge

Visualization:


 To create a visualization, we load a data set, add the data to a visualization, and set up operators that determine how to visualize the data.
 TextSprite:支持多种Tetx格式,如Bitmap方式中,可支持旋转和alpha blend
 SwitchButton:可以使用支持点击的Image替换
 使用Timer实现 sleep功能
 DropShadowFilter:向显示对象添加投影
 EdgeSprite:代表图形中的一条连线


Operator:


 IOperator: 代表在Visualization内容上执行的操作需要实现的接口,其实类似于Functor
 Operator:基类,操作种类有 layout  color shape size encoding
 BundledEdgeRouter 实现分组,需要树结构
 PropertyEncoder: 实现对集合中某一属性的同时修改,类似于Closure

 

.

下一步

学习demo
flare.vis.axis: provides axes, labels and gridlines
flare.vis.controls: interaction handlers for selection, zooming, and more
flare.vis.data: visual objects that represent data elements:

DataSprite:

       Base class for sprites that visually represent data. DataSprite is a subclass of the Flash Player's Sprite class. DataSprite includes a data property where the data tuple (an ActionScript Object) is stored and also provides additional visual variables beyond those supported by basic sprites, including color, shape, and size fields, and support for setting positions in polar coordinates.
NodeSprite:

       DataSprite instance representing a node. This is the default type used for visualizing data. NodeSprite instances can be connected within network or tree structures by EdgeSprite instances.
EdgeSprite:

        DataSprite instance representing an edge. An EdgeSprite connects two NodeSprites. The nodes are accessible through the source and target properties. EdgeSprites are used to create graphs and trees, as well as to represent lines, such as in time-series graphs.


       Typically, NodeSprites and EdgeSprites are created and stored in the flare.vis.data.Data class, which manages all the visual items for a single visualization. The Data class provides methods for creating new visual objects for data tuples and for representing a graph structure.

        Data.setProperties 使用动画修改属性

         The Data.fromArray() function creates a Data instance for tabular data stored as an array of ActionScript objects, while the Data.fromDataSet() method similarly creates a Data instance from a loaded DataSet object.


flare.vis.data.render: pluggable renderers that draw DataSprites
flare.vis.events: event types used in the flare framework
flare.vis.legend: represents legends for describing visual encodings
flare.vis.operator: building blocks for defining visualizations
flare.vis.palette: palettes for color, shape, and size values
flare.vis.util: general utility classes

 

你可能感兴趣的:(tree,actionscript,dataset,parallel,methods,Visualization)