aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tensorboard/components/tf-dashboard-common/urlGenerator.ts
blob: c7bbcbf434029577d2b74a9b2932d628032aab26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/// <reference path="../../typings/tsd.d.ts" />
/// <reference path="../../bower_components/plottable/plottable.d.ts" />

module TF {
  export module Urls {

    export var routes = ["runs", "scalars", "histograms",
                         "compressedHistograms", "images",
                         "individualImage", "graph"];

    function router(route: string): ((tag: string, run: string) => string) {
      return function(tag: string, run: string): string {
        return "/" + route + "?tag=" + encodeURIComponent(tag)
                           + "&run=" + encodeURIComponent(run);
      };
    }

    export function runsUrl() {
      return "/runs";
    }
    export var scalarsUrl = router("scalars");
    export var histogramsUrl = router("histograms");
    export var compressedHistogramsUrl = router("compressedHistograms");
    export var imagesUrl = router("images");
    export function individualImageUrl(query: string) {
      return "/individualImage?" + query;
    }
    export function graphUrl(run: string) {
      return "/graph?run=" + encodeURIComponent(run);
    }

  }
}