Skip to content

attribute types #802

Answered by kamiazya
seethroughdev asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

Thank you for using my library and noticing the flaws!

PR is welcome!

To add types and documentation for attributes, edit the file.

https://github.com/ts-graphviz/ts-graphviz/blob/master/src/attribute.ts

Also not sure what the preferred method for setting attributes on an object is. For now I'm doing: g.attributes.node.set("shape", "square"). But of course it would be nice to set an Options object for multiple values at once.

Also, as a method to specify attributes at once, an apply method is prepared.

https://ts-graphviz.github.io/ts-graphviz/classes/attributes.html#apply

You call like this.

g.attributes.node.apply({
  shape: 'square',
});

Thanks!

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by kamiazya
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
good first issue Good for newcomers question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #122 on January 28, 2023 04:05.