有没有一种方法可以动态设置纸张的模型(也许,稍后将其更改为另一个层)?
或者JointJS / Rappid仅限于(1个模型:1篇论文)?
基本上,我希望能够在几个模型之间动态切换,并用一张纸画出所有这些开关。
发布于 2021-01-31 19:25:47
只需更改模型并重新呈现您的论文
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);
https://stackoverflow.com/questions/65918903
复制相似问题