Last active
May 20, 2023 17:47
-
-
Save C451/362210179fd1c452b4907a8f3e04a252 to your computer and use it in GitHub Desktop.
Converting TVJS overlay to NavyJs with ChatGPT-4 (approx). Prompt Template.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I need to convert trading-vue-js overlay to my new .navy language. Let me show how it should look: | |
```navyjs | |
// Navy ~ 0.1-lite | |
// <ds>Description</ds> | |
[OVERLAY name=OverlayName, ctx=Canvas, verion=1.0.0, author=GPT4] | |
// Define new props (types: number, string, boolean, object ...), e.g.: | |
prop('color', { type: 'color', def: '#31ce31' }) | |
// Local Variables (those defined in data() function), e.g.: | |
let A = null | |
// Draw function | |
draw(ctx) { | |
// this.$props.layout => $core.layout | |
// this.$props.data => $core.dataSubset | |
// t2screen => time2x(t) | |
// $2screen => value2y($) | |
// Access props: $props.color | |
} | |
// mouseup, keydown, keypress, etc. | |
mousedown(event) { } | |
// Returns array of [value, color] pairs | |
legend() => [] | |
``` | |
The overlay i need to port: | |
```tvjs | |
<Your TVJS overlay> | |
``` | |
All computed stuff should be converted to props. Ignore `use_for` and `calc`. `sett` is a reference to props object, ignore it too. It's a hypothetical script, but try to implement all methods. Please don't explain, focus on code. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Write 'Continue' if there is not enough context.