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

Error when trying to layout a graph with some nodes having no edges #5

Open
bjonnh opened this issue Jan 14, 2016 · 4 comments
Open

Comments

@bjonnh
Copy link

bjonnh commented Jan 14, 2016

If a node has no edges, a dummy node seems to be created, I then get:
Do not assign mappings to elements without corresponding data (e.g. ele DummyCompound_undefined for property background-color with data field faveColor); try a [faveColor] selector to limit scope to elements with faveColor defined

where my css selector for node is defined like:

.css({
                'width': 'label',
                'content': 'data(name)',
                'text-valign': 'center',
                'text-outline-width': 2,
                'text-outline-color': '#fff',
                'background-color': 'data(faveColor)',
                'color': '#000',
                'visiblity': 'visible'
            })
@bjonnh
Copy link
Author

bjonnh commented Jan 14, 2016

It works with all the layouts integrated with cytoscape.js and it work with graphs that contains at least an edge for each node.

@ugurdogrusoz
Copy link
Contributor

This probably has to do with tiling of disconnected nodes (i.e. nodes with no incident edges). We do create dummy nodes as a container of disconnected nodes for tiling. These dummy nodes are destroyed before layout ends. We will look into this. In the meantime, feel free to disable tiling (tile: false).

@bjonnh
Copy link
Author

bjonnh commented Jan 15, 2016

I just made virtual nodes that I hide, it also help with the layout, seems nicer with it anyway. Thanks for the quick answer.

@metincansiper
Copy link
Contributor

We will look into this. However, for the time being if you do not want to disable 'tilling' option, you can use another selector for 'background-color' attribute. For example, if your current selector is 'node' you can use 'node[faveColor]' selector for 'background-color' attribute.

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

3 participants