@@ -28,14 +28,45 @@ function placeMark() {
2828
2929}
3030
31+ function setMarker ( ) {
32+ let svg = d3 . select ( "#composition" )
33+
34+ svg . selectAll ( "defs" ) . remove ( "*" ) ;
35+
36+ let def = svg . append ( "defs" )
37+
38+ let marker = def . append ( "marker" )
39+ . attr ( "id" , "arrow" )
40+ . attr ( "refX" , "-0" )
41+ . attr ( "refY" , "3.5" )
42+ . attr ( "markerWidth" , "7" )
43+ . attr ( "markerHeight" , "7" )
44+ . attr ( "orient" , "mid" )
45+
46+
47+ // marker.append("path")
48+ // .attr("d", "M 0 5 L 8 0 L 8 9 z")
49+ // .attr("stroke-width", 3)
50+ // .attr("stroke", "red")
51+ // .attr("fill", "none")
52+
53+ marker . append ( "image" )
54+ . attr ( "xlink:href" , "assets/images/buttons/side.png" )
55+ . attr ( "x" , "0" )
56+ . attr ( "y" , "0" )
57+ . attr ( "width" , "7" )
58+ . attr ( "height" , "7" )
59+ }
60+
61+
3162function addPaletteInfoToCollage ( palette , name ) {
3263
3364 let svg = d3 . select ( "#composition" )
3465
3566 let show = palette . encodings . range . marks [ "mark0" ] . proto . canvas
3667
3768 drawnMarks [ name ] = placeMark ( )
38-
69+ setMarker ( )
3970
4071 svg . append ( "image" )
4172 . attr ( "class" , "collageElement" )
@@ -96,12 +127,17 @@ function addPaletteInfoToCollage(palette, name) {
96127 const cx = ( tFrom . x + tTo . x ) / 2 ;
97128 const curve = 2 ;
98129
130+ console . log ( "?????????????????????????????????????????" ) ;
131+
99132 svg . append ( "path" )
100133 // .attr("d", `M ${tFrom.x} ${tFrom.y} Q ${cx} ${curve} ${tTo.x} ${tTo.y}`)
101134 . attr ( "d" , makeLink ( tFrom . x , tFrom . y , tTo . x , tTo . y ) )
135+ . attr ( "marker-end" , "url(#arrow)" )
102136 . attr ( "stroke-width" , 3 )
103137 . attr ( "stroke" , "red" )
104138 . attr ( "fill" , "none" )
139+
140+
105141 // .attr("stroke", drawnMarks[name].x)
106142
107143 megaPalettes [ name ] . apply = tFrom . name
@@ -159,6 +195,7 @@ function addPaletteInfoToCollage(palette, name) {
159195 . attr ( "stroke-width" , 3 )
160196 . attr ( "stroke" , "red" )
161197 . attr ( "fill" , "none" )
198+ . attr ( "marker-end" , "url(#arrow)" )
162199 // .attr("stroke", drawnMarks[name].x)
163200
164201
@@ -189,7 +226,7 @@ function displayPalette(name) {
189226
190227 const val = parseInt ( document . getElementById ( "strokewidth" ) . value ) ;
191228 stWidth = val
192- console . log ( "dsdsadas" ) ;
229+
193230 }
194231
195232 document . getElementById ( 'strokecolor' ) . onchange = function ( ) {
0 commit comments