Closed GoogleCodeExporter closed 8 years ago
Same thing with the Label: when I pass this in to connect() then it's ignored
overlays : [
["Label", {
cssClass:"foo",
label : 'foo',
location:0.5,
}]
]
as soon as I use (assign) types. In version 1.4 when I omit this
c.addType('someType')
it works, when I add it then the label is missing.
my registerConnectionTypes (called on my graph instance) doesn't include a
label, but it includes an overlay:
registerConnectionTypes({
"basic": {
paintStyle:{lineWidth:2},
hoverPaintStyle:{ lineWidth:7 },
connector:[ "StateMachine", { curviness:20 } ],
overlays: [
[ "Arrow", {
location: 0.9,
length: 14,
foldback: 0.8
} ]
]
},
it doesn't matter if i call registerConnectionTypes in version 1.4 or not. only
calling addType() makes the difference.
Original comment by fabian.k...@optimaize.com
on 17 Apr 2013 at 6:57
So the workaround that works for me in 1.4 is this:
I register a type using registerConnectionTypes() and it has a label overlay:
["Label", {
id: 'label',
label : 'temporary',
location:0.5,
}]
then, after connect() and addType():
var labelOverlay = c.getOverlay("label");
labelOverlay.setLabel( "myRelationSpecificLabel" );
labelOverlay.addClass( "myRelationSpecificCssClass" );
note that there is no setCssClass(), it's called addClass() (a bit inconsistent
api).
Original comment by fabian.k...@optimaize.com
on 17 Apr 2013 at 7:33
the "huge list of imports" makes development easier and more maintainable.
when you need a single file before a version is released, you can build one,
with the instructions from the wiki:
https://github.com/sporritt/jsPlumb/wiki/Build
addClass is called what it is because that is what it does. it adds a class to
the current classes on the label. it does not "set" the label's class.
Original comment by simon.po...@gmail.com
on 17 Apr 2013 at 10:36
moved to github
https://github.com/sporritt/jsPlumb/issues/28
Original comment by simon.po...@gmail.com
on 30 Apr 2013 at 11:39
Issues have all moved to Github. Google code is no longer in use for jsPlumb.
Original comment by simon.po...@gmail.com
on 10 May 2013 at 11:37
Original issue reported on code.google.com by
fabian.k...@optimaize.com
on 17 Apr 2013 at 4:32