rubyvis 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data.tar.gz.sig +0 -0
  2. data/History.txt +8 -0
  3. data/Manifest.txt +45 -36
  4. data/examples/{first_rbp_api.rb → 1_basic/1a_bar_rbp_api.rb} +1 -1
  5. data/examples/{first_protovis_api.rb → 1_basic/1b_bar_pv_api.rb} +1 -1
  6. data/examples/{second.rb → 1_basic/2_bar_and_rule.rb} +2 -2
  7. data/examples/{third.rb → 1_basic/3_grouped_bars.rb} +1 -1
  8. data/examples/{area_interpolation.rb → 1_basic/area_interpolation.rb} +1 -1
  9. data/examples/{dot.rb → 1_basic/dot.rb} +1 -1
  10. data/examples/{fixtures → 1_basic/fixtures}/tipsy.gif +0 -0
  11. data/examples/1_basic/grid.rb +29 -0
  12. data/examples/{image.rb → 1_basic/image.rb} +1 -1
  13. data/examples/{line.rb → 1_basic/line.rb} +1 -1
  14. data/examples/{line_interpolation.rb → 1_basic/line_interpolation.rb} +1 -1
  15. data/examples/2_medium/censo_agropecuario/censo_agropecuario_chile_data.rb +53 -0
  16. data/examples/2_medium/censo_agropecuario/census_treemap.rb +63 -0
  17. data/examples/2_medium/censo_agropecuario/create_data.rb +10 -0
  18. data/examples/2_medium/censo_agropecuario/resultset.csv +51 -0
  19. data/examples/{nested_grid.rb → 2_medium/nested_grid.rb} +3 -4
  20. data/examples/{area.rb → 3_pv_conventional/area.rb} +1 -1
  21. data/examples/{bar_column_chart.rb → 3_pv_conventional/bar_column_chart.rb} +1 -1
  22. data/examples/{grouped_charts.rb → 3_pv_conventional/grouped_charts.rb} +1 -1
  23. data/examples/{line_and_step.rb → 3_pv_conventional/line_and_step.rb} +1 -1
  24. data/examples/{pie_and_donut.rb → 3_pv_conventional/pie_and_donut.rb} +1 -1
  25. data/examples/{scatterplot.rb → 3_pv_conventional/scatterplot.rb} +1 -1
  26. data/examples/{stacked_charts.rb → 3_pv_conventional/stacked_charts.rb} +1 -3
  27. data/examples/{antibiotics → 4_pv_custom/antibiotics}/antibiotics_data.rb +0 -0
  28. data/examples/{antibiotics → 4_pv_custom/antibiotics}/antibiotics_scatter.rb +1 -1
  29. data/examples/{antibiotics → 4_pv_custom/antibiotics}/antibiotics_wedge.rb +1 -1
  30. data/examples/{barley → 4_pv_custom/barley}/barley.rb +5 -1
  31. data/examples/{barley → 4_pv_custom/barley}/barley_data.rb +0 -0
  32. data/examples/{cars → 4_pv_custom/cars}/cars.rb +1 -1
  33. data/examples/{cars → 4_pv_custom/cars}/cars_data.rb +0 -0
  34. data/examples/{crimea → 4_pv_custom/crimea}/crimea_data.rb +0 -0
  35. data/examples/{crimea → 4_pv_custom/crimea}/crimea_grouped_bar.rb +1 -1
  36. data/examples/{crimea → 4_pv_custom/crimea}/crimea_line.rb +1 -1
  37. data/examples/{bubble_charts.rb → 5_pv_hierarchies/bubble_charts.rb} +3 -2
  38. data/examples/5_pv_hierarchies/bubble_charts_matrix.rb +64 -0
  39. data/examples/{circle_packing.rb → 5_pv_hierarchies/circle_packing.rb} +4 -4
  40. data/examples/{dendogram.rb → 5_pv_hierarchies/dendogram.rb} +2 -2
  41. data/examples/{icicle.rb → 5_pv_hierarchies/icicle.rb} +2 -2
  42. data/examples/{indent.rb → 5_pv_hierarchies/indent.rb} +2 -2
  43. data/examples/5_pv_hierarchies/node_link_tree.rb +52 -0
  44. data/examples/{sunburst.rb → 5_pv_hierarchies/sunburst.rb} +2 -2
  45. data/examples/5_pv_hierarchies/treemap.rb +48 -0
  46. data/lib/rubyvis.rb +1 -1
  47. data/lib/rubyvis/dom.rb +16 -1
  48. data/lib/rubyvis/internals.rb +2 -2
  49. data/lib/rubyvis/layout.rb +2 -0
  50. data/lib/rubyvis/layout/grid.rb +105 -0
  51. data/lib/rubyvis/layout/pack.rb +53 -54
  52. data/lib/rubyvis/layout/stack.rb +26 -24
  53. data/lib/rubyvis/layout/tree.rb +267 -0
  54. data/lib/rubyvis/layout/treemap.rb +1 -0
  55. data/lib/rubyvis/mark.rb +10 -8
  56. data/lib/rubyvis/mark/area.rb +6 -6
  57. data/lib/rubyvis/mark/dot.rb +1 -1
  58. data/lib/rubyvis/mark/shorcut_methods.rb +29 -2
  59. data/lib/rubyvis/nest.rb +48 -2
  60. data/lib/rubyvis/scale/ordinal.rb +6 -6
  61. data/lib/rubyvis/scale/quantitative.rb +13 -7
  62. data/lib/rubyvis/scene/svg_area.rb +20 -14
  63. data/lib/rubyvis/scene/svg_bar.rb +1 -1
  64. data/lib/rubyvis/scene/svg_scene.rb +0 -1
  65. data/lib/rubyvis/sceneelement.rb +1 -1
  66. data/spec/area_spec.rb +12 -0
  67. data/spec/dom_spec.rb +15 -8
  68. data/spec/layout_stack_spec.rb +70 -0
  69. data/spec/nest_spec.rb +8 -2
  70. data/spec/scale_linear_spec.rb +7 -1
  71. data/spec/scale_ordinal_spec.rb +4 -0
  72. data/spec/spec_helper.rb +1 -1
  73. data/web/build_site.rb +6 -2
  74. data/web/index.haml +2 -2
  75. metadata +61 -68
  76. metadata.gz.sig +0 -0
  77. data/examples/treemap/treemap.rb +0 -29
  78. data/examples/treemap/treemap_data.rb +0 -285
metadata.gz.sig CHANGED
Binary file
@@ -1,29 +0,0 @@
1
- # = Treemap
2
- # Introduced by Ben Shneiderman in 1991, a treemap recursively subdivides area into rectangles. As with adjacency diagrams, the size of any node in the tree is quickly revealed. This example uses color to encode different packages of the Flare visualization toolkit, and area to encode file size. “Squarified” treemaps use approximately square rectangles, which offer better readability and size estimation than naive “slice-and-dice” subdivision. Fancier algorithms such as Voronoi and jigsaw treemaps also exist but are less common.
3
-
4
- $:.unshift(File.dirname(__FILE__)+"/../../lib")
5
- require 'rubyvis'
6
- load(File.dirname(__FILE__)+"/treemap_data.rb")
7
- color = pv.Colors.category19
8
- nodes = pv.dom($flare).root("flare").nodes
9
-
10
-
11
- vis = pv.Panel.new()
12
- .width(600)
13
- .height(1000)
14
-
15
- treemap = vis.add(Rubyvis::Layout::Treemap).
16
- nodes(nodes).mode("squarify").round(true)
17
-
18
- treemap.leaf.add(Rubyvis::Panel).
19
- fill_style(lambda{|d|
20
- color.scale(d.parent_node.node_name)}).
21
- stroke_style("#fff").
22
- line_width(1).
23
- antialias(false)
24
-
25
- treemap.node_label.add(Rubyvis::Label).
26
- text_style(lambda {|d| pv.rgb(0, 0, 0, 1)})
27
-
28
- vis.render
29
- puts vis.to_svg
@@ -1,285 +0,0 @@
1
- $flare = {
2
- analytics: {
3
- cluster: {
4
- AgglomerativeCluster: 3938,
5
- CommunityStructure: 3812,
6
- HierarchicalCluster: 6714,
7
- MergeEdge: 743
8
- },
9
- graph: {
10
- BetweennessCentrality: 3534,
11
- LinkDistance: 5731,
12
- MaxFlowMinCut: 7840,
13
- ShortestPaths: 5914,
14
- SpanningTree: 3416
15
- },
16
- optimization: {
17
- AspectRatioBanker: 7074
18
- }
19
- },
20
- animate: {
21
- Easing: 17010,
22
- FunctionSequence: 5842,
23
- interpolate: {
24
- ArrayInterpolator: 1983,
25
- ColorInterpolator: 2047,
26
- DateInterpolator: 1375,
27
- Interpolator: 8746,
28
- MatrixInterpolator: 2202,
29
- NumberInterpolator: 1382,
30
- ObjectInterpolator: 1629,
31
- PointInterpolator: 1675,
32
- RectangleInterpolator: 2042
33
- },
34
- ISchedulable: 1041,
35
- Parallel: 5176,
36
- Pause: 449,
37
- Scheduler: 5593,
38
- Sequence: 5534,
39
- Transition: 9201,
40
- Transitioner: 19975,
41
- TransitionEvent: 1116,
42
- Tween: 6006
43
- },
44
- data: {
45
- converters: {
46
- Converters: 721,
47
- DelimitedTextConverter: 4294,
48
- GraphMLConverter: 9800,
49
- IDataConverter: 1314,
50
- JSONConverter: 2220
51
- },
52
- DataField: 1759,
53
- DataSchema: 2165,
54
- DataSet: 586,
55
- DataSource: 3331,
56
- DataTable: 772,
57
- DataUtil: 3322
58
- },
59
- display: {
60
- DirtySprite: 8833,
61
- LineSprite: 1732,
62
- RectSprite: 3623,
63
- TextSprite: 10066
64
- },
65
- flex: {
66
- FlareVis: 4116
67
- },
68
- physics: {
69
- DragForce: 1082,
70
- GravityForce: 1336,
71
- IForce: 319,
72
- NBodyForce: 10498,
73
- Particle: 2822,
74
- Simulation: 9983,
75
- Spring: 2213,
76
- SpringForce: 1681
77
- },
78
- query: {
79
- AggregateExpression: 1616,
80
- And: 1027,
81
- Arithmetic: 3891,
82
- Average: 891,
83
- BinaryExpression: 2893,
84
- Comparison: 5103,
85
- CompositeExpression: 3677,
86
- Count: 781,
87
- DateUtil: 4141,
88
- Distinct: 933,
89
- Expression: 5130,
90
- ExpressionIterator: 3617,
91
- Fn: 3240,
92
- If: 2732,
93
- IsA: 2039,
94
- Literal: 1214,
95
- Match: 3748,
96
- Maximum: 843,
97
- methods: {
98
- add: 593,
99
- and: 330,
100
- average: 287,
101
- count: 277,
102
- distinct: 292,
103
- div: 595,
104
- eq: 594,
105
- fn: 460,
106
- gt: 603,
107
- gte: 625,
108
- iff: 748,
109
- isa: 461,
110
- lt: 597,
111
- lte: 619,
112
- max: 283,
113
- min: 283,
114
- mod: 591,
115
- mul: 603,
116
- neq: 599,
117
- not: 386,
118
- or: 323,
119
- orderby: 307,
120
- range: 772,
121
- select: 296,
122
- stddev: 363,
123
- sub: 600,
124
- sum: 280,
125
- update: 307,
126
- variance: 335,
127
- where: 299,
128
- xor: 354,
129
- _: 264
130
- },
131
- Minimum: 843,
132
- Not: 1554,
133
- Or: 970,
134
- Query: 13896,
135
- Range: 1594,
136
- StringUtil: 4130,
137
- Sum: 791,
138
- Variable: 1124,
139
- Variance: 1876,
140
- Xor: 1101
141
- },
142
- scale: {
143
- IScaleMap: 2105,
144
- LinearScale: 1316,
145
- LogScale: 3151,
146
- OrdinalScale: 3770,
147
- QuantileScale: 2435,
148
- QuantitativeScale: 4839,
149
- RootScale: 1756,
150
- Scale: 4268,
151
- ScaleType: 1821,
152
- TimeScale: 5833
153
- },
154
- util: {
155
- Arrays: 8258,
156
- Colors: 10001,
157
- Dates: 8217,
158
- Displays: 12555,
159
- Filter: 2324,
160
- Geometry: 10993,
161
- heap: {
162
- FibonacciHeap: 9354,
163
- HeapNode: 1233
164
- },
165
- IEvaluable: 335,
166
- IPredicate: 383,
167
- IValueProxy: 874,
168
- math: {
169
- DenseMatrix: 3165,
170
- IMatrix: 2815,
171
- SparseMatrix: 3366
172
- },
173
- Maths: 17705,
174
- Orientation: 1486,
175
- palette: {
176
- ColorPalette: 6367,
177
- Palette: 1229,
178
- ShapePalette: 2059,
179
- SizePalette: 2291
180
- },
181
- Property: 5559,
182
- Shapes: 19118,
183
- Sort: 6887,
184
- Stats: 6557,
185
- Strings: 22026
186
- },
187
- vis: {
188
- axis: {
189
- Axes: 1302,
190
- Axis: 24593,
191
- AxisGridLine: 652,
192
- AxisLabel: 636,
193
- CartesianAxes: 6703
194
- },
195
- controls: {
196
- AnchorControl: 2138,
197
- ClickControl: 3824,
198
- Control: 1353,
199
- ControlList: 4665,
200
- DragControl: 2649,
201
- ExpandControl: 2832,
202
- HoverControl: 4896,
203
- IControl: 763,
204
- PanZoomControl: 5222,
205
- SelectionControl: 7862,
206
- TooltipControl: 8435
207
- },
208
- data: {
209
- Data: 20544,
210
- DataList: 19788,
211
- DataSprite: 10349,
212
- EdgeSprite: 3301,
213
- NodeSprite: 19382,
214
- render: {
215
- ArrowType: 698,
216
- EdgeRenderer: 5569,
217
- IRenderer: 353,
218
- ShapeRenderer: 2247
219
- },
220
- ScaleBinding: 11275,
221
- Tree: 7147,
222
- TreeBuilder: 9930
223
- },
224
- events: {
225
- DataEvent: 2313,
226
- SelectionEvent: 1880,
227
- TooltipEvent: 1701,
228
- VisualizationEvent: 1117
229
- },
230
- legend: {
231
- Legend: 20859,
232
- LegendItem: 4614,
233
- LegendRange: 10530
234
- },
235
- operator: {
236
- distortion: {
237
- BifocalDistortion: 4461,
238
- Distortion: 6314,
239
- FisheyeDistortion: 3444
240
- },
241
- encoder: {
242
- ColorEncoder: 3179,
243
- Encoder: 4060,
244
- PropertyEncoder: 4138,
245
- ShapeEncoder: 1690,
246
- SizeEncoder: 1830
247
- },
248
- filter: {
249
- FisheyeTreeFilter: 5219,
250
- GraphDistanceFilter: 3165,
251
- VisibilityFilter: 3509
252
- },
253
- IOperator: 1286,
254
- label: {
255
- Labeler: 9956,
256
- RadialLabeler: 3899,
257
- StackedAreaLabeler: 3202
258
- },
259
- layout: {
260
- AxisLayout: 6725,
261
- BundledEdgeRouter: 3727,
262
- CircleLayout: 9317,
263
- CirclePackingLayout: 12003,
264
- DendrogramLayout: 4853,
265
- ForceDirectedLayout: 8411,
266
- IcicleTreeLayout: 4864,
267
- IndentedTreeLayout: 3174,
268
- Layout: 7881,
269
- NodeLinkTreeLayout: 12870,
270
- PieLayout: 2728,
271
- RadialTreeLayout: 12348,
272
- RandomLayout: 870,
273
- StackedAreaLayout: 9121,
274
- TreeMapLayout: 9191
275
- },
276
- Operator: 2490,
277
- OperatorList: 5248,
278
- OperatorSequence: 4190,
279
- OperatorSwitch: 2581,
280
- SortOperator: 2023
281
- },
282
- Visualization: 16540
283
- }
284
- };
285
-