Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resize Chart - Responsiveness #59

Open
kkknet opened this issue Jan 24, 2018 · 3 comments
Open

Resize Chart - Responsiveness #59

kkknet opened this issue Jan 24, 2018 · 3 comments

Comments

@kkknet
Copy link

kkknet commented Jan 24, 2018

Hi,

Does CircosJS has resize chart method/functionality?. I would like to resize the chart according to the window resize. Is there anything which is in built already?. If not, please let me know if anyone has done anything similar. Thanks.

@nicgirault
Copy link
Owner

Hi,

No it's not a use case I considered. I didn't try the following code but I guess a very inneficient way to do it would be:

const renderCircos = (width, height) => {
  const circos = new Circos({width, height}).render()
}

window.addEventListener('resize', () => {
  renderCircos(window.innerWidth, window.innerHeight)
})

@kkknet
Copy link
Author

kkknet commented Jan 24, 2018

Thanks for the quick response.

I tried doing the same. The only issue was layout regions are not getting displayed properly if we change the height and width of the chart (tried changing inner radius and outer radius of the config too).

Layout regions on the right hand side are getting hidden and the layout regions are not positioned in center in with the new width and height.

Is there a setting I am missing?

@kkknet
Copy link
Author

kkknet commented Feb 19, 2018

@nicgirault I was able to achieve the functionality almost close to auto resize with window using by subscribing to windows resize event and changing the inner radius and outer radius.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants