old_sql 1.16.0 → 1.17.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +24 -13
- data/app/controllers/old_sql/report_controller.rb +3 -17
- data/app/views/layouts/old_sql/chart.html.erb +11 -0
- data/app/views/old_sql/report/chart.html.erb +8 -25
- data/lib/generators/old_sql/templates/user_design_template.csv +2 -3
- data/lib/generators/old_sql/templates/user_old_sql_demo_chart_design.yml +18 -9
- data/lib/old_sql/report_design/chart.rb +2 -2
- data/lib/old_sql/report_design/chart_item.rb +4 -4
- data/lib/old_sql/report_design/chart_parser.rb +2 -2
- data/public/javascripts/old_sql/chart.js +33 -0
- metadata +5 -265
- data/public/javascripts/old_sql/MochiKit-1.4.2/Changes +0 -362
- data/public/javascripts/old_sql/MochiKit-1.4.2/LICENSE.txt +0 -69
- data/public/javascripts/old_sql/MochiKit-1.4.2/MANIFEST +0 -179
- data/public/javascripts/old_sql/MochiKit-1.4.2/META.json +0 -17
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Async.html +0 -814
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Base.html +0 -1703
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Color.html +0 -755
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DOM.html +0 -1197
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DateTime.html +0 -168
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/DragAndDrop.html +0 -187
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Format.html +0 -300
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Iter.html +0 -524
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Logging.html +0 -420
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/LoggingPane.html +0 -142
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Position.html +0 -38
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Selector.html +0 -240
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Signal.html +0 -508
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Sortable.html +0 -244
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Style.html +0 -385
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/VersionHistory.html +0 -384
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/Visual.html +0 -1161
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/html/MochiKit/index.html +0 -447
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/js/toc.js +0 -113
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Async.rst +0 -767
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Base.rst +0 -1445
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Color.rst +0 -651
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DOM.rst +0 -1143
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DateTime.rst +0 -145
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/DragAndDrop.rst +0 -197
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Format.rst +0 -258
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Iter.rst +0 -454
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Logging.rst +0 -348
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/LoggingPane.rst +0 -128
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Position.rst +0 -26
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Selector.rst +0 -203
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Signal.rst +0 -498
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Sortable.rst +0 -186
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Style.rst +0 -353
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/VersionHistory.rst +0 -362
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/Visual.rst +0 -895
- data/public/javascripts/old_sql/MochiKit-1.4.2/doc/rst/MochiKit/index.rst +0 -83
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/ajax_tables.css +0 -69
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/ajax_tables.js +0 -401
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/domains.json +0 -10
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/domains.xml +0 -40
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/ajax_tables/index.html +0 -96
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/color_wheel.css +0 -4
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/color_wheel.js +0 -95
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/color_wheel/index.html +0 -31
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/dnd_sortable.css +0 -23
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/dropmarker.png +0 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/icon.png +0 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/index.html +0 -54
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable2_test.html +0 -150
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable3_test.html +0 -42
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable4_test.html +0 -90
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable5_test.html +0 -29
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable_test.html +0 -38
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/dnd_sortable/sortable_tree_test.html +0 -189
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/draggable.css +0 -28
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/draggable.js +0 -73
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/draggable/index.html +0 -38
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_bigslide.html +0 -36
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_blind.html +0 -65
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_blindslide.html +0 -31
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_combi.css +0 -18
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_fadeappear.html +0 -61
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_grow_shrink.html +0 -38
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_onload.html +0 -67
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_queue.html +0 -67
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_queue_limit.html +0 -30
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_scroll.html +0 -483
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/effects_slide.html +0 -62
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/full.html +0 -71
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/icon.png +0 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/effects/index.html +0 -150
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/index.html +0 -88
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/interpreter.css +0 -54
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/interpreter/interpreter.js +0 -373
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/index.html +0 -78
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/key_events.css +0 -5
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/key_events/key_events.js +0 -85
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/index.html +0 -46
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/logging_pane.css +0 -78
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/logging_pane/logging_pane.js +0 -11
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/index.html +0 -74
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/mochiregexp.css +0 -73
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mochiregexp/mochiregexp.js +0 -125
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/index.html +0 -88
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/mouse_events.css +0 -17
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/mouse_events/mouse_events.js +0 -59
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/index.html +0 -28
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/rounded_corners.css +0 -3
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/rounded_corners/rounded_corners.js +0 -19
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_boxes.html +0 -45
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_full.html +0 -119
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_ghost.html +0 -40
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_hoverclass.html +0 -43
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_scroll.html +0 -91
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/dnd_snap.html +0 -54
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/index.html +0 -93
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/simple_dnd/simple_dnd.css +0 -64
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/index.html +0 -71
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/sortable_tables.css +0 -66
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/sortable_tables/sortable_tables.js +0 -203
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/SyntaxHighlighter.css +0 -177
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/Tests.html +0 -339
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushCSharp.js +0 -30
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushDelphi.js +0 -31
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushJScript.js +0 -22
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushPhp.js +0 -23
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushPython.js +0 -71
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushSql.js +0 -40
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushVb.js +0 -29
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shBrushXml.js +0 -61
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/lib/SyntaxHighlighter/shCore.js +0 -622
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.css +0 -1
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.html +0 -19
- data/public/javascripts/old_sql/MochiKit-1.4.2/examples/view-source/view-source.js +0 -70
- data/public/javascripts/old_sql/MochiKit-1.4.2/include/_img/bg_docheader.gif +0 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/include/_img/g_bullet.gif +0 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/include/_img/g_logo_doc.gif +0 -0
- data/public/javascripts/old_sql/MochiKit-1.4.2/include/css/documentation.css +0 -130
- data/public/javascripts/old_sql/MochiKit-1.4.2/include/css/general.css +0 -48
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Async.js +0 -682
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Base.js +0 -1489
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Color.js +0 -863
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DOM.js +0 -1256
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DateTime.js +0 -222
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/DragAndDrop.js +0 -793
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Format.js +0 -304
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Iter.js +0 -844
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Logging.js +0 -315
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/LoggingPane.js +0 -353
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/MochiKit.js +0 -188
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/MockDOM.js +0 -115
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Position.js +0 -236
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Selector.js +0 -415
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Signal.js +0 -897
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Sortable.js +0 -589
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Style.js +0 -594
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Test.js +0 -162
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/Visual.js +0 -2026
- data/public/javascripts/old_sql/MochiKit-1.4.2/lib/MochiKit/__package__.js +0 -18
- data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/MochiKit.js +0 -7829
- data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/__package__.js +0 -6
- data/public/javascripts/old_sql/MochiKit-1.4.2/packed/MochiKit/customize.html +0 -251
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/FakeJSAN.js +0 -40
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/SimpleTest.js +0 -381
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/TestRunner.js +0 -159
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/SimpleTest/test.css +0 -28
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/cli.js +0 -6
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/index.html +0 -25
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/standalone.js +0 -16
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Base.js +0 -577
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Color.js +0 -137
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_DateTime.js +0 -52
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_DragAndDrop.js +0 -30
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Format.js +0 -89
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Iter.js +0 -186
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Logging.js +0 -88
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Async.html +0 -408
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Async.json +0 -1
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Base.html +0 -34
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Color.html +0 -84
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DOM-Safari.html +0 -48
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DOM.html +0 -363
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DateTime.html +0 -39
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-DragAndDrop.html +0 -54
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Format.html +0 -39
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Iter.html +0 -38
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-JSAN.html +0 -32
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Logging.html +0 -40
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-MochiKit.html +0 -18
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Selector.html +0 -295
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Signal.html +0 -43
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Style.html +0 -223
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_MochiKit-Visual.html +0 -197
- data/public/javascripts/old_sql/MochiKit-1.4.2/tests/test_Signal.js +0 -481
- data/public/javascripts/old_sql/plotkit-0.9.1/COPYING +0 -28
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Base.js +0 -406
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Canvas.js +0 -683
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/EasyPlot.js +0 -161
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/Layout.js +0 -756
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/PlotKit.js +0 -151
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/PlotKit_Packed.js +0 -2177
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SVG.js +0 -705
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SweetCanvas.js +0 -348
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/SweetSVG.js +0 -247
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/dummy.svg +0 -9
- data/public/javascripts/old_sql/plotkit-0.9.1/PlotKit/excanvas.js +0 -723
- data/public/javascripts/old_sql/plotkit-0.9.1/README +0 -1
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/MochiKitAdditions.html +0 -2
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/MochiKitAdditions.txt +0 -2
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Base.html +0 -302
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Base.txt +0 -139
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Canvas.html +0 -172
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Canvas.txt +0 -81
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.EasyPlot.html +0 -155
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.EasyPlot.txt +0 -50
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Layout.html +0 -428
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Layout.txt +0 -330
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.QuickStart.html +0 -368
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.QuickStart.txt +0 -256
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Renderer.html +0 -436
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.Renderer.txt +0 -299
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SVG.html +0 -159
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SVG.txt +0 -64
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetCanvas.html +0 -131
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetCanvas.txt +0 -34
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetSVG.html +0 -131
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.SweetSVG.txt +0 -34
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.html +0 -334
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/PlotKit.txt +0 -151
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/SVGCanvasCompat.html +0 -304
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/SVGCanvasCompat.txt +0 -144
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/barsample.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/black.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/blue.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/cyan.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/doc.css +0 -62
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/generate.py +0 -37
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/green.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/orange.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/piesample.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/purple.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/doc/red.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/scripts/custom_rhino.jar +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/scripts/pack.py +0 -58
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/axis.html +0 -31
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/basic.html +0 -25
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/basic.js +0 -143
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/debug.html +0 -56
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo-svg.html +0 -58
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo-svg.js +0 -133
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo.html +0 -57
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/demo.js +0 -136
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/dynamic.html +0 -161
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/firefox.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/konqueror.png +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/mozilla.ico +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/msie.gif +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/opera.ico +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/img/safari.gif +0 -0
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/labels-img.html +0 -38
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/labels.html +0 -43
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/prototype_compat.html +0 -28
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-easy.html +0 -29
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-horiz.html +0 -53
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-neg.html +0 -29
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart-svg.html +0 -61
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/quickstart.html +0 -57
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/sample.txt +0 -6
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg-sweet.html +0 -29
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg-sweet.js +0 -141
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg.html +0 -26
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/svg.js +0 -147
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/sweet.html +0 -24
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/sweet.js +0 -89
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/tests.css +0 -66
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/testsvg.html +0 -20
- data/public/javascripts/old_sql/plotkit-0.9.1/tests/testsvg.js +0 -31
@@ -1,705 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
PlotKit SVG
|
3
|
-
===========
|
4
|
-
SVG Renderer for PlotKit
|
5
|
-
|
6
|
-
Copyright
|
7
|
-
---------
|
8
|
-
Copyright 2005,2006 (c) Alastair Tse <alastair^liquidx.net>
|
9
|
-
For use under the BSD license. <http://www.liquidx.net/plotkit>
|
10
|
-
*/
|
11
|
-
|
12
|
-
// -------------------------------------------------------------------------
|
13
|
-
// NOTES: - If you use XHTML1.1 strict, then you must include each MochiKit
|
14
|
-
// file individuall.
|
15
|
-
// - For IE support, you must include the AdobeSVG object hack.
|
16
|
-
// See tests/svg.html for details.
|
17
|
-
// -------------------------------------------------------------------------
|
18
|
-
// -------------------------------------------------------------------------
|
19
|
-
// Check required components
|
20
|
-
// -------------------------------------------------------------------------
|
21
|
-
|
22
|
-
try {
|
23
|
-
if (typeof(PlotKit.Layout) == 'undefined')
|
24
|
-
{
|
25
|
-
throw "";
|
26
|
-
}
|
27
|
-
}
|
28
|
-
catch (e) {
|
29
|
-
throw "PlotKit depends on MochiKit.{Base,Color,DOM,Format} and PlotKit.Layout"
|
30
|
-
}
|
31
|
-
|
32
|
-
|
33
|
-
// ---------------------------------------------------------------------------
|
34
|
-
// SVG Renderer
|
35
|
-
// ---------------------------------------------------------------------------
|
36
|
-
|
37
|
-
PlotKit.SVGRenderer = function(element, layout, options) {
|
38
|
-
if (arguments.length > 0)
|
39
|
-
this.__init__(element, layout, options);
|
40
|
-
};
|
41
|
-
|
42
|
-
PlotKit.SVGRenderer.NAME = "PlotKit.SVGRenderer";
|
43
|
-
PlotKit.SVGRenderer.VERSION = PlotKit.VERSION;
|
44
|
-
|
45
|
-
PlotKit.SVGRenderer.__repr__ = function() {
|
46
|
-
return "[" + this.NAME + " " + this.VERSION + "]";
|
47
|
-
};
|
48
|
-
|
49
|
-
PlotKit.SVGRenderer.toString = function() {
|
50
|
-
return this.__repr__();
|
51
|
-
}
|
52
|
-
|
53
|
-
PlotKit.SVGRenderer.SVGNS = 'http://www.w3.org/2000/svg';
|
54
|
-
|
55
|
-
PlotKit.SVGRenderer.prototype.__init__ = function(element, layout, options) {
|
56
|
-
var isNil = MochiKit.Base.isUndefinedOrNull;
|
57
|
-
|
58
|
-
// default options
|
59
|
-
this.options = {
|
60
|
-
"drawBackground": true,
|
61
|
-
"backgroundColor": Color.whiteColor(),
|
62
|
-
"padding": {left: 30, right: 30, top: 5, bottom: 10},
|
63
|
-
"colorScheme": PlotKit.Base.palette(PlotKit.Base.baseColors()[1]),
|
64
|
-
"strokeColor": Color.whiteColor(),
|
65
|
-
"strokeColorTransform": "asStrokeColor",
|
66
|
-
"strokeWidth": 0.5,
|
67
|
-
"shouldFill": true,
|
68
|
-
"shouldStroke": true,
|
69
|
-
"drawXAxis": true,
|
70
|
-
"drawYAxis": true,
|
71
|
-
"axisLineColor": Color.blackColor(),
|
72
|
-
"axisLineWidth": 0.5,
|
73
|
-
"axisTickSize": 3,
|
74
|
-
"axisLabelColor": Color.blackColor(),
|
75
|
-
"axisLabelFont": "Arial",
|
76
|
-
"axisLabelFontSize": 9,
|
77
|
-
"axisLabelWidth": 50,
|
78
|
-
"axisLabelUseDiv": true,
|
79
|
-
"pieRadius": 0.4,
|
80
|
-
"enableEvents": true
|
81
|
-
};
|
82
|
-
|
83
|
-
MochiKit.Base.update(this.options, options ? options : {});
|
84
|
-
this.layout = layout;
|
85
|
-
this.element = MochiKit.DOM.getElement(element);
|
86
|
-
this.container = this.element.parentNode;
|
87
|
-
this.height = parseInt(this.element.getAttribute("height"));
|
88
|
-
this.width = parseInt(this.element.getAttribute("width"));
|
89
|
-
this.document = document;
|
90
|
-
this.root = this.element;
|
91
|
-
|
92
|
-
// Adobe SVG Support:
|
93
|
-
// - if an exception is thrown, then no Adobe SVG Plugin support.
|
94
|
-
try {
|
95
|
-
this.document = this.element.getSVGDocument();
|
96
|
-
this.root = isNil(this.document.documentElement) ? this.element : this.document.documentElement;
|
97
|
-
}
|
98
|
-
catch (e) {
|
99
|
-
}
|
100
|
-
|
101
|
-
this.element.style.zIndex = 1;
|
102
|
-
|
103
|
-
if (isNil(this.element))
|
104
|
-
throw "SVGRenderer() - passed SVG object is not found";
|
105
|
-
|
106
|
-
if (isNil(this.container) || this.container.nodeName.toLowerCase() != "div")
|
107
|
-
throw "SVGRenderer() - No DIV's around the SVG.";
|
108
|
-
|
109
|
-
// internal state
|
110
|
-
this.xlabels = new Array();
|
111
|
-
this.ylabels = new Array();
|
112
|
-
|
113
|
-
// initialise some meta structures in SVG
|
114
|
-
this.defs = this.createSVGElement("defs");
|
115
|
-
|
116
|
-
this.area = {
|
117
|
-
x: this.options.padding.left,
|
118
|
-
y: this.options.padding.top,
|
119
|
-
w: this.width - this.options.padding.left - this.options.padding.right,
|
120
|
-
h: this.height - this.options.padding.top - this.options.padding.bottom
|
121
|
-
};
|
122
|
-
|
123
|
-
MochiKit.DOM.updateNodeAttributes(this.container,
|
124
|
-
{"style":{ "position": "relative", "width": this.width + "px"}});
|
125
|
-
|
126
|
-
|
127
|
-
};
|
128
|
-
|
129
|
-
|
130
|
-
PlotKit.SVGRenderer.prototype.render = function() {
|
131
|
-
if (this.options.drawBackground)
|
132
|
-
this._renderBackground();
|
133
|
-
|
134
|
-
if (this.layout.style == "bar") {
|
135
|
-
this._renderBarChart();
|
136
|
-
this._renderBarAxis();
|
137
|
-
}
|
138
|
-
else if (this.layout.style == "pie") {
|
139
|
-
this._renderPieChart();
|
140
|
-
this._renderPieAxis();
|
141
|
-
}
|
142
|
-
else if (this.layout.style == "line") {
|
143
|
-
this._renderLineChart();
|
144
|
-
this._renderLineAxis();
|
145
|
-
}
|
146
|
-
};
|
147
|
-
|
148
|
-
PlotKit.SVGRenderer.prototype._renderBarOrLine = function(data, plotFunc, startFunc, endFunc) {
|
149
|
-
|
150
|
-
var colorCount = this.options.colorScheme.length;
|
151
|
-
var colorScheme = this.options.colorScheme;
|
152
|
-
var setNames = MochiKit.Base.keys(this.layout.datasets);
|
153
|
-
var setCount = setNames.length;
|
154
|
-
|
155
|
-
for (var i = 0; i < setCount; i++) {
|
156
|
-
var setName = setNames[i];
|
157
|
-
var attrs = new Array();
|
158
|
-
var color = colorScheme[i%colorCount];
|
159
|
-
|
160
|
-
if (this.options.shouldFill)
|
161
|
-
attrs["fill"] = color.toRGBString();
|
162
|
-
else
|
163
|
-
attrs["fill"] = "none";
|
164
|
-
|
165
|
-
if (this.options.shouldStroke &&
|
166
|
-
(this.options.strokeColor || this.options.strokeColorTransform)) {
|
167
|
-
if (this.options.strokeColor)
|
168
|
-
attrs["stroke"] = this.options.strokeColor.toRGBString();
|
169
|
-
else if (this.options.strokeColorTransform)
|
170
|
-
attrs["stroke"] = color[this.options.strokeColorTransform]().toRGBString();
|
171
|
-
attrs["strokeWidth"] = this.options.strokeWidth;
|
172
|
-
}
|
173
|
-
|
174
|
-
if (startFunc)
|
175
|
-
startFunc(attrs);
|
176
|
-
|
177
|
-
var forEachFunc = function(obj) {
|
178
|
-
if (obj.name == setName)
|
179
|
-
plotFunc(attrs, obj);
|
180
|
-
};
|
181
|
-
|
182
|
-
MochiKit.Iter.forEach(data, bind(forEachFunc, this));
|
183
|
-
if (endFunc)
|
184
|
-
endFunc(attrs);
|
185
|
-
}
|
186
|
-
};
|
187
|
-
|
188
|
-
PlotKit.SVGRenderer.prototype._renderBarChart = function() {
|
189
|
-
var bind = MochiKit.Base.bind;
|
190
|
-
|
191
|
-
var drawRect = function(attrs, bar) {
|
192
|
-
var x = this.area.w * bar.x + this.area.x;
|
193
|
-
var y = this.area.h * bar.y + this.area.y;
|
194
|
-
var w = this.area.w * bar.w;
|
195
|
-
var h = this.area.h * bar.h;
|
196
|
-
this._drawRect(x, y, w, h, attrs);
|
197
|
-
};
|
198
|
-
this._renderBarOrLine(this.layout.bars, bind(drawRect, this));
|
199
|
-
};
|
200
|
-
|
201
|
-
PlotKit.SVGRenderer.prototype._renderLineChart = function() {
|
202
|
-
var bind = MochiKit.Base.bind;
|
203
|
-
|
204
|
-
var addPoint = function(attrs, point) {
|
205
|
-
this._tempPointsBuffer += (this.area.w * point.x + this.area.x) + "," +
|
206
|
-
(this.area.h * point.y + this.area.y) + " ";
|
207
|
-
};
|
208
|
-
|
209
|
-
var startLine = function(attrs) {
|
210
|
-
this._tempPointsBuffer = "";
|
211
|
-
this._tempPointsBuffer += (this.area.x) + "," + (this.area.y+this.area.h) + " ";
|
212
|
-
};
|
213
|
-
|
214
|
-
var endLine = function(attrs) {
|
215
|
-
this._tempPointsBuffer += (this.area.w + this.area.x) + "," +(this.area.h + this.area.y);
|
216
|
-
attrs["points"] = this._tempPointsBuffer;
|
217
|
-
var elem = this.createSVGElement("polygon", attrs);
|
218
|
-
this.root.appendChild(elem);
|
219
|
-
};
|
220
|
-
|
221
|
-
this._renderBarOrLine(this.layout.points,
|
222
|
-
bind(addPoint, this),
|
223
|
-
bind(startLine, this),
|
224
|
-
bind(endLine, this));
|
225
|
-
};
|
226
|
-
|
227
|
-
|
228
|
-
PlotKit.SVGRenderer.prototype._renderPieChart = function() {
|
229
|
-
var colorCount = this.options.colorScheme.length;
|
230
|
-
var slices = this.layout.slices;
|
231
|
-
|
232
|
-
var centerx = this.area.x + this.area.w * 0.5;
|
233
|
-
var centery = this.area.y + this.area.h * 0.5;
|
234
|
-
var radius = Math.min(this.area.w * this.options.pieRadius,
|
235
|
-
this.area.h * this.options.pieRadius);
|
236
|
-
|
237
|
-
// NOTE NOTE!! Canvas Tag draws the circle clockwise from the y = 0, x = 1
|
238
|
-
// so we have to subtract 90 degrees to make it start at y = 1, x = 0
|
239
|
-
|
240
|
-
// workaround if we only have 1 slice of 100%
|
241
|
-
if (slices.length == 1 && (Math.abs(slices[0].startAngle) - Math.abs(slices[0].endAngle) < 0.1)) {
|
242
|
-
var attrs = {"cx": centerx , "cy": centery , "r": radius };
|
243
|
-
var color = this.options.colorScheme[0];
|
244
|
-
if (this.options.shouldFill)
|
245
|
-
attrs["fill"] = color.toRGBString();
|
246
|
-
else
|
247
|
-
attrs["fill"] = "none";
|
248
|
-
|
249
|
-
if (this.options.shouldStroke &&
|
250
|
-
(this.options.strokeColor || this.options.strokeColorTransform)) {
|
251
|
-
if (this.options.strokeColor)
|
252
|
-
attrs["stroke"] = this.options.strokeColor.toRGBString();
|
253
|
-
else if (this.options.strokeColorTransform)
|
254
|
-
attrs["stroke"] = color[this.options.strokeColorTransform]().toRGBString();
|
255
|
-
attrs["style"] = "stroke-width: " + this.options.strokeWidth;
|
256
|
-
}
|
257
|
-
|
258
|
-
this.root.appendChild(this.createSVGElement("circle", attrs));
|
259
|
-
return;
|
260
|
-
}
|
261
|
-
|
262
|
-
for (var i = 0; i < slices.length; i++) {
|
263
|
-
var attrs = new Array();
|
264
|
-
var color = this.options.colorScheme[i%colorCount];
|
265
|
-
if (this.options.shouldFill)
|
266
|
-
attrs["fill"] = color.toRGBString();
|
267
|
-
else
|
268
|
-
attrs["fill"] = "none";
|
269
|
-
|
270
|
-
if (this.options.shouldStroke &&
|
271
|
-
(this.options.strokeColor || this.options.strokeColorTransform)) {
|
272
|
-
if (this.options.strokeColor)
|
273
|
-
attrs["stroke"] = this.options.strokeColor.toRGBString();
|
274
|
-
else if (this.options.strokeColorTransform)
|
275
|
-
attrs["stroke"] = color[this.options.strokeColorTransform]().toRGBString();
|
276
|
-
attrs["style"] = "stroke-width:" + this.options.strokeWidth;
|
277
|
-
}
|
278
|
-
|
279
|
-
var largearc = 0;
|
280
|
-
if (Math.abs(slices[i].endAngle - slices[i].startAngle) > Math.PI)
|
281
|
-
largearc = 1;
|
282
|
-
var x1 = Math.cos(slices[i].startAngle - Math.PI/2) * radius;
|
283
|
-
var y1 = Math.sin(slices[i].startAngle - Math.PI/2) * radius;
|
284
|
-
var x2 = Math.cos(slices[i].endAngle - Math.PI/2) * radius;
|
285
|
-
var y2 = Math.sin(slices[i].endAngle - Math.PI/2) * radius;
|
286
|
-
var rx = x2 - x1;
|
287
|
-
var ry = y2 - y1;
|
288
|
-
|
289
|
-
var pathString = "M" + centerx + "," + centery + " ";
|
290
|
-
pathString += "l" + x1 + "," + y1 + " ";
|
291
|
-
pathString += "a" + radius + "," + radius + " 0 " + largearc + ",1 " + rx + "," + ry + " z";
|
292
|
-
|
293
|
-
attrs["d"] = pathString;
|
294
|
-
|
295
|
-
var elem = this.createSVGElement("path", attrs);
|
296
|
-
this.root.appendChild(elem);
|
297
|
-
}
|
298
|
-
};
|
299
|
-
|
300
|
-
PlotKit.SVGRenderer.prototype._renderBarAxis = function() {
|
301
|
-
this._renderAxis();
|
302
|
-
}
|
303
|
-
|
304
|
-
PlotKit.SVGRenderer.prototype._renderLineAxis = function() {
|
305
|
-
this._renderAxis();
|
306
|
-
};
|
307
|
-
|
308
|
-
|
309
|
-
PlotKit.SVGRenderer.prototype._renderAxis = function() {
|
310
|
-
|
311
|
-
if (!this.options.drawXAxis && !this.options.drawYAxis)
|
312
|
-
return;
|
313
|
-
|
314
|
-
var labelStyle = {"style":
|
315
|
-
{"position": "absolute",
|
316
|
-
"textAlign": "center",
|
317
|
-
"fontSize": this.options.axisLabelFontSize + "px",
|
318
|
-
"zIndex": 10,
|
319
|
-
"color": this.options.axisLabelColor.toRGBString(),
|
320
|
-
"width": this.options.axisLabelWidth + "px",
|
321
|
-
"overflow": "hidden"
|
322
|
-
}
|
323
|
-
};
|
324
|
-
|
325
|
-
// axis lines
|
326
|
-
var lineAttrs = {
|
327
|
-
"stroke": this.options.axisLineColor.toRGBString(),
|
328
|
-
"strokeWidth": this.options.axisLineWidth
|
329
|
-
};
|
330
|
-
|
331
|
-
|
332
|
-
if (this.options.drawYAxis) {
|
333
|
-
if (this.layout.yticks) {
|
334
|
-
var drawTick = function(tick) {
|
335
|
-
var x = this.area.x;
|
336
|
-
var y = this.area.y + tick[0] * this.area.h;
|
337
|
-
this._drawLine(x, y, x - 3, y, lineAttrs);
|
338
|
-
|
339
|
-
if (this.options.axisLabelUseDiv) {
|
340
|
-
var label = DIV(labelStyle, tick[1]);
|
341
|
-
label.style.top = (y - this.options.axisLabelFontSize) + "px";
|
342
|
-
label.style.left = (x - this.options.padding.left + this.options.axisTickSize) + "px";
|
343
|
-
label.style.textAlign = "left";
|
344
|
-
label.style.width = (this.options.padding.left - 3) + "px";
|
345
|
-
MochiKit.DOM.appendChildNodes(this.container, label);
|
346
|
-
this.ylabels.push(label);
|
347
|
-
}
|
348
|
-
else {
|
349
|
-
var attrs = {
|
350
|
-
y: y + 3,
|
351
|
-
x: (x - this.options.padding.left + 3),
|
352
|
-
width: (this.options.padding.left - this.options.axisTickSize) + "px",
|
353
|
-
height: (this.options.axisLabelFontSize + 3) + "px",
|
354
|
-
fontFamily: "Arial",
|
355
|
-
fontSize: this.options.axisLabelFontSize + "px",
|
356
|
-
fill: this.options.axisLabelColor.toRGBString()
|
357
|
-
};
|
358
|
-
|
359
|
-
/* we can do clipping just like DIVs
|
360
|
-
http://www.xml.com/pub/a/2004/06/02/svgtype.html */
|
361
|
-
/*
|
362
|
-
var mask = this.createSVGElement("mask", {id: "mask" + tick[0]});
|
363
|
-
var maskShape = this.createSVGElement("rect",
|
364
|
-
{y: y + 3,
|
365
|
-
x: (x - this.options.padding.left + 3),
|
366
|
-
width: (this.options.padding.left - this.options.axisTickSize) + "px",
|
367
|
-
height: (this.options.axisLabelFontSize + 3) + "px",
|
368
|
-
style: {"fill": "#ffffff", "stroke": "#000000"}});
|
369
|
-
mask.appendChild(maskShape);
|
370
|
-
this.defs.appendChild(mask);
|
371
|
-
|
372
|
-
attrs["filter"] = "url(#mask" + tick[0] + ")";
|
373
|
-
*/
|
374
|
-
|
375
|
-
var label = this.createSVGElement("text", attrs);
|
376
|
-
label.appendChild(this.document.createTextNode(tick[1]));
|
377
|
-
this.root.appendChild(label);
|
378
|
-
}
|
379
|
-
};
|
380
|
-
|
381
|
-
MochiKit.Iter.forEach(this.layout.yticks, bind(drawTick, this));
|
382
|
-
}
|
383
|
-
|
384
|
-
this._drawLine(this.area.x, this.area.y, this.area.x, this.area.y + this.area.h, lineAttrs);
|
385
|
-
}
|
386
|
-
|
387
|
-
if (this.options.drawXAxis) {
|
388
|
-
if (this.layout.xticks) {
|
389
|
-
var drawTick = function(tick) {
|
390
|
-
var x = this.area.x + tick[0] * this.area.w;
|
391
|
-
var y = this.area.y + this.area.h;
|
392
|
-
this._drawLine(x, y, x, y + this.options.axisTickSize, lineAttrs);
|
393
|
-
|
394
|
-
if (this.options.axisLabelUseDiv) {
|
395
|
-
var label = DIV(labelStyle, tick[1]);
|
396
|
-
label.style.top = (y + this.options.axisTickSize) + "px";
|
397
|
-
label.style.left = (x - this.options.axisLabelWidth/2) + "px";
|
398
|
-
label.style.textAlign = "center";
|
399
|
-
label.style.width = this.options.axisLabelWidth + "px";
|
400
|
-
MochiKit.DOM.appendChildNodes(this.container, label);
|
401
|
-
this.xlabels.push(label);
|
402
|
-
}
|
403
|
-
else {
|
404
|
-
var attrs = {
|
405
|
-
y: (y + this.options.axisTickSize + this.options.axisLabelFontSize),
|
406
|
-
x: x - 3,
|
407
|
-
width: this.options.axisLabelWidth + "px",
|
408
|
-
height: (this.options.axisLabelFontSize + 3) + "px",
|
409
|
-
fontFamily: "Arial",
|
410
|
-
fontSize: this.options.axisLabelFontSize + "px",
|
411
|
-
fill: this.options.axisLabelColor.toRGBString(),
|
412
|
-
textAnchor: "middle"
|
413
|
-
};
|
414
|
-
var label = this.createSVGElement("text", attrs);
|
415
|
-
label.appendChild(this.document.createTextNode(tick[1]));
|
416
|
-
this.root.appendChild(label);
|
417
|
-
}
|
418
|
-
};
|
419
|
-
|
420
|
-
MochiKit.Iter.forEach(this.layout.xticks, bind(drawTick, this));
|
421
|
-
}
|
422
|
-
|
423
|
-
this._drawLine(this.area.x, this.area.y + this.area.h, this.area.x + this.area.w, this.area.y + this.area.h, lineAttrs)
|
424
|
-
}
|
425
|
-
};
|
426
|
-
|
427
|
-
PlotKit.SVGRenderer.prototype._renderPieAxis = function() {
|
428
|
-
|
429
|
-
if (this.layout.xticks) {
|
430
|
-
// make a lookup dict for x->slice values
|
431
|
-
var lookup = new Array();
|
432
|
-
for (var i = 0; i < this.layout.slices.length; i++) {
|
433
|
-
lookup[this.layout.slices[i].xval] = this.layout.slices[i];
|
434
|
-
}
|
435
|
-
|
436
|
-
var centerx = this.area.x + this.area.w * 0.5;
|
437
|
-
var centery = this.area.y + this.area.h * 0.5;
|
438
|
-
var radius = Math.min(this.area.w * this.options.pieRadius + 10,
|
439
|
-
this.area.h * this.options.pieRadius + 10);
|
440
|
-
var labelWidth = this.options.axisLabelWidth;
|
441
|
-
|
442
|
-
for (var i = 0; i < this.layout.xticks.length; i++) {
|
443
|
-
var slice = lookup[this.layout.xticks[i][0]];
|
444
|
-
if (MochiKit.Base.isUndefinedOrNull(slice))
|
445
|
-
continue;
|
446
|
-
|
447
|
-
|
448
|
-
var angle = (slice.startAngle + slice.endAngle)/2;
|
449
|
-
// normalize the angle
|
450
|
-
var normalisedAngle = angle;
|
451
|
-
if (normalisedAngle > Math.PI * 2)
|
452
|
-
normalisedAngle = normalisedAngle - Math.PI * 2;
|
453
|
-
else if (normalisedAngle < 0)
|
454
|
-
normalisedAngle = normalisedAngle + Math.PI * 2;
|
455
|
-
|
456
|
-
var labelx = centerx + Math.sin(normalisedAngle) * (radius + 10);
|
457
|
-
var labely = centery - Math.cos(normalisedAngle) * (radius + 10);
|
458
|
-
|
459
|
-
var attrib = {
|
460
|
-
"position": "absolute",
|
461
|
-
"zIndex": 11,
|
462
|
-
"width": labelWidth + "px",
|
463
|
-
"fontSize": this.options.axisLabelFontSize + "px",
|
464
|
-
"overflow": "hidden",
|
465
|
-
"color": this.options.axisLabelColor.toHexString()
|
466
|
-
};
|
467
|
-
|
468
|
-
var svgattrib = {
|
469
|
-
"width": labelWidth + "px",
|
470
|
-
"fontSize": this.options.axisLabelFontSize + "px",
|
471
|
-
"height": (this.options.axisLabelFontSize + 3) + "px",
|
472
|
-
"fill": this.options.axisLabelColor.toRGBString()
|
473
|
-
};
|
474
|
-
|
475
|
-
if (normalisedAngle <= Math.PI * 0.5) {
|
476
|
-
// text on top and align left
|
477
|
-
MochiKit.Base.update(attrib, {
|
478
|
-
'textAlign': 'left', 'verticalAlign': 'top',
|
479
|
-
'left': labelx + 'px',
|
480
|
-
'top': (labely - this.options.axisLabelFontSize) + "px"
|
481
|
-
});
|
482
|
-
MochiKit.Base.update(svgattrib, {
|
483
|
-
"x": labelx,
|
484
|
-
"y" :(labely - this.options.axisLabelFontSize),
|
485
|
-
"textAnchor": "left"
|
486
|
-
});
|
487
|
-
}
|
488
|
-
else if ((normalisedAngle > Math.PI * 0.5) && (normalisedAngle <= Math.PI)) {
|
489
|
-
// text on bottom and align left
|
490
|
-
MochiKit.Base.update(attrib, {
|
491
|
-
'textAlign': 'left', 'verticalAlign': 'bottom',
|
492
|
-
'left': labelx + 'px',
|
493
|
-
'top': labely + "px"
|
494
|
-
});
|
495
|
-
MochiKit.Base.update(svgattrib, {
|
496
|
-
'textAnchor': 'left',
|
497
|
-
'x': labelx,
|
498
|
-
'y': labely
|
499
|
-
});
|
500
|
-
}
|
501
|
-
else if ((normalisedAngle > Math.PI) && (normalisedAngle <= Math.PI*1.5)) {
|
502
|
-
// text on bottom and align right
|
503
|
-
MochiKit.Base.update(attrib, {
|
504
|
-
'textAlign': 'right', 'verticalAlign': 'bottom',
|
505
|
-
'left': labelx + 'px',
|
506
|
-
'top': labely + "px"
|
507
|
-
});
|
508
|
-
MochiKit.Base.update(svgattrib, {
|
509
|
-
'textAnchor': 'right',
|
510
|
-
'x': labelx - labelWidth,
|
511
|
-
'y': labely
|
512
|
-
});
|
513
|
-
}
|
514
|
-
else {
|
515
|
-
// text on top and align right
|
516
|
-
MochiKit.Base.update(attrib, {
|
517
|
-
'textAlign': 'left', 'verticalAlign': 'bottom',
|
518
|
-
'left': labelx + 'px',
|
519
|
-
'top': labely + "px"
|
520
|
-
});
|
521
|
-
MochiKit.Base.update(svgattrib, {
|
522
|
-
'textAnchor': 'left',
|
523
|
-
'x': labelx - labelWidth,
|
524
|
-
'y': labely - this.options.axisLabelFontSize
|
525
|
-
});
|
526
|
-
}
|
527
|
-
|
528
|
-
if (this.options.axisLabelUseDiv) {
|
529
|
-
var label = DIV({'style': attrib}, this.layout.xticks[i][1]);
|
530
|
-
this.xlabels.push(label);
|
531
|
-
MochiKit.DOM.appendChildNodes(this.container, label);
|
532
|
-
}
|
533
|
-
else {
|
534
|
-
var label = this.createSVGElement("text", svgattrib);
|
535
|
-
label.appendChild(this.document.createTextNode(this.layout.xticks[i][1]))
|
536
|
-
this.root.appendChild(label);
|
537
|
-
}
|
538
|
-
}
|
539
|
-
|
540
|
-
}
|
541
|
-
};
|
542
|
-
|
543
|
-
PlotKit.SVGRenderer.prototype._renderBackground = function() {
|
544
|
-
var opts = {"stroke": "none",
|
545
|
-
"fill": this.options.backgroundColor.toRGBString()
|
546
|
-
};
|
547
|
-
this._drawRect(0, 0, this.width, this.height, opts);
|
548
|
-
};
|
549
|
-
|
550
|
-
PlotKit.SVGRenderer.prototype._drawRect = function(x, y, w, h, moreattrs) {
|
551
|
-
var attrs = {x: x + "px", y: y + "px", width: w + "px", height: h + "px"};
|
552
|
-
if (moreattrs)
|
553
|
-
MochiKit.Base.update(attrs, moreattrs);
|
554
|
-
|
555
|
-
var elem = this.createSVGElement("rect", attrs);
|
556
|
-
this.root.appendChild(elem);
|
557
|
-
};
|
558
|
-
|
559
|
-
PlotKit.SVGRenderer.prototype._drawLine = function(x1, y1, x2, y2, moreattrs) {
|
560
|
-
var attrs = {x1: x1 + "px", y1: y1 + "px", x2: x2 + "px", y2: y2 + "px"};
|
561
|
-
if (moreattrs)
|
562
|
-
MochiKit.Base.update(attrs, moreattrs);
|
563
|
-
|
564
|
-
var elem = this.createSVGElement("line", attrs);
|
565
|
-
this.root.appendChild(elem);
|
566
|
-
}
|
567
|
-
|
568
|
-
PlotKit.SVGRenderer.prototype.clear = function() {
|
569
|
-
while(this.element.firstChild) {
|
570
|
-
this.element.removeChild(this.element.firstChild);
|
571
|
-
}
|
572
|
-
|
573
|
-
if (this.options.axisLabelUseDiv) {
|
574
|
-
for (var i = 0; i < this.xlabels.length; i++) {
|
575
|
-
MochiKit.DOM.removeElement(this.xlabels[i]);
|
576
|
-
}
|
577
|
-
for (var i = 0; i < this.ylabels.length; i++) {
|
578
|
-
MochiKit.DOM.removeElement(this.ylabels[i]);
|
579
|
-
}
|
580
|
-
}
|
581
|
-
this.xlabels = new Array();
|
582
|
-
this.ylabels = new Array();
|
583
|
-
};
|
584
|
-
|
585
|
-
|
586
|
-
PlotKit.SVGRenderer.prototype.createSVGElement = function(name, attrs) {
|
587
|
-
var isNil = MochiKit.Base.isUndefinedOrNull;
|
588
|
-
var elem;
|
589
|
-
var doc = isNil(this.document) ? document : this.document;
|
590
|
-
|
591
|
-
try {
|
592
|
-
elem = doc.createElementNS(PlotKit.SVGRenderer.SVGNS, name);
|
593
|
-
}
|
594
|
-
catch (e) {
|
595
|
-
elem = doc.createElement(name);
|
596
|
-
elem.setAttribute("xmlns", PlotKit.SVGRenderer.SVGNS);
|
597
|
-
}
|
598
|
-
|
599
|
-
if (attrs)
|
600
|
-
MochiKit.DOM.updateNodeAttributes(elem, attrs);
|
601
|
-
|
602
|
-
// TODO: we don't completely emulate the MochiKit.DOM.createElement
|
603
|
-
// as we don't care about nodes contained. We really should though.
|
604
|
-
|
605
|
-
return elem;
|
606
|
-
|
607
|
-
};
|
608
|
-
|
609
|
-
|
610
|
-
PlotKit.SVGRenderer.SVG = function(attrs) {
|
611
|
-
// we have to do things differently for IE+AdobeSVG.
|
612
|
-
// My guess this works (via trial and error) is that we need to
|
613
|
-
// have an SVG object in order to use SVGDocument.createElementNS
|
614
|
-
// but IE doesn't allow us to that.
|
615
|
-
|
616
|
-
var ie = navigator.appVersion.match(/MSIE (\d\.\d)/);
|
617
|
-
var opera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
|
618
|
-
if (ie && (ie[1] >= 6) && (!opera)) {
|
619
|
-
var width = attrs["width"] ? attrs["width"] : "100";
|
620
|
-
var height = attrs["height"] ? attrs["height"] : "100";
|
621
|
-
var eid = attrs["id"] ? attrs["id"] : "notunique";
|
622
|
-
|
623
|
-
var html = '<svg:svg width="' + width + '" height="' + height + '" ';
|
624
|
-
html += 'id="' + eid + '" version="1.1" baseProfile="full" />';
|
625
|
-
|
626
|
-
var canvas = document.createElement(html);
|
627
|
-
|
628
|
-
// create embedded SVG inside SVG.
|
629
|
-
var group = canvas.getSVGDocument().createElementNS(PlotKit.SVGRenderer.SVGNS, "svg");
|
630
|
-
group.setAttribute("width", width);
|
631
|
-
group.setAttribute("height", height);
|
632
|
-
canvas.getSVGDocument().appendChild(group);
|
633
|
-
|
634
|
-
return canvas;
|
635
|
-
}
|
636
|
-
else {
|
637
|
-
return PlotKit.SVGRenderer.prototype.createSVGElement("svg", attrs);
|
638
|
-
}
|
639
|
-
};
|
640
|
-
|
641
|
-
PlotKit.SVGRenderer.isSupported = function() {
|
642
|
-
var isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
|
643
|
-
var ieVersion = navigator.appVersion.match(/MSIE (\d\.\d)/);
|
644
|
-
var safariVersion = navigator.userAgent.match(/AppleWebKit\/(\d+)/);
|
645
|
-
var operaVersion = navigator.userAgent.match(/Opera\/(\d*\.\d*)/);
|
646
|
-
var mozillaVersion = navigator.userAgent.match(/rv:(\d*\.\d*).*Gecko/);
|
647
|
-
var svgFeature = "http://www.w3.org/TR/SVG11/feature#SVG";
|
648
|
-
|
649
|
-
if (ieVersion && (ieVersion[1] >= 6) && !isOpera) {
|
650
|
-
return document.implementation.hasFeature(svgFeature,"1.1");
|
651
|
-
/*
|
652
|
-
var dummysvg = document.createElement('<svg:svg width="1" height="1" baseProfile="full" version="1.1" id="dummy">');
|
653
|
-
try {
|
654
|
-
dummysvg.getSVGDocument();
|
655
|
-
dummysvg = null;
|
656
|
-
return true;
|
657
|
-
}
|
658
|
-
catch (e) {
|
659
|
-
return false;
|
660
|
-
}
|
661
|
-
*/
|
662
|
-
|
663
|
-
}
|
664
|
-
|
665
|
-
/* support not really there yet. no text and paths are buggy
|
666
|
-
if (safariVersion && (safariVersion[1] > 419))
|
667
|
-
return true;
|
668
|
-
*/
|
669
|
-
|
670
|
-
if (operaVersion && (operaVersion[1] > 8.9))
|
671
|
-
return true
|
672
|
-
|
673
|
-
if (mozillaVersion && (mozillaVersion > 1.7))
|
674
|
-
return true;
|
675
|
-
|
676
|
-
return false;
|
677
|
-
};
|
678
|
-
|
679
|
-
// Namespace Iniitialisation
|
680
|
-
|
681
|
-
PlotKit.SVG = {}
|
682
|
-
PlotKit.SVG.SVGRenderer = PlotKit.SVGRenderer;
|
683
|
-
|
684
|
-
PlotKit.SVG.EXPORT = [
|
685
|
-
"SVGRenderer"
|
686
|
-
];
|
687
|
-
|
688
|
-
PlotKit.SVG.EXPORT_OK = [
|
689
|
-
"SVGRenderer"
|
690
|
-
];
|
691
|
-
|
692
|
-
PlotKit.SVG.__new__ = function() {
|
693
|
-
var m = MochiKit.Base;
|
694
|
-
|
695
|
-
m.nameFunctions(this);
|
696
|
-
|
697
|
-
this.EXPORT_TAGS = {
|
698
|
-
":common": this.EXPORT,
|
699
|
-
":all": m.concat(this.EXPORT, this.EXPORT_OK)
|
700
|
-
};
|
701
|
-
};
|
702
|
-
|
703
|
-
PlotKit.SVG.__new__();
|
704
|
-
MochiKit.Base._exportSymbols(this, PlotKit.SVG);
|
705
|
-
|