Module: Charty::Backends::Plotly::IRubyOutput

Defined in:
lib/charty/backends/plotly.rb

Class Method Summary collapse

Class Method Details

.mathjax_configObject



811
812
813
814
815
# File 'lib/charty/backends/plotly.rb', line 811

def self.mathjax_config
  "    if (window.MathJax) {MathJax.Hub.Config({SVG: {font: \"STIX-Web\"}});}\n  END\nend\n"

.prepareObject



780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
# File 'lib/charty/backends/plotly.rb', line 780

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_configObject



804
805
806
807
808
# File 'lib/charty/backends/plotly.rb', line 804

def self.window_plotly_config
  "    window.PlotlyConfig = {MathJaxConfig: 'local'};\n  END\nend\n"