spatineo / harvester-seasons-2024

0 stars 0 forks source link

Create HarvesterChart component #10

Open sampov2 opened 1 year ago

sampov2 commented 1 year ago

Create a chart component that is given the timespan (start, end, timestep) and which parameters to show as well as a click handler function and current time. This chart component will:

sampov2 commented 1 year ago

Example usage:

const span = {
  start: 1681776000,
  end: 1697587200,
  timestep: 10080
}

const selectedParameters = [ "HARVIDX{0.4;SOILWET-M3M3:ECBSF::9:7:3:1-50;SOILWET-M3M3:ECBSF::9:7:1:0", "HARVIDX{273;TSOIL-K:ECBSF:::7:3:1-50;TSOIL-K:ECBSF:::7:1:0}" , ... ]

const currentTime = 1692316800

function dostuff(evt) {
   ...
}

return (
  <HarvesterChart starttime={span.start} endtime={span.end} timestep={span.timestep} parameters={selectedParameters} onclick={onclick} currentTime={currentTime} />
)