A-A+

GGEditor

2020年01月06日 JavaScript 暂无评论 阅读 1,122 次

GGEditor思维导图

import React, { Component } from 'react';
import { duplicate } from '@/utils/utils';
import G2 from '@antv/g2';
import DataSet from '@antv/data-set';
import { Icon } from 'antd';
import GGEditor, { Mind } from 'gg-editor';
import { getSchema } from '../service';
import styles from './style.less';

export interface KnowledgeSchemaState {
  imgData:[{
    links:[],
    nodes:[{
      opacity:number
    }]
  }]
}
const data = {
  roots: [{
    label: '中心主题',
    children: [{
      label: '分支主题 1',
    }, {
      label: '分支主题 2',
    }, {
      label: '分支主题 3',
    }],
  }],
};
const imgIdCurrent = ''
class AIDetailComponent extends Component<KnowledgeSchemaState> {
  static defaultProps = {
  };

  state = {
    imgData: {
      links: [{
        target: '',
        source: '',
      }],
      nodes: [{
        opacity: 1,
      }],
    },
    num_semanticTypes: 0, // 语义类型
    num_entities: 0, // 语义类型
    num_relationships: 0, // 语义类型
  }


  async componentDidMount() {
  }

  componentWillUnmount() {
  }

  render() {
    const { num_semanticTypes, num_entities, num_relationships } = this.state
    return (
      <div className={styles.schema}>
        <p className={styles.title}>唯医骨科知识图谱语义类型和关系</p>
        <div className={styles.tag}>
          <Icon type="exclamation-circle" />
          <p>当前图谱中共有 <span>{num_semanticTypes}</span> 个语义类型(包含 <span>{num_entities}</span> 个实体),<span>{num_relationships}</span> 类关系</p>
        </div>
      <GGEditor>
        <Mind style={{ width: 500, height: 500 }} data={data} />
      </GGEditor>
      </div>
    );
  }
}
export default AIDetailComponent;

GGEditor官网
jsmind

标签:

给我留言

Copyright © web前端技术开发个人博客 保留所有权利  京ICP备14060653号 Theme  Ality

用户登录