@@ -228,7 +228,7 @@ func TestPieRender(t *testing.T) {
228228 require .NoError (t , err )
229229 data , err := p .Bytes ()
230230 require .NoError (t , err )
231- assertEqualSVG (t , "<svg xmlns=\" http://www.w3.org/2000/svg\" xmlns:xlink=\" http://www.w3.org/1999/xlink\" viewBox=\" 0 0 600 400\" ><path d=\" M 0 0\n L 600 0\n L 600 400\n L 0 400\n L 0 0\" style=\" stroke:none;fill:white\" /><path d=\" M 20 29\n L 50 29\" style=\" stroke-width:3;stroke:rgb(84,112,198);fill:none\" /><circle cx=\" 35\" cy=\" 29\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(84,112,198);fill:rgb(84,112,198)\" /><text x=\" 52\" y=\" 35\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Search Engine</text><path d=\" M 20 49\n L 50 49\" style=\" stroke-width:3;stroke:rgb(145,204,117);fill:none\" /><circle cx=\" 35\" cy=\" 49\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(145,204,117);fill:rgb(145,204,117)\" /><text x=\" 52\" y=\" 55\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Direct</text><path d=\" M 20 69\n L 50 69\" style=\" stroke-width:3;stroke:rgb(250,200,88);fill:none\" /><circle cx=\" 35\" cy=\" 69\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(250,200,88);fill:rgb(250,200,88)\" /><text x=\" 52\" y=\" 75\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Email</text><path d=\" M 20 89\n L 50 89\" style=\" stroke-width:3;stroke:rgb(238,102,102);fill:none\" /><circle cx=\" 35\" cy=\" 89\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(238,102,102);fill:rgb(238,102,102)\" /><text x=\" 52\" y=\" 95\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Union Ads</text><path d=\" M 20 109\n L 50 109\" style=\" stroke-width:3;stroke:rgb(115,192,222);fill:none\" /><circle cx=\" 35\" cy=\" 109\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(115,192,222);fill:rgb(115,192,222)\" /><text x=\" 52\" y=\" 115\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Video Ads</text><text x=\" 222\" y=\" 35\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Rainfall vs Evaporation</text><text x=\" 266\" y=\" 50\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Fake Data</text><path d=\" M 300 207\n L 300 93\n A 114 114 119.89 0 1 398 263\n L 300 207\n Z\" style=\" stroke-width:1;stroke:rgb(84,112,198);fill:rgb(84,112,198)\" /><path d=\" M 398 150\n L 411 143\n M 411 143\n L 426 143\" style=\" stroke-width:1;stroke:rgb(84,112,198);fill:none\" /><text x=\" 429\" y=\" 148\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >Search Engine: 33.3%</text><path d=\" M 300 207\n L 398 263\n A 114 114 84.08 0 1 254 311\n L 300 207\n Z\" style=\" stroke-width:1;stroke:rgb(145,204,117);fill:rgb(145,204,117)\" /><path d=\" M 335 315\n L 340 329\n M 340 329\n L 355 329\" style=\" stroke-width:1;stroke:rgb(145,204,117);fill:none\" /><text x=\" 358\" y=\" 334\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >Direct: 23.35%</text><path d=\" M 300 207\n L 254 311\n A 114 114 66.35 0 1 187 207\n L 300 207\n Z\" style=\" stroke-width:1;stroke:rgb(250,200,88);fill:rgb(250,200,88)\" /><path d=\" M 205 268\n L 192 276\n M 192 276\n L 177 276\" style=\" stroke-width:1;stroke:rgb(250,200,88);fill:none\" /><text x=\" 93\" y=\" 281\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >Email: 18.43%</text><path d=\" M 300 207\n L 187 207\n A 114 114 55.37 0 1 236 113\n L 300 207\n Z\" style=\" stroke-width:1;stroke:rgb(238,102,102);fill:rgb(238,102,102)\" /><path d=\" M 200 154\n L 187 147\n M 187 147\n L 172 147\" style=\" stroke-width:1;stroke:rgb(238,102,102);fill:none\" /><text x=\" 61\" y=\" 152\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >Union Ads: 15.37%</text><path d=\" M 300 207\n L 236 113\n A 114 114 34.32 0 1 300 93\n L 300 207\n Z\" style=\" stroke-width:1;stroke:rgb(115,192,222);fill:rgb(115,192,222)\" /><path d=\" M 267 99\n L 262 84\n M 262 84\n L 247 84\" style=\" stroke-width:1;stroke:rgb(115,192,222);fill:none\" /><text x=\" 144\" y=\" 89\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >Video Ads: 9.53%</text></svg>" , data )
231+ assertEqualSVG (t , "<svg xmlns=\" http://www.w3.org/2000/svg\" xmlns:xlink=\" http://www.w3.org/1999/xlink\" viewBox=\" 0 0 600 400\" ><path d=\" M 0 0\n L 600 0\n L 600 400\n L 0 400\n L 0 0\" style=\" stroke:none;fill:white\" /><path d=\" M 20 29\n L 50 29\" style=\" stroke-width:3;stroke:rgb(84,112,198);fill:none\" /><circle cx=\" 35\" cy=\" 29\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(84,112,198);fill:rgb(84,112,198)\" /><text x=\" 52\" y=\" 35\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Search Engine</text><path d=\" M 20 49\n L 50 49\" style=\" stroke-width:3;stroke:rgb(145,204,117);fill:none\" /><circle cx=\" 35\" cy=\" 49\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(145,204,117);fill:rgb(145,204,117)\" /><text x=\" 52\" y=\" 55\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Direct</text><path d=\" M 20 69\n L 50 69\" style=\" stroke-width:3;stroke:rgb(250,200,88);fill:none\" /><circle cx=\" 35\" cy=\" 69\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(250,200,88);fill:rgb(250,200,88)\" /><text x=\" 52\" y=\" 75\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Email</text><path d=\" M 20 89\n L 50 89\" style=\" stroke-width:3;stroke:rgb(238,102,102);fill:none\" /><circle cx=\" 35\" cy=\" 89\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(238,102,102);fill:rgb(238,102,102)\" /><text x=\" 52\" y=\" 95\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Union Ads</text><path d=\" M 20 109\n L 50 109\" style=\" stroke-width:3;stroke:rgb(115,192,222);fill:none\" /><circle cx=\" 35\" cy=\" 109\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(115,192,222);fill:rgb(115,192,222)\" /><text x=\" 52\" y=\" 115\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Video Ads</text><text x=\" 222\" y=\" 35\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Rainfall vs Evaporation</text><text x=\" 266\" y=\" 50\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Fake Data</text><path d=\" M 300 207\n L 300 93\n A 114 114 119.89 0 1 398 263\n L 300 207\n Z\" style=\" stroke-width:1;stroke:rgb(84,112,198);fill:rgb(84,112,198)\" /><path d=\" M 398 150\n L 411 143\n M 411 143\n L 426 143\" style=\" stroke-width:1;stroke:rgb(84,112,198);fill:none\" /><text x=\" 429\" y=\" 148\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >: 33.3%</text><path d=\" M 300 207\n L 398 263\n A 114 114 84.08 0 1 254 311\n L 300 207\n Z\" style=\" stroke-width:1;stroke:rgb(145,204,117);fill:rgb(145,204,117)\" /><path d=\" M 335 315\n L 340 329\n M 340 329\n L 355 329\" style=\" stroke-width:1;stroke:rgb(145,204,117);fill:none\" /><text x=\" 358\" y=\" 334\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >: 23.35%</text><path d=\" M 300 207\n L 254 311\n A 114 114 66.35 0 1 187 207\n L 300 207\n Z\" style=\" stroke-width:1;stroke:rgb(250,200,88);fill:rgb(250,200,88)\" /><path d=\" M 205 268\n L 192 276\n M 192 276\n L 177 276\" style=\" stroke-width:1;stroke:rgb(250,200,88);fill:none\" /><text x=\" 125\" y=\" 281\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >: 18.43%</text><path d=\" M 300 207\n L 187 207\n A 114 114 55.37 0 1 236 113\n L 300 207\n Z\" style=\" stroke-width:1;stroke:rgb(238,102,102);fill:rgb(238,102,102)\" /><path d=\" M 200 154\n L 187 147\n M 187 147\n L 172 147\" style=\" stroke-width:1;stroke:rgb(238,102,102);fill:none\" /><text x=\" 120\" y=\" 152\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >: 15.37%</text><path d=\" M 300 207\n L 236 113\n A 114 114 34.32 0 1 300 93\n L 300 207\n Z\" style=\" stroke-width:1;stroke:rgb(115,192,222);fill:rgb(115,192,222)\" /><path d=\" M 267 99\n L 262 84\n M 262 84\n L 247 84\" style=\" stroke-width:1;stroke:rgb(115,192,222);fill:none\" /><text x=\" 202\" y=\" 89\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >: 9.53%</text></svg>" , data )
232232}
233233
234234func TestRadarRender (t * testing.T ) {
@@ -279,7 +279,7 @@ func TestFunnelRender(t *testing.T) {
279279 require .NoError (t , err )
280280 data , err := p .Bytes ()
281281 require .NoError (t , err )
282- assertEqualSVG (t , "<svg xmlns=\" http://www.w3.org/2000/svg\" xmlns:xlink=\" http://www.w3.org/1999/xlink\" viewBox=\" 0 0 600 400\" ><path d=\" M 0 0\n L 600 0\n L 600 400\n L 0 400\n L 0 0\" style=\" stroke:none;fill:white\" /><path d=\" M 87 29\n L 117 29\" style=\" stroke-width:3;stroke:rgb(84,112,198);fill:none\" /><circle cx=\" 102\" cy=\" 29\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(84,112,198);fill:rgb(84,112,198)\" /><text x=\" 119\" y=\" 35\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Show</text><path d=\" M 177 29\n L 207 29\" style=\" stroke-width:3;stroke:rgb(145,204,117);fill:none\" /><circle cx=\" 192\" cy=\" 29\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(145,204,117);fill:rgb(145,204,117)\" /><text x=\" 209\" y=\" 35\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Click</text><path d=\" M 263 29\n L 293 29\" style=\" stroke-width:3;stroke:rgb(250,200,88);fill:none\" /><circle cx=\" 278\" cy=\" 29\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(250,200,88);fill:rgb(250,200,88)\" /><text x=\" 295\" y=\" 35\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Visit</text><path d=\" M 346 29\n L 376 29\" style=\" stroke-width:3;stroke:rgb(238,102,102);fill:none\" /><circle cx=\" 361\" cy=\" 29\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(238,102,102);fill:rgb(238,102,102)\" /><text x=\" 378\" y=\" 35\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Inquiry</text><path d=\" M 445 29\n L 475 29\" style=\" stroke-width:3;stroke:rgb(115,192,222);fill:none\" /><circle cx=\" 460\" cy=\" 29\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(115,192,222);fill:rgb(115,192,222)\" /><text x=\" 477\" y=\" 35\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Order</text><text x=\" 20\" y=\" 35\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Funnel</text><path d=\" M 20 55\n L 580 55\n L 524 112\n L 76 112\n L 20 55\" style=\" stroke:none;fill:rgb(84,112,198)\" /><text x=\" 264\" y=\" 83\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >Show(100%)</text><path d=\" M 76 114\n L 524 114\n L 468 171\n L 132 171\n L 76 114\" style=\" stroke:none;fill:rgb(145,204,117)\" /><text x=\" 269\" y=\" 142\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >Click(80%)</text><path d=\" M 132 173\n L 468 173\n L 412 230\n L 188 230\n L 132 173\" style=\" stroke:none;fill:rgb(250,200,88)\" /><text x=\" 271\" y=\" 201\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >Visit(60%)</text><path d=\" M 188 232\n L 412 232\n L 356 289\n L 244 289\n L 188 232\" style=\" stroke:none;fill:rgb(238,102,102)\" /><text x=\" 264\" y=\" 260\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >Inquiry(40%)</text><path d=\" M 244 291\n L 356 291\n L 300 348\n L 300 348\n L 244 291\" style=\" stroke:none;fill:rgb(115,192,222)\" /><text x=\" 268\" y=\" 319\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >Order(20%)</text></svg>" , data )
282+ assertEqualSVG (t , "<svg xmlns=\" http://www.w3.org/2000/svg\" xmlns:xlink=\" http://www.w3.org/1999/xlink\" viewBox=\" 0 0 600 400\" ><path d=\" M 0 0\n L 600 0\n L 600 400\n L 0 400\n L 0 0\" style=\" stroke:none;fill:white\" /><path d=\" M 87 29\n L 117 29\" style=\" stroke-width:3;stroke:rgb(84,112,198);fill:none\" /><circle cx=\" 102\" cy=\" 29\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(84,112,198);fill:rgb(84,112,198)\" /><text x=\" 119\" y=\" 35\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Show</text><path d=\" M 177 29\n L 207 29\" style=\" stroke-width:3;stroke:rgb(145,204,117);fill:none\" /><circle cx=\" 192\" cy=\" 29\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(145,204,117);fill:rgb(145,204,117)\" /><text x=\" 209\" y=\" 35\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Click</text><path d=\" M 263 29\n L 293 29\" style=\" stroke-width:3;stroke:rgb(250,200,88);fill:none\" /><circle cx=\" 278\" cy=\" 29\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(250,200,88);fill:rgb(250,200,88)\" /><text x=\" 295\" y=\" 35\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Visit</text><path d=\" M 346 29\n L 376 29\" style=\" stroke-width:3;stroke:rgb(238,102,102);fill:none\" /><circle cx=\" 361\" cy=\" 29\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(238,102,102);fill:rgb(238,102,102)\" /><text x=\" 378\" y=\" 35\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Inquiry</text><path d=\" M 445 29\n L 475 29\" style=\" stroke-width:3;stroke:rgb(115,192,222);fill:none\" /><circle cx=\" 460\" cy=\" 29\" r=\" 5\" style=\" stroke-width:3;stroke:rgb(115,192,222);fill:rgb(115,192,222)\" /><text x=\" 477\" y=\" 35\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Order</text><text x=\" 20\" y=\" 35\" style=\" stroke:none;fill:rgb(70,70,70);font-size:15.3px;font-family:'Roboto Medium',sans-serif\" >Funnel</text><path d=\" M 20 55\n L 580 55\n L 524 112\n L 76 112\n L 20 55\" style=\" stroke:none;fill:rgb(84,112,198)\" /><text x=\" 280\" y=\" 83\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >(100%)</text><path d=\" M 76 114\n L 524 114\n L 468 171\n L 132 171\n L 76 114\" style=\" stroke:none;fill:rgb(145,204,117)\" /><text x=\" 284\" y=\" 142\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >(80%)</text><path d=\" M 132 173\n L 468 173\n L 412 230\n L 188 230\n L 132 173\" style=\" stroke:none;fill:rgb(250,200,88)\" /><text x=\" 284\" y=\" 201\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >(60%)</text><path d=\" M 188 232\n L 412 232\n L 356 289\n L 244 289\n L 188 232\" style=\" stroke:none;fill:rgb(238,102,102)\" /><text x=\" 284\" y=\" 260\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >(40%)</text><path d=\" M 244 291\n L 356 291\n L 300 348\n L 300 348\n L 244 291\" style=\" stroke:none;fill:rgb(115,192,222)\" /><text x=\" 284\" y=\" 319\" style=\" stroke:none;fill:rgb(70,70,70);font-size:12.8px;font-family:'Roboto Medium',sans-serif\" >(20%)</text></svg>" , data )
283283}
284284
285285func TestChildRender (t * testing.T ) {
0 commit comments