Skip to content

Commit

Permalink
feat: add the options to display chains etc...
Browse files Browse the repository at this point in the history
  • Loading branch information
owulveryck committed Jun 13, 2023
1 parent f1943ad commit 725796d
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions examples/wtg2svglive/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ import (
)

type configuration struct {
Width int `default:"1500"`
Height int `default:"900"`
Port string `default:"8080"`
Width int `default:"1500"`
Height int `default:"900"`
Port string `default:"8080"`
WithSpace bool `default:"true"`
WithControls bool `default:"true"`
WithValueChain bool `default:"true"`
WithIndicators bool `default:"false"`
}

var config configuration
Expand Down Expand Up @@ -182,8 +186,15 @@ func generateSVG(filePath string) ([]byte, error) {
return nil, err
}
defer e.Close()
style := svgmap.NewOctoStyle(p.EvolutionStages)
indicators := []svgmap.Annotator{}
if config.WithIndicators {
indicators = svgmap.AllEvolutionIndications()
}
style := svgmap.NewOctoStyle(p.EvolutionStages, indicators...)
style.WithControls = true
style.WithSpace = config.WithSpace
style.WithControls = config.WithControls
style.WithValueChain = config.WithValueChain
e.Init(style)
err = e.Encode(p.WMap)
if err != nil {
Expand Down

0 comments on commit 725796d

Please sign in to comment.