Skip to content

Commit

Permalink
zoom on scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
gkorland committed Jan 7, 2024
1 parent f8dcae4 commit 828aa3f
Showing 1 changed file with 8 additions and 26 deletions.
34 changes: 8 additions & 26 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,33 +114,8 @@ export default function Home() {
factor.current *= changefactor
let chart = echartRef.current
if (chart) {
// let option = chart.getOption()
// let zoom = factor * option.series[0].zoom
// let edgeSize = factor * option.series[0].edgeLabel.fontSize
// let labelSize = factor * option.series[0].label.fontSize
// let lineWidth = factor * option.series[0].lineStyle.width
// let edgeSymbolSize = factor * option.series[0].edgeSymbolSize
// let symbolSize = factor * option.series[0].symbolSize
let options = getOptions(graph)
chart.setOption(options)
// chart.setOption({
// series: [
// {
// symbolSize,
// edgeSymbolSize,
// edgeLabel: {
// fontSize: edgeSize
// },
// label: {
// fontSize: labelSize
// },
// lineStyle: {
// width: lineWidth
// },
// zoom,
// }
// ]
// })
}
}

Expand All @@ -162,7 +137,14 @@ export default function Home() {
<ReactECharts
option={getOptions(graph)}
style={{ height: '100%', width: '100%' }}
onChartReady={(e) => { echartRef.current = e }}
onChartReady={(e) => {
echartRef.current = e
}}
onEvents={{
graphRoam: (params:any) => {
handleZoomClick(params.zoom)
}
}}
/>
</main>
</section>
Expand Down

0 comments on commit 828aa3f

Please sign in to comment.