aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tensorboard/components/tf_imports/BUILD
blob: 8b91502ae2a93f962f8b5bb51ba183610195b055 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
package(default_visibility = ["//tensorflow:internal"])

load("@io_bazel_rules_closure//closure:defs.bzl", "webfiles")

licenses(["notice"])  # Apache 2.0

webfiles(
    name = "d3",
    srcs = [
        "d3.html",
        "@org_d3js",
    ],
    path = "/tf-imports",
)

webfiles(
    name = "lodash",
    srcs = ["lodash.html"],
    path = "/tf-imports",
    deps = ["@com_lodash"],
)

webfiles(
    name = "graphlib",
    srcs = [
        "graphlib.html",
        "@io_github_cpettitt_graphlib",
    ],
    path = "/tf-imports",
    deps = [":lodash"],
)

webfiles(
    name = "dagre",
    srcs = [
        "dagre.html",
        "@io_github_cpettitt_dagre",
    ],
    path = "/tf-imports",
    deps = [
        ":graphlib",
        ":lodash",
    ],
)

webfiles(
    name = "plottable",
    srcs = [
        "plottable.html",
        "@com_palantir_plottable//:plottable.css",
        "@com_palantir_plottable//:plottable.js",
    ],
    path = "/tf-imports",
    deps = [":d3"],
)

# Generate single TypeScript typings file for d3.js with no ES6 imports.
#
# The DefinitelyTyped definition of d3 v4 was written under the assumption that
# we want to use d3 in a modularized way. We don't want to do that because its
# import statements use NodeJS namespaces, and the Web Compiler only supports
# W3C, ECMA, and IETF standards.
genrule(
    name = "d3v4_typings",
    srcs = [
        # please maintain a reverse topological order
        "@org_definitelytyped_types_d3_path//:index.d.ts",
        "@org_definitelytyped_types_d3_time//:index.d.ts",
        "@org_definitelytyped_types_d3_dsv//:index.d.ts",
        "@org_definitelytyped_types_d3_color//:index.d.ts",
        "@org_definitelytyped_types_d3_selection//:index.d.ts",
        # d3-transition defines stuff in d3-selection wat?
        # "@org_definitelytyped_types_d3_transition//:index.d.ts",
        "@org_definitelytyped_types_d3_shape//:index.d.ts",
        "@org_definitelytyped_types_d3_scale//:index.d.ts",
        "@org_definitelytyped_types_d3_request//:index.d.ts",
        "@org_definitelytyped_types_d3_interpolate//:index.d.ts",
        "@org_definitelytyped_types_d3_drag//:index.d.ts",
        "@org_definitelytyped_types_d3_brush//:index.d.ts",
        "@org_definitelytyped_types_d3_axis//:index.d.ts",
        "@org_definitelytyped_types_d3_zoom//:index.d.ts",
        "@org_definitelytyped_types_d3_array//:index.d.ts",
        "@org_definitelytyped_types_d3_chord//:index.d.ts",
        "@org_definitelytyped_types_d3_collection//:index.d.ts",
        "@org_definitelytyped_types_d3_dispatch//:index.d.ts",
        "@org_definitelytyped_types_d3_ease//:index.d.ts",
        "@org_definitelytyped_types_d3_force//:index.d.ts",
        "@org_definitelytyped_types_d3_format//:index.d.ts",
        "@org_definitelytyped_types_d3_hierarchy//:index.d.ts",
        "@org_definitelytyped_types_d3_polygon//:index.d.ts",
        "@org_definitelytyped_types_d3_quadtree//:index.d.ts",
        "@org_definitelytyped_types_d3_queue//:index.d.ts",
        "@org_definitelytyped_types_d3_random//:index.d.ts",
        "@org_definitelytyped_types_d3_timer//:index.d.ts",
        "@org_definitelytyped_types_d3_voronoi//:index.d.ts",
    ],
    outs = ["d3v4.d.ts"],
    cmd = "\n".join([
        "(",
        "  echo 'declare namespace d3 {'",
        "  for f in $(SRCS); do",
        "    echo",
        "    echo /////////////////////////////////////////////",
        "    echo // $$f",
        "    echo /////////////////////////////////////////////",
        "    echo",
        "    sed '/^import /d' $$f",
        "  done",
        "  echo '}'",
        ") >$@",
    ]),
)

filegroup(
    name = "all_files",
    srcs = glob(["**"]),
    tags = ["notsan"],
)