File tree Expand file tree Collapse file tree 3 files changed +2
-12
lines changed
Expand file tree Collapse file tree 3 files changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ function App() {
1717 < Container className = "app" >
1818 < PieChart
1919 theme = "dark"
20- data = { fruit }
20+ data = { fruit . sort ( ( a , b ) => a . value - b . value ) }
2121 label = "label"
2222 value = "value"
2323 legend = "top-left"
Original file line number Diff line number Diff line change @@ -159,14 +159,6 @@ export default function LineChart({
159159 // ********************
160160
161161 const numberOfKeys = Array . from ( keys ) . length ;
162- // let discreteColors = 0;
163- // let computedScheme: string[];
164- // if (numberOfKeys > 3) {
165- // discreteColors = Math.min(Array.from(keys).length, 9);
166- // computedScheme = d3[`${colorScheme}`][discreteColors];
167- // } else {
168-
169- // }
170162 const discreteColors =
171163 numberOfKeys < 4 ? 3 : Math . min ( Array . from ( keys ) . length , 9 ) ;
172164 const computedScheme = Array . from (
Original file line number Diff line number Diff line change @@ -148,9 +148,7 @@ export default function PieChart({
148148 const numberOfKeys = Array . from ( keys ) . length ;
149149 const discreteColors =
150150 numberOfKeys < 4 ? 3 : Math . min ( Array . from ( keys ) . length , 9 ) ;
151- const computedScheme = Array . from (
152- d3 [ `${ colorScheme } ` ] [ discreteColors ]
153- ) . reverse ( ) ;
151+ const computedScheme = d3 [ `${ colorScheme } ` ] [ discreteColors ] ;
154152 const colorScale = d3 . scaleOrdinal ( computedScheme ) ;
155153 colorScale . domain ( keys ) ;
156154
You can’t perform that action at this time.
0 commit comments