Coder Social home page Coder Social logo

how can i set the node's name? about neo4jd3 HOT 4 OPEN

eisman avatar eisman commented on June 3, 2024
how can i set the node's name?

from neo4jd3.

Comments (4)

laaron2008 avatar laaron2008 commented on June 3, 2024

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

from neo4jd3.

mboussaa avatar mboussaa commented on June 3, 2024

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

from neo4jd3.

therealhieu avatar therealhieu commented on June 3, 2024

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

from neo4jd3.

tejash-7span avatar tejash-7span commented on June 3, 2024

Hello @eisman,
How to achieve appendTextToNode functionality?

Please do needful help to achieve this functionality.

from neo4jd3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.