mirror of
https://gitee.com/antv/g6.git
synced 2024-11-29 18:28:19 +08:00
feat: g6 unified external exposure entrance
This commit is contained in:
parent
37b5e765ca
commit
64887f406b
26
packages/g6/.babelrc.js
Normal file
26
packages/g6/.babelrc.js
Normal file
@ -0,0 +1,26 @@
|
||||
module.exports = api => {
|
||||
api.cache(() => process.env.NODE_ENV);
|
||||
|
||||
if (process.env.GATSBY === 'true') {
|
||||
return {
|
||||
presets: ['@babel/preset-env', 'babel-preset-gatsby'],
|
||||
};
|
||||
}
|
||||
return {
|
||||
presets: [
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{
|
||||
loose: true,
|
||||
modules: false,
|
||||
},
|
||||
],
|
||||
'@babel/preset-react',
|
||||
{
|
||||
"plugins": [
|
||||
"@babel/plugin-proposal-class-properties"
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
};
|
22
packages/g6/.eslintignore
Normal file
22
packages/g6/.eslintignore
Normal file
@ -0,0 +1,22 @@
|
||||
build/
|
||||
coverage/
|
||||
lib/
|
||||
dist/
|
||||
mocks/
|
||||
node_modules/
|
||||
demos/
|
||||
.cache
|
||||
public
|
||||
bin
|
||||
esm/
|
||||
es/
|
||||
examples/
|
||||
tests/
|
||||
stories/
|
||||
gatsby-browser.js
|
||||
site/
|
||||
webpack.*.js
|
||||
gatsby-*.js
|
||||
global.d.ts
|
||||
jest.config.js
|
||||
.eslintrc.*
|
42
packages/g6/.eslintrc.js
Normal file
42
packages/g6/.eslintrc.js
Normal file
@ -0,0 +1,42 @@
|
||||
module.exports = {
|
||||
extends: [require.resolve('@umijs/fabric/dist/eslint')],
|
||||
globals: {
|
||||
$: true,
|
||||
_: true,
|
||||
},
|
||||
rules: {
|
||||
'no-bitwise': 0,
|
||||
'import/order': 0,
|
||||
'no-plusplus': 0,
|
||||
'no-console': ['error', { allow: ['warn', 'error'] }],
|
||||
'operator-assignment': 0,
|
||||
'consistent-return': 0,
|
||||
'lines-between-class-members': 0,
|
||||
'class-methods-use-this': 0,
|
||||
'lines-between-class-members': 0,
|
||||
'no-multi-assign': 0,
|
||||
'no-continue': 0,
|
||||
'no-underscore-dangle': 0,
|
||||
'no-useless-constructor': 0,
|
||||
'prefer-destructuring': 0,
|
||||
'guard-for-in': 0,
|
||||
'no-restricted-globals': 0,
|
||||
'max-classes-per-file': 0,
|
||||
// 后面需要去掉
|
||||
'no-restricted-syntax': 0,
|
||||
'prefer-spread': 0,
|
||||
'@typescript-eslint/camelcase': 0,
|
||||
'no-loop-func': 0,
|
||||
'@typescript-eslint/no-loop-func': 0,
|
||||
'@typescript-eslint/no-redeclare': 0,
|
||||
'@typescript-eslint/no-shadow': 0,
|
||||
'@typescript-eslint/no-unused-vars': 0,
|
||||
'no-param-reassign': 0,
|
||||
'import/no-extraneous-dependencies': 0,
|
||||
'no-unused-expressions': 0,
|
||||
'dot-notation': 0,
|
||||
'array-callback-return': 0,
|
||||
'one-var': 0,
|
||||
'no-lonely-if': 0
|
||||
},
|
||||
};
|
5
packages/g6/.fatherrc.js
Normal file
5
packages/g6/.fatherrc.js
Normal file
@ -0,0 +1,5 @@
|
||||
export default {
|
||||
entry: './src/index.ts',
|
||||
esm: 'babel',
|
||||
cjs: 'babel',
|
||||
};
|
83
packages/g6/.npmignore
Normal file
83
packages/g6/.npmignore
Normal file
@ -0,0 +1,83 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# lock
|
||||
package-lock.json
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Typescript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
.DS_Store
|
||||
|
||||
# npmignore - content above this line is automatically generated and modifications may be omitted
|
||||
# see npmjs.com/npmignore for more details.
|
||||
test
|
||||
|
||||
*.sw*
|
||||
*.un~
|
||||
.idea
|
||||
bin
|
||||
demos
|
||||
docs
|
||||
temp
|
||||
webpack-dev.config.js
|
||||
webpack.config.js
|
||||
public
|
||||
.cache
|
||||
site
|
||||
examples
|
||||
gatsby-browser.js
|
||||
gatsby-config.js
|
966
packages/g6/CHANGELOG.md
Normal file
966
packages/g6/CHANGELOG.md
Normal file
@ -0,0 +1,966 @@
|
||||
# ChangeLog
|
||||
|
||||
#### 4.0.3
|
||||
|
||||
- fix: state style restore for non-circle shapes;
|
||||
|
||||
#### 4.0.2
|
||||
|
||||
- fix: node and edge state style with update problem;
|
||||
- fix: import lib problem;
|
||||
- fix: import node module problem;
|
||||
- fix: hidden shapes show up after zoom-canvas or drag-canvas with enableOptimize;
|
||||
- fix: tooltip for combo;
|
||||
- fix: update edge with false endArrow and startArrow;
|
||||
|
||||
#### 4.0.1
|
||||
|
||||
- fix: glslang problem;
|
||||
|
||||
#### 4.0.0-beta.0
|
||||
|
||||
- feat: fruchterman and gforce layout with gpu;
|
||||
- feat: gforce;
|
||||
- feat: updateChildren API for TreeGraph;
|
||||
- feat: louvain clustering algorithm;
|
||||
- feat: container of plugins with dom id;
|
||||
- feat: label propagation clustering algorithm;
|
||||
- feat: get color sets by subject color array;
|
||||
- feat: canvas context menu;
|
||||
- feat: stop gforce;
|
||||
- feat: dark rules for colors;
|
||||
- fix: text redidual problem, closes: #2045 #2193;
|
||||
- fix: graph on callback parameter type problem, closes: #2250;
|
||||
- fix: combo zIndex problem;
|
||||
- fix: webworker updateLayoutCfg problem;
|
||||
- fix: drag-canvas and click node on mobile;
|
||||
|
||||
#### 3.8.5
|
||||
|
||||
- fix: get fontFamily of the window in global leads to DOM depending when using bigfish;
|
||||
|
||||
#### 3.8.4
|
||||
|
||||
- feat: new version of basic styles for light version;
|
||||
- feat: shortcuts-call behavior for calling a Graph function by shortcuts;
|
||||
- feat: color generate util function getColorsWithSubjectColor;
|
||||
- fix: drag-canvas on mobile problem;
|
||||
- fix: style update problem with stateStyles in the options of registerNode;
|
||||
|
||||
#### 3.8.3
|
||||
|
||||
- feat: drag the viewport of the minimap out of the the view;
|
||||
- fix: extend modelRect with description problem, closes: #2235;
|
||||
|
||||
#### 3.8.2
|
||||
|
||||
- feat: graph.setImageWaterMarker, graph.setTextWaterMarker API;
|
||||
- feat: zoom-canvas support mobile;
|
||||
- fix: drag-canvas behavior support scalable range, closes: #2136;
|
||||
- fix: TreeGraph changeData clear all states, closes: #2173;
|
||||
- chore: auto zoom tooltip & contextMenu component when zoom-canvas;
|
||||
- chore: upgrade @antv/g-canvas;
|
||||
- feat: destroyLayout API for graph, closes: #2140;
|
||||
- feat: clustering for force layout, closes: #2196;
|
||||
- fix: svg renderer minimap hidden elements probem, closes: #2174;
|
||||
- feat: add extra parameter graph for menu plugin, closes: #2204;
|
||||
- fix: tooltip plugin, crossing different shape cant execute the getContent function, closes: #2153;
|
||||
- feat: add edgeConfig for create-edge behavior, closes: #2195;
|
||||
- fix: remove the source node while creat-edge;
|
||||
- feat: create-edge for combo, closes: #2211;
|
||||
- fix: update the typings for G6Event;
|
||||
|
||||
#### 3.8.1
|
||||
|
||||
- fix: update edge states with updateItem problem, closes: #2142;
|
||||
- fix: create-edge behavior with polyline problem, closes: #2165;
|
||||
- fix: console.warn show duplicate ID, closes: #2163;
|
||||
- feat: support the drag-canvas behavior on the mobile device, closes: #816;
|
||||
- chore: timeBar component docs;
|
||||
|
||||
#### 3.8.0
|
||||
|
||||
- fix: treeGraph render with addItem and stack problem, closes: #2084;
|
||||
- feat: G6 Interactive Document GraphMarker;
|
||||
- feat: registerNode with jsx support afterDraw and setState;
|
||||
- feat: edge filter lens plugin;
|
||||
- feat: timebar plugin;
|
||||
|
||||
#### 3.7.3
|
||||
|
||||
- fix: update G to fix the shape disappear when it has been dragged out of the view port problem, closes: #2078, #2030, #2007;
|
||||
- fix: redo undo with treeGraph problem;
|
||||
- fix: remove item with itemType problem, closes: #2096.
|
||||
|
||||
#### 3.7.2
|
||||
|
||||
- fix: toolbar redo undo addItem with type problem, closes #2043;
|
||||
- fix: optimized drag-canvas with hidden items;
|
||||
- fix: state style with 0 value problem, closes: #2039;
|
||||
- fix: layout with webworker leads to twice beforelayout, closes: #2052;
|
||||
- fix: context menu with sibling doms of graph container leads to position problem, closes: #2053;
|
||||
- fix: changeData with combos problem, closes: #2064;
|
||||
- fix: improve the position of the context menu before showing up;
|
||||
- feat: fisheye allows user to config the trigger of scaling range(r) and magnify factor(d) by scaleRBy and scaleDBy respectively;
|
||||
- feat: add the percent text of magnify factor(d) for fisheye and users are allowed to configure it by show showDPercent.
|
||||
|
||||
#### 3.7.1
|
||||
|
||||
- fix: hide the tooltip plugin when drag node and contextmenu, closes #1975;
|
||||
- fix: processParellelEdges without edge id problem;
|
||||
- fix: label background with left, right position problem, closes #1861;
|
||||
- fix: create-edge and redo undo problem, #1976;
|
||||
- fix: tooltip plugin with shouldBegin problem, closes #2006;
|
||||
- fix: tooltip behavior with shouldBegin problem, closes #2016;
|
||||
- fix: the position of grid plugins when there is something on the top of the canvas, closes: #2012;
|
||||
- fix: fisheye destroy and new problem, closes: #2018;
|
||||
- fix: node event with wrong canvasX and canvasY problem, closes: #2027;
|
||||
- fix: drag combo and drag node to drop on canvas/combo/node problem;
|
||||
- feat: improve the performance on the combos;
|
||||
- fix: redo and undo problem when update item after additem, closes #2019;
|
||||
- feat: hide shapes beside keyShape while zooming;
|
||||
- feat: improve the performance on the combos.
|
||||
|
||||
#### 3.7.0
|
||||
|
||||
- feat: chart node;
|
||||
- feat: bubble set;
|
||||
- feat: custom node with JSX;
|
||||
- feat: minimum spanning tree algorithm;
|
||||
- feat: path finding algorithm;
|
||||
- feat: cycle finding algorithm;
|
||||
- chore: update antv/hierarchy to fix indented tree with dropCap problem.
|
||||
|
||||
#### 3.6.2
|
||||
|
||||
- feat: find all paths and the shortest path between two nodes;
|
||||
- feat: fisheye with dragging;
|
||||
- feat: fisheye with scaling range and d;
|
||||
- feat: click and drag to create an edge by create-edge behavior;
|
||||
- feat: process multiple parallel edges to quadratic with proper curveOffset;
|
||||
- fix: polyline with rect and radius=0 problem;
|
||||
- fix: arrow state & linkpoint;
|
||||
- fix: the position of the tooltip plugin;
|
||||
- fix: drop a node onto a sub node of a combo;
|
||||
- chore: update hierarchy to solve the children ordering problem for indented tree layout;
|
||||
- chore: extract the public calculation to enhance the performance of fisheye.
|
||||
|
||||
#### 3.6.1-beta
|
||||
|
||||
- chore: update g-canvas to support quickHit and pruning the rendering of the graph outside the viewport;
|
||||
- feat: add statistical chart nodes;
|
||||
- feat: add hull for create smooth contour to include specific items;
|
||||
- fix: clear combos before render;
|
||||
- fix: menu plugin with clickHandler problem.
|
||||
|
||||
#### 3.6.1
|
||||
|
||||
- feat: image minimap;
|
||||
- feat: visible can be controlled in the data;
|
||||
- feat: item type for tooltip plugin;
|
||||
- feat: menu plugin with shouldUpdate;
|
||||
- fix: tooltip plugin position and hidden by removeItem;
|
||||
- fix: tooltip behavior hidden by removeItem;
|
||||
- fix: menu plugin with clicking on canvas problem;
|
||||
- fix: menu plugin with clickHandler problem;
|
||||
- fix: createCombo with double nodes problem.
|
||||
|
||||
#### 3.6.0
|
||||
|
||||
- feat: fisheye lens plugin;
|
||||
- feat: lasso-select behavior;
|
||||
- feat: TimeBar plugin;
|
||||
- feat: ToolBar plugin.
|
||||
|
||||
#### 3.5.12
|
||||
|
||||
- fix: node:click is triggered twice while clicking a node;
|
||||
- fix: update combo edge when drag node out of it problem;
|
||||
- feat: animate configuration for combo, true by default;
|
||||
- fix: calling canvas.on('\*', ...) instead of origin way in event controller leads to malposition while dragging nodes with zoomed graph.
|
||||
|
||||
#### 3.5.11
|
||||
|
||||
- feat: graph.priorityState api;
|
||||
- feat: graph.on support name:event mode.
|
||||
- fix: combo edge with uncorrect end points;
|
||||
- fix: combo polyline edge with wrong path;
|
||||
- fix: getViewCenter with padding problem;
|
||||
- fix: cannot read property 'getModel' of null problem on contextmenu when the target is not an item;
|
||||
- feat: allow user to configure the initial positions for empty combos;
|
||||
- feat: optimize by hiding edges and shapes which are not keyShape while dragging canvas;
|
||||
- feat: fix the initial positions by equably distributing for layout to produce similar result.
|
||||
|
||||
#### 3.5.10
|
||||
|
||||
- fix: fitView and fitCenter with animate in the initial state;
|
||||
- fix: dulplicated edges in nodeselectchange event of brush-select;
|
||||
- fix: triple click and drag canvas problem;
|
||||
- fix: sync the minZoom and maxZoom in drag-canvas and graph;
|
||||
- fix: integrate getSourceNeighbors and getTargetNeighbors to getNeighbors(node, type);
|
||||
- feat: initial x and y for combo data;
|
||||
- feat: dagre layout supports sortByCombo;
|
||||
- feat: allow user to disable relayout in collapse-expand-combo behavior;
|
||||
- feat: dijkstra shortest path lenght algorithm.
|
||||
|
||||
#### 3.5.9
|
||||
|
||||
- fix: multiple animate update shape for combo;
|
||||
- fix: removeItem from a combo.
|
||||
|
||||
#### 3.5.8
|
||||
|
||||
- fix: combo edge problem, issues #1722;
|
||||
- feat: adjacency matrix algorithm;
|
||||
- feat: Floyd Warshall shortest path algorithm;
|
||||
- feat: built-in arrows;
|
||||
- feat: built-in markers;
|
||||
- fix: force layout with addItem and relayout;
|
||||
- fix: create combo with parentId problem;
|
||||
- feat: allow user to configure the pixelRatio for Canvas;
|
||||
- chore: update G to resolve the blur canvas problem.
|
||||
|
||||
#### 3.5.7
|
||||
|
||||
- feat: shouldBegin for click-select behavior;
|
||||
- feat: graph.getGroup, graph.getContainer, graph.getMinZoom, graph.setMinZoom, graph.getMaxZoom, graph.setMaxZoom, graph.getWidth, graph.getHeight API;
|
||||
- fix: combo edge dashLine attribute;
|
||||
- fix: combo collapse and expand with edges problem;
|
||||
- fix: destroy the tooltip DOMs when destroy the graph;
|
||||
- fix: unify the shape names for custom node and extended node;
|
||||
- fix: update the edges after first render with collapsed combos.
|
||||
|
||||
#### 3.5.6
|
||||
|
||||
- feat: dropCap for indented TreeGraph layout.
|
||||
|
||||
#### 3.5.5
|
||||
|
||||
- fix: custom node with setState problem;
|
||||
- fix: validationCombo in drag-combo and drag-node.
|
||||
|
||||
#### 3.5.3
|
||||
|
||||
- feat: focusItem with animation;
|
||||
- feat: generate the image url of the full graph by graph.toFullDataUrl;
|
||||
- fix: graph dispears after being dragged out of the canvas and back;
|
||||
- fix: the graph cannot be dragged back if it is already out of the view;
|
||||
- fix: size and radius of the linkPoints problem;
|
||||
- fix: combo graph with unused state name in comboStateStyles;
|
||||
- fix: preventDefault in drag-canvas behavior.
|
||||
|
||||
#### 3.5.2
|
||||
|
||||
- feat: degree algorithm;
|
||||
- feat: graph.getNodeDegree;
|
||||
- fix: downloadFullImage changes the matrix of the graph problem;
|
||||
- fix: circular layout modifies the origin data with infinite hierarchy problem.
|
||||
|
||||
#### 3.5.1
|
||||
|
||||
- feat: graph.fitCenter to align the graph center to canvas center;
|
||||
- fix: getType is not a function error occurs when addItem with point;
|
||||
- fix: checking comboTrees avaiability;
|
||||
- fix: error occurs when createCombo into the graph without any combos;
|
||||
- fix: endPoint and startPoint are missing in modelConfig type;
|
||||
- fix: edge background leads to empty canvas when the autoRotate is false;
|
||||
- fix: combo state style bug.
|
||||
|
||||
#### 3.5.0
|
||||
|
||||
- feat: combo and combo layout;
|
||||
- feat: graph algorithms: DFS, BFS and circle detection;
|
||||
- feat: add `getNeighbors`, `getSourceNeighbors`, `getTargetNeighbors` methods on Graph and Node;
|
||||
- feat: add `getID` method on Item;
|
||||
- fix: All Configuration type declarations are migrated to types folder, refer [here](https://github.com/antvis/G6/commit/3691cb51264df8529f75222147ac3f248b71f2f6?diff=unified#diff-76cf0eb5e3d8032945f1ac79ffc5e815R6);
|
||||
- fix: Some configuration type declarations have removed the `I` prefix, refer [here](https://github.com/antvis/G6/commit/3691cb51264df8529f75222147ac3f248b71f2f6?diff=unified#diff-aa582974831cee2972b8c96cfcce503aR16);
|
||||
- feat: Util.getLetterWidth and Util.getTextSize.
|
||||
|
||||
#### 3.4.10
|
||||
|
||||
- fix: TreeGraphData type with style and stateStyles;
|
||||
- fix: wrong controlpoint position for bezier curves with getControlPoint.
|
||||
|
||||
#### 3.4.9
|
||||
|
||||
- fix: transplie d3-force to support IE11.
|
||||
|
||||
#### 3.4.8
|
||||
|
||||
- feat: update the keyShape type minimap when the node or edge's style is updated;
|
||||
- fix: problem about switching to another applications or browser menu and then switch back, the drag-canvas does not take effect;
|
||||
- fix: fix the problem about fail to render the graph when the animate and fitView are true by turn off the animate for rendering temporary;
|
||||
- fix: curveOffset for arc, quadratic, cubic edge.
|
||||
|
||||
#### 3.4.7
|
||||
|
||||
- feat: downloadFullImage when the (part of) graph is out of the screen;
|
||||
- feat: With pre-graph has no layout configurations and no positions in data, calling changeData to change into a new data with positions, results in show the node with positions in data;
|
||||
- feat: allow user to assign curveOffset and curvePostion for Bezier curves;
|
||||
- fix: moveTo wrong logic problem;
|
||||
- fix: removeItem to update the minimap.
|
||||
|
||||
#### 3.4.6
|
||||
|
||||
- same as 3.4.5, published wrongly.
|
||||
|
||||
#### 3.4.5
|
||||
|
||||
- feat: background of the label on node or edge;
|
||||
- feat: better performance of minimap;
|
||||
- fix: minimap viewport displace problem;
|
||||
- feat: offset of tooltip;
|
||||
- fix: the length of the node's name affects the tree layout;
|
||||
- fix: toFront does not work for svg renderer;
|
||||
- fix: error occurs when the fontSize is smaller than 12 with svg renderer;
|
||||
- fix: changeData clears states;
|
||||
- fix: state does not work when default labelCfg is not assigned.
|
||||
|
||||
#### 3.4.4
|
||||
|
||||
- feat: background color for downloadImage and toDataURL;
|
||||
- feat: support configure image for grid plugin;
|
||||
- fix: initial position for fruchterman layout;
|
||||
- refactor: clip for image node.
|
||||
- fix: cubic with only one controlPoint error;
|
||||
- fix: polyline without L attributes.
|
||||
|
||||
#### 3.4.3
|
||||
|
||||
- fix: support extends BehaviorOption;
|
||||
- fix: click-select Behavior support multiple selection using ctrl key.
|
||||
|
||||
#### 3.4.2
|
||||
|
||||
- feat: zoom-canvas behavior supports hiding non-keyshape elements when scaling canvas;
|
||||
- refactor: when the second parameter is null, clearItemStates will clear all states of the item;
|
||||
- fix: [changeData bug](https://github.com/antvis/G6/issues/1323);
|
||||
- fix: update antv/hierarchy to fix fixedRoot for TreeGraph;
|
||||
- fix: problem of a graph has multiple polyline edges;
|
||||
- fix: problem of dagre with controlPoints and loop edges.
|
||||
|
||||
#### 3.4.1
|
||||
|
||||
- feat: force layout clone original data model to allow the customized properties;
|
||||
- fix: BehaviorOptions type error;
|
||||
- fix: fitView the graph with data whose nodes and edges are empty arrays;
|
||||
- fix: rect node positions are changed after calling graph.changeData;
|
||||
- fix: drag behavior is disabled when the keys are released invalidly;
|
||||
- refactor: update G and the fill of custom arrow should be assigned by user.
|
||||
|
||||
#### 3.4.0
|
||||
|
||||
- feat: SVG renderer;
|
||||
- refactor: new state mechanism with multiple values, sub graphics shape style settings.
|
||||
|
||||
#### 3.3.7
|
||||
|
||||
- feat: beforeaddchild and afteraddchild emit for TreeGraph;
|
||||
- feat: built-in nodes' labels can be captured;
|
||||
- fix: drag shadow caused by localRefresh, update the g-canvas version;
|
||||
- fix: abnormal polyline bendding;
|
||||
- fix: collapse-expand trigger problem;
|
||||
- fix: update nodes with empty string label;
|
||||
- fix: abnormal rendering when a graph has image nodes and other type nodes.
|
||||
|
||||
#### 3.3.6
|
||||
|
||||
- feat: support edge weight for dagre layout;
|
||||
- feat: automatically add draggable to keyShape, users do not need to assign it when custom a node or an edge;
|
||||
- fix: cannot read 0 or null problem in getPointByCanvas;
|
||||
- fix: brush-select bug;
|
||||
- fix: set autoDraw to canvas when graph's setAutoPaint is called;
|
||||
- fix: modify the usage of bbox in view controller since the interface is chagned by G;
|
||||
- fix: the shape.attr error in updateShapeStyle;
|
||||
- fix: local refresh influence on changeData;
|
||||
- refactor: upgrade g-canvas to 0.3.23 to solve lacking of removeChild function;
|
||||
- doc: update the demo fo custom behavior doc;
|
||||
- doc: add plugin demos and cases for site;
|
||||
- doc: fix shouldUpdate problem in treeWithLargeData demo on the site.
|
||||
|
||||
#### 3.3.5
|
||||
|
||||
- fix: 3.3.4 is not published successfully;
|
||||
|
||||
#### 3.3.4
|
||||
|
||||
- fix: 3.3.3 is not published successfully;
|
||||
- fix: delegate or keyShape type minimap does not display bug;
|
||||
- fix: dragging bug on minimap with a graph whose bbox is nagtive;
|
||||
- fix: null matrix bug, create a unit matrix for null.
|
||||
|
||||
#### 3.3.3
|
||||
|
||||
- fix: delegate or keyShape type minimap does not display bug;
|
||||
- fix: null matrix in focus() and getLoopCfgs() bug.
|
||||
|
||||
#### 3.3.2
|
||||
|
||||
- fix: ts type export problem;
|
||||
- fix: edge with endArrow and autoRotate label bug;
|
||||
- fix: code prettier;
|
||||
- fix: line with control points bug;
|
||||
- fix: matrix null bug.
|
||||
|
||||
#### 3.3.1
|
||||
|
||||
- fix: resolve 3.3.0 compatibility problem.
|
||||
|
||||
#### 3.3.0
|
||||
|
||||
- Graph API
|
||||
- refactor: delete removeEvent function, use off;
|
||||
- refactor: parameters of Shape animate changed, shape.animate(toAttrs, animateCfg) or shape.animate(onFrame, animateCfg);
|
||||
- feat: descriptionCfg for modelRect to define the style of description by user;
|
||||
- feat: update a node from without some shapes to with them, such as linkPoints, label, logo icon and state icon for modelRect;
|
||||
- feat: the callback paramter of event nodeselectchange is changed to { target, selectedItems, ... };
|
||||
- feat: support stateStyles in node and edge data;
|
||||
- feat: calculate pixelRatio by G automatically, user do not need to assign it to graph instance;
|
||||
- chore: G 4.0
|
||||
- refactor: refreshLayout of TreeGraph is renamed as layout
|
||||
- fix: no fan shape in G any more
|
||||
- feat: recommand to assign name for each shape when addShape
|
||||
- fix: do not support SVG renderer anymore. no renderer for graph configuration anymore
|
||||
- refactor: plugins usage is changed into new G6.PluginName()
|
||||
|
||||
#### 3.2.7
|
||||
|
||||
- feat: supports create the group without nodes in node-group;
|
||||
- fix: supports destoryed properties and fix issue 1094;
|
||||
|
||||
#### 3.2.6
|
||||
|
||||
- feat: supports sort the nodes on one circle according to the data ordering or some attribute in radial layout
|
||||
- fix: grid layout with cols and rows
|
||||
- feat: fix the nodes with position information in their original data and random the positions of others when the layout is not defined for graph
|
||||
|
||||
#### 3.2.5
|
||||
|
||||
- fix: click-select trigger error
|
||||
- fix: solved position problem for minimap
|
||||
|
||||
#### 3.2.4
|
||||
|
||||
- fix: typescript compile error
|
||||
- fix: delete sankey lib
|
||||
|
||||
#### 3.2.3
|
||||
|
||||
- fix: group position error
|
||||
- fix: supports not set layout type
|
||||
|
||||
#### 3.1.5
|
||||
|
||||
- feat: supports g6 types file
|
||||
- fix: set brush-select trigger param to ctrl not work
|
||||
- fix: when set fitView to true, drag-group Behavior not get desired positon
|
||||
|
||||
#### 3.1.3
|
||||
|
||||
- feat: radial layout nonoverlap iterations can be controlled by user
|
||||
- feat: add lock, unlock and hasLocked function, supports lock and unlock node
|
||||
- fix: mds with discrete points problem
|
||||
- fix: fruchterman-group layout title position for rect groups
|
||||
|
||||
#### 3.1.2
|
||||
|
||||
- feat: default behavior supports configuration trigger mode
|
||||
- feat: node combining supports configuration title
|
||||
- fix: update demo state styles
|
||||
|
||||
#### 3.1.1
|
||||
|
||||
- fix: update node use custom config
|
||||
- fix: update demo
|
||||
- feat: default node implement getShapeStyle function
|
||||
|
||||
#### 3.1.0
|
||||
|
||||
- feat: support for rich layouts:random, radial, mds, circular, fruchterman, force, dagre
|
||||
- feat: more flexible configuration for shape
|
||||
- feat: build-in rich default nodes
|
||||
- feat: cases that provide layout and default nodes
|
||||
|
||||
#### 3.0.7-beta.1
|
||||
|
||||
`2019-09-11`
|
||||
|
||||
- fix: zoom-canvas support IE and Firefox
|
||||
|
||||
#### 3.0.6
|
||||
|
||||
`2019-09-11`
|
||||
|
||||
- fix: group data util function use module.exports
|
||||
- feat: update @antv/hierarchy version
|
||||
|
||||
#### 3.0.5
|
||||
|
||||
`2019-09-10`
|
||||
|
||||
- feat: support add and remove group
|
||||
- feat: support collapse and expand group
|
||||
- feat: add graph api: collapseGroup and expandGroup
|
||||
|
||||
#### 3.0.5-beta.12
|
||||
|
||||
- feat: add rect group
|
||||
- feat: add rect group demo
|
||||
- feat: add chart node
|
||||
|
||||
---
|
||||
|
||||
#### 3.0.5-beta.10
|
||||
|
||||
- feat: add 5 chart node
|
||||
- feat: collapse-expand tree support click and dblclick by trigger option
|
||||
- fix: drag group bug fix
|
||||
|
||||
#### 3.0.5-beta.9
|
||||
|
||||
- feat: support render group
|
||||
- feat: support drag group, collapse and expand group, drag node in/out group
|
||||
- feat: add drag-group、collapse-expand-group and drag-node-with-group behavior
|
||||
- feat: add drag-group and collapse-expand-group demo
|
||||
- feat: add register list node demo
|
||||
|
||||
#### 3.0.5-beta.8
|
||||
|
||||
`2019-07-19`
|
||||
|
||||
- feat: add five demos
|
||||
- refactor: update three behaviors
|
||||
|
||||
#### 2.2.5
|
||||
|
||||
`2018-12-20`
|
||||
|
||||
- feat: add saveimage limitRatio
|
||||
|
||||
#### 2.2.4
|
||||
|
||||
`2018-12-20`
|
||||
|
||||
- fix: bug fix
|
||||
|
||||
#### 2.2.3
|
||||
|
||||
`2018-12-10`
|
||||
|
||||
- fix: bug fix
|
||||
|
||||
#### 2.2.2
|
||||
|
||||
`2018-11-30`
|
||||
|
||||
- fix: tree remove guide will not getEdges.closes #521
|
||||
|
||||
#### 2.2.1
|
||||
|
||||
`2018-11-25`
|
||||
|
||||
- fix: Compatible with MOUSEWHEEL
|
||||
- fix: fadeIn aniamtion
|
||||
- fix: fix wheelZoom behaviour by removing the deprecated mousewheel event
|
||||
|
||||
#### 2.2.0
|
||||
|
||||
`2018-11-22`
|
||||
|
||||
- fix: Graph read zIndex
|
||||
- refactor: Animation
|
||||
|
||||
#### 2.1.5
|
||||
|
||||
`2018-10-26`
|
||||
|
||||
- fix: svg pixelRatio bug
|
||||
- feat: add wheel event
|
||||
|
||||
#### 2.1.4
|
||||
|
||||
`2018-10-06`
|
||||
|
||||
- fix: custom math.sign to compatible with ie browser.Closes #516.
|
||||
- fix: legend component from @antv/component
|
||||
- feat: update svg minimap && fix svg dom event
|
||||
|
||||
#### 2.1.3
|
||||
|
||||
`2018-09-27`
|
||||
|
||||
- feat: add label rotate
|
||||
- feat: if there is no items the graph box equal canvas size
|
||||
|
||||
#### 2.1.2
|
||||
|
||||
`2018-09-19`
|
||||
|
||||
- fix: dom getShape bug.Closes #472
|
||||
- fix: template.maxSpanningForest bug
|
||||
|
||||
#### 2.1.1
|
||||
|
||||
`2018-09-17`
|
||||
|
||||
- fix: tool.highlightSubgraph calculate box bug
|
||||
- fix: plugin.grid.Closes #479
|
||||
- chore(dev): upgrade babel & torchjs
|
||||
|
||||
#### 2.1.0
|
||||
|
||||
`2018-09-03`
|
||||
|
||||
- feat: svg render
|
||||
- feat: plugin.layout.forceAtlas2
|
||||
- feat: plugin.tool.fisheye
|
||||
- feat: plugin.tool.textDisplay
|
||||
- feat: plugin.tool.grid
|
||||
- feat: plugin.template.tableSankey
|
||||
- feat: plugin.edge.polyline
|
||||
|
||||
#### 2.0.5
|
||||
|
||||
`2018-07-12`
|
||||
|
||||
- improve: add g6 arrow
|
||||
|
||||
#### 2.0.4
|
||||
|
||||
`2018-07-12`
|
||||
|
||||
- feat: layout export group.Closes #355
|
||||
- feat(plugin): add tool.tooltip. Closes #360.
|
||||
- style: change the calling way of forceAtlas2 on template.maxSpanningForest
|
||||
- fix: origin tree data collapsed is true tree edge visible bug.Closes #357
|
||||
- fix: remove the forceAtlas.js in template.maxSpanningForest, use forceAtlas from layout.forceAtlas2
|
||||
- fix: add demos: plugin-fisheye, plugin-forceAtlas2, gallery-graphanalyzer
|
||||
- fix: add demos: plugin-forceAtlas2, plugin-fisheye
|
||||
|
||||
#### 2.0.3
|
||||
|
||||
`2018-06-29`
|
||||
|
||||
- feat: update g to 3.0.x. Closes #346
|
||||
- fix: group should use rect intersect box. Close #297
|
||||
- fix(plugin): dagre edge controlpoints remove start point and end point
|
||||
- style: remove some annotations
|
||||
- chore: update torchjs && improve demo name
|
||||
|
||||
#### 2.0.2
|
||||
|
||||
`2018-06-13`
|
||||
|
||||
- chore(plugin): require g6 by src/index
|
||||
- chore(dev test): remove useless test script
|
||||
- fix(plugin) minimap destroy Closes #308
|
||||
- fix(saveImage) saveImage bug
|
||||
- fix(event): fix dom coord. Closes #305
|
||||
|
||||
#### 2.0.1
|
||||
|
||||
`2018-06-11`
|
||||
|
||||
- fix: reDraw edge after layout
|
||||
- feat: add quadraticCurve config cpd
|
||||
- feat: add beforelayout && afterlayout event
|
||||
- chore: .travis.yml add add Node.js
|
||||
- chore: .travis.yml cache node_modules
|
||||
|
||||
#### 2.0.0
|
||||
|
||||
`2018-06-06`
|
||||
|
||||
- refactor: refactor architecture && code
|
||||
|
||||
#### 1.2.1
|
||||
|
||||
`2018-03-15`
|
||||
|
||||
- feat: layout interface
|
||||
|
||||
#### 1.2.0
|
||||
|
||||
`2018-01-15`
|
||||
|
||||
- fix: nodeActivedBoxStyle spelling error
|
||||
- fix: error when deleting a circle
|
||||
- fix: trigger dragstart while right clicking and moveing
|
||||
- feat: Unify Layout mechanism
|
||||
- feat: Plugin mechanism
|
||||
- feat: Data filter mechanism
|
||||
- feat: Activated interface
|
||||
- feat: Action wheelZoomAutoLabel
|
||||
- feat: configuration of graph -- preciseAnchor
|
||||
- remove: Global.preciseAnchor
|
||||
- remove: Layout.Flow、Layout.Force
|
||||
- improve: html container strategy
|
||||
|
||||
#### 1.1.6
|
||||
|
||||
`2017-10-15`
|
||||
|
||||
- fix: pack problem in layout algorithm
|
||||
|
||||
#### 1.1.5
|
||||
|
||||
`2017-09-15`
|
||||
|
||||
- fix: dragCanvas is effective while mousemove, prevent it from affecting click events
|
||||
- fix: unactivate pick-up in activeRectBox of node
|
||||
|
||||
#### 1.1.4
|
||||
|
||||
`2017-08-15`
|
||||
|
||||
- feat: graph.invertPoint()
|
||||
- feat: third configuration of anchor to support style setting, float style, connection
|
||||
- feat: item.getGroup()
|
||||
- feat: events -- afteritemrender、itemremove、itemadd
|
||||
- feat: behaviourSignal
|
||||
- improve: mouseWheel is affective after focusing the canvas
|
||||
|
||||
#### 1.1.3
|
||||
|
||||
`2017-08-8`
|
||||
|
||||
- feat: Graph configuration -- useNodeSortGroup
|
||||
- feat: Global.nodeDelegationStyle, Global.edgeDelegationStyle, isolate the delegation of edge and node on graph
|
||||
- fix: itemremove is triggered before destroying a graph
|
||||
|
||||
#### 1.1.2
|
||||
|
||||
`2017-08-01`
|
||||
|
||||
- feat: dragBlankX dragBlankY
|
||||
|
||||
#### 1.1.1
|
||||
|
||||
`2017-07-18`
|
||||
|
||||
- improve: dragNode protect mechanism
|
||||
|
||||
#### 1.1.0
|
||||
|
||||
`2017-07-05`
|
||||
|
||||
- feat: HTML node
|
||||
- feat: mapper support callback function
|
||||
- feat: Graph interfaces -- updateMatrix、changeSize、showAnchor、hideAnchor、updataNodesPosition
|
||||
- feat: tool functions -- Util.isNode()、Util.isEdge()
|
||||
- feat: Shape polyLineFlow
|
||||
- feat: dragEdgeEndHideAnchor、dragNodeEndHideAnchor、hoverAnchorSetActived、hoverNodeShowAnchor
|
||||
|
||||
#### 1.0.7
|
||||
|
||||
`2017-06-21`
|
||||
|
||||
- fix: draw one more time in 16ms after first draw
|
||||
- improve: add zoom by scroll in edit mode
|
||||
|
||||
#### 1.0.6
|
||||
|
||||
`2017-06-15`
|
||||
|
||||
- fix: compatible in chrome in windows. triggering mousemove after first click leads to wrong click event.
|
||||
- feat: support fix size graphics
|
||||
- feat: analysis mode
|
||||
- feat: updateNodesPositon update a set of nodes' position
|
||||
- improve: change useAnchor to be a configuration of edge
|
||||
|
||||
#### 1.0.5
|
||||
|
||||
`2017-06-01`
|
||||
|
||||
- feat: downloadImage support saving with name
|
||||
- feat: automatically detect tooltip padding
|
||||
- improve: stop the action while mouse dragging out of the canvas
|
||||
|
||||
#### 1.0.4
|
||||
|
||||
`2017-05-20`
|
||||
|
||||
- fix: tree changeData Bug
|
||||
- fix: when getAnchorPoints returns auto, anchor is the intersection of edge and the bounding box
|
||||
- fix: generate node label according to isNull
|
||||
- feat: viewport parameters -- tl、tc、tr、rc、br、bc、bl、lc、cc
|
||||
- improve: reduce tolerance to improve the accuracy of interception
|
||||
- improve: improve tooltip event mechanisom to enhance performance
|
||||
|
||||
#### 1.0.3
|
||||
|
||||
`2017-05-10`
|
||||
|
||||
- feat: graph.guide().link()
|
||||
|
||||
#### 1.0.2
|
||||
|
||||
`2017-05-10`
|
||||
|
||||
- fix: Object.values => Util.getObjectValues
|
||||
- fix: when anchorPoints is auto, there is only anchorpoint on edge, it will also return the intersection
|
||||
- fix: tree update interface Bug
|
||||
- improve: represent positions information by group.transfrom()
|
||||
|
||||
#### 1.0.1
|
||||
|
||||
`2017-04-22`
|
||||
|
||||
- fix: copy and paste bug
|
||||
- feat: draw once in 16ms
|
||||
- feat: itemactived itemunactived itemhover itemupdate itemmouseenter itemmouseleave
|
||||
- improve: be clear the status of graphics before activating graphics by frame selection
|
||||
- improve: dragAddEdge, linkable to anchor
|
||||
- improve: performance of animation
|
||||
|
||||
#### 1.0.0
|
||||
|
||||
`2017-03-31`
|
||||
|
||||
- feat: fitView configurations
|
||||
- feat: graph.zoom()
|
||||
- feat: wheelZoomHideEdges hide the edges while zooming by wheel
|
||||
- feat: dragHideEdges hide the edge while dragging edge
|
||||
- feat: graph.filterBehaviour()
|
||||
- feat: graph.addBehaviour()
|
||||
- feat: graph.changeLayout()
|
||||
- feat: read interface, re-define save interface
|
||||
- feat: graph.snapshot, graph.downloadImage
|
||||
- feat: graph.autoSize()
|
||||
- feat: graph.focusPoint()
|
||||
- feat: tree graph、net graph
|
||||
- feat: interaction mechanism -- event => action => mode
|
||||
- feat: animation mechanism
|
||||
- feat: itemmouseleave、itemmouseenter
|
||||
- remove: graph.refresh()
|
||||
- remove: graph.changeNodes()
|
||||
- remove: graph attributes -- zoomable、dragable、resizeable、selectable
|
||||
- improve: anchor mechanism
|
||||
- improve: hide G6.GraphUtil functions, unified in G6.Util
|
||||
- improve: replace g-canvas-core to g-canvas to improve performance
|
||||
- improve: Global.nodeAcitveBoxStyle instead of Global.nodeBoxStyle
|
||||
- improve: afterAdd => afteradd
|
||||
- improve: G6.Graph to be an abstract class
|
||||
|
||||
#### 0.2.3
|
||||
|
||||
`2017-03-2`
|
||||
|
||||
- fix: dragable for controlling dragable under default mode
|
||||
- feat: graph.converPoint()
|
||||
- feat: graph.autoSize()
|
||||
- feat: rightmousedown leftmousedown wheeldown
|
||||
- improve: use try catch to prevent the length of getPoint of path equals zero
|
||||
|
||||
#### 0.2.2
|
||||
|
||||
`2017-02-24`
|
||||
|
||||
- fix: add px totooltip css padding
|
||||
- fix: tooltip mapping error
|
||||
- fix: accurate intersection
|
||||
- fix: zoom error on double accuracy screen
|
||||
- fix: buonding box extended from keyShape
|
||||
- feat: afterAdd
|
||||
- feat: dblclick
|
||||
- improve: width、height default null
|
||||
- improve: remove hovershape on node
|
||||
- improve: tooltip defense mechanism
|
||||
|
||||
#### 0.2.1
|
||||
|
||||
`2017-02-14`
|
||||
|
||||
- fix: rollback when add node
|
||||
- fix: apply tranformation of parent container while calculating bounding box
|
||||
- feat: waterPath
|
||||
- feat: tooltip tip information
|
||||
- feat: mouseover
|
||||
- feat: multiSelectable, default false
|
||||
- feat: set forceFit to true while width is undefined
|
||||
- improve: zoomable、dragable、resizeable、selectable default true
|
||||
|
||||
#### 0.2.0
|
||||
|
||||
`2017-02-07`
|
||||
|
||||
- feat: accurate anchor mechanism
|
||||
- feat: GraphUtil.getEllipsePath
|
||||
- feat: GraphUtil.pointsToPolygon
|
||||
- feat: GraphUtil.pointsToBezier
|
||||
- feat: GraphUtil.snapPreciseAnchor
|
||||
- feat: GraphUtil.arrowTo
|
||||
- feat: GraphUtil.drawEdge
|
||||
- feat: bezierQuadratic
|
||||
- feat: node.show
|
||||
- feat: node.hide
|
||||
- feat: node.getLinkNodes
|
||||
- feat: node.getUnLinkNodes
|
||||
- feat: node.getRelativeItems
|
||||
- feat: node.getUnRelativeItems
|
||||
- feat: edge.show
|
||||
- feat: edge.hide
|
||||
- feat: Shape afterDraw
|
||||
- improve: the controlling point positions of Bezier Curve 改进贝塞尔曲线控制点位置
|
||||
- improve: grpah.delete => graph.del
|
||||
- improve: error when adding id
|
||||
|
||||
#### 0.1.4
|
||||
|
||||
`2017-01-17`
|
||||
|
||||
- fix: delegator of dragging a node is the center of bbox
|
||||
- fix: use cardinality sort for all the sorting algorithm
|
||||
- fix: random id on edges
|
||||
- feat: level sort on edges, edge labels on the top level
|
||||
- feat: while extending shape is undefined when register an edge, find the extending shaoe automatically
|
||||
|
||||
#### 0.1.3
|
||||
|
||||
`2017-01-15`
|
||||
|
||||
- fix: judge the existance of the object while operating assistGrid
|
||||
- feat: rollback judgement, default unactivate
|
||||
- feat: style mapping channel
|
||||
- feat: return the intersections while getAnchorPoints is null or returns false
|
||||
- feat: bezierHorizontal、bezierVertical
|
||||
- improve: 'eventEnd'
|
||||
|
||||
#### 0.1.2
|
||||
|
||||
`2017-01-12`
|
||||
|
||||
- fix: judge the configuration before updating grid
|
||||
- fix: the size of graphContainer in unsetable, setted by inner canvas
|
||||
- fix: will not add an edge if the target or source is undefined
|
||||
- fix: changeSize() maximum tolerance for error
|
||||
- feat: graph.get('el') to get canvas DOM
|
||||
- feat: event exposures shape
|
||||
|
||||
#### 0.1.1
|
||||
|
||||
`2017-01-09`
|
||||
|
||||
- feat: entrance of graph is G6.Graph
|
||||
|
||||
#### 0.1.0
|
||||
|
||||
`2017-01-07`
|
||||
|
||||
- feat: color calculation library
|
||||
- feat: hot key
|
||||
- feat: updo, redo
|
||||
- feat: copy, paste
|
||||
- feat: reset zoom, auto zoom
|
||||
- feat: tree graph, linear graph, sankey graph, flow laout
|
||||
- feat: flow chart package
|
||||
- feat: timing diagram package
|
||||
- feat: single selection, frame selection
|
||||
- feat: node deformation
|
||||
- feat: edge deformation
|
||||
- feat: drag node and edge
|
||||
- feat: link edge and node
|
||||
- feat: drag canvas
|
||||
- feat: zoom
|
||||
- feat: select mode
|
||||
- feat: integrate g-graph
|
139
packages/g6/CONTRIBUTING.md
Normal file
139
packages/g6/CONTRIBUTING.md
Normal file
@ -0,0 +1,139 @@
|
||||
# Contribution Guide
|
||||
|
||||
If you have any comment or advice, please report your [issue](https://github.com/antvis/g6/issues), or make any change as you wish and submit an [PR](https://github.com/antvis/g6/pulls).
|
||||
|
||||
## Reporting New Issues
|
||||
|
||||
- Please specify what kind of issue it is.
|
||||
- Before you report an issue, please search for related issues. Make sure you are not going to open a duplicate issue.
|
||||
- Explain your purpose clearly in tags(see **Useful Tags**), title, or content.
|
||||
|
||||
AntV group members will confirm the purpose of the issue, replace more accurate tags for it, identify related milestone, and assign developers working on it.
|
||||
|
||||
## Submitting Code
|
||||
|
||||
### Pull Request Guide
|
||||
|
||||
If you are developer of AntV repo and you are willing to contribute, feel free to create a new branch, finish your modification and submit a PR. AntV group will review your work and merge it to master branch.
|
||||
|
||||
```bash
|
||||
# Create a new branch for development. The name of branch should be semantic, avoiding words like 'update' or 'tmp'. We suggest to use feature/xxx, if the modification is about to implement a new feature.
|
||||
$ git checkout -b branch-name
|
||||
|
||||
# Run the test after you finish your modification. Add new test cases or change old ones if you feel necessary
|
||||
$ npm test
|
||||
|
||||
# If your modification pass the tests, congradulations it's time to push your work back to us. Notice that the commit message should be wirtten in the following format.
|
||||
$ git add . # git add -u to delete files
|
||||
$ git commit -m "fix(role): role.use must xxx"
|
||||
$ git push origin branch-name
|
||||
```
|
||||
|
||||
Then you can create a Pull Request at [g6](https://github.com/antvis/g6/pulls).
|
||||
|
||||
No one can guarantee how much will be remembered about certain PR after some time. To make sure we can easily recap what happened previously, please provide the following information in your PR.
|
||||
|
||||
1. Need: What function you want to achieve (Generally, please point out which issue is related).
|
||||
2. Updating Reason: Different with issue. Briefly describe your reason and logic about why you need to make such modification.
|
||||
3. Related Testing: Briefly describe what part of testing is relevant to your modification.
|
||||
4. User Tips: Notice for g6 users. You can skip this part, if the PR is not about update in API or potential compatibility problem.
|
||||
|
||||
### Style Guide
|
||||
|
||||
Eslint can help to identify styling issues that may exist in your code. Your code is required to pass the test from eslint. Run the test locally by `$ npm run lint`.
|
||||
|
||||
### Commit Message Format
|
||||
|
||||
You are encouraged to use [angular commit-message-format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format) to write commit message. In this way, we could have a more trackable history and an automatically generated changelog.
|
||||
|
||||
```xml
|
||||
<type>(<scope>): <subject>
|
||||
<BLANK LINE>
|
||||
<body>
|
||||
<BLANK LINE>
|
||||
<footer>
|
||||
```
|
||||
|
||||
(1)type
|
||||
|
||||
Must be one of the following:
|
||||
|
||||
- feat: A new feature
|
||||
- fix: A bug fix
|
||||
- docs: Documentation-only changes
|
||||
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
||||
- refactor: A code change that neither fixes a bug nor adds a feature
|
||||
- perf: A code change that improves performance
|
||||
- test: Adding missing tests
|
||||
- chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
|
||||
- deps: Updates about dependencies
|
||||
|
||||
(2)scope
|
||||
|
||||
The scope could be anything specifying place of the commit change.
|
||||
|
||||
(3)subject
|
||||
|
||||
Use succinct words to describe what did you do in the commit change.
|
||||
|
||||
(4)body
|
||||
|
||||
Feel free to add more content in the body, if you think subject is not self-explanatory enough, such as what it is the purpose or reasons of you commit.
|
||||
|
||||
(5)footer
|
||||
|
||||
- **If the commit is a Breaking Change, please note it clearly in this part.**
|
||||
- related issues, like `Closes #1, Closes #2, #3`
|
||||
|
||||
e.g.
|
||||
|
||||
```
|
||||
fix($compile): [BREAKING_CHANGE] couple of unit tests for IE9
|
||||
|
||||
Older IEs serialize html uppercased, but IE9 does not...
|
||||
Would be better to expect case insensitive, unfortunately jasmine does
|
||||
not allow to user regexps for throw expectations.
|
||||
|
||||
Document change on antvis/g6#123
|
||||
|
||||
Closes #392
|
||||
|
||||
BREAKING CHANGE:
|
||||
|
||||
Breaks foo.bar api, foo.baz should be used instead
|
||||
```
|
||||
|
||||
Look at [these files](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit) for more details.
|
||||
|
||||
## Release
|
||||
|
||||
g6 uses semantic versioning in release process based on [semver].
|
||||
|
||||
### Branch Strategy
|
||||
|
||||
`master` branch is the latest stable version.
|
||||
|
||||
- just checkout develop branch from `master`
|
||||
- All new features will be added into `master` or `next` branch as well as all bug-fix except security issues. In such way, we can motivate developers to update to the latest stable version.
|
||||
|
||||
### Release Strategy
|
||||
|
||||
In the release of every stable version, there will be a PM who has the following responsibilities in different stages of the release.
|
||||
|
||||
#### Preparation
|
||||
|
||||
- Set up milestone. Confirm that request is related to milestone.
|
||||
|
||||
#### Before Release
|
||||
|
||||
- Confirm that performance test is passed and all issues in current Milestone are either closed or can be delayed to later versions.
|
||||
- Open a new [Release Proposal MR], and write `History` as [node CHANGELOG]. Don't forget to correct content in documentation which is related to the releasing version. Commits can be generated automatically.
|
||||
```
|
||||
$ npm run commits
|
||||
```
|
||||
- Nominate PM for next stable version.
|
||||
|
||||
[semver]: http://semver.org/lang/zh-CN/
|
||||
[release proposal mr]: https://github.com/nodejs/node/pull/4181
|
||||
[node changelog]: https://github.com/nodejs/node/blob/master/CHANGELOG.md
|
||||
[『我是如何发布一个 npm 包的』]: https://fengmk2.com/blog/2016/how-i-publish-a-npm-package
|
145
packages/g6/CONTRIBUTING.zh-CN.md
Normal file
145
packages/g6/CONTRIBUTING.zh-CN.md
Normal file
@ -0,0 +1,145 @@
|
||||
# 代码贡献规范
|
||||
|
||||
有任何疑问,欢迎提交 [issue](https://github.com/antvis/g6/issues),或者直接修改提交 [PR](https://github.com/antvis/g6/pulls)!
|
||||
|
||||
## 提交 issue
|
||||
|
||||
- 请确定 issue 的类型。
|
||||
- 请避免提交重复的 issue,在提交之前搜索现有的 issue。
|
||||
- 在标签(分类参考**标签分类**), 标题 或者内容中体现明确的意图。
|
||||
|
||||
随后 AntV 负责人会确认 issue 意图,更新合适的标签,关联 milestone,指派开发者。
|
||||
|
||||
## 提交代码
|
||||
|
||||
### 提交 Pull Request
|
||||
|
||||
如果你有仓库的开发者权限,而且希望贡献代码,那么你可以创建分支修改代码提交 PR,AntV 开发团队会 review 代码合并到主干。
|
||||
|
||||
```bash
|
||||
# 先创建开发分支开发,分支名应该有含义,避免使用 update、tmp 之类的
|
||||
$ git checkout -b branch-name
|
||||
|
||||
# 开发完成后跑下测试是否通过,必要时需要新增或修改测试用例
|
||||
$ npm test
|
||||
|
||||
# 测试通过后,提交代码,message 见下面的规范
|
||||
|
||||
$ git add . # git add -u 删除文件
|
||||
$ git commit -m "fix(role): role.use must xxx"
|
||||
$ git push origin branch-name
|
||||
```
|
||||
|
||||
提交后就可以在 [g6](https://github.com/antvis/g6/pulls) 创建 Pull Request 了。
|
||||
|
||||
由于谁也无法保证过了多久之后还记得多少,为了后期回溯历史的方便,请在提交 MR 时确保提供了以下信息。
|
||||
|
||||
1. 需求点(一般关联 issue 或者注释都算)
|
||||
2. 升级原因(不同于 issue,可以简要描述下为什么要处理)
|
||||
3. 框架测试点(可以关联到测试文件,不用详细描述,关键点即可)
|
||||
4. 关注点(针对用户而言,可以没有,一般是不兼容更新等,需要额外提示)
|
||||
|
||||
### 代码风格
|
||||
|
||||
你的代码风格必须通过 eslint,你可以运行 `$ npm run lint` 本地测试。
|
||||
|
||||
### Commit 提交规范
|
||||
|
||||
根据 [angular 规范](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format)提交 commit,这样 history 看起来更加清晰,还可以自动生成 changelog。
|
||||
|
||||
```xml
|
||||
<type>(<scope>): <subject>
|
||||
<BLANK LINE>
|
||||
<body>
|
||||
<BLANK LINE>
|
||||
<footer>
|
||||
```
|
||||
|
||||
(1)type
|
||||
|
||||
提交 commit 的类型,包括以下几种
|
||||
|
||||
- feat: 新功能
|
||||
- fix: 修复问题
|
||||
- docs: 修改文档
|
||||
- style: 修改代码格式,不影响代码逻辑
|
||||
- refactor: 重构代码,理论上不影响现有功能
|
||||
- perf: 提升性能
|
||||
- test: 增加修改测试用例
|
||||
- chore: 修改工具相关(包括但不限于文档、代码生成等)
|
||||
- deps: 升级依赖
|
||||
|
||||
(2)scope
|
||||
|
||||
修改文件的范围
|
||||
|
||||
(3)subject
|
||||
|
||||
用一句话清楚的描述这次提交做了什么
|
||||
|
||||
(4)body
|
||||
|
||||
补充 subject,适当增加原因、目的等相关因素,也可不写。
|
||||
|
||||
(5)footer
|
||||
|
||||
- **当有非兼容修改(Breaking Change)时必须在这里描述清楚**
|
||||
- 关联相关 issue,如 `Closes #1, Closes #2, #3`
|
||||
|
||||
示例
|
||||
|
||||
```
|
||||
fix($compile): [BREAKING_CHANGE] couple of unit tests for IE9
|
||||
|
||||
Older IEs serialize html uppercased, but IE9 does not...
|
||||
Would be better to expect case insensitive, unfortunately jasmine does
|
||||
not allow to user regexps for throw expectations.
|
||||
|
||||
Document change on antvis/g6#12
|
||||
|
||||
Closes #392
|
||||
|
||||
BREAKING CHANGE:
|
||||
|
||||
Breaks foo.bar api, foo.baz should be used instead
|
||||
```
|
||||
|
||||
查看具体[文档](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit)
|
||||
|
||||
## 发布管理
|
||||
|
||||
g6 基于 [semver] 语义化版本号进行发布。
|
||||
|
||||
`master` 分支为当前稳定发布的版本。
|
||||
|
||||
- 直接从 `master` 切出开发分支
|
||||
- 所有 API 的废弃都需要在当前的稳定版本上 `deprecate` 提示,并保证在当前的稳定版本上一直兼容到新版本的发布。
|
||||
|
||||
### 发布策略
|
||||
|
||||
每个大版本都有一个发布经理管理(PM),他/她要做的事情
|
||||
|
||||
#### 准备工作:
|
||||
|
||||
- 建立 milestone,确认需求关联 milestone,指派和更新 issues。
|
||||
|
||||
#### 发布前:
|
||||
|
||||
- 确认当前 Milestone 所有的 issue 都已关闭或可延期,完成性能测试。
|
||||
- 发起一个新的 [Release Proposal MR],按照 [node CHANGELOG] 进行 `History` 的编写,修正文档中与版本相关的内容,commits 可以自动生成。
|
||||
```bash
|
||||
$ npm run commits
|
||||
```
|
||||
- 指定下一个大版本的 PM。
|
||||
|
||||
#### 发布时:
|
||||
|
||||
- 将老的稳定版本(master)备份到以当前大版本为名字的分支上(例如 `1.x`),并设置 tag 为 {v}.x`( v 为当前版本,例如`1.x`)。
|
||||
- 发布新的稳定版本到 [npm],并通知上层框架进行更新。
|
||||
- `npm publish` 之前,请先阅读[『我是如何发布一个 npm 包的』]。
|
||||
|
||||
[semver]: http://semver.org/lang/zh-CN/
|
||||
[release proposal mr]: https://github.com/nodejs/node/pull/4181
|
||||
[node changelog]: https://github.com/nodejs/node/blob/master/CHANGELOG.md
|
||||
[npm]: http://npmjs.com/
|
||||
[『我是如何发布一个 npm 包的』]: https://fengmk2.com/blog/2016/how-i-publish-a-npm-package
|
156
packages/g6/README-zh_CN.md
Normal file
156
packages/g6/README-zh_CN.md
Normal file
@ -0,0 +1,156 @@
|
||||
![](https://user-images.githubusercontent.com/6113694/45008751-ea465300-b036-11e8-8e2a-166cbb338ce2.png)
|
||||
|
||||
[![travis-ci](https://img.shields.io/travis/antvis/g6.svg)](https://travis-ci.org/antvis/g6) [![codecov](https://codecov.io/gh/antvis/G6/branch/master/graph/badge.svg)](https://codecov.io/gh/antvis/G6) ![typescript](https://img.shields.io/badge/language-typescript-red.svg) ![MIT](https://img.shields.io/badge/license-MIT-000000.svg) [![npm package](https://img.shields.io/npm/v/@antv/g6.svg)](https://www.npmjs.com/package/@antv/g6) [![NPM downloads](http://img.shields.io/npm/dm/@antv/g6.svg)](https://npmjs.org/package/@antv/g6) [![Percentage of issues still open](http://isitmaintained.com/badge/open/antvis/g6.svg)](http://isitmaintained.com/project/antvis/g6 'Percentage of issues still open')
|
||||
|
||||
[English README](README.md)
|
||||
|
||||
## 什么是 G6
|
||||
|
||||
[G6](https://github.com/antvis/g6) 是一个图可视化引擎。它提供了图的绘制、布局、分析、交互、动画等图可视化的基础能力。旨在让关系变得透明,简单。让用户获得关系数据的 Insight。
|
||||
|
||||
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*zTjwQaXokeQAAAAAAAAAAABkARQnAQ' width=550 />
|
||||
|
||||
基于 G6,用户可以快速搭建自己的 **图分析** 或 **图编辑** 应用。
|
||||
|
||||
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*zau8QJcVpDQAAAAAAAAAAABkARQnAQ' height=200 /><img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RIlETY_S6IoAAAAAAAAAAABkARQnAQ' height=200 />
|
||||
|
||||
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*cDzXR4jIWr8AAAAAAAAAAABkARQnAQ' height=150 /><img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*DifbSahOblAAAAAAAAAAAABkARQnAQ' height=150 /><img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*HTasSJGC4koAAAAAAAAAAABkARQnAQ' height=150 />
|
||||
|
||||
> 强大的动画及交互
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/6113694/44995293-02858600-afd5-11e8-840c-349e4730d63d.gif" height=150><img src="https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*I9OdTbXJIi0AAAAAAAAAAABkARQnAQ" height=150><img src="https://user-images.githubusercontent.com/6113694/44995332-2ba61680-afd5-11e8-8cab-db0e9d08ceb7.gif" height=150>
|
||||
|
||||
<img src="https://gw.alipayobjects.com/zos/rmsportal/HQxYguinFOMIXrGQOABY.gif" height=150><img src="https://gw.alipayobjects.com/zos/rmsportal/nAugyFgrbrUWPmDIDiQm.gif" height=150><img src="https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*xoufSYcjK2AAAAAAAAAAAABkARQnAQ" height=150>
|
||||
|
||||
> 强大的布局
|
||||
|
||||
## G6 的特性
|
||||
|
||||
G6 作为一款专业的图可视化引擎,具有以下特性:
|
||||
|
||||
- 丰富的元素:内置丰富的节点与边元素,自由配置,支持自定义;
|
||||
- 可控的交互:内置 10+ 交互行为,支持自定义交互;
|
||||
- 强大的布局:内置了 10+ 常用的图布局,支持自定义布局;
|
||||
- 便捷的组件:优化内置组件功能及性能;
|
||||
- 友好的体验:根据用户需求分层梳理文档,支持 TypeScript 类型推断。
|
||||
|
||||
除了默认好用、配置自由的内置功能,元素、交互、布局均具有高可扩展的自定义机制。
|
||||
|
||||
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*Y0c6S7cxjVkAAAAAAAAAAABkARQnAQ' width=800 height=200 />
|
||||
|
||||
> 丰富的图元素
|
||||
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
$ npm install @antv/g6
|
||||
```
|
||||
|
||||
## 使用
|
||||
|
||||
<img src="https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*khbvSrptr0kAAAAAAAAAAABkARQnAQ" width=437 height=148 />
|
||||
|
||||
```js
|
||||
import G6 from '@antv/g6';
|
||||
|
||||
const data = {
|
||||
nodes: [
|
||||
{
|
||||
id: 'node1',
|
||||
label: 'Circle1',
|
||||
x: 150,
|
||||
y: 150,
|
||||
},
|
||||
{
|
||||
id: 'node2',
|
||||
label: 'Circle2',
|
||||
x: 400,
|
||||
y: 150,
|
||||
},
|
||||
],
|
||||
edges: [
|
||||
{
|
||||
source: 'node1',
|
||||
target: 'node2',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const graph = new G6.Graph({
|
||||
container: 'container',
|
||||
width: 500,
|
||||
height: 500,
|
||||
defaultNode: {
|
||||
type: 'circle',
|
||||
size: [100],
|
||||
color: '#5B8FF9',
|
||||
style: {
|
||||
fill: '#9EC9FF',
|
||||
lineWidth: 3,
|
||||
},
|
||||
labelCfg: {
|
||||
style: {
|
||||
fill: '#fff',
|
||||
fontSize: 20,
|
||||
},
|
||||
},
|
||||
},
|
||||
defaultEdge: {
|
||||
style: {
|
||||
stroke: '#e2e2e2',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
graph.data(data);
|
||||
graph.render();
|
||||
```
|
||||
|
||||
[![Edit compassionate-lalande-5lxm7](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/compassionate-lalande-5lxm7?fontsize=14&hidenavigation=1&theme=dark)
|
||||
|
||||
更多关于 G6 使用的问题,请参考[快速上手](https://antv-g6.gitee.io/zh/docs/manual/getting-started)。
|
||||
|
||||
## 开发
|
||||
|
||||
```bash
|
||||
$ npm install
|
||||
|
||||
# run test case
|
||||
$ npm test
|
||||
|
||||
# run test case in watch mode
|
||||
npm test -- --watch ./tests/unit/algorithm/find-path-spec
|
||||
DEBUG_MODE=1 npm test -- --watch ./tests/unit/algorithm/find-path-spec
|
||||
|
||||
# build watching file changes and run demos
|
||||
$ npm run demos
|
||||
```
|
||||
|
||||
## 文档
|
||||
|
||||
- <a href='https://g6.antv.vision/zh/docs/manual/tutorial/preface' target='_blank'>入门教程</a>
|
||||
- <a href='https://g6.antv.vision/zh/docs/manual/middle/overview' target='_blank'>核心概念</a>
|
||||
- <a href='https://g6.antv.vision/zh/docs/manual/advanced/coordinate-system' target='_blank'>扩展阅读</a>
|
||||
- <a href='https://g6.antv.vision/zh/docs/api/Graph' target='_blank'>API</a>
|
||||
|
||||
## G6 图可视化交流群
|
||||
|
||||
欢迎各界 G6 使用者、图可视化爱好者加入 **G6 图可视化交流群** 及 **G6 图可视化交流二群**(钉钉群,使用钉钉扫一扫加入)讨论与交流。
|
||||
|
||||
> **G6 图可视化交流群** 已满员,该群会不定期移除不活跃的成员。
|
||||
|
||||
> 由于值班同学的时间和精力有限,**G6 图可视化交流二群** 中的问题我们会不定期回复。欢迎对 G6 感兴趣的同学加入到答疑中来,非常感谢!交流群-1 已满,请加交流群-2。
|
||||
|
||||
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*LFppR6_BfdYAAAAAAAAAAABkARQnAQ' width=400 alt="">
|
||||
|
||||
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*hzfaSrAj0jkAAAAAAAAAAABkARQnAQ' width=400 alt="">
|
||||
|
||||
## 如何贡献
|
||||
|
||||
请让我们知道您要解决或贡献什么,所以在贡献之前请先提交 [issues](https://github.com/antvis/g6/issues) 描述 bug 或建议。
|
||||
|
||||
成为一个贡献者前请阅读 [代码贡献规范](https://github.com/antvis/g6/blob/master/CONTRIBUTING.zh-CN.md).
|
||||
|
||||
## License
|
||||
|
||||
[MIT license](./LICENSE).
|
152
packages/g6/README.md
Normal file
152
packages/g6/README.md
Normal file
@ -0,0 +1,152 @@
|
||||
# G6: A Graph Visualization Framework in TypeScript.
|
||||
|
||||
![](https://user-images.githubusercontent.com/6113694/45008751-ea465300-b036-11e8-8e2a-166cbb338ce2.png)
|
||||
|
||||
[![travis-ci](https://img.shields.io/travis/antvis/g6/master.svg)](https://travis-ci.org/antvis/g6) [![codecov](https://codecov.io/gh/antvis/G6/branch/master/graph/badge.svg)](https://codecov.io/gh/antvis/G6) ![typescript](https://img.shields.io/badge/language-typescript-red.svg) ![MIT](https://img.shields.io/badge/license-MIT-000000.svg) [![npm package](https://img.shields.io/npm/v/@antv/g6.svg)](https://www.npmjs.com/package/@antv/g6) [![NPM downloads](http://img.shields.io/npm/dm/@antv/g6.svg)](https://npmjs.org/package/@antv/g6) [![Percentage of issues still open](http://isitmaintained.com/badge/open/antvis/g6.svg)](http://isitmaintained.com/project/antvis/g6 'Percentage of issues still open')
|
||||
|
||||
[中文 README](README-zh_CN.md)
|
||||
|
||||
## What is G6
|
||||
|
||||
[G6](https://github.com/antvis/g6) is a graph visualization engine, which provides a set of basic mechanisms, including rendering, layout, analysis, interaction, animation, and other auxiliary tools. G6 aims to simplify the relationships, and help people to obtain the insight of relational data.
|
||||
|
||||
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*zTjwQaXokeQAAAAAAAAAAABkARQnAQ' width=550 />
|
||||
|
||||
Developers are able to build graph visualization **analysis** applications or graph visualization **modeling** applications easily.
|
||||
|
||||
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*zau8QJcVpDQAAAAAAAAAAABkARQnAQ' height=200 /><img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RIlETY_S6IoAAAAAAAAAAABkARQnAQ' height=200 />
|
||||
|
||||
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*cDzXR4jIWr8AAAAAAAAAAABkARQnAQ' height=150 /><img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*DifbSahOblAAAAAAAAAAAABkARQnAQ' height=150 /><img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*HTasSJGC4koAAAAAAAAAAABkARQnAQ' height=150 />
|
||||
|
||||
> Powerful Animation and Interactions
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/6113694/44995293-02858600-afd5-11e8-840c-349e4730d63d.gif" height=150><img src="https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*I9OdTbXJIi0AAAAAAAAAAABkARQnAQ" height=150><img src="https://user-images.githubusercontent.com/6113694/44995332-2ba61680-afd5-11e8-8cab-db0e9d08ceb7.gif" height=150>
|
||||
|
||||
<img src="https://gw.alipayobjects.com/zos/rmsportal/HQxYguinFOMIXrGQOABY.gif" height=150><img src="https://gw.alipayobjects.com/zos/rmsportal/nAugyFgrbrUWPmDIDiQm.gif" height=150><img src="https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*xoufSYcjK2AAAAAAAAAAAABkARQnAQ" height=150>
|
||||
|
||||
> Powerful Layouts
|
||||
|
||||
## Features
|
||||
|
||||
- Abundant Built-in Items: Nodes and edges with free configurations;
|
||||
- Steerable Interactions: More than 10 basic interaction behaviors ;
|
||||
- Powerful Layout: More than 10 layout algorithms;
|
||||
- Convenient Components: Outstanding ability and performance;
|
||||
- Friendly User Experience: Complete documents for different levels of user requirements. TypeScript supported.
|
||||
|
||||
G6 concentrates on the principle of 'good by default'. In addition, the custom mechanism of the item, interation behavior, and layout satisfies the customazation requirements.
|
||||
|
||||
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*Y0c6S7cxjVkAAAAAAAAAAABkARQnAQ' width=800 height=200 />
|
||||
|
||||
> Abundant Built-in Items
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
$ npm install @antv/g6
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
<img src="https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*khbvSrptr0kAAAAAAAAAAABkARQnAQ" width=437 height=148 />
|
||||
|
||||
```js
|
||||
import G6 from '@antv/g6';
|
||||
|
||||
const data = {
|
||||
nodes: [
|
||||
{
|
||||
id: 'node1',
|
||||
label: 'Circle1',
|
||||
x: 150,
|
||||
y: 150,
|
||||
},
|
||||
{
|
||||
id: 'node2',
|
||||
label: 'Circle2',
|
||||
x: 400,
|
||||
y: 150,
|
||||
},
|
||||
],
|
||||
edges: [
|
||||
{
|
||||
source: 'node1',
|
||||
target: 'node2',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const graph = new G6.Graph({
|
||||
container: 'container',
|
||||
width: 500,
|
||||
height: 500,
|
||||
defaultNode: {
|
||||
type: 'circle',
|
||||
size: [100],
|
||||
color: '#5B8FF9',
|
||||
style: {
|
||||
fill: '#9EC9FF',
|
||||
lineWidth: 3,
|
||||
},
|
||||
labelCfg: {
|
||||
style: {
|
||||
fill: '#fff',
|
||||
fontSize: 20,
|
||||
},
|
||||
},
|
||||
},
|
||||
defaultEdge: {
|
||||
style: {
|
||||
stroke: '#e2e2e2',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
graph.data(data);
|
||||
graph.render();
|
||||
```
|
||||
|
||||
[![Edit compassionate-lalande-5lxm7](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/compassionate-lalande-5lxm7?fontsize=14&hidenavigation=1&theme=dark)
|
||||
|
||||
For more information of the usage, please refer to [Getting Started](https://antv-g6.gitee.io/en/docs/manual/getting-started).
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
$ npm install
|
||||
|
||||
# run test case
|
||||
$ npm test
|
||||
|
||||
# run test case in watch mode
|
||||
npm test -- --watch ./tests/unit/algorithm/find-path-spec
|
||||
DEBUG_MODE=1 npm test -- --watch ./tests/unit/algorithm/find-path-spec
|
||||
|
||||
# build watching file changes and run demos
|
||||
$ npm run demos
|
||||
```
|
||||
|
||||
## Documents
|
||||
|
||||
- <a href='https://g6.antv.vision/en/docs/manual/tutorial/preface' target='_blank'>Tutorial</a>
|
||||
- <a href='https://g6.antv.vision/en/docs/manual/middle/overview' target='_blank'>Middle Guides</a>
|
||||
- <a href='https://g6.antv.vision/en/docs/manual/advanced/coordinate-system' target='_blank'>Further Reading</a>
|
||||
- <a href='https://g6.antv.vision/en/docs/api/Graph' target='_blank'>API Reference</a>
|
||||
|
||||
## G6 Communication Group
|
||||
|
||||
Users are welcome to join the **G6 Communication Group** or **G6 Communication Group-2** (They are DingTalk groups). We also welcome the github issues. The Group is full, join Group-2 instead.
|
||||
|
||||
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*LFppR6_BfdYAAAAAAAAAAABkARQnAQ' width=400 alt="">
|
||||
|
||||
<img src='https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*hzfaSrAj0jkAAAAAAAAAAABkARQnAQ' width=400 alt="">
|
||||
|
||||
## How to Contribute
|
||||
|
||||
Please let us know what you are you going to help. Do check out [issues](https://github.com/antvis/g6/issues) for bug reports or suggestions first.
|
||||
|
||||
To become a contributor, please follow our [contributing guide](https://github.com/antvis/g6/blob/master/CONTRIBUTING.md).
|
||||
|
||||
## License
|
||||
|
||||
[MIT license](./LICENSE).
|
93
packages/g6/package.json
Normal file
93
packages/g6/package.json
Normal file
@ -0,0 +1,93 @@
|
||||
{
|
||||
"name": "@antv/g6",
|
||||
"version": "4.0.4-beta.0",
|
||||
"description": "A Graph Visualization Framework in JavaScript",
|
||||
"keywords": [
|
||||
"antv",
|
||||
"g6",
|
||||
"graph",
|
||||
"graph analysis",
|
||||
"graph editor",
|
||||
"graph visualization",
|
||||
"relational data"
|
||||
],
|
||||
"homepage": "https://g6.antv.vision",
|
||||
"bugs": {
|
||||
"url": "https://github.com/antvis/g6/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/antvis/g6"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "https://github.com/orgs/antvis/people",
|
||||
"files": [
|
||||
"package.json",
|
||||
"es",
|
||||
"lib",
|
||||
"dist",
|
||||
"LICENSE",
|
||||
"README.md"
|
||||
],
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"browser": "dist/g6.min.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"scripts": {
|
||||
"start": "father build --watch",
|
||||
"build": "npm run clean && father build && npm run build:umd",
|
||||
"build:umd": "webpack --config webpack.config.js --mode production",
|
||||
"ci": "npm run build && npm run coverage",
|
||||
"clean": "rimraf es esm lib dist",
|
||||
"coverage": "jest --coverage",
|
||||
"demos": "start-storybook -p 8080 -c .storybook",
|
||||
"doc": "rimraf apis && typedoc",
|
||||
"lint": "eslint --ext .js,.jsx,.ts,.tsx --format=pretty \"./\"",
|
||||
"lint:src": "eslint --ext .ts --format=pretty \"./src\"",
|
||||
"prettier": "prettier -c --write \"**/*\"",
|
||||
"test": "jest",
|
||||
"test-live": "DEBUG_MODE=1 jest --watch ./tests/unit/graph/graph-watermarker-spec.ts",
|
||||
"lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx",
|
||||
"watch": "father build -w",
|
||||
"cdn": "antv-bin upload -n @antv/g6"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"**/*.{js,jsx,ts,tsx}": [
|
||||
"npm run lint-staged:js",
|
||||
"prettier --write"
|
||||
],
|
||||
"**/*.{less,md,json}": [
|
||||
"prettier --write"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@antv/g6-pc": "*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.7.7",
|
||||
"@babel/plugin-proposal-class-properties": "^7.1.0",
|
||||
"@turf/turf": "^5.1.6",
|
||||
"@types/jest": "^25.2.1",
|
||||
"@types/node": "13.11.1",
|
||||
"@typescript-eslint/eslint-plugin": "^3.9.0",
|
||||
"@umijs/fabric": "^2.0.0",
|
||||
"babel-loader": "^8.0.6",
|
||||
"eslint": "^7.7.0",
|
||||
"event-simulate": "~1.0.0",
|
||||
"father": "^2.29.1",
|
||||
"husky": "^4.2.5",
|
||||
"lint-staged": "^10.2.11",
|
||||
"pre-commit": "^1.2.2",
|
||||
"prettier": "^2.0.5",
|
||||
"rimraf": "^3.0.0",
|
||||
"ts-loader": "^7.0.3",
|
||||
"typescript": "^3.5.3",
|
||||
"webpack": "^4.41.4",
|
||||
"webpack-cli": "^3.3.10"
|
||||
}
|
||||
}
|
3
packages/g6/src/index.ts
Normal file
3
packages/g6/src/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import G6 from '@antv/g6-pc';
|
||||
export * from '@antv/g6-pc';
|
||||
export default G6;
|
18
packages/g6/tsconfig.json
Normal file
18
packages/g6/tsconfig.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"rootDir": "./",
|
||||
"module": "esnext",
|
||||
"declaration": true,
|
||||
"sourceMap": true,
|
||||
"target": "es5",
|
||||
"outDir": "lib",
|
||||
"jsx": "react",
|
||||
"importHelpers": true,
|
||||
"moduleResolution": "node",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"lib": ["esnext", "dom"]
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
60
packages/g6/webpack.config.js
Normal file
60
packages/g6/webpack.config.js
Normal file
@ -0,0 +1,60 @@
|
||||
const webpack = require('webpack');
|
||||
// eslint-disable-next-line prefer-destructuring
|
||||
const resolve = require('path').resolve;
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
g6: './src/index.ts',
|
||||
},
|
||||
output: {
|
||||
filename: '[name].min.js',
|
||||
library: 'G6',
|
||||
libraryTarget: 'umd',
|
||||
libraryExport: 'default',
|
||||
path: resolve(process.cwd(), 'dist/'),
|
||||
globalObject: 'this',
|
||||
},
|
||||
resolve: {
|
||||
// Add `.ts` as a resolvable extension.
|
||||
extensions: ['.ts', '.js'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.worker\.ts$/,
|
||||
exclude: /(node_modules)/,
|
||||
use: [
|
||||
{
|
||||
loader: 'worker-loader',
|
||||
options: {
|
||||
inline: 'fallback',
|
||||
filename: 'g6Layout.worker.js',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
include: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
// babelrc: true,
|
||||
presets: ['@babel/preset-env'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.ts$/,
|
||||
use: {
|
||||
loader: 'ts-loader',
|
||||
options: {
|
||||
transpileOnly: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [new webpack.NoEmitOnErrorsPlugin(), new webpack.optimize.AggressiveMergingPlugin()],
|
||||
devtool: 'source-map',
|
||||
};
|
13
packages/g6/webpack.dev.config.js
Normal file
13
packages/g6/webpack.dev.config.js
Normal file
@ -0,0 +1,13 @@
|
||||
const webpackConfig = require('./webpack.config');
|
||||
|
||||
module.exports = Object.assign(
|
||||
{
|
||||
devtool: 'cheap-source-map',
|
||||
watch: true,
|
||||
watchOptions: {
|
||||
aggregateTimeout: 300,
|
||||
poll: 1000,
|
||||
},
|
||||
},
|
||||
webpackConfig,
|
||||
);
|
Loading…
Reference in New Issue
Block a user