@@ -5,15 +5,14 @@ import { blueColor, redColor, greenColor, grayColor } from './colors';
55
66export default function ( cloneData ) {
77
8- let { genealogyList, projectName, genealogyInfo, versionCount, uniqueVersionList } = cloneData ;
9-
10- let paddingHeightPerGroup = 40 ;
11- let marginPadding = 80 ;
12- let height = ( genealogyList . length * paddingHeightPerGroup ) + 100 ;
13- let width = document . body . clientWidth - marginPadding ;
8+ let { genealogyList, versionCount, uniqueVersionList } = cloneData ,
9+ paddingHeightPerGroup = 20 ,
10+ height = ( genealogyList . length * paddingHeightPerGroup ) + 100 ,
11+ squareRange = document . body . clientWidth ,
12+ width = squareRange - ( squareRange / 10 ) ;
1413
1514 // if a map exists remove it , could probably handle this better in a future version
16- d3 . selectAll ( 'mainContainer' ) . remove ( )
15+ d3 . selectAll ( '. mainContainer' ) . remove ( ) ;
1716
1817 let mainContainer = d3 . select ( '#root' ) . append ( 'div' )
1918 mainContainer . attr ( 'class' , 'mainContainer' )
@@ -28,6 +27,7 @@ export default function (cloneData) {
2827 . append ( 'h2' )
2928 . style ( "width" , width / versionCount + 'px' )
3029 . text ( ( d ) => d )
30+ . style ( 'font-size' , ( width / versionCount ) * 0.15 + 'px' )
3131
3232 let contentContainer = mainContainer . append ( 'svg' )
3333 . attr ( 'class' , 'contentContainer' )
@@ -38,10 +38,7 @@ export default function (cloneData) {
3838 . data ( genealogyList )
3939 . enter ( )
4040 . append ( 'g' )
41- . attr ( 'transform' , ( d , i ) => "translate(0," + paddingHeightPerGroup * i + ")" )
42- . on ( 'mouseover' , function ( ) {
43- debugger ;
44- } )
41+ . attr ( 'transform' , ( d , i ) => "translate(0," + paddingHeightPerGroup * i + ")" ) ;
4542
4643 genealogySetGroup . selectAll ( '.changeLine' ) . data ( ( d ) => d . set )
4744 . enter ( )
@@ -84,12 +81,7 @@ export default function (cloneData) {
8481 . append ( 'path' )
8582 . attr ( "class" , 'cloneMarker ' )
8683 . attr ( "d" , symbol ( ) . size ( 375 ) . type ( ( d , i ) => symbolCircle ) )
87- . style ( "fill" , ( d , i ) => {
88- if ( d . cloneType . length > 1 ) {
89- return grayColor ;
90- }
91- else this . remove ( ) ;
92- } )
84+ . style ( "fill" , ( d , i ) => ( d . cloneType . length > 1 ) ? grayColor : 'white' )
9385 . attr ( "transform" , function ( d , i ) {
9486 return "translate(" + ( ( ( width / versionCount ) * i ) + ( width / ( versionCount * 2 ) ) ) + "," + paddingHeightPerGroup + ")" ;
9587 } )
@@ -105,5 +97,7 @@ export default function (cloneData) {
10597 return "translate(" + ( ( ( width / versionCount ) * i ) + ( width / ( versionCount * 2 ) ) - 4 ) + "," + ( paddingHeightPerGroup + 5 ) + ")" ;
10698 } ) ;
10799
100+
101+
108102}
109103
0 commit comments