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

Changing the search to include all words in a node #37

Closed
cpbridges opened this issue Dec 19, 2013 · 5 comments
Closed

Changing the search to include all words in a node #37

cpbridges opened this issue Dec 19, 2013 · 5 comments

Comments

@cpbridges
Copy link

Hey! I'm looking to edit the search function in main.js to search not just for names, but any keywords contained in the node definitions returned. How would one do that?

Great script btw! Chris

@computermacgyver
Copy link
Member

Glad you're finding the code useful. It is just one additional attribute or multiple attributes you want to search for each node. One option is just to concatenate the value for whatever additional attribute you want to search to the label at line 385 of main.js. If it's multiple attributes to search they could all be concatenated together or (probably more efficiently) the search could loop over them and check them individually.

@cpbridges
Copy link
Author

Thanks for the fast response. Ah I see, it's multiple attributes. So could I include:

g.test(a.label.toLowerCase()) && c.push({
id: a.id,
name: a.label
interests: a.interests
country: a.country

I'd have to change 'g.test(a.label.toLowerCase())' I'm guessing? To include more g.tests?

Chris

@computermacgyver
Copy link
Member

Yes, that's basically it. I've made the changes online to main.js.

Could you download the new main.js file and replace the file in your export?

Then open your config.json file in a text editor (e.g., notepad) find the line that reads

    "informationPanel": {

and replace it with

    "search":{
        "fulltext":true
    },
    "informationPanel": {

Save your config.json and try it out. It should search all the node attributes for any match.

@cpbridges
Copy link
Author

Thanks! That's excellent and exactly what I was looking for. Another quick one: how can I enter the plot in maximum view? I must click on the minus at the bottom to get the full view. Where is this default set? Kind regards, Chris

@computermacgyver
Copy link
Member

Hi Chris, Sorry for the long delay. The full network should be available by default, but I have seen this issue on occasion. I think it has to do with an underlying sigma.js bug that I never fully tracked down. There is a new version of sigma.js out now that I will incorporate into the plugin in due course. That should hopefully address the issue, but I don't have any immediate fix to hand I'm afraid.

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

No branches or pull requests

2 participants