ziya 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/Manifest.txt +127 -0
- data/README.txt +137 -0
- data/Rakefile +45 -0
- data/bin/ziyafy +51 -0
- data/charts/charts.swf +0 -0
- data/charts/charts_library/arno.swf +0 -0
- data/charts/charts_library/arst.swf +0 -0
- data/charts/charts_library/brfl.swf +0 -0
- data/charts/charts_library/brno.swf +0 -0
- data/charts/charts_library/brst.swf +0 -0
- data/charts/charts_library/cl3d.swf +0 -0
- data/charts/charts_library/clfl.swf +0 -0
- data/charts/charts_library/clno.swf +0 -0
- data/charts/charts_library/clp3.swf +0 -0
- data/charts/charts_library/cls3.swf +0 -0
- data/charts/charts_library/clst.swf +0 -0
- data/charts/charts_library/cnno.swf +0 -0
- data/charts/charts_library/lnno.swf +0 -0
- data/charts/charts_library/mxno.swf +0 -0
- data/charts/charts_library/pi3d.swf +0 -0
- data/charts/charts_library/pino.swf +0 -0
- data/charts/charts_library/pono.swf +0 -0
- data/charts/charts_library/scno.swf +0 -0
- data/charts/themes/commando/bar_chart.yml +9 -0
- data/charts/themes/commando/base_chart.yml +65 -0
- data/charts/themes/commando/column_chart.yml +13 -0
- data/charts/themes/commando/column_threed_chart.yml +25 -0
- data/charts/themes/commando/parallel_threed_column_chart.yml +17 -0
- data/charts/themes/commando/pie_chart.yml +22 -0
- data/charts/themes/commando/pie_threed_chart.yml +28 -0
- data/charts/themes/commando/polar_chart.yml +11 -0
- data/charts/themes/commando/stacked_bar_chart.yml +9 -0
- data/charts/themes/commando/stacked_column_chart.yml +14 -0
- data/charts/themes/commando/stacked_threed_column_chart.yml +17 -0
- data/charts/themes/default/bar_chart.yml +3 -0
- data/charts/themes/default/base_chart.yml +67 -0
- data/charts/themes/default/column_chart.yml +13 -0
- data/charts/themes/default/column_threed_chart.yml +25 -0
- data/charts/themes/default/parallel_threed_column_chart.yml +17 -0
- data/charts/themes/default/pie_chart.yml +29 -0
- data/charts/themes/default/pie_threed_chart.yml +28 -0
- data/charts/themes/default/polar_chart.yml +12 -0
- data/charts/themes/default/stacked_bar_chart.yml +3 -0
- data/charts/themes/default/stacked_column_chart.yml +14 -0
- data/charts/themes/default/stacked_threed_column_chart.yml +17 -0
- data/charts/themes/default/test.yml +4 -0
- data/lib/ziya.rb +100 -0
- data/lib/ziya/charts/area.rb +13 -0
- data/lib/ziya/charts/bar.rb +11 -0
- data/lib/ziya/charts/base.rb +435 -0
- data/lib/ziya/charts/candle_stick.rb +11 -0
- data/lib/ziya/charts/column.rb +11 -0
- data/lib/ziya/charts/column_threed.rb +11 -0
- data/lib/ziya/charts/floating_bar.rb +11 -0
- data/lib/ziya/charts/floating_column.rb +11 -0
- data/lib/ziya/charts/line.rb +11 -0
- data/lib/ziya/charts/mixed.rb +11 -0
- data/lib/ziya/charts/parallel_threed_column.rb +11 -0
- data/lib/ziya/charts/pie.rb +11 -0
- data/lib/ziya/charts/pie_threed.rb +11 -0
- data/lib/ziya/charts/polar.rb +11 -0
- data/lib/ziya/charts/scatter.rb +11 -0
- data/lib/ziya/charts/stacked_area.rb +11 -0
- data/lib/ziya/charts/stacked_bar.rb +11 -0
- data/lib/ziya/charts/stacked_column.rb +11 -0
- data/lib/ziya/charts/stacked_threed_column.rb +11 -0
- data/lib/ziya/components/area.rb +14 -0
- data/lib/ziya/components/axis_category.rb +69 -0
- data/lib/ziya/components/axis_ticks.rb +37 -0
- data/lib/ziya/components/axis_value.rb +59 -0
- data/lib/ziya/components/base.rb +100 -0
- data/lib/ziya/components/chart_border.rb +33 -0
- data/lib/ziya/components/chart_grid_h.rb +28 -0
- data/lib/ziya/components/chart_grid_v.rb +28 -0
- data/lib/ziya/components/chart_pref.rb +22 -0
- data/lib/ziya/components/chart_rect.rb +36 -0
- data/lib/ziya/components/chart_transition.rb +26 -0
- data/lib/ziya/components/chart_value.rb +71 -0
- data/lib/ziya/components/circle.rb +13 -0
- data/lib/ziya/components/draw.rb +45 -0
- data/lib/ziya/components/image.rb +13 -0
- data/lib/ziya/components/legend_label.rb +18 -0
- data/lib/ziya/components/legend_rect.rb +19 -0
- data/lib/ziya/components/legend_transition.rb +18 -0
- data/lib/ziya/components/line.rb +12 -0
- data/lib/ziya/components/link.rb +29 -0
- data/lib/ziya/components/link_data.rb +19 -0
- data/lib/ziya/components/live_update.rb +21 -0
- data/lib/ziya/components/rect.rb +13 -0
- data/lib/ziya/components/series_color.rb +35 -0
- data/lib/ziya/components/series_explode.rb +38 -0
- data/lib/ziya/components/series_gap.rb +18 -0
- data/lib/ziya/components/series_switch.rb +25 -0
- data/lib/ziya/components/text.rb +13 -0
- data/lib/ziya/helpers/base_helper.rb +37 -0
- data/lib/ziya/utils/logger.rb +125 -0
- data/lib/ziya/utils/text.rb +33 -0
- data/lib/ziya/version.rb +15 -0
- data/lib/ziya/ziya_helper.rb +147 -0
- data/spec/charts/base_spec.rb +120 -0
- data/spec/charts/chart_type_spec.rb +42 -0
- data/spec/components/area_spec.rb +60 -0
- data/spec/components/draw_spec.rb +33 -0
- data/spec/components/link_spec.rb +23 -0
- data/spec/components/series_color_spec.rb +40 -0
- data/spec/components/series_explode_spec.rb +40 -0
- data/spec/components/series_switch_spec.rb +19 -0
- data/spec/helpers/base_helper_spec.rb +22 -0
- data/spec/spec_helper.rb +7 -0
- data/spec/themes/default/fred.yml +6 -0
- data/spec/themes/default/line_chart.yml +6 -0
- data/spec/utils/logger_spec.rb +57 -0
- data/spec/utils/text_spec.rb +34 -0
- data/spec/ziya_helper_spec.rb +40 -0
- data/spec/ziya_spec.rb +19 -0
- data/tasks/ann.rake +76 -0
- data/tasks/annotations.rake +22 -0
- data/tasks/doc.rake +48 -0
- data/tasks/gem.rake +110 -0
- data/tasks/manifest.rake +49 -0
- data/tasks/post_load.rake +26 -0
- data/tasks/rubyforge.rake +57 -0
- data/tasks/setup.rb +227 -0
- data/tasks/spec.rake +61 -0
- data/tasks/svn.rake +44 -0
- data/tasks/test.rake +38 -0
- metadata +190 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
History.txt
|
|
2
|
+
Manifest.txt
|
|
3
|
+
README.txt
|
|
4
|
+
Rakefile
|
|
5
|
+
bin/ziyafy
|
|
6
|
+
charts/charts.swf
|
|
7
|
+
charts/charts_library/arno.swf
|
|
8
|
+
charts/charts_library/arst.swf
|
|
9
|
+
charts/charts_library/brfl.swf
|
|
10
|
+
charts/charts_library/brno.swf
|
|
11
|
+
charts/charts_library/brst.swf
|
|
12
|
+
charts/charts_library/cl3d.swf
|
|
13
|
+
charts/charts_library/clfl.swf
|
|
14
|
+
charts/charts_library/clno.swf
|
|
15
|
+
charts/charts_library/clp3.swf
|
|
16
|
+
charts/charts_library/cls3.swf
|
|
17
|
+
charts/charts_library/clst.swf
|
|
18
|
+
charts/charts_library/cnno.swf
|
|
19
|
+
charts/charts_library/lnno.swf
|
|
20
|
+
charts/charts_library/mxno.swf
|
|
21
|
+
charts/charts_library/pi3d.swf
|
|
22
|
+
charts/charts_library/pino.swf
|
|
23
|
+
charts/charts_library/pono.swf
|
|
24
|
+
charts/charts_library/scno.swf
|
|
25
|
+
charts/themes/commando/bar_chart.yml
|
|
26
|
+
charts/themes/commando/base_chart.yml
|
|
27
|
+
charts/themes/commando/column_chart.yml
|
|
28
|
+
charts/themes/commando/column_threed_chart.yml
|
|
29
|
+
charts/themes/commando/parallel_threed_column_chart.yml
|
|
30
|
+
charts/themes/commando/pie_chart.yml
|
|
31
|
+
charts/themes/commando/pie_threed_chart.yml
|
|
32
|
+
charts/themes/commando/polar_chart.yml
|
|
33
|
+
charts/themes/commando/stacked_bar_chart.yml
|
|
34
|
+
charts/themes/commando/stacked_column_chart.yml
|
|
35
|
+
charts/themes/commando/stacked_threed_column_chart.yml
|
|
36
|
+
charts/themes/default/bar_chart.yml
|
|
37
|
+
charts/themes/default/base_chart.yml
|
|
38
|
+
charts/themes/default/column_chart.yml
|
|
39
|
+
charts/themes/default/column_threed_chart.yml
|
|
40
|
+
charts/themes/default/parallel_threed_column_chart.yml
|
|
41
|
+
charts/themes/default/pie_chart.yml
|
|
42
|
+
charts/themes/default/pie_threed_chart.yml
|
|
43
|
+
charts/themes/default/polar_chart.yml
|
|
44
|
+
charts/themes/default/stacked_bar_chart.yml
|
|
45
|
+
charts/themes/default/stacked_column_chart.yml
|
|
46
|
+
charts/themes/default/stacked_threed_column_chart.yml
|
|
47
|
+
charts/themes/default/test.yml
|
|
48
|
+
lib/ziya.rb
|
|
49
|
+
lib/ziya/charts/area.rb
|
|
50
|
+
lib/ziya/charts/bar.rb
|
|
51
|
+
lib/ziya/charts/base.rb
|
|
52
|
+
lib/ziya/charts/candle_stick.rb
|
|
53
|
+
lib/ziya/charts/column.rb
|
|
54
|
+
lib/ziya/charts/column_threed.rb
|
|
55
|
+
lib/ziya/charts/floating_bar.rb
|
|
56
|
+
lib/ziya/charts/floating_column.rb
|
|
57
|
+
lib/ziya/charts/line.rb
|
|
58
|
+
lib/ziya/charts/mixed.rb
|
|
59
|
+
lib/ziya/charts/parallel_threed_column.rb
|
|
60
|
+
lib/ziya/charts/pie.rb
|
|
61
|
+
lib/ziya/charts/pie_threed.rb
|
|
62
|
+
lib/ziya/charts/polar.rb
|
|
63
|
+
lib/ziya/charts/scatter.rb
|
|
64
|
+
lib/ziya/charts/stacked_area.rb
|
|
65
|
+
lib/ziya/charts/stacked_bar.rb
|
|
66
|
+
lib/ziya/charts/stacked_column.rb
|
|
67
|
+
lib/ziya/charts/stacked_threed_column.rb
|
|
68
|
+
lib/ziya/components/area.rb
|
|
69
|
+
lib/ziya/components/axis_category.rb
|
|
70
|
+
lib/ziya/components/axis_ticks.rb
|
|
71
|
+
lib/ziya/components/axis_value.rb
|
|
72
|
+
lib/ziya/components/base.rb
|
|
73
|
+
lib/ziya/components/chart_border.rb
|
|
74
|
+
lib/ziya/components/chart_grid_h.rb
|
|
75
|
+
lib/ziya/components/chart_grid_v.rb
|
|
76
|
+
lib/ziya/components/chart_pref.rb
|
|
77
|
+
lib/ziya/components/chart_rect.rb
|
|
78
|
+
lib/ziya/components/chart_transition.rb
|
|
79
|
+
lib/ziya/components/chart_value.rb
|
|
80
|
+
lib/ziya/components/circle.rb
|
|
81
|
+
lib/ziya/components/draw.rb
|
|
82
|
+
lib/ziya/components/image.rb
|
|
83
|
+
lib/ziya/components/legend_label.rb
|
|
84
|
+
lib/ziya/components/legend_rect.rb
|
|
85
|
+
lib/ziya/components/legend_transition.rb
|
|
86
|
+
lib/ziya/components/line.rb
|
|
87
|
+
lib/ziya/components/link.rb
|
|
88
|
+
lib/ziya/components/link_data.rb
|
|
89
|
+
lib/ziya/components/live_update.rb
|
|
90
|
+
lib/ziya/components/rect.rb
|
|
91
|
+
lib/ziya/components/series_color.rb
|
|
92
|
+
lib/ziya/components/series_explode.rb
|
|
93
|
+
lib/ziya/components/series_gap.rb
|
|
94
|
+
lib/ziya/components/series_switch.rb
|
|
95
|
+
lib/ziya/components/text.rb
|
|
96
|
+
lib/ziya/helpers/base_helper.rb
|
|
97
|
+
lib/ziya/utils/logger.rb
|
|
98
|
+
lib/ziya/utils/text.rb
|
|
99
|
+
lib/ziya/version.rb
|
|
100
|
+
lib/ziya/ziya_helper.rb
|
|
101
|
+
spec/charts/base_spec.rb
|
|
102
|
+
spec/charts/chart_type_spec.rb
|
|
103
|
+
spec/components/area_spec.rb
|
|
104
|
+
spec/components/draw_spec.rb
|
|
105
|
+
spec/components/link_spec.rb
|
|
106
|
+
spec/components/series_color_spec.rb
|
|
107
|
+
spec/components/series_explode_spec.rb
|
|
108
|
+
spec/components/series_switch_spec.rb
|
|
109
|
+
spec/helpers/base_helper_spec.rb
|
|
110
|
+
spec/spec_helper.rb
|
|
111
|
+
spec/themes/default/fred.yml
|
|
112
|
+
spec/themes/default/line_chart.yml
|
|
113
|
+
spec/utils/logger_spec.rb
|
|
114
|
+
spec/utils/text_spec.rb
|
|
115
|
+
spec/ziya_helper_spec.rb
|
|
116
|
+
spec/ziya_spec.rb
|
|
117
|
+
tasks/ann.rake
|
|
118
|
+
tasks/annotations.rake
|
|
119
|
+
tasks/doc.rake
|
|
120
|
+
tasks/gem.rake
|
|
121
|
+
tasks/manifest.rake
|
|
122
|
+
tasks/post_load.rake
|
|
123
|
+
tasks/rubyforge.rake
|
|
124
|
+
tasks/setup.rb
|
|
125
|
+
tasks/spec.rake
|
|
126
|
+
tasks/svn.rake
|
|
127
|
+
tasks/test.rake
|
data/README.txt
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
ziya
|
|
2
|
+
by Fernand Galiana
|
|
3
|
+
ziya.rubyforge.org
|
|
4
|
+
|
|
5
|
+
== DESCRIPTION:
|
|
6
|
+
|
|
7
|
+
ZiYa allows you to easily display graphs in your ruby based applications by leveraging
|
|
8
|
+
SWF Charts (http://www.maani.us/xml_charts/index.php). This plugin bundles version 4.7
|
|
9
|
+
of the flash library. Incorporating flash graphs in your app relieves the server by
|
|
10
|
+
allowing for delegating graph rendering to the client side. Using this plugin, you will
|
|
11
|
+
be able to easily create great looking charts for your application. You will also be able
|
|
12
|
+
to use the charts has a navigation scheme by embedding various link in the chart components
|
|
13
|
+
thus bring to the table an ideal scheme for reporting and dashboard like applications. Your
|
|
14
|
+
managers will love you for it !!
|
|
15
|
+
|
|
16
|
+
Checkout the demo: http://ziya.liquidrail.com
|
|
17
|
+
Video : http://www.youtube.com/watch?v=axIMmMHdXzo ( Out of date but you'll get the basics... )
|
|
18
|
+
Documentation : http://ziya.liquidrail.com/rdoc ( New docs coming soon... )
|
|
19
|
+
Forum : http://groups.google.com/group/ziya-plugin
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
== FEATURES:
|
|
23
|
+
|
|
24
|
+
* Allows you to style your charts just like you would an html page using css styles
|
|
25
|
+
philosophy. Each chart can be associated with a YAML file that allows you to specify
|
|
26
|
+
preferences based on SWF Charts properties. Chart style sheet reside under
|
|
27
|
+
public/charts/themes. By default all styling resides under the 'default' directory.
|
|
28
|
+
Each chart type may have an associated YAML file. You can either inherit the default
|
|
29
|
+
styles or define your own by specifying an id when you create your graph. The styles
|
|
30
|
+
will cascade thru your graph class hierarchy and override default preferences as you
|
|
31
|
+
would in a style sheet.
|
|
32
|
+
|
|
33
|
+
NOTE: XML/SWF charts are free of charge unless you need to use special features such
|
|
34
|
+
as embedded links and printing.
|
|
35
|
+
The package cost $45 per domain and is well worth the investment.
|
|
36
|
+
|
|
37
|
+
* We are leveraging ERB within the YAML file to provide access to the chart state. State
|
|
38
|
+
can be passed in via the options hash when the graph is generated.
|
|
39
|
+
You can also define your own methods in helpers/ZiyaHelpers. You can access these
|
|
40
|
+
helper methods in your style file just like you would in a rails template.
|
|
41
|
+
|
|
42
|
+
* Theme support. You can change the appearance and behavior of any charts by introducing
|
|
43
|
+
new themes under the public/charts/themes directory.
|
|
44
|
+
|
|
45
|
+
== SYNOPSIS:
|
|
46
|
+
|
|
47
|
+
When using within a rails application you will need to create a ziya.rb file in your
|
|
48
|
+
config/initializers directory ( Rails 2.0 )
|
|
49
|
+
|
|
50
|
+
ziya.rb:
|
|
51
|
+
|
|
52
|
+
# Pull in the ZiYa gem framework
|
|
53
|
+
gem "ziya", "~> 1.0.0"
|
|
54
|
+
require 'ziya'
|
|
55
|
+
|
|
56
|
+
# Initializes the ZiYa Framework
|
|
57
|
+
Ziya.initialize( :logger => RAILS_DEFAULT_LOGGER,
|
|
58
|
+
:helpers_dir => File.join( File.dirname(__FILE__), %w[.. .. app helpers ziya] ),
|
|
59
|
+
:themes_dir => File.join( File.dirname(__FILE__), %w[.. .. public charts themes]) )
|
|
60
|
+
|
|
61
|
+
This will initialize the gem. You can log the output to stdout as well using the ZiYa bundled logger
|
|
62
|
+
or specify a file ie File.join( File.dirname(__FILE__), %w[.. log ziya.log]. If you choose to user the
|
|
63
|
+
ZiYa logger, you can specify the :log_level option to either :warn :info :debug or :error.
|
|
64
|
+
You will need to indicate your themes directory typically located under public/charts/themes or any location
|
|
65
|
+
you'll choose. Otherwise ZiYa will used the default themes from the gem ie default or commando.
|
|
66
|
+
Lastly you can specify a custom helper directory :helpers_dir, so you can use helper methods within your
|
|
67
|
+
ZiYa stylesheets.
|
|
68
|
+
|
|
69
|
+
* Creating a chart
|
|
70
|
+
|
|
71
|
+
blee_controller.rb
|
|
72
|
+
|
|
73
|
+
class BleeController < ApplicationController
|
|
74
|
+
helper Ziya::Helper
|
|
75
|
+
|
|
76
|
+
# Callback from the flash movie to get the chart's data
|
|
77
|
+
def load_chart
|
|
78
|
+
chart = Ziya::Charts::Bar.new
|
|
79
|
+
chart.add( :axis_category_text, %w[2006 2007 2008] )
|
|
80
|
+
chart.add( :series, "Dogs", [10,20,30] )
|
|
81
|
+
chart.add( :series, "Cats", [5,15,25] )
|
|
82
|
+
|
|
83
|
+
respond_to do |fmt|
|
|
84
|
+
fmt.xml => { render :xml => chart.to_xml }
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
blee/index.html.erb
|
|
89
|
+
|
|
90
|
+
<!-- Setups up flash in the html template -->
|
|
91
|
+
<%= ziya_chart load_chart_url, :size => "300x200" -%>
|
|
92
|
+
|
|
93
|
+
config/route.rb
|
|
94
|
+
|
|
95
|
+
# Creates a named route for the chart.
|
|
96
|
+
map.load_chart '/blee/load_chart', :controller => 'blee', :action => 'load_chart'
|
|
97
|
+
|
|
98
|
+
== REQUIREMENTS:
|
|
99
|
+
|
|
100
|
+
ZiYa depends on the logging gem version > 0.7.1
|
|
101
|
+
|
|
102
|
+
== INSTALL:
|
|
103
|
+
|
|
104
|
+
sudo gem install ziya
|
|
105
|
+
|
|
106
|
+
cd to your application directory and issue the following command
|
|
107
|
+
|
|
108
|
+
> ziyafy
|
|
109
|
+
|
|
110
|
+
This will copy the necessary themes and flash files to run ziya in your application
|
|
111
|
+
public/charts directory.
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
== LICENSE:
|
|
115
|
+
|
|
116
|
+
(The MIT License)
|
|
117
|
+
|
|
118
|
+
Copyright (c) 2008 FIXME (different license?)
|
|
119
|
+
|
|
120
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
121
|
+
a copy of this software and associated documentation files (the
|
|
122
|
+
'Software'), to deal in the Software without restriction, including
|
|
123
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
124
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
125
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
126
|
+
the following conditions:
|
|
127
|
+
|
|
128
|
+
The above copyright notice and this permission notice shall be
|
|
129
|
+
included in all copies or substantial portions of the Software.
|
|
130
|
+
|
|
131
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
132
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
133
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
134
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
135
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
136
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
137
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Look in the tasks/setup.rb file for the various options that can be
|
|
2
|
+
# configured in this Rakefile. The .rake files in the tasks directory
|
|
3
|
+
# are where the options are used.
|
|
4
|
+
|
|
5
|
+
load 'tasks/setup.rb'
|
|
6
|
+
|
|
7
|
+
ensure_in_path 'lib'
|
|
8
|
+
require 'ziya'
|
|
9
|
+
require 'ziya/version'
|
|
10
|
+
|
|
11
|
+
task :default => 'spec:run'
|
|
12
|
+
|
|
13
|
+
PROJ.name = 'ziya'
|
|
14
|
+
PROJ.authors = 'Fernand Galiana'
|
|
15
|
+
PROJ.email = 'fernand@liquidrail.com'
|
|
16
|
+
PROJ.url = 'http://ziya.rubyforge.org'
|
|
17
|
+
PROJ.rubyforge_name = 'ziya'
|
|
18
|
+
PROJ.description = "Easily add charting to your rails/merb applications"
|
|
19
|
+
PROJ.spec_opts << '--color'
|
|
20
|
+
PROJ.rcov_dir = ENV['CC_BUILD_ARTIFACTS'] ? "#{ENV['CC_BUILD_ARTIFACTS']}/test_coverage" : 'coverage'
|
|
21
|
+
PROJ.rdoc_dir = ENV['CC_BUILD_ARTIFACTS'] ? "#{ENV['CC_BUILD_ARTIFACTS']}/api_docs" : 'docs'
|
|
22
|
+
PROJ.ruby_opts = %w[-W0]
|
|
23
|
+
PROJ.version = ::Ziya::Version.version
|
|
24
|
+
PROJ.svn = 'ziya'
|
|
25
|
+
PROJ.rcov_threshold = 90.0
|
|
26
|
+
PROJ.executables = ['ziyafy']
|
|
27
|
+
|
|
28
|
+
PROJ.exclude << %w[.DS_Store$ .swo$ .swp$]
|
|
29
|
+
PROJ.tests = FileList['test/**/test_*.rb']
|
|
30
|
+
PROJ.annotation_tags << 'BOZO'
|
|
31
|
+
|
|
32
|
+
desc "Clean up artifact directories"
|
|
33
|
+
task :clean do
|
|
34
|
+
rcov_artifacts = File.join( File.dirname( __FILE__ ), "coverage" )
|
|
35
|
+
FileUtils.rm_rf rcov_artifacts if File.exists? rcov_artifacts
|
|
36
|
+
rdoc_artifacts = File.join( File.dirname( __FILE__ ), "docs" )
|
|
37
|
+
FileUtils.rm_rf rdoc_artifacts if File.exists? rdoc_artifacts
|
|
38
|
+
gem_artifacts = File.join( File.dirname( __FILE__ ), "pkg" )
|
|
39
|
+
FileUtils.rm_rf gem_artifacts if File.exists? gem_artifacts
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
task 'gem:package' => 'manifest:assert'
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
depend_on "logging", "= 0.7.1"
|
data/bin/ziyafy
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require 'optparse'
|
|
3
|
+
require 'ostruct'
|
|
4
|
+
|
|
5
|
+
require File.expand_path( File.join(File.dirname(__FILE__), '..', 'lib', 'ziya') )
|
|
6
|
+
|
|
7
|
+
module Ziya
|
|
8
|
+
class Ziyafy
|
|
9
|
+
# Copy necessary ZiYa components to a ruby web application
|
|
10
|
+
def initialize( argv=ARGV )
|
|
11
|
+
option_parser = default_option_parser
|
|
12
|
+
option_parser.parse!(argv)
|
|
13
|
+
puts "Installing ZiYa artifacts in `#{options.public_dir}"
|
|
14
|
+
copy_artifacts
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# copies ziya artifacts to public app directory
|
|
18
|
+
def copy_artifacts
|
|
19
|
+
source_dir = File.expand_path( File.join( File.dirname(__FILE__), %w[.. charts]) )
|
|
20
|
+
FileUtils.cp_r( source_dir, options.public_dir )
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# access the options
|
|
24
|
+
def options #:nodoc:
|
|
25
|
+
if not @options then
|
|
26
|
+
@options = OpenStruct.new
|
|
27
|
+
# Unless specified copy artifacts to the public directory
|
|
28
|
+
@options.public_dir = File.join( Dir.pwd, %w[public] )
|
|
29
|
+
end
|
|
30
|
+
return @options
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# sets up cmd line args
|
|
34
|
+
def default_option_parser #:nodoc:
|
|
35
|
+
OptionParser.new do |op|
|
|
36
|
+
op.separator ""
|
|
37
|
+
op.separator "Ziyafy options"
|
|
38
|
+
|
|
39
|
+
op.on( "-p", "--public_dir FILE", "The location of the public app directory." ) do |dir|
|
|
40
|
+
options.public_dir = dir
|
|
41
|
+
end
|
|
42
|
+
op.separator ""
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
Ziya::Ziyafy.new(ARGV)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
data/charts/charts.swf
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<%= chart :base %>
|
|
2
|
+
<%=component :axis_category %>
|
|
3
|
+
size: 10
|
|
4
|
+
color: 61332b
|
|
5
|
+
bold: true
|
|
6
|
+
alpha: 100
|
|
7
|
+
|
|
8
|
+
<%=component :axis_value %>
|
|
9
|
+
color: a79d91
|
|
10
|
+
skip: 0
|
|
11
|
+
alpha: 100
|
|
12
|
+
size: 10
|
|
13
|
+
|
|
14
|
+
<%=component :chart_rect %>
|
|
15
|
+
positive_color: f8af68
|
|
16
|
+
positive_alpha: 40
|
|
17
|
+
negative_color: f88868
|
|
18
|
+
negative_alpha: 40
|
|
19
|
+
|
|
20
|
+
<%=component :legend_rect %>
|
|
21
|
+
fill_color: f8af68
|
|
22
|
+
fill_alpha: 40
|
|
23
|
+
|
|
24
|
+
<%=component :axis_ticks %>
|
|
25
|
+
major_color: 54544c
|
|
26
|
+
minor_color: a19d91
|
|
27
|
+
value_ticks: true
|
|
28
|
+
|
|
29
|
+
<%=component :chart_border %>
|
|
30
|
+
left_thickness: 2
|
|
31
|
+
bottom_thickness: 1
|
|
32
|
+
top_thickness: 1
|
|
33
|
+
right_thickness: 1
|
|
34
|
+
|
|
35
|
+
<%=component :chart_grid_h %>
|
|
36
|
+
thickness: 1
|
|
37
|
+
color: 000000
|
|
38
|
+
alpha: 7
|
|
39
|
+
|
|
40
|
+
<%=component :chart_grid_v %>
|
|
41
|
+
thickness: 3
|
|
42
|
+
color: 000000
|
|
43
|
+
alpha: 7
|
|
44
|
+
|
|
45
|
+
<%=component :chart_transition %>
|
|
46
|
+
type: none
|
|
47
|
+
order: category
|
|
48
|
+
duration: 0.2
|
|
49
|
+
|
|
50
|
+
<%=component :chart_value %>
|
|
51
|
+
position: right
|
|
52
|
+
color: F5F0BE
|
|
53
|
+
size: 9
|
|
54
|
+
alpha: 100
|
|
55
|
+
|
|
56
|
+
<%=component :legend_label %>
|
|
57
|
+
color: 000000
|
|
58
|
+
size: 10
|
|
59
|
+
|
|
60
|
+
<%=component :legend_transition %>
|
|
61
|
+
color: 00ff00
|
|
62
|
+
type: none
|
|
63
|
+
|
|
64
|
+
<%=component :series_color %>
|
|
65
|
+
colors: 5f5a38,f8af68,4e6b49,e99e57
|