Module: Charty::Backends::Plotly::IRubyOutput
- Defined in:
- lib/charty/backends/plotly.rb
Class Method Summary collapse
Class Method Details
.mathjax_config ⇒ Object
883 884 885 886 887 |
# File 'lib/charty/backends/plotly.rb', line 883 def self.mathjax_config " if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n END\nend\n" |
.prepare ⇒ Object
852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 |
# File 'lib/charty/backends/plotly.rb', line 852 def self.prepare return if @prepared html = " <script type=\"text/javascript\">\n %{win_config}\n %{mathjax_config}\n require.config({\n paths: {\n plotly: \"https://cdn.plot.ly/plotly-latest.min\"\n }\n });\n </script>\n HTML\n\n html %= {\n win_config: window_plotly_config,\n mathjax_config: mathjax_config\n }\n\n IRuby.display(html, mime: \"text/html\")\n @prepared = true\nend\n" |
.window_plotly_config ⇒ Object
876 877 878 879 880 |
# File 'lib/charty/backends/plotly.rb', line 876 def self.window_plotly_config " window.PlotlyConfig = {MathJaxConfig: 'local'};\n END\nend\n" |