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({
248
248
childPropsLength = Object . keys ( childPropsObj ) . length ;
249
249
console . log ( '>> child_props_length: ' , childPropsLength ) ;
250
250
}
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;
265
259
console . log ( 'strokeWidthIndex: ' , strokeWidthIndex ) ;
266
260
267
-
268
261
if ( strokeWidthIndex <= 1 ) {
269
262
// strokeWidthIndex = 1;
270
263
stroke = '#000000' ;
You can’t perform that action at this time.
0 commit comments