ela 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/.gitlab-ci.yml +23 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +139 -0
- data/Guardfile +25 -0
- data/LICENSE.txt +205 -0
- data/README.de.md +195 -0
- data/README.md +66 -0
- data/Rakefile +96 -0
- data/app/css/screen.styl +425 -0
- data/app/css/vendor/stackedit.styl +140 -0
- data/app/fonts/Roboto-Italic-webfont.eot +0 -0
- data/app/fonts/Roboto-Italic-webfont.svg +642 -0
- data/app/fonts/Roboto-Italic-webfont.ttf +0 -0
- data/app/fonts/Roboto-Italic-webfont.woff +0 -0
- data/app/fonts/Roboto-Light-webfont.eot +0 -0
- data/app/fonts/Roboto-Light-webfont.svg +641 -0
- data/app/fonts/Roboto-Light-webfont.ttf +0 -0
- data/app/fonts/Roboto-Light-webfont.woff +0 -0
- data/app/fonts/Roboto-LightItalic-webfont.eot +0 -0
- data/app/fonts/Roboto-LightItalic-webfont.svg +641 -0
- data/app/fonts/Roboto-LightItalic-webfont.ttf +0 -0
- data/app/fonts/Roboto-LightItalic-webfont.woff +0 -0
- data/app/fonts/Roboto-Medium-webfont.eot +0 -0
- data/app/fonts/Roboto-Medium-webfont.svg +593 -0
- data/app/fonts/Roboto-Medium-webfont.ttf +0 -0
- data/app/fonts/Roboto-Medium-webfont.woff +0 -0
- data/app/fonts/Roboto-MediumItalic-webfont.eot +0 -0
- data/app/fonts/Roboto-MediumItalic-webfont.svg +642 -0
- data/app/fonts/Roboto-MediumItalic-webfont.ttf +0 -0
- data/app/fonts/Roboto-MediumItalic-webfont.woff +0 -0
- data/app/fonts/Roboto-Regular-webfont.eot +0 -0
- data/app/fonts/Roboto-Regular-webfont.svg +621 -0
- data/app/fonts/Roboto-Regular-webfont.ttf +0 -0
- data/app/fonts/Roboto-Regular-webfont.woff +0 -0
- data/app/fonts/Roboto-Thin-webfont.eot +0 -0
- data/app/fonts/Roboto-Thin-webfont.svg +631 -0
- data/app/fonts/Roboto-Thin-webfont.ttf +0 -0
- data/app/fonts/Roboto-Thin-webfont.woff +0 -0
- data/app/fonts/Roboto-ThinItalic-webfont.eot +0 -0
- data/app/fonts/Roboto-ThinItalic-webfont.svg +631 -0
- data/app/fonts/Roboto-ThinItalic-webfont.ttf +0 -0
- data/app/fonts/Roboto-ThinItalic-webfont.woff +0 -0
- data/app/fonts/droid_sans_regular.typeface.svg +1 -0
- data/app/fonts/fontawesome-webfont.eot +0 -0
- data/app/fonts/fontawesome-webfont.svg +2671 -0
- data/app/fonts/fontawesome-webfont.ttf +0 -0
- data/app/fonts/fontawesome-webfont.woff +0 -0
- data/app/fonts/fontawesome-webfont.woff2 +0 -0
- data/app/js/lib/application.coffee +83 -0
- data/app/js/lib/bootstrap_data.coffee +70 -0
- data/app/js/lib/collections/00_limited_collection.coffee +85 -0
- data/app/js/lib/collections/curves.coffee +3 -0
- data/app/js/lib/collections/named_object_collection.coffee +7 -0
- data/app/js/lib/mathjaxConfig.coffee +241 -0
- data/app/js/lib/models/app.coffee +58 -0
- data/app/js/lib/models/base_app.coffee +62 -0
- data/app/js/lib/models/base_app_model.coffee +61 -0
- data/app/js/lib/models/base_calculator.coffee +212 -0
- data/app/js/lib/models/base_subapp_container.coffee +35 -0
- data/app/js/lib/models/curve.coffee +179 -0
- data/app/js/lib/router.coffee +26 -0
- data/app/js/lib/views/app.coffee +56 -0
- data/app/js/lib/views/base_app.coffee +274 -0
- data/app/js/lib/views/base_aside.coffee +9 -0
- data/app/js/lib/views/base_graph.coffee +477 -0
- data/app/js/lib/views/base_subapp_container.coffee +44 -0
- data/app/js/lib/views/canvas.coffee +73 -0
- data/app/js/lib/views/curve_graph.coffee +163 -0
- data/app/js/lib/views/curves_aside.coffee +21 -0
- data/app/js/lib/views/curves_list_item.coffee +8 -0
- data/app/js/lib/views/grouped_parameters_aside.coffee +14 -0
- data/app/js/lib/views/headup.coffee +15 -0
- data/app/js/lib/views/help.coffee +86 -0
- data/app/js/lib/views/interpolated_graph.coffee +281 -0
- data/app/js/lib/views/legend.coffee +138 -0
- data/app/js/lib/views/legend_handler.coffee +51 -0
- data/app/js/lib/views/overview.coffee +85 -0
- data/app/js/lib/views/overview_tile.coffee +18 -0
- data/app/js/lib/views/parameters_aside.coffee +12 -0
- data/app/js/lib/views/three_graph.coffee +92 -0
- data/app/js/vendor/Markdown.Converter.js +1519 -0
- data/app/js/vendor/Markdown.Extra.js +874 -0
- data/app/js/vendor/Markdown.Toc.coffee +79 -0
- data/app/js/vendor/backbone-1.3.3.min.js +2 -0
- data/app/js/vendor/backbone-validation-0.11.5.js +8 -0
- data/app/js/vendor/backbone.poised/form.coffee +156 -0
- data/app/js/vendor/backbone.poised/form/anchor.coffee +26 -0
- data/app/js/vendor/backbone.poised/form/base_control.coffee +42 -0
- data/app/js/vendor/backbone.poised/form/linked_control.coffee +79 -0
- data/app/js/vendor/backbone.poised/form/linked_number_control.coffee +27 -0
- data/app/js/vendor/backbone.poised/form/linked_range_control.coffee +53 -0
- data/app/js/vendor/backbone.poised/form/linked_select_control.coffee +18 -0
- data/app/js/vendor/backbone.poised/form/linked_string_control.coffee +27 -0
- data/app/js/vendor/backbone.poised/form/number_control.coffee +25 -0
- data/app/js/vendor/backbone.poised/form/range_control.coffee +48 -0
- data/app/js/vendor/backbone.poised/form/select_control.coffee +16 -0
- data/app/js/vendor/backbone.poised/form/selectbox.coffee +78 -0
- data/app/js/vendor/backbone.poised/form/slider.coffee +109 -0
- data/app/js/vendor/backbone.poised/form/string_control.coffee +23 -0
- data/app/js/vendor/backbone.poised/form/submit_control.coffee +39 -0
- data/app/js/vendor/backbone.poised/form/textarea.coffee +36 -0
- data/app/js/vendor/backbone.poised/form/textfield.coffee +86 -0
- data/app/js/vendor/backbone.poised/form/value.coffee +33 -0
- data/app/js/vendor/backbone.poised/form/value_control.coffee +15 -0
- data/app/js/vendor/backbone.poised/linked_form.coffee +43 -0
- data/app/js/vendor/backbone.poised/list.coffee +97 -0
- data/app/js/vendor/backbone.poised/list/add_button.coffee +16 -0
- data/app/js/vendor/backbone.poised/list/anchor.coffee +32 -0
- data/app/js/vendor/backbone.poised/list/item.coffee +68 -0
- data/app/js/vendor/backbone.poised/list/searchfield.coffee +26 -0
- data/app/js/vendor/backbone.poised/list/selectable_item.coffee +65 -0
- data/app/js/vendor/backbone.poised/patches.coffee +6 -0
- data/app/js/vendor/backbone.poised/string_mixin.coffee +23 -0
- data/app/js/vendor/backbone.poised/underscore_ext.coffee +2 -0
- data/app/js/vendor/backbone.poised/view.coffee +59 -0
- data/app/js/vendor/gaussianElimination.coffee +40 -0
- data/app/js/vendor/hammer-2.0.8.min.js +7 -0
- data/app/js/vendor/jquery-3.1.1.min.js +4 -0
- data/app/js/vendor/jquery.after-transition.coffee +20 -0
- data/app/js/vendor/jquery.backbone-hammer.coffee +28 -0
- data/app/js/vendor/jquery.keyboard-modifiers.coffee +22 -0
- data/app/js/vendor/jquery.mark-5.2.3.min.js +7 -0
- data/app/js/vendor/jquery.scrollTo-2.1.2.min.js +7 -0
- data/app/js/vendor/js-yaml-3.4.3.min.js +3 -0
- data/app/js/vendor/markup_text.coffee +95 -0
- data/app/js/vendor/mathjax/MathJax.js +19 -0
- data/app/js/vendor/mathjax/extensions/MathEvents.js +19 -0
- data/app/js/vendor/mathjax/extensions/tex2jax.js +19 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_AMS-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Caligraphic-Bold.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Caligraphic-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Fraktur-Bold.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Fraktur-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Main-Bold.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Main-Italic.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Main-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Math-BoldItalic.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Math-Italic.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Math-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_SansSerif-Bold.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_SansSerif-Italic.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_SansSerif-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Script-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Size1-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Size2-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Size3-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Size4-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_Typewriter-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/eot/MathJax_WinIE6-Regular.eot +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_AMS-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Caligraphic-Bold.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Caligraphic-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Fraktur-Bold.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Fraktur-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Main-Bold.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Main-Italic.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Main-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Math-BoldItalic.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Math-Italic.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Math-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_SansSerif-Bold.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_SansSerif-Italic.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_SansSerif-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Script-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Size1-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Size2-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Size3-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Size4-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_Typewriter-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_WinChrome-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/otf/MathJax_WinIE6-Regular.otf +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_AMS-Regular.svg +765 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Caligraphic-Bold.svg +136 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Caligraphic-Regular.svg +134 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Fraktur-Bold.svg +319 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Fraktur-Regular.svg +309 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Main-Bold.svg +656 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Main-Italic.svg +374 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Main-Regular.svg +659 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Math-BoldItalic.svg +331 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Math-Italic.svg +331 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Math-Regular.svg +330 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_SansSerif-Bold.svg +280 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_SansSerif-Italic.svg +245 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_SansSerif-Regular.svg +211 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Script-Regular.svg +160 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Size1-Regular.svg +110 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Size2-Regular.svg +109 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Size3-Regular.svg +49 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Size4-Regular.svg +102 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_Typewriter-Regular.svg +322 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/svg/MathJax_WinChrome-Regular.svg +39 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_AMS-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Caligraphic-Bold.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Caligraphic-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Fraktur-Bold.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Fraktur-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Main-Bold.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Main-Italic.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Main-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Math-BoldItalic.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Math-Italic.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Math-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_SansSerif-Bold.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_SansSerif-Italic.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_SansSerif-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Script-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Size1-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Size2-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Size3-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Size4-Regular.woff +0 -0
- data/app/js/vendor/mathjax/fonts/HTML-CSS/TeX/woff/MathJax_Typewriter-Regular.woff +0 -0
- data/app/js/vendor/mathjax/jax/element/mml/jax.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/Arrows.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/BasicLatin.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/CombDiacritMarks.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/CombDiactForSymbols.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/Dingbats.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/GeneralPunctuation.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/GeometricShapes.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/GreekAndCoptic.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/Latin1Supplement.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/LetterlikeSymbols.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/MathOperators.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/MiscMathSymbolsA.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/MiscMathSymbolsB.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/MiscSymbolsAndArrows.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/MiscTechnical.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/SpacingModLetters.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/SuppMathOperators.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/SupplementalArrowsA.js +19 -0
- data/app/js/vendor/mathjax/jax/element/mml/optable/SupplementalArrowsB.js +19 -0
- data/app/js/vendor/mathjax/jax/input/TeX/config.js +19 -0
- data/app/js/vendor/mathjax/jax/input/TeX/jax.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/autoload/annotation-xml.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/autoload/maction.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/autoload/menclose.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/autoload/mglyph.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/autoload/mmultiscripts.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/autoload/ms.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/autoload/mtable.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/autoload/multiline.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/config.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/AMS-Regular.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/Caligraphic-Bold.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/Fraktur-Bold.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/Fraktur-Regular.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/Main-Bold.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/Math-BoldItalic.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/SansSerif-Bold.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/SansSerif-Italic.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/SansSerif-Regular.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/Script-Regular.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/Typewriter-Regular.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/fontdata-extra.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/fonts/TeX/fontdata.js +19 -0
- data/app/js/vendor/mathjax/jax/output/CommonHTML/jax.js +19 -0
- data/app/js/vendor/modernizr-custom-3.3.1.min.js +3 -0
- data/app/js/vendor/persistjs-git.js +1136 -0
- data/app/js/vendor/poised/poised.general.coffee +21 -0
- data/app/js/vendor/poised/poised.tabs.coffee +31 -0
- data/app/js/vendor/poised/utils.coffee +11 -0
- data/app/js/vendor/request_animation_frame.coffee +19 -0
- data/app/js/vendor/three-82.min.js +15 -0
- data/app/js/vendor/three-CanvasRenderer-82.js +1118 -0
- data/app/js/vendor/three-Projector-82.js +929 -0
- data/app/js/vendor/underscore-1.8.3.min.js +6 -0
- data/app/js/vendor/webfontloader-1.6.26.min.js +33 -0
- data/app/views/aliasing/legend.jst.hamlc +6 -0
- data/app/views/composites/composites_list_item_label.jst.hamlc +3 -0
- data/app/views/composites/import_composites_aside.jst.hamlc +6 -0
- data/app/views/composites/mix_preset_list_item_label.jst.hamlc +8 -0
- data/app/views/composites/share_aside.jst.hamlc +7 -0
- data/app/views/doc/airplanes_list_item_label.jst.hamlc +3 -0
- data/app/views/doc/import_airplanes_aside.jst.hamlc +6 -0
- data/app/views/doc/share_aside.jst.hamlc +7 -0
- data/app/views/general/app.jst.hamlc +42 -0
- data/app/views/general/curves_list_item_label.jst.hamlc +5 -0
- data/app/views/general/help.jst.hamlc +7 -0
- data/app/views/general/tabs.jst.hamlc +6 -0
- data/app/views/index.haml +24 -0
- data/app/views/overview/app.jst.hamlc +7 -0
- data/app/views/overview/tile.jst.hamlc +4 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/ela.gemspec +50 -0
- data/exe/ela +59 -0
- data/lib/ela.rb +8 -0
- data/lib/ela/jasmine.rb +87 -0
- data/lib/ela/server.rb +136 -0
- data/lib/ela/utils.rb +131 -0
- data/lib/ela/version.rb +3 -0
- data/package-lock.json +899 -0
- data/package.json +11 -0
- data/support/project/Guardfile +64 -0
- data/support/project/jasmine.yml +3 -0
- data/support/server.ru +5 -0
- metadata +4365 -0
@@ -0,0 +1,58 @@
|
|
1
|
+
ELA.Models ?= {}
|
2
|
+
class ELA.Models.App extends Backbone.Model
|
3
|
+
helpText: 'about'
|
4
|
+
|
5
|
+
defaults:
|
6
|
+
path: null
|
7
|
+
params: null
|
8
|
+
showAbout: false
|
9
|
+
|
10
|
+
initialize: ->
|
11
|
+
@on('change:path', @handlePath)
|
12
|
+
@on('change:params', @handleParams)
|
13
|
+
|
14
|
+
# @returns BaseApp or BaseSubappContainer
|
15
|
+
currentAppModel: ->
|
16
|
+
@get('currentAppModel')
|
17
|
+
|
18
|
+
# @returns BaseApp
|
19
|
+
currentApp: ->
|
20
|
+
@currentAppModel()?.currentApp()
|
21
|
+
|
22
|
+
currentNamespace: ->
|
23
|
+
path = @get('path')
|
24
|
+
if path?
|
25
|
+
klass = path[0].toCapitalCamel()
|
26
|
+
ELA[klass]
|
27
|
+
|
28
|
+
handlePath: (model, path) ->
|
29
|
+
if path?
|
30
|
+
if path[0] is 'about'
|
31
|
+
@set(showAbout: true)
|
32
|
+
else if path[0] isnt @currentAppModel()?.name
|
33
|
+
AppClass = @currentNamespace().Models.App
|
34
|
+
@set
|
35
|
+
showAbout: false
|
36
|
+
currentAppModel: new AppClass(path: path.slice(1))
|
37
|
+
else
|
38
|
+
@currentAppModel()?.set(path: path.slice(1))
|
39
|
+
@set(showAbout: false)
|
40
|
+
else
|
41
|
+
@set
|
42
|
+
currentAppModel: null
|
43
|
+
showAbout: false
|
44
|
+
|
45
|
+
handleParams: (model, params) ->
|
46
|
+
@currentApp().deserialize(params) if params?
|
47
|
+
|
48
|
+
url: ->
|
49
|
+
url = location.origin
|
50
|
+
if json = @toJSON()
|
51
|
+
url += '/#app/' +
|
52
|
+
@get('path').join('/') +
|
53
|
+
'?' +
|
54
|
+
encodeURI(json)
|
55
|
+
url
|
56
|
+
|
57
|
+
toJSON: ->
|
58
|
+
JSON.stringify(currentApp.serialize()) if currentApp = @currentApp()
|
@@ -0,0 +1,62 @@
|
|
1
|
+
ELA.Models ?= {}
|
2
|
+
class ELA.Models.BaseApp extends ELA.Models.BaseAppModel
|
3
|
+
hasHelpText: true
|
4
|
+
|
5
|
+
initialize: (options = {}) ->
|
6
|
+
@parentApp = options.parentApp
|
7
|
+
|
8
|
+
@on 'change:path', @handlePath
|
9
|
+
@set currentAside: @get('currentAside') or null
|
10
|
+
@handlePath()
|
11
|
+
|
12
|
+
handlePath: =>
|
13
|
+
path = @get('path')?[0]
|
14
|
+
if path is 'help'
|
15
|
+
@set showHelp: true
|
16
|
+
else
|
17
|
+
@set showHelp: false
|
18
|
+
|
19
|
+
helpTextName: =>
|
20
|
+
@path.replace('/', '_')
|
21
|
+
|
22
|
+
# Initialize the curves attribute with all necessary options.
|
23
|
+
#
|
24
|
+
# @param [Array] curves curves to add to the curves collection
|
25
|
+
# @param [Object] options reached through to collection initialization
|
26
|
+
initCurves: (curves, options = {}) ->
|
27
|
+
@curves = new ELA.Collections.Curves(curves, options)
|
28
|
+
|
29
|
+
currentApp: -> this
|
30
|
+
|
31
|
+
serialize: ->
|
32
|
+
v = parameters: _.pick(
|
33
|
+
@attributes
|
34
|
+
_.keys(@defaults())
|
35
|
+
)
|
36
|
+
if @curves?
|
37
|
+
v.selectedCurves = for curve in @curves.getHistory()
|
38
|
+
curve.get('function')
|
39
|
+
if @displayParams?
|
40
|
+
v.displayParams = @displayParams.serialize()
|
41
|
+
if @get('axisLabelingForCurve')?
|
42
|
+
v.axisLabelingForCurve = @get('axisLabelingForCurve').get('function')
|
43
|
+
v
|
44
|
+
|
45
|
+
deserialize: (params) ->
|
46
|
+
@set(params.parameters)
|
47
|
+
|
48
|
+
for curve in @curves.models
|
49
|
+
curve.set(selected: false)
|
50
|
+
|
51
|
+
for curve in @curves.models
|
52
|
+
curveFunction = curve.get('function')
|
53
|
+
if _.contains(params.selectedCurves, curveFunction)
|
54
|
+
curve.set(selected: true)
|
55
|
+
if curveFunction is params.axisLabelingForCurve
|
56
|
+
@set(axisLabelingForCurve: curve)
|
57
|
+
|
58
|
+
# Wait until graphView has been created, it's initializer resets
|
59
|
+
# displayParams
|
60
|
+
if params.displayParams?
|
61
|
+
_.defer =>
|
62
|
+
@displayParams.deserialize(params.displayParams)
|
@@ -0,0 +1,61 @@
|
|
1
|
+
ELA.Models ?= {}
|
2
|
+
class ELA.Models.BaseAppModel extends Backbone.Model
|
3
|
+
# Returns the locale prefixes for the current app. Subapps have all
|
4
|
+
# levels as prefix.
|
5
|
+
localePrefix: (append = null) ->
|
6
|
+
prefixes = []
|
7
|
+
path = @path.split('/')
|
8
|
+
path.push(append) if append?
|
9
|
+
until path.length < 1
|
10
|
+
prefixes.push(path.join('.'))
|
11
|
+
path.pop()
|
12
|
+
if prefixes.length <= 0
|
13
|
+
null
|
14
|
+
else if prefixes.length is 1
|
15
|
+
prefixes[0]
|
16
|
+
else
|
17
|
+
prefixes
|
18
|
+
|
19
|
+
# Loads the settings for the current app. This function is subapp
|
20
|
+
# aware meaning it prefers the current subapps settings, then the
|
21
|
+
# parent apps settings.
|
22
|
+
#
|
23
|
+
# @param [String] type the settings type (e.g. curves, formFields, defaults, etc.)
|
24
|
+
# @param [String] key the settings key (may be undefined)
|
25
|
+
# @param [Object] defaults the fixed defaults (those may not be overwritten)
|
26
|
+
# @returns [Object] the merged settings
|
27
|
+
loadSettings: (type, key, defaults = {}) ->
|
28
|
+
@settings ||= {}
|
29
|
+
settings = @settings["#{type}_#{key}"] ||= do =>
|
30
|
+
settings = {}
|
31
|
+
pathComponents = @path.split('/')
|
32
|
+
until pathComponents.length < 1
|
33
|
+
step = ELA.settings
|
34
|
+
step = step[component] for component in pathComponents when step?
|
35
|
+
if type? and key?
|
36
|
+
settings = $.extend step?[type]?[key], settings
|
37
|
+
else
|
38
|
+
settings = $.extend step?[type], settings
|
39
|
+
pathComponents.pop()
|
40
|
+
settings
|
41
|
+
$.extend settings, defaults
|
42
|
+
|
43
|
+
# Loads the default parameters for the current app.
|
44
|
+
defaults: ->
|
45
|
+
@loadSettings('defaults')
|
46
|
+
|
47
|
+
# Loads the settings for a specific form field.
|
48
|
+
#
|
49
|
+
# @param [String] attribute the name of the attribute
|
50
|
+
# @param [Object] defaults
|
51
|
+
loadFormFieldSettings: (attribute, defaults = {}) ->
|
52
|
+
defaults.attribute = attribute
|
53
|
+
@loadSettings('formFields', attribute, defaults)
|
54
|
+
|
55
|
+
# Loads the curve settings for given FUN for the current app.
|
56
|
+
#
|
57
|
+
# @param [String] fun name of the curve function
|
58
|
+
# @param [Object] defaults default values
|
59
|
+
loadCurveSettings: (fun, defaults = {}) ->
|
60
|
+
defaults.function = fun
|
61
|
+
@loadSettings('curves', fun, defaults)
|
@@ -0,0 +1,212 @@
|
|
1
|
+
ELA.Models ?= {}
|
2
|
+
class ELA.Models.BaseCalculator
|
3
|
+
_.extend @prototype, Backbone.Events
|
4
|
+
|
5
|
+
xRange: (func) -> 1.0
|
6
|
+
yRange: (func) ->
|
7
|
+
curve = func
|
8
|
+
group = _.find @curveGroups, (group) -> _.contains(group, curve)
|
9
|
+
minY = null
|
10
|
+
maxY = null
|
11
|
+
if group?
|
12
|
+
for func in group when _.isFunction(@[func])
|
13
|
+
result = @[func]()
|
14
|
+
maxY = Math.max(result.maxY, maxY)
|
15
|
+
minY = Math.min(result.minY, minY)
|
16
|
+
else
|
17
|
+
result = null
|
18
|
+
if _.isFunction(@[func])
|
19
|
+
result = @[func]()
|
20
|
+
else
|
21
|
+
throw new Error("#{func} does not specify a calculator function in #{name}")
|
22
|
+
minY = result.minY
|
23
|
+
maxY = result.maxY
|
24
|
+
|
25
|
+
range = 0
|
26
|
+
range += maxY if maxY > 0
|
27
|
+
range -= minY if minY < 0
|
28
|
+
range
|
29
|
+
|
30
|
+
constructor: (options) ->
|
31
|
+
for required in (options.required or [])
|
32
|
+
throw "Missing `#{required}` option" unless options[required]?
|
33
|
+
|
34
|
+
models = _.omit(options, 'required')
|
35
|
+
|
36
|
+
@_memo = {}
|
37
|
+
|
38
|
+
this[name] = model for name, model of models
|
39
|
+
|
40
|
+
@bindEvents(models)
|
41
|
+
|
42
|
+
bindEvents: (models = {}) ->
|
43
|
+
@stopListening()
|
44
|
+
for key, obj of models
|
45
|
+
do =>
|
46
|
+
if obj.on?
|
47
|
+
modelName = _.clone(key)
|
48
|
+
@listenTo obj, 'change', (model) =>
|
49
|
+
for attribute, value of model.changed
|
50
|
+
@trigger("change:#{modelName}.#{attribute}", model, value)
|
51
|
+
|
52
|
+
@_parseForDeps: (funcStr) ->
|
53
|
+
for dep in (funcStr.match(/this.([$_a-zA-Z][$_a-zA-Z0-9]*(\.get)?(\([^\)]*\))?)/g) or [])
|
54
|
+
dep = dep.slice(5)
|
55
|
+
continue if /^[_A-Z][_A-Z0-9]*$/.test(dep) # skip CONSTANTS
|
56
|
+
if (match = dep.match(/([^.]+)\.get\(['"]([^'"]+)['"]\)/))
|
57
|
+
"#{match[1]}.#{match[2]}"
|
58
|
+
else
|
59
|
+
ampIndex = dep.indexOf('(')
|
60
|
+
if ampIndex > 0
|
61
|
+
# Search within parentheses again
|
62
|
+
[dep.slice(0, ampIndex), @_parseForDeps(dep.slice(ampIndex))]
|
63
|
+
else
|
64
|
+
dep
|
65
|
+
|
66
|
+
@extractDeps: (func) ->
|
67
|
+
deps = @_parseForDeps(func.toString())
|
68
|
+
_.chain(deps).flatten().compact().uniq().value()
|
69
|
+
|
70
|
+
@memoize: (name, func) ->
|
71
|
+
resolveDeps = (f) ->
|
72
|
+
depsBefore = ''
|
73
|
+
until f.deps.join('') is depsBefore
|
74
|
+
depsBefore = f.deps.join('')
|
75
|
+
f.deps = for dep in f.deps
|
76
|
+
if /([^.]+)\.([^.]+)/.test(dep)
|
77
|
+
dep
|
78
|
+
else if this[dep]?
|
79
|
+
this[dep].deps or dep
|
80
|
+
f.deps = _.chain(f.deps).flatten().compact().uniq().value()
|
81
|
+
f.depsResolved = true
|
82
|
+
|
83
|
+
bindDeps = (f, callback) ->
|
84
|
+
for dep in f.deps
|
85
|
+
@on "change:#{dep}", =>
|
86
|
+
callback()
|
87
|
+
@trigger("change:#{name}")
|
88
|
+
@_memo[name].eventsBound = true
|
89
|
+
|
90
|
+
parameters = do ->
|
91
|
+
funcStr = func.toString()
|
92
|
+
if (match = funcStr.match(/function ?\(([^\)]+)\)/))?
|
93
|
+
match[1].split(',')
|
94
|
+
else
|
95
|
+
[]
|
96
|
+
|
97
|
+
# TODO: Bind Events for dynamic dependencies like this[func] where
|
98
|
+
# func is a string parameter when calling the function.
|
99
|
+
f = if parameters.length > 0
|
100
|
+
->
|
101
|
+
@_memo[name] ||= values: {}, eventsBound: false
|
102
|
+
key = JSON.stringify(arguments)
|
103
|
+
|
104
|
+
unless @_memo[name].values[key]?
|
105
|
+
@_memo[name].values[key] = func.apply(this, arguments)
|
106
|
+
|
107
|
+
resolveDeps.call(this, f) unless f.depsResolved
|
108
|
+
|
109
|
+
unless @_memo[name].eventsBound
|
110
|
+
bindDeps.call this, f, =>
|
111
|
+
@_memo[name].values = {}
|
112
|
+
|
113
|
+
@_memo[name].values[key]
|
114
|
+
|
115
|
+
else
|
116
|
+
->
|
117
|
+
@_memo[name] ||= eventsBound: false
|
118
|
+
|
119
|
+
unless @_memo[name].value?
|
120
|
+
@_memo[name].value = func.apply(this, arguments)
|
121
|
+
|
122
|
+
resolveDeps.call(this, f) unless f.depsResolved
|
123
|
+
|
124
|
+
unless @_memo[name].eventsBound
|
125
|
+
bindDeps.call this, f, =>
|
126
|
+
@_memo[name].value = null
|
127
|
+
|
128
|
+
@_memo[name].value
|
129
|
+
|
130
|
+
f.depsResolved = false
|
131
|
+
f.memoizable = true
|
132
|
+
f.deps = @extractDeps(func)
|
133
|
+
f
|
134
|
+
|
135
|
+
@reactive: (name, func) ->
|
136
|
+
resolveDeps = (f) ->
|
137
|
+
depsBefore = ''
|
138
|
+
resolvedDeps = [] # required to avoid loops
|
139
|
+
until f.deps.join('') is depsBefore
|
140
|
+
depsBefore = f.deps.join('')
|
141
|
+
f.deps = for dep in f.deps
|
142
|
+
continue if dep is name
|
143
|
+
if /([^.]+)\.([^.]+)/.test(dep)
|
144
|
+
dep
|
145
|
+
else if this[dep]? and not _.contains(resolvedDeps, dep)
|
146
|
+
resolvedDeps.push(dep)
|
147
|
+
this[dep].deps or dep
|
148
|
+
f.deps = _.chain(f.deps).flatten().compact().uniq().value()
|
149
|
+
f.depsResolved = true
|
150
|
+
|
151
|
+
bindDeps = (f, callback) ->
|
152
|
+
for dep in f.deps
|
153
|
+
@on "change:#{dep}", =>
|
154
|
+
callback() if callback?
|
155
|
+
@trigger("change:#{name}")
|
156
|
+
@_memo[name].eventsBound = true
|
157
|
+
|
158
|
+
parameters = do ->
|
159
|
+
funcStr = func.toString()
|
160
|
+
if (match = funcStr.match(/function \(([^\)]+)\)/))?
|
161
|
+
match[1].split(',')
|
162
|
+
else
|
163
|
+
[]
|
164
|
+
|
165
|
+
# TODO: Bind Events for dynamic dependencies like this[func] where
|
166
|
+
# func is a string parameter when calling the function.
|
167
|
+
f = ->
|
168
|
+
@_memo[name] ||= eventsBound: false
|
169
|
+
resolveDeps.call(this, f) unless f.depsResolved
|
170
|
+
bindDeps.call(this, f) unless @_memo[name].eventsBound
|
171
|
+
f._func.apply(this, arguments)
|
172
|
+
|
173
|
+
f.depsResolved = false
|
174
|
+
f.memoizable = false
|
175
|
+
f.deps = @extractDeps(func)
|
176
|
+
f._func = func
|
177
|
+
f
|
178
|
+
|
179
|
+
clearMemoizations: ->
|
180
|
+
for key, memo of @_memo
|
181
|
+
memo.value = null if _.has(memo, 'value')
|
182
|
+
memo.values = {} if _.has(memo, 'values')
|
183
|
+
|
184
|
+
pole: (func, options = {}) ->
|
185
|
+
precision = Math.abs(options.precision or 0.001)
|
186
|
+
min = options.min or 0.0
|
187
|
+
max = options.max or 1.0
|
188
|
+
middle = (max + min)*0.5
|
189
|
+
|
190
|
+
minPos = this[func](min) > 0
|
191
|
+
maxPos = this[func](max) > 0
|
192
|
+
middlePos = this[func](middle) > 0
|
193
|
+
|
194
|
+
n = 0
|
195
|
+
if minPos is maxPos
|
196
|
+
return max
|
197
|
+
else
|
198
|
+
while middle - min > precision
|
199
|
+
y = this[func](middle)
|
200
|
+
return middle if y is Infinity or y is -Infinity
|
201
|
+
|
202
|
+
if minPos is middlePos
|
203
|
+
min = middle
|
204
|
+
minPos = middlePos
|
205
|
+
else
|
206
|
+
max = middle
|
207
|
+
maxPos = middlePos
|
208
|
+
|
209
|
+
middle = (max + min)*0.5
|
210
|
+
middlePos = this[func](middle) > 0
|
211
|
+
n += 1
|
212
|
+
min
|
@@ -0,0 +1,35 @@
|
|
1
|
+
ELA.Models ?= {}
|
2
|
+
class ELA.Models.BaseSubappContainer extends ELA.Models.BaseAppModel
|
3
|
+
subapps: {}
|
4
|
+
|
5
|
+
initialize: (options = {}) ->
|
6
|
+
@subappInstances = {}
|
7
|
+
|
8
|
+
for name, app of @subapps
|
9
|
+
AppModel = app.model.toFunction()
|
10
|
+
@subappInstances[name] = new AppModel
|
11
|
+
parentApp: this
|
12
|
+
|
13
|
+
@on 'change:path', @handlePath
|
14
|
+
@handlePath()
|
15
|
+
|
16
|
+
handlePath: =>
|
17
|
+
path = @get('path')
|
18
|
+
subapp = path[0]
|
19
|
+
if _.isEmpty(path)
|
20
|
+
subappPath = @subappInfo()[0].path
|
21
|
+
ELA.router.navigate "app/#{subappPath}",
|
22
|
+
trigger: false
|
23
|
+
replace: true
|
24
|
+
[..., last] = subappPath.split('/')
|
25
|
+
path.push(last)
|
26
|
+
|
27
|
+
@subappInstances[subapp]?.set(path: path.slice(1))
|
28
|
+
|
29
|
+
subappInfo: ->
|
30
|
+
for name, app of @subappInstances
|
31
|
+
name: app.name
|
32
|
+
path: app.path
|
33
|
+
|
34
|
+
currentApp: ->
|
35
|
+
@subappInstances[@get('path')[0]]
|
@@ -0,0 +1,179 @@
|
|
1
|
+
ELA.Models ?= {}
|
2
|
+
class ELA.Models.Curve extends Backbone.Model
|
3
|
+
defaults:
|
4
|
+
selected: false
|
5
|
+
lineDash: null
|
6
|
+
lineWidth: 3
|
7
|
+
zIndex: 0
|
8
|
+
group: 'general'
|
9
|
+
parentCurve: null
|
10
|
+
|
11
|
+
# https://jsfiddle.net/wct4bctb/
|
12
|
+
LINE_DASHES: [
|
13
|
+
[],
|
14
|
+
[6, 4], # 10
|
15
|
+
[2, 2], # 4
|
16
|
+
[2, 4, 10, 4], # 20
|
17
|
+
[2, 4, 2, 4, 2, 4, 2, 4, 10, 4], # 38
|
18
|
+
[26, 6], # 32
|
19
|
+
[2, 4, 26, 4] # 36
|
20
|
+
[2, 4, 2, 4, 2, 4, 2, 4, 26, 4] # 54
|
21
|
+
]
|
22
|
+
|
23
|
+
initialize: (attributes, options = {}) ->
|
24
|
+
super
|
25
|
+
|
26
|
+
# We have to reinitialize the subcurves every time. Otherwise they
|
27
|
+
# stay as Curve objects in the Model (Beware the scope of the
|
28
|
+
# subcurves reference, its class wide).
|
29
|
+
subcurves = {}
|
30
|
+
for name, subcurve of (attributes.subcurves or {})
|
31
|
+
subcurves[name] = new ELA.Models.Curve(subcurve, parentCurve: this)
|
32
|
+
@set('subcurves', subcurves)
|
33
|
+
@parentCurve = options.parentCurve if options.parentCurve?
|
34
|
+
|
35
|
+
showInLegend: ->
|
36
|
+
show = @get('showInLegend')
|
37
|
+
if show? then show else true
|
38
|
+
|
39
|
+
strokeStyle: ->
|
40
|
+
if @get('strokeStyle')?
|
41
|
+
@get('strokeStyle')
|
42
|
+
else if @parentCurve?
|
43
|
+
@parentCurve.strokeStyle()
|
44
|
+
else
|
45
|
+
index = @collection.filter((c) -> c.attributes.strokeStyle is undefined).indexOf(this)
|
46
|
+
length = @collection.length
|
47
|
+
saturation = Math.round(65 - 40 * ((index % 20) / 20))
|
48
|
+
luminance = Math.round(65 - 15 * ((index % 20) / 20 + 1))
|
49
|
+
distance = 360 * 0.61088
|
50
|
+
hue = index * distance
|
51
|
+
'hsl(' + hue + ",#{saturation}%,#{luminance}%)"
|
52
|
+
|
53
|
+
# @return Array canvas lineDash definition
|
54
|
+
lineDash: (idx = 0) ->
|
55
|
+
@get('lineDash') or @LINE_DASHES[idx % @LINE_DASHES.length]
|
56
|
+
|
57
|
+
hasSubcurves: ->
|
58
|
+
_.keys(@subcurves()).length > 0
|
59
|
+
|
60
|
+
subcurves: ->
|
61
|
+
@get('subcurves')
|
62
|
+
|
63
|
+
subcurve: (key) ->
|
64
|
+
@get('subcurves')[key]
|
65
|
+
|
66
|
+
select: => @set(selected: true)
|
67
|
+
deselect: => @set(selected: false)
|
68
|
+
|
69
|
+
toJSON: =>
|
70
|
+
_.defaults super(),
|
71
|
+
strokeStyle: @strokeStyle()
|
72
|
+
hsl: @strokeStyle()
|
73
|
+
|
74
|
+
Presenter: class Presenter extends Backbone.Poised.View
|
75
|
+
unitValue: (value) ->
|
76
|
+
unitFn = @model.get('unitFn')
|
77
|
+
return unitFn(value) if _.isFunction(unitFn)
|
78
|
+
|
79
|
+
unitFactor = @model.get('unitFactor')
|
80
|
+
return unitFactor * value if unitFactor?
|
81
|
+
|
82
|
+
value
|
83
|
+
|
84
|
+
# Returns the label.
|
85
|
+
#
|
86
|
+
# @return String The label
|
87
|
+
label: ->
|
88
|
+
@_label ||= do =>
|
89
|
+
func = @model.get('function')
|
90
|
+
@loadLocale "curves.#{func}.label", "curves.#{func}.yAxisLabel", "curves.#{func}.xAxisLabel",
|
91
|
+
'curves.yAxisLabel', 'curves.xAxisLabel',
|
92
|
+
defaultValue: func.toLabel()
|
93
|
+
|
94
|
+
# Returns the x-axis label.
|
95
|
+
#
|
96
|
+
# @return String The label for the x-axis
|
97
|
+
xAxisLabel: ->
|
98
|
+
@_xAxisLabel ||= do =>
|
99
|
+
func = @model.get('function')
|
100
|
+
@loadLocale "curves.#{func}.xAxisLabel", 'curves.xAxisLabel',
|
101
|
+
defaultValue: func.toLabel()
|
102
|
+
|
103
|
+
# Returns the y-axis label.
|
104
|
+
#
|
105
|
+
# @return String The label for the y-axis
|
106
|
+
yAxisLabel: ->
|
107
|
+
@_yAxisLabel ||= do =>
|
108
|
+
func = @model.get('function')
|
109
|
+
@loadLocale "curves.#{func}.yAxisLabel", 'curves.yAxisLabel',
|
110
|
+
defaultValue: func.toLabel()
|
111
|
+
|
112
|
+
# Returns the y axis unit label.
|
113
|
+
#
|
114
|
+
# With the introduction of distinction between curve specific x
|
115
|
+
# and y axis labeling, this function is deprecated in favor of
|
116
|
+
# `#xAxisUnitLabel` and `#yAxisUnitLabel`.
|
117
|
+
#
|
118
|
+
# @deprecated
|
119
|
+
#
|
120
|
+
# @return String The unit for the y-axis
|
121
|
+
unitLabel: ->
|
122
|
+
console.log('ELA.Models.Curve.Presenter#unitLabel is deprecated.')
|
123
|
+
unit = @model.get('unit')
|
124
|
+
if unit then "[#{unit}]" else ''
|
125
|
+
|
126
|
+
# Returns the x-axis unit label.
|
127
|
+
#
|
128
|
+
# @return String The unit for the x-axis
|
129
|
+
xAxisUnitLabel: ->
|
130
|
+
@_xAxisUnitLabel ||= do =>
|
131
|
+
func = @model.get('function')
|
132
|
+
@loadLocale "curves.#{func}.xAxisUnitLabel", 'curves.xAxisUnitLabel',
|
133
|
+
returnNull: true
|
134
|
+
|
135
|
+
# Returns the y axis unit label.
|
136
|
+
#
|
137
|
+
# @return String The unit for the y-axis
|
138
|
+
yAxisUnitLabel: ->
|
139
|
+
@_yAxisUnitLabel ||= do =>
|
140
|
+
func = @model.get('function')
|
141
|
+
@loadLocale "curves.#{func}.yAxisUnitLabel", 'curves.yAxisUnitLabel',
|
142
|
+
returnNull: true
|
143
|
+
|
144
|
+
# Returns the full label as concatenation of `#label` and
|
145
|
+
# `#unitLabel`. Generally used for curve specific axis labling.
|
146
|
+
#
|
147
|
+
# With the introduction of distinction between curve specific x
|
148
|
+
# and y axis labeling, this function is deprecated in favor of
|
149
|
+
# `#fullXAxisLabel` and `#fullYAxisLabel`.
|
150
|
+
#
|
151
|
+
# @deprecated
|
152
|
+
#
|
153
|
+
# @return String The full curve label
|
154
|
+
fullLabel: ->
|
155
|
+
console.log('ELA.Models.Curve.Presenter#fullLabel is deprecated.')
|
156
|
+
"#{@label()} #{@unitLabel()}"
|
157
|
+
|
158
|
+
# Returns the full label for the x-axis as concatenation of label
|
159
|
+
# and unit label.
|
160
|
+
#
|
161
|
+
# @return String The full label for the x-axis
|
162
|
+
fullXAxisLabel: ->
|
163
|
+
unit = @xAxisUnitLabel()
|
164
|
+
unit = if unit? then " [#{unit}]" else ''
|
165
|
+
"#{@xAxisLabel()}#{unit}"
|
166
|
+
|
167
|
+
# Returns the full label for the y-axis as concatenation of label
|
168
|
+
# and unit label.
|
169
|
+
#
|
170
|
+
# @return String The full label for the y-axis
|
171
|
+
fullYAxisLabel: ->
|
172
|
+
unit = @yAxisUnitLabel()
|
173
|
+
unit = if unit? then " [#{unit}]" else ''
|
174
|
+
"#{@yAxisLabel()}#{unit}"
|
175
|
+
|
176
|
+
subcurveLabel: (subcurve) ->
|
177
|
+
func = @model.get('function')
|
178
|
+
@loadLocale "curves.#{func}.subcurves.#{subcurve}.label",
|
179
|
+
defaultValue: func
|