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

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

Class Method Summary collapse

Class Method Details

.mathjax_configObject



888
889
890
891
892
# File 'lib/charty/backends/plotly.rb', line 888

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

.prepareObject



857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
# File 'lib/charty/backends/plotly.rb', line 857

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



881
882
883
884
885
# File 'lib/charty/backends/plotly.rb', line 881

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