@@ -5,6 +5,9 @@ import { Zoom } from '@visx/zoom';
55import { localPoint } from '@visx/event' ;
66import { RectClipPath } from '@visx/clip-path' ;
77import { scaleLinear } from '@visx/scale' ;
8+ import LegendKey from './legend' ;
9+ import History from './History' ;
10+ // import { hierarchy } from '@visx/hierarchy';
811
912const bg = '' ;
1013const points = [ ...new Array ( 1000 ) ] ;
@@ -21,14 +24,15 @@ const initialTransform = {
2124 skewY : 0 ,
2225} ;
2326
24- export type ZoomIProps = {
25- width : number ;
26- height : number ;
27- } ;
27+ // export type ZoomIProps = {
28+ // width: number;
29+ // height: number;
30+ // };
2831
29- export default function ZoomI ( { width , height } : ZoomIProps ) {
32+ export default function ZoomI ( props : any ) {
3033 const [ showMiniMap , setShowMiniMap ] = useState < boolean > ( true ) ;
31-
34+ // const { width, height, hierarchy, dispatch, sliderIndex, viewIndex } = props;
35+ const { width, height } = props ;
3236 // const genenerator: GenPhyllotaxisFunction = genPhyllotaxis({
3337 // radius: 10,
3438 // width,
@@ -56,18 +60,7 @@ export default function ZoomI({ width, height }: ZoomIProps) {
5660 >
5761 < RectClipPath id = "zoom-clip" width = { width } height = { height } />
5862 < rect width = { width } height = { height } rx = { 14 } fill = { bg } />
59- < g transform = { zoom . toString ( ) } >
60- { phyllotaxis . map ( ( { x, y } , i ) => (
61- // <React.Fragment key={`dot-${i}`}>
62- // <circle
63- // cx={x}
64- // cy={y}
65- // r={i > 500 ? sizeScale(1000 - i) : sizeScale(i)}
66- // // fill={interpolateRainbow(colorScale(i) ?? 0)}
67- // />
68- < / React . Fragment >
69- ))}
70- </ g >
63+ < g transform = { zoom . toString ( ) } > { /* invoke them here */ } </ g >
7164 < rect
7265 width = { width }
7366 height = { height }
@@ -88,38 +81,6 @@ export default function ZoomI({ width, height }: ZoomIProps) {
8881 zoom . scale ( { scaleX : 1.1 , scaleY : 1.1 , point } ) ;
8982 } }
9083 />
91- { showMiniMap && (
92- < g
93- clipPath = "url(#zoom-clip)"
94- transform = { `
95- scale(0.25)
96- translate(${ width * 4 - width - 60 } , ${
97- height * 4 - height - 60
98- } )
99- ` }
100- >
101- < rect width = { width } height = { height } fill = "#1a1a1a" />
102- { phyllotaxis . map ( ( { x, y } , i ) => (
103- // <React.Fragment key={`dot-sm-${i}`}>
104- // <circle
105- // cx={x}
106- // cy={y}
107- // r={i > 500 ? sizeScale(1000 - i) : sizeScale(i)}
108- // // fill={interpolateRainbow(colorScale(i) ?? 0)}
109- // />
110- < / React . Fragment >
111- ))}
112- < rect
113- width = { width }
114- height = { height }
115- fill = "white"
116- fillOpacity = { 0.2 }
117- stroke = "white"
118- strokeWidth = { 4 }
119- transform = { zoom . toStringInvert ( ) }
120- />
121- </ g >
122- ) }
12384 </ svg >
12485 < div className = "controls" >
12586 < button
0 commit comments