(in []gvEdgeInput)
| 397 | } |
| 398 | |
| 399 | func normalizeEdgeInputs(in []gvEdgeInput) []GraphEdge { |
| 400 | out := make([]GraphEdge, 0, len(in)) |
| 401 | for _, e := range in { |
| 402 | s := firstNonEmpty(e.Source, e.From) |
| 403 | t := firstNonEmpty(e.Target, e.To) |
| 404 | if s == "" || t == "" { |
| 405 | continue |
| 406 | } |
| 407 | out = append(out, GraphEdge{Source: s, Target: t, Weight: e.Weight}) |
| 408 | } |
| 409 | return out |
| 410 | } |
| 411 | |
| 412 | func finalizeGraphViewArgs(out graphViewArgs) (graphViewArgs, error) { |
| 413 | out.Source = strings.ToLower(strings.TrimSpace(out.Source)) |
no test coverage detected