(out graphViewArgs)
| 410 | } |
| 411 | |
| 412 | func finalizeGraphViewArgs(out graphViewArgs) (graphViewArgs, error) { |
| 413 | out.Source = strings.ToLower(strings.TrimSpace(out.Source)) |
| 414 | switch out.Source { |
| 415 | case "", "json": |
| 416 | out.Source = "json" |
| 417 | case "knowledge", "conversation": |
| 418 | default: |
| 419 | return out, fmt.Errorf("unknown source %q (use json, knowledge or conversation)", out.Source) |
| 420 | } |
| 421 | if out.Theme != "light" { |
| 422 | out.Theme = "dark" |
| 423 | } |
| 424 | return out, nil |
| 425 | } |
| 426 | |
| 427 | // resolveGraphData produces the renderable data for the chosen source. |
| 428 | func resolveGraphData(cfg graphViewArgs) (GraphData, error) { |
no test coverage detected