apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.16k stars 19.6k forks source link

Highlight edges through dispatchAction in force-layout graph #10676

Open moqi112358 opened 5 years ago

moqi112358 commented 5 years ago

What problem does this feature solve?

In my project, I want to highlight one or some paths (including several edges). However we can only highlight nodes (dataIndex or data name) through dispatchAction. Could you please add some new feature to help to highlight the edges through dispatchAction?

What does the proposed API look like?

myChart.dispatchAction({
       type: 'highlight',       
       seriesIndex: 0, 
        seriesName: 'test', 
        edgeDataIndex: number | list
});
echarts-bot[bot] commented 5 years ago

Hi! We've received your issue and please be patient to get responded. 🎉 The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

Have a nice day! 🍵

Ovilia commented 5 years ago

https://echarts.apache.org/zh/api.html#action.highlight

liuttcc commented 5 years ago

Hi, I have read the document as well as the source code. First, the node dataIndex and the edge dataIndex were counted separately. In the code view/Chart.js, I find

highlight: function (seriesModel, ecModel, api, payload) {
        toggleHighlight(seriesModel.getData(), payload, 'emphasis');
    }

Here getData() can be found in Model/Series.js, I think the possible reason that we can't highlight the edges through dispatchAction now is that getData function will get the node dataIndex but not the edge dataindex.

Could you please help me check it?

Ovilia commented 5 years ago

Could @susiwen8 help check this? Thanks!

susiwen8 commented 5 years ago

@Ovilia Sure

ilovepumpkin commented 4 years ago

Any updates on this issue? I have the same requirement - need to highlight an edge programmingly.

ppaz commented 2 years ago

Any updates?

Dugyu commented 12 months ago

Any updates?

hx425072624 commented 9 months ago

Any updates?I need to highlight both node and edge

iezlli commented 3 months ago

Any updates?

tri-dataxight commented 2 months ago

any updates?