ABTSoftware / SciChart.JS.Examples

MIT License
76 stars 36 forks source link

refactor(examples): replace direct core lib usage with SciChartReact (Style-Animation) #220

Closed dilipt-capitalnumber closed 2 days ago

dilipt-capitalnumber commented 4 weeks ago

To reuse the same chart setup logic we need to extract it to a separate file - drawExample.ts. Usually, the setup logic is contained within a drawExample function. So we need to move it from index.tsx to the drawExample.ts and export it from there. Then to allow the function to be passed to the SciChartReact we need to ensure it has the proper signature for input param and passes it to SciChartSurface.create method.

Also, it should return an object that contains at least the sciChartSurface property

Currently, most of the examples should already return the reference to a surface. Also, they can return other properties that might be used by the consuming code, so should be handled accordingly if so.

codesandbox[bot] commented 4 weeks ago

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview