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

AJAX request should be before cy.js init #1

Open
maxkfranz opened this issue Jan 7, 2014 · 1 comment
Open

AJAX request should be before cy.js init #1

maxkfranz opened this issue Jan 7, 2014 · 1 comment

Comments

@maxkfranz
Copy link

The example you have for pulling the style via AJAX may work in most cases, but to guarantee display of the correct style, the AJAX request should complete prior to initialising cy.js. For example, you may have a flash of unstyled content (http://en.wikipedia.org/wiki/Flash_of_unstyled_content), because your stylesheet can't override the default one until it's loaded.

Great library! We'll try to add native support for parsing string stylesheets, though we'll probably leave the AJAX request call itself to the dev's discretion for better control.

I've created a ticket for native support: cytoscape/cytoscape.js#396

@aschriner
Copy link
Owner

Excellent point about timing of the stylesheet loading.

Glad to hear you're open to native stylesheets. I think it eases the cognitive load on the dev to just "style with css" rather than "style with JSON/CSS hybrid", and to allow that style definition to be a standalone css file. This library was just a hack to make things easier on my brain :)

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