copy & paste problem #2827
Unanswered
james-ep01
asked this question in
Q&A
Replies: 2 comments 3 replies
-
Since I am not able to reproduce I assume It's a problem in how you define your shape. Please make sure that the class MyElement extends dia.Element {
initialize(...args) {
super.initialize(...args);
/* ... *.
}
} |
Beta Was this translation helpful? Give feedback.
2 replies
-
I've tried all sorts of ways, but I can't. As expected, it's not easy. I have to experience it myself. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
To copy and paste objects, the properties of attr become strange. Then there is the missing attr. (Not a user-defined function)
What is the problem?
This problem occurs when using export json, so the exported json cannot be called and used as it is.
My Object Internal Code:
markup: [
{ tagName: 'image', selector: 'image' },
{ tagName: 'text', selector: 'label' },
{ tagName: 'text', selector: 'label_line' },
{ tagName: 'text', selector: 'label_load' },
{ tagName: 'text', selector: 'label_ex1' },
{ tagName: 'text', selector: 'label_ex2' },
],
attrs: {
image: {
href: ''
},
root: {
dataTooltip: '', dataTooltipPosition: 'left'
},
label: {
x: 'calc(w/2)', y:'calc(h+20)', fill: '#8f8f8f', text: '' , fontSize: 12,
},
label_line:{
x: 'calc(w/2)', y:50, text:'',fill:'#8f8f8f', fontSize: 11, textAnchor:'middle',
},
label_load:{
x: 'calc(w/2)', y:'calc(h-40)',text: '',fontSize: 11, fill:'#8f8f8f',textAnchor:'middle',
},
label_ex1: {
x: 'calc(w/2)', y:'calc(h / 2+ 30)',text:'', fontSize:12, fill:'blue', textAnchor: 'middle',
},
label_ex2: {
x: 'calc(w/2)', y:'calc(h / 2 + 40)',text:'', fontSize:11, fill:'red', textAnchor: 'middle',
},
},
and i made my object is
var hwb = new MyModel();
hwb.attr('root/dataTooltip', 'My Tooltip');
hwb.attr('label/text', 'lbl 1' );
hwb.attr('label_line/text', 'lbl 2' );
hwb.attr('label_load/text', 'lbl 3' );
hwb.attr('label_ex1/text', 'lbl 4' );
hwb.attr('label_ex2/text', 'lbl 5' );
Copied Object Properties
Properties of pasted objects
The label of the copied object property is changed and pasted from fill:'#8f8f8f' to fill:'#33333'.
And the attr of label_line, label_load, label_ex1, and label_ex2 all disappear except text.
Doesn't the attr function change only that property?
Steps to reproduce
No response
Restrictions & Constraints
No response
Does your question relate to JointJS or JointJS+. Select both if applicable.
JointJS+
Beta Was this translation helpful? Give feedback.
All reactions