How to create a label progromaticaly? #836
Replies: 3 comments 3 replies
-
hey @ainsleyclark , I'll make a note to document this better, but the best place to look right now is our tests, which we have a large number of. For example, edge labels are found here: Line 1010 in d369371 And you can scroll down to how this is tested: Line 1164 in d369371 So the correct usage is:
|
Beta Was this translation helpful? Give feedback.
-
Hey @alixander Thanks for your swift response. I think I maybe missing something: _, graph, _ := d2lib.Compile(context.Background(), "", nil)
_, _, err := d2oracle.Create(graph, "test1 -> test2")
if err != nil {
log.Fatal(err)
}
t2 := "hey"
_, err = d2oracle.Set(graph, "(test1 -> test2)[0]", &t2, nil)
// Also tried _, err = d2oracle.Set(graph, "(test1 -> test2)[0]", nil, &t2)
if err != nil {
log.Fatal(err)
} Prints:
Just out of interest, are there any docs on using the library in Thanks again. |
Beta Was this translation helpful? Give feedback.
-
Ah perfect thanks for answering that, it's working perfectly now. Some docs on the I'm constructing a fairly big infrastructure diagram of events produced/consumed within AWS. Which kind of leads me to my next question (appreciate your patience), is there a way to make all connecting lines straight? Otherwise, I may get in a tangled mess when I run this over around 100 microservices; any advice for this sort of large scale diagram would be great. Thanks once again. |
Beta Was this translation helpful? Give feedback.
-
Hi there,
I'm just wondering how we can create a label programmatically using the library?
The below doesn't work, I think I'm missing something.
Beta Was this translation helpful? Give feedback.
All reactions