Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes of API call d2lib.Compile() breaks sample code #1565

Open
archeopternix opened this issue Aug 25, 2023 · 0 comments
Open

Changes of API call d2lib.Compile() breaks sample code #1565

archeopternix opened this issue Aug 25, 2023 · 0 comments

Comments

@archeopternix
Copy link

archeopternix commented Aug 25, 2023

The API for d2lib.Compile() changed and breaks the example - so it does not work anymore
Generate diagrams programmatically

New:
func Compile(ctx context.Context, input string, compileOpts *CompileOptions, renderOpts *d2svg.RenderOpts) (*d2target.Diagram, *d2graph.Graph, error)

Old:
func Compile(ctx context.Context, input string, compileOpts *CompileOptions) (*d2target.Diagram, *d2graph.Graph, error)
in addition the function:
d2dagrelayout.DefaultLayout(ctx context.Context, g *d2graph.Graph) (err error)
does not match anymore the

d2lib.CompileOptions{
	Layout:  *string,
}

from sample code:

d2lib.CompileOptions{
		Layout:  d2dagrelayout.DefaultLayout,
}

so there seems to be no chance getting the example to compile

@cyborg-ts cyborg-ts added this to D2 Aug 25, 2023
@archeopternix archeopternix changed the title Cahanges of API call d2lib.Compile() Changes of API call d2lib.Compile() Aug 25, 2023
@archeopternix archeopternix changed the title Changes of API call d2lib.Compile() Changes of API call d2lib.Compile() breaks sample code Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant