You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by Vaishnav Nair <va...@gmail.com> on 2022/07/19 09:56:25 UTC

Regarding ECharts force graphs labels

We are using echarts series force graphs to generate network
graphs. Currently, when we zoom out too much the labels of the nodes look
cluttered and they are unreadable. We want to show labels only after a
certain zoom level. I was wondering if there is any way we could listen to
the zoom event and get the current zoom level. I checked with the dataZoom
event. However it doesn't seem to work with graph series.

Thanks
Vaishnav

Re: Regarding ECharts force graphs labels

Posted by Vaishnav Nair <va...@gmail.com>.
Thank you Zhongxiang Wang. This is exactly what I was looking for.

Regards
Vaishnav


On Wed, 20 Jul 2022 at 13:14, Zhongxiang Wang <wa...@apache.org> wrote:

> Hi Vaishnav,
>
> I'd like to provide you with more information.
>
> To get the current zoom level, you may listen to the **graphRoam**(case
> insensitive) event.
> Please refer to the link [1] for the full example.
>
> BTW, you can also set `labelLayout.hideOverlap`[2] to be `true` to hide
> the overlapped labels.
>
> [1] https://s.apache.org/l82z4
> [2]
> https://echarts.apache.org/option.html#series-graph.labelLayout.hideOverlap
>
> Regards.
>
>
> On Wed, Jul 20, 2022 at 11:37 AM Ovilia <ov...@gmail.com> wrote:
>
>> Hi,
>>
>> Zooming is different from dataZoom so you should not use the current
>> dataZoom event.
>> From the API I didn't see that there is a zoom event so if you are willing
>> to make a PR
>> to make this feature, it should be the best way to solve the problem.
>>
>> Thanks
>>
>> *Ovilia*
>>
>>
>> On Tue, Jul 19, 2022 at 6:02 PM Vaishnav Nair <va...@gmail.com>
>> wrote:
>>
>> > We are using echarts series force graphs to generate network
>> > graphs. Currently, when we zoom out too much the labels of the nodes
>> look
>> > cluttered and they are unreadable. We want to show labels only after a
>> > certain zoom level. I was wondering if there is any way we could listen
>> to
>> > the zoom event and get the current zoom level. I checked with the
>> dataZoom
>> > event. However it doesn't seem to work with graph series.
>> >
>> > Thanks
>> > Vaishnav
>> >
>>
>

Re: Regarding ECharts force graphs labels

Posted by Zhongxiang Wang <wa...@apache.org>.
Hi Vaishnav,

I'd like to provide you with more information.

To get the current zoom level, you may listen to the **graphRoam**(case
insensitive) event.
Please refer to the link [1] for the full example.

BTW, you can also set `labelLayout.hideOverlap`[2] to be `true` to hide the
overlapped labels.

[1] https://s.apache.org/l82z4
[2]
https://echarts.apache.org/option.html#series-graph.labelLayout.hideOverlap

Regards.


On Wed, Jul 20, 2022 at 11:37 AM Ovilia <ov...@gmail.com> wrote:

> Hi,
>
> Zooming is different from dataZoom so you should not use the current
> dataZoom event.
> From the API I didn't see that there is a zoom event so if you are willing
> to make a PR
> to make this feature, it should be the best way to solve the problem.
>
> Thanks
>
> *Ovilia*
>
>
> On Tue, Jul 19, 2022 at 6:02 PM Vaishnav Nair <va...@gmail.com>
> wrote:
>
> > We are using echarts series force graphs to generate network
> > graphs. Currently, when we zoom out too much the labels of the nodes look
> > cluttered and they are unreadable. We want to show labels only after a
> > certain zoom level. I was wondering if there is any way we could listen
> to
> > the zoom event and get the current zoom level. I checked with the
> dataZoom
> > event. However it doesn't seem to work with graph series.
> >
> > Thanks
> > Vaishnav
> >
>

Re: Regarding ECharts force graphs labels

Posted by Ovilia <ov...@gmail.com>.
Hi,

Zooming is different from dataZoom so you should not use the current
dataZoom event.
From the API I didn't see that there is a zoom event so if you are willing
to make a PR
to make this feature, it should be the best way to solve the problem.

Thanks

*Ovilia*


On Tue, Jul 19, 2022 at 6:02 PM Vaishnav Nair <va...@gmail.com>
wrote:

> We are using echarts series force graphs to generate network
> graphs. Currently, when we zoom out too much the labels of the nodes look
> cluttered and they are unreadable. We want to show labels only after a
> certain zoom level. I was wondering if there is any way we could listen to
> the zoom event and get the current zoom level. I checked with the dataZoom
> event. However it doesn't seem to work with graph series.
>
> Thanks
> Vaishnav
>