function chartExtension(editor, options = {}) {
  const optionLanguages = editor.options.codeBlockLanguages;
  if (optionLanguages && optionLanguages.indexOf(LANG) < 0) {
    optionLanguages.push(LANG);
  }

  options = util.extend({
    usageStatistics: editor.options.usageStatistics
  }, options);

  codeBlockManager.setReplacer(LANG, codeBlockChartDataAndOptions => {
    return chartReplacer(codeBlockChartDataAndOptions, options);
  });

  if (!editor.isViewer()) {
    // treat wysiwyg paste event
    _setWwCodeBlockManagerForChart(editor);

    // treat markdown paste event
    editor.eventManager.listen('pasteBefore', ev => _onMDPasteBefore(editor.mdEditor.cm, ev));
  }
}
function chartExtension(editor, options = {}) {
  const optionLanguages = editor.options.codeBlockLanguages;
  if (optionLanguages && optionLanguages.indexOf(LANG) < 0) {
    optionLanguages.push(LANG);
  }

  options = util.extend({
    usageStatistics: editor.options.usageStatistics
  }, options);

  codeBlockManager.setReplacer(LANG, codeBlockChartDataAndOptions => {
    return chartReplacer(codeBlockChartDataAndOptions, options);
  });

  if (!editor.isViewer()) {
    // treat wysiwyg paste event
    _setWwCodeBlockManagerForChart(editor);

    // treat markdown paste event
    editor.eventManager.listen('pasteBefore', ev => _onMDPasteBefore(editor.mdEditor.cm, ev));
  }
}
function chartExtension ( editor , options = { } ) { const optionLanguages = editor . options . codeBlockLanguages ; if ( optionLanguages && optionLanguages . indexOf ( LANG ) < 0 ) { optionLanguages . push ( LANG ) ; } options = util . extend ( { usageStatistics : editor . options . usageStatistics } , options ) ; codeBlockManager . setReplacer ( LANG , codeBlockChartDataAndOptions => { return chartReplacer ( codeBlockChartDataAndOptions , options ) ; } ) ; if ( ! editor . isViewer ( ) ) { // treat wysiwyg paste event _setWwCodeBlockManagerForChart ( editor ) ; // treat markdown paste event editor . eventManager . listen ( 'pasteBefore' , ev => _onMDPasteBefore ( editor . mdEditor . cm , ev ) ) ; } }
chart plugin
@param {Editor} editor - editor
@param {Object} options - chart options
@param {number} [options.minWidth=0] - minimum width
@param {number} [options.maxWidth=0] - maximum width
@param {number} [options.minHeight=Infinity] - minimum height
@param {number} [options.maxHeight=Infinity] - maximum height
@param {number|string} [options.width='auto'] - default height
@param {number|string} [options.height='auto'] - default height
@ignore
chart plugin
chartExtension - Extension for chart