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

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

Class Method Summary collapse

Class Method Details

.mathjax_configObject



914
915
916
917
918
# File 'lib/charty/backends/plotly.rb', line 914

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

.prepareObject



883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
# File 'lib/charty/backends/plotly.rb', line 883

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



907
908
909
910
911
# File 'lib/charty/backends/plotly.rb', line 907

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