echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Feature] Phylogenetic tree

Open nikolay-alemasov opened this issue 3 years ago • 4 comments

What problem does this feature solve?

Tree charts now cannot have a distance information for the particular edge. To draw not usual but phylogenetic tree such an information is used to depict distance between different sequences of the same gene in different organisms. Ideally such a tree should also be able to be constructed from a file in Newick format.

What does the proposed API look like?

myChart.showLoading();
$.get(ROOT_PATH + '/data/asset/data/phylogenetic-tree.nwk', function (data) {
  myChart.hideLoading();
  myChart.setOption(
    (option = {
      tooltip: {
        trigger: 'item',
        triggerOn: 'mousemove'
      },
      series: [
        {
          type: 'tree',
          data: [data],
          left: '2%',
          right: '2%',
          top: '8%',
          bottom: '20%',
          symbol: 'emptyCircle',
          orient: 'vertical',
          expandAndCollapse: true,
          label: {
            position: 'top',
            rotate: -90,
            verticalAlign: 'middle',
            align: 'right',
            fontSize: 9
          },
          leaves: {
            label: {
              position: 'bottom',
              rotate: -90,
              verticalAlign: 'middle',
              align: 'left'
            }
          },
          animationDurationUpdate: 750
        }
      ]
    })
  );
});

nikolay-alemasov avatar Feb 22 '22 03:02 nikolay-alemasov

Hi, I see that there are many designs in Phylogenetic_tree. Which one is required? Like this one?

Would graph series be useful in this case? But you have to provide the position of each node.

Ovilia avatar Feb 23 '22 09:02 Ovilia

It could be like this:

image

At least usually people get used to see such design. But the design itself can be different. For instance:

image

Or like this:

image

The main idea not to have different layout but rather have additional information on distance of a node from each other. That is why different nodes placed at different distances from each other on such trees.

nikolay-alemasov avatar Feb 23 '22 09:02 nikolay-alemasov

The second point is to be able to load a tree from newick format.

nikolay-alemasov avatar Feb 23 '22 09:02 nikolay-alemasov

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] avatar Feb 24 '24 21:02 github-actions[bot]

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!

github-actions[bot] avatar Mar 03 '24 21:03 github-actions[bot]

@Ovilia This is something my organization would also find super valuable. Any thoughts on pursuing this in echarts?

jdimmerman avatar Mar 14 '24 19:03 jdimmerman