ziya 2.0.7 → 2.1.6
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/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
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,27 @@
|
|
1
|
+
# This demonstrates stylesheet inheritance. Define a base style here for
|
2
|
+
# the look and feel of all maps. Then you can refine/augment the styles in derived
|
3
|
+
# classes. How cool is that ?
|
4
|
+
<%= map :base %>
|
5
|
+
|
6
|
+
# color to be used when to heat_color can be found for range or value
|
7
|
+
<%=config :default_color %>
|
8
|
+
color: 000000
|
9
|
+
|
10
|
+
# states outline color
|
11
|
+
<%=config :outline_color %>
|
12
|
+
color: 000000
|
13
|
+
|
14
|
+
# map background color
|
15
|
+
<%=config :background_color %>
|
16
|
+
color: ff0000
|
17
|
+
opacity: 20
|
18
|
+
|
19
|
+
# tooltip configuration
|
20
|
+
<%=config :hover %>
|
21
|
+
font_size: 10
|
22
|
+
font_color: 434343
|
23
|
+
background_color: fcf8b8
|
24
|
+
|
25
|
+
# disable zooming
|
26
|
+
<%=config :zoom_mode %>
|
27
|
+
data: no zoom
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Here we redefine the map outline color using a helper and
|
2
|
+
# specify the heat map ranges using the handy dandy heat_range component...
|
3
|
+
<%= map :us%>
|
4
|
+
|
5
|
+
# overrides background color and opacity to white/full
|
6
|
+
<%=config :background_color %>
|
7
|
+
color: ffffff
|
8
|
+
opacity: 100
|
9
|
+
|
10
|
+
# overrides state outline with color from helper
|
11
|
+
<%=config :outline_color %>
|
12
|
+
color: <%= outline_color %>
|
13
|
+
|
14
|
+
<%=config :heat_range %>
|
15
|
+
base_color: 'f49329'
|
16
|
+
min: 0
|
17
|
+
max: 100
|
18
|
+
step: 10
|
19
|
+
color_step: 90
|
20
|
+
color_method: darken_by
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Here we redefine the map outline color using a helper and
|
2
|
+
# specify the heat map ranges using the handy dandy heat_range component...
|
3
|
+
<%= map :us%>
|
4
|
+
# randomizes heat map base color
|
5
|
+
<% color = random_color %>
|
6
|
+
|
7
|
+
# overrides state outline with color from helper
|
8
|
+
<%=config :outline_color %>
|
9
|
+
color: <%= color %>
|
10
|
+
|
11
|
+
<%=config :heat_range %>
|
12
|
+
base_color: <%= color %>
|
13
|
+
min: 0
|
14
|
+
max: 100
|
15
|
+
step: 10
|
16
|
+
color_step: 90
|
17
|
+
color_method: darken_by
|
@@ -0,0 +1,13 @@
|
|
1
|
+
This directory indicates the location where you can specify the maps looks and feel.
|
2
|
+
You will need to create a new theme directory which contains the map YAML stylesheets for
|
3
|
+
your various maps.
|
4
|
+
|
5
|
+
For example
|
6
|
+
|
7
|
+
public/charts/themes/cool_maps
|
8
|
+
- us_map.yml
|
9
|
+
- world_map.yml
|
10
|
+
|
11
|
+
Then in your controller, indicate you want to choose the 'cool_maps' theme by using the following:
|
12
|
+
|
13
|
+
map.add( :theme, "cool_maps" )
|
@@ -0,0 +1,16 @@
|
|
1
|
+
body {
|
2
|
+
background-color: #ffffff;
|
3
|
+
font-family: "Arial","Helvetica","Verdana","sans-serif";
|
4
|
+
color: #5c5c5c;
|
5
|
+
font-size: 12px;
|
6
|
+
font-size-adjust: none;
|
7
|
+
font-stretch: normal;
|
8
|
+
font-style: normal;
|
9
|
+
font-variant: normal;
|
10
|
+
font-weight: normal;
|
11
|
+
margin: 0;
|
12
|
+
}
|
13
|
+
|
14
|
+
h1 {
|
15
|
+
color: #ff0000;
|
16
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<div style="margin-left:5px">
|
2
|
+
<h1>ZiYa map examples</h1>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<div style="text-align:center;">
|
6
|
+
<div style="float:left;width:49%;border:1px black solid;margin:0px 5px 0px 5px;">
|
7
|
+
<h2>Basic map</h2>
|
8
|
+
<%= ziya_map '/load_map_1', :map_type => :us, :id => "map_1", :size => '400x300' %>
|
9
|
+
</div>
|
10
|
+
<div style="width:49%;border:1px black solid;overflow:auto;margin:0px 5px 0px 0px;">
|
11
|
+
<h2>Drillable/Updatable map</h2>
|
12
|
+
<%= ziya_map '/load_map_2', :map_type => :us, :id => "map2", :size => '400x300' %>
|
13
|
+
<a id="link" href="/goes_nowhere">Refresh Map...</a>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
|
18
|
+
<script type="text/javascript">
|
19
|
+
var flashProxy = new FlashProxy( 'map2', '/maps/js/JavaScriptFlashGateway.swf' );
|
20
|
+
$( function() {
|
21
|
+
$('a').click( function( event ) {
|
22
|
+
flashProxy.call( 'refreshData', '/refresh_map_2' );
|
23
|
+
event.preventDefault();
|
24
|
+
});
|
25
|
+
});
|
26
|
+
</script>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
6
|
+
<title>ZiYa Maps</title>
|
7
|
+
<link href="/stylesheets/map.css" media="screen" type="text/css" rel="stylesheet" />
|
8
|
+
<script src="/javascripts/jquery-1.3.2.js" type="text/javascript" ></script>
|
9
|
+
|
10
|
+
<script src="/maps/js/Exception.js" type="text/javascript" ></script>
|
11
|
+
<script src="/maps/js/FlashTag.js" type="text/javascript" ></script>
|
12
|
+
<script src="/maps/js/FlashProxy.js" type="text/javascript" ></script>
|
13
|
+
<script src="/maps/js/FlashSerializer.js" type="text/javascript" ></script>
|
14
|
+
</head>
|
15
|
+
|
16
|
+
<body>
|
17
|
+
<%= yield %>
|
18
|
+
</body>
|
19
|
+
|
20
|
+
</html>
|
21
|
+
|
data/gem_script.rb
ADDED
data/lib/ziya.rb
CHANGED
@@ -1,9 +1,5 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
# BOZO !! Document !!
|
4
|
-
|
5
|
-
# Equivalent to a header guard in C/C++
|
6
|
-
# Used to prevent the class/module from being loaded more than once
|
1
|
+
# Initializes the ziya framework. Call Ziya.initialize(...) somewhere in your
|
2
|
+
# framework initialization routine
|
7
3
|
unless defined? Ziya
|
8
4
|
module Ziya
|
9
5
|
# :stopdoc:
|
@@ -11,22 +7,30 @@ unless defined? Ziya
|
|
11
7
|
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
|
12
8
|
|
13
9
|
def self.default_configuration
|
14
|
-
{
|
10
|
+
{
|
11
|
+
:themes_dir => File.join( File.dirname(__FILE__), %w[.. charts themes] ),
|
15
12
|
:log_file => $stdout,
|
16
|
-
:log_level => :info
|
13
|
+
:log_level => :info
|
14
|
+
}
|
17
15
|
end
|
18
16
|
|
19
17
|
def self.initialize( opts={} )
|
20
|
-
|
21
|
-
|
18
|
+
if opts[:log_level] == :debug
|
19
|
+
puts ">>> No logger specified. Using ZiYa default logger" unless opts[:logger]
|
20
|
+
puts ">>> No themes_dir specified. Using ZiYa default themes" unless opts[:themes_dir]
|
21
|
+
end
|
22
22
|
@config = default_configuration.merge( opts )
|
23
23
|
@logger = opts[:logger] if opts[:logger]
|
24
24
|
|
25
|
-
# Verify
|
25
|
+
# Verify existence of themes, designs and helper dirs if any
|
26
26
|
if themes_dir
|
27
27
|
raise "Unable to find themes directory `#{themes_dir}" unless File.exists?( themes_dir )
|
28
28
|
end
|
29
29
|
|
30
|
+
if map_themes_dir
|
31
|
+
raise "Unable to find map themes directory `#{map_themes_dir}" unless File.exists?( map_themes_dir )
|
32
|
+
end
|
33
|
+
|
30
34
|
if designs_dir
|
31
35
|
raise "Unable to find designs directory `#{designs_dir}" unless File.exists?( designs_dir )
|
32
36
|
end
|
@@ -57,6 +61,11 @@ unless defined? Ziya
|
|
57
61
|
config[:themes_dir]
|
58
62
|
end
|
59
63
|
|
64
|
+
# the map themes root directory location
|
65
|
+
def self.map_themes_dir
|
66
|
+
config[:map_themes_dir]
|
67
|
+
end
|
68
|
+
|
60
69
|
# the gauges designs root directory location
|
61
70
|
def self.designs_dir
|
62
71
|
config[:designs_dir]
|
data/lib/ziya/charts/base.rb
CHANGED
@@ -11,31 +11,52 @@
|
|
11
11
|
# Author:: Fernand Galiana
|
12
12
|
# Date:: Dec 15th, 2006
|
13
13
|
# -----------------------------------------------------------------------------
|
14
|
-
require 'ziya/
|
14
|
+
require 'ziya/html_helpers'
|
15
|
+
require 'ziya/html_helpers/charts'
|
16
|
+
require 'ziya/yaml_helpers/charts'
|
15
17
|
require 'yaml'
|
16
18
|
|
17
19
|
module Ziya::Charts
|
18
|
-
# The mother ship of all charts. This class figures out how to generate the
|
19
|
-
# correct xml to render the chart on the client side.
|
20
|
-
#
|
21
|
-
#
|
20
|
+
# The mother ship of all charts. This abstract class figures out how to generate the
|
21
|
+
# correct xml to render the chart on the client side. It handles loading the look
|
22
|
+
# and feel via associated stylesheets. In order to customize the chart look and feel,
|
23
|
+
# you must create a theme directory in your application public/charts/themes dir. And
|
24
|
+
# reference it via the #add method using the :theme directive.
|
22
25
|
class Base
|
23
|
-
|
24
|
-
include Ziya::Helpers::BaseHelper
|
26
|
+
include Ziya::YamlHelpers::Charts, Ziya::HtmlHelpers::Charts
|
25
27
|
|
26
28
|
# =========================================================================
|
27
29
|
protected
|
28
30
|
# defines the various chart components
|
29
31
|
def self.declare_components # :nodoc:
|
30
|
-
@components =
|
31
|
-
|
32
|
-
:
|
33
|
-
:
|
34
|
-
:
|
35
|
-
:
|
36
|
-
:
|
37
|
-
:
|
38
|
-
:
|
32
|
+
@components =
|
33
|
+
[
|
34
|
+
:axis_category,
|
35
|
+
:axis_ticks,
|
36
|
+
:axis_value,
|
37
|
+
:chart_rect,
|
38
|
+
:chart_border,
|
39
|
+
:chart_grid_h,
|
40
|
+
:chart_grid_v,
|
41
|
+
:chart_note,
|
42
|
+
:tooltip,
|
43
|
+
:chart_transition,
|
44
|
+
:chart_label,
|
45
|
+
:chart_guide,
|
46
|
+
:legend,
|
47
|
+
:filter,
|
48
|
+
:flash_to_javascript,
|
49
|
+
:draw,
|
50
|
+
:series_color,
|
51
|
+
:series,
|
52
|
+
:series_explode,
|
53
|
+
:chart_pref,
|
54
|
+
:scroll,
|
55
|
+
:update,
|
56
|
+
:link_data,
|
57
|
+
:link,
|
58
|
+
:context_menu
|
59
|
+
]
|
39
60
|
@components.each { |a| attr_accessor a }
|
40
61
|
end
|
41
62
|
declare_components
|
@@ -47,11 +68,11 @@ module Ziya::Charts
|
|
47
68
|
attr_reader :type # :nodoc:
|
48
69
|
|
49
70
|
# create a new chart.
|
50
|
-
# <tt
|
51
|
-
# <tt
|
71
|
+
# <tt>license</tt> -- the XML/SWF charts license
|
72
|
+
# <tt>chart_id</tt> -- the name of the chart style sheet.
|
52
73
|
# NOTE: If chart_id is specified the framework will attempt to load the chart styles
|
53
74
|
# from public/themes/theme_name/chart_id.yml
|
54
|
-
def initialize( license=nil, chart_id=nil )
|
75
|
+
def initialize( license=nil, chart_id=nil ) # :nodoc:
|
55
76
|
@id = chart_id
|
56
77
|
@license = license
|
57
78
|
@options = {}
|
@@ -68,11 +89,15 @@ module Ziya::Charts
|
|
68
89
|
@components
|
69
90
|
end
|
70
91
|
|
71
|
-
# don't
|
72
|
-
def self.mode_data()
|
92
|
+
# don't load stylesheets just gen code for chart..
|
93
|
+
def self.mode_data() #:nodoc:
|
94
|
+
1
|
95
|
+
end
|
73
96
|
|
74
97
|
# renders everything
|
75
|
-
def self.mode_reset
|
98
|
+
def self.mode_reset #:nodoc:
|
99
|
+
0
|
100
|
+
end
|
76
101
|
|
77
102
|
# default ZiYa theme
|
78
103
|
def default_theme # :nodoc:
|
@@ -99,72 +124,66 @@ module Ziya::Charts
|
|
99
124
|
end
|
100
125
|
end
|
101
126
|
|
102
|
-
# Add chart components
|
103
|
-
# labels.
|
127
|
+
# Add chart components to a given chart.
|
104
128
|
#
|
105
|
-
# Example:
|
106
|
-
# my_chart = Ziya::Charts::Bar.new
|
107
|
-
# my_chart.add( :axis_category_text, ['2004', '2005', '2006'] )
|
108
|
-
# my_chart.add( :axis_category_label, [ '10 dogs', '20 cats', '30 rats'] )
|
109
|
-
# my_chart.add( :series, 'series A', [ 10, 20, 30] )
|
110
|
-
# my_chart.add( :axis_value_label, [ 'my dogs', 'my cats', 'my rats'] )
|
111
|
-
# my_chart.add( :user_data, :mykey, "Fred" )
|
112
|
-
#
|
113
|
-
# This will display a bar chart with x axis ticks my dogs, my cats, my fox and
|
114
|
-
# y axis values 2004, 2005, 2006. The labels on the bars will read 10 dogs,
|
115
|
-
# 20 cats, 30 rats
|
116
|
-
#
|
117
129
|
# The <tt>args</tt> must contain certain keys for the chart
|
118
|
-
# to be
|
119
|
-
# <tt>:axis_category_text</tt>:: Array of strings representing the x/y axis
|
120
|
-
# ticks dependending on the chart type. This
|
121
|
-
# value is required.
|
122
|
-
# <tt>:axis_category_label</tt>:: Array of strings representing the x axis
|
123
|
-
# labels. This is supported only for Scatter and Bubble charts.
|
124
|
-
# This value is optional. Specify nil for no label change.
|
125
|
-
# <tt>:series</tt>:: Specifies the series name and chart data points as an array.
|
126
|
-
# The series name will be used to display chart legends.
|
127
|
-
# You must have at least one of these tag defined.
|
128
|
-
# The data values may be specified as a straight up array of
|
129
|
-
# strings or numbers but also as an array of hash representing
|
130
|
-
# the data points and their attributes such as note, label, tooltip, effect, etc..
|
131
|
-
# Examples:
|
132
|
-
# Plain old series with integer data points
|
133
|
-
# my_chart.add( :series, "series A", [ 10, 20, 30] )
|
130
|
+
# to be displayed correctly.
|
134
131
|
#
|
135
|
-
#
|
136
|
-
#
|
137
|
-
#
|
138
|
-
#
|
139
|
-
#
|
140
|
-
#
|
141
|
-
#
|
142
|
-
#
|
143
|
-
# <tt>:
|
144
|
-
#
|
145
|
-
#
|
146
|
-
#
|
147
|
-
#
|
148
|
-
# <tt>:
|
149
|
-
#
|
150
|
-
#
|
132
|
+
# === Directives
|
133
|
+
# * <tt>:axis_category_text</tt> -- Array of strings representing the x/y
|
134
|
+
# axis ticks dependending on the chart type. This value is required.
|
135
|
+
# In an x/y axis chart setup the category is the x axis unless the chart is
|
136
|
+
# a bar chart.
|
137
|
+
# * <tt>:axis_category_label</tt> -- Array of strings representing the x axis
|
138
|
+
# labels. This is supported only for Scatter and Bubble charts.
|
139
|
+
# This value is optional. Specify nil for no label change.
|
140
|
+
# * <tt>:series</tt> -- Specifies the series name and chart data points as an array.
|
141
|
+
# The series name will be used to display chart legends. You must have at least one
|
142
|
+
# of these tag defined. The data values may be specified as a straight up array of
|
143
|
+
# strings or numbers but also as an array of hash representing the data points and
|
144
|
+
# their attributes such as note, label, tooltip, effect, etc..
|
145
|
+
# * <tt>:axis_value_label</tt> -- Array of strings representing the ticks on the x/y
|
146
|
+
# axis depending on the chart type. This is symmetrical to the <tt>axis_category_label</tt>
|
147
|
+
# tag for the opposite chart axis. Specify nil for no label change.
|
148
|
+
# * <tt>:user_data</tt>:: -- Used to make user data available to the ERB templates in
|
149
|
+
# the chart stylesheet yaml file. You must specify a key symbol and an ad-hoc value.
|
150
|
+
# The key will be used with the @options hash to access the user data.
|
151
|
+
# * <tt>:composites</tt> -- Embeds multiple charts within the given chart via the
|
152
|
+
# draw image component. You must specify a hash of chart_id/url pairs.
|
153
|
+
# * <tt>:chart_types</tt> -- Specify the chart types per series. This option should
|
154
|
+
# only be used with Mixed Charts !!
|
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.
|
151
157
|
#
|
158
|
+
# === Examples
|
159
|
+
# Setup the category axis to with 3 ticks namely 2004, 2005, 2006
|
160
|
+
# my_chart.add( :axis_category_text, ['2004', '2005', '2006'] )
|
161
|
+
#
|
162
|
+
# Plain old series with integer data points
|
163
|
+
# my_chart.add( :series, "series A", [ 10, 20, 30] )
|
164
|
+
# Specifying custom series labels. You may specify the following attributes in the data point
|
165
|
+
# hash : :note, :label, :tooltip and effects such as :shadow, :glow, etc...
|
166
|
+
# my_chart.add( :series, "series A", [ { :value => 10, :label => 'l1' }, { :value => 20, :label => 'l2' } ] )
|
152
167
|
def add( *args )
|
153
168
|
# TODO Validation categories = series, series = labels, etc...
|
154
169
|
directive = args.shift
|
155
170
|
case directive
|
171
|
+
# BOZO !! Idea - could use a formatter object to specificy how you want to format this series
|
156
172
|
when :axis_category_text
|
157
173
|
categories = args.first.is_a?(Array) ? args.shift : []
|
158
174
|
raise ArgumentError, "Must specify an array of categories" if categories.empty?
|
159
|
-
|
160
|
-
|
175
|
+
# don't side effect the passed in categs
|
176
|
+
categs = categories.clone
|
177
|
+
categs.insert( 0, nil )
|
178
|
+
@options[directive] = categs
|
179
|
+
# BOZO !! Need to constrain this only scatter and bubble support this !!
|
161
180
|
when :axis_category_label
|
162
181
|
labels = args.first.is_a?(Array) ? args.shift : []
|
163
182
|
raise ArgumentError, "Must specify an array of category labels" if labels.empty?
|
164
183
|
@options[directive] = labels
|
165
184
|
when :composites
|
166
|
-
composites = args.first.is_a?(
|
167
|
-
raise ArgumentError, "Must specify
|
185
|
+
composites = args.first.is_a?(Hash) ? args.shift: []
|
186
|
+
raise ArgumentError, "Must specify a hash of id => url pairs for the composite chart(s)" if composites.empty?
|
168
187
|
@options[directive] = composites
|
169
188
|
when :axis_value_label
|
170
189
|
values = args.first.is_a?(Array) ? args.shift : []
|
@@ -176,8 +195,10 @@ module Ziya::Charts
|
|
176
195
|
if args.first.is_a?( Array )
|
177
196
|
points = args.shift || []
|
178
197
|
raise ArgumentError, "Must specify an array of data points" if points.empty?
|
179
|
-
|
180
|
-
|
198
|
+
# don't side effect the passed in series
|
199
|
+
pts = points.clone
|
200
|
+
pts.insert( 0, legend )
|
201
|
+
series[:points] = pts
|
181
202
|
else
|
182
203
|
raise ArgumentError, "Must specify an array of data points"
|
183
204
|
end
|
@@ -222,7 +243,7 @@ module Ziya::Charts
|
|
222
243
|
@xml.chart do
|
223
244
|
@xml.license( @license ) unless @license.nil?
|
224
245
|
if render_parents?
|
225
|
-
if
|
246
|
+
if @type
|
226
247
|
@xml.chart_type( @type )
|
227
248
|
elsif @options[:chart_types].is_a? Array and ! @options[:chart_types].empty?
|
228
249
|
@xml.chart_type do
|
@@ -251,16 +272,15 @@ module Ziya::Charts
|
|
251
272
|
|
252
273
|
# load yaml file associated with class if any
|
253
274
|
def inflate( clazz, theme, instance=nil )
|
254
|
-
class_name =
|
275
|
+
class_name = clazz.to_s.gsub( /Ziya::Charts/, '' ).underscore.gsub( /\//, '' )
|
255
276
|
class_name += '_chart' unless class_name.match( /.?_chart$/ )
|
256
277
|
begin
|
257
278
|
file_name = "#{theme}/#{class_name}"
|
258
279
|
file_name = "#{theme}/#{instance}" unless instance.nil?
|
259
280
|
Ziya.logger.debug ">>> Ziya attempt to load style sheet file '#{file_name}"
|
260
281
|
yml = IO.read( "#{file_name}.yml" )
|
261
|
-
# Ziya.logger.debug( yml )
|
262
282
|
load = YAML::load( erb_render( yml ) )
|
263
|
-
Ziya.logger.
|
283
|
+
Ziya.logger.debug ">>> ZiYa [loading styles] -- #{file_name}.yml"
|
264
284
|
return load
|
265
285
|
rescue SystemCallError => boom
|
266
286
|
; # ignore if no style file...
|
@@ -279,14 +299,15 @@ module Ziya::Charts
|
|
279
299
|
|
280
300
|
# generates category axis data points
|
281
301
|
def gen_axis_category
|
282
|
-
categories = @options[:axis_category_text]
|
302
|
+
categories = @options[:axis_category_text] || []
|
283
303
|
@xml.row do
|
284
304
|
categories.each do |category|
|
285
305
|
case
|
286
306
|
when category.nil? : @xml.null
|
307
|
+
when category.instance_of?(Symbol) : @xml.string( category.to_s )
|
287
308
|
when category.instance_of?(String) : @xml.string( category )
|
288
309
|
when category.respond_to?(:zero?) : @xml.number( category )
|
289
|
-
when category.is_a?(Hash) : gen_row_data(
|
310
|
+
when category.is_a?(Hash) : categ = category.clone;gen_row_data( categ.delete( :value ), categ, @xml )
|
290
311
|
else puts "No match"
|
291
312
|
end
|
292
313
|
end
|
@@ -300,6 +321,8 @@ module Ziya::Charts
|
|
300
321
|
gen_string_data( value, opts, xml )
|
301
322
|
elsif value.respond_to? :zero?
|
302
323
|
gen_number_data( value, opts, xml )
|
324
|
+
else
|
325
|
+
xml.null
|
303
326
|
end
|
304
327
|
end
|
305
328
|
|
@@ -318,11 +341,13 @@ module Ziya::Charts
|
|
318
341
|
def gen_chart_data( series )
|
319
342
|
block = lambda {
|
320
343
|
series[:points].each do |row|
|
321
|
-
if row
|
344
|
+
if !row
|
322
345
|
@xml.null
|
323
|
-
elsif row.instance_of?
|
324
|
-
|
325
|
-
|
346
|
+
elsif row.instance_of?(Hash)
|
347
|
+
# don't side effect the original series
|
348
|
+
the_clone = row.clone
|
349
|
+
value = the_clone.delete( :value )
|
350
|
+
gen_row_data( value, the_clone, @xml )
|
326
351
|
else
|
327
352
|
gen_row_data( row, nil, @xml )
|
328
353
|
end
|
@@ -338,9 +363,7 @@ module Ziya::Charts
|
|
338
363
|
|
339
364
|
# lay down graph data points and labels if any
|
340
365
|
# TODO Validate series sizes/label sizes
|
341
|
-
def setup_series
|
342
|
-
raise "You must specify an axis_category_text with your series." if !@series_desc.empty? and ! @options[:axis_category_text]
|
343
|
-
|
366
|
+
def setup_series
|
344
367
|
if @options[:axis_category_text]
|
345
368
|
@xml.chart_data do
|
346
369
|
gen_axis_category
|
@@ -417,8 +440,9 @@ module Ziya::Charts
|
|
417
440
|
def setup_lnf
|
418
441
|
load_lnf
|
419
442
|
unless @partial
|
420
|
-
Base.components.each do |comp|
|
421
|
-
|
443
|
+
Base.components.each do |comp|
|
444
|
+
# Don't include non configured components
|
445
|
+
next unless ( comp == :draw and @options[:composites] ) or self.send( comp ).configured?
|
422
446
|
if comp == :draw
|
423
447
|
instance_eval "#{comp}.flatten( @xml, @options[:composites] )"
|
424
448
|
else
|
@@ -433,7 +457,7 @@ module Ziya::Charts
|
|
433
457
|
# Setup instance vars
|
434
458
|
Base.components.each do |comp|
|
435
459
|
instance_var = lambda { |v| self.instance_eval{ instance_variable_set "@#{comp}", v } }
|
436
|
-
instance_var.call(Ziya::
|
460
|
+
instance_var.call(Ziya::Charts::Support.const_get( comp.to_s.classify ).new)
|
437
461
|
end
|
438
462
|
end
|
439
463
|
end
|