Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Fix bug outline frames not working
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasepe committed Jun 22, 2020
1 parent 7565386 commit 5492b5b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.6.1] - 2020-06-22
### Fixed
- 🐛 outline frames not working

## [0.6.0] - 2020-06-20
### Added
- 🎉 new feature use specific icons for each provider (see [README](./README.md) for the _How To_)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Draft

[![Go Report Card](https://goreportcard.com/badge/github.com/lucasepe/draft)](https://goreportcard.com/report/github.com/lucasepe/draft)     [![Coverage](https://gocover.io/_badge/github.com/lucasepe/draft?nocache=draft)](https://gocover.io/_badge/github.com/lucasepe/draft?nocache=draft)     [![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Flucasepe%2Fdraft)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Flucasepe%2Fdraft)
[![Go Report Card](https://goreportcard.com/badge/github.com/lucasepe/draft)](https://goreportcard.com/report/github.com/lucasepe/draft)     [![Go Coverage](https://gocover.io/_badge/github.com/lucasepe/draft?nocache=draft)](https://gocover.io/_badge/github.com/lucasepe/draft?nocache=draft)     [![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Flucasepe%2Fdraft)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Flucasepe%2Fdraft)

A commandline tool that generate **H**igh **L**evel microservice & serverless **A**rchitecture diagrams using a declarative syntax defined in a YAML file.

Expand Down
14 changes: 12 additions & 2 deletions draft.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strings"

"github.com/emicklei/dot"
"github.com/lucasepe/draft/pkg/cluster"
"github.com/lucasepe/draft/pkg/edge"
"github.com/lucasepe/draft/pkg/graph"
)
Expand Down Expand Up @@ -141,9 +142,18 @@ func sketchComponents(gfx *dot.Graph, cfg Config, items []Component) error {
fmt.Fprintf(os.Stderr, " • component: %s\n", string(bin))
}

if ok := figIcon(cfg, it)(gfx); !ok {
parent := gfx
if strings.TrimSpace(it.Outline) != "" {
parent = cluster.New(gfx, it.Outline,
cluster.PenColor("#d9cc31"),
cluster.FontName("Fira Mono"),
cluster.FontSize(10),
cluster.FontColor("#63625b"))
}

if ok := figIcon(cfg, it)(parent); !ok {
if fig, found := figRegistry[it.Kind]; found {
fig(cfg, it)(gfx)
fig(cfg, it)(parent)
} else {
return fmt.Errorf("sketcher not found for component of kind <%s>", it.Kind)
}
Expand Down

0 comments on commit 5492b5b

Please sign in to comment.