const {
dia,
shapes,
highlighters,
util
} = joint;
const HotModel = dia.Element.define('HotModel', {
size: {
width: 300,
height: 0
},
z: 1,
data: null,
ports: {
groups: {
top: {
z: 0,
position: {
name: 'line',
args: {
start: {
x: 50,
y: -15
},
end: {
x: 'calc(w)',
y: -15
}
}
},
markup: util.svg `
<line @selector="portLine" x1="0" y1="0" x2="0" y2="30" stroke="black" />
<rect @selector="portBody" magnet="true" x="-5" y="-5" width="10" height="10" stroke="black" fill="white" />
`
}
}
}
});
const HotFlags = {
// RenderView is used to render the adaptive card inside the foreign object
RenderView: '@render-view',
// UpdateView is used to update the size of the foreign object
// and the color of border
UpdateView: '@update-view',
// TransformView is used to position and rotate the view
TransformView: '@transform-view',
// MeasureView is used to measure the view and update
// the size of the model
MeasureView: '@measure-view'
};
const HotModelView = dia.ElementView.extend({
// The root of the element view is the <g> element by default.
tagName: 'g',
// Whenever the model attributes change (the map key is the attribute name),
// the update() method will be called, which will contain all the flags that were reported.
presentationAttributes: {
size: [HotFlags.UpdateView],
position: [HotFlags.TransformView],
angle: [HotFlags.TransformView],
template: [HotFlags.RenderView],
border: [HotFlags.UpdateView],
},
// The initFlag property is a list of flags that will be reported to the paper
// when the element view is initialized.
initFlag: [HotFlags.RenderView, HotFlags.UpdateView, HotFlags.TransformView, HotFlags.MeasureView],
confirmUpdate:...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.