File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed
src/app/components/StateRoute/ComponentMap Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -248,23 +248,16 @@ export default function ComponentMap({
248248 childPropsLength = Object . keys ( childPropsObj ) . length ;
249249 console . log ( '>> child_props_length: ' , childPropsLength ) ;
250250 }
251- // function Sigmoid (x) {
252- // // alter the shape by changing x0, L and k (see wikipedia)
253- // const x0 = 5;
254- // const L = 25;
255- // const k = .4;
256- // // some costumization for case x <= 0
257- // if (x <= 0) result = 1
258- // else {
259- // let result = -3 + L / (1 + Math.exp(-k * (x - x0)));
260- // }
261- // return result;
262- // }
263- // const strokeWidthIndex = Sigmoid(childPropsLength);
264- const strokeWidthIndex = childPropsLength * 2.5 + 1 ;
251+ // go to https://en.wikipedia.org/wiki/Logistic_function
252+ // for an explanation of Logistic functions and parameters used
253+ const yshift = - 3 ;
254+ const x0 = 5 ;
255+ const L = 25 ;
256+ const k = .4 ;
257+ const strokeWidthIndex = yshift + L / ( 1 + Math . exp ( - k * ( childPropsLength - x0 ) ) ) ;
258+ // const strokeWidthIndex = childPropsLength * 2.5 + 1;
265259 console . log ( 'strokeWidthIndex: ' , strokeWidthIndex ) ;
266260
267-
268261 if ( strokeWidthIndex <= 1 ) {
269262 // strokeWidthIndex = 1;
270263 stroke = '#000000' ;
You can’t perform that action at this time.
0 commit comments