m_sunils
Posts: 7
Joined: Fri Nov 23, 2018 4:22 pm

word cloud rectangular spiral

I need to implement a rectangular spiral in word cloud, the archimedean spiral works fine as mentioned on highcharts docs. But I am unable to figure out how a rectangular spiral can be applied (something like an elongated ellipse), tried something along the lines of whats in this sample
https://github.com/jasondavies/d3-cloud ... t.cloud.js
but was not successful.

Any help is much appreciated.
bastss
Site Admin
Posts: 1192
Joined: Wed Oct 17, 2018 10:59 am

Re: word cloud rectangular spiral

Hello m_sunis,

In a word cloud, spiral property by default is set to rectangular API: https://api.highcharts.com/highcharts/p ... oud.spiral. In most of our demos word cloud is displayed as an exactly rectangular spiral, demo: https://jsfiddle.net/Bastss/t7og1q3w/. Check for a change, how word-cloud archimedean spiral looks like, demo: https://jsfiddle.net/Bastss/2swLoghp/.

Best regards!
Sebastian Wędzel,
Highcharts Developer
m_sunils
Posts: 7
Joined: Fri Nov 23, 2018 4:22 pm

Re: word cloud rectangular spiral

bastss wrote: Mon Nov 26, 2018 10:39 am Hello m_sunis,

In a word cloud, spiral property by default is set to rectangular API: https://api.highcharts.com/highcharts/p ... oud.spiral. In most of our demos word cloud is displayed as an exactly rectangular spiral, demo: https://jsfiddle.net/Bastss/t7og1q3w/. Check for a change, how word-cloud archimedean spiral looks like, demo: https://jsfiddle.net/Bastss/2swLoghp/.

Best regards!
Thanks Basts for the help, however my requirement was a rectangular spiral with the words having a 0 deg orientation as opposed to default, when I change the orientation I dont get what i want eg;
With rectangular : https://jsfiddle.net/m_sunils/2swLoghp/4/
With archimedian: https://jsfiddle.net/m_sunils/zktnpjmL/1/

But I need something like below
Image
bastss
Site Admin
Posts: 1192
Joined: Wed Oct 17, 2018 10:59 am

Re: word cloud rectangular spiral

m_sunils,

There is a link to documentation which helps you to understand word-cloud and how building algorithm works API: https://www.highcharts.com/docs/chart-a ... -algorithm. I've reached something similar by manipulating t and x values. Check demo: https://jsfiddle.net/Bastss/rtc4pz3L/

Best regards!
Sebastian Wędzel,
Highcharts Developer
m_sunils
Posts: 7
Joined: Fri Nov 23, 2018 4:22 pm

Re: word cloud rectangular spiral

bastss wrote: Mon Nov 26, 2018 1:56 pm m_sunils,

There is a link to documentation which helps you to understand word-cloud and how building algorithm works API: https://www.highcharts.com/docs/chart-a ... -algorithm. I've reached something similar by manipulating t and x values. Check demo: https://jsfiddle.net/Bastss/rtc4pz3L/

Best regards!
Perfect!! Thanks a lot bastss!! you saved my day :)
bastss
Site Admin
Posts: 1192
Joined: Wed Oct 17, 2018 10:59 am

Re: word cloud rectangular spiral

You're welcome :)
Sebastian Wędzel,
Highcharts Developer

Return to “Highcharts Usage”