mirror of
https://gitee.com/antv/g6.git
synced 2024-12-01 03:08:33 +08:00
feat: render zindex for addItem and changeData.
This commit is contained in:
parent
3798b476c2
commit
ea48e70788
@ -1928,11 +1928,9 @@ export default class Graph extends EventEmitter implements IGraph {
|
||||
const sourceDepth: number = dataDepthMap[edge.source] || 0;
|
||||
const targetDepth: number = dataDepthMap[edge.target] || 0;
|
||||
const depth = Math.max(sourceDepth, targetDepth);
|
||||
console.log(depth, edge.id, edge.source, edge.target, sourceDepth, targetDepth);
|
||||
if (depthMap[depth]) depthMap[depth].push(edge.id);
|
||||
else depthMap[depth] = [ edge.id ];
|
||||
});
|
||||
console.log(depthMap);
|
||||
depthMap.forEach(array => {
|
||||
if (!array || !array.length) return;
|
||||
for (let i = array.length - 1; i >= 0; i--) {
|
||||
|
@ -11,6 +11,10 @@ const CACHE_BBOX = 'bboxCache';
|
||||
const CACHE_CANVAS_BBOX = 'bboxCanvasCache';
|
||||
const CACHE_ANCHOR_POINTS = 'anchorPointsCache';
|
||||
|
||||
const CACHE_BBOX = 'bboxCache';
|
||||
const CACHE_CANVAS_BBOX = 'bboxCanvasCache';
|
||||
const CACHE_ANCHOR_POINTS = 'anchorPointsCache';
|
||||
|
||||
export default class Combo extends Node implements ICombo {
|
||||
public getDefaultCfg() {
|
||||
return {
|
||||
|
@ -237,13 +237,13 @@ const DefaultCombo = () => {
|
||||
graph.on('canvas:click', e => {
|
||||
// graph.setItemState(graph.findById('A'), 'selected', true);
|
||||
// console.log( graph.findAllByState('combo', 'selected'))
|
||||
// const hidedCombos = graph.findAll('combo', combo => {
|
||||
// if (!combo.isVisible()) return true;
|
||||
// return false;
|
||||
// });
|
||||
// hidedCombos.forEach(combo => {
|
||||
// graph.showItem(combo);
|
||||
// })
|
||||
const hidedCombos = graph.findAll('combo', combo => {
|
||||
if (!combo.isVisible()) return true;
|
||||
return false;
|
||||
});
|
||||
hidedCombos.forEach(combo => {
|
||||
graph.showItem(combo);
|
||||
})
|
||||
// console.log(graph.getCombos()[0]);
|
||||
// console.log(graph.getComboChildren(graph.getCombos()[0]));
|
||||
//graph.focusItem(graph.getCombos()[0]);
|
||||
@ -251,7 +251,7 @@ const DefaultCombo = () => {
|
||||
// graph.remove('A');
|
||||
// graph.changeData(data2);
|
||||
// graph.changeData(graph.save());
|
||||
|
||||
|
||||
// graph.render();
|
||||
// graph.addItem('combo', {
|
||||
// id: 'M',
|
||||
|
Loading…
Reference in New Issue
Block a user