Code Monkey home page Code Monkey logo

Comments (7)

anvaka avatar anvaka commented on September 2, 2024

Agreed. Will add an API for this.

from vivagraphjs.

ibnesayeed avatar ibnesayeed commented on September 2, 2024

Not directly related to this thread but I will ask it anyway. Is there a way to pass a config object at the time of node/link creation to customize individual node/link appearance like color, position, size and whatnot?

Thanks

from vivagraphjs.

anvaka avatar anvaka commented on September 2, 2024

Yep. Check this: "Basic graph operations" - you can pass any object (not necessary a string or a number) as a last argument for addNode()/addLink() methods.

from vivagraphjs.

ibnesayeed avatar ibnesayeed commented on September 2, 2024

Thanks for your response. My question was a bit different though. I am aware of the data attributes that associates an arbitrary object/data to each node and link. But if there are some graph configuration properties passed in that object, they wont be applied automatically. User has to apply config properties in a callback (correct me if I am wrong). Following example may explain my point.

addNode(id, data, config)

Now, if 'config' object is something like:

config = {
  color: '#f00',
  position: {x: 10, y:50}
}

Then it should be applied at the time of node initialization. Eventually we can document possible config properties for nodes and links. If my question seems valid and if this feature is not available yet in the library then we can move this discussion in a separate feature request.

from vivagraphjs.

arikan avatar arikan commented on September 2, 2024

i agree with @ibnesayeed to have arrow heads in the API, since directional vs bidirectional link is a common use.

from vivagraphjs.

gg4u avatar gg4u commented on September 2, 2024

@ibnesayeed you could pass arrow head at construction of placelink() function - if using SVG, you could use a tag instead of line and use markers to place arrows.

from vivagraphjs.

ibnesayeed avatar ibnesayeed commented on September 2, 2024

Thanks @gg4u. The feature request is still worth, though I am done with the project I was using it for.

from vivagraphjs.

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.