feat: render zindex for addItem and changeData.

This commit is contained in:
Yanyan-Wang 2020-04-03 10:47:12 +08:00 committed by Yanyan Wang
parent 8fb33d1798
commit d1feaea737
2 changed files with 11 additions and 10 deletions

View File

@ -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--) {

View File

@ -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', {