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

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

Class Method Summary collapse

Class Method Details

.mathjax_configObject



239
240
241
242
243
# File 'lib/charty/backends/plotly.rb', line 239

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

.prepareObject



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/charty/backends/plotly.rb', line 208

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



232
233
234
235
236
# File 'lib/charty/backends/plotly.rb', line 232

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