add comments about autolayout url
This commit is contained in:
Родитель
cc9d860ef1
Коммит
094bbc9dce
|
@ -6,7 +6,7 @@ import { EdgeCollection } from '~/arquero'
|
|||
import { AUTOLAYOUT_URL } from '~/constants'
|
||||
|
||||
/**
|
||||
* Transforms and edge list to the POST payload JSON.
|
||||
* Transforms an edge list to the POST payload JSON.
|
||||
* @param edges
|
||||
*/
|
||||
function edgesToPOST(edges: EdgeCollection) {
|
||||
|
@ -26,6 +26,15 @@ function createPOSTBody(edges: EdgeCollection) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function invokes a service that uses graspologic autolayout.
|
||||
* It can be configured by assigning the AUTOLAYOUT_URL environment variable
|
||||
* at deployment time. If the variable is missing, the UMAP button will not be
|
||||
* visible in the interface.
|
||||
* See https://graspologic.readthedocs.io/en/latest/reference/layouts.html#automatic-graph-layout
|
||||
* @param edges
|
||||
* @returns
|
||||
*/
|
||||
export async function umapLayout(edges: EdgeCollection) {
|
||||
const body = createPOSTBody(edges)
|
||||
return fetch(AUTOLAYOUT_URL, {
|
||||
|
|
|
@ -4,4 +4,7 @@
|
|||
*/
|
||||
export const ROOT_COMMUNITY_ID = '-1'
|
||||
|
||||
/**
|
||||
* This constant can be configured to point to a web service for graspologic autolayout.
|
||||
*/
|
||||
export const AUTOLAYOUT_URL = process.env.AUTOLAYOUT_URL as string
|
||||
|
|
Загрузка…
Ссылка в новой задаче