E5B6 PlotlyJS · previm/previm Wiki · GitHub
[go: up one dir, main page]

Skip to content
mattn edited this page Jun 14, 2022 · 2 revisions
let g:previm_extra_libraries = [
\  {
\    'name': 'plotly',
\    'files': [
\      {
\        'type': 'js',
\        'path': '_/js/extra/plotly.min.js',
\        'url': 'https://cdn.plot.ly/plotly-2.12.1.min.js',
\        'code': [
\          'document.querySelectorAll(''pre code.language-plotlyjs'').forEach(elem => {',
\          '  const div = document.createElement(''div'')',
\          '  Plotly.newPlot(div, JSON.parse(elem.innerText))',
\          '  elem.parentNode.replaceWith(div)',
\          '})'
\        ],
\      },
\    ],
\  },
\]

Clone this wiki locally

0