Skip to content

Compare Outside temperature with Inside temperature after insulation #348

Answered by dbuezas
parrel asked this question in Q&A
Discussion options

You must be logged in to vote

You're getting there! Sorting like this requires extra tricks, you need to first pair the data, then sort the pairs, then separate it back into a usable form

Something like this:

const pairs = vars.inside.ys
   .map((y,i)=> [y, vars.outside.ys[i], vars.outside.xs[i])
   .sort((a,b)=> a[0]-b[0])

const day =  Date("2023-12-01");
const pairsBefore = pairs.filter(([,,date])=> date <day)
const pairsAfter = pairs.filter( ..... > day);

const before = {xs: pairs.map(([x,y])=> x), ys: .....}
const after = ....

// Then put it inside vars and use it inside the two separate traces/entities 

I'm writing this in a phone so you'll have to connect the dots

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@parrel
Comment options

@dbuezas
Comment options

Answer selected by parrel
@dbuezas
Comment options

@parrel
Comment options

@dbuezas
Comment options

@dbuezas
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants