File tree Expand file tree Collapse file tree 1 file changed +18
-15
lines changed Expand file tree Collapse file tree 1 file changed +18
-15
lines changed Original file line number Diff line number Diff line change @@ -60,21 +60,24 @@ export const domShapesToJSON = () => {
6060} ;
6161
6262export const domPolylineToJSON = ( ) => {
63- return d3Extended . selectAll ( `[${ dataAttributes . elementType } ="${ ElementType . Polyline } "]` ) . map ( ( polyline ) => {
64- return {
65- id : polyline . attr ( "id" ) ,
66- points : polyline
67- . attr ( "points" )
68- . split ( " " )
69- . map ( ( point ) => {
70- const [ x , y ] = point . split ( "," ) ;
71- return { x : + x , y : + y } ;
72- } ) ,
73- section : polyline . attr ( dataAttributes . section ) ,
74- color : rgbToHex ( polyline . style ( "color" ) ) || polyline . attr ( "color" ) ,
75- stroke : rgbToHex ( polyline . style ( "stroke" ) ) || polyline . attr ( "stroke" )
76- } ;
77- } ) ;
63+ return d3Extended
64+ . selectAll ( `[${ dataAttributes . elementType } ="${ ElementType . Polyline } "]` )
65+ . map ( ( polyline ) => {
66+ return {
67+ id : polyline . attr ( "id" ) ,
68+ points : polyline
69+ . attr ( "points" )
70+ . split ( " " )
71+ . map ( ( point ) => {
72+ const [ x , y ] = point . split ( "," ) ;
73+ return { x : + x , y : + y } ;
74+ } ) ,
75+ section : polyline . attr ( dataAttributes . section ) ,
76+ color : rgbToHex ( polyline . style ( "color" ) ) || polyline . attr ( "color" ) ,
77+ stroke : rgbToHex ( polyline . style ( "stroke" ) ) || polyline . attr ( "stroke" )
78+ } ;
79+ } )
80+ . filter ( ( polyline ) => polyline . points . length > 1 ) ;
7881} ;
7982
8083export const domImagesToJSON = ( ) => {
You can’t perform that action at this time.
0 commit comments