Giter VIP home page Giter VIP logo

Comments (4)

mariusz-schimke avatar mariusz-schimke commented on June 1, 2024 1

If you are more familiar with Graphviz attribute names, you can also see the mapping file in this repository. You can look for an attribute name to learn by which programmatic property it is exposed on specific graph elements. In your case this would be:

"fontcolor": [ "Font.Color: DotColor [Graph, Cluster, Node, Edge]" ]

from gigraph.

kakyoism avatar kakyoism commented on June 1, 2024 1

Thanks a lot. How did I miss that? lol

from gigraph.

kakyoism avatar kakyoism commented on June 1, 2024

Figured it out myself:

node.Attributes.Collection.Set("fontcolor", myColor);

from gigraph.

mariusz-schimke avatar mariusz-schimke commented on June 1, 2024

Glad you wrote! :) Your final solution is correct, but this way you omit the abstraction the library gives you, and provide Graphviz attribute names directly. You can simply do it this way:

node.Font.Color = Color.Red

As long as you only want to adjust the color of the whole label, this is fine. You can generally do the following with the label:

  • set font color, font size and font name (for the complete text, not its parts),
  • left- or right-justify individual lines of text, or center them.

See here.

When you want to have more granular control on pieces of text, you can use HTML (see here).

from gigraph.

Related Issues (5)

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.