ziya 2.0.7 → 2.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +561 -89
- data/README.txt +203 -108
- data/Rakefile +7 -6
- data/bin/ziyafy +38 -14
- data/docs/History.txt.html +50 -0
- data/docs/README.txt.html +403 -0
- data/docs/String.html +832 -0
- data/docs/Ziya.html +636 -0
- data/docs/Ziya/Charts.html +909 -0
- data/docs/Ziya/Charts/Area.html +672 -0
- data/docs/Ziya/Charts/AreaThreed.html +672 -0
- data/docs/Ziya/Charts/Bar.html +672 -0
- data/docs/Ziya/Charts/Base.html +1101 -0
- data/docs/Ziya/Charts/Bubble.html +672 -0
- data/docs/Ziya/Charts/CandleStick.html +672 -0
- data/docs/Ziya/Charts/Column.html +672 -0
- data/docs/Ziya/Charts/ColumnThreed.html +672 -0
- data/docs/Ziya/Charts/Custom.html +672 -0
- data/docs/Ziya/Charts/Donut.html +672 -0
- data/docs/Ziya/Charts/FloatingBar.html +672 -0
- data/docs/Ziya/Charts/FloatingColumn.html +672 -0
- data/docs/Ziya/Charts/ImageColumn.html +672 -0
- data/docs/Ziya/Charts/ImagePie.html +672 -0
- data/docs/Ziya/Charts/Line.html +672 -0
- data/docs/Ziya/Charts/Mixed.html +672 -0
- data/docs/Ziya/Charts/ParallelThreedColumn.html +672 -0
- data/docs/Ziya/Charts/Pie.html +672 -0
- data/docs/Ziya/Charts/PieThreed.html +672 -0
- data/docs/Ziya/Charts/Polar.html +672 -0
- data/docs/Ziya/Charts/Scatter.html +672 -0
- data/docs/Ziya/Charts/StackedArea.html +672 -0
- data/docs/Ziya/Charts/StackedBar.html +672 -0
- data/docs/Ziya/Charts/StackedColumn.html +672 -0
- data/docs/Ziya/Charts/StackedThreedArea.html +672 -0
- data/docs/Ziya/Charts/StackedThreedColumn.html +672 -0
- data/docs/Ziya/Charts/Support.html +1245 -0
- data/docs/Ziya/Charts/Support/Area.html +582 -0
- data/docs/Ziya/Charts/Support/AxisCategory.html +583 -0
- data/docs/Ziya/Charts/Support/AxisTicks.html +644 -0
- data/docs/Ziya/Charts/Support/AxisValue.html +583 -0
- data/docs/Ziya/Charts/Support/Base.html +577 -0
- data/docs/Ziya/Charts/Support/Bevel.html +583 -0
- data/docs/Ziya/Charts/Support/Blur.html +583 -0
- data/docs/Ziya/Charts/Support/Button.html +583 -0
- data/docs/Ziya/Charts/Support/ChartBorder.html +582 -0
- data/docs/Ziya/Charts/Support/ChartGridH.html +616 -0
- data/docs/Ziya/Charts/Support/ChartGridV.html +616 -0
- data/docs/Ziya/Charts/Support/ChartGuide.html +582 -0
- data/docs/Ziya/Charts/Support/ChartLabel.html +583 -0
- data/docs/Ziya/Charts/Support/ChartNote.html +582 -0
- data/docs/Ziya/Charts/Support/ChartPref.html +589 -0
- data/docs/Ziya/Charts/Support/ChartRect.html +632 -0
- data/docs/Ziya/Charts/Support/ChartTransition.html +613 -0
- data/docs/Ziya/Charts/Support/Circle.html +583 -0
- data/docs/Ziya/Charts/Support/ContextMenu.html +583 -0
- data/docs/Ziya/Charts/Support/Draw.html +886 -0
- data/docs/Ziya/Charts/Support/DrawBase.html +577 -0
- data/docs/Ziya/Charts/Support/Filter.html +668 -0
- data/docs/Ziya/Charts/Support/FlashToJavascript.html +596 -0
- data/docs/Ziya/Charts/Support/Glow.html +583 -0
- data/docs/Ziya/Charts/Support/Image.html +583 -0
- data/docs/Ziya/Charts/Support/Legend.html +582 -0
- data/docs/Ziya/Charts/Support/Line.html +583 -0
- data/docs/Ziya/Charts/Support/Link.html +734 -0
- data/docs/Ziya/Charts/Support/LinkData.html +589 -0
- data/docs/Ziya/Charts/Support/Rect.html +583 -0
- data/docs/Ziya/Charts/Support/Scroll.html +583 -0
- data/docs/Ziya/Charts/Support/Series.html +583 -0
- data/docs/Ziya/Charts/Support/SeriesColor.html +676 -0
- data/docs/Ziya/Charts/Support/SeriesExplode.html +676 -0
- data/docs/Ziya/Charts/Support/Shadow.html +583 -0
- data/docs/Ziya/Charts/Support/Text.html +664 -0
- data/docs/Ziya/Charts/Support/Tooltip.html +583 -0
- data/docs/Ziya/Charts/Support/Update.html +590 -0
- data/docs/Ziya/Gauges.html +644 -0
- data/docs/Ziya/Gauges/Base.html +1052 -0
- data/docs/Ziya/Gauges/Radial.html +654 -0
- data/docs/Ziya/Gauges/Signal.html +794 -0
- data/docs/Ziya/Gauges/Support.html +726 -0
- data/docs/Ziya/Gauges/Support/Area.html +577 -0
- data/docs/Ziya/Gauges/Support/Base.html +690 -0
- data/docs/Ziya/Gauges/Support/Circle.html +577 -0
- data/docs/Ziya/Gauges/Support/Design.html +577 -0
- data/docs/Ziya/Gauges/Support/Image.html +577 -0
- data/docs/Ziya/Gauges/Support/Line.html +577 -0
- data/docs/Ziya/Gauges/Support/Link.html +577 -0
- data/docs/Ziya/Gauges/Support/Move.html +577 -0
- data/docs/Ziya/Gauges/Support/Point.html +577 -0
- data/docs/Ziya/Gauges/Support/Polygon.html +577 -0
- data/docs/Ziya/Gauges/Support/RadialBase.html +654 -0
- data/docs/Ziya/Gauges/Support/RadialNumbers.html +694 -0
- data/docs/Ziya/Gauges/Support/RadialTicks.html +676 -0
- data/docs/Ziya/Gauges/Support/Rect.html +577 -0
- data/docs/Ziya/Gauges/Support/Rotate.html +577 -0
- data/docs/Ziya/Gauges/Support/Scale.html +577 -0
- data/docs/Ziya/Gauges/Support/Text.html +656 -0
- data/docs/Ziya/Gauges/Support/Update.html +577 -0
- data/docs/Ziya/Gauges/Thermo.html +826 -0
- data/docs/Ziya/HtmlHelpers.html +597 -0
- data/docs/Ziya/HtmlHelpers/Charts.html +1399 -0
- data/docs/Ziya/HtmlHelpers/Gauges.html +987 -0
- data/docs/Ziya/HtmlHelpers/Maps.html +950 -0
- data/docs/Ziya/Maps.html +713 -0
- data/docs/Ziya/Maps/Australia.html +648 -0
- data/docs/Ziya/Maps/Base.html +1099 -0
- data/docs/Ziya/Maps/Belgium.html +648 -0
- data/docs/Ziya/Maps/Brazil.html +648 -0
- data/docs/Ziya/Maps/Canada.html +648 -0
- data/docs/Ziya/Maps/Europe.html +648 -0
- data/docs/Ziya/Maps/France.html +648 -0
- data/docs/Ziya/Maps/Geocode.html +752 -0
- data/docs/Ziya/Maps/Germany.html +648 -0
- data/docs/Ziya/Maps/Italy.html +648 -0
- data/docs/Ziya/Maps/Mexico.html +648 -0
- data/docs/Ziya/Maps/Support.html +798 -0
- data/docs/Ziya/Maps/Support/Arc.html +577 -0
- data/docs/Ziya/Maps/Support/ArcColor.html +577 -0
- data/docs/Ziya/Maps/Support/ArcRange.html +577 -0
- data/docs/Ziya/Maps/Support/BackgroundColor.html +577 -0
- data/docs/Ziya/Maps/Support/Base.html +792 -0
- data/docs/Ziya/Maps/Support/DefaultColor.html +577 -0
- data/docs/Ziya/Maps/Support/DefaultPoint.html +577 -0
- data/docs/Ziya/Maps/Support/FirstZoom.html +577 -0
- data/docs/Ziya/Maps/Support/HeatRange.html +658 -0
- data/docs/Ziya/Maps/Support/Hover.html +577 -0
- data/docs/Ziya/Maps/Support/Line.html +577 -0
- data/docs/Ziya/Maps/Support/LineColor.html +577 -0
- data/docs/Ziya/Maps/Support/LineRange.html +577 -0
- data/docs/Ziya/Maps/Support/OutlineColor.html +577 -0
- data/docs/Ziya/Maps/Support/Point.html +577 -0
- data/docs/Ziya/Maps/Support/PointRange.html +577 -0
- data/docs/Ziya/Maps/Support/Range.html +753 -0
- data/docs/Ziya/Maps/Support/Ranges.html +658 -0
- data/docs/Ziya/Maps/Support/Region.html +577 -0
- data/docs/Ziya/Maps/Support/ScalePoints.html +577 -0
- data/docs/Ziya/Maps/Support/ShowName.html +577 -0
- data/docs/Ziya/Maps/Support/State.html +577 -0
- data/docs/Ziya/Maps/Support/StateInfoIcon.html +577 -0
- data/docs/Ziya/Maps/Support/ZoomMode.html +577 -0
- data/docs/Ziya/Maps/Support/ZoomOutButton.html +577 -0
- data/docs/Ziya/Maps/Support/ZoomOutScale.html +577 -0
- data/docs/Ziya/Maps/Sweden.html +648 -0
- data/docs/Ziya/Maps/Uk.html +648 -0
- data/docs/Ziya/Maps/Us.html +648 -0
- data/docs/Ziya/Maps/World.html +648 -0
- data/docs/Ziya/YamlHelpers.html +592 -0
- data/docs/Ziya/YamlHelpers/Gauges.html +848 -0
- data/docs/Ziya/YamlHelpers/Maps.html +750 -0
- data/docs/Ziya/Ziyafy.html +735 -0
- data/docs/bin/ziyafy.html +52 -0
- data/docs/created.rid +1 -0
- data/docs/examples/charts/public/charts/themes/readme.txt.html +61 -0
- data/docs/examples/maps/public/maps/themes/readme.txt.html +61 -0
- data/docs/images/brick.png +0 -0
- data/docs/images/brick_link.png +0 -0
- data/docs/images/bullet_black.png +0 -0
- data/docs/images/date.png +0 -0
- data/docs/images/macFFBgHack.png +0 -0
- data/docs/images/package.png +0 -0
- data/docs/images/page_green.png +0 -0
- data/docs/images/page_white_width.png +0 -0
- data/docs/images/plugin.png +0 -0
- data/docs/images/ruby.png +0 -0
- data/docs/images/tag_green.png +0 -0
- data/docs/images/wrench.png +0 -0
- data/docs/images/wrench_orange.png +0 -0
- data/docs/images/zoom.png +0 -0
- data/docs/index.html +978 -0
- data/docs/js/darkfish.js +91 -0
- data/docs/js/jquery.js +32 -0
- data/docs/js/quicksearch.js +135 -0
- data/docs/js/thickbox-compressed.js +10 -0
- data/docs/lib/ziya.rb.html +43 -0
- data/docs/lib/ziya/charts/area.rb.html +54 -0
- data/docs/lib/ziya/charts/area_threed.rb.html +153 -0
- data/docs/lib/ziya/charts/bar.rb.html +45 -0
- data/docs/lib/ziya/charts/base.rb.html +71 -0
- data/docs/lib/ziya/charts/bubble.rb.html +54 -0
- data/docs/lib/ziya/charts/candle_stick.rb.html +45 -0
- data/docs/lib/ziya/charts/column.rb.html +45 -0
- data/docs/lib/ziya/charts/column_threed.rb.html +45 -0
- data/docs/lib/ziya/charts/custom.rb.html +54 -0
- data/docs/lib/ziya/charts/donut.rb.html +54 -0
- data/docs/lib/ziya/charts/floating_bar.rb.html +45 -0
- data/docs/lib/ziya/charts/floating_column.rb.html +45 -0
- data/docs/lib/ziya/charts/image_column.rb.html +54 -0
- data/docs/lib/ziya/charts/image_pie.rb.html +54 -0
- data/docs/lib/ziya/charts/line.rb.html +45 -0
- data/docs/lib/ziya/charts/mixed.rb.html +45 -0
- data/docs/lib/ziya/charts/parallel_threed_column.rb.html +45 -0
- data/docs/lib/ziya/charts/pie.rb.html +45 -0
- data/docs/lib/ziya/charts/pie_threed.rb.html +45 -0
- data/docs/lib/ziya/charts/polar.rb.html +45 -0
- data/docs/lib/ziya/charts/scatter.rb.html +45 -0
- data/docs/lib/ziya/charts/stacked_area.rb.html +45 -0
- data/docs/lib/ziya/charts/stacked_bar.rb.html +45 -0
- data/docs/lib/ziya/charts/stacked_column.rb.html +45 -0
- data/docs/lib/ziya/charts/stacked_threed_area.rb.html +45 -0
- data/docs/lib/ziya/charts/stacked_threed_column.rb.html +45 -0
- data/docs/lib/ziya/charts/support/area.rb.html +56 -0
- data/docs/lib/ziya/charts/support/axis_category.rb.html +407 -0
- data/docs/lib/ziya/charts/support/axis_ticks.rb.html +48 -0
- data/docs/lib/ziya/charts/support/axis_value.rb.html +48 -0
- data/docs/lib/ziya/charts/support/base.rb.html +64 -0
- data/docs/lib/ziya/charts/support/bevel.rb.html +48 -0
- data/docs/lib/ziya/charts/support/blur.rb.html +48 -0
- data/docs/lib/ziya/charts/support/button.rb.html +48 -0
- data/docs/lib/ziya/charts/support/chart_border.rb.html +48 -0
- data/docs/lib/ziya/charts/support/chart_grid_h.rb.html +48 -0
- data/docs/lib/ziya/charts/support/chart_grid_v.rb.html +48 -0
- data/docs/lib/ziya/charts/support/chart_guide.rb.html +48 -0
- data/docs/lib/ziya/charts/support/chart_label.rb.html +49 -0
- data/docs/lib/ziya/charts/support/chart_note.rb.html +53 -0
- data/docs/lib/ziya/charts/support/chart_pref.rb.html +48 -0
- data/docs/lib/ziya/charts/support/chart_rect.rb.html +48 -0
- data/docs/lib/ziya/charts/support/chart_transition.rb.html +48 -0
- data/docs/lib/ziya/charts/support/circle.rb.html +48 -0
- data/docs/lib/ziya/charts/support/context_menu.rb.html +47 -0
- data/docs/lib/ziya/charts/support/draw.rb.html +57 -0
- data/docs/lib/ziya/charts/support/draw_base.rb.html +48 -0
- data/docs/lib/ziya/charts/support/filter.rb.html +52 -0
- data/docs/lib/ziya/charts/support/flash_to_javascript.rb.html +48 -0
- data/docs/lib/ziya/charts/support/glow.rb.html +48 -0
- data/docs/lib/ziya/charts/support/image.rb.html +52 -0
- data/docs/lib/ziya/charts/support/legend.rb.html +48 -0
- data/docs/lib/ziya/charts/support/line.rb.html +48 -0
- data/docs/lib/ziya/charts/support/link.rb.html +48 -0
- data/docs/lib/ziya/charts/support/link_data.rb.html +48 -0
- data/docs/lib/ziya/charts/support/rect.rb.html +48 -0
- data/docs/lib/ziya/charts/support/scroll.rb.html +50 -0
- data/docs/lib/ziya/charts/support/series.rb.html +47 -0
- data/docs/lib/ziya/charts/support/series_color.rb.html +62 -0
- data/docs/lib/ziya/charts/support/series_explode.rb.html +65 -0
- data/docs/lib/ziya/charts/support/shadow.rb.html +48 -0
- data/docs/lib/ziya/charts/support/text.rb.html +51 -0
- data/docs/lib/ziya/charts/support/tooltip.rb.html +53 -0
- data/docs/lib/ziya/charts/support/update.rb.html +49 -0
- data/docs/lib/ziya/core_ext/string.rb.html +50 -0
- data/docs/lib/ziya/gauges/base.rb.html +54 -0
- data/docs/lib/ziya/gauges/radial.rb.html +64 -0
- data/docs/lib/ziya/gauges/signal.rb.html +49 -0
- data/docs/lib/ziya/gauges/support/area.rb.html +57 -0
- data/docs/lib/ziya/gauges/support/base.rb.html +39 -0
- data/docs/lib/ziya/gauges/support/circle.rb.html +57 -0
- data/docs/lib/ziya/gauges/support/design.rb.html +39 -0
- data/docs/lib/ziya/gauges/support/image.rb.html +57 -0
- data/docs/lib/ziya/gauges/support/line.rb.html +57 -0
- data/docs/lib/ziya/gauges/support/link.rb.html +57 -0
- data/docs/lib/ziya/gauges/support/move.rb.html +57 -0
- data/docs/lib/ziya/gauges/support/point.rb.html +57 -0
- data/docs/lib/ziya/gauges/support/polygon.rb.html +57 -0
- data/docs/lib/ziya/gauges/support/radial_base.rb.html +58 -0
- data/docs/lib/ziya/gauges/support/radial_numbers.rb.html +60 -0
- data/docs/lib/ziya/gauges/support/radial_ticks.rb.html +57 -0
- data/docs/lib/ziya/gauges/support/rect.rb.html +57 -0
- data/docs/lib/ziya/gauges/support/rotate.rb.html +57 -0
- data/docs/lib/ziya/gauges/support/scale.rb.html +57 -0
- data/docs/lib/ziya/gauges/support/text.rb.html +57 -0
- data/docs/lib/ziya/gauges/support/update.rb.html +57 -0
- data/docs/lib/ziya/gauges/thermo.rb.html +48 -0
- data/docs/lib/ziya/html_helpers.rb.html +39 -0
- data/docs/lib/ziya/html_helpers/base.rb.html +48 -0
- data/docs/lib/ziya/html_helpers/charts.rb.html +48 -0
- data/docs/lib/ziya/html_helpers/gauges.rb.html +48 -0
- data/docs/lib/ziya/html_helpers/maps.rb.html +39 -0
- data/docs/lib/ziya/maps/australia.rb.html +48 -0
- data/docs/lib/ziya/maps/base.rb.html +62 -0
- data/docs/lib/ziya/maps/belgium.rb.html +39 -0
- data/docs/lib/ziya/maps/brazil.rb.html +39 -0
- data/docs/lib/ziya/maps/canada.rb.html +39 -0
- data/docs/lib/ziya/maps/europe.rb.html +39 -0
- data/docs/lib/ziya/maps/france.rb.html +39 -0
- data/docs/lib/ziya/maps/geocode.rb.html +45 -0
- data/docs/lib/ziya/maps/germany.rb.html +39 -0
- data/docs/lib/ziya/maps/italy.rb.html +39 -0
- data/docs/lib/ziya/maps/mexico.rb.html +39 -0
- data/docs/lib/ziya/maps/support/arc.rb.html +48 -0
- data/docs/lib/ziya/maps/support/arc_color.rb.html +48 -0
- data/docs/lib/ziya/maps/support/arc_range.rb.html +48 -0
- data/docs/lib/ziya/maps/support/background_color.rb.html +48 -0
- data/docs/lib/ziya/maps/support/base.rb.html +48 -0
- data/docs/lib/ziya/maps/support/default_color.rb.html +48 -0
- data/docs/lib/ziya/maps/support/default_point.rb.html +48 -0
- data/docs/lib/ziya/maps/support/first_zoom.rb.html +48 -0
- data/docs/lib/ziya/maps/support/heat_range.rb.html +50 -0
- data/docs/lib/ziya/maps/support/hover.rb.html +48 -0
- data/docs/lib/ziya/maps/support/line.rb.html +48 -0
- data/docs/lib/ziya/maps/support/line_color.rb.html +48 -0
- data/docs/lib/ziya/maps/support/line_range.rb.html +48 -0
- data/docs/lib/ziya/maps/support/outline_color.rb.html +48 -0
- data/docs/lib/ziya/maps/support/point.rb.html +48 -0
- data/docs/lib/ziya/maps/support/point_range.rb.html +48 -0
- data/docs/lib/ziya/maps/support/range.rb.html +48 -0
- data/docs/lib/ziya/maps/support/ranges.rb.html +47 -0
- data/docs/lib/ziya/maps/support/region.rb.html +48 -0
- data/docs/lib/ziya/maps/support/scale_points.rb.html +48 -0
- data/docs/lib/ziya/maps/support/show_name.rb.html +48 -0
- data/docs/lib/ziya/maps/support/state.rb.html +48 -0
- data/docs/lib/ziya/maps/support/state_info_icon.rb.html +48 -0
- data/docs/lib/ziya/maps/support/zoom_mode.rb.html +48 -0
- data/docs/lib/ziya/maps/support/zoom_out_button.rb.html +48 -0
- data/docs/lib/ziya/maps/support/zoom_out_scale.rb.html +48 -0
- data/docs/lib/ziya/maps/sweden.rb.html +39 -0
- data/docs/lib/ziya/maps/uk.rb.html +39 -0
- data/docs/lib/ziya/maps/us.rb.html +39 -0
- data/docs/lib/ziya/maps/world.rb.html +39 -0
- data/docs/lib/ziya/utils/logger.rb.html +53 -0
- data/docs/lib/ziya/version.rb.html +39 -0
- data/docs/lib/ziya/yaml_helpers.rb.html +39 -0
- data/docs/lib/ziya/yaml_helpers/base.rb.html +48 -0
- data/docs/lib/ziya/yaml_helpers/charts.rb.html +50 -0
- data/docs/lib/ziya/yaml_helpers/gauges.rb.html +39 -0
- data/docs/lib/ziya/yaml_helpers/maps.rb.html +39 -0
- data/docs/rdoc.css +664 -0
- data/docs/release_notes.txt.html +51 -0
- data/docs/resources/charts/themes/readme.txt.html +61 -0
- data/docs/resources/maps/themes/readme.txt.html +61 -0
- data/examples/charts/basic_chart.rb +55 -0
- data/{charts → examples/charts/public/charts}/AC_RunActiveContent.js +0 -0
- data/examples/charts/public/charts/charts.swf +0 -0
- data/examples/charts/public/charts/charts_library/ar3d.swf +0 -0
- data/examples/charts/public/charts/charts_library/arno.swf +0 -0
- data/examples/charts/public/charts/charts_library/ars3.swf +0 -0
- data/examples/charts/public/charts/charts_library/arst.swf +0 -0
- data/examples/charts/public/charts/charts_library/brfl.swf +0 -0
- data/examples/charts/public/charts/charts_library/brno.swf +0 -0
- data/examples/charts/public/charts/charts_library/brst.swf +0 -0
- data/examples/charts/public/charts/charts_library/buno.swf +0 -0
- data/examples/charts/public/charts/charts_library/cl3d.swf +0 -0
- data/examples/charts/public/charts/charts_library/clfl.swf +0 -0
- data/examples/charts/public/charts/charts_library/clim.swf +0 -0
- data/examples/charts/public/charts/charts_library/clno.swf +0 -0
- data/examples/charts/public/charts/charts_library/clp3.swf +0 -0
- data/examples/charts/public/charts/charts_library/cls3.swf +0 -0
- data/examples/charts/public/charts/charts_library/clst.swf +0 -0
- data/examples/charts/public/charts/charts_library/cnno.swf +0 -0
- data/{charts → examples/charts/public/charts}/charts_library/dollar.jpg +0 -0
- data/examples/charts/public/charts/charts_library/dono.swf +0 -0
- data/examples/charts/public/charts/charts_library/lnno.swf +0 -0
- data/examples/charts/public/charts/charts_library/mxno.swf +0 -0
- data/examples/charts/public/charts/charts_library/pi3d.swf +0 -0
- data/{charts → examples/charts/public/charts}/charts_library/pie.jpg +0 -0
- data/examples/charts/public/charts/charts_library/piim.swf +0 -0
- data/examples/charts/public/charts/charts_library/pino.swf +0 -0
- data/examples/charts/public/charts/charts_library/pono.swf +0 -0
- data/examples/charts/public/charts/charts_library/scno.swf +0 -0
- data/examples/charts/public/charts/full_screen.fla +0 -0
- data/{charts → examples/charts/public/charts}/full_screen.swf +0 -0
- data/{charts → examples/charts/public/charts}/scripts/output_jpg.php +0 -0
- data/{charts → examples/charts/public/charts}/sliders/black.swf +0 -0
- data/{charts → examples/charts/public/charts}/sliders/preview_handle_1.swf +0 -0
- data/{charts → examples/charts/public/charts}/sliders/preview_handle_2.swf +0 -0
- data/examples/charts/public/charts/themes/cool_theme/column_chart.yml +150 -0
- data/examples/charts/public/charts/themes/cool_theme/line_chart.yml +5 -0
- data/examples/charts/public/charts/themes/readme.txt +13 -0
- data/examples/charts/public/fred.xml +21 -0
- data/examples/charts/views/index.erb +17 -0
- data/examples/maps/basic_map.rb +63 -0
- data/examples/maps/helpers/map_helper.rb +15 -0
- data/examples/maps/models/confidential_herpes_report.rb +78 -0
- data/examples/maps/public/javascripts/jquery-1.3.2.js +4376 -0
- data/examples/maps/public/map.xml +336 -0
- data/examples/maps/public/maps/js/Exception.js +45 -0
- data/examples/maps/public/maps/js/FlashProxy.js +72 -0
- data/examples/maps/public/maps/js/FlashSerializer.js +165 -0
- data/examples/maps/public/maps/js/FlashTag.js +111 -0
- data/examples/maps/public/maps/js/JavaScriptFlashGateway.js +455 -0
- data/examples/maps/public/maps/js/JavaScriptFlashGateway.swf +0 -0
- data/examples/maps/public/maps/map_library/australia.swf +0 -0
- data/examples/maps/public/maps/map_library/belgium.swf +0 -0
- data/examples/maps/public/maps/map_library/brazil.swf +0 -0
- data/examples/maps/public/maps/map_library/canada.swf +0 -0
- data/examples/maps/public/maps/map_library/europe.swf +0 -0
- data/examples/maps/public/maps/map_library/france.swf +0 -0
- data/examples/maps/public/maps/map_library/germany.swf +0 -0
- data/examples/maps/public/maps/map_library/italy.swf +0 -0
- data/examples/maps/public/maps/map_library/mexico.swf +0 -0
- data/examples/maps/public/maps/map_library/sweden.swf +0 -0
- data/examples/maps/public/maps/map_library/uk_ireland.swf +0 -0
- data/examples/maps/public/maps/map_library/us.swf +0 -0
- data/examples/maps/public/maps/map_library/us_canada.swf +0 -0
- data/examples/maps/public/maps/map_library/world.swf +0 -0
- data/examples/maps/public/maps/themes/default/base_map.yml +27 -0
- data/examples/maps/public/maps/themes/default/us_map.yml +20 -0
- data/examples/maps/public/maps/themes/default/us_map_2.yml +17 -0
- data/examples/maps/public/maps/themes/readme.txt +13 -0
- data/examples/maps/public/stylesheets/map.css +16 -0
- data/examples/maps/views/index.erb +26 -0
- data/examples/maps/views/layout.erb +21 -0
- data/gem_script.rb +5 -0
- data/lib/ziya.rb +20 -11
- data/lib/ziya/charts/base.rb +114 -90
- data/lib/ziya/{components → charts/support}/area.rb +2 -2
- data/lib/ziya/{components → charts/support}/axis_category.rb +1 -1
- data/lib/ziya/{components → charts/support}/axis_ticks.rb +1 -1
- data/lib/ziya/{components → charts/support}/axis_value.rb +1 -1
- data/lib/ziya/{components → charts/support}/base.rb +9 -21
- data/lib/ziya/{components → charts/support}/bevel.rb +1 -1
- data/lib/ziya/{components → charts/support}/blur.rb +1 -1
- data/lib/ziya/{components → charts/support}/button.rb +1 -1
- data/lib/ziya/{components → charts/support}/chart_border.rb +1 -1
- data/lib/ziya/{components → charts/support}/chart_grid_h.rb +1 -1
- data/lib/ziya/{components → charts/support}/chart_grid_v.rb +1 -1
- data/lib/ziya/{components → charts/support}/chart_guide.rb +1 -1
- data/lib/ziya/{components → charts/support}/chart_label.rb +1 -1
- data/lib/ziya/{components → charts/support}/chart_note.rb +1 -1
- data/lib/ziya/{components → charts/support}/chart_pref.rb +3 -2
- data/lib/ziya/{components → charts/support}/chart_rect.rb +1 -1
- data/lib/ziya/{components → charts/support}/chart_transition.rb +1 -1
- data/lib/ziya/{components → charts/support}/circle.rb +1 -1
- data/lib/ziya/{components → charts/support}/context_menu.rb +1 -3
- data/lib/ziya/charts/support/draw.rb +76 -0
- data/lib/ziya/{components → charts/support}/draw_base.rb +1 -1
- data/lib/ziya/{components → charts/support}/filter.rb +1 -1
- data/lib/ziya/charts/support/flash_to_javascript.rb +23 -0
- data/lib/ziya/{components → charts/support}/glow.rb +1 -1
- data/lib/ziya/{components → charts/support}/image.rb +1 -1
- data/lib/ziya/{components → charts/support}/legend.rb +1 -1
- data/lib/ziya/{components → charts/support}/line.rb +1 -1
- data/lib/ziya/{components → charts/support}/link.rb +9 -1
- data/lib/ziya/{components → charts/support}/link_data.rb +1 -1
- data/lib/ziya/{components → charts/support}/rect.rb +1 -1
- data/lib/ziya/{components → charts/support}/scroll.rb +1 -3
- data/lib/ziya/{components → charts/support}/series.rb +1 -3
- data/lib/ziya/{components → charts/support}/series_color.rb +1 -1
- data/lib/ziya/{components → charts/support}/series_explode.rb +1 -1
- data/lib/ziya/{components → charts/support}/shadow.rb +1 -1
- data/lib/ziya/{components → charts/support}/text.rb +9 -1
- data/lib/ziya/{components → charts/support}/tooltip.rb +1 -1
- data/lib/ziya/{components → charts/support}/update.rb +1 -1
- data/lib/ziya/core_ext/string.rb +31 -0
- data/lib/ziya/gauges/base.rb +17 -12
- data/lib/ziya/gauges/support/base.rb +4 -12
- data/lib/ziya/gauges/support/radial_numbers.rb +1 -1
- data/lib/ziya/html_helpers.rb +1 -0
- data/lib/ziya/html_helpers/base.rb +91 -0
- data/lib/ziya/html_helpers/charts.rb +200 -0
- data/lib/ziya/html_helpers/gauges.rb +90 -0
- data/lib/ziya/html_helpers/maps.rb +74 -0
- data/lib/ziya/maps/australia.rb +9 -0
- data/lib/ziya/maps/base.rb +409 -0
- data/lib/ziya/maps/belgium.rb +7 -0
- data/lib/ziya/maps/brazil.rb +7 -0
- data/lib/ziya/maps/canada.rb +7 -0
- data/lib/ziya/maps/europe.rb +7 -0
- data/lib/ziya/maps/france.rb +7 -0
- data/lib/ziya/maps/geocode.rb +18 -0
- data/lib/ziya/maps/germany.rb +7 -0
- data/lib/ziya/maps/italy.rb +7 -0
- data/lib/ziya/maps/mexico.rb +7 -0
- data/lib/ziya/maps/support/arc.rb +7 -0
- data/lib/ziya/maps/support/arc_color.rb +7 -0
- data/lib/ziya/maps/support/arc_range.rb +7 -0
- data/lib/ziya/maps/support/background_color.rb +7 -0
- data/lib/ziya/maps/support/base.rb +34 -0
- data/lib/ziya/maps/support/default_color.rb +7 -0
- data/lib/ziya/maps/support/default_point.rb +7 -0
- data/lib/ziya/maps/support/first_zoom.rb +7 -0
- data/lib/ziya/maps/support/heat_range.rb +35 -0
- data/lib/ziya/maps/support/hover.rb +7 -0
- data/lib/ziya/maps/support/line.rb +7 -0
- data/lib/ziya/maps/support/line_color.rb +7 -0
- data/lib/ziya/maps/support/line_range.rb +7 -0
- data/lib/ziya/maps/support/outline_color.rb +7 -0
- data/lib/ziya/maps/support/point.rb +8 -0
- data/lib/ziya/maps/support/point_range.rb +7 -0
- data/lib/ziya/maps/support/range.rb +31 -0
- data/lib/ziya/maps/support/ranges.rb +18 -0
- data/lib/ziya/maps/support/region.rb +7 -0
- data/lib/ziya/maps/support/scale_points.rb +7 -0
- data/lib/ziya/maps/support/show_name.rb +7 -0
- data/lib/ziya/maps/support/state.rb +7 -0
- data/lib/ziya/maps/support/state_info_icon.rb +7 -0
- data/lib/ziya/maps/support/zoom_mode.rb +7 -0
- data/lib/ziya/maps/support/zoom_out_button.rb +7 -0
- data/lib/ziya/maps/support/zoom_out_scale.rb +7 -0
- data/lib/ziya/maps/sweden.rb +7 -0
- data/lib/ziya/maps/uk.rb +7 -0
- data/lib/ziya/maps/us.rb +7 -0
- data/lib/ziya/maps/world.rb +7 -0
- data/lib/ziya/version.rb +3 -3
- data/lib/ziya/yaml_helpers.rb +1 -0
- data/lib/ziya/yaml_helpers/base.rb +20 -0
- data/lib/ziya/yaml_helpers/charts.rb +49 -0
- data/lib/ziya/yaml_helpers/gauges.rb +33 -0
- data/lib/ziya/yaml_helpers/maps.rb +17 -0
- data/resources/charts/AC_RunActiveContent.js +292 -0
- data/resources/charts/charts.swf +0 -0
- data/resources/charts/charts_library/ar3d.swf +0 -0
- data/resources/charts/charts_library/arno.swf +0 -0
- data/resources/charts/charts_library/ars3.swf +0 -0
- data/resources/charts/charts_library/arst.swf +0 -0
- data/resources/charts/charts_library/brfl.swf +0 -0
- data/resources/charts/charts_library/brno.swf +0 -0
- data/resources/charts/charts_library/brst.swf +0 -0
- data/resources/charts/charts_library/buno.swf +0 -0
- data/resources/charts/charts_library/cl3d.swf +0 -0
- data/resources/charts/charts_library/clfl.swf +0 -0
- data/resources/charts/charts_library/clim.swf +0 -0
- data/resources/charts/charts_library/clno.swf +0 -0
- data/resources/charts/charts_library/clp3.swf +0 -0
- data/resources/charts/charts_library/cls3.swf +0 -0
- data/resources/charts/charts_library/clst.swf +0 -0
- data/resources/charts/charts_library/cnno.swf +0 -0
- data/resources/charts/charts_library/dono.swf +0 -0
- data/resources/charts/charts_library/lnno.swf +0 -0
- data/resources/charts/charts_library/mxno.swf +0 -0
- data/resources/charts/charts_library/pi3d.swf +0 -0
- data/resources/charts/charts_library/piim.swf +0 -0
- data/resources/charts/charts_library/pino.swf +0 -0
- data/resources/charts/charts_library/pono.swf +0 -0
- data/resources/charts/charts_library/scno.swf +0 -0
- data/resources/charts/full_screen.fla +0 -0
- data/resources/charts/full_screen.swf +0 -0
- data/resources/charts/scripts/output_jpg.php +23 -0
- data/resources/charts/sliders/black.swf +0 -0
- data/resources/charts/sliders/preview_handle_1.swf +0 -0
- data/resources/charts/sliders/preview_handle_2.swf +0 -0
- data/resources/charts/themes/readme.txt +13 -0
- data/{gauges → resources/gauges}/designs/circle.yml +0 -0
- data/{gauges → resources/gauges}/designs/signal.yml +0 -0
- data/{gauges → resources/gauges}/designs/thermo.yml +0 -0
- data/{gauges → resources/gauges}/designs/title.yml +0 -0
- data/{gauges → resources/gauges}/gauge.swf +0 -0
- data/resources/maps/js/Exception.js +45 -0
- data/resources/maps/js/FlashProxy.js +72 -0
- data/resources/maps/js/FlashSerializer.js +165 -0
- data/resources/maps/js/FlashTag.js +111 -0
- data/resources/maps/js/JavaScriptFlashGateway.js +455 -0
- data/resources/maps/js/JavaScriptFlashGateway.swf +0 -0
- data/resources/maps/map_library/australia.swf +0 -0
- data/resources/maps/map_library/belgium.swf +0 -0
- data/resources/maps/map_library/brazil.swf +0 -0
- data/resources/maps/map_library/canada.swf +0 -0
- data/resources/maps/map_library/europe.swf +0 -0
- data/resources/maps/map_library/france.swf +0 -0
- data/resources/maps/map_library/germany.swf +0 -0
- data/resources/maps/map_library/italy.swf +0 -0
- data/resources/maps/map_library/mexico.swf +0 -0
- data/resources/maps/map_library/sweden.swf +0 -0
- data/resources/maps/map_library/uk_ireland.swf +0 -0
- data/resources/maps/map_library/us.swf +0 -0
- data/resources/maps/map_library/us_canada.swf +0 -0
- data/resources/maps/map_library/world.swf +0 -0
- data/resources/maps/themes/readme.txt +13 -0
- data/spec/charts/base_spec.rb +7 -6
- data/spec/charts/chart_type_spec.rb +11 -4
- data/spec/{components → charts/support}/area_spec.rb +8 -8
- data/spec/charts/support/chart_pref_spec.rb +36 -0
- data/spec/charts/support/draw_spec.rb +41 -0
- data/spec/{components → charts/support}/filter_spec.rb +6 -6
- data/spec/{components → charts/support}/link_spec.rb +6 -6
- data/spec/{components → charts/support}/series.rb +4 -4
- data/spec/{components → charts/support}/series_color_spec.rb +4 -4
- data/spec/{components → charts/support}/series_explode.rb +4 -4
- data/spec/{components → charts/support}/series_explode_spec.rb +4 -4
- data/spec/core_ext/string_spec.rb +40 -0
- data/spec/gauges/base_spec.rb +1 -1
- data/spec/html_helpers/base_spec.rb +50 -0
- data/spec/html_helpers/charts_spec.rb +23 -0
- data/spec/html_helpers/gauges_spec.rb +16 -0
- data/spec/html_helpers/maps_spec.rb +20 -0
- data/spec/maps/base_spec.rb +82 -0
- data/spec/maps/support/default_color_spec.rb +29 -0
- data/spec/maps/support/heat_range_spec.rb +29 -0
- data/spec/maps/us_spec.rb +12 -0
- data/spec/maps/world_spec.rb +18 -0
- data/spec/spec_helper.rb +5 -4
- data/spec/themes/maps/base_map.yml +81 -0
- data/spec/themes/maps/us_map.yml +6 -0
- data/spec/themes/maps/world_map.yml +6 -0
- data/spec/themes/maps/world_ov_map.yml +6 -0
- data/spec/{helpers/base_helper_spec.rb → yaml_helpers/charts_spec.rb} +10 -13
- data/spec/yaml_helpers/gauges_spec.rb +15 -0
- data/spec/ziya_helper_spec.rb +118 -116
- data/tasks/doc.rake +12 -7
- data/tasks/gem.rake +1 -1
- data/tasks/setup.rb +1 -1
- data/ziya.gemspec +40 -0
- metadata +582 -94
- data/charts/charts.swf +0 -0
- data/charts/charts_library/ar3d.swf +0 -0
- data/charts/charts_library/arno.swf +0 -0
- data/charts/charts_library/ars3.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/buno.swf +0 -0
- data/charts/charts_library/cl3d.swf +0 -0
- data/charts/charts_library/clfl.swf +0 -0
- data/charts/charts_library/clim.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/dono.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/piim.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/ziya.js +0 -66
- data/lib/ziya/components/draw.rb +0 -47
- data/lib/ziya/helpers/base_helper.rb +0 -91
- data/lib/ziya/utils/text.rb +0 -39
- data/lib/ziya/ziya_helper.rb +0 -354
- data/spec/components/draw_spec.rb +0 -32
- data/spec/utils/text_spec.rb +0 -33
@@ -0,0 +1,90 @@
|
|
1
|
+
# Generates necessary html flash tag to support ZiYa
|
2
|
+
#
|
3
|
+
# TODO -- Rewrite to use content tag block instead...
|
4
|
+
#
|
5
|
+
# Author: Fernand Galiana
|
6
|
+
|
7
|
+
module Ziya::HtmlHelpers::Gauges
|
8
|
+
include Ziya::HtmlHelpers::Base
|
9
|
+
|
10
|
+
# generates necessary html tags to display a gauge.
|
11
|
+
def ziya_gauge( url, gauge_options={} )
|
12
|
+
options = default_gauge_options.merge( gauge_options )
|
13
|
+
_ziya_gauge( url, gauges_swf, options )
|
14
|
+
end
|
15
|
+
|
16
|
+
# =========================================================================
|
17
|
+
# private
|
18
|
+
|
19
|
+
# Const accessors...
|
20
|
+
def gauges_swf() "%s/gauge.swf?xml_source=%s"; end
|
21
|
+
def gauge_path() "/gauges"; end
|
22
|
+
def class_id() "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" end
|
23
|
+
def codebase() "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0"; end
|
24
|
+
|
25
|
+
def default_gauge_options
|
26
|
+
{ :width => "200",
|
27
|
+
:height => "200",
|
28
|
+
:align => "middle",
|
29
|
+
:scale => "noscale",
|
30
|
+
:script_access => "sameDomain",
|
31
|
+
:salign => "",
|
32
|
+
:class => "",
|
33
|
+
:class_id => "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
|
34
|
+
:id => "ziya_gauge",
|
35
|
+
:swf_path => gauge_path,
|
36
|
+
:use_cache => false,
|
37
|
+
:timeout => 30,
|
38
|
+
:retry => 2,
|
39
|
+
:use_stage => false }
|
40
|
+
end
|
41
|
+
|
42
|
+
def _ziya_gauge( url, swf_path, options )
|
43
|
+
# Setup options for opaque mode
|
44
|
+
setup_wmode( options )
|
45
|
+
|
46
|
+
# setup width and height
|
47
|
+
setup_movie_size( options )
|
48
|
+
|
49
|
+
color_param = tag( 'param', {:name => 'bgcolor', :value => options[:bgcolor]}, true )
|
50
|
+
color_param += tag( 'param', {:name => "wmode", :value => options[:wmode]}, true )
|
51
|
+
|
52
|
+
xml_swf_path = swf_path % [options[:swf_path], url]
|
53
|
+
xml_swf_path << "&timestamp=#{Time.now.to_i}" if options[:use_cache] == true
|
54
|
+
xml_swf_path << "&timeout=#{options[:timeout]}&retry=#{options[:retry]}" if options[:timeout]
|
55
|
+
xml_swf_path << "&stage_width=#{options[:width]}&stage_height=#{options[:height]}" if options[:use_stage] == true
|
56
|
+
tags = <<-TAGS
|
57
|
+
<object codebase="#{codebase}" classid="#{options[:class_id]}" id="#{options[:id]}" height="#{options[:height]}" width="#{options[:width]}">
|
58
|
+
<param name="scale" value="noscale"/>
|
59
|
+
<param name="align" value="#{options[:align]}"/>
|
60
|
+
<param name="bgcolor" value="#{options[:bgcolor]}"/>
|
61
|
+
<param name="wmode" value="#{options[:wmode]}"/>
|
62
|
+
<param name="movie" value="#{xml_swf_path}"/>
|
63
|
+
<param name="menu" value="true"/>
|
64
|
+
<param name="allowFullScreen" value="true"/>
|
65
|
+
<param name="allowScriptAccess" value="#{options[:script_access]}"/>
|
66
|
+
<param name="quality" value="high"/>
|
67
|
+
<param name="play" value="true"/>
|
68
|
+
<param name="devicefont" value="false"/>
|
69
|
+
<embed scale="noscale"
|
70
|
+
allowfullscreen="true"
|
71
|
+
allowscriptaccess="#{options[:script_access]}"
|
72
|
+
bgcolor="#{options[:bgcolor]}"
|
73
|
+
devicefont="false"
|
74
|
+
src="#{xml_swf_path}"
|
75
|
+
menu="true"
|
76
|
+
name="#{options[:id]}"
|
77
|
+
play="true"
|
78
|
+
pluginspage="#{plugin_url}"
|
79
|
+
quality="high"
|
80
|
+
salign="#{options[:salign]}"
|
81
|
+
src="#{xml_swf_path}"
|
82
|
+
type="#{mime}"
|
83
|
+
wmode="#{options[:wmode]}"
|
84
|
+
salign="#{options[:salign]}"
|
85
|
+
height="#{options[:height]}"
|
86
|
+
width="#{options[:width]}">
|
87
|
+
</object>
|
88
|
+
TAGS
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
module Ziya::HtmlHelpers::Maps
|
2
|
+
include Ziya::HtmlHelpers::Base
|
3
|
+
|
4
|
+
def maps_swf_base() "/maps"; end
|
5
|
+
def maps_swf() "#{maps_swf_base}?data_file=%s"; end
|
6
|
+
|
7
|
+
# default options
|
8
|
+
def default_map_options
|
9
|
+
{
|
10
|
+
:width => "400",
|
11
|
+
:height => "300",
|
12
|
+
:map_type => :world,
|
13
|
+
:id => "ziya_map",
|
14
|
+
:code_base => "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0",
|
15
|
+
:align => "top",
|
16
|
+
:quality => "high",
|
17
|
+
:wmode => "opaque",
|
18
|
+
:class_id => "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",
|
19
|
+
:swf_path => "/maps/map_library",
|
20
|
+
:use_cache => false
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
# generates swf path
|
25
|
+
def gen_sw_path( path, swf_file, url )
|
26
|
+
path_directive = "#{path}/%s?data_file=%s"
|
27
|
+
path_directive % [swf_file, escape_url( url )]
|
28
|
+
end
|
29
|
+
|
30
|
+
# generates necessary tags for map support
|
31
|
+
def ziya_map( url, map_options={} )
|
32
|
+
options = default_map_options.merge( map_options )
|
33
|
+
_ziya_map( url, "#{options[:map_type]}.swf", options )
|
34
|
+
end
|
35
|
+
|
36
|
+
# generates actual html tags
|
37
|
+
def _ziya_map( url, swf_file, options )
|
38
|
+
# Setup options for opaque mode
|
39
|
+
setup_wmode( options )
|
40
|
+
|
41
|
+
# setup width and height
|
42
|
+
setup_movie_size( options )
|
43
|
+
|
44
|
+
color_param = tag( 'param', {:name => 'bgcolor', :value => options[:bgcolor]}, true )
|
45
|
+
color_param += tag( 'param', {:name => "wmode", :value => options[:wmode]}, true )
|
46
|
+
|
47
|
+
xml_swf_path = gen_sw_path( options[:swf_path], swf_file, url )
|
48
|
+
xml_swf_path << "&timestamp=#{Time.now.to_i}" if options[:cache]
|
49
|
+
|
50
|
+
tags = <<-TAGS
|
51
|
+
<object codebase="#{options[:codebase]}" classid="#{options[:class_id]}" id="#{options[:id]}" height="#{options[:height]}" width="#{options[:width]}">
|
52
|
+
<param name="align" value="#{options[:align]}"/>
|
53
|
+
<param name="Flashvars" value="lcId=#{options[:id]}"/>
|
54
|
+
<param name="bgcolor" value="#{options[:bgcolor]}"/>
|
55
|
+
<param name="wmode" value="#{options[:wmode]}"/>
|
56
|
+
<param name="movie" value="#{xml_swf_path}"/>
|
57
|
+
<param name="quality" value="#{options[:quality]}"/>
|
58
|
+
<embed scale="noscale"
|
59
|
+
flashvars = "lcId=#{options[:id]}"
|
60
|
+
bgcolor = "#{options[:bgcolor]}"
|
61
|
+
src = "#{xml_swf_path}"
|
62
|
+
name = "#{options[:id]}"
|
63
|
+
pluginspage = "#{plugin_url}"
|
64
|
+
quality = "high"
|
65
|
+
type = "#{mime}"
|
66
|
+
wmode = "#{options[:wmode]}"
|
67
|
+
align = "#{options[:align]}"
|
68
|
+
height = "#{options[:height]}"
|
69
|
+
width = "#{options[:width]}"/>
|
70
|
+
</object>
|
71
|
+
TAGS
|
72
|
+
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,409 @@
|
|
1
|
+
# -----------------------------------------------------------------------------
|
2
|
+
# == Ziya::Maps::Base
|
3
|
+
#
|
4
|
+
# Maps mother ship
|
5
|
+
#
|
6
|
+
# Author:: Fernand Galiana
|
7
|
+
# Date:: Jan 01 2009
|
8
|
+
# -----------------------------------------------------------------------------
|
9
|
+
require 'ziya/yaml_helpers/maps'
|
10
|
+
require 'ziya/html_helpers/maps'
|
11
|
+
|
12
|
+
module Ziya::Maps
|
13
|
+
class Base
|
14
|
+
include Ziya::YamlHelpers::Maps, Ziya::HtmlHelpers::Maps
|
15
|
+
|
16
|
+
# =========================================================================
|
17
|
+
protected
|
18
|
+
def self.map_types
|
19
|
+
@map_types ||= [
|
20
|
+
:australia,
|
21
|
+
:belgium,
|
22
|
+
:brazil,
|
23
|
+
:canada,
|
24
|
+
:europe,
|
25
|
+
:france,
|
26
|
+
:germany,
|
27
|
+
:italy,
|
28
|
+
:mexico,
|
29
|
+
:sweden,
|
30
|
+
:uk_ireland,
|
31
|
+
:us,
|
32
|
+
:us_canada,
|
33
|
+
:world ]
|
34
|
+
end
|
35
|
+
|
36
|
+
# defines the various map components
|
37
|
+
def self.declare_components # :nodoc:
|
38
|
+
@components =
|
39
|
+
[
|
40
|
+
:arc,
|
41
|
+
:arc_color,
|
42
|
+
:arc_range,
|
43
|
+
:background_color,
|
44
|
+
:default_color,
|
45
|
+
:default_point,
|
46
|
+
:first_zoom,
|
47
|
+
:hover,
|
48
|
+
:heat_range,
|
49
|
+
:line,
|
50
|
+
:line_color,
|
51
|
+
:line_range,
|
52
|
+
:outline_color,
|
53
|
+
:point,
|
54
|
+
:point_range,
|
55
|
+
:ranges,
|
56
|
+
:range,
|
57
|
+
:region,
|
58
|
+
:scale_points,
|
59
|
+
:show_name,
|
60
|
+
:state,
|
61
|
+
:state_info_icon,
|
62
|
+
:zoom_mode,
|
63
|
+
:zoom_out_button,
|
64
|
+
:zoom_out_scale
|
65
|
+
]
|
66
|
+
@components.each { |a| attr_accessor a }
|
67
|
+
end
|
68
|
+
declare_components
|
69
|
+
|
70
|
+
|
71
|
+
# =========================================================================
|
72
|
+
public
|
73
|
+
|
74
|
+
attr_accessor :id, :theme, :options # :nodoc:
|
75
|
+
attr_reader :map_type # :nodoc:
|
76
|
+
|
77
|
+
# create a new map.
|
78
|
+
# <tt>chart_id</tt> -- the name of the map stylesheet.
|
79
|
+
# NOTE: If map_id is specified the framework will attempt to load the map styles
|
80
|
+
# from public/maps/themes/theme_name/map_id.yml
|
81
|
+
def initialize( map_type, map_id=nil ) # :nodoc:
|
82
|
+
raise "Invalid map type '#{map_type.inspect}'" unless Ziya::Maps::Base.map_types.include?( map_type )
|
83
|
+
@id = map_id
|
84
|
+
@options = @series = @points = @arcs = @lines = {}
|
85
|
+
@line_colors = @range_colors = @point_colors = @arc_colors = {}
|
86
|
+
@theme = default_theme
|
87
|
+
@map_type = map_type
|
88
|
+
initialize_components
|
89
|
+
load_helpers( Ziya.helpers_dir ) if Ziya.helpers_dir
|
90
|
+
end
|
91
|
+
|
92
|
+
# class component accessor...
|
93
|
+
def self.components # :nodoc:
|
94
|
+
@components
|
95
|
+
end
|
96
|
+
|
97
|
+
# default ZiYa theme
|
98
|
+
def default_theme # :nodoc:
|
99
|
+
File.join( Ziya.map_themes_dir, %w[default] )
|
100
|
+
end
|
101
|
+
|
102
|
+
# load up ERB style helpers
|
103
|
+
def load_helpers( helper_dir ) # :nodoc:
|
104
|
+
Dir.foreach(helper_dir) do |helper_file|
|
105
|
+
next unless helper_file =~ /^([a-z][a-z_]*_helper).rb$/
|
106
|
+
Ziya.logger.debug( ">>> ZiYa loading custom helper `#{$1}" )
|
107
|
+
# check rails env for autoloader ?
|
108
|
+
if defined?(RAILS_ROOT)
|
109
|
+
require_dependency File.join(helper_dir, $1)
|
110
|
+
else
|
111
|
+
require File.join(helper_dir, $1)
|
112
|
+
end
|
113
|
+
helper_module_name = "Ziya::" + $1.gsub(/(^|_)(.)/) { $2.upcase }
|
114
|
+
# helper_module_name = $1.to_s.gsub(/\/(.?)/) { "::" + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase }
|
115
|
+
# if Ziya::Helpers.const_defined?(helper_module_name)
|
116
|
+
Ziya.logger.debug( "Include module #{helper_module_name}")
|
117
|
+
Ziya::Maps::Base.class_eval("include #{helper_module_name}")
|
118
|
+
# end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
# Add chart components to a given chart.
|
123
|
+
#
|
124
|
+
# The <tt>args</tt> must contain certain keys for the chart
|
125
|
+
# to be displayed correctly.
|
126
|
+
#
|
127
|
+
# === Directives
|
128
|
+
# * <tt>:series</tt> -- Specifies the data points for the map. This must be a hash
|
129
|
+
# of region, data pairs. Where the data is also a hash of attributes such as
|
130
|
+
# :name, :data, :hover, :url and :target.
|
131
|
+
# * <tt>:range_colors</tt> -- Specifies the map of ranges of data values from the
|
132
|
+
# series to a color on the map. The range may be an exact value such as 10 or an
|
133
|
+
# actual range in the form of 1 - 10. The color must be an hexadecimal value of the
|
134
|
+
# form 'ff00ff'.
|
135
|
+
# * <tt>:point_colors</tt> -- Specifies a map of valid color ranges to color the points
|
136
|
+
# on the map. Valid key/value pairs are a number or range for the key and an
|
137
|
+
# associated color.
|
138
|
+
# * <tt>:arc_colors</tt> -- Specifies a map of valid color ranges to color the arcs
|
139
|
+
# on the map. Valid key/value pairs are a number or range for the key and an
|
140
|
+
# associated color.
|
141
|
+
# * <tt>:line_colors</tt> -- Specifies a map of valid color ranges to color the lines
|
142
|
+
# on the map. Valid key/value pairs are a number or range for the key and an
|
143
|
+
# associated color.
|
144
|
+
# * <tt>:lines</tt> -- Specifies a map of lines to plot on the map. These are key/value pairs.
|
145
|
+
# The value represent the name of the line to be displayed. The value is a hash of attributes
|
146
|
+
# as follows: :start, the geocode location of the point, :stop, the geocode location of the arc to end at
|
147
|
+
# :stroke, the thickness of the line and :data for the range value of the arc.
|
148
|
+
# * <tt>:arcs</tt> -- Specifies a map of arcs to plot on the map. These are key/value pairs.
|
149
|
+
# The value represent the name of the arc to be displayed. The value is a hash of attributes
|
150
|
+
# as follows: :start, the geocode location of the point, :stop, the geocode location of the arc to end at
|
151
|
+
# and :data for the range value of the arc.
|
152
|
+
# * <tt>:points</tt> -- Specifies a map of points to plot on the map. These are key/value pairs.
|
153
|
+
# The value represent the name of the point to be displayed. The value is a hash of attributes
|
154
|
+
# as follows: :loc for the geocode location of the point and :data for the range value of the point.
|
155
|
+
# * <tt>:theme</tt> -- Specify the use of a given named theme. The named theme must
|
156
|
+
# reside in a directory named equaly under your application public/charts/themes.
|
157
|
+
#
|
158
|
+
# === Examples
|
159
|
+
# Colorize colorado and california on a US map
|
160
|
+
# my_map.add( :series, { :CO => { :name => "Colorado", :data => 1 }, :CA => { :name => "California", :data => 2 } )
|
161
|
+
def add( *args )
|
162
|
+
# TODO Validation categories = series, series = labels, etc...
|
163
|
+
directive = args.shift
|
164
|
+
case directive
|
165
|
+
when :series
|
166
|
+
if args.first.is_a?( Hash )
|
167
|
+
points = args.shift || {}
|
168
|
+
raise ArgumentError, "Must specify an hash of data points" if points.empty?
|
169
|
+
@series = points
|
170
|
+
else
|
171
|
+
raise ArgumentError, "Must specify an hash of data points"
|
172
|
+
end
|
173
|
+
when :range_colors
|
174
|
+
@range_colors = args.shift || {}
|
175
|
+
raise ArgumentError, "You must specify a hash of data range/color pairs" if @range_colors.empty?
|
176
|
+
when :lines
|
177
|
+
@lines = args.shift || {}
|
178
|
+
raise ArgumentError, "You must specify a hash of lines attributes" if @lines.empty?
|
179
|
+
when :line_colors
|
180
|
+
@line_colors = args.shift || {}
|
181
|
+
raise ArgumentError, "You must specify a hash of line range/color pairs" if @line_colors.empty?
|
182
|
+
when :arcs
|
183
|
+
@arcs = args.shift || {}
|
184
|
+
raise ArgumentError, "You must specify a hash of arcs attributes" if @arcs.empty?
|
185
|
+
when :arc_colors
|
186
|
+
@arc_colors = args.shift || {}
|
187
|
+
raise ArgumentError, "You must specify a hash of arc range/color pairs" if @arc_colors.empty?
|
188
|
+
when :points
|
189
|
+
@points = args.shift || {}
|
190
|
+
raise ArgumentError, "You must specify a hash of points attributes" if @points.empty?
|
191
|
+
when :point_colors
|
192
|
+
@point_colors = args.shift || {}
|
193
|
+
raise ArgumentError, "You must specify a hash of point range/color pairs" if @point_colors.empty?
|
194
|
+
when :user_data
|
195
|
+
key = args.first.is_a?(Symbol) ? args.shift : ""
|
196
|
+
raise ArgumentError, "Must specify a key" if key.to_s.empty?
|
197
|
+
value = args.shift
|
198
|
+
# raise ArgumentError, "Must specify a value" if value.empty?
|
199
|
+
@options[key] = value
|
200
|
+
when :theme
|
201
|
+
theme = args.first.is_a?(String) ? args.shift : ""
|
202
|
+
raise ArgumentError, "Must specify a theme name" if theme.to_s.empty?
|
203
|
+
@theme = "#{Ziya.map_themes_dir}/#{theme}"
|
204
|
+
else raise ArgumentError, "Invalid directive must be one of " +
|
205
|
+
":series, :theme, :user_data"
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
# spews the map specification to a string
|
210
|
+
def to_s
|
211
|
+
@xml = Builder::XmlMarkup.new
|
212
|
+
# Forces utf8 encoding on xml stream
|
213
|
+
@xml.instruct! :xml, :version => "1.0", :encoding => "UTF-8"
|
214
|
+
if map_type == :us
|
215
|
+
@xml.us_states do
|
216
|
+
setup_lnf
|
217
|
+
setup_series
|
218
|
+
end
|
219
|
+
else
|
220
|
+
@xml.countrydata do
|
221
|
+
setup_lnf
|
222
|
+
setup_series
|
223
|
+
end
|
224
|
+
end
|
225
|
+
@xml.to_s.gsub( /<to_s\/>/, '' )
|
226
|
+
end
|
227
|
+
# dumps the map design to xml for client side consumption
|
228
|
+
alias to_xml to_s
|
229
|
+
|
230
|
+
# =========================================================================
|
231
|
+
private
|
232
|
+
|
233
|
+
# inflate object state based on object hierarchy
|
234
|
+
def setup_state( state )
|
235
|
+
override = self.class.name == state.class.name
|
236
|
+
Base.components.each do |comp|
|
237
|
+
instance_eval "#{comp}.merge( state.#{comp}, override ) unless state.#{comp}.nil?"
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
# load yaml file associated with class if any
|
242
|
+
def inflate( clazz, theme, instance=nil )
|
243
|
+
class_name = clazz.to_s.gsub( /Ziya::Maps/, '' ).underscore.gsub( /\//, '' )
|
244
|
+
class_name += '_map' unless class_name.match( /.?_map$/ )
|
245
|
+
begin
|
246
|
+
file_name = "#{theme}/#{class_name}"
|
247
|
+
file_name = "#{theme}/#{instance}" unless instance.nil?
|
248
|
+
Ziya.logger.debug ">>> Ziya attempt to load map stylesheet file '#{file_name}"
|
249
|
+
yml = IO.read( "#{file_name}.yml" )
|
250
|
+
processed = erb_render( yml )
|
251
|
+
# puts ">>> Processed yaml", processed
|
252
|
+
load = YAML::load( processed )
|
253
|
+
Ziya.logger.debug ">>> ZiYa [loading map styles] -- #{file_name}.yml"
|
254
|
+
# puts load.inspect
|
255
|
+
return load
|
256
|
+
rescue SystemCallError => boom
|
257
|
+
Ziya.logger.debug "ERROR #{boom}"
|
258
|
+
; # ignore if no style file...
|
259
|
+
rescue => bang
|
260
|
+
Ziya.logger.debug ">>> ZiYa -- Error encountered loading map file `#{file_name} -- #{bang}"
|
261
|
+
bang.backtrace.each { |l| Ziya.logger.debug( l ) }
|
262
|
+
end
|
263
|
+
nil
|
264
|
+
end
|
265
|
+
|
266
|
+
# parse erb template if any
|
267
|
+
def erb_render(fixture_content)
|
268
|
+
b = binding
|
269
|
+
ERB.new(fixture_content).result b
|
270
|
+
end
|
271
|
+
|
272
|
+
# lay down the map data points and color ranges
|
273
|
+
def setup_series
|
274
|
+
@series.keys.sort{ |a,b| a.to_s <=> b.to_s }.each do |s|
|
275
|
+
hash = @series[s]
|
276
|
+
@xml.state( :id => s ) do |xml|
|
277
|
+
hash.keys.sort{ |a,b| a.to_s <=> b.to_s}.each do |k|
|
278
|
+
self.class.module_eval "xml.#{k}( '#{hash[k]}' )"
|
279
|
+
end
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
# lay down points if any?
|
284
|
+
@points.keys.sort.each do |name|
|
285
|
+
@xml.state( :id => "point" ) do |xml|
|
286
|
+
xml.name( name )
|
287
|
+
@points[name].keys.sort { |a,b| a.to_s <=> b.to_s }.each do |attr|
|
288
|
+
self.class.module_eval "xml.#{attr}( '#{@points[name][attr]}' )"
|
289
|
+
end
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
293
|
+
# lay down points if any?
|
294
|
+
@lines.keys.sort.each do |name|
|
295
|
+
@xml.state( :id => "line" ) do |xml|
|
296
|
+
xml.name( name )
|
297
|
+
@lines[name].keys.sort { |a,b| a.to_s <=> b.to_s }.each do |attr|
|
298
|
+
self.class.module_eval "xml.#{attr}( '#{@lines[name][attr]}' )"
|
299
|
+
end
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
@arcs.keys.sort.each do |name|
|
304
|
+
@xml.state( :id => "arc" ) do |xml|
|
305
|
+
xml.name( name )
|
306
|
+
@arcs[name].keys.sort { |a,b| a.to_s <=> b.to_s }.each do |attr|
|
307
|
+
self.class.module_eval "xml.#{attr}( '#{@arcs[name][attr]}' )"
|
308
|
+
end
|
309
|
+
end
|
310
|
+
end
|
311
|
+
|
312
|
+
# lay down range colors if any
|
313
|
+
unless @range_colors.empty?
|
314
|
+
@range_colors.each_pair do |range, color|
|
315
|
+
@xml.state( :id => 'range' ) do
|
316
|
+
@xml.data( range )
|
317
|
+
@xml.color( color )
|
318
|
+
end
|
319
|
+
end
|
320
|
+
end
|
321
|
+
|
322
|
+
# lay down point range colors if any
|
323
|
+
unless @point_colors.empty?
|
324
|
+
@point_colors.each_pair do |range, color|
|
325
|
+
@xml.state( :id => 'point_range' ) do
|
326
|
+
@xml.data( range )
|
327
|
+
@xml.color( color )
|
328
|
+
end
|
329
|
+
end
|
330
|
+
end
|
331
|
+
|
332
|
+
# lay down line range colors if any
|
333
|
+
unless @line_colors.empty?
|
334
|
+
@line_colors.each_pair do |range, color|
|
335
|
+
@xml.state( :id => 'line_range' ) do
|
336
|
+
@xml.data( range )
|
337
|
+
@xml.color( color )
|
338
|
+
end
|
339
|
+
end
|
340
|
+
end
|
341
|
+
|
342
|
+
# lay down arc range colors if any
|
343
|
+
unless @arc_colors.empty?
|
344
|
+
@arc_colors.each_pair do |range, color|
|
345
|
+
@xml.state( :id => 'arc_range' ) do
|
346
|
+
@xml.data( range )
|
347
|
+
@xml.color( color )
|
348
|
+
end
|
349
|
+
end
|
350
|
+
end
|
351
|
+
|
352
|
+
end
|
353
|
+
|
354
|
+
# walk up class hierarchy to find chart inheritance classes
|
355
|
+
def ancestors
|
356
|
+
ancestors = self.class.ancestors.reverse
|
357
|
+
allow = false
|
358
|
+
ancestors.map do |k|
|
359
|
+
allow = true if k == Ziya::Maps::Base
|
360
|
+
k if allow
|
361
|
+
end.compact!
|
362
|
+
end
|
363
|
+
|
364
|
+
# load up look and feel data
|
365
|
+
def load_lnf
|
366
|
+
unless @partial
|
367
|
+
ancestors.each do |super_class|
|
368
|
+
# Load class instance prefs
|
369
|
+
if ( super_class == self.class )
|
370
|
+
o = inflate( super_class, theme )
|
371
|
+
setup_state( o ) unless o.nil?
|
372
|
+
# Now load instance prefs if any
|
373
|
+
unless id.nil?
|
374
|
+
o = inflate( super_class, theme, id )
|
375
|
+
setup_state( o ) unless o.nil?
|
376
|
+
end
|
377
|
+
# Otherwise load parent prefs...
|
378
|
+
else
|
379
|
+
o = inflate( super_class, theme, nil )
|
380
|
+
setup_state( o ) unless o.nil?
|
381
|
+
end
|
382
|
+
end
|
383
|
+
end
|
384
|
+
# Additional styles specified ? if so load them
|
385
|
+
unless @options[:styles].nil?
|
386
|
+
o = YAML::load( erb_render( @options[:styles] ) )
|
387
|
+
setup_state( o ) unless o.nil?
|
388
|
+
end
|
389
|
+
end
|
390
|
+
|
391
|
+
# generates xml for look and feel data
|
392
|
+
def setup_lnf
|
393
|
+
load_lnf
|
394
|
+
Base.components.sort { |a,b| a.to_s <=> b.to_s }.each do |comp|
|
395
|
+
next unless self.send( comp ).configured?
|
396
|
+
instance_eval "#{comp}.flatten( @xml )"
|
397
|
+
end
|
398
|
+
end
|
399
|
+
|
400
|
+
# load up the allowable map components
|
401
|
+
def initialize_components
|
402
|
+
# Setup instance vars
|
403
|
+
Base.components.each do |comp|
|
404
|
+
instance_var = lambda { |v| self.instance_eval{ instance_variable_set "@#{comp}", v } }
|
405
|
+
instance_var.call(Ziya::Maps::Support.const_get( comp.to_s.classify ).new)
|
406
|
+
end
|
407
|
+
end
|
408
|
+
end
|
409
|
+
end
|