File tree Expand file tree Collapse file tree
packages/layerchart/src/routes/docs/examples/RadialLine Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515 export let data;
1616
17- $ : opacityScale = scaleLinear ().domain ([1940 , 2024 ]).range ([0.1 , 0.2 ]);
18- $ : dataByYear = flatGroup (data .dailyTemperatures , (d ) => d .year );
19-
2017 /**
2118 * TODO:
2219 * - [ ] Tooltip (manual with path, radial bisect?). Work with Highlight
2522
2623<h1 >Examples</h1 >
2724
28- <h2 >Line with Area </h2 >
25+ <h2 >Line with Areas </h2 >
2926
3027<Preview data ={data .sfoTemperatures }>
3128 <div class =" h-[500px] p-4 border rounded" >
6461 </div >
6562</Preview >
6663
67- <h2 >Multi line </h2 >
64+ <h2 >Multi-year Lines </h2 >
6865
6966<Preview data ={data .dailyTemperatures }>
7067 <div class =" h-[500px] p-4 border rounded" >
7875 _yRange={({ height }) => [0, height / 2]}
7976 yRange={({ height }) => [height / 5 , height / 2 ]}
8077 yPadding={[0 , 20 ]}
78+ zDomain={[1940 , 2024 ]}
79+ zRange={[0.1 , 0.2 ]}
80+ let:zScale
8181 >
8282 <Svg >
8383 <Group center >
84- {#each dataByYear as [year, yearData]}
84+ {#each flatGroup ( data . dailyTemperatures , ( d ) => d . year ) as [year, yearData]}
8585 <Spline
8686 data ={yearData }
8787 radial
9393 ? ' stroke-primary/50'
9494 : ' stroke-surface-content'
9595 )}
96- opacity ={[2023 , 2024 ].includes (year ) ? 1 : opacityScale (year )}
96+ opacity ={[2023 , 2024 ].includes (year ) ? 1 : zScale (year )}
9797 />
9898 {/each }
9999 <Axis placement ="angle" grid format ={PeriodType .Month } />
You can’t perform that action at this time.
0 commit comments