MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / createGraphMap

Method createGraphMap

src/maplibregl/overlay/GraphMap.js:60–74  ·  view source on GitHub ↗

* @private * @function GraphMap.prototype.createGraphMap * @description 创建图谱。 * @param {string} graphMapName - 图谱名称。 * @param {Object} options - 配置项。 * @param {string} [options.proxy] - 服务代理地址。 * @param {boolean} [options.withCredentials] - 请求是否携带凭据。默认情况下,仅同源请求包含凭据。 * @param {bo

(graphMapName, options)

Source from the content-addressed store, hash-verified

58 * @param {KnowledgeGraph.Config} [options.config] - knowledgegraph 配置项。
59 */
60 async createGraphMap(graphMapName, options) {
61 this.knowledgeGraphService = this.createKnowledgeGraphService(this.url, options);
62 const res = await this.knowledgeGraphService.getGraphMapData(graphMapName);
63 const result = KnowledgeGraph.dataFromGraphMap(res.data, res.graphMap);
64 this.graph = new KnowledgeGraph(options && options.config);
65 this.graph.on('afterlayout', () => {
66 /**
67 * @event GraphMap#loaded
68 * @description 渲染完成时触发。
69 */
70 this.fire(this.EVENT_TYPES[0]);
71 });
72 this.graph.setData(result);
73 this.graph.handleNodeStatus(transformExpandCollapseHiddenData(res.graphMap));
74 }
75
76 /**
77 * @private

Callers 1

constructorMethod · 0.95

Calls 8

dataFromGraphMapMethod · 0.80
handleNodeStatusMethod · 0.80
getGraphMapDataMethod · 0.45
onMethod · 0.45
fireMethod · 0.45
setDataMethod · 0.45

Tested by

no test coverage detected