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
8fb33d1798
commit
d1feaea737
@ -1936,7 +1936,6 @@ export default class Graph extends EventEmitter implements IGraph {
|
||||
if (depthMap[depth]) depthMap[depth].push(edge.id);
|
||||
else depthMap[depth] = [edge.id];
|
||||
});
|
||||
|
||||
depthMap.forEach(array => {
|
||||
if (!array || !array.length) return;
|
||||
for (let i = array.length - 1; i >= 0; i--) {
|
||||
|
@ -237,21 +237,23 @@ 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]);
|
||||
// graph.remove('B');
|
||||
// graph.remove('A');
|
||||
|
||||
graph.changeData(data2);
|
||||
// graph.changeData(data2);
|
||||
// graph.changeData(graph.save());
|
||||
|
||||
// graph.render();
|
||||
// graph.addItem('combo', {
|
||||
// id: 'M',
|
||||
// parentId: 'B'
|
||||
@ -259,7 +261,7 @@ const DefaultCombo = () => {
|
||||
|
||||
// graph.addItem('node', {
|
||||
// id: 'M',
|
||||
// comboId: 'B'
|
||||
// comboId: 'A'
|
||||
// });
|
||||
|
||||
// graph.updateItem('A', {
|
||||
|
Loading…
Reference in New Issue
Block a user