# topic-dependence-visualization-main **Repository Path**: WuliDragon/topic-dependence-visualization-main ## Basic Information - **Project Name**: topic-dependence-visualization-main - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 3 - **Created**: 2021-04-12 - **Last Updated**: 2021-06-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Topic-dependence-visualization ## drawMap模块 ### Input - `mapData` 后端返回的认知关系数据,格式如`gaozhongshuxue.ts` - `svg` 显示认知关系的svg元素,需要设置宽高 - `treeSvg` 显示分面树的svg元素,不要设置宽高,但需要使其浮于认知关系图之上 - `learningPath: number[]` 知识主题id列表,用来显示推荐认知路径 - `clickTopic(topicId: number, topicName: string)` 点击知识主题的响应函数 - `clickFacet(facetId: number)` 点击分面的响应函数 - `deleteTopic` 删除主题的回调函数 - `assembleTopic` 装配主题的回调函数 - `selectTopic` 添加依赖关系选定主题的回调函数 - `insertTopic` 新添加主题的回调函数 - `clickPath` 点击认知关系的回调函数 - `MenuDisplay: string` 调用drawMap的页面名称,包括'knowledge-forest', 'facet-tree', 'relation', 'assemble',不需要菜单的浏览页面写 'none' 就行 - `onClickBranch` 删除分面的回调函数 - `clickBranchAdd` 添加分面的回调函数 ### Output - Circular layout between data ![avatar](photos/visualization.png) ## drawCommunity模块(仅绘制知识簇) ### Input - `data` - `svg` - `clickCom(d)` ### Output - Circular layout between clusters # drawTopic模块(仅绘制知识簇内) ### Input - `id` - `data` - `svg` - `clickTopic(topicId: number, topicName: string)` ### Output - Circular layout between topics in clusters ## Build `npm run build` 打包结果在 `/module/topicDependenceVisualization.js` ## Usage 1. download 'topicDependenceVisualization.js' from 'release' tab 2. import 'drawMap'/'drawCommunity'/'drawTopic'(refer to 'index.ts') `drawMap(data, svg, treesvg, domainName, learningPath, clickTopic, clickFacet)`