Skip to content

Fix "Now line" example from lambda to filters #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 30, 2023

Conversation

edwardtfn
Copy link
Contributor

The example was broken as it was still using lambdas.

The example was broken as it was still using lambdas.
@dbuezas
Copy link
Owner

dbuezas commented Jan 30, 2023

Thanks!
Now this would also work:

 - entity: ''
    name: Now
    yaxis: y9
    showlegend: false
    line:
      width: 1
      dash: dot
      color: deepskyblue
    x: $fn () => [Date.now(), Date.now()]
    y: $fn () => [0,1]

Which one do you think is a better example?

Let me know and I'll merge or wait a bit :)

@dbuezas
Copy link
Owner

dbuezas commented Jan 30, 2023

Or like this too:

- fn: ({ xs, ys }) => ({ xs: [Date.now(), Date.now()], ys: [0, 1] })

@edwardtfn
Copy link
Contributor Author

I liked both of your suggestions.

@dbuezas
Copy link
Owner

dbuezas commented Jan 30, 2023

Then feel free to apply one to the PR and I'll merge it:)

@dbuezas dbuezas merged commit 4cefbab into dbuezas:master Jan 30, 2023
@edwardtfn
Copy link
Contributor Author

The last option should be formatted as a text, right? Like this:

- fn: "({ xs, ys }) => ({ xs: [Date.now(), Date.now()], ys: [0, 1] })"

Anyways, the first format you shared here worked fine. And it looks nice.

@dbuezas
Copy link
Owner

dbuezas commented Jan 31, 2023

Yes true, not putting the quotes wiill sometimes not work. In any case, I agree the other one is prettier, and also shows a different way of doing it

@dbuezas
Copy link
Owner

dbuezas commented Jan 31, 2023

Welcome to the contribuitors list :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants