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

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

Class Method Summary collapse

Class Method Details

.mathjax_configObject



541
542
543
544
545
# File 'lib/charty/backends/plotly.rb', line 541

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

.prepareObject



510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# File 'lib/charty/backends/plotly.rb', line 510

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



534
535
536
537
538
# File 'lib/charty/backends/plotly.rb', line 534

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