(nts []*Tag, maxNumNodelets int, flatTags bool, source string)
| 263 | } |
| 264 | |
| 265 | func (b *builder) numericNodelets(nts []*Tag, maxNumNodelets int, flatTags bool, source string) string { |
| 266 | nodelets := "" |
| 267 | |
| 268 | // Collapse numeric labels into maxNumNodelets buckets, of the form: |
| 269 | // 1MB..2MB, 3MB..5MB, ... |
| 270 | for j, t := range b.collapsedTags(nts, maxNumNodelets, flatTags) { |
| 271 | w, attr := t.CumValue(), ` style="dotted"` |
| 272 | if flatTags || t.FlatValue() == t.CumValue() { |
| 273 | w, attr = t.FlatValue(), "" |
| 274 | } |
| 275 | if w != 0 { |
| 276 | weight := b.config.FormatValue(w) |
| 277 | nodelets += fmt.Sprintf(`N%s_%d [label = "%s" id="N%s_%d" fontsize=8 shape=box3d tooltip="%s"]`+"\n", source, j, t.Name, source, j, weight) |
| 278 | nodelets += fmt.Sprintf(`%s -> N%s_%d [label=" %s" weight=100 tooltip="%s" labeltooltip="%s"%s]`+"\n", source, source, j, weight, weight, weight, attr) |
| 279 | } |
| 280 | } |
| 281 | return nodelets |
| 282 | } |
| 283 | |
| 284 | // addEdge generates a graph edge in DOT format. |
| 285 | func (b *builder) addEdge(edge *Edge, from, to int, hasNodelets bool) { |
no test coverage detected