1.0.0 • Published 2 years ago

case-gg-editor v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

English | 简体中文

GGEditor

language GitHub license npm version npm downloads

A visual graph editor based on G6 and React.

Demo

Flow

Flow

Mind

Mind

Koni

Installation

npm

npm install --save gg-editor

umd

<script src="https://unpkg.com/gg-editor@${version}/dist/bundle.js"></script>

run demo

$ git clone https://github.com/gaoli/GGEditor.git
$ cd gg-editor
$ npm install
$ npm start

Usage

Flow

import GGEditor, { Flow } from 'gg-editor';

const data = {
  nodes: [{
    type: 'node',
    size: '70*70',
    shape: 'flow-circle',
    color: '#FA8C16',
    label: '起止节点',
    x: 55,
    y: 55,
    id: 'ea1184e8',
    index: 0,
  }, {
    type: 'node',
    size: '70*70',
    shape: 'flow-circle',
    color: '#FA8C16',
    label: '结束节点',
    x: 55,
    y: 255,
    id: '481fbb1a',
    index: 2,
  }],
  edges: [{
    source: 'ea1184e8',
    sourceAnchor: 2,
    target: '481fbb1a',
    targetAnchor: 0,
    id: '7989ac70',
    index: 1,
  }],
};

<GGEditor>
  <Flow style={{ width: 500, height: 500 }} data={data} />
</GGEditor>

Mind

import GGEditor, { Mind } from 'gg-editor';

const data = {
  roots: [{
    label: '中心主题',
    children: [{
      label: '分支主题 1',
    }, {
      label: '分支主题 2',
    }, {
      label: '分支主题 3',
    }],
  }],
};

<GGEditor>
  <Mind style={{ width: 500, height: 500 }} data={data} />
</GGEditor>

Documentation

DingTalk Group

acceptsacornacorn-jsxajv-errorsajvajv-keywordsansi-colorsansi-escapesansi-html-communityansi-regexant-design-palettesansi-stylesanymatchaprobaargparsearia-queryarr-diffarr-flattenarray-flattenarr-unionarray-includesarray-uniqarray-uniquearray.prototype.flatarray.prototype.flatmapasn1.jsassertassign-symbolsast-types-flowastral-regexasync-eachasyncasync-limiteratobautoprefixeraxe-coreaxobject-querybabel-eslintbabel-loaderbabel-plugin-dynamic-import-nodebabel-plugin-module-resolverbabel-plugin-polyfill-corejs2babel-plugin-polyfill-corejs3babel-plugin-polyfill-regeneratorbabel-plugin-transform-inline-environment-variablesbalanced-matchbasebase64-jsbatchbig.jsbinary-extensionsbindingsbluebirdbn.jsbonjourbody-parserbrace-expansionbracesbrorandbrowserify-aesbrowserify-cipherbrowserify-desbrowserify-rsabrowserify-signbrowserify-zlibbrowserslistbufferbuffer-indexofbuffer-frombuffer-xorbuiltin-status-codesbytescache-basecall-bindcaller-callsitecaller-pathcallsitescamelcasecaniuse-litechalkchardetchokidarchrome-trace-eventchownrcipher-baseclass-utilscli-cursorcli-widthclonecollection-visitcolorcolor-convertcolor-namecolor-stringcommandercomponent-emittercommondircompressiblecompressionconcat-mapconcat-streamconfusing-browser-globalsconnect-history-api-fallbackconsole-browserifyconstants-browserifycontent-dispositioncontent-typeconventional-commit-typesconvert-source-mapcookiecookie-signaturecopy-concurrentlycopy-anythingcore-jscopy-descriptorcore-js-compatcore-js-purecore-util-iscreate-ecdhcreate-hashcreate-hmaccross-envcross-spawncrypto-browserifycss-blank-pseudocss-has-pseudocss-loadercss-prefers-color-schemecssdbcssesccsstypecyclistcz-conventional-changelogd3d3-arrayd3-axisd3-brushd3-chordd3-collectiond3-colord3-dispatchd3-contourd3-dragd3-dsvd3-eased3-fetchd3-forced3-formatd3-geod3-hierarchyd3-interpolated3-pathd3-polygond3-quadtreed3-randomd3-sankeyd3-scaled3-selectiond3-scale-chromaticd3-shaped3-svg-legendd3-timed3-time-formatd3-timerd3-transitiond3-voronoid3-zoomdagre-compounddagredamerau-levenshteindebugdecamelizedeep-equaldecode-uri-componentdeep-isdefault-gatewaydefine-propertiesdefine-propertydeldepddes.jsdestroydetect-browserdetect-filedetect-nodediffie-hellmandns-equaldns-packetdns-txtdoctrinedom-to-imagedomain-browserduplexifyelectron-to-chromiumee-firstellipticemojis-listencodeurlend-of-streamenhanced-resolveerrnoerror-exes-abstractes-shim-unscopableses-to-primitiveescaladeescape-string-regexpescape-htmleslinteslint-config-airbnbeslint-config-airbnb-baseeslint-import-resolver-nodeeslint-module-utilseslint-plugin-importeslint-plugin-jsx-a11yeslint-plugin-reacteslint-visitor-keysespreeesprimaesqueryesrecurseesutilsestraverseetageventemitter3eventseventsourceevp_bytestokeyexecaexpand-bracketsexpand-tildeexpressexternal-editorextend-shallowextglobfast-deep-equalfast-json-stable-stringifyfast-levenshteinfaye-websocketfechafiggy-puddingfiguresfile-entry-cachefile-uri-to-pathfill-rangefinalhandlerfind-babel-configfind-cache-dirfind-upflat-cachefindup-syncflattedflattenflush-write-streamfollow-redirectsfor-inforwardedfragment-cachefreshfrom2fs-write-stream-atomicfs-readdir-recursivefs.realpathfunction-bindfunction.prototype.namefunctional-red-black-treefunctions-have-namesgensyncget-caller-fileget-intrinsicget-streamget-symbol-descriptionget-valuegg-editor-coregl-matrixgl-vec2globglob-parentglobal-modulesglobal-prefixglobalsgraceful-fshammerjsgraphlibhandle-thinghashas-bigintshas-flaghas-property-descriptorshas-symbolshas-tostringtaghas-valuehash-basehas-valueshash.jshmac-drbghomedir-polyfillhpack.jshttp-deceiverhttp-errorshttp-parser-jshttp-proxyhttp-proxy-middlewarehttps-browserifyiconv-liteicss-replace-symbolsicss-utilsieee754iferrimport-cwdimport-freshimport-fromimurmurhashimport-localindexes-ofinfer-ownerinflightinheritsiniinquirerinsert-cssinternal-ipinternal-slotinterpretinversifyinversify-inject-decoratorsipip-regexipaddr.jsis-absolute-urlis-accessor-descriptoris-any-arrayis-argumentsis-arrayishis-bigintis-binary-pathis-boolean-objectis-callableis-core-moduleis-data-descriptoris-date-objectis-descriptoris-directoryis-extendableis-extglobis-negative-zerois-globis-numberis-number-objectis-path-cwdis-path-in-cwdis-plain-objectis-regexis-shared-array-bufferis-streamis-stringis-symbolis-weakrefis-whatis-windowsisobjectisexejs-tokensjs-yamljsescjson-parse-better-errorsjson-schema-traversejson-stable-stringify-without-jsonifyjson5jsx-ast-utilskind-oflanguage-subtag-registrykillablelanguage-tagslessless-loaderlevnloader-runnerloader-utilslocate-pathlodashlodash.debouncelodash.maploglevellongestloose-envifymake-dirmap-cachemap-visitmd5.jsmedia-typermemory-fsmerge-descriptorsmethodsmicromatchmiller-rabinmimemime-dbmime-typesminimalistic-assertminimalistic-crypto-utilsminimatchminimistmixin-deepmkdirpml-array-maxml-array-minml-array-rescaleml-matrixmove-concurrentlymsmulticast-dnsmulticast-dns-service-typesmute-streamnannanomatchnative-requestnatural-comparenegotiatorneo-asyncnice-trynode-forgenode-libs-browsernode-releasesnormalize-pathnormalize-rangenpm-run-pathnum2fractionobject-assignobject-copyobject-inspectobject-isobject-keysobject-visitobject.assignobject.entriesobject.fromentriesobject.hasownobject.pickobject.valuesobufon-finishedon-headersonceopnoptionatoros-browserifyos-tmpdirp-finallyp-limitp-locatep-mapp-retryp-trypakoparallel-transformparent-moduleparse-asn1parse-passwdparseurlpascalcasepath-browserifypath-dirnamepath-existspath-is-absolutepath-is-insidepath-keypath-parsepbkdf2picocolorspicomatchpinkiepinkie-promisepkg-dirpkg-uppolyline-normalspolyline-miter-utilportfinderposix-character-classespostcsspostcss-attribute-case-insensitivepostcss-color-functional-notationpostcss-color-hex-alphapostcss-color-mod-functionpostcss-color-graypostcss-color-rebeccapurplepostcss-custom-mediapostcss-custom-propertiespostcss-custom-selectorspostcss-dir-pseudo-classpostcss-double-position-gradientspostcss-env-functionpostcss-focus-visiblepostcss-focus-withinpostcss-font-variantpostcss-gap-propertiespostcss-image-set-functionpostcss-initialpostcss-lab-functionpostcss-load-configpostcss-loaderpostcss-logicalpostcss-media-minmaxpostcss-modules-extract-importspostcss-modules-local-by-defaultpostcss-modules-scopepostcss-modules-valuespostcss-nestingpostcss-overflow-shorthandpostcss-page-breakpostcss-placepostcss-preset-envpostcss-pseudo-class-any-linkpostcss-replace-overflow-wrappostcss-selector-matchespostcss-selector-notpostcss-selector-parserpostcss-value-parserpostcss-values-parserprelude-lsprobe.glprocessprogressprocess-nextick-argsprop-typespromise-inflightproxy-addrprrpumppublic-encryptpumpifypunycodeqsquerystringquerystring-es3querystringifyrandombytesrange-parserrandomfillraw-bodyreactreact-isreadable-streamreaddirpreflect-metadataregenerateregenerator-runtimeregenerator-transformregex-notregexp.prototype.flagsregexpu-coreregjsgenregjsparserremove-trailing-separatorreglrepeat-elementrepeat-stringrequire-directoryrequire-main-filenamerequires-portreselectresolveresolve-cwdresolve-dirresolve-fromresolve-urlrestore-cursorretright-padrimrafripemd160run-asyncrun-queuerwrxjssafe-buffersafe-regexsafe-regex-testsafer-buffersemverselect-hoseselfsignedsendserialize-javascriptserve-indexserve-staticset-blockingset-valuesetimmediatesetprototypeofsha.jsshebang-commandshebang-regexside-channelsignal-exitsimple-swizzleslashslice-ansisnapdragonsnapdragon-nodesnapdragon-utilsockjssockjs-clientsource-list-mapsource-mapsource-map-resolvesource-map-supportsource-map-urlspdyspdy-transportsplit-stringsprintf-jsstatic-extendstatusesstream-browserifystream-eachstream-httpstream-shiftstring.prototype.matchallstring.prototype.trimendstring.prototype.trimstartstring_decoderstrip-ansistrip-bomstrip-eofstrip-json-commentsstyle-loadersupports-colorsupports-preserve-symlinks-flagtabletapableterser-webpack-plugintext-tablethroughthunkytimers-browserifytinycolor2tmpto-arraybufferto-fast-propertiesto-object-pathto-regexto-regex-rangetoidentifiertsconfig-pathstslibtty-browserifytype-checktype-istypedarrayunbox-primitiveunicode-canonical-property-names-ecmascriptunicode-match-property-value-ecmascriptunicode-match-property-ecmascriptunicode-property-aliases-ecmascriptunion-valueuniqunique-filenameunique-slugunpipeunset-valueupathuri-jsupdate-browserslist-dburixurlurl-parseuseutilutil-deprecateutils-mergeuuidv8-compile-cachevaryvm-browserifywatchpackwatchpack-chokidar2wbufwebpackwebpack-cliwebpack-dev-middlewarewebpack-logwebpack-dev-serverwebpack-sourceswebsocket-driverwebsocket-extensionswhichwhich-boxed-primitivewhich-modulewolfy87-eventemitterword-wrapworker-farmwrappywritextend
1.0.0

2 years ago