sandip
November 2, 2023, 12:51pm
1
I Want to Bind strokeDashArray Property using multiple Scenario like link selected property or Depends on Some Link data Property.
I am try below code but not work:
new go.Binding("strokeDashArray","isSelected",
(sel,shp)=>sel ==true? [0,0]:shp.part.data.edgedetails.linestyletype=="dashed_dotted"?[3, 2]:[0,0]),
walter
November 2, 2023, 1:21pm
2
When you don’t want there to be any dashes, use null as the value of Shape.strokeDashArray , not [0,0].
Shape | GoJS API
sandip
November 3, 2023, 4:32am
3
I am using null value for strokeDashArray but it still not works dash links not generated.
Binding Property I am using:
new go.Binding(“strokeDashArray”,“isSelected”,
(sel,shp)=>sel == true? null: shp.part.data.edgedetails.linestyletype == “dashed_dotted”? [3, 2]: null),
walter
November 3, 2023, 12:28pm
4
Don’t you also have a Binding whose target is “strokeDashArray” and whose source is “edgedetails” with a conversion to get its “linestyletype” property?
sandip
November 6, 2023, 4:08am
5
I want to bind StrokeDashArray Property Based on two Different Properties is there any way for that?
walter
November 6, 2023, 4:40am
6
It’s probably easiest to use the empty string as the source property name – the conversion function will be passed a reference to the whole data object rather than the value of any property.
sandip
November 6, 2023, 5:15am
7
Can u please provide Example Like these.
new go.Binding(“strokeDashArray”,“isSelected”,
(sel,shp)=>sel ==true? [0,0]:shp.part.data.edgedetails.linestyletype==“dashed_dotted”?[3, 2]:[0,0]),
walter
November 6, 2023, 11:28am
8
I don’t know which two properties you wanted the Shape.strokeDashArray to depend on, or how. I’ll guess:
new go.Binding("strokeDashArray", "", data => data.edgedetails.linestyletype == "dashed_dotted" ? data.edgedetails.array : null)
sandip
November 10, 2023, 10:19am
9
Default Shape.strokeDashArray is null.
If data => data.edgedetails.linestyletype == “dashed_dotted” Then I want to set
Shape.strokeDashArray is [3,2] .
IF Property isSelected ==True Then I Want to set Shape.strokeDashArray is null .
walter
November 10, 2023, 5:18pm
10
Your logic is incomplete – there are at least three cases. What do you want for the third case?
new go.Binding("strokeDashArray", "", (d, shp) => {
if (d.edgedetails && d.edgedetails.linestyletype === "dashed_dotted") return [3, 2];
if (shp.part.isSelected) return null;
return null;
})