Just change the model and rerender your paper
const graph1 = new joint.dia.Graph();
const graph2 = new joint.dia.Graph();
const paper = new joint.dia.Paper({
el: document.getElementById('paper'),
height: '100%',
width: '100%'
});
function setPapaerModel(paper, model) {
paper.model = model; //set model
paper.render();
}
//Then you can change as you wish
setPaperModel(paper, graph2);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…