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

Canvas width doesnt fit the container #14

Closed
balaram26 opened this issue Apr 18, 2019 · 3 comments
Closed

Canvas width doesnt fit the container #14

balaram26 opened this issue Apr 18, 2019 · 3 comments

Comments

@balaram26
Copy link

Hi,i seem to have the same issue of canvas window not fitting, even when testing your examples from the Repo. Whatever example i load, the "canvas" element always starts from the middle of the page. The width of the canvas never fits its parent container and first of the container is empty always.
and i my vue versions are :"vue": "^2.5.2" and "vue-cytoscape": "^0.2.8", I have attached my .vue file. I have also added some screenshots showing the positioning of the canvas inside the cytoscape container.

The position of whole cytoscape container

whole-cytoscape-container

The canvas element being positioned from the center of the cytoscape container, going beyond the bounds of the cytoscape container.

canvas-position-inside-container

test_cytoscape_vue.txt

@rcarcasses
Copy link
Owner

Hi @balaram26, from what you describe it seems like you have a css issue that is causing this. This doesn't look like vue-cytoscape issue. Did you imported the library css: import 'vue-cytoscape/dist/vue-cytoscape.css'?

@balaram26
Copy link
Author

hi @rcarcasses ,yes i rechecked my main.js . Here is sample Vue project i created to test it again without importing any other css based module. Here is the zip file of the whole project.
https://1drv.ms/u/s!AonI71hfBXuMyIsdHQBcJVrwBu3SvQ

@balaram26
Copy link
Author

@rcarcasses I think this is caused by "cytoscape.js" itself. I tested it directly and still had the exact same issue when using with vue component. The only way to fix this was just add additional css to canvas(canvas { left:0; }) to reposition itself inside the container. Though this is not the solution, but it can fix this issue for now.

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