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

how can i set the node's name? #11

Open
jackyrong opened this issue Jul 18, 2017 · 4 comments
Open

how can i set the node's name? #11

jackyrong opened this issue Jul 18, 2017 · 4 comments

Comments

@jackyrong
Copy link

hi,how can i set the node's name?,now it is still use icon or title?thank you

@laaron2008
Copy link

you can add '.text(function (d)){return d.name}' in the function appendTextToNode and delete both '.attr('class'...)' and '.html(...)'in the neo4jd3.js

@mboussaa
Copy link

It does not work when I changed as you suggested @laaron2008

    function appendTextToNode(node) {
        return node.append('text')              
				   .text(function (d){return d.name})
                   .attr('fill', '#ffffff')
                   .attr('font-size', function(d) {
                       return icon(d) ? (options.nodeRadius + 'px') : '10px';
                   })
                   .attr('pointer-events', 'none')
                   .attr('text-anchor', 'middle')
                   .attr('y', function(d) {
                       return icon(d) ? (parseInt(Math.round(options.nodeRadius * 0.32)) + 'px') : '4px';
                   });
    }

Do you have any idea why? @jackyrong @laaron2008
Thank youuuuu

@therealhieu
Copy link

It does not work when I changed as you suggested @laaron2008

    function appendTextToNode(node) {
        return node.append('text')              
				   .text(function (d){return d.name})
                   .attr('fill', '#ffffff')
                   .attr('font-size', function(d) {
                       return icon(d) ? (options.nodeRadius + 'px') : '10px';
                   })
                   .attr('pointer-events', 'none')
                   .attr('text-anchor', 'middle')
                   .attr('y', function(d) {
                       return icon(d) ? (parseInt(Math.round(options.nodeRadius * 0.32)) + 'px') : '4px';
                   });
    }

Do you have any idea why? @jackyrong @laaron2008
Thank youuuuu

Hi, you need to run function appendTextToNode() in appendNodeToGraph(), default setting is only running this function when options.icon argument is not null.

image

@tejash-7span
Copy link

tejash-7span commented Oct 27, 2022

Hello @eisman,
How to achieve appendTextToNode functionality?

Please do needful help to achieve this functionality.

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

5 participants