如何在Plotly中为parcoords删除轴?

时间:2017-06-03 06:29:51

标签: javascript r plotly parallel-coordinates

从文档中,我发现了 custom buttonsclick events。但是,当我在平行坐标图中单击y轴时,我无法弄清楚如何配对它们,它会删除该轴。

编辑:我尝试了什么: 似乎我可以选择点,但不能选择线。

plot_ly(partial, type = 'parcoords', 
line = list(color = partial$freq,
colorscale = 'Jet',
showscale = TRUE,
reversescale = TRUE,
cmin = min_freq,
cmax = max_freq),
dimensions = interactiveList
) %>%
layout(title=name) %>%
onRender("
function(el, x) {
  console.log('entered');
  console.log(el);
  el.on('plotly_click', function(d) {
    // d.points is an array of objects which, in this case,
    // is length 1 since the click is tied to 1 point.
    console.log('lalala');
    var pt = d.points[0];
    var url = pt.data.text[pt.pointNumber];
    // DISCLAIMER: this won't work from RStudio
  console.log('hello');
    window.open(url);
  });
  el.on('plotly_selected', function(d) {
            console.log('selected');
  });
}

“)

0 个答案:

没有答案