Javascript 如何在d3.js元素上使用intro.js

Javascript 如何在d3.js元素上使用intro.js,javascript,d3.js,intro.js,Javascript,D3.js,Intro.js,我使用d3.js生成一个sankey图,并使用intro.js引导页面浏览。js适用于我所有的页面,除了d3图表。例如,我还使用intro.js浏览了其他元素,这些元素也是由js库数据表动态生成的,它工作得非常好 我的DataTables教程代码: document.getElementById('help').onclick = function (){ var intro = introJs(); intro.setOptions({ steps: [

我使用d3.js生成一个sankey图,并使用intro.js引导页面浏览。js适用于我所有的页面,除了d3图表。例如,我还使用intro.js浏览了其他元素,这些元素也是由js库数据表动态生成的,它工作得非常好

我的DataTables教程代码:

document.getElementById('help').onclick = function (){
  var intro = introJs();
    intro.setOptions({
      steps: [
        { 
          intro: "These are the results of your search."
        },
        {
          element: "[name=DataTables_Table_0_length]",
          intro: "Select how many results to view.",
          position: "right"
        },
        {
          element: "[type=search][aria-controls=DataTables_Table_0]",
          intro: 'Here you can search the table.',
          position: 'left'
        },
        {
          element: "[class=ColVis]",
          intro: "To show or hide columns, use this.",
          position: "left"
        },
        {
          element: "[class=DTTT_container]",
          intro: "Use these buttons to download, print or copy the data in the     table.",
          position: "left"
        },
        {
          intro: "Select an NPI to view its homepage and we'll continue from there."
        }
      ],
      'showBullets': true,
      'skipLabel': 'Let me drive',
      'doneLabel': "Try it out"
    });

intro.start();
};
所有这些元素都是动态生成的,但在调用时由intro.js识别

但是,当我尝试使用d3元素时,intro.js找不到它们

document.getElementById('help').onclick = function (){
  var intro = introJs();
    intro.setOptions({
      steps: [
        { 
          intro: "These are the results of your search."
        },
        {
          element: "[class=legend-items]",
          intro: "This is the legend.",
          position: "right"
        }
      ],
      'showBullets': true,
      'skipLabel': 'Let me drive',
      'doneLabel': "Try it out"
    });

    intro.start();
};
这是我的d3图表的截图:

有没有人面对过这个问题,能为我解释一下


非常感谢。

这在intro.js repo上仍然是一个未解决的问题:

这在intro.js repo上仍然是一个未解决的问题:

我在兔子洞里没有任何成功。终于有幸参加了“自助游”,尽管它并不完美。你甚至可以让mathjax在tour元素中进行渲染。我没能成功地进入兔子洞。终于有幸参加了“自助游”,尽管它并不完美。您甚至可以让mathjax在tour元素中进行渲染。