MCPcopy Create free account
hub / github.com/tensorflow/tensorboard / createRouter

Function createRouter

tensorboard/components/tf_backend/router.ts:49–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47 * can pass this to `setRouter` to make it the global router.
48 */
49export function createRouter(): Router {
50 return {
51 environment: () => createDataPath('/environment'),
52 experiments: () => createDataPath('/experiments'),
53 pluginRoute: (
54 pluginName: string,
55 route: string,
56 params?: URLSearchParams
57 ): string => {
58 return createDataPath(`/plugin/${pluginName}${route}`, params);
59 },
60 pluginRouteForSrc: (
61 pluginName: string,
62 route: string,
63 params: URLSearchParams = new URLSearchParams()
64 ): string => {
65 const featureFlags = getFeatureFlagsToSendToServer();
66 if (Object.keys(featureFlags).length > 0) {
67 params.append(
68 FEATURE_FLAGS_QUERY_STRING_NAME,
69 JSON.stringify(featureFlags)
70 );
71 }
72 return createDataPath(`/plugin/${pluginName}${route}`, params);
73 },
74 pluginsListing: () =>
75 createDataPath(
76 '/plugins_listing',
77 createSearchParam({
78 [EXPERIMENTAL_PLUGINS_QUERY_PARAM]: initialURLSearchParams.getAll(
79 EXPERIMENTAL_PLUGINS_QUERY_PARAM
80 ),
81 })
82 ),
83 runs: () => createDataPath('/runs'),
84 };
85}
86
87/**
88 * @return {Router} the global router

Callers 1

router.tsFile · 0.85

Calls 4

createDataPathFunction · 0.85
createSearchParamFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…